]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx
#3207 creaMaracasVisu Feature New Normal branch vtk7itk4wx3-mingw
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / vtkClipping3DDataViewer.cxx
index 646baf280d5cc60011db3a2a02c141f32ef7d294..bca71dd8c8e0231095c189490429b3ee9777c22e 100644 (file)
@@ -42,11 +42,17 @@ vtkClipping3DDataViewer::vtkClipping3DDataViewer()
        _shade                                          = false;
 
     _volumerendererdata        = VolumeRendererData::New();
+
+#if (VTK_MAJOR_VERSION <= 7) 
     _volumeMapper                      = vtkVolumeRayCastMapper::New();
+    _compositeFunction                 = vtkVolumeRayCastCompositeFunction::New();
+       _compositeFunctionMIP   = vtkVolumeRayCastMIPFunction::New();
+#else 
+    _volumeMapper                      = vtkFixedPointVolumeRayCastMapper::New();
+#endif
+
     _newvol                            = vtkVolume::New();
     _volumeProperty            = vtkVolumeProperty::New();
-    _compositeFunction                 = vtkVolumeRayCastCompositeFunction::New();
-        _compositeFunctionMIP  = vtkVolumeRayCastMIPFunction::New();
 
 }
 //-------------------------------------------------------------------
@@ -64,7 +70,11 @@ vtkClipping3DDataViewer::~vtkClipping3DDataViewer()
        // Volume
        _tfun->Delete();
        _ctfun->Delete();
+#if (VTK_MAJOR_VERSION <= 7) 
        _compositeFunction->Delete();
+#else 
+       // ..
+#endif
        _volumeMapper->Delete();
        _volumeProperty->Delete();
        _newvol->Delete();
@@ -398,9 +408,12 @@ void vtkClipping3DDataViewer::Configure_Volume()
 #endif
 
 
+#if (VTK_MAJOR_VERSION <= 7) 
     _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
-
-   // _volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
+       // _volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
+#else 
+       // ..
+#endif
        
 //
        _volumeMapper->SetClippingPlanes( _volumePlanes );
@@ -429,7 +442,12 @@ void vtkClipping3DDataViewer::Configure_Volume()
     _observerV = boxSurfaceObserver::New();
        _observerV->SetPlanes( _volumePlanes );
        _observerV->SetActor( _newvol );
+       
+#if (VTK_MAJOR_VERSION <= 7) 
        _observerV->SetvtkVolumeRayCastMapper( _volumeMapper );
+#else 
+       _observerV->SetvtkFixedPointVolumeRayCastMapper( _volumeMapper );
+#endif
 }
 
 //-----------------------------------------------------------------------------
@@ -490,16 +508,20 @@ void vtkClipping3DDataViewer::UpdateVolumeBox(vector<double> gf, vector<double>
 void vtkClipping3DDataViewer::updateVolume()
 {
 
+#if (VTK_MAJOR_VERSION <= 7) 
     if(_isRayCasting)
     {
         _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
         _volumerendererdata->changeCompositeMIPFunction(0);
-    }
-    else if(_isMIP)
-    {
+    }    else if(_isMIP) {
         _volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
         _volumerendererdata->changeCompositeMIPFunction(1);
     }
+#else 
+       // ...   here Composition of MIP
+       printf("EED vtkClipping3DDataViewer::updateVolume ...   here Composition or MIP \n");
+#endif
+
 
     if(_interpolation)
     {
@@ -554,7 +576,12 @@ vtkVolume* vtkClipping3DDataViewer::GetVolumeActor()
    return _newvol;
 }
 //-------------------------------------------------------------------
-vtkVolumeRayCastMapper* vtkClipping3DDataViewer::GetVolumeMapper(){
+#if (VTK_MAJOR_VERSION <= 7) 
+       vtkVolumeRayCastMapper* vtkClipping3DDataViewer::GetVolumeMapper()
+#else 
+       vtkFixedPointVolumeRayCastMapper* vtkClipping3DDataViewer::GetVolumeMapper()
+#endif
+{
        return _volumeMapper;
 }
 //-------------------------------------------------------------------