[Debian-med-packaging] Bug#1013153: camitk: vtk[6,7] removal

Andreas Tille andreas at an3as.eu
Tue Jan 31 10:22:37 GMT 2023


Dear Emmanuel,

could you simply push your patch and we can see the build log in
Salsa CI?

Kind regards
   Andreas.

Am Tue, Jan 31, 2023 at 08:28:12AM +0100 schrieb Emmanuel Promayon:
> Dear Andreas,
> 
> I managed to patch the current CamiTK 5.0.2version  to build with VTK9
> (vtk9-compatibility.patch in attachment).
> 
> The build then stopped with the following error:
> /build/camitk-5.0.2/imaging/components/dicom/DicomComponent.cpp:40:10: fatal
> error: vtkGDCMImageReader.h: No such file or directory
> 
> When this plugin is disabled in d/r (see below), the compilation ends with
> no error, (which is good news!) but all tests failed with the following
> error:
> /build/camitk-5.0.2/camitk-build/bin/camitk-testcomponents: error while
> loading shared libraries: libjawt.so: cannot open shared object file: No
> such file or directory
> 
> This error seems to be linked with a Java installation problem (maybe
> temporary?)
> 
> Let me know what will be the best course of action from this.
> Best regards,
> Emmanuel
> 
> PS: this is the d/r diff to disable the dicom component,
> --- a/debian/rules
> +++ b/debian/rules
> @@ -42,6 +42,7 @@ CMAKE_EXTRA_FLAGS = \
>         -DCEP_IMAGING:BOOL=TRUE \
>         -DCEP_MODELING:BOOL=TRUE \
>         -DCEP_TUTORIALS:BOOL=TRUE \
> +       -DCOMPONENT_DICOM:BOOL=FALSE \
>         \
>         -DAPIDOC_SDK:BOOL=TRUE

> --- a/modeling/actions/mml/GenerateModel.cpp
> +++ b/modeling/actions/mml/GenerateModel.cpp
> @@ -127 +127 @@ void GenerateModel::saveSOFAFile(QString baseFilename) {
> -    ofstream scnFile(SOFAFileName.toUtf8());
> +    std::ofstream scnFile(SOFAFileName.toUtf8());
> @@ -188 +188 @@ void GenerateModel::saveMMLFiles(QString baseFilename) {
> -        ofstream lmlofs(lmlFilename.toStdString().c_str());
> +        std::ofstream lmlofs(lmlFilename.toStdString().c_str());
> @@ -235 +235 @@ void GenerateModel::saveMMLFiles(QString baseFilename) {
> -    ofstream mmlofs(mmlFilename.toStdString().c_str());
> +    std::ofstream mmlofs(mmlFilename.toStdString().c_str());
> @@ -268 +268 @@ void GenerateModel::saveMMLFiles(QString baseFilename) {
> -        ofstream pmlofs(completePmlFilename.toStdString().c_str(), std::ios_base::trunc);
> +        std::ofstream pmlofs(completePmlFilename.toStdString().c_str(), std::ios_base::trunc);
> --- a/modeling/components/mmlcomponent/MMLComponent.cpp
> +++ b/modeling/components/mmlcomponent/MMLComponent.cpp
> @@ -80 +80 @@ MMLComponent::MMLComponent(const QString& fileName) : Component(fileName, QFileI
> -            ofstream ofs(exportedMml.toStdString().c_str());
> +            std::ofstream ofs(exportedMml.toStdString().c_str());
> --- a/sdk/actions/image/multipicking/PickedPixelMap.cpp
> +++ b/sdk/actions/image/multipicking/PickedPixelMap.cpp
> @@ -165 +165 @@ void PickedPixelMap::savePixelList(QString fileName) {
> -    ofstream myFile;
> +    std::ofstream myFile;
> deleted file mode 100644
> Binary files a/sdk/actions/image/volumerendering/resources/Thumbs.db and /dev/null differ
> --- a/sdk/actions/mesh/meshprocessing/MergeMeshs.cpp
> +++ b/sdk/actions/mesh/meshprocessing/MergeMeshs.cpp
> @@ -338 +338 @@ void MergeMeshs::printKToFile() {
> -    ofstream mshFile(fileNeigh.toUtf8());
> +    std::ofstream mshFile(fileNeigh.toUtf8());
> --- a/sdk/actions/mesh/meshprocessing/MeshClipping.cpp
> +++ b/sdk/actions/mesh/meshprocessing/MeshClipping.cpp
> @@ -93,0 +94 @@ QWidget* MeshClipping::getWidget() {
> +#if VTK_MAJOR_VERSION < 9          
> @@ -95 +96,3 @@ QWidget* MeshClipping::getWidget() {
> -
> +#else
> +            vtkRenderWindowInteractor* iren = default3DViewer->getRendererWidget()->renderWindow()->GetInteractor();
> +#endif
> --- a/sdk/applications/imp/main.cpp
> +++ b/sdk/applications/imp/main.cpp
> @@ -107 +107 @@ int main(int argc, char* argv[]) {
> -
> +                
> --- a/sdk/components/msh/MshExtension.cpp
> +++ b/sdk/components/msh/MshExtension.cpp
> @@ -72 +72 @@ bool MshExtension::save(Component* component) const {
> -    ofstream mshFile(meshComp->getFileName().toStdString().c_str());
> +    std::ofstream mshFile(meshComp->getFileName().toStdString().c_str());
> --- a/sdk/components/obj/ObjExtension.cpp
> +++ b/sdk/components/obj/ObjExtension.cpp
> @@ -90 +90 @@ bool ObjExtension::save(camitk::Component* component) const {
> -    ofstream objFile(fileName.toUtf8());
> +    std::ofstream objFile(fileName.toUtf8());
> --- a/sdk/components/off/OffExtension.cpp
> +++ b/sdk/components/off/OffExtension.cpp
> @@ -77 +77 @@ bool OffExtension::save(Component* component) const {
> -    ofstream offFile(offFilename.toUtf8());
> +    std::ofstream offFile(offFilename.toUtf8());
> --- a/sdk/components/vrml/VRMLComponentExtension.cpp
> +++ b/sdk/components/vrml/VRMLComponentExtension.cpp
> @@ -80,0 +81 @@ bool VRMLComponentExtension::save(Component* component) const {
> +#if VTK_MAJOR_VERSION < 9
> @@ -81,0 +83,3 @@ bool VRMLComponentExtension::save(Component* component) const {
> +#else
> +                exporter->SetInput(default3DViewer->getRendererWidget()->renderWindow());
> +#endif
> deleted file mode 100644
> --- a/sdk/libraries/core/viewer/InteractiveViewer.cpp
> +++ b/sdk/libraries/core/viewer/InteractiveViewer.cpp
> @@ -151,0 +152 @@ void InteractiveViewer::init() {
> +#if VTK_MAJOR_VERSION < 9
> @@ -152,0 +154,3 @@ void InteractiveViewer::init() {
> +#else
> +    connector->Connect(rendererWidget->interactor(), vtkCommand::EndPickEvent, this, SLOT(picked()));
> +#endif
> @@ -2056,0 +2061 @@ void InteractiveViewer::picked() {
> +#if VTK_MAJOR_VERSION < 9
> @@ -2057,0 +2063,3 @@ void InteractiveViewer::picked() {
> +#else
> +    vtkSmartPointer<vtkAbstractPropPicker> picker = vtkAbstractPropPicker::SafeDownCast(this->rendererWidget->interactor()->GetPicker());
> +#endif
> @@ -2152,0 +2161 @@ void InteractiveViewer::picked() {
> +#if VTK_MAJOR_VERSION < 9
> @@ -2153,0 +2163,3 @@ void InteractiveViewer::picked() {
> +#else
> +            vtkSmartPointer<vtkCellPicker> cellPicker = vtkCellPicker::SafeDownCast(this->rendererWidget->interactor()->GetPicker());
> +#endif
> @@ -2176,0 +2189 @@ void InteractiveViewer::picked() {
> +#if VTK_MAJOR_VERSION < 9
> @@ -2177,0 +2191,3 @@ void InteractiveViewer::picked() {
> +#else
> +            vtkSmartPointer<vtkRenderedAreaPicker> areaPicker = vtkRenderedAreaPicker::SafeDownCast(this->rendererWidget->interactor()->GetPicker());
> +#endif
> @@ -2198,0 +2215 @@ void InteractiveViewer::picked() {
> +#if VTK_MAJOR_VERSION < 9
> @@ -2199,0 +2217,3 @@ void InteractiveViewer::picked() {
> +#else
> +            vtkSmartPointer<vtkRenderedAreaPicker> areaPicker = vtkRenderedAreaPicker::SafeDownCast(this->rendererWidget->interactor()->GetPicker());
> +#endif
> --- a/sdk/libraries/core/viewer/RendererWidget.cpp
> +++ b/sdk/libraries/core/viewer/RendererWidget.cpp
> @@ -31 +31 @@
> -// // -- QT stuff
> +// -- QT stuff
> @@ -39,0 +40 @@
> +
> @@ -110 +111 @@
> -// Extra classes are required for VTK8
> +// Extra classes are required for VTK8 and up
> @@ -119,3 +119,0 @@ static void initialize() {
> -    // needed to ensure appropriate OpenGL context is created for VTK rendering.
> -    //QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());
> -
> @@ -127,0 +126 @@ static void initialize() {
> +
> @@ -140,0 +140,20 @@ Q_COREAPP_STARTUP_FUNCTION(initialize)
> +
> +#elif VTK_MAJOR_VERSION == 9
> +#include <vtkOpenGLRenderWindow.h>
> +#include <QSurfaceFormat>
> +
> +// On some OpenGL drivers (e.g. Mesa 13), the OpenGL context has to be requested before hand
> +static void initialize() {
> +    CAMITK_TRACE_ALT("Initializing OpenGL Context...");
> +
> +    // recommended: disable multisampling for older version of OpenGL ES
> +    // see for instance how mitk (thank guys!) solved the problem in BaseApplication::getQApplication()
> +    // from Modules/AppUtil/src/mitkBaseApplication.cpp
> +    vtkOpenGLRenderWindow::SetGlobalMaximumNumberOfMultiSamples(0);
> +
> +    auto defaultFormat = QVTKOpenGLStereoWidget::defaultFormat();
> +    defaultFormat.setSamples(0);
> +    QSurfaceFormat::setDefaultFormat(defaultFormat);
> +
> +#ifdef Q_OS_OSX
> +    QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
> @@ -142,0 +162,11 @@ Q_COREAPP_STARTUP_FUNCTION(initialize)
> +    QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
> +}
> +
> +Q_COREAPP_STARTUP_FUNCTION(initialize)
> +
> +
> +
> +#endif
> +
> +
> +
> @@ -154,0 +185,3 @@ RendererWidget::RendererWidget(QWidget * parent, ControlMode mode) : QVTKOpenGLW
> +#elif VTK_MAJOR_VERSION == 9
> +RendererWidget::RendererWidget(QWidget * parent, ControlMode mode) : QVTKOpenGLStereoWidget(parent) {
> +
> @@ -207 +240 @@ RendererWidget::RendererWidget(QWidget * parent, ControlMode mode) : QVTKOpenGLW
> -    CAMITK_TRACE("---------------------------------------------------------------------\n")
> +    CAMITK_TRACE("-----------------------------------\n")
> @@ -243 +276 @@ RendererWidget::RendererWidget(QWidget * parent, ControlMode mode) : QVTKOpenGLW
> -#elif VTK_MAJOR_VERSION == 8
> +#elif VTK_MAJOR_VERSION >= 8
> @@ -255,0 +289,3 @@ RendererWidget::RendererWidget(QWidget * parent, ControlMode mode) : QVTKOpenGLW
> +    //-- renderer
> +    renderer = vtkSmartPointer<vtkRenderer>::New();
> +
> @@ -256,0 +293,3 @@ RendererWidget::RendererWidget(QWidget * parent, ControlMode mode) : QVTKOpenGLW
> +#if VTK_MAJOR_VERSION >= 9
> +    vtkSmartPointer<vtkRenderWindow> renderWindow = QVTKOpenGLStereoWidget::renderWindow();
> +#else
> @@ -257,0 +297 @@ RendererWidget::RendererWidget(QWidget * parent, ControlMode mode) : QVTKOpenGLW
> +#endif
> @@ -259,3 +299 @@ RendererWidget::RendererWidget(QWidget * parent, ControlMode mode) : QVTKOpenGLW
> -    //-- renderer
> -    renderer = vtkSmartPointer<vtkRenderer>::New();
> -#if VTK_MAJOR_VERSION == 8
> +#if VTK_MAJOR_VERSION >= 8
> @@ -268,0 +307,3 @@ RendererWidget::RendererWidget(QWidget * parent, ControlMode mode) : QVTKOpenGLW
> +
> +    renderWindow->SetMultiSamples(0); // no MSAA as it is incompatible with depth peeling
> +    renderWindow->SetAlphaBitPlanes(1); // Necessary for depth peeling
> @@ -273,3 +314,3 @@ RendererWidget::RendererWidget(QWidget * parent, ControlMode mode) : QVTKOpenGLW
> -    interactor = vtkSmartPointer<QVTKInteractor>::New();
> -    interactor->SetRenderWindow(renderWindow);
> -    renderWindow->SetInteractor(interactor);
> +    renderWindowInteractor = vtkSmartPointer<QVTKInteractor>::New();
> +    renderWindowInteractor->SetRenderWindow(renderWindow);
> +    renderWindow->SetInteractor(renderWindowInteractor);
> @@ -287 +328 @@ RendererWidget::RendererWidget(QWidget * parent, ControlMode mode) : QVTKOpenGLW
> -    interactor->Initialize();
> +    renderWindowInteractor->Initialize();
> @@ -454 +495 @@ RendererWidget::RendererWidget(QWidget * parent, ControlMode mode) : QVTKOpenGLW
> -    logoWidget->SetInteractor(interactor);
> +    logoWidget->SetInteractor(renderWindowInteractor);
> @@ -472 +513 @@ RendererWidget::RendererWidget(QWidget * parent, ControlMode mode) : QVTKOpenGLW
> -    colorBarWidget->SetInteractor(interactor);
> +    colorBarWidget->SetInteractor(renderWindowInteractor);
> @@ -583,0 +625,6 @@ void RendererWidget::screenshot(QString filename) {
> +#if VTK_MAJOR_VERSION >= 9
> +        vtkSmartPointer<vtkRenderWindow> currentRenderWindow = QVTKOpenGLStereoWidget::renderWindow();
> +#else
> +        vtkSmartPointer<vtkRenderWindow> currentRenderWindow = GetRenderWindow();
> +#endif
> +
> @@ -593 +640 @@ void RendererWidget::screenshot(QString filename) {
> -        exporter->SetInput(GetRenderWindow());
> +        exporter->SetInput(currentRenderWindow);
> @@ -606 +653 @@ void RendererWidget::screenshot(QString filename) {
> -            imageFilter->SetInput(GetRenderWindow());
> +            imageFilter->SetInput(currentRenderWindow);
> @@ -621 +668 @@ void RendererWidget::screenshot(QString filename) {
> -                gl2psExporter->SetInput(GetRenderWindow());
> +                gl2psExporter->SetInput(currentRenderWindow);
> @@ -631 +678,2 @@ void RendererWidget::refresh() {
> -    // QVTKOpenGLWidget now relies on VTK applications calling `Render` on the window when data or rendering has changed.
> +    // QVTKOpenGLWidget and QVTKOpenGLNativeWidget relies on VTK applications 
> +    // calling `Render` on the window when data or rendering has changed.
> @@ -632,0 +681,2 @@ void RendererWidget::refresh() {
> +#elif VTK_MAJOR_VERSION == 9
> +    renderWindow()->Render();
> @@ -638 +687,0 @@ void RendererWidget::refresh() {
> -
> @@ -649 +698 @@ void RendererWidget::getBackgroundColor(double& r, double& g, double& b) {
> -//--------------------- getGradientBackground --------------
> +//--------------------- getGradientBackground ---------------------
> @@ -654 +703 @@ bool RendererWidget::getGradientBackground() {
> -//--------------------- setGradientBackground --------------
> +//--------------------- setGradientBackground ---------------------
> @@ -669 +718 @@ void RendererWidget::setGradientBackground(bool gb) {
> -//--------------------- toogle3DRedBlue --------------
> +//--------------------- toogle3DRedBlue ---------------------
> @@ -671,0 +721,5 @@ void RendererWidget::toogle3DRedBlue() {
> +#if VTK_MAJOR_VERSION >= 9
> +        vtkSmartPointer<vtkRenderWindow> renderWindow = QVTKOpenGLStereoWidget::renderWindow();
> +#else
> +        vtkSmartPointer<vtkRenderWindow> renderWindow = GetRenderWindow();
> +#endif
> @@ -675,4 +729,4 @@ void RendererWidget::toogle3DRedBlue() {
> -        GetRenderWindow()->StereoCapableWindowOn();
> -        GetRenderWindow()->SetStereoTypeToRedBlue();
> -        GetRenderWindow()->StereoRenderOn(); //On();
> -        GetRenderWindow()->StereoUpdate();
> +        renderWindow->StereoCapableWindowOn();
> +        renderWindow->SetStereoTypeToRedBlue();
> +        renderWindow->StereoRenderOn(); //On();
> +        renderWindow->StereoUpdate();
> @@ -681,2 +735,2 @@ void RendererWidget::toogle3DRedBlue() {
> -        GetRenderWindow()->StereoRenderOff(); //On();
> -        GetRenderWindow()->StereoUpdate();
> +        renderWindow->StereoRenderOff(); //On();
> +        renderWindow->StereoUpdate();
> @@ -686 +740 @@ void RendererWidget::toogle3DRedBlue() {
> -//--------------------- toggleLogo --------------
> +//--------------------- toggleLogo ---------------------
> @@ -691,0 +746 @@ void RendererWidget::toggleLogo(bool c) {
> +//--------------------- setAreaPicking ---------------------
> @@ -696 +751 @@ void RendererWidget::setAreaPicking(bool areaPicking) {
> -// --------------------- getControlMode ----------------------------
> +// --------------------- getControlMode ---------------------
> @@ -701 +756 @@ RendererWidget::ControlMode RendererWidget::getControlMode() const {
> -// --------------------- setControlMode ----------------------------
> +// --------------------- setControlMode ---------------------
> @@ -724 +779 @@ void RendererWidget::setControlMode(ControlMode mode) {
> -        interactor->SetInteractorStyle(controlInteractorStyle);
> +        renderWindowInteractor->SetInteractorStyle(controlInteractorStyle);
> @@ -729,0 +785 @@ void RendererWidget::setControlMode(ControlMode mode) {
> +// --------------------- startPicking ---------------------
> @@ -731 +787 @@ void RendererWidget::startPicking() {
> -    interactor->SetInteractorStyle(pickInteractorStyle);
> +    renderWindowInteractor->SetInteractorStyle(pickInteractorStyle);
> @@ -734,0 +791 @@ void RendererWidget::startPicking() {
> +// --------------------- endPicking ---------------------
> @@ -736 +793 @@ void RendererWidget::endPicking() {
> -    interactor->SetInteractorStyle(controlInteractorStyle);
> +    renderWindowInteractor->SetInteractorStyle(controlInteractorStyle);
> @@ -740 +797 @@ void RendererWidget::endPicking() {
> -// --------------------- pick -----------------------------------
> +// --------------------- pick ---------------------
> @@ -751 +808 @@ void RendererWidget::pick() {
> -// --------------------- pickActor -----------------------------------
> +// --------------------- pickActor ---------------------
> @@ -754 +811,9 @@ void RendererWidget::pickActor(int, int) {
> -    vtkSmartPointer<vtkPicker> picker = vtkPicker::SafeDownCast(GetInteractor()->GetPicker());
> +#if VTK_MAJOR_VERSION >= 9    
> +    vtkSmartPointer<QVTKInteractor> currentInteractor = interactor();
> +    // get the current renderer for picking
> +    renderer = interactor()->FindPokedRenderer(currentInteractor->GetEventPosition()[0], currentInteractor->GetEventPosition()[1]);
> +#else
> +    vtkSmartPointer<QVTKInteractor> currentInteractor = GetInteractor();
> +    // get the current renderer for picking
> +    renderer = GetInteractor()->FindPokedRenderer(currentInteractor->GetEventPosition()[0], currentInteractor->GetEventPosition()[1]);
> +#endif
> @@ -755,0 +821 @@ void RendererWidget::pickActor(int, int) {
> +    vtkSmartPointer<vtkPicker> picker = vtkPicker::SafeDownCast(currentInteractor->GetPicker());
> @@ -760,3 +825,0 @@ void RendererWidget::pickActor(int, int) {
> -    // get the current renderer for picking
> -    renderer = GetInteractor()->FindPokedRenderer(GetInteractor()->GetEventPosition()[0], GetInteractor()->GetEventPosition()[1]);
> -
> @@ -764,2 +827,2 @@ void RendererWidget::pickActor(int, int) {
> -    int picked = picker->Pick(GetInteractor()->GetEventPosition()[0],
> -                              GetInteractor()->GetEventPosition()[1],
> +    int picked = picker->Pick(currentInteractor->GetEventPosition()[0],
> +                              currentInteractor->GetEventPosition()[1],
> @@ -767 +830 @@ void RendererWidget::pickActor(int, int) {
> -                              GetInteractor()->GetRenderWindow()->GetRenderers()->GetFirstRenderer());
> +                              currentInteractor->GetRenderWindow()->GetRenderers()->GetFirstRenderer());
> @@ -778 +841 @@ void RendererWidget::pickActor(int, int) {
> -// ----------------------- setBackfaceCulling -----------------------------
> +// ----------------------- setBackfaceCulling ----------------------
> @@ -800 +863 @@ bool RendererWidget::getBackfaceCulling() const {
> -// --------------- setCameraOrientation ------------------------------------------------
> +// --------------------- setCameraOrientation ---------------------
> @@ -805 +868 @@ void RendererWidget::setCameraOrientation(RendererWidget::CameraOrientation a) {
> -// --------------- getCameraOrientation ------------------------------------------------
> +// --------------------- getCameraOrientation ---------------------
> @@ -814 +877 @@ void RendererWidget::setLightFollowCamera(bool lightFollow) {
> -    interactor->LightFollowCameraOff(); // legacy
> +    renderWindowInteractor->LightFollowCameraOff(); // legacy
> @@ -933 +996 @@ bool RendererWidget::getColorScale() const {
> -//------------------------- setColorScaleMinMax ----------------------------
> +//------------------------- setColorScaleMinMax ---------------------
> @@ -942 +1005 @@ void RendererWidget::setColorScaleMinMax(double min, double max) {
> -//------------------------- setColorScaleTitle ----------------------------
> +//------------------------- setColorScaleTitle ---------------------
> @@ -982,3 +1045,2 @@ void RendererWidget::addProp(vtkSmartPointer<vtkProp> prop, bool refresh) {
> -        if (refresh)
> -            // update axes size
> -        {
> +        // update axes size
> +        if (refresh) {
> @@ -1001,3 +1063,2 @@ void RendererWidget::removeProp(vtkSmartPointer<vtkProp> prop, bool refresh) {
> -        if (refresh)
> -            // update axes size
> -        {
> +        // update axes size
> +        if (refresh) {
> @@ -1009 +1070 @@ void RendererWidget::removeProp(vtkSmartPointer<vtkProp> prop, bool refresh) {
> -// --------------------- actorTransform --------------------------------
> +// --------------------- actorTransform -------------------------
> @@ -1112 +1173 @@ void RendererWidget::rotateCamera(double angle, int axe) {
> -// --------------------- keyPressEvent --------------------------------
> +// --------------------- keyPressEvent -------------------------
> @@ -1120 +1181,2 @@ void RendererWidget::keyPressEvent(QKeyEvent* event) {
> -//--------------------- mousePressEvent ----------------------------------
> +
> +//--------------------- mousePressEvent ---------------------------
> @@ -1122,2 +1184,2 @@ void RendererWidget::mousePressEvent(QMouseEvent* event) {
> -    if ((QApplication::keyboardModifiers() == Qt::ControlModifier) &&
> -            (event->button() == Qt::LeftButton)) {
> +    
> +    if (QApplication::keyboardModifiers() == Qt::ControlModifier && event->button() == Qt::LeftButton) {
> @@ -1126 +1187,0 @@ void RendererWidget::mousePressEvent(QMouseEvent* event) {
> -
> @@ -1140,0 +1202,3 @@ void RendererWidget::mousePressEvent(QMouseEvent* event) {
> +
> +#elif VTK_MAJOR_VERSION == 9
> +        QVTKOpenGLStereoWidget::mousePressEvent(event);
> @@ -1144,0 +1209 @@ void RendererWidget::mousePressEvent(QMouseEvent* event) {
> +
> @@ -1147 +1212 @@ void RendererWidget::mousePressEvent(QMouseEvent* event) {
> -//--------------------- mouseReleaseEvent ----------------------------------
> +//--------------------- mouseReleaseEvent ---------------------------
> @@ -1148,0 +1214 @@ void RendererWidget::mouseReleaseEvent(QMouseEvent* event) {
> +
> @@ -1156,0 +1223,4 @@ void RendererWidget::mouseReleaseEvent(QMouseEvent* event) {
> +
> +#elif VTK_MAJOR_VERSION == 9
> +    QVTKOpenGLStereoWidget::mouseReleaseEvent(event);
> +
> @@ -1163 +1233 @@ void RendererWidget::mouseReleaseEvent(QMouseEvent* event) {
> -// --------------------- mouseMoveEvent ----------------------------------
> +// --------------------- mouseMoveEvent ---------------------------
> @@ -1164,0 +1235 @@ void RendererWidget::mouseMoveEvent(QMouseEvent* event) {
> +  
> @@ -1180,0 +1252,3 @@ void RendererWidget::mouseMoveEvent(QMouseEvent* event) {
> +#elif VTK_MAJOR_VERSION == 9    
> +    QVTKOpenGLStereoWidget::mouseMoveEvent(event);
> +
> @@ -1184 +1257,0 @@ void RendererWidget::mouseMoveEvent(QMouseEvent* event) {
> -}
> @@ -1185,0 +1259 @@ void RendererWidget::mouseMoveEvent(QMouseEvent* event) {
> +}
> @@ -1272,0 +1347,3 @@ void RendererWidget::getMouse3DCoordinates(double& x, double& y, double& z) {
> +#if VTK_MAJOR_VERSION >= 9    
> +    renderer = interactor()->FindPokedRenderer(cursor_pos.x(), cursor_pos.y());
> +#else
> @@ -1273,0 +1351 @@ void RendererWidget::getMouse3DCoordinates(double& x, double& y, double& z) {
> +#endif
> @@ -1286,0 +1365,6 @@ void RendererWidget::setPicker(vtkSmartPointer<vtkAbstractPropPicker> woodyWood)
> +#if VTK_MAJOR_VERSION >= 9    
> +    if (interactor()) {
> +        // I know, it is really Woody Wood Pecker, but you know, with a french accent...
> +        interactor()->SetPicker(woodyWood);
> +    }
> +#else
> @@ -1290,0 +1375 @@ void RendererWidget::setPicker(vtkSmartPointer<vtkAbstractPropPicker> woodyWood)
> +#endif  
> --- a/sdk/libraries/core/viewer/RendererWidget.h
> +++ b/sdk/libraries/core/viewer/RendererWidget.h
> @@ -57,0 +58,3 @@
> +#elif VTK_MAJOR_VERSION == 9
> +#include <QVTKOpenGLStereoWidget.h>
> +
> @@ -111,0 +115,3 @@ class CAMITK_API RendererWidget : public QVTKOpenGLWidget {
> +#elif VTK_MAJOR_VERSION == 9
> +class CAMITK_API RendererWidget : public QVTKOpenGLStereoWidget {
> +
> @@ -287 +292,0 @@ public :
> -
> @@ -378 +383 @@ protected :
> -    vtkSmartPointer<QVTKInteractor> interactor;
> +    vtkSmartPointer<QVTKInteractor> renderWindowInteractor;
> @@ -383,3 +387,0 @@ protected :
> -    ///// current interaction mode
> -    //InteractionMode interactionMode;
> -
> --- a/tutorials/actions/vtkwidget/BoxWidget.cpp
> +++ b/tutorials/actions/vtkwidget/BoxWidget.cpp
> @@ -82,0 +83 @@ QWidget* BoxWidget::getWidget() {
> +#if VTK_MAJOR_VERSION < 9
> @@ -83,0 +85,3 @@ QWidget* BoxWidget::getWidget() {
> +#else
> +            vtkRenderWindowInteractor* iren = default3DViewer->getRendererWidget()->renderWindow()->GetInteractor();
> +#endif
> --- a/tutorials/actions/vtkwidget/ContourWidget.cpp
> +++ b/tutorials/actions/vtkwidget/ContourWidget.cpp
> @@ -220,0 +221 @@ void ContourWidget::initContour() {
> +#if VTK_MAJOR_VERSION < 9
> @@ -221,0 +223,3 @@ void ContourWidget::initContour() {
> +#else
> +            interactor = dynamic_cast<InteractiveSliceViewer*>(Application::getViewer("Coronal Viewer"))->getRendererWidget()->renderWindow()->GetInteractor();
> +#endif
> @@ -225,0 +230 @@ void ContourWidget::initContour() {
> +#if VTK_MAJOR_VERSION < 9
> @@ -226,0 +232,3 @@ void ContourWidget::initContour() {
> +#else
> +                interactor = dynamic_cast<InteractiveSliceViewer*>(Application::getViewer("Sagittal Viewer"))->getRendererWidget()->renderWindow()->GetInteractor();
> +#endif
> @@ -229,0 +238 @@ void ContourWidget::initContour() {
> +#if VTK_MAJOR_VERSION < 9
> @@ -230,0 +240,3 @@ void ContourWidget::initContour() {
> +#else
> +                interactor = dynamic_cast<InteractiveSliceViewer*>(Application::getViewer("Axial Viewer"))->getRendererWidget()->renderWindow()->GetInteractor();
> +#endif


-- 
http://fam-tille.de



More information about the Debian-med-packaging mailing list