]> Creatis software - creaMaracasVisu.git/blobdiff - lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx
addition of image stencil to surface rendering
[creaMaracasVisu.git] / lib / Kernel / VTKObjects / VolumeRenderer / volumerenderermanagerdata.cxx
index 21047faad34ed15eb61bcac0072a537643bea345..ba51a3c7434584407673e9fbb6d0a88489ef5113 100644 (file)
@@ -47,9 +47,12 @@ void VolumeRendererManagerData::Initialize(vtkImageData* vol, std::string datana
 
     _volumeProperty = vtkVolumeProperty::New();
     _volumeProperty->SetInterpolationTypeToLinear();
-    //_volumeProperty->ShadeOn();
-    _volumeProperty->DisableGradientOpacityOn();    
-    _tfun = vtkPiecewiseFunction::New();
+    _volumeProperty->ShadeOn();
+    _volumeProperty->SetAmbient(3);
+    _volumeProperty->SetDiffuse(0.2);
+    _volumeProperty->SetSpecular(0.5);
+    //_volumeProperty->DisableGradientOpacityOn();
+    _tfun = vtkPiecewiseFunction::New();    
     _volumeProperty->SetScalarOpacity(_tfun );
     _ctfun = vtkColorTransferFunction::New();
 
@@ -147,10 +150,10 @@ VolumeRendererManagerData::~VolumeRendererManagerData()
 }
 void VolumeRendererManagerData::SetIndependentComponents(bool independent){
 
-    if(!independent){
-        _volumeProperty->IndependentComponentsOff();
-    }else{
+    if(independent){
         _volumeProperty->IndependentComponentsOn();
+    }else{
+        _volumeProperty->IndependentComponentsOff();
     }
 }