00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00035 #ifndef __vtkWin32RenderWindowInteractor_h
00036 #define __vtkWin32RenderWindowInteractor_h
00037
00038 #include "vtkRenderWindowInteractor.h"
00039 #include "vtkWindows.h"
00040
00041
00042 class VTK_RENDERING_EXPORT vtkWin32RenderWindowInteractor : public vtkRenderWindowInteractor
00043 {
00044 public:
00046 static vtkWin32RenderWindowInteractor *New();
00047
00048 vtkTypeRevisionMacro(vtkWin32RenderWindowInteractor,vtkRenderWindowInteractor);
00049 void PrintSelf(ostream& os, vtkIndent indent);
00050
00052 virtual void Initialize();
00053
00055
00062 virtual void Enable();
00063 virtual void Disable();
00065
00069 virtual void Start();
00070
00072
00077 vtkSetMacro(InstallMessageProc,int);
00078 vtkGetMacro(InstallMessageProc,int);
00079 vtkBooleanMacro(InstallMessageProc,int);
00081
00086 void TerminateApp(void);
00087
00088
00089 friend VTK_RENDERING_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l);
00090 friend VTK_RENDERING_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor *me);
00091
00093
00095 virtual void OnMouseMove (HWND wnd, UINT nFlags, int X, int Y);
00096 virtual void OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
00097 virtual void OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
00098 virtual void OnRButtonUp (HWND wnd, UINT nFlags, int X, int Y);
00099 virtual void OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
00100 virtual void OnMButtonUp (HWND wnd, UINT nFlags, int X, int Y);
00101 virtual void OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
00102 virtual void OnLButtonUp (HWND wnd, UINT nFlags, int X, int Y);
00103 virtual void OnSize (HWND wnd, UINT nType, int X, int Y);
00104 virtual void OnTimer (HWND wnd, UINT nIDEvent);
00105 virtual void OnKeyDown (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
00106 virtual void OnKeyUp (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
00107 virtual void OnChar (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
00108 virtual void OnMouseWheelForward (HWND wnd, UINT nFlags, int X, int Y);
00109 virtual void OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
00110
00112
00114
00118 static void SetClassExitMethod(void (*f)(void *), void *arg);
00119 static void SetClassExitMethodArgDelete(void (*f)(void *));
00121
00124 virtual void ExitCallback();
00125
00126 protected:
00127 vtkWin32RenderWindowInteractor();
00128 ~vtkWin32RenderWindowInteractor();
00129
00130 HWND WindowId;
00131 WNDPROC OldProc;
00132 int InstallMessageProc;
00133 int MouseInWindow;
00134 int StartedMessageLoop;
00135
00136
00138
00141 static void (*ClassExitMethod)(void *);
00142 static void (*ClassExitMethodArgDelete)(void *);
00143 static void *ClassExitMethodArg;
00144
00146
00148
00150 virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
00151 virtual int InternalDestroyTimer(int platformTimerId);
00153
00154 private:
00155 vtkWin32RenderWindowInteractor(const vtkWin32RenderWindowInteractor&);
00156 void operator=(const vtkWin32RenderWindowInteractor&);
00157 };
00158
00159 #endif
00160