]> Creatis software - crea.git/commitdiff
3388 TDx
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 27 Oct 2021 15:04:57 +0000 (17:04 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 27 Oct 2021 15:04:57 +0000 (17:04 +0200)
cmake/CREAMacro_FindAndUseVTK.cmake
cmake/CREAMacro_FindAndUseWxWidgets.cmake
lib/creaDevManagerLib/modelCDMPackageSrc.cpp
src/creawxVTKRenderWindowInteractor.h
src/creawxVTKRenderWindowInteractor.mm

index 7d1518c6d9573de59218aedc012cfdefe953834b..969efaeb01e24eb4205fb31dfb72b0bf51a8dd08 100644 (file)
@@ -206,13 +206,15 @@ ENDIF("${VTK_MAJOR_VERSION}" LESS 6)
        IF (WIN32)
          SET(VTK_LIBRARIES ${VTK_LIBRARIES} )
     ELSE(WIN32)
-         SET(VTK_LIBRARIES ${VTK_LIBRARIES} 
+         SET(VTK_LIBRARIES ${VTK_LIBRARIES}   
 #          vtkRenderingQt
 #          vtkGUISupportQt            
 #          vtkGUISupportQtSQL         
 #          vtkViewsQt
 #          vtkNetCDF_cxx       
+               vtkRenderingTDx
                )
+    message("EED vtk libraries: "${VTK_LIBRARIES})
        ENDIF(WIN32)
        
        
index eaf52dd73518826a1cf7e035699cd44d9a750abe..baf698e29f2d2afcc7f2b0c67dcb686729e8770b 100644 (file)
@@ -140,6 +140,9 @@ MACRO(CREA_USE_WXWIDGETS)
         SET(WXWIDGETS_LIBRARIES
             ${wxWidgets_LIBRARIES}
         )
+
+message("EED WXWIDGETS_LIBRARIES: "  ${WXWIDGETS_LIBRARIES} )
+
     ELSEIF(APPLE)
                ##    # GTK2
                ##    INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
index 4654e58cf3a462951eafd26a048c4f4e8c58aa79..862da27c8f8f29ef3f8997015b45616ced1b7290 100644 (file)
@@ -231,8 +231,13 @@ modelCDMBlackBox* modelCDMPackageSrc::CreateBlackBox(
   command += " \"" + bbDescription + "\"";
   command += " \"" + bbCategories + "\"";
 
+    
+#ifndef APPLE
+    command = "source ~/.bbtk/profile_creatools ; " + command;
+#endif
+    
   //excecute command
-  //wxMessageBox(crea::std2wx("Command: ->" + command + "<-"),_T("Creating Black Box"),wxOK | wxICON_INFORMATION);
+//  wxMessageBox(crea::std2wx("Command: ->" + command + "<-"),_T("Creating Black Box"),wxOK | wxICON_INFORMATION);
   if(system(command.c_str()))
     {
       result = new std::string("Error executing command '" + command + "'");
@@ -246,7 +251,7 @@ modelCDMBlackBox* modelCDMPackageSrc::CreateBlackBox(
   modelCDMFile* header = NULL;
   modelCDMFile* source = NULL;
   wxDir dir(crea::std2wx(path));
-  if (dir.IsOpened())
+    if (dir.IsOpened())
     {
       wxString fileName;
       bool cont = dir.GetFirst(&fileName, crea::std2wx("bb"+package+bbName+".h"), wxDIR_FILES);
@@ -263,6 +268,8 @@ modelCDMBlackBox* modelCDMPackageSrc::CreateBlackBox(
         }
     }
   //if source and header exist
+    
+    
   if (header != NULL && source != NULL)
     {
       //create black box
index 7118318fac73910b0301264da090c0244aebd6a8..b465e3c5ea240efd155a1df89917fb5b9c12fa8e 100644 (file)
 
 #include "creaSystem.h"
 
+#include "vtkTDxConfigure.h" // defines VTK_USE_TDX
+#ifdef VTK_USE_TDX
+class vtkTDxMacDevice;
+#endif
+
+
 
 // wx forward declarations
 class wxPaintEvent;
@@ -207,6 +213,11 @@ class CREA_EXPORT wxVTKRenderWindowInteractor : public wxWindow, public vtkRende
     long GetHandleHack();
     int Stereo;
     
+#ifdef VTK_USE_TDX
+  vtkTDxMacDevice *Device;
+#endif
+
+    
   private:
     long Handle;
     bool Created;
index 6bc66c2f2df9f15d6c850d60dd77f9d99c83e92a..578c3a36ac4a925008d8b224af635a1928211fed 100644 (file)
 #endif
 
 
+#ifdef VTK_USE_TDX
+// #import "vtkTDxMacDevice.h"
+#import "/Users/davila/Creatis/C11/tpli/include/vtk-8.2/vtkTDxMacDevice.h"
+#endif
+
+
 //=======================================================================
 // LG : NAMESPACE IS NECESSARY TO AVOID CONFLICTING SYMBOLS IN DYN LIBS
 namespace crea
@@ -270,6 +276,12 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor()
   this->RenderWindow = NULL;
   this->SetRenderWindow(vtkRenderWindow::New());
   this->RenderWindow->Delete();
+    
+#ifdef VTK_USE_TDX
+    this->Device=vtkTDxMacDevice::New();
+#endif
+
+    
 }
 //---------------------------------------------------------------------------
 wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent,
@@ -310,6 +322,13 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent,
   // so we update the size information of the interactor/renderwindow here
   this->UpdateSize(size.x, size.y);
 #endif
+    
+
+#ifdef VTK_USE_TDX
+    this->Device=vtkTDxMacDevice::New();
+#endif
+
+    
 }
 //---------------------------------------------------------------------------
 wxVTKRenderWindowInteractor::~wxVTKRenderWindowInteractor()
@@ -319,6 +338,11 @@ wxVTKRenderWindowInteractor::~wxVTKRenderWindowInteractor()
 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
   delete this->context;
 #endif
+    
+#ifdef VTK_USE_TDX
+  this->Device->Delete();
+#endif
+
 }
 //---------------------------------------------------------------------------
 wxVTKRenderWindowInteractor * wxVTKRenderWindowInteractor::New()
@@ -353,11 +377,34 @@ void wxVTKRenderWindowInteractor::Enable()
 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
   wxGLCanvas::SetCurrent(*this->context);
 #endif
+
+//EED 2010-10-14
+#ifdef VTK_USE_TDX
+  if(this->UseTDx)
+  {
+    this->Device->SetInteractor(this);
+    this->Device->Initialize();
+  }
+#endif
+
+    
+    
   Modified();
 }
 //---------------------------------------------------------------------------
 bool wxVTKRenderWindowInteractor::Enable(bool enable)
 {
+    
+#ifdef VTK_USE_TDX
+  if(this->UseTDx)
+  {
+    this->Device->SetInteractor(this);
+    this->Device->Initialize();
+  }
+#endif
+
+    
+    
 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
   return wxGLCanvas::Enable(enable);
 #else
@@ -371,6 +418,14 @@ void wxVTKRenderWindowInteractor::Disable()
   if (!Enabled)
     return;
 
+#ifdef VTK_USE_TDX
+  if(this->Device->GetInitialized())
+  {
+    this->Device->Close();
+  }
+#endif
+    
+    
   // that's it (we can't remove the event handler like it should be...)
   Enabled = 0;
   Modified();