]> Creatis software - creaMaracasVisu.git/commitdiff
addition of surface rendering, qt support
authorJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Tue, 28 Jun 2011 16:34:37 +0000 (16:34 +0000)
committerJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Tue, 28 Jun 2011 16:34:37 +0000 (16:34 +0000)
18 files changed:
CMakeLists.txt
appli/QtVTKViewer/CMakeLists.txt
appli/QtVTKViewer/qtvtkviewer.cxx
lib/GUI/Base/CMakeLists.txt
lib/GUI/Base/VolumeRenderer/CMakeLists.txt
lib/GUI/Base/VolumeRenderer/volumerendererdata.cxx
lib/GUI/Qt/CMakeLists.txt
lib/GUI/Qt/Viewers/CMakeLists.txt
lib/GUI/Qt/Viewers/qtvtkviewerwidget.cxx
lib/GUI/Qt/Viewers/qtvtkviewerwidget.ui
lib/GUI/Qt/VolumeRenderer/CMakeLists.txt
lib/GUI/Wx/CMakeLists.txt
lib/GUI/Wx/VolumeRenderer/CMakeLists.txt
lib/Kernel/CMakeLists.txt
lib/Kernel/VTKObjects/CMakeLists.txt
lib/Kernel/VTKObjects/ViewerWidgets/CMakeLists.txt
lib/Kernel/VTKObjects/VolumeRenderer/CMakeLists.txt
lib/Kernel/VTKObjects/VolumeRenderer/volumerenderermanagerdata.cxx

index e947cb1c87b2daa2b69bfbef6418b6dd115bd756..a4ecd1af46c7a99e5dbb4f9c1dc1c21c8dddf3e3 100644 (file)
@@ -80,18 +80,24 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib/maracasVisuLib/src/CutModule/inte
 INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib/maracasVisuLib/src/CutModule/kernel )
 INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/lib/maracasVisuLib/../../../ )
 
-INCLUDE_DIRECTORIES( ${PROJECT_BINARY_DIR}/lib/GUI/Qt/Viewers
+INCLUDE_DIRECTORIES(
+                     ${PROJECT_BINARY_DIR}/lib/GUI/Qt/Viewers
                      ${PROJECT_SOURCE_DIR}/lib/GUI/Qt/Viewers
                      ${PROJECT_SOURCE_DIR}/lib/GUI/Qt/VolumeRenderer
+                     ${PROJECT_SOURCE_DIR}/lib/GUI/Qt/SurfaceRenderer
 
 
                      ${PROJECT_SOURCE_DIR}/lib/GUI/Wx/VolumeRenderer
+                     ${PROJECT_SOURCE_DIR}/lib/GUI/Wx/SurfaceRenderer
 
                      ${PROJECT_SOURCE_DIR}/lib/GUI/Base/VolumeRenderer
+                     ${PROJECT_SOURCE_DIR}/lib/GUI/Base/SurfaceRenderer
 
+                     ${PROJECT_SOURCE_DIR}/lib/Kernel/VTKObjects/SurfaceRenderer
                      ${PROJECT_SOURCE_DIR}/lib/Kernel/VTKObjects/ViewerWidgets
                      ${PROJECT_SOURCE_DIR}/lib/Kernel/VTKObjects/VolumeRenderer
-                     ${PROJECT_SOURCE_DIR}/lib/Kernel/ITKVTK
+
+
                     )
 
 
index 1c18fd5170602e3c7fb661222be5fbd02a080755..71c4b0d1b5676696e9f1669c35f49f196041d78d 100644 (file)
@@ -32,12 +32,7 @@ INCLUDE_DIRECTORIES (
 #----------------------------------------------------------------------------
 # DEPENDENCIES (LIBRARIES TO LINK WITH)
 SET ( ${EXE_NAME}_LINK_LIBRARIES
-    GUIQtViewers    
-    GUIQtVolumeRenderer
-    #${VTK_LIBRARIES}
-    ${QT_LIBRARIES}
-    QVTK
-    creaMaracasVisu
+    GUIQtViewers
   #    ${WXWIDGETS_LIBRARIES}
   #    ${KWWidgets_LIBRARIES}
   #    ${VTK_LIBRARIES}
index 1b531816e953d2b9e9704b0d67690561338823f1..76778d49b1f9ff32253aa41941de821fba1a601e 100644 (file)
@@ -58,6 +58,12 @@ int main(int argc, char **argv)
          }
     }else{
         std::string inputFilename = argv[1];
+
+        vtkMetaImageReader* reader = vtkMetaImageReader::New();
+        reader->SetFileName(inputFilename.c_str());
+        reader->Update();
+        img = reader->GetOutput();
+
     }
 
 
index 82143254e628df1dbbb1d929766c8563e2327c55..ecd2ced140d0afa6521d6c05798cafe955fffafd 100644 (file)
@@ -1 +1,2 @@
+ADD_SUBDIRECTORY(SurfaceRenderer)
 ADD_SUBDIRECTORY(VolumeRenderer)
index 4c8fa917fe90141995dd28f1c261d00f51531461..91ec24a6973ff4f5032d10bd74e6b3a5157234e2 100644 (file)
@@ -73,6 +73,8 @@ IF ( BUILD_${LIBRARY_NAME} )
   # if you need to create a static library
   # comment out the following line :
 
+  SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/creaMaracasVisu)
+  SET(${LIBRARY_NAME}_INSTALL_FOLDER creaMaracasVisu)
   CREA_ADD_LIBRARY( ${LIBRARY_NAME} )
   #SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES LINKER_LANGUAGE C)
 
index 6adf475c4a96a5b73f447a1919ba5fdd6186373e..3e3cf88de08382ee11f644d0328ec965956a83cc 100644 (file)
@@ -13,7 +13,11 @@ void VolumeRendererData::ShowVolume(bool checked){
     if(checked){
             invariant();
             VolRendData = new VolumeRendererManagerData(ImageData, true);
-            VolRendData->SetLookupTable(LookUpTable);
+            if(!LookUpTable){
+
+            }else{
+                VolRendData->SetLookupTable(LookUpTable);
+            }
             Renderer->AddActor(VolRendData->getProp3D());
     }else{
         Renderer->RemoveActor(VolRendData->getProp3D());
index 1011f013cb4119405d4f1d2ec015650567e3e84f..d670448a25b930efbba4c93cd2d8c0256f5097f9 100644 (file)
@@ -1,2 +1,3 @@
+ADD_SUBDIRECTORY(SurfaceRenderer)
 ADD_SUBDIRECTORY(Viewers)
 ADD_SUBDIRECTORY(VolumeRenderer)
index 2b7d5c7d645531c0aa3490d75f3e343844d02709..cabd6209923247824dff35eaee7723a21bb132e2 100644 (file)
@@ -88,7 +88,10 @@ IF ( BUILD_${LIBRARY_NAME} )
   #    ${BOOST_LIBRARIES}
     ${QT_LIBRARIES}
     QVTK
-    GUIQtVolumeRenderer
+
+    GUIQtVolumeRenderer    
+    GUIQtSurfaceRenderer
+
     KernelViewerWidgets
   # If this library must link against other libraries 
   # USER! : Add here any extra Library you need
@@ -104,6 +107,8 @@ IF ( BUILD_${LIBRARY_NAME} )
   # if you need to create a static library
   # comment out the following line :
 
+  SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/creaMaracasVisu)
+  SET(${LIBRARY_NAME}_INSTALL_FOLDER creaMaracasVisu)
   CREA_ADD_LIBRARY( ${LIBRARY_NAME} )
 
   # and uncomment the 2 lines hereafter:
index 3d9be6efc91cb4d925ae4dcb741e17e72abc3184..081107f7a4e05ffb597127915164c87095e66ae4 100644 (file)
@@ -11,6 +11,9 @@ QtVTKViewerWidget::QtVTKViewerWidget(QWidget *parent) :
 
     this->m_VolumeRender->SetRenderer(this->getRenderer());
     this->m_VolumeRender->SetInteractor(this->_qtvtkviewer->GetRenderWindow()->GetInteractor());
+
+    this->m_SurfaceRender->setRenderer(this->getRenderer());
+    this->m_SurfaceRender->setInteractor(this->_qtvtkviewer->GetRenderWindow()->GetInteractor());
 }
 
 QtVTKViewerWidget::~QtVTKViewerWidget()
@@ -25,11 +28,14 @@ vtkRenderer* QtVTKViewerWidget::getRenderer(){
 void QtVTKViewerWidget::setImage(vtkImageData* img){
     this->_qtvtkviewer->setImage(img);
     this->m_VolumeRender->SetImageData(img);
+    this->m_SurfaceRender->SetImageData(img);
+
 }
 
 void QtVTKViewerWidget::SetLookupTable(vtkLookupTable *lookuptable){
     this->_qtvtkviewer->SetLookupTable(lookuptable);
     this->m_VolumeRender->SetLookUpTable(lookuptable);
+
 }
 
 void QtVTKViewerWidget::on_checkBoxShowPlanes_clicked(){
index c9ba2728574320662b170afbe3c4721d5a83be9f..553d4b9a97dfb497f987b2b301b0b00cb00456b6 100644 (file)
@@ -2,6 +2,14 @@
 <ui version="4.0">
  <class>QtVTKViewerWidget</class>
  <widget class="QWidget" name="QtVTKViewerWidget">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>801</width>
+    <height>616</height>
+   </rect>
+  </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
       </sizepolicy>
      </property>
      <property name="currentIndex">
-      <number>1</number>
+      <number>2</number>
      </property>
      <widget class="QWidget" name="page">
       <property name="geometry">
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>239</width>
-        <height>417</height>
+        <width>98</width>
+        <height>28</height>
        </rect>
       </property>
       <attribute name="label">
@@ -57,8 +65,8 @@
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>176</width>
-        <height>417</height>
+        <width>98</width>
+        <height>28</height>
        </rect>
       </property>
       <attribute name="label">
        </property>
       </widget>
      </widget>
+     <widget class="QWidget" name="page_3">
+      <property name="geometry">
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>155</width>
+        <height>505</height>
+       </rect>
+      </property>
+      <attribute name="label">
+       <string>Surface Rendering</string>
+      </attribute>
+      <widget class="QtSurfaceRendererPanel" name="m_SurfaceRender" native="true">
+       <property name="geometry">
+        <rect>
+         <x>0</x>
+         <y>0</y>
+         <width>151</width>
+         <height>271</height>
+        </rect>
+       </property>
+      </widget>
+     </widget>
     </widget>
    </item>
    <item>
    <header>qtvolumerendererpanel.h</header>
    <container>1</container>
   </customwidget>
+  <customwidget>
+   <class>QtSurfaceRendererPanel</class>
+   <extends>QWidget</extends>
+   <header location="global">qtsurfacerendererpanel.h</header>
+   <container>1</container>
+  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
index 19f47cddd7e571a48008e0dc675d3e3287cf9188..dde40a2c13021d115b132c87d33a62258952b2e1 100644 (file)
@@ -104,6 +104,8 @@ IF ( BUILD_${LIBRARY_NAME} )
   # if you need to create a static library
   # comment out the following line :
 
+  SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/creaMaracasVisu)
+  SET(${LIBRARY_NAME}_INSTALL_FOLDER creaMaracasVisu)
   CREA_ADD_LIBRARY( ${LIBRARY_NAME} )
 
   # and uncomment the 2 lines hereafter:
index 82143254e628df1dbbb1d929766c8563e2327c55..b572d1b5af3f6e7c551f227705dbbb6493f2b3be 100644 (file)
@@ -1 +1,3 @@
+ADD_SUBDIRECTORY(SurfaceRenderer)
 ADD_SUBDIRECTORY(VolumeRenderer)
+
index 6419b4cafbf2115ae40e45215165d65040904152..294c230213b6ab4fa464e0db0af4e5e5060d3681 100644 (file)
@@ -73,6 +73,8 @@ IF ( BUILD_${LIBRARY_NAME} )
   # if you need to create a static library
   # comment out the following line :
 
+  SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/creaMaracasVisu)
+  SET(${LIBRARY_NAME}_INSTALL_FOLDER creaMaracasVisu)
   CREA_ADD_LIBRARY( ${LIBRARY_NAME} )
   SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES LINKER_LANGUAGE C)
 
index 21bc5bff1f00c832ad4ac3a60c485a5a2d6053c7..e9b0b1d69fdff63a3b07112874ffe4cc9a72c3a2 100644 (file)
@@ -1,4 +1,4 @@
 # Add a ADD_SUBDIRECTORY command for each of your libraries
 #ADD_SUBDIRECTORY(ITKVTK)
 ADD_SUBDIRECTORY(VTKObjects)
\ No newline at end of file
index 02b76be09feab58cf4190450ac288f626b6c67f8..d664bbacf923e2994bd3b93e519e4d2f6c1fa8ac 100644 (file)
@@ -1,2 +1,3 @@
+ADD_SUBDIRECTORY(SurfaceRenderer)
 ADD_SUBDIRECTORY(ViewerWidgets)
 ADD_SUBDIRECTORY(VolumeRenderer)
index fcacc56e5fd9685b0c77351159bcdb9fc181b54e..0f6533af53a7a1a89d9c97daa367a873fafccc0e 100644 (file)
@@ -102,6 +102,8 @@ IF ( BUILD_${LIBRARY_NAME} )
   # comment out the following line :
 
 
+  SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/creaMaracasVisu)
+  SET(${LIBRARY_NAME}_INSTALL_FOLDER creaMaracasVisu)
   CREA_ADD_LIBRARY( ${LIBRARY_NAME} )
 SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES LINKER_LANGUAGE C)
 
index 71c94f61bcb20c9b1c71808a4923ca7f226cda2f..2fcf9ca824b2a115ebc765f75e37fcf5f0d195e6 100644 (file)
@@ -102,6 +102,8 @@ IF ( BUILD_${LIBRARY_NAME} )
   # comment out the following line :
 
 
+  SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/creaMaracasVisu)
+  SET(${LIBRARY_NAME}_INSTALL_FOLDER creaMaracasVisu)
   CREA_ADD_LIBRARY( ${LIBRARY_NAME} )
 SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES LINKER_LANGUAGE C)
 
index 74dd5057e70f2a1f0867568bc610f3ae077c4871..ba1706c63b4298bc12540cddf4954d2cbc70ff9a 100644 (file)
@@ -141,6 +141,7 @@ VolumeRendererManagerData::~VolumeRendererManagerData()
 void VolumeRendererManagerData::EnableBoundingBox(vtkRenderWindowInteractor* interactor)
 {
 //EED9Juin2011    if(_volumeMappergpu){
+    if(!_boxWidgetS1){
         _boxWidgetS1 = vtkBoxWidget::New();
         _boxWidgetS1->SetInteractor( interactor );
         _boxWidgetS1->SetPlaceFactor(1.01);
@@ -161,14 +162,17 @@ void VolumeRendererManagerData::EnableBoundingBox(vtkRenderWindowInteractor* int
         callback->Delete();
         _boxWidgetS1->EnabledOn();
         _boxWidgetS1->GetSelectedFaceProperty()->SetOpacity(0.0);
+    }else{
+        _boxWidgetS1->EnabledOn();
+    }
 //EED9Juin2011  }
 }
 
 void VolumeRendererManagerData::DisableBoundingBox(){
     if(_boxWidgetS1){
         _boxWidgetS1->EnabledOff();
-        _boxWidgetS1->Delete();
-        _boxWidgetS1 = 0;
+        //_boxWidgetS1->Delete();
+        //_boxWidgetS1 = 0;
     }
 }