From 5e2ead6bede930b7c36d4ea2bf55a4214eec7513 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Wed, 27 Oct 2021 17:04:57 +0200 Subject: [PATCH] 3388 TDx --- cmake/CREAMacro_FindAndUseVTK.cmake | 4 +- cmake/CREAMacro_FindAndUseWxWidgets.cmake | 3 ++ lib/creaDevManagerLib/modelCDMPackageSrc.cpp | 11 +++- src/creawxVTKRenderWindowInteractor.h | 11 ++++ src/creawxVTKRenderWindowInteractor.mm | 55 ++++++++++++++++++++ 5 files changed, 81 insertions(+), 3 deletions(-) diff --git a/cmake/CREAMacro_FindAndUseVTK.cmake b/cmake/CREAMacro_FindAndUseVTK.cmake index 7d1518c..969efae 100644 --- a/cmake/CREAMacro_FindAndUseVTK.cmake +++ b/cmake/CREAMacro_FindAndUseVTK.cmake @@ -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) diff --git a/cmake/CREAMacro_FindAndUseWxWidgets.cmake b/cmake/CREAMacro_FindAndUseWxWidgets.cmake index eaf52dd..baf698e 100644 --- a/cmake/CREAMacro_FindAndUseWxWidgets.cmake +++ b/cmake/CREAMacro_FindAndUseWxWidgets.cmake @@ -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}) diff --git a/lib/creaDevManagerLib/modelCDMPackageSrc.cpp b/lib/creaDevManagerLib/modelCDMPackageSrc.cpp index 4654e58..862da27 100644 --- a/lib/creaDevManagerLib/modelCDMPackageSrc.cpp +++ b/lib/creaDevManagerLib/modelCDMPackageSrc.cpp @@ -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 diff --git a/src/creawxVTKRenderWindowInteractor.h b/src/creawxVTKRenderWindowInteractor.h index 7118318..b465e3c 100644 --- a/src/creawxVTKRenderWindowInteractor.h +++ b/src/creawxVTKRenderWindowInteractor.h @@ -99,6 +99,12 @@ #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; diff --git a/src/creawxVTKRenderWindowInteractor.mm b/src/creawxVTKRenderWindowInteractor.mm index 6bc66c2..578c3a3 100644 --- a/src/creawxVTKRenderWindowInteractor.mm +++ b/src/creawxVTKRenderWindowInteractor.mm @@ -81,6 +81,12 @@ #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(); -- 2.45.1