]> Creatis software - creaMaracasVisu.git/commitdiff
linking error on fedora, changes in qt cmake
authorJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Fri, 6 Jan 2012 14:53:12 +0000 (14:53 +0000)
committerJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Fri, 6 Jan 2012 14:53:12 +0000 (14:53 +0000)
appli/QtVTKViewer/CMakeLists.txt
lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx
lib/maracasVisuLib/CMakeLists.txt

index 71c4b0d1b5676696e9f1669c35f49f196041d78d..5e8d184d3f65ee9878bcd8dc8811793e837b9d0a 100644 (file)
@@ -32,7 +32,19 @@ INCLUDE_DIRECTORIES (
 #----------------------------------------------------------------------------
 # DEPENDENCIES (LIBRARIES TO LINK WITH)
 SET ( ${EXE_NAME}_LINK_LIBRARIES
+
+    QVTK
+
     GUIQtViewers
+    GUIQtVolumeRenderer
+    GUIQtSurfaceRenderer
+
+    BaseVolumeRenderer
+    BaseSurfaceRenderer
+
+    KernelViewerWidgets
+    KernelVolumeRenderer
+    KernelSurfaceRenderer
   #    ${WXWIDGETS_LIBRARIES}
   #    ${KWWidgets_LIBRARIES}
   #    ${VTK_LIBRARIES}
index d25f4a8c98f8779adab20ac9ecfc03d2facbe4c8..21047faad34ed15eb61bcac0072a537643bea345 100644 (file)
     #endif
 #endif
 
-
 using namespace std;
 
-VolumeRendererManagerData::VolumeRendererManagerData(vtkImageData* vol, bool usegpu)
-{
+VolumeRendererManagerData::VolumeRendererManagerData(vtkImageData* vol, bool usegpu){
     Initialize(vol, "", usegpu);
 }
 
-VolumeRendererManagerData::VolumeRendererManagerData(vtkImageData* vol, std::string dataname)
-{
+VolumeRendererManagerData::VolumeRendererManagerData(vtkImageData* vol, std::string dataname){
+
     Initialize(vol, dataname);
+
+
 }
 
-VolumeRendererManagerData::VolumeRendererManagerData(vtkImageData* vol, vtkRenderer* render, std::string dataname)
-{
+VolumeRendererManagerData::VolumeRendererManagerData(vtkImageData* vol, vtkRenderer* render, std::string dataname){
+
     Initialize(vol, dataname);
     render->AddActor(this->getProp3D());
+
 }
 
-void VolumeRendererManagerData::Initialize(vtkImageData* vol, std::string dataname, bool usegpu)
-{
+void VolumeRendererManagerData::Initialize(vtkImageData* vol, std::string dataname, bool usegpu){
     _id = 0;
     _vol = vol;
     _dataname = dataname;
@@ -53,6 +53,14 @@ void VolumeRendererManagerData::Initialize(vtkImageData* vol, std::string datana
     _volumeProperty->SetScalarOpacity(_tfun );
     _ctfun = vtkColorTransferFunction::New();
 
+    if(vol->GetNumberOfScalarComponents() == 1 ){
+
+        _ctfun->AddRGBPoint(vol->GetScalarRange()[0], 0, 0 , 0);
+        _ctfun->AddRGBPoint(vol->GetScalarRange()[1], 1, 1 , 1);
+        _ctfun->Build();
+        _volumeProperty->SetColor(_ctfun);
+    }
+
     _newvol = vtkVolume::New();
     _newvol->SetProperty(_volumeProperty );    
 
@@ -89,23 +97,22 @@ void VolumeRendererManagerData::Initialize(vtkImageData* vol, std::string datana
 */
 
        VolumeMapper = 0;
-       
-       
-#if ( VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION >= 8  )
-       
-//EED 10/Nov/2011       vtkGPUVolumeRayCastMapper * volumeMappergpu = vtkGPUVolumeRayCastMapper::New();
-         vtkSmartVolumeMapper * volumeMappergpu = vtkSmartVolumeMapper::New();
-       
-       volumeMappergpu->AutoAdjustSampleDistancesOn();
+#if VTK_MAJOR_VERSION >= 5
+    #if VTK_MINOR_VERSION >= 6
+       cout<<"using volume render GPU"<<endl;
+       vtkGPUVolumeRayCastMapper * volumeMappergpu = vtkGPUVolumeRayCastMapper::New();
+       volumeMappergpu->AutoAdjustSampleDistancesOn();       
        VolumeMapper = volumeMappergpu;
+    #endif
 #else
-               _volumeProperty->SetColor(_ctfun);
-               _compositeFunction                                                                                      = vtkVolumeRayCastCompositeFunction::New();
-               _MIPFunction                                                                                            = vtkVolumeRayCastMIPFunction::New();
-               vtkVolumeRayCastMapper* volumeMapper                                            = vtkVolumeRayCastMapper::New();
-               volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
-               volumeMapper->AutoAdjustSampleDistancesOn();
-               VolumeMapper                                                                                            = volumeMapper;
+
+
+       _compositeFunction                                                              = vtkVolumeRayCastCompositeFunction::New();
+       _MIPFunction                                                                    = vtkVolumeRayCastMIPFunction::New();
+       vtkVolumeRayCastMapper* volumeMapper                                                                    = vtkVolumeRayCastMapper::New();
+       volumeMapper->SetVolumeRayCastFunction(_compositeFunction);
+               volumeMapper->AutoAdjustSampleDistancesOn();
+               VolumeMapper                                                                    = volumeMapper;
 #endif
 
 
@@ -136,10 +143,10 @@ VolumeRendererManagerData::~VolumeRendererManagerData()
         if(BoxWidget){
             DisableBoundingBox();
         }
+
 }
+void VolumeRendererManagerData::SetIndependentComponents(bool independent){
 
-void VolumeRendererManagerData::SetIndependentComponents(bool independent)
-{
     if(!independent){
         _volumeProperty->IndependentComponentsOff();
     }else{
@@ -185,13 +192,16 @@ void VolumeRendererManagerData::EnableBoundingBox(vtkRenderWindowInteractor* int
 //EED9Juin2011  }
 }
 
-void VolumeRendererManagerData::DisableBoundingBox()
-{
+void VolumeRendererManagerData::DisableBoundingBox(){
+
     if(BoxWidget){
         BoxWidget->EnabledOff();
         //BoxWidget->Delete();
         //BoxWidget = 0;
+
         cout<<"JPRG::VolumeRendererManagerData::DisableBoundingBox"<<endl;
+
+
     }
 }
 
@@ -215,8 +225,7 @@ void VolumeRendererManagerData::setVolumeColor(std::vector<double>& greylevelcol
 /**
 **     Volume Opacity
 **/
-void VolumeRendererManagerData::setVolumeOpacity(std::vector<double> greylevel,std::vector<double> value)
-{
+void VolumeRendererManagerData::setVolumeOpacity(std::vector<double> greylevel,std::vector<double> value){
 
         _tfun->RemoveAllPoints();
         for(unsigned int i = 0; i < greylevel.size();i++){
@@ -226,12 +235,10 @@ void VolumeRendererManagerData::setVolumeOpacity(std::vector<double> greylevel,s
     _newvol->Update();
 }
 
-
 /**
 **     Volume Opacity
 **/
-void VolumeRendererManagerData::setVolumeOpacity(std::vector<double> greylevel,double value)
-{
+void VolumeRendererManagerData::setVolumeOpacity(std::vector<double> greylevel,double value){
     std::vector<double> valuevector;
     for(unsigned i = 0; i < greylevel.size(); i++){
         valuevector.push_back(value);
@@ -257,56 +264,44 @@ void VolumeRendererManagerData::checkInvariant()throw (char *){
 /**
 **     Check if the variables are setted correctly
 **/
-void VolumeRendererManagerData::Update()
-{
+void VolumeRendererManagerData::Update(){
          _newvol->Update();
 }
-
 /**
 **     get the prop3D
 **/
-vtkProp3D* VolumeRendererManagerData::getProp3D()
-{
+vtkProp3D* VolumeRendererManagerData::getProp3D(){
         return this->_newvol;
 }
-
 /**
 **     return the id from the daat
 **/
-int VolumeRendererManagerData::getId()
-{
+int VolumeRendererManagerData::getId(){
         return _id;
 }
-
 /**
 **     set data id
 **/
-void VolumeRendererManagerData::setId(int propid)
-{
+void VolumeRendererManagerData::setId(int propid){
         _id = propid;
 }
 
 /**
 **     Get the filanme
 **/
-std::string VolumeRendererManagerData::getDataname()
-{
+std::string VolumeRendererManagerData::getDataname(){
         return _dataname;
 }
 /**
 ** Set the filanme
 **/
-void VolumeRendererManagerData::setDataname(std::string dataname)
-{
+void VolumeRendererManagerData::setDataname(std::string dataname){
         _dataname = dataname;
 }
 
-
-void VolumeRendererManagerData::changeCompositeMIPFunction(int function)
-{
+void VolumeRendererManagerData::changeCompositeMIPFunction(int function){
         //checkInvariant();
         if(VolumeMapper){
-
 #if VTK_MAJOR_VERSION >= 5
     #if VTK_MINOR_VERSION >= 6
             if(dynamic_cast<vtkVolumeRayCastMapper*>(VolumeMapper)){
@@ -328,7 +323,6 @@ void VolumeRendererManagerData::changeCompositeMIPFunction(int function)
             }
     #endif
 #else
             vtkGPUVolumeRayCastMapper* volumemapper = dynamic_cast<vtkGPUVolumeRayCastMapper*>(VolumeMapper);
             if(function == 0){
                 volumemapper->SetBlendModeToComposite();
@@ -342,8 +336,7 @@ void VolumeRendererManagerData::changeCompositeMIPFunction(int function)
 
 }
 
-void VolumeRendererManagerData::SetLookupTable(vtkLookupTable* lookuptable)
-{
+void VolumeRendererManagerData::SetLookupTable(vtkLookupTable* lookuptable){
     if(lookuptable){
          _ctfun->RemoveAllPoints();
          vtkColorTransferFunction* colort = (vtkColorTransferFunction*)lookuptable;
@@ -358,8 +351,7 @@ void VolumeRendererManagerData::SetLookupTable(vtkLookupTable* lookuptable)
 
 }
 
-void VolumeRendererManagerData::changeInterpolationType(int type)
-{
+void VolumeRendererManagerData::changeInterpolationType(int type){
     //checkInvariant();
     if(type == 0){
         _volumeProperty->SetInterpolationTypeToLinear();
@@ -368,7 +360,8 @@ void VolumeRendererManagerData::changeInterpolationType(int type)
     }
 }
 
-void VolumeRendererManagerData::SetColorTransferFunction(int i, vtkColorTransferFunction* colorf)
-{
+void VolumeRendererManagerData::SetColorTransferFunction(int i, vtkColorTransferFunction* colorf){
+
     _volumeProperty->SetColor(i, colorf);
+
 }
index 14db1349d5bd72f0e155d3ad953f0b7e125b899a..330cf1e24e23a7ef767adcb60058208f2abeeb30 100644 (file)
@@ -137,11 +137,11 @@ FILE(GLOB ${LIBRARY_NAME}_HEADERS_CUTMODULE src/CutModule/interface/*.h src/CutM
        #jhcl-End===========================================================================
                #creaMaracasVisu_CutModule_interface
 #EED CM
-            KernelVolumeRenderer
+            #KernelVolumeRenderer
              KernelViewerWidgets
-             KernelSurfaceRenderer
-             BaseVolumeRenderer
-             BaseSurfaceRenderer
+             #KernelSurfaceRenderer
+             #BaseVolumeRenderer
+             #BaseSurfaceRenderer
 
     )
   #----------------------------------------------------------------------------