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 =========================================================================*/
36 #ifndef vtkWin32RenderWindowInteractor_h
37 #define vtkWin32RenderWindowInteractor_h
38 
39 #include "vtkRenderingOpenGL2Module.h" // For export macro
41 #include "vtkWindows.h" // For windows API.
42 
43 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX
44 #ifdef VTK_USE_TDX
45 class vtkTDxWinDevice;
46 #endif
47 
48 class VTKRENDERINGOPENGL2_EXPORT vtkWin32RenderWindowInteractor : public vtkRenderWindowInteractor
49 {
50 public:
55 
57  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
62  virtual void Initialize() override;
63 
65 
74  virtual void Enable() override;
75  virtual void Disable() override;
77 
79 
85  vtkSetMacro(InstallMessageProc,int);
86  vtkGetMacro(InstallMessageProc,int);
87  vtkBooleanMacro(InstallMessageProc,int);
89 
95  void TerminateApp(void) override;
96 
97  friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l);
98  friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor *me);
99 
101 
105  virtual int OnMouseMove(HWND wnd, UINT nFlags, int X, int Y);
106  virtual int OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
107  virtual int OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
108  virtual int OnRButtonUp(HWND wnd, UINT nFlags, int X, int Y);
109  virtual int OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
110  virtual int OnMButtonUp(HWND wnd, UINT nFlags, int X, int Y);
111  virtual int OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
112  virtual int OnLButtonUp(HWND wnd, UINT nFlags, int X, int Y);
113  virtual int OnSize(HWND wnd, UINT nType, int X, int Y);
114  virtual int OnTimer(HWND wnd, UINT nIDEvent);
115  virtual int OnKeyDown(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
116  virtual int OnKeyUp(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
117  virtual int OnChar(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
118  virtual int OnMouseWheelForward(HWND wnd, UINT nFlags, int X, int Y);
119  virtual int OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
120  virtual int OnFocus(HWND wnd, UINT nFlags);
121  virtual int OnKillFocus(HWND wnd, UINT nFlags);
122  virtual int OnTouch(HWND wnd, UINT wParam, UINT lParam);
124 
126 
132  static void SetClassExitMethod(void (*f)(void *), void *arg);
133  static void SetClassExitMethodArgDelete(void (*f)(void *));
135 
140  void ExitCallback() override;
141 
142 protected:
145 
146  HWND WindowId;
147  WNDPROC OldProc;
151 
153 
158  static void (*ClassExitMethod)(void *);
159  static void (*ClassExitMethodArgDelete)(void *);
160  static void *ClassExitMethodArg;
162 
164 
168  int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
169  int InternalDestroyTimer(int platformTimerId) override;
171 
177  void StartEventLoop() override;
178 
179 #ifdef VTK_USE_TDX
180  vtkTDxWinDevice *Device;
181 #endif
182 
183 private:
185  void operator=(const vtkWin32RenderWindowInteractor&) = delete;
186 };
187 
188 #endif
static void * ClassExitMethodArg
Class variables so an exit method can be defined for this class (used to set different exit methods f...
virtual void Enable()
Enable/Disable interactions.
virtual int InternalDestroyTimer(int platformTimerId)
Internal methods for creating and destroying timers that must be implemented by subclasses.
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 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...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.