]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracasMultipleVolumeRendererManagerData.cxx
index fb0ef0a8e08e331bf321c308e84068293333d29b..052da71062ec1fe6e89ee48fdf733631e5d781a1 100644 (file)
@@ -15,13 +15,15 @@ wxMaracasMultipleVolumeRendererManagerData::wxMaracasMultipleVolumeRendererManag
 
        _volumePlanes  = vtkPlanes::New();
        _compositeFunction = vtkVolumeRayCastCompositeFunction::New();
+       _MIPFunction = vtkVolumeRayCastMIPFunction::New();
+
        _volumeMapper = vtkVolumeRayCastMapper::New();  
        _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
        _volumeMapper->SetClippingPlanes( _volumePlanes );
        _volumeMapper->AutoAdjustSampleDistancesOn();
        _volumeProperty = vtkVolumeProperty::New();     
        _volumeProperty->SetInterpolationTypeToLinear();
-       _volumeProperty->ShadeOn();
+       //_volumeProperty->ShadeOn();
        _volumeProperty->DisableGradientOpacityOn();    
        _volumeProperty->SetColor(_ctfun);
        _volumeProperty->SetScalarOpacity(_tfun );
@@ -79,8 +81,23 @@ void wxMaracasMultipleVolumeRendererManagerData::setVolumeOpacity(std::vector<do
 /**
 **     Check if the variables are setted correctly
 **/
-void wxMaracasMultipleVolumeRendererManagerData::checkInvariant(){
+void wxMaracasMultipleVolumeRendererManagerData::checkInvariant()throw (char *){
+       if(!_compositeFunction){
+               throw "No composite function initialized";
+       }
+       if(!_MIPFunction){
+               throw "No MIP function initialized";
+       }
+       if(!_volumeMapper){
+               throw "No volume mapper initialized";
+       }
+}
 
+/**
+**     Check if the variables are setted correctly
+**/
+void wxMaracasMultipleVolumeRendererManagerData::Update(){
+        _newvol->Update();
 }
 /**
 **     get the prop3D 
@@ -114,3 +131,12 @@ void wxMaracasMultipleVolumeRendererManagerData::setDataname(std::string datanam
        _dataname = dataname;
 }
 
+void wxMaracasMultipleVolumeRendererManagerData::changeCompositeMIPFunction(int function) throw (char *){
+       checkInvariant();
+       if(function == 0){
+               _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
+       }else{
+               _volumeMapper->SetVolumeRayCastFunction(_MIPFunction);
+       }
+       
+}