]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx
#3263 creaMaracasVisu Feature New Normal - ViewerNV sync ParallelScale Camera
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracasMultipleVolumeRendererManagerData.cxx
index a7680bb84171bd365bb03b189a5a1d18c1c4f411..d71d3e91bac1b45d89d1006f682f54a80932bf63 100644 (file)
 
 wxMaracasMultipleVolumeRendererManagerData::wxMaracasMultipleVolumeRendererManagerData(vtkImageData* vol, std::string dataname){
 
-       _vol = vol;     
-       _dataname = dataname;
-       
-       _tfun = vtkPiecewiseFunction::New();
-       _ctfun = vtkColorTransferFunction::New();   
+       _vol                                    = vol;  
+       _dataname                               = dataname;
+       _tfun                                   = vtkPiecewiseFunction::New();
+       _ctfun                                  = vtkColorTransferFunction::New();   
+       _volumePlanes                   = vtkPlanes::New();
 
-       _volumePlanes  = vtkPlanes::New();
-       _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
-       _MIPFunction = vtkVolumeRayCastMIPFunction::New();
 
-       _volumeMapper = vtkVolumeRayCastMapper::New();  
+#if (VTK_MAJOR_VERSION <= 7) 
+       _compositeFunction              = vtkVolumeRayCastCompositeFunction::New();
+       _MIPFunction                    = vtkVolumeRayCastMIPFunction::New();
+       _volumeMapper                   = vtkVolumeRayCastMapper::New();                
        _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
+#else 
+       _volumeMapper                   = vtkFixedPointVolumeRayCastMapper::New();      
+#endif
+
        _volumeMapper->SetClippingPlanes( _volumePlanes );
        _volumeMapper->AutoAdjustSampleDistancesOn();
        _volumeProperty = vtkVolumeProperty::New();     
@@ -74,8 +78,16 @@ wxMaracasMultipleVolumeRendererManagerData::~wxMaracasMultipleVolumeRendererMana
        _tfun->Delete();
        _ctfun->Delete();
        _volumePlanes->Delete();
+
+
+#if (VTK_MAJOR_VERSION <= 7) 
        _compositeFunction->Delete();
+#else 
+       // ..
+#endif
+
        _volumeMapper->Delete();
+
        _volumeProperty->Delete();
        _newvol->Delete();
        
@@ -113,14 +125,24 @@ void wxMaracasMultipleVolumeRendererManagerData::setVolumeOpacity(std::vector<do
 /**
 **     Check if the variables are setted correctly
 **/
-void wxMaracasMultipleVolumeRendererManagerData::checkInvariant()throw (char *){
-       if(!_compositeFunction){
+void wxMaracasMultipleVolumeRendererManagerData::checkInvariant()throw (char *)
+{
+
+       
+#if (VTK_MAJOR_VERSION <= 7) 
+       if(!_compositeFunction)
+       {
                throw "No composite function initialized";
        }
-       if(!_MIPFunction){
+       if(!_MIPFunction)
+       {
                throw "No MIP function initialized";
        }
-       if(!_volumeMapper){
+#else 
+       // ..
+#endif
+       if(!_volumeMapper)
+       {
                throw "No volume mapper initialized";
        }
 }
@@ -163,12 +185,17 @@ void wxMaracasMultipleVolumeRendererManagerData::setDataname(std::string datanam
        _dataname = dataname;
 }
 
-void wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction(int function) throw (char *){
-       checkInvariant();
-       if(function == 0){
+void wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction(int function) throw (char *)
+{
+       checkInvariant();       
+#if (VTK_MAJOR_VERSION <= 7) 
+       if(function == 0)
+       {
                _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
        }else{
                _volumeMapper->SetVolumeRayCastFunction(_MIPFunction);
        }
-       
+#else 
+       printf("EED   wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction   Composite MIP  ..... ??");
+#endif
 }