X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreawxVTKRenderWindowInteractor.mm;h=578c3a36ac4a925008d8b224af635a1928211fed;hb=5e2ead6bede930b7c36d4ea2bf55a4214eec7513;hp=6bc66c2f2df9f15d6c850d60dd77f9d99c83e92a;hpb=c9546c365ab501557bfd5793034730cfc3fb019d;p=crea.git 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();