]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / vtkClipping3DDataViewer.cxx
index 800f8be546d499af73ae2bef0223cb0deb87a55e..80a39b6301a652edb860a44d3f34b61af4c30341 100644 (file)
@@ -19,6 +19,9 @@ vtkClipping3DDataViewer::vtkClipping3DDataViewer()
     _volumeMapper = vtkVolumeRayCastMapper::New();
     _newvol = vtkVolume::New();
     _volumeProperty = vtkVolumeProperty::New();
+    _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
+        _compositeFunctionMIP = vtkVolumeRayCastMIPFunction::New();
+
 }
 //-------------------------------------------------------------------
 vtkClipping3DDataViewer::~vtkClipping3DDataViewer()
@@ -313,30 +316,24 @@ void vtkClipping3DDataViewer::Configure_Volume()
 
        // EED 13/03/2011
 
-  _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
-       vtkVolumeRayCastMIPFunction* _compositeFunctionMIP = vtkVolumeRayCastMIPFunction::New();
 
 
  // _volumeMapper = vtkVolumeRayCastMapper::New();
        _volumeMapper->SetInput( this->GetVtkMPRBaseData()->GetImageData() );
 
-if(_isRayCasting)
-{
-    cout<<"JPRG::vtkClipping3DDataViewer::Configure_Volume::isRayCasting"<<endl;
+
+
     _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
 
-}
-else if(_isMIP)
-{
-    cout<<"JPRG::vtkClipping3DDataViewer::Configure_Volume::isMIP"<<endl;
-    _volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
-}
+
+   // _volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
 
 //
 
        _volumeMapper->SetClippingPlanes( _volumePlanes );
        _volumeMapper->AutoAdjustSampleDistancesOn();
 
+    _volumeProperty->SetInterpolationTypeToNearest();
     //_volumeProperty = vtkVolumeProperty::New();
        _volumeProperty->SetColor(_ctfun);
        _volumeProperty->SetScalarOpacity( _tfun );
@@ -345,23 +342,7 @@ else if(_isMIP)
 
        _volumeProperty->DisableGradientOpacityOn();
 
-if(_interpolation)
-{
-    _volumeProperty->SetInterpolationTypeToLinear();
-}
-else
-{
-    _volumeProperty->SetInterpolationTypeToNearest();
-}
 
-if(_shade)
-{
-    _volumeProperty->ShadeOn();
-}
-else
-{
-    _volumeProperty->ShadeOff();
-}
 
 //     _
 
@@ -386,6 +367,40 @@ else
        _observerV->SetvtkVolumeRayCastMapper( _volumeMapper );
 }
 
+void vtkClipping3DDataViewer::updateVolume()
+{
+
+    if(_isRayCasting)
+    {
+        cout<<"JPRG::vtkClipping3DDataViewer::Configure_Volume::isRayCasting"<<endl;
+        _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
+    }
+    else if(_isMIP)
+    {
+        cout<<"JPRG::vtkClipping3DDataViewer::Configure_Volume::isMIP"<<endl;
+
+        _volumeMapper->SetVolumeRayCastFunction(_compositeFunctionMIP);
+    }
+
+    if(_interpolation)
+    {
+        _volumeProperty->SetInterpolationTypeToLinear();
+    }
+    else
+    {
+        _volumeProperty->SetInterpolationTypeToNearest();
+    }
+
+    if(_shade)
+    {
+        _volumeProperty->ShadeOn();
+    }
+    else
+    {
+        _volumeProperty->ShadeOff();
+    }
+
+}
 
 //-------------------------------------------------------------------
 void vtkClipping3DDataViewer::Configure()