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();
_newvol = vtkVolume::New();
_newvol->SetMapper(_volumeMapper );
_newvol->SetProperty(_volumeProperty );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
_volumeMapper->SetInput( _vol );
+#else
+ _volumeMapper->SetInputData( _vol );
+#endif
+
_volumeMapper->Update();
_newvol->Update();
}
_tfun->Delete();
_ctfun->Delete();
_volumePlanes->Delete();
+
+
+#if (VTK_MAJOR_VERSION <= 7)
_compositeFunction->Delete();
+#else
+ // ..
+#endif
+
_volumeMapper->Delete();
+
_volumeProperty->Delete();
_newvol->Delete();
/**
** 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";
}
}
_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
}