From: Eduardo Davila Date: Thu, 9 Jun 2011 09:51:23 +0000 (+0000) Subject: no message X-Git-Tag: v1.0.4~101 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=effe950c57bb076bb8aabe3d3bf533de83863913;p=creaMaracasVisu.git no message --- diff --git a/appli/CMakeLists.txt b/appli/CMakeLists.txt index 5d842df..5d30230 100644 --- a/appli/CMakeLists.txt +++ b/appli/CMakeLists.txt @@ -1,5 +1,8 @@ #ADD_SUBDIRECTORY(ManualPaint) -ADD_SUBDIRECTORY(QtVTKViewer) #ADD_SUBDIRECTORY(BasicViewer) +IF(QT_USE_QTUITOOLS) + ADD_SUBDIRECTORY(QtVTKViewer) +ENDIF(QT_USE_QTUITOOLS) + diff --git a/lib/Kernel/CMakeLists.txt b/lib/Kernel/CMakeLists.txt index 138ea98..21bc5bf 100644 --- a/lib/Kernel/CMakeLists.txt +++ b/lib/Kernel/CMakeLists.txt @@ -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 diff --git a/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx b/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx index 9b6a5dd..70862f2 100644 --- a/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx +++ b/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx @@ -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(){ diff --git a/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.h b/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.h index cfa0c87..b65de91 100644 --- a/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.h +++ b/lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.h @@ -5,6 +5,7 @@ #include "vtkCommand.h" #include #include +#include #include #include #include @@ -14,16 +15,15 @@ #include #include #include - #include - #include #include -#if (VTK_MAYOR_VERSION>=5 && VTK_MINOR_VERSION>=6) +#if (VTK_MAYOR_VERSION>=6 && VTK_MINOR_VERSION>=6) #include #endif + #include @@ -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;