From: Eduardo DAVILA Date: Fri, 20 Jul 2018 14:05:28 +0000 (+0200) Subject: 3205 BBTK Feature New Normal branch vtk7itk4wx3-mxecc X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=ef49b9b19c6e209bf1b2e2b687de3988b183cb0f;p=bbtk.git 3205 BBTK Feature New Normal branch vtk7itk4wx3-mxecc --- diff --git a/packages/vtk/src/bbvtkMIPCreator.cxx b/packages/vtk/src/bbvtkMIPCreator.cxx index b65e51d..9da0c3e 100644 --- a/packages/vtk/src/bbvtkMIPCreator.cxx +++ b/packages/vtk/src/bbvtkMIPCreator.cxx @@ -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 diff --git a/packages/vtk/src/bbvtkMIPCreator.h b/packages/vtk/src/bbvtkMIPCreator.h index 486cc7e..124abe8 100644 --- a/packages/vtk/src/bbvtkMIPCreator.h +++ b/packages/vtk/src/bbvtkMIPCreator.h @@ -57,8 +57,16 @@ #include "vtkImageData.h" #include -#include -#include + +//EED 2018-07-20 Migration VTK8 +#if (VTK_MAJOR_VERSION <= 7) + #include + #include +#else + #include +#endif + + #include "vtkProp3D.h" #include "vtkVolume.h" @@ -85,8 +93,18 @@ namespace bbvtk std::vector DensityPoints; std::vector 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; diff --git a/packages/vtk/src/bbvtkVolumeRenderer.cxx b/packages/vtk/src/bbvtkVolumeRenderer.cxx index a3b39a5..3c5b371 100644 --- a/packages/vtk/src/bbvtkVolumeRenderer.cxx +++ b/packages/vtk/src/bbvtkVolumeRenderer.cxx @@ -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(); diff --git a/packages/vtk/src/bbvtkVolumeRenderer.h b/packages/vtk/src/bbvtkVolumeRenderer.h index d18b8aa..fc500f1 100644 --- a/packages/vtk/src/bbvtkVolumeRenderer.h +++ b/packages/vtk/src/bbvtkVolumeRenderer.h @@ -64,8 +64,13 @@ //#include //#include #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 +#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; };