]> Creatis software - crea.git/blobdiff - src/creawxVTKRenderWindowInteractor.cxx
*** empty log message ***
[crea.git] / src / creawxVTKRenderWindowInteractor.cxx
similarity index 81%
rename from src/wxVTKRenderWindowInteractor.cxx
rename to src/creawxVTKRenderWindowInteractor.cxx
index e6c0161acb8b2aa16380add08289a896ac1455ec..e8206e72bba407492f56342049e375c6858b5358 100644 (file)
@@ -1,9 +1,9 @@
 /*=========================================================================
 
   Program:   Visualization Toolkit
-  Module:    $RCSfile: wxVTKRenderWindowInteractor.cxx,v $
+  Module:    $RCSfile: creawxVTKRenderWindowInteractor.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/09/26 14:09:55 $
+  Date:      $Date: 2008/10/15 11:19:18 $
   Version:   $Revision: 1.1 $
 
   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
@@ -16,7 +16,7 @@
 
 =========================================================================*/
 
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
 
 //This is needed for vtk 3.1 :
 #ifndef VTK_MAJOR_VERSION
 #  define WX_USE_X_CAPTURE 1
 #endif
 
-#define ID_wxVTKRenderWindowInteractor_TIMER 1001
+#define ID_creawxVTKRenderWindowInteractor_TIMER 1001
 
 namespace crea
 {
 
 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-IMPLEMENT_DYNAMIC_CLASS(wxVTKRenderWindowInteractor, wxGLCanvas)
+IMPLEMENT_DYNAMIC_CLASS(creawxVTKRenderWindowInteractor, wxGLCanvas)
 #else
-IMPLEMENT_DYNAMIC_CLASS(wxVTKRenderWindowInteractor, wxWindow)
+IMPLEMENT_DYNAMIC_CLASS(creawxVTKRenderWindowInteractor, wxWindow)
 #endif  //__WXGTK__
 
 //---------------------------------------------------------------------------
 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-BEGIN_EVENT_TABLE(wxVTKRenderWindowInteractor, wxGLCanvas)
+BEGIN_EVENT_TABLE(creawxVTKRenderWindowInteractor, wxGLCanvas)
 #else
-BEGIN_EVENT_TABLE(wxVTKRenderWindowInteractor, wxWindow)
+BEGIN_EVENT_TABLE(creawxVTKRenderWindowInteractor, wxWindow)
 #endif //__WXGTK__
   //refresh window by doing a Render
-  EVT_PAINT       (wxVTKRenderWindowInteractor::OnPaint)
-  EVT_ERASE_BACKGROUND(wxVTKRenderWindowInteractor::OnEraseBackground)
-  EVT_MOTION      (wxVTKRenderWindowInteractor::OnMotion)
+  EVT_PAINT       (creawxVTKRenderWindowInteractor::OnPaint)
+  EVT_ERASE_BACKGROUND(creawxVTKRenderWindowInteractor::OnEraseBackground)
+  EVT_MOTION      (creawxVTKRenderWindowInteractor::OnMotion)
 
   //Bind the events to the event converters
-  EVT_LEFT_DOWN   (wxVTKRenderWindowInteractor::OnButtonDown)
-  EVT_MIDDLE_DOWN (wxVTKRenderWindowInteractor::OnButtonDown)
-  EVT_RIGHT_DOWN  (wxVTKRenderWindowInteractor::OnButtonDown)
-  EVT_LEFT_UP     (wxVTKRenderWindowInteractor::OnButtonUp)
-  EVT_MIDDLE_UP   (wxVTKRenderWindowInteractor::OnButtonUp)
-  EVT_RIGHT_UP    (wxVTKRenderWindowInteractor::OnButtonUp)
+  EVT_LEFT_DOWN   (creawxVTKRenderWindowInteractor::OnButtonDown)
+  EVT_MIDDLE_DOWN (creawxVTKRenderWindowInteractor::OnButtonDown)
+  EVT_RIGHT_DOWN  (creawxVTKRenderWindowInteractor::OnButtonDown)
+  EVT_LEFT_UP     (creawxVTKRenderWindowInteractor::OnButtonUp)
+  EVT_MIDDLE_UP   (creawxVTKRenderWindowInteractor::OnButtonUp)
+  EVT_RIGHT_UP    (creawxVTKRenderWindowInteractor::OnButtonUp)
 #if !(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
-  EVT_ENTER_WINDOW(wxVTKRenderWindowInteractor::OnEnter)
-  EVT_LEAVE_WINDOW(wxVTKRenderWindowInteractor::OnLeave)
-  EVT_MOUSEWHEEL  (wxVTKRenderWindowInteractor::OnMouseWheel)
+  EVT_ENTER_WINDOW(creawxVTKRenderWindowInteractor::OnEnter)
+  EVT_LEAVE_WINDOW(creawxVTKRenderWindowInteractor::OnLeave)
+  EVT_MOUSEWHEEL  (creawxVTKRenderWindowInteractor::OnMouseWheel)
 // If we use EVT_KEY_DOWN instead of EVT_CHAR, capital versions
 // of all characters are always returned.  EVT_CHAR also performs
 // other necessary keyboard-dependent translations.
-  //EVT_KEY_DOWN    (wxVTKRenderWindowInteractor::OnKeyDown)
-  EVT_CHAR        (wxVTKRenderWindowInteractor::OnKeyDown)
-  EVT_KEY_UP      (wxVTKRenderWindowInteractor::OnKeyUp)
+  //EVT_KEY_DOWN    (creawxVTKRenderWindowInteractor::OnKeyDown)
+  EVT_CHAR        (creawxVTKRenderWindowInteractor::OnKeyDown)
+  EVT_KEY_UP      (creawxVTKRenderWindowInteractor::OnKeyUp)
 #endif
-  EVT_TIMER       (ID_wxVTKRenderWindowInteractor_TIMER, wxVTKRenderWindowInteractor::OnTimer)
-  EVT_SIZE        (wxVTKRenderWindowInteractor::OnSize)
+  EVT_TIMER       (ID_creawxVTKRenderWindowInteractor_TIMER, creawxVTKRenderWindowInteractor::OnTimer)
+  EVT_SIZE        (creawxVTKRenderWindowInteractor::OnSize)
 END_EVENT_TABLE()
 
 //---------------------------------------------------------------------------
 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : vtkRenderWindowInteractor(), wxGLCanvas()
+creawxVTKRenderWindowInteractor::creawxVTKRenderWindowInteractor() : vtkRenderWindowInteractor(), wxGLCanvas()
 #else
-wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : vtkRenderWindowInteractor(), wxWindow()
+creawxVTKRenderWindowInteractor::creawxVTKRenderWindowInteractor() : vtkRenderWindowInteractor(), wxWindow()
 #endif //__WXGTK__
-      , timer(this, ID_wxVTKRenderWindowInteractor_TIMER)
+      , timer(this, ID_creawxVTKRenderWindowInteractor_TIMER)
       , ActiveButton(wxEVT_NULL)
       , RenderAllowed(0)
       , Stereo(0)
@@ -149,7 +149,7 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : vtkRenderWindowInte
   //this->SetBackgroundColour( wxColour(255,0,255) );
 }
 //---------------------------------------------------------------------------
-wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent,
+creawxVTKRenderWindowInteractor::creawxVTKRenderWindowInteractor(wxWindow *parent,
                                                          wxWindowID id,
                                                          const wxPoint &pos,
                                                          const wxSize &size,
@@ -160,7 +160,7 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent,
 #else
       : vtkRenderWindowInteractor(), wxWindow(parent, id, pos, size, style, name)
 #endif //__WXGTK__
-      , timer(this, ID_wxVTKRenderWindowInteractor_TIMER)
+      , timer(this, ID_creawxVTKRenderWindowInteractor_TIMER)
       , ActiveButton(wxEVT_NULL)
       , RenderAllowed(0)
       , Stereo(0)
@@ -177,20 +177,20 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent,
   // this->SetBackgroundColour( wxColour(255,0,0) );
 }
 //---------------------------------------------------------------------------
-wxVTKRenderWindowInteractor::~wxVTKRenderWindowInteractor()
+creawxVTKRenderWindowInteractor::~creawxVTKRenderWindowInteractor()
 {   
   // LG : trompe la mort !
   SetRenderWindow(NULL);
   SetReferenceCount(0);
 }
 //---------------------------------------------------------------------------
-wxVTKRenderWindowInteractor * wxVTKRenderWindowInteractor::New()
+creawxVTKRenderWindowInteractor * creawxVTKRenderWindowInteractor::New()
 {
   // we don't make use of the objectfactory, because we're not registered
-  return new wxVTKRenderWindowInteractor;
+  return new creawxVTKRenderWindowInteractor;
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Initialize()
+void creawxVTKRenderWindowInteractor::Initialize()
 {
   int *size = RenderWindow->GetSize();
   // enable everything and start rendering
@@ -205,7 +205,7 @@ void wxVTKRenderWindowInteractor::Initialize()
   Initialized = 1;
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Enable()
+void creawxVTKRenderWindowInteractor::Enable()
 {
   // if already enabled then done
   if (Enabled)
@@ -219,7 +219,7 @@ void wxVTKRenderWindowInteractor::Enable()
   Modified();
 }
 //---------------------------------------------------------------------------
-bool wxVTKRenderWindowInteractor::Enable(bool enable)
+bool creawxVTKRenderWindowInteractor::Enable(bool enable)
 {
 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
   return wxGLCanvas::Enable(enable);
@@ -228,7 +228,7 @@ bool wxVTKRenderWindowInteractor::Enable(bool enable)
 #endif
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Disable()
+void creawxVTKRenderWindowInteractor::Disable()
 {
   // if already disabled then done
   if (!Enabled)
@@ -239,14 +239,14 @@ void wxVTKRenderWindowInteractor::Disable()
   Modified();
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Start()
+void creawxVTKRenderWindowInteractor::Start()
 {
   // the interactor cannot control the event loop
-  vtkErrorMacro( << "wxVTKRenderWindowInteractor::Start() "
+  vtkErrorMacro( << "creawxVTKRenderWindowInteractor::Start() "
     "interactor cannot control event loop.");
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::UpdateSize(int x, int y)
+void creawxVTKRenderWindowInteractor::UpdateSize(int x, int y)
 {
   if( RenderWindow )
   {
@@ -262,7 +262,7 @@ void wxVTKRenderWindowInteractor::UpdateSize(int x, int y)
   }
 }
 //---------------------------------------------------------------------------
-int wxVTKRenderWindowInteractor::CreateTimer(int WXUNUSED(timertype))
+int creawxVTKRenderWindowInteractor::CreateTimer(int WXUNUSED(timertype))
 {
   // it's a one shot timer
   if (!timer.Start(10, TRUE))
@@ -272,13 +272,13 @@ int wxVTKRenderWindowInteractor::CreateTimer(int WXUNUSED(timertype))
   
 }
 //---------------------------------------------------------------------------
-int wxVTKRenderWindowInteractor::DestroyTimer()
+int creawxVTKRenderWindowInteractor::DestroyTimer()
 {
   // do nothing
   return 1;
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnTimer(wxTimerEvent& WXUNUSED(event))
+void creawxVTKRenderWindowInteractor::OnTimer(wxTimerEvent& WXUNUSED(event))
 {
   if (!Enabled)
     return;
@@ -301,7 +301,7 @@ void wxVTKRenderWindowInteractor::OnTimer(wxTimerEvent& WXUNUSED(event))
 // Anyway if this happen to break for you then compare to a recent version of wxPython
 // and look for the function long wxPyGetWinHandle(wxWindow* win)
 // in wxPython/src/helpers.cpp
-long wxVTKRenderWindowInteractor::GetHandleHack()
+long creawxVTKRenderWindowInteractor::GetHandleHack()
 {
   //helper function to hide the MSW vs GTK stuff
   long handle_tmp = 0;
@@ -339,7 +339,7 @@ long wxVTKRenderWindowInteractor::GetHandleHack()
   return handle_tmp;
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
+void creawxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
 {
 
   //must always be here
@@ -355,26 +355,26 @@ void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
 #endif //__WXMSW__
   }
   // get vtk to render to the wxWindows
-  //bbtkDebugMessage("Wx",9,"wxVTKRenderWindowInteractor::OnPaint"<<std::endl);
-  //std::cout << "wxVTKRenderWindowInteractor::OnPaint"<<std::endl;
+  //bbtkDebugMessage("Wx",9,"creawxVTKRenderWindowInteractor::OnPaint"<<std::endl);
+  //std::cout << "creawxVTKRenderWindowInteractor::OnPaint"<<std::endl;
   Render();
 
 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-  //  bbtkDebugMessage("Core",9,"wxVTKRenderWindowInteractor::OnPaint   public wxGLCanvas, virtual public vtkRenderWindowInteractor  \n");
+  //  bbtkDebugMessage("Core",9,"creawxVTKRenderWindowInteractor::OnPaint   public wxGLCanvas, virtual public vtkRenderWindowInteractor  \n");
 #else
-  //  bbtkDebugMessage("Core",9,"wxVTKRenderWindowInteractor::OnPaint public wxWindow, virtual public vtkRenderWindowInteractor     \n");
+  //  bbtkDebugMessage("Core",9,"creawxVTKRenderWindowInteractor::OnPaint public wxWindow, virtual public vtkRenderWindowInteractor     \n");
 #endif //__WXGTK__
 
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnEraseBackground(wxEraseEvent &event)
+void creawxVTKRenderWindowInteractor::OnEraseBackground(wxEraseEvent &event)
 {
-  //printf("EED wxVTKRenderWindowInteractor::OnEraseBackground \n");
+  //printf("EED creawxVTKRenderWindowInteractor::OnEraseBackground \n");
   //turn off background erase to reduce flickering on MSW
   event.Skip(false);
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnSize(wxSizeEvent& WXUNUSED(event))
+void creawxVTKRenderWindowInteractor::OnSize(wxSizeEvent& WXUNUSED(event))
 {
   int w, h;
   GetClientSize(&w, &h);
@@ -392,7 +392,7 @@ void wxVTKRenderWindowInteractor::OnSize(wxSizeEvent& WXUNUSED(event))
   //Render();
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event)
+void creawxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event)
 {
  if (!Enabled) 
     {
@@ -411,7 +411,7 @@ void wxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event)
 }
 //---------------------------------------------------------------------------
 #if !(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
-void wxVTKRenderWindowInteractor::OnEnter(wxMouseEvent &event)
+void creawxVTKRenderWindowInteractor::OnEnter(wxMouseEvent &event)
 {
   if (!Enabled) 
     {
@@ -431,7 +431,7 @@ void wxVTKRenderWindowInteractor::OnEnter(wxMouseEvent &event)
 #endif
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnLeave(wxMouseEvent &event)
+void creawxVTKRenderWindowInteractor::OnLeave(wxMouseEvent &event)
 {
   if (!Enabled) 
     {
@@ -451,7 +451,7 @@ void wxVTKRenderWindowInteractor::OnLeave(wxMouseEvent &event)
 #endif
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnKeyDown(wxKeyEvent &event)
+void creawxVTKRenderWindowInteractor::OnKeyDown(wxKeyEvent &event)
 {
   if (!Enabled) 
     {
@@ -480,7 +480,7 @@ void wxVTKRenderWindowInteractor::OnKeyDown(wxKeyEvent &event)
   event.Skip();
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnKeyUp(wxKeyEvent &event)
+void creawxVTKRenderWindowInteractor::OnKeyUp(wxKeyEvent &event)
 {
   if (!Enabled) 
     {
@@ -508,7 +508,7 @@ void wxVTKRenderWindowInteractor::OnKeyUp(wxKeyEvent &event)
 }
 #endif //!(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event)
+void creawxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event)
 {
   if (!Enabled || (ActiveButton != wxEVT_NULL))
     {
@@ -564,7 +564,7 @@ void wxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event)
   }
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event)
+void creawxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event)
 {
   //EVT_xxx_DOWN == EVT_xxx_UP - 1
   //This is only needed if two mouse buttons are pressed at the same time.
@@ -621,7 +621,7 @@ void wxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event)
   ActiveButton = wxEVT_NULL;
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnMouseWheel(wxMouseEvent& event)
+void creawxVTKRenderWindowInteractor::OnMouseWheel(wxMouseEvent& event)
 {
 // Mouse wheel was only added after VTK 4.4 (I think...)
 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 2)
@@ -647,7 +647,7 @@ void wxVTKRenderWindowInteractor::OnMouseWheel(wxMouseEvent& event)
 }
 
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Render()
+void creawxVTKRenderWindowInteractor::Render()
 {
   RenderAllowed = 1;
   if (!RenderWhenDisabled)
@@ -684,7 +684,7 @@ void wxVTKRenderWindowInteractor::Render()
     }
 }
 //---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::SetRenderWhenDisabled(int newValue)
+void creawxVTKRenderWindowInteractor::SetRenderWhenDisabled(int newValue)
 {
   //Change value of __RenderWhenDisabled ivar.
   //If __RenderWhenDisabled is false (the default), this widget will not
@@ -698,7 +698,7 @@ void wxVTKRenderWindowInteractor::SetRenderWhenDisabled(int newValue)
   //prevent re-entrancy of code) and then handling all outstanding
   //GUI events.
         
-  //However, this often triggers an OnPaint() method for wxVTKRWIs,
+  //However, this often triggers an OnPaint() method for creawxVTKRWIs,
   //resulting in a Render(), resulting in Update() being called whilst
   //still in progress.
 
@@ -709,7 +709,7 @@ void wxVTKRenderWindowInteractor::SetRenderWhenDisabled(int newValue)
 // Set the variable that indicates that we want a stereo capable window
 // be created. This method can only be called before a window is realized.
 //
-void wxVTKRenderWindowInteractor::SetStereo(int capable)
+void creawxVTKRenderWindowInteractor::SetStereo(int capable)
 {
   if (Stereo != capable)
     {
@@ -723,16 +723,16 @@ void wxVTKRenderWindowInteractor::SetStereo(int capable)
 //---------------------------------------------------------------------------
 //
 //
-void wxVTKRenderWindowInteractor::PrintSelf(ostream& os, vtkIndent indent)
+void creawxVTKRenderWindowInteractor::PrintSelf(ostream& os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os, indent);
 }
 
 
 #if defined(_WIN32)
-const char * wxVTKRenderWindowInteractor::GetClassName() const
+const char * creawxVTKRenderWindowInteractor::GetClassName() const
 {
-  return "wxVTKRenderWindowInteractor";
+  return "creawxVTKRenderWindowInteractor";
 }
 #endif //_WIN32