VTK
vtkWin32RenderWindowInteractor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkWin32RenderWindowInteractor.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
35 #ifndef vtkWin32RenderWindowInteractor_h
36 #define vtkWin32RenderWindowInteractor_h
37 
38 #include "vtkRenderingOpenGL2Module.h" // For export macro
40 #include "vtkWindows.h" // For windows API.
41 
42 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX
43 #ifdef VTK_USE_TDX
44 class vtkTDxWinDevice;
45 #endif
46 
47 class VTKRENDERINGOPENGL2_EXPORT vtkWin32RenderWindowInteractor : public vtkRenderWindowInteractor
48 {
49 public:
52 
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
57  virtual void Initialize();
58 
60 
67  virtual void Enable();
68  virtual void Disable();
70 
72 
77  vtkSetMacro(InstallMessageProc,int);
78  vtkGetMacro(InstallMessageProc,int);
79  vtkBooleanMacro(InstallMessageProc,int);
81 
86  void TerminateApp(void);
87 
88  friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l);
89  friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor *me);
90 
92 
94  virtual void OnMouseMove (HWND wnd, UINT nFlags, int X, int Y);
95  virtual void OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
96  virtual void OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
97  virtual void OnRButtonUp (HWND wnd, UINT nFlags, int X, int Y);
98  virtual void OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
99  virtual void OnMButtonUp (HWND wnd, UINT nFlags, int X, int Y);
100  virtual void OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
101  virtual void OnLButtonUp (HWND wnd, UINT nFlags, int X, int Y);
102  virtual void OnSize (HWND wnd, UINT nType, int X, int Y);
103  virtual void OnTimer (HWND wnd, UINT nIDEvent);
104  virtual void OnKeyDown (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
105  virtual void OnKeyUp (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
106  virtual void OnChar (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
107  virtual void OnMouseWheelForward (HWND wnd, UINT nFlags, int X, int Y);
108  virtual void OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
109  virtual void OnFocus(HWND wnd, UINT nFlags);
110  virtual void OnKillFocus(HWND wnd, UINT nFlags);
111  virtual void OnTouch(HWND wnd, UINT wParam, UINT lParam);
113 
115 
119  static void SetClassExitMethod(void (*f)(void *), void *arg);
120  static void SetClassExitMethodArgDelete(void (*f)(void *));
122 
125  virtual void ExitCallback();
126 
127 protected:
130 
131  HWND WindowId;
132  WNDPROC OldProc;
133  int InstallMessageProc;
134  int MouseInWindow;
135  int StartedMessageLoop;
136 
138 
141  static void (*ClassExitMethod)(void *);
142  static void (*ClassExitMethodArgDelete)(void *);
143  static void *ClassExitMethodArg;
145 
147 
149  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
150  virtual int InternalDestroyTimer(int platformTimerId);
152 
156  virtual void StartEventLoop();
157 
158  int GetContactIndex(int id);
159  int IDLookup[VTKI_MAX_POINTERS];
160 
161 #ifdef VTK_USE_TDX
162  vtkTDxWinDevice *Device;
163 #endif
164 
165 private:
167  void operator=(const vtkWin32RenderWindowInteractor&); // Not implemented.
168 };
169 
170 #endif
Implementation of vtkTDxDevice on Windows.
virtual int InternalDestroyTimer(int platformTimerId)
void PrintSelf(ostream &os, vtkIndent indent)
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
implements Win32 specific functions required by vtkRenderWindowInteractor.
virtual void Initialize()
static vtkRenderWindowInteractor * New()
platform-independent render window interaction including picking and frame rate control.
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void ExitCallback()
#define VTKI_MAX_POINTERS