VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Rendering/OpenGL/vtkWin32RenderWindowInteractor.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkWin32RenderWindowInteractor.h
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 =========================================================================*/
00035 #ifndef vtkWin32RenderWindowInteractor_h
00036 #define vtkWin32RenderWindowInteractor_h
00037 
00038 #include "vtkRenderingOpenGLModule.h" // For export macro
00039 #include "vtkRenderWindowInteractor.h"
00040 #include "vtkWindows.h" // For windows API.
00041 
00042 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX
00043 #ifdef VTK_USE_TDX
00044 class vtkTDxWinDevice;
00045 #endif
00046 
00047 class VTKRENDERINGOPENGL_EXPORT vtkWin32RenderWindowInteractor : public vtkRenderWindowInteractor
00048 {
00049 public:
00051   static vtkWin32RenderWindowInteractor *New();
00052 
00053   vtkTypeMacro(vtkWin32RenderWindowInteractor,vtkRenderWindowInteractor);
00054   void PrintSelf(ostream& os, vtkIndent indent);
00055 
00057   virtual void Initialize();
00058 
00060 
00067   virtual void Enable();
00068   virtual void Disable();
00070 
00072 
00077   vtkSetMacro(InstallMessageProc,int);
00078   vtkGetMacro(InstallMessageProc,int);
00079   vtkBooleanMacro(InstallMessageProc,int);
00081 
00086   void TerminateApp(void);
00087 
00088   //BTX
00089   friend VTKRENDERINGOPENGL_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l);
00090   friend VTKRENDERINGOPENGL_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   virtual void OnFocus(HWND wnd, UINT nFlags);
00111   virtual void OnKillFocus(HWND wnd, UINT nFlags);
00112   //ETX
00114 
00116 
00120   static void SetClassExitMethod(void (*f)(void *), void *arg);
00121   static void SetClassExitMethodArgDelete(void (*f)(void *));
00123 
00126   virtual void ExitCallback();
00127 
00128 protected:
00129   vtkWin32RenderWindowInteractor();
00130   ~vtkWin32RenderWindowInteractor();
00131 
00132   HWND    WindowId;
00133   WNDPROC OldProc;
00134   int     InstallMessageProc;
00135   int     MouseInWindow;
00136   int     StartedMessageLoop;
00137 
00138   //BTX
00140 
00143   static void (*ClassExitMethod)(void *);
00144   static void (*ClassExitMethodArgDelete)(void *);
00145   static void *ClassExitMethodArg;
00146   //ETX
00148 
00150 
00152   virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
00153   virtual int InternalDestroyTimer(int platformTimerId);
00155 
00159   virtual void StartEventLoop();
00160 
00161 #ifdef VTK_USE_TDX
00162   vtkTDxWinDevice *Device;
00163 #endif
00164 
00165 private:
00166   vtkWin32RenderWindowInteractor(const vtkWin32RenderWindowInteractor&);  // Not implemented.
00167   void operator=(const vtkWin32RenderWindowInteractor&);  // Not implemented.
00168 };
00169 
00170 #endif
00171