]> Creatis software - bbtk.git/commitdiff
3205 BBTK Feature New Normal branch vtk7itk4wx3-mxecc
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 20 Jul 2018 14:05:28 +0000 (16:05 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 20 Jul 2018 14:05:28 +0000 (16:05 +0200)
packages/vtk/src/bbvtkMIPCreator.cxx
packages/vtk/src/bbvtkMIPCreator.h
packages/vtk/src/bbvtkVolumeRenderer.cxx
packages/vtk/src/bbvtkVolumeRenderer.h

index b65e51d22893d90ba8a461a1a5044b6052be254f..9da0c3efe4c389d34a471288a61fea67b953dc42 100644 (file)
@@ -65,7 +65,14 @@ namespace bbvtk
        opacityTransferFunction         = vtkPiecewiseFunction::New();
        grayTransferFunction    = vtkPiecewiseFunction::New();
           mCast        = NULL;
+
+//EED 2018-07-20 Migration VTK8
+#if (VTK_MAJOR_VERSION <= 7) 
           mMIP         = NULL;
+#else 
+       //
+#endif
+
           mMapper      = NULL;
           mVolume      = NULL;
    }
@@ -88,11 +95,16 @@ namespace bbvtk
                   mCast=NULL;
           }
 
+//EED 2018-07-20 Migration VTK8
+#if (VTK_MAJOR_VERSION <= 7) 
           if (mMIP!=NULL)
           {
                   mMIP->Delete();
                   mMIP=NULL;
           }
+#else 
+       //
+#endif
 
           if (mMapper!=NULL)
           {
@@ -171,10 +183,19 @@ namespace bbvtk
 //        mipProperty->SetAmbient(0.9);
 //        mipProperty->SetDiffuse(0.9);
 //        mipProperty->SetSpecular(0.9);
+
+
+//EED 2018-07-20 Migration VTK8
+#if (VTK_MAJOR_VERSION <= 7) 
         mMIP = vtkVolumeRayCastMIPFunction::New();
         mMIP->SetMaximizeMethodToScalarValue();
         mMapper = vtkVolumeRayCastMapper::New();
         mMapper->SetVolumeRayCastFunction(mMIP);
+#else 
+               mMapper = vtkFixedPointVolumeRayCastMapper::New();
+#endif
+
+               
                mCast->Update();
 
 //EED 2017-01-01 Migration VTK7
index 486cc7ea6c7b5c5eafb24207e96428e754851ea6..124abe89cb4e980a139d1019716717b32533ede2 100644 (file)
 
 #include "vtkImageData.h"
 #include <vtkImageShiftScale.h>
-#include <vtkVolumeRayCastMIPFunction.h>
-#include <vtkVolumeRayCastMapper.h>
+
+//EED 2018-07-20 Migration VTK8
+#if (VTK_MAJOR_VERSION <= 7) 
+       #include <vtkVolumeRayCastMIPFunction.h>
+       #include <vtkVolumeRayCastMapper.h>
+#else 
+       #include <vtkFixedPointVolumeRayCastMapper.h>
+#endif
+
+
 #include "vtkProp3D.h"
 #include "vtkVolume.h"
 
@@ -85,8 +93,18 @@ namespace bbvtk
     std::vector<double> DensityPoints;
     std::vector<double> OpacityValues;
     vtkImageShiftScale                 *mCast;
-    vtkVolumeRayCastMIPFunction                *mMIP;
-    vtkVolumeRayCastMapper             *mMapper;
+
+
+//EED 2018-07-20 Migration VTK8
+#if (VTK_MAJOR_VERSION <= 7) 
+    vtkVolumeRayCastMIPFunction                        *mMIP;
+    vtkVolumeRayCastMapper                             *mMapper;
+#else 
+    vtkFixedPointVolumeRayCastMapper   *mMapper;
+#endif
+
+
+
     vtkVolume                          *mVolume;
     vtkPiecewiseFunction *opacityTransferFunction;
     vtkPiecewiseFunction *grayTransferFunction;
index a3b39a5a2d17611513f6b40418fe53348e033ad2..3c5b371acb3201e38410c32f21f3ef05548c167a 100644 (file)
@@ -59,7 +59,12 @@ namespace bbvtk
 
    void VolumeRenderer::bbUserSetDefaultValues() 
    { 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
           mRayCastFunction = NULL;
+#else
+       //
+#endif
           mMapper                      = NULL;
           mVolume                      = NULL;
           bbSetInputColorFunction(0);
@@ -78,11 +83,16 @@ namespace bbvtk
     //    mMIP = vtkVolumeRayCastMIPFunction::New();
     //    mMIP->SetMaximizeMethodToScalarValue();
 
+//EED 2018-07-20 Migration VTK8
+#if (VTK_MAJOR_VERSION <= 7) 
     mRayCastFunction = vtkVolumeRayCastCompositeFunction::New();
     mMapper = vtkVolumeRayCastMapper::New();
           mMapper->SetVolumeRayCastFunction(mRayCastFunction);
           mMapper->AutoAdjustSampleDistancesOn();
-
+#else 
+         mMapper = vtkFixedPointVolumeRayCastMapper::New();
+#endif
+                  
           _volumeProperty = vtkVolumeProperty::New();  
        _volumeProperty->SetInterpolationTypeToLinear();
        _volumeProperty->ShadeOn();
@@ -102,11 +112,16 @@ namespace bbvtk
        //---------------------------------------------------------------------
    void VolumeRenderer::bbUserFinalizeProcessing() 
    { 
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
           if (mRayCastFunction!=NULL)
           {
                   mRayCastFunction->Delete();
                   mRayCastFunction=NULL;
           }      
+#else
+       //
+#endif
           if (mMapper!=NULL)
           {
                   mMapper->Delete();
index d18b8aa25154f8bcdea8130181073a66bd41df98..fc500f17181b33f508ca847d68db5e2ad3810797 100644 (file)
 //#include <vtkImageShiftScale.h>
 //#include <vtkVolumeRayCastMIPFunction.h>
 #include "vtkVolumeProperty.h"
-#include "vtkVolumeRayCastCompositeFunction.h"
-#include "vtkVolumeRayCastMapper.h"
+//EED 2018-07-20 Migration VTK8
+#if (VTK_MAJOR_VERSION <= 7) 
+       #include "vtkVolumeRayCastCompositeFunction.h"
+       #include "vtkVolumeRayCastMapper.h"
+#else 
+       #include <vtkFixedPointVolumeRayCastMapper.h>
+#endif
 #include "vtkProp3D.h"
 #include "vtkVolume.h"
 
@@ -95,8 +100,13 @@ namespace bbvtk
 
   private:
     vtkVolumeProperty                 *mVolumeProperty;
+//EED 2018-07-20 Migration VTK8
+#if (VTK_MAJOR_VERSION <= 7) 
     vtkVolumeRayCastCompositeFunction *mRayCastFunction;
     vtkVolumeRayCastMapper            *mMapper;
+#else 
+    vtkFixedPointVolumeRayCastMapper  *mMapper;
+#endif
     vtkVolume                         *mVolume;
     vtkVolumeProperty                 *_volumeProperty;
   };