]> Creatis software - creaMaracasVisu.git/commitdiff
#3109 creaMaracasVisu Bug New Normal - branch vtk7itk4 compilation with vtk7
authorEduardo DAVILA <davila@localhost.localdomain>
Thu, 10 Aug 2017 13:37:26 +0000 (15:37 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Thu, 10 Aug 2017 13:37:26 +0000 (15:37 +0200)
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkmyPWCallback_3DPointWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkmyPWCallback_3DPointWidget.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DViewCntrlPanel.cxx

index 68f8c2b75f5fa08e0e83ec3a3cbc1ccd4155f3f9..2ecbb5d2e533b2cf57c44139778bcf74fab680c7 100644 (file)
@@ -262,7 +262,6 @@ void vtkClipping3DDataViewer::Configure_Tissue()
                _tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() );
 #else
                _tissueClipper[i]->SetInputData( _tissueStripper[i]->GetOutput() );
-               printf("EED vtkClipping3DDataViewer::Configure_Tissue Update\n");
                _tissueClipper[i]->Update();
 #endif
 
index c82d0d8a3467b03f2e5b2bf2dc693fa68801b939..1d202777ff92679d0b8579588a9db37a876bb010 100644 (file)
@@ -46,6 +46,14 @@ void vtkmyPWCallback_3DPointWidget::Execute(vtkObject *caller, unsigned long, vo
                _planeWidget->GetCenter(p);
                _planeWidget->GetNormal(n);
                _wxvtkmpr3Dview->GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->SetNormal(n[0],n[1],n[2]);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+               //..
+#else
+               _planeWidget->GetPolyData(_vtkplane);
+               _probe->Update();
+#endif
+
        }
 
        double spc[3];
@@ -100,3 +108,17 @@ void vtkmyPWCallback_3DPointWidget::SetVtkPlaneWidget( vtkPlaneWidget *planeWidg
        _planeWidget=planeWidget;
 }
 
+//-------------------------------------------------------------------
+ void vtkmyPWCallback_3DPointWidget::SetVtkPolyData( vtkPolyData *vtkplane)
+{
+       _vtkplane=vtkplane;
+}
+
+//-------------------------------------------------------------------
+void vtkmyPWCallback_3DPointWidget::SetVtkProbeFilter( vtkProbeFilter *probe)
+{
+       _probe=probe;
+}
+
+
+
index 465e9ca8693571688303302581a6ee8167960dad..85de5dcfb3859fbbe3bcfd620c9196a456d97533 100644 (file)
@@ -43,13 +43,20 @@ public:
   void SetWxVtkMPR3DView( wxVtkMPR3DView *wxvtkmpr3Dview );
   void SetVtkPointWidget( vtkPointWidget *pointWidget );
   void SetVtkPlaneWidget( vtkPlaneWidget *planeWidget );
+
+  void SetVtkPolyData( vtkPolyData *vtkplane);
+  void SetVtkProbeFilter( vtkProbeFilter *probe);
+
 private:
 
        double                                                  _backNormal[3];
        vtkPlaneWidget                                  *_planeWidget;
+
        vtkPointWidget                                  *_pointWidget;
-       wxVtkMPR3DView *_wxvtkmpr3Dview;
+       vtkPolyData                                             *_vtkplane;
+       vtkProbeFilter                                  *_probe;
+               
+       wxVtkMPR3DView                                  *_wxvtkmpr3Dview;
 };
 
-
 #endif /*VTKMYPWCALLBACK_3DPOINTWIDGET_H_*/
index eae1fb6086b8a31aaa7a0a3599c3d1bdc3f10129..87b4fa3d909c507d49fb273a68eb6e5db4f79b17 100644 (file)
@@ -56,14 +56,14 @@ wxVtkMPR2DView::wxVtkMPR2DView( wxWindow *parent, int direction)
 //-------------------------------------------------------------------
 wxVtkMPR2DView::~wxVtkMPR2DView()
 {
-       if (_ptsA!=NULL)            { _ptsA                 -> Delete(); }
-       if (_lineAActor!=NULL)  { _lineAActor   -> Delete(); }
-       if (_lineAMapper!=NULL) { _lineAMapper  -> Delete(); }
-       if (_pdA!=NULL)             { _pdA                  -> Delete(); }
-       if (_ptsB!=NULL)            { _ptsB                 -> Delete(); }
-       if (_lineBActor!=NULL)  { _lineBActor   -> Delete(); }
-       if (_lineBMapper!=NULL) { _lineBMapper  -> Delete(); }
-       if (_pdB!=NULL)             { _pdB                  -> Delete(); }
+       if (_ptsA!=NULL)            { _ptsA->Delete();                  }
+       if (_lineAActor!=NULL)  { _lineAActor->Delete();        }
+       if (_lineAMapper!=NULL) { _lineAMapper->Delete();       }
+       if (_pdA!=NULL)             { _pdA->Delete();                   }
+       if (_ptsB!=NULL)            { _ptsB->Delete();                  }
+       if (_lineBActor!=NULL)  { _lineBActor->Delete();        }
+       if (_lineBMapper!=NULL) { _lineBMapper->Delete();       }
+       if (_pdB!=NULL)             { _pdB->Delete();                   }
 }
 //-------------------------------------------------------------------
 vtkMPRBaseData *wxVtkMPR2DView::GetVtkmprbasedata()
@@ -360,6 +360,15 @@ void wxVtkMPR2DView::Refresh()
                                
                                
                        } // if back
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+                               // ..
+#else
+                               _ptsA->Modified();
+                               _ptsB->Modified();
+#endif
+
                        _backX=xx;
                        _backY=yy;
                        _backZ=zz;
index 11e0030810ee30ea7dd14678704779236837eeba..7a66d83d0a963ad797aed221182a3485923c2548 100644 (file)
@@ -47,7 +47,6 @@ public:
                        vtkMPRBaseData  *GetVtkmprbasedata();
        virtual int                             GetActualSlice();
        virtual void                    SetActualSlice(int slice);
-
                        bool                    IfMouseTouchX(double x, double y, double z);
                        bool                    IfMouseTouchY(double x, double y, double z);
                        bool                    IfMouseTouchZ(double x, double y, double z);
@@ -56,20 +55,14 @@ public:
                        void                    MoveZ(double x, double y, double z);
                        void                    ChangeAxisColor(double x, double y, double z);
        virtual void                    TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection=false, int type=2);
-
                        void                    SetVisibleAxis(bool ok);
     virtual int             GetDirection();
 
-
-
 private:
-
        int                                                     _backX;
        int                                                     _backY;
        int                                                     _backZ;
-
        bool                                            _visibleAxis;
-
        int                                                     _direction;
        vtkPoints                                       *_ptsA;
        vtkActor                                        *_lineAActor;
@@ -83,5 +76,4 @@ private:
        vtkInteractorStyleMPRView       *_interactorstylemprview;
 };
 
-
 #endif /*WXVTKMPR2DVIEW_H_*/
index a55a101ec4311dce7ce0ebf69a6ae8d80efe0425..d6fb6a53eebbe33672756b43486172ed03026a83 100644 (file)
@@ -186,36 +186,16 @@ void wxVtkMPR3DView::RemoveActor(vtkActor* actor)
 void wxVtkMPR3DView::Configure()
 {
        vtkImageData *imageData = GetVtkMPR3DDataViewer()->GetVtkMPRBaseData()->GetImageData();
-
        _wxvtk3Dbaseview->Configure();
        _wxvtkmpr3DviewCntrlPanel->UpdateControlPanel();
-
-//EED 27 Mai 2009
-//     _wxvtk3Dbaseview->GetRenderer()->Clear();
-
        // Actors are added to the renderer.
        vtkActor* _outlineActor = _vtkmpr3Ddataviewer->GetOutlineActor();
-
-
        _wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
-
-//     _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(0)  );    // _saggital
-//     _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(1)  );    // _axial
-//     _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(2)  );    // _coronal
-
-
-       
-       // vtkPointWidget
-       //if(_myCallback!=NULL){
-               //_myCallback->Delete();
-
-       //}
        vtkmyPWCallback_3DPointWidget *_myCallback = vtkmyPWCallback_3DPointWidget::New();
        _myCallback->SetWxVtkMPR3DView(this);
-
-
        if(imageData){
-               if(_pointWidget==NULL){
+               if(_pointWidget==NULL)
+               {
                        _pointWidget = vtkPointWidget::New();
                }
 //EED 2017-01-01 Migration VTK7
@@ -258,18 +238,21 @@ void wxVtkMPR3DView::Configure()
                _planeWidget->PlaceWidget( px-dd , px+dd , py-dd , py+dd , pz-dd , pz+dd );
 
                if(_vtkplane==NULL){
-                       _vtkplane = vtkPolyData::New();
-
-                       _probe = vtkProbeFilter::New();
-                       _contourMapper = vtkPolyDataMapper::New();
-
+                       _vtkplane               = vtkPolyData::New();
+                       _probe                  = vtkProbeFilter::New();
+                       _contourMapper  = vtkPolyDataMapper::New();
 
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
                        _probe->SetInput(_vtkplane);
                        _contourMapper->SetInput( _probe->GetPolyDataOutput() );
 #else
+                       _myCallback->SetVtkPolyData(_vtkplane);
+                       _myCallback->SetVtkProbeFilter(_probe);
+                       _planeWidget->GetPolyData(_vtkplane);
                        _probe->SetInputData(_vtkplane);
+                       _probe->SetSourceData(imageData);
+//                     _probe->Update();
                        _contourMapper->SetInputData( _probe->GetPolyDataOutput() );
 #endif
 
@@ -611,6 +594,12 @@ void wxVtkMPR3DView::RefreshView()   // virtual
                _planeWidget->SetCenter( x,y,z );
                _planeWidget->UpdatePlacement();
                _planeWidget->GetPolyData(_vtkplane);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+               // ..
+#else
+               _probe->Update();
+#endif
        }
 
        if (_wxvtkmpr3DviewCntrlPanel!=NULL)
@@ -690,9 +679,9 @@ void wxVtkMPR3DView::VisibleImageActor(int idPosition, bool visible){
                        // step 5 Refresh
                        _wxvtk3Dbaseview->GetRenderer()->GetRenderWindow()->Render();
 
-               }
+               } // if visible
                _vtkmpr3Ddataviewer->SetVisiblePosition(idPosition,visible);
-       }
+       } // if visible 
 }
 
 
@@ -705,8 +694,8 @@ void wxVtkMPR3DView::VisiblePointWidget( bool visible )
                        _pointWidget->On();
                } else {
                        _pointWidget->Off();
-               }
-       }
+               } // visible
+       } // _pointWidget
 }
 
 //-------------------------------------------------------------------
@@ -720,9 +709,10 @@ void wxVtkMPR3DView::VisiblePlaneWidget( bool visible )
 
                } else {
                        _planeWidget->Off();
-                       _contourPlaneActor->VisibilityOff();
-               }
-       }
+                       _contourPlaneActor->VisibilityOff();                    
+               } // if visible
+               _wxvtk3Dbaseview->GetRenderer()->GetRenderWindow()->Render();
+       } // _planeWidget
 }
 
 //CPR: Method added 30 Nov 2009
@@ -733,11 +723,9 @@ void wxVtkMPR3DView::showOutlineActor(bool value)
        if(value == true)
        {
                _wxvtk3Dbaseview->GetRenderer()->AddActor( _outlineActor );
-       }
-       else
-       {
+       } else {
                _wxvtk3Dbaseview->GetRenderer()->RemoveActor( _outlineActor );
-       }
+       } // value
 
 }
 
index a46afe60ab19da8ac925ed683915fa7629dbd034..4d42b26342bcdebb9ca990a465bd4d7d10e3bfbc 100644 (file)
@@ -76,7 +76,6 @@ public:
 
        void setColorTransferFunction(vtkColorTransferFunction* colortable);
 
-       
        //Free planes
        //-------------------------------------------------------------------
        void ConfigureFreePlanes();
@@ -88,7 +87,6 @@ public:
        void SetColorWindow(double colorWindow);
        void SetColorLevel(double colorLevel);
 
-       
 private:
        wxVtk3DBaseView                                 *_wxvtk3Dbaseview;
        vtkMPR3DDataViewer                              *_vtkmpr3Ddataviewer;
@@ -106,11 +104,10 @@ private:
        vtkPolyDataMapper                               *_contourMapper;
 
        //Free planes
-       vtkImagePlaneWidget *_planeWidgetX;
-       vtkImagePlaneWidget *_planeWidgetY;
-       vtkImagePlaneWidget *_planeWidgetZ;
+       vtkImagePlaneWidget                     *_planeWidgetX;
+       vtkImagePlaneWidget                     *_planeWidgetY;
+       vtkImagePlaneWidget                     *_planeWidgetZ;
        
-
 protected:
 };
 
index 790d3bc01c7b708f97561878cd7e7e2157a18db2..b07233c849e80545fcdbc5985e5a4062c4a20df1 100644 (file)
@@ -568,7 +568,6 @@ void wxVtkMPR3DViewCntrlPanel::OnVisibleAxisXYZ(wxCommandEvent& event)
 void wxVtkMPR3DViewCntrlPanel::OnVisiblePlane(wxCommandEvent& event)
 {
        _wxvtkmpr3Dview->VisiblePlaneWidget(event.IsChecked());
-
 }
 
 //-------------------------------------------------------------------