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 =========================================================================*/
33 #ifndef vtkWin32RenderWindowInteractor_h
34 #define vtkWin32RenderWindowInteractor_h
35 
36 #include "vtkRenderingOpenGL2Module.h" // For export macro
38 #include "vtkWindows.h" // For windows API.
39 
40 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX
41 #ifdef VTK_USE_TDX
42 class vtkTDxWinDevice;
43 #endif
44 
45 class VTKRENDERINGOPENGL2_EXPORT vtkWin32RenderWindowInteractor : public vtkRenderWindowInteractor
46 {
47 public:
52 
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
59  virtual void Initialize();
60 
62 
71  virtual void Enable();
72  virtual void Disable();
74 
76 
82  vtkSetMacro(InstallMessageProc,int);
83  vtkGetMacro(InstallMessageProc,int);
84  vtkBooleanMacro(InstallMessageProc,int);
86 
92  void TerminateApp(void);
93 
94  friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l);
95  friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor *me);
96 
98 
102  virtual int OnMouseMove(HWND wnd, UINT nFlags, int X, int Y);
103  virtual int OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
104  virtual int OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
105  virtual int OnRButtonUp(HWND wnd, UINT nFlags, int X, int Y);
106  virtual int OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
107  virtual int OnMButtonUp(HWND wnd, UINT nFlags, int X, int Y);
108  virtual int OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
109  virtual int OnLButtonUp(HWND wnd, UINT nFlags, int X, int Y);
110  virtual int OnSize(HWND wnd, UINT nType, int X, int Y);
111  virtual int OnTimer(HWND wnd, UINT nIDEvent);
112  virtual int OnKeyDown(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
113  virtual int OnKeyUp(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
114  virtual int OnChar(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
115  virtual int OnMouseWheelForward(HWND wnd, UINT nFlags, int X, int Y);
116  virtual int OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
117  virtual int OnFocus(HWND wnd, UINT nFlags);
118  virtual int OnKillFocus(HWND wnd, UINT nFlags);
119  virtual int OnTouch(HWND wnd, UINT wParam, UINT lParam);
121 
123 
129  static void SetClassExitMethod(void (*f)(void *), void *arg);
130  static void SetClassExitMethodArgDelete(void (*f)(void *));
132 
137  virtual void ExitCallback();
138 
139 protected:
142 
143  HWND WindowId;
144  WNDPROC OldProc;
145  int InstallMessageProc;
146  int MouseInWindow;
147  int StartedMessageLoop;
148 
150 
155  static void (*ClassExitMethod)(void *);
156  static void (*ClassExitMethodArgDelete)(void *);
157  static void *ClassExitMethodArg;
159 
161 
165  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
166  virtual int InternalDestroyTimer(int platformTimerId);
168 
174  virtual void StartEventLoop();
175 
176 #ifdef VTK_USE_TDX
177  vtkTDxWinDevice *Device;
178 #endif
179 
180 private:
182  void operator=(const vtkWin32RenderWindowInteractor&) VTK_DELETE_FUNCTION;
183 };
184 
185 #endif
Implementation of vtkTDxDevice on Windows.
virtual void Enable()
Enable/Disable interactions.
virtual int InternalDestroyTimer(int platformTimerId)
Internal methods for creating and destroying timers that must be implemented by subclasses.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
Internal methods for creating and destroying timers that must be implemented by subclasses.
implements Win32 specific functions required by vtkRenderWindowInteractor.
virtual void Initialize()
Prepare for handling events and set the Enabled flag to true.
static vtkRenderWindowInteractor * New()
platform-independent render window interaction including picking and frame rate control.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void ExitCallback()
These methods correspond to the the Exit, User and Pick callbacks.
virtual void StartEventLoop()
Run the event loop (does not return until TerminateApp is called).
virtual void TerminateApp(void)
This function is called on 'q','e' keypress if exitmethod is not specified and should be overridden b...
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.