VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/Rendering/OpenGL2/vtkWin32OpenGLRenderWindowInteractor.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkWin32OpenGLRenderWindowInteractor.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 =========================================================================*/
00032 #ifndef vtkWin32OpenGLRenderWindowInteractor_h
00033 #define vtkWin32OpenGLRenderWindowInteractor_h
00034 
00035 #include "vtkRenderingOpenGL2Module.h" // For export macro
00036 #include "vtkRenderWindowInteractor.h"
00037 #include "vtkWindows.h" // For windows API.
00038 
00039 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX
00040 #ifdef VTK_USE_TDX
00041 class vtkTDxWinDevice;
00042 #endif
00043 
00044 class VTKRENDERINGOPENGL2_EXPORT vtkWin32OpenGLRenderWindowInteractor : public vtkRenderWindowInteractor
00045 {
00046 public:
00048   static vtkWin32OpenGLRenderWindowInteractor *New();
00049 
00050   vtkTypeMacro(vtkWin32OpenGLRenderWindowInteractor,vtkRenderWindowInteractor);
00051   void PrintSelf(ostream& os, vtkIndent indent);
00052 
00054   virtual void Initialize();
00055 
00057 
00064   virtual void Enable();
00065   virtual void Disable();
00067 
00069 
00074   vtkSetMacro(InstallMessageProc,int);
00075   vtkGetMacro(InstallMessageProc,int);
00076   vtkBooleanMacro(InstallMessageProc,int);
00078 
00083   void TerminateApp(void);
00084 
00085   friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l);
00086   friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l, vtkWin32OpenGLRenderWindowInteractor *me);
00087 
00089 
00091   virtual void OnMouseMove  (HWND wnd, UINT nFlags, int X, int Y);
00092   virtual void OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
00093   virtual void OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
00094   virtual void OnRButtonUp  (HWND wnd, UINT nFlags, int X, int Y);
00095   virtual void OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
00096   virtual void OnMButtonUp  (HWND wnd, UINT nFlags, int X, int Y);
00097   virtual void OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
00098   virtual void OnLButtonUp  (HWND wnd, UINT nFlags, int X, int Y);
00099   virtual void OnSize       (HWND wnd, UINT nType,  int X, int Y);
00100   virtual void OnTimer      (HWND wnd, UINT nIDEvent);
00101   virtual void OnKeyDown    (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
00102   virtual void OnKeyUp      (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
00103   virtual void OnChar       (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
00104   virtual void OnMouseWheelForward (HWND wnd, UINT nFlags, int X, int Y);
00105   virtual void OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
00106   virtual void OnFocus(HWND wnd, UINT nFlags);
00107   virtual void OnKillFocus(HWND wnd, UINT nFlags);
00108   virtual void OnTouch(HWND wnd, UINT wParam, UINT lParam);
00110 
00112 
00116   static void SetClassExitMethod(void (*f)(void *), void *arg);
00117   static void SetClassExitMethodArgDelete(void (*f)(void *));
00119 
00122   virtual void ExitCallback();
00123 
00124 protected:
00125   vtkWin32OpenGLRenderWindowInteractor();
00126   ~vtkWin32OpenGLRenderWindowInteractor();
00127 
00128   HWND    WindowId;
00129   WNDPROC OldProc;
00130   int     InstallMessageProc;
00131   int     MouseInWindow;
00132   int     StartedMessageLoop;
00133 
00135 
00138   static void (*ClassExitMethod)(void *);
00139   static void (*ClassExitMethodArgDelete)(void *);
00140   static void *ClassExitMethodArg;
00142 
00144 
00146   virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
00147   virtual int InternalDestroyTimer(int platformTimerId);
00149 
00153   virtual void StartEventLoop();
00154 
00155   int GetContactIndex(int id);
00156   int IDLookup[VTKI_MAX_POINTERS];
00157 
00158 #ifdef VTK_USE_TDX
00159   vtkTDxWinDevice *Device;
00160 #endif
00161 
00162 private:
00163   vtkWin32OpenGLRenderWindowInteractor(const vtkWin32OpenGLRenderWindowInteractor&);  // Not implemented.
00164   void operator=(const vtkWin32OpenGLRenderWindowInteractor&);  // Not implemented.
00165 };
00166 
00167 #endif