]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasMultipleVolumeRendererManagerData.cxx
creaButtonContainer: exceptions added, doxygen documentation added :)
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracasMultipleVolumeRendererManagerData.cxx
index 8f2175d217d5eca3a74157a5f4fcb5020f2d63f6..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,16 @@ 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";
+       }
 }
 
 /**
@@ -121,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);
+       }
+       
+}