00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00032 #ifndef __vtkWin32RenderWindowInteractor_h
00033 #define __vtkWin32RenderWindowInteractor_h
00034
00035 #include "vtkRenderWindowInteractor.h"
00036 #include "vtkWindows.h"
00037
00038 #include "vtkTDxConfigure.h"
00039 #ifdef VTK_USE_TDX
00040 class vtkTDxWinDevice;
00041 #endif
00042
00043 class VTK_RENDERING_EXPORT vtkWin32RenderWindowInteractor : public vtkRenderWindowInteractor
00044 {
00045 public:
00047 static vtkWin32RenderWindowInteractor *New();
00048
00049 vtkTypeRevisionMacro(vtkWin32RenderWindowInteractor,vtkRenderWindowInteractor);
00050 void PrintSelf(ostream& os, vtkIndent indent);
00051
00053 virtual void Initialize();
00054
00056
00063 virtual void Enable();
00064 virtual void Disable();
00066
00070 virtual void Start();
00071
00073
00078 vtkSetMacro(InstallMessageProc,int);
00079 vtkGetMacro(InstallMessageProc,int);
00080 vtkBooleanMacro(InstallMessageProc,int);
00082
00087 void TerminateApp(void);
00088
00089
00090 friend VTK_RENDERING_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l);
00091 friend VTK_RENDERING_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor *me);
00092
00094
00096 virtual void OnMouseMove (HWND wnd, UINT nFlags, int X, int Y);
00097 virtual void OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
00098 virtual void OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
00099 virtual void OnRButtonUp (HWND wnd, UINT nFlags, int X, int Y);
00100 virtual void OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
00101 virtual void OnMButtonUp (HWND wnd, UINT nFlags, int X, int Y);
00102 virtual void OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
00103 virtual void OnLButtonUp (HWND wnd, UINT nFlags, int X, int Y);
00104 virtual void OnSize (HWND wnd, UINT nType, int X, int Y);
00105 virtual void OnTimer (HWND wnd, UINT nIDEvent);
00106 virtual void OnKeyDown (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
00107 virtual void OnKeyUp (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
00108 virtual void OnChar (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
00109 virtual void OnMouseWheelForward (HWND wnd, UINT nFlags, int X, int Y);
00110 virtual void OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
00111 virtual void OnFocus(HWND wnd, UINT nFlags);
00112 virtual void OnKillFocus(HWND wnd, UINT nFlags);
00113
00115
00117
00121 static void SetClassExitMethod(void (*f)(void *), void *arg);
00122 static void SetClassExitMethodArgDelete(void (*f)(void *));
00124
00127 virtual void ExitCallback();
00128
00129 protected:
00130 vtkWin32RenderWindowInteractor();
00131 ~vtkWin32RenderWindowInteractor();
00132
00133 HWND WindowId;
00134 WNDPROC OldProc;
00135 int InstallMessageProc;
00136 int MouseInWindow;
00137 int StartedMessageLoop;
00138
00139
00141
00144 static void (*ClassExitMethod)(void *);
00145 static void (*ClassExitMethodArgDelete)(void *);
00146 static void *ClassExitMethodArg;
00147
00149
00151
00153 virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
00154 virtual int InternalDestroyTimer(int platformTimerId);
00156
00157 #ifdef VTK_USE_TDX
00158 vtkTDxWinDevice *Device;
00159 #endif
00160
00161 private:
00162 vtkWin32RenderWindowInteractor(const vtkWin32RenderWindowInteractor&);
00163 void operator=(const vtkWin32RenderWindowInteractor&);
00164 };
00165
00166 #endif
00167