wxVTKRenderWindowInteractor.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef _wxVTKRenderWindowInteractor_h_
00038 #define _wxVTKRenderWindowInteractor_h_
00039
00040
00041 #include "wx/wxprec.h"
00042
00043 #ifdef __BORLANDC__
00044 # pragma hdrstop
00045 #endif
00046
00047 #ifndef WX_PRECOMP
00048 #include <wx/wx.h>
00049 #endif
00050
00051 #include <wx/timer.h>
00052 #include <wx/dcclient.h>
00053
00054
00055 #include "vtkRenderWindowInteractor.h"
00056 #include "vtkRenderWindow.h"
00057
00058
00059
00060 #if (!wxCHECK_VERSION(2, 8, 0))
00061 #define USE_WXGLCANVAS
00062 #endif
00063
00064
00065 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
00066 # if wxUSE_GLCANVAS
00067 # include <wx/glcanvas.h>
00068 # else
00069 # error "problem of wxGLCanvas, you need to build wxWidgets with opengl"
00070 # endif //wxUSE_GLCANVAS
00071 #endif //__WXGTK__
00072
00073
00074 #if defined(__WXMOTIF__)
00075 # error This GUI is not supported by wxVTKRenderWindowInteractor for now
00076 #endif
00077
00078
00079 class wxPaintEvent;
00080 class wxMouseEvent;
00081 class wxTimerEvent;
00082 class wxKeyEvent;
00083 class wxSizeEvent;
00084
00085 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
00086 class VTK_RENDERING_EXPORT wxVTKRenderWindowInteractor : public wxGLCanvas, virtual public vtkRenderWindowInteractor
00087 #else
00088 class wxVTKRenderWindowInteractor : public wxWindow, virtual public vtkRenderWindowInteractor
00089 #endif //__WXGTK__
00090 {
00091 DECLARE_DYNAMIC_CLASS(wxVTKRenderWindowInteractor)
00092
00093 public:
00094
00095 wxVTKRenderWindowInteractor();
00096
00097 wxVTKRenderWindowInteractor(wxWindow *parent,
00098 wxWindowID id,
00099 const wxPoint &pos = wxDefaultPosition,
00100 const wxSize &size = wxDefaultSize,
00101 long style = wxWANTS_CHARS | wxNO_FULL_REPAINT_ON_RESIZE,
00102 const wxString &name = wxPanelNameStr);
00103
00104 static wxVTKRenderWindowInteractor * New();
00105 void PrintSelf(ostream& os, vtkIndent indent);
00106
00107
00108 ~wxVTKRenderWindowInteractor();
00109
00110 #if defined(_WIN32)
00111 const char * wxVTKRenderWindowInteractor::GetClassName() const;
00112 #endif //_WIN32
00113
00114
00115
00116 void Initialize();
00117 void Enable();
00118 bool Enable(bool enable);
00119 void Disable();
00120 void Start();
00121 void UpdateSize(int x, int y);
00122 int CreateTimer(int timertype);
00123 int DestroyTimer();
00124 void TerminateApp() {};
00125
00126
00127 void OnPaint(wxPaintEvent &event);
00128 void OnEraseBackground (wxEraseEvent& event);
00129 void OnMotion(wxMouseEvent &event);
00130
00131 void OnButtonDown(wxMouseEvent &event);
00132 void OnButtonUp(wxMouseEvent &event);
00133 #if !(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
00134 void OnEnter(wxMouseEvent &event);
00135 void OnLeave(wxMouseEvent &event);
00136 void OnKeyDown(wxKeyEvent &event);
00137 void OnKeyUp(wxKeyEvent &event);
00138 #endif
00139 void OnTimer(wxTimerEvent &event);
00140 void OnSize(wxSizeEvent &event);
00141 void OnMouseWheel(wxMouseEvent& event);
00142
00143 void Render()throw (char*);
00144 void SetRenderWhenDisabled(int newValue);
00145
00146
00147
00148
00149 vtkGetMacro(Stereo,int);
00150 vtkBooleanMacro(Stereo,int);
00151 virtual void SetStereo(int capable);
00152
00153
00154
00155
00156
00157 vtkSetMacro(UseCaptureMouse,int);
00158 vtkBooleanMacro(UseCaptureMouse,int);
00159
00160 protected:
00161 wxTimer timer;
00162 int ActiveButton;
00163 int RenderAllowed;
00164 long GetHandleHack();
00165 int Stereo;
00166
00167 private:
00168 long Handle;
00169 bool Created;
00170 int RenderWhenDisabled;
00171 int UseCaptureMouse;
00172
00173 DECLARE_EVENT_TABLE()
00174 };
00175
00176 #endif //_wxVTKRenderWindowInteractor_h_