]> Creatis software - creaMaracasVisu.git/commitdiff
no message
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Thu, 9 Jun 2011 09:51:23 +0000 (09:51 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Thu, 9 Jun 2011 09:51:23 +0000 (09:51 +0000)
appli/CMakeLists.txt
lib/Kernel/CMakeLists.txt
lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx
lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.h

index 5d842dfa8e870c357712daff9db2af02f70151b6..5d30230872fdea8092b5991fd0d7be4f5197dc30 100644 (file)
@@ -1,5 +1,8 @@
 
 #ADD_SUBDIRECTORY(ManualPaint)
-ADD_SUBDIRECTORY(QtVTKViewer)
 #ADD_SUBDIRECTORY(BasicViewer)
 
+IF(QT_USE_QTUITOOLS)
+  ADD_SUBDIRECTORY(QtVTKViewer)
+ENDIF(QT_USE_QTUITOOLS)
+
index 138ea98914eb77529e33eb33a56849ec0834e9e5..21bc5bff1f00c832ad4ac3a60c485a5a2d6053c7 100644 (file)
@@ -1,4 +1,4 @@
 # Add a ADD_SUBDIRECTORY command for each of your libraries
-ADD_SUBDIRECTORY(ITKVTK)
+#ADD_SUBDIRECTORY(ITKVTK)
 ADD_SUBDIRECTORY(VTKObjects)
  
\ No newline at end of file
index 9b6a5dd2d7663458cbf4fc9d0cb1ddda2c037793..70862f286994e40015a22f25b45c4d6b36869159 100644 (file)
@@ -9,6 +9,7 @@
 #include "boxSurfaceObserver.h"
 #include "vtkProperty.h"
 
+
 using namespace std;
 
 VolumeRendererManagerData::VolumeRendererManagerData(vtkImageData* vol, std::string dataname){
@@ -55,6 +56,9 @@ void VolumeRendererManagerData::Initialize(vtkImageData* vol, std::string datana
     _MIPFunction = 0;
     _boxWidgetS1 = 0;
 
+       
+       
+/* EED9Juin2011        
     if(usegpu && _vol->GetDataDimension() > 2){
         _volumeMappergpu = vtkGPUVolumeRayCastMapper::New();
         _volumeMappergpu->SetClippingPlanes( _volumePlanes );
@@ -78,12 +82,41 @@ void VolumeRendererManagerData::Initialize(vtkImageData* vol, std::string datana
         _volumeMapper->SetInput( _vol );
         _volumeMapper->Update();
     }
+*/
 
+       vtkVolumeMapper *volMapperTmp;
+    if(usegpu && _vol->GetDataDimension() > 2){
+               #if (VTK_MAYOR_VERSION>=6 && VTK_MINOR_VERSION>=6)
+                       _volumeMappergpu                                                                = vtkGPUVolumeRayCastMapper::New();     
+                       _volumeMappergpu->AutoAdjustSampleDistancesOn();
+                       volMapperTmp                                                                    = _volumeMappergpu;
+               #else
+                       _compositeFunction                                                              = vtkVolumeRayCastCompositeFunction::New();
+                       _MIPFunction                                                                    = vtkVolumeRayCastMIPFunction::New();
+                       _volumeMapper           = vtkVolumeRayCastMapper::New();
+                       _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
+                       _volumeMapper->AutoAdjustSampleDistancesOn();
+                       volMapperTmp                                                                    = _volumeMapper;
+               #endif
+    }else{
+        _compositeFunction                                                             = vtkVolumeRayCastCompositeFunction::New();
+        _MIPFunction                                                                   = vtkVolumeRayCastMIPFunction::New();
+        _volumeMapper                                                                  = vtkVolumeRayCastMapper::New();
+        _volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
+               _volumeMapper->AutoAdjustSampleDistancesOn();
+               volMapperTmp                                                                    = _volumeMapper;
+    }
+       
+       volMapperTmp->SetClippingPlanes( _volumePlanes );
+       _newvol->SetMapper(volMapperTmp );
+       volMapperTmp->SetInput( _vol );
+       volMapperTmp->Update();
     _newvol->Update();
 }
 
 
-VolumeRendererManagerData::~VolumeRendererManagerData(){
+VolumeRendererManagerData::~VolumeRendererManagerData()
+{
 
         _tfun->Delete();
         _ctfun->Delete();
@@ -105,8 +138,9 @@ VolumeRendererManagerData::~VolumeRendererManagerData(){
 
 }
 
-void VolumeRendererManagerData::EnableBoundingBox(vtkRenderWindowInteractor* interactor){
-    if(_volumeMappergpu){
+void VolumeRendererManagerData::EnableBoundingBox(vtkRenderWindowInteractor* interactor)
+{
+//EED9Juin2011    if(_volumeMappergpu){
         _boxWidgetS1 = vtkBoxWidget::New();
         _boxWidgetS1->SetInteractor( interactor );
         _boxWidgetS1->SetPlaceFactor(1.01);
@@ -116,12 +150,18 @@ void VolumeRendererManagerData::EnableBoundingBox(vtkRenderWindowInteractor* int
         _boxWidgetS1->PlaceWidget();
 
         vtkBoxWidgetCallback *callback = vtkBoxWidgetCallback::New();
-        callback->SetMapper(_volumeMappergpu);
+       
+               if (_volumeMapper!=0){
+                       callback->SetMapper(_volumeMapper);
+               } else {
+                       callback->SetMapper(_volumeMappergpu);
+               } 
+       
         _boxWidgetS1->AddObserver(vtkCommand::InteractionEvent, callback);
         callback->Delete();
         _boxWidgetS1->EnabledOn();
         _boxWidgetS1->GetSelectedFaceProperty()->SetOpacity(0.0);
-    }
+//EED9Juin2011  }
 }
 
 void VolumeRendererManagerData::DisableBoundingBox(){
index cfa0c879c0f7e15cc4339785b3f0821b42c61aac..b65de9158db1289a4355a6124bf1943fbb1266e8 100644 (file)
@@ -5,6 +5,7 @@
 #include "vtkCommand.h"
 #include <vtkVolumeRayCastCompositeFunction.h>
 #include <vtkPlanes.h>
+#include <vtkVolumeMapper.h>
 #include <vtkVolumeRayCastMapper.h>
 #include <vtkVolumeProperty.h>
 #include <vtkVolume.h>
 #include <vtkProp3D.h>
 #include <vtkRenderer.h>
 #include <vtkVolumeRayCastMIPFunction.h>
-
 #include <vtkLookupTable.h>
-
 #include <vtkBoxWidget.h>
 #include <vtkAbstractMapper.h>
 
-#if (VTK_MAYOR_VERSION>=5 && VTK_MINOR_VERSION>=6)
+#if (VTK_MAYOR_VERSION>=6 && VTK_MINOR_VERSION>=6)
   #include <vtkGPUVolumeRayCastMapper.h>
 #endif
 
+
 #include <vector>
 
 
@@ -150,8 +150,16 @@ private:
 
         vtkVolumeRayCastCompositeFunction      *_compositeFunction;
         vtkPlanes                                                      *_volumePlanes;
-        vtkVolumeRayCastMapper                         *_volumeMapper;
-        vtkGPUVolumeRayCastMapper           *_volumeMappergpu;
+        vtkVolumeRayCastMapper                     *_volumeMapper;
+       
+       
+#if (VTK_MAYOR_VERSION>=6 && VTK_MINOR_VERSION>=6)
+               vtkGPUVolumeRayCastMapper           *_volumeMappergpu;
+#else  
+               vtkVolumeRayCastMapper                      *_volumeMappergpu;
+#endif 
+       
+       
         vtkVolumeProperty                                      *_volumeProperty;
         vtkVolume                                                      *_newvol;
         vtkPiecewiseFunction* _tfun;