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 "vtkRenderingOpenGLModule.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 VTKRENDERINGOPENGL_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  //BTX
89  friend VTKRENDERINGOPENGL_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l);
90  friend VTKRENDERINGOPENGL_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor *me);
91 
93 
95  virtual int OnMouseMove(HWND wnd, UINT nFlags, int X, int Y);
96  virtual int OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
97  virtual int OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
98  virtual int OnRButtonUp(HWND wnd, UINT nFlags, int X, int Y);
99  virtual int OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
100  virtual int OnMButtonUp(HWND wnd, UINT nFlags, int X, int Y);
101  virtual int OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
102  virtual int OnLButtonUp(HWND wnd, UINT nFlags, int X, int Y);
103  virtual int OnSize(HWND wnd, UINT nType, int X, int Y);
104  virtual int OnTimer(HWND wnd, UINT nIDEvent);
105  virtual int OnKeyDown(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
106  virtual int OnKeyUp(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
107  virtual int OnChar(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
108  virtual int OnMouseWheelForward(HWND wnd, UINT nFlags, int X, int Y);
109  virtual int OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
110  virtual int OnFocus(HWND wnd, UINT nFlags);
111  virtual int OnKillFocus(HWND wnd, UINT nFlags);
112  //ETX
114 
116 
120  static void SetClassExitMethod(void (*f)(void *), void *arg);
121  static void SetClassExitMethodArgDelete(void (*f)(void *));
123 
126  virtual void ExitCallback();
127 
128 protected:
131 
132  HWND WindowId;
133  WNDPROC OldProc;
137 
138  //BTX
140 
143  static void (*ClassExitMethod)(void *);
144  static void (*ClassExitMethodArgDelete)(void *);
145  static void *ClassExitMethodArg;
146  //ETX
148 
150 
152  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
153  virtual int InternalDestroyTimer(int platformTimerId);
155 
159  virtual void StartEventLoop();
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
171 
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()