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

index 9c3760aea88a0b4b5d74ea7e1140dd4ecc22177a..36e9c9b11e9da5d6d1d4ed84f6246e8f0725f127 100644 (file)
@@ -31,6 +31,14 @@ void boxSurfaceObserver::Execute(vtkObject *wdg, unsigned long eventId, void* ca
        vtkBoxWidget *boxwidget = reinterpret_cast<vtkBoxWidget*>(wdg);
        boxwidget->GetPlanes(_planes);
 
+       if ((_mCubes!=NULL)&&(_tissueStripper!=NULL)&&(_tissueClipper!=NULL))
+       {
+                       _mCubes->Update();
+                       _tissueStripper->Update();
+                       _tissueClipper->Update();
+       } // if surface
+
+
        if ( _vtkVolumeRayCastMapper != NULL )
        {
                _vtkVolumeRayCastMapper->RemoveAllClippingPlanes();
@@ -38,7 +46,8 @@ void boxSurfaceObserver::Execute(vtkObject *wdg, unsigned long eventId, void* ca
 //             boxwidget->GetPlanes(planes);
 //             _vtkVolumeRayCastMapper->SetClippingPlanes(planes);
                _vtkVolumeRayCastMapper->SetClippingPlanes(_planes);
-       }
+       } // if volume
+
 
 //     _actor->VisibilityOn();
 
@@ -57,3 +66,14 @@ void boxSurfaceObserver::SetvtkVolumeRayCastMapper(vtkVolumeRayCastMapper *vtkvo
 {
        _vtkVolumeRayCastMapper = vtkvolumeraycastmapper;
 }
+
+//-------------------------------------------------------------------
+void boxSurfaceObserver::SetFilters(vtkAlgorithm *mCubes , vtkAlgorithm *tissueStripper , vtkAlgorithm *tissueClipper)
+{
+       _mCubes                 = mCubes;
+       _tissueStripper = tissueStripper;
+       _tissueClipper  = tissueClipper;
+
+
+}
+
index 11e4d591ac221ac662a473e05d0715761acd8199..92892da6461affbc389f52313b7d48ac5955ebd6 100644 (file)
@@ -39,10 +39,17 @@ class boxSurfaceObserver : public vtkCommand
        public:
                vtkPlanes                                       *_planes;
                vtkProp                                         *_actor;
+
+               vtkAlgorithm                            *_mCubes;
+               vtkAlgorithm                            *_tissueStripper;
+               vtkAlgorithm                            *_tissueClipper;
                vtkVolumeRayCastMapper          *_vtkVolumeRayCastMapper;
 
                boxSurfaceObserver() 
                {  
+                       _mCubes                                 = NULL;
+                       _tissueStripper                 = NULL;
+                       _tissueClipper                  = NULL;
                        _vtkVolumeRayCastMapper = NULL;
                }
 
@@ -58,8 +65,8 @@ class boxSurfaceObserver : public vtkCommand
                void SetPlanes(vtkPlanes *planes);
                void SetActor(vtkProp *actor);
                void SetvtkVolumeRayCastMapper(vtkVolumeRayCastMapper *vtkvolumeraycastmapper);
+               void SetFilters(vtkAlgorithm *_mCubes , vtkAlgorithm *_tissueStripper , vtkAlgorithm *_tissueClipper);
 };
 
 
-
 #endif /*BOXSURFACEOBSERVER_H_*/
index 2ecbb5d2e533b2cf57c44139778bcf74fab680c7..646baf280d5cc60011db3a2a02c141f32ef7d294 100644 (file)
@@ -252,7 +252,7 @@ void vtkClipping3DDataViewer::Configure_Tissue()
                _tissuePlanes[i]  = vtkPlanes::New();
                int x1,x2,y1,y2,z1,z2;
                imagedata->GetExtent(x1,x2,y1,y2,z1,z2);
-               _tissuePlanes[i]->SetBounds  (x1,x2,y1,y2,z1,z2);
+               _tissuePlanes[i]->SetBounds(x1,x2,y1,y2,z1,z2);
                _tissueClipper[i] = vtkClipPolyData::New();
                _tissueClipper[i]->SetClipFunction( _tissuePlanes[i] );
                _tissueClipper[i]->InsideOutOn( );
@@ -262,7 +262,6 @@ void vtkClipping3DDataViewer::Configure_Tissue()
                _tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() );
 #else
                _tissueClipper[i]->SetInputData( _tissueStripper[i]->GetOutput() );
-               _tissueClipper[i]->Update();
 #endif
 
                _tissueMapper[i] = vtkPolyDataMapper::New( );
@@ -271,6 +270,9 @@ void vtkClipping3DDataViewer::Configure_Tissue()
 #if VTK_MAJOR_VERSION <= 5
                _tissueMapper[i]->SetInput( _tissueClipper[i]->GetOutput() );
 #else
+               _mCubes[i]->Update();
+               _tissueStripper[i]->Update();
+               _tissueClipper[i]->Update();
                _tissueMapper[i]->SetInputData( _tissueClipper[i]->GetOutput() );
                _tissueMapper[i]->Update();
 #endif
@@ -290,19 +292,19 @@ void vtkClipping3DDataViewer::Configure_Tissue()
                _tissue[i]->GetProperty()->SetSpecular(.3);
                _tissue[i]->GetProperty()->SetSpecularPower(20);
                _tissue[i]->GetProperty()->SetOpacity(0.5);
-               if (i==0) _tissue[i]->GetProperty()->SetColor(0.85, 0.85   , 0.85   );
-               if (i==1) _tissue[i]->GetProperty()->SetColor(0, 0  ,  1  );
-               if (i==2) _tissue[i]->GetProperty()->SetColor(0.85, 0.20   , 0.20   );
-               if (i==3) _tissue[i]->GetProperty()->SetColor(0, 1   , 0   );
-       }
+               if (i==0) { _tissue[i]->GetProperty()->SetColor(0.85, 0.85   , 0.85   );        }
+               if (i==1) { _tissue[i]->GetProperty()->SetColor(0, 0  ,  1  );                          }
+               if (i==2) { _tissue[i]->GetProperty()->SetColor(0.85, 0.20   , 0.20   );        }
+               if (i==3) { _tissue[i]->GetProperty()->SetColor(0, 1   , 0   );                         }
+       } // for
 
        for (i=0; i< VTKMPRDATA_MAXTISSUE ; i++)
        {
                _observerS[i] = boxSurfaceObserver::New();
                _observerS[i]->SetPlanes( GetTissuePlanes(i) );
                _observerS[i]->SetActor( _tissue[i] );
-       }
-
+               _observerS[i]->SetFilters( _mCubes[i], _tissueStripper[i] ,_tissueClipper[i] );
+       } // for
 }
 
 //-----------------------------------------------------------------------------
@@ -532,6 +534,14 @@ void vtkClipping3DDataViewer::Configure()
 void vtkClipping3DDataViewer::SetIsovalue(int idTissue, int isoValue)
 {
        _mCubes[idTissue]->SetValue(0, isoValue);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+       // ..
+#else
+       _mCubes[idTissue]->Update();
+       _tissueStripper[idTissue]->Update();
+       _tissueClipper[idTissue]->Update();
+#endif
 }
 //-------------------------------------------------------------------
 double vtkClipping3DDataViewer::GetIsovalue(int idTissue)
index 4fd2218353644285d17e92081f29d6bbfaf60ea3..b41609ebcb2fb5cc3928edadecd3cf5ef7ab158a 100644 (file)
@@ -173,8 +173,6 @@ void wxVtkClipping3DView::Configure()
        _boxWidgetS1->SetInteractor( _wxvtk3Dbaseview->GetWxVTKRenderWindowInteractor() );
        _boxWidgetS1->SetPlaceFactor(1.25);
 
-
-
        vtkStripper *stripper=_vtkclipping3Ddataviewer->GetTissueStripper(0);
        vtkPolyData *polydata= stripper->GetOutput();
 
@@ -182,6 +180,7 @@ void wxVtkClipping3DView::Configure()
 #if VTK_MAJOR_VERSION <= 5
        _boxWidgetS1->SetInput( polydata );
 #else
+       stripper->Update();
        _boxWidgetS1->SetInputData( polydata );
 #endif
 
@@ -265,6 +264,7 @@ void wxVtkClipping3DView::Configure()
        _vtkclipping3Ddataviewer->SetRenderer(this->GetWxvtk3Dbaseview()->GetRenderer());
        _vtkclipping3Ddataviewer->SetInteractor(this->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor());
 }
+
 //-------------------------------------------------------------------
 void wxVtkClipping3DView::SetVtkClipping3DDataViewer(vtkClipping3DDataViewer *vtkclipping3Ddataviewer)
 {