VTK  9.0.1
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 =========================================================================*/
30 #ifndef vtkWin32RenderWindowInteractor_h
31 #define vtkWin32RenderWindowInteractor_h
32 
34 #include "vtkRenderingUIModule.h" // For export macro
35 #include "vtkWindows.h" // For windows API.
36 
37 #include "vtkTDxConfigure.h" // defines VTK_USE_TDX
38 #ifdef VTK_USE_TDX
39 class vtkTDxWinDevice;
40 #endif
41 
42 class VTKRENDERINGUI_EXPORT vtkWin32RenderWindowInteractor : public vtkRenderWindowInteractor
43 {
44 public:
49 
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
56  virtual void Initialize() override;
57 
59 
68  virtual void Enable() override;
69  virtual void Disable() override;
71 
77  void ProcessEvents() override;
78 
80 
86  vtkSetMacro(InstallMessageProc, int);
87  vtkGetMacro(InstallMessageProc, int);
88  vtkBooleanMacro(InstallMessageProc, int);
90 
96  void TerminateApp(void) override;
97 
98  friend VTKRENDERINGUI_EXPORT LRESULT CALLBACK vtkHandleMessage(
99  HWND hwnd, UINT uMsg, WPARAM w, LPARAM l);
100  friend VTKRENDERINGUI_EXPORT LRESULT CALLBACK vtkHandleMessage2(
101  HWND hwnd, UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor* me);
102 
104 
108  virtual int OnMouseMove(HWND wnd, UINT nFlags, int X, int Y);
109  virtual int OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
110  virtual int OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
111  virtual int OnRButtonUp(HWND wnd, UINT nFlags, int X, int Y);
112  virtual int OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
113  virtual int OnMButtonUp(HWND wnd, UINT nFlags, int X, int Y);
114  virtual int OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
115  virtual int OnLButtonUp(HWND wnd, UINT nFlags, int X, int Y);
116  virtual int OnSize(HWND wnd, UINT nType, int X, int Y);
117  virtual int OnTimer(HWND wnd, UINT nIDEvent);
118  virtual int OnKeyDown(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
119  virtual int OnKeyUp(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
120  virtual int OnChar(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
121  virtual int OnMouseWheelForward(HWND wnd, UINT nFlags, int X, int Y);
122  virtual int OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
123  virtual int OnFocus(HWND wnd, UINT nFlags);
124  virtual int OnKillFocus(HWND wnd, UINT nFlags);
125  virtual int OnTouch(HWND wnd, UINT wParam, UINT lParam);
126  virtual int OnDropFiles(HWND wnd, WPARAM wParam);
128 
130 
136  static void SetClassExitMethod(void (*f)(void*), void* arg);
137  static void SetClassExitMethodArgDelete(void (*f)(void*));
139 
144  void ExitCallback() override;
145 
146 protected:
149 
150  HWND WindowId;
151  WNDPROC OldProc;
155 
157 
162  static void (*ClassExitMethod)(void*);
163  static void (*ClassExitMethodArgDelete)(void*);
164  static void* ClassExitMethodArg;
166 
168 
172  int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
173  int InternalDestroyTimer(int platformTimerId) override;
175 
181  void StartEventLoop() override;
182 
183 #ifdef VTK_USE_TDX
184  vtkTDxWinDevice* Device;
185 #endif
186 
187 private:
189  void operator=(const vtkWin32RenderWindowInteractor&) = delete;
190 };
191 
192 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
platform-independent render window interaction including picking and frame rate control.
implements Win32 specific functions required by vtkRenderWindowInteractor.
virtual int OnKillFocus(HWND wnd, UINT nFlags)
virtual int OnMouseWheelForward(HWND wnd, UINT nFlags, int X, int Y)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int InternalDestroyTimer(int platformTimerId) override
virtual int OnChar(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags)
virtual void Initialize() override
Initialize the event handler.
virtual int OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0)
virtual int OnRButtonUp(HWND wnd, UINT nFlags, int X, int Y)
virtual int OnDropFiles(HWND wnd, WPARAM wParam)
virtual int OnTouch(HWND wnd, UINT wParam, UINT lParam)
virtual int OnMouseMove(HWND wnd, UINT nFlags, int X, int Y)
Various methods that a Win32 window can redirect to this class to be handled.
static void SetClassExitMethodArgDelete(void(*f)(void *))
virtual int OnTimer(HWND wnd, UINT nIDEvent)
void TerminateApp(void) override
Win32 specific application terminate, calls ClassExitMethod then calls PostQuitMessage(0) to terminat...
virtual int OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0)
virtual int OnFocus(HWND wnd, UINT nFlags)
int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override
Win32-specific internal timer methods.
virtual int OnKeyDown(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags)
void StartEventLoop() override
This will start up the event loop and never return.
virtual int OnKeyUp(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags)
~vtkWin32RenderWindowInteractor() override
static void SetClassExitMethod(void(*f)(void *), void *arg)
Methods to set the default exit method for the class.
virtual int OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y)
void ProcessEvents() override
Run the event loop and return.
static vtkWin32RenderWindowInteractor * New()
Construct object so that light follows camera motion.
virtual int OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0)
void ExitCallback() override
These methods correspond to the Exit, User and Pick callbacks.
friend VTKRENDERINGUI_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd, UINT uMsg, WPARAM w, LPARAM l)
friend VTKRENDERINGUI_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd, UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor *me)
virtual int OnMButtonUp(HWND wnd, UINT nFlags, int X, int Y)
virtual int OnSize(HWND wnd, UINT nType, int X, int Y)
virtual void Enable() override
Enable/Disable interactions.
virtual int OnLButtonUp(HWND wnd, UINT nFlags, int X, int Y)
virtual void Disable() override
virtual int OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y)