VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkWin32RenderWindowInteractor.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00032 #ifndef __vtkWin32RenderWindowInteractor_h 00033 #define __vtkWin32RenderWindowInteractor_h 00034 00035 #include "vtkRenderWindowInteractor.h" 00036 #include "vtkWindows.h" // For windows API. 00037 00038 00039 class VTK_RENDERING_EXPORT vtkWin32RenderWindowInteractor : public vtkRenderWindowInteractor 00040 { 00041 public: 00043 static vtkWin32RenderWindowInteractor *New(); 00044 00045 vtkTypeRevisionMacro(vtkWin32RenderWindowInteractor,vtkRenderWindowInteractor); 00046 void PrintSelf(ostream& os, vtkIndent indent); 00047 00049 virtual void Initialize(); 00050 00052 00059 virtual void Enable(); 00060 virtual void Disable(); 00062 00066 virtual void Start(); 00067 00069 00074 vtkSetMacro(InstallMessageProc,int); 00075 vtkGetMacro(InstallMessageProc,int); 00076 vtkBooleanMacro(InstallMessageProc,int); 00078 00083 void TerminateApp(void); 00084 00085 //BTX 00086 friend VTK_RENDERING_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l); 00087 friend VTK_RENDERING_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor *me); 00088 00090 00092 virtual void OnMouseMove (HWND wnd, UINT nFlags, int X, int Y); 00093 virtual void OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y); 00094 virtual void OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0); 00095 virtual void OnRButtonUp (HWND wnd, UINT nFlags, int X, int Y); 00096 virtual void OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0); 00097 virtual void OnMButtonUp (HWND wnd, UINT nFlags, int X, int Y); 00098 virtual void OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0); 00099 virtual void OnLButtonUp (HWND wnd, UINT nFlags, int X, int Y); 00100 virtual void OnSize (HWND wnd, UINT nType, int X, int Y); 00101 virtual void OnTimer (HWND wnd, UINT nIDEvent); 00102 virtual void OnKeyDown (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags); 00103 virtual void OnKeyUp (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags); 00104 virtual void OnChar (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags); 00105 virtual void OnMouseWheelForward (HWND wnd, UINT nFlags, int X, int Y); 00106 virtual void OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y); 00107 //ETX 00109 00111 00115 static void SetClassExitMethod(void (*f)(void *), void *arg); 00116 static void SetClassExitMethodArgDelete(void (*f)(void *)); 00118 00121 virtual void ExitCallback(); 00122 00123 protected: 00124 vtkWin32RenderWindowInteractor(); 00125 ~vtkWin32RenderWindowInteractor(); 00126 00127 HWND WindowId; 00128 WNDPROC OldProc; 00129 int InstallMessageProc; 00130 int MouseInWindow; 00131 int StartedMessageLoop; 00132 00133 //BTX 00135 00138 static void (*ClassExitMethod)(void *); 00139 static void (*ClassExitMethodArgDelete)(void *); 00140 static void *ClassExitMethodArg; 00141 //ETX 00143 00145 00147 virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration); 00148 virtual int InternalDestroyTimer(int platformTimerId); 00150 00151 private: 00152 vtkWin32RenderWindowInteractor(const vtkWin32RenderWindowInteractor&); // Not implemented. 00153 void operator=(const vtkWin32RenderWindowInteractor&); // Not implemented. 00154 }; 00155 00156 #endif 00157