/*=========================================================================
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
=========================================================================*/
-#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)
//this->SetBackgroundColour( wxColour(255,0,255) );
}
//---------------------------------------------------------------------------
-wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent,
+creawxVTKRenderWindowInteractor::creawxVTKRenderWindowInteractor(wxWindow *parent,
wxWindowID id,
const wxPoint &pos,
const wxSize &size,
#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)
// 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
Initialized = 1;
}
//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Enable()
+void creawxVTKRenderWindowInteractor::Enable()
{
// if already enabled then done
if (Enabled)
Modified();
}
//---------------------------------------------------------------------------
-bool wxVTKRenderWindowInteractor::Enable(bool enable)
+bool creawxVTKRenderWindowInteractor::Enable(bool enable)
{
#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
return wxGLCanvas::Enable(enable);
#endif
}
//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Disable()
+void creawxVTKRenderWindowInteractor::Disable()
{
// if already disabled then done
if (!Enabled)
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 )
{
}
}
//---------------------------------------------------------------------------
-int wxVTKRenderWindowInteractor::CreateTimer(int WXUNUSED(timertype))
+int creawxVTKRenderWindowInteractor::CreateTimer(int WXUNUSED(timertype))
{
// it's a one shot timer
if (!timer.Start(10, TRUE))
}
//---------------------------------------------------------------------------
-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;
// 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;
return handle_tmp;
}
//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
+void creawxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
{
//must always be here
#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);
//Render();
}
//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event)
+void creawxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event)
{
if (!Enabled)
{
}
//---------------------------------------------------------------------------
#if !(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
-void wxVTKRenderWindowInteractor::OnEnter(wxMouseEvent &event)
+void creawxVTKRenderWindowInteractor::OnEnter(wxMouseEvent &event)
{
if (!Enabled)
{
#endif
}
//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnLeave(wxMouseEvent &event)
+void creawxVTKRenderWindowInteractor::OnLeave(wxMouseEvent &event)
{
if (!Enabled)
{
#endif
}
//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnKeyDown(wxKeyEvent &event)
+void creawxVTKRenderWindowInteractor::OnKeyDown(wxKeyEvent &event)
{
if (!Enabled)
{
event.Skip();
}
//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnKeyUp(wxKeyEvent &event)
+void creawxVTKRenderWindowInteractor::OnKeyUp(wxKeyEvent &event)
{
if (!Enabled)
{
}
#endif //!(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event)
+void creawxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event)
{
if (!Enabled || (ActiveButton != wxEVT_NULL))
{
}
}
//---------------------------------------------------------------------------
-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.
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)
}
//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Render()
+void creawxVTKRenderWindowInteractor::Render()
{
RenderAllowed = 1;
if (!RenderWhenDisabled)
}
}
//---------------------------------------------------------------------------
-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
//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.
// 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)
{
//---------------------------------------------------------------------------
//
//
-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
/*=========================================================================
Program: Visualization Toolkit
- Module: $RCSfile: wxVTKRenderWindowInteractor.h,v $
+ Module: $RCSfile: creawxVTKRenderWindowInteractor.h,v $
Language: C++
- Date: $Date: 2008/10/02 12:29:45 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2008/10/15 11:19:18 $
+ Version: $Revision: 1.1 $
Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
=========================================================================*/
-// .NAME wxVTKRenderWindowInteractor - class to enable VTK to render to
+// .NAME creawxVTKRenderWindowInteractor - class to enable VTK to render to
// and interact with wxWindow.
// .SECTION Description
-// wxVTKRenderWindowInteractor provide a VTK widget for wxWindow. This class
+// creawxVTKRenderWindowInteractor provide a VTK widget for wxWindow. This class
// was completely rewrote to have the 'Look & Feel' of the python version:
-// wxVTKRenderWindowInteractor.py
+// creawxVTKRenderWindowInteractor.py
// .SECTION Caveats
// - There is a know bug that prevent this class to works for more info see
// WX_USE_X_CAPTURE. This bug only affect wxGTK from 2.3.2 to wxGTK 2.4.0.
// - This class might not be easily readable as it tried to work with VTK 3.2
// and 4.x. This class doesn't support reparenting with VTK 4.2 and earlier.
// .SECTION see also
-// wxVTKRenderWindowInteractor.py wxVTKRenderWindow.py
+// creawxVTKRenderWindowInteractor.py creawxVTKRenderWindow.py
-#ifndef _wxVTKRenderWindowInteractor_h_
-#define _wxVTKRenderWindowInteractor_h_
+#ifndef _creawxVTKRenderWindowInteractor_h_
+#define _creawxVTKRenderWindowInteractor_h_
#include <creaSystem.h>
#include <creaWx.h>
// Motif version (renamed into wxX11 for wxWindow 2.4 and newer)
#if defined(__WXMOTIF__)
-# error This GUI is not supported by wxVTKRenderWindowInteractor for now
+# error This GUI is not supported by creawxVTKRenderWindowInteractor for now
#endif
#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-class CREA_EXPORT wxVTKRenderWindowInteractor : public wxGLCanvas, virtual public vtkRenderWindowInteractor
+class CREA_EXPORT creawxVTKRenderWindowInteractor : public wxGLCanvas, virtual public vtkRenderWindowInteractor
#else
-class CREA_EXPORT wxVTKRenderWindowInteractor : public wxWindow, virtual public vtkRenderWindowInteractor
+class CREA_EXPORT creawxVTKRenderWindowInteractor : public wxWindow, virtual public vtkRenderWindowInteractor
#endif //__WXGTK__
{
- DECLARE_DYNAMIC_CLASS(wxVTKRenderWindowInteractor)
+ DECLARE_DYNAMIC_CLASS(creawxVTKRenderWindowInteractor)
public:
//constructors
- wxVTKRenderWindowInteractor();
+ creawxVTKRenderWindowInteractor();
- wxVTKRenderWindowInteractor(wxWindow *parent,
+ creawxVTKRenderWindowInteractor(wxWindow *parent,
wxWindowID id,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxWANTS_CHARS | wxNO_FULL_REPAINT_ON_RESIZE,
const wxString &name = wxPanelNameStr);
//vtk ::New()
- static wxVTKRenderWindowInteractor * New();
+ static creawxVTKRenderWindowInteractor * New();
void PrintSelf(ostream& os, vtkIndent indent);
//destructor
- ~wxVTKRenderWindowInteractor();
+ ~creawxVTKRenderWindowInteractor();
#if defined(_WIN32)
- const char * wxVTKRenderWindowInteractor::GetClassName() const;
+ const char * creawxVTKRenderWindowInteractor::GetClassName() const;
#endif //_WIN32
// LG : EO namespace crea
//======================================================================
-#endif //_wxVTKRenderWindowInteractor_h_
+#endif //_creawxVTKRenderWindowInteractor_h_