]> Creatis software - crea.git/blobdiff - src/creawxVTKRenderWindowInteractor.mm
3388 TDx
[crea.git] / src / creawxVTKRenderWindowInteractor.mm
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();