VTK  9.2.6
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
37#include "vtkRenderingUIModule.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
42class vtkTDxWinDevice;
43#endif
44
46{
47public:
52
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
59 void Initialize() override;
60
62
71 void Enable() override;
72 void Disable() override;
74
80 void ProcessEvents() override;
81
83
89 vtkSetMacro(InstallMessageProc, int);
90 vtkGetMacro(InstallMessageProc, int);
91 vtkBooleanMacro(InstallMessageProc, int);
93
99 void TerminateApp(void) override;
100
101 friend VTKRENDERINGUI_EXPORT LRESULT CALLBACK vtkHandleMessage(
102 HWND hwnd, UINT uMsg, WPARAM w, LPARAM l);
103 friend VTKRENDERINGUI_EXPORT LRESULT CALLBACK vtkHandleMessage2(
104 HWND hwnd, UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor* me);
105
107
111 virtual int OnMouseMove(HWND wnd, UINT nFlags, int X, int Y);
112 virtual int OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
113 virtual int OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
114 virtual int OnRButtonUp(HWND wnd, UINT nFlags, int X, int Y);
115 virtual int OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
116 virtual int OnMButtonUp(HWND wnd, UINT nFlags, int X, int Y);
117 virtual int OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat = 0);
118 virtual int OnLButtonUp(HWND wnd, UINT nFlags, int X, int Y);
119 virtual int OnSize(HWND wnd, UINT nType, int X, int Y);
120 virtual int OnTimer(HWND wnd, UINT nIDEvent);
121 virtual int OnKeyDown(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
122 virtual int OnKeyUp(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
123 virtual int OnChar(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
124 virtual int OnMouseWheelForward(HWND wnd, UINT nFlags, int X, int Y);
125 virtual int OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
126 virtual int OnFocus(HWND wnd, UINT nFlags);
127 virtual int OnKillFocus(HWND wnd, UINT nFlags);
128 virtual int OnTouch(HWND wnd, UINT wParam, UINT lParam);
129 virtual int OnDropFiles(HWND wnd, WPARAM wParam);
131
133
139 static void SetClassExitMethod(void (*f)(void*), void* arg);
140 static void SetClassExitMethodArgDelete(void (*f)(void*));
142
147 void ExitCallback() override;
148
149protected:
152
154 WNDPROC OldProc;
158
160
165 static void (*ClassExitMethod)(void*);
166 static void (*ClassExitMethodArgDelete)(void*);
167 static void* ClassExitMethodArg;
169
171
175 int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
176 int InternalDestroyTimer(int platformTimerId) override;
178
184 void StartEventLoop() override;
185
186#ifdef VTK_USE_TDX
187 vtkTDxWinDevice* Device;
188#endif
189
190private:
192 void operator=(const vtkWin32RenderWindowInteractor&) = delete;
193};
194
195#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)
Various methods that a Win32 window can redirect to this class to be handled.
virtual int OnMouseWheelForward(HWND wnd, UINT nFlags, int X, int Y)
Various methods that a Win32 window can redirect to this class to be handled.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int InternalDestroyTimer(int platformTimerId) override
Win32-specific internal timer methods.
virtual int OnChar(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags)
Various methods that a Win32 window can redirect to this class to be handled.
virtual int OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0)
Various methods that a Win32 window can redirect to this class to be handled.
virtual int OnRButtonUp(HWND wnd, UINT nFlags, int X, int Y)
Various methods that a Win32 window can redirect to this class to be handled.
virtual int OnDropFiles(HWND wnd, WPARAM wParam)
Various methods that a Win32 window can redirect to this class to be handled.
virtual int OnTouch(HWND wnd, UINT wParam, UINT lParam)
Various methods that a Win32 window can redirect to this class to be handled.
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 * ClassExitMethodArg
Class variables so an exit method can be defined for this class (used to set different exit methods f...
void Enable() override
Enable/Disable interactions.
static void SetClassExitMethodArgDelete(void(*f)(void *))
Methods to set the default exit method for the class.
virtual int OnTimer(HWND wnd, UINT nIDEvent)
Various methods that a Win32 window can redirect to this class to be handled.
void Disable() override
Enable/Disable interactions.
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)
Various methods that a Win32 window can redirect to this class to be handled.
virtual int OnFocus(HWND wnd, UINT nFlags)
Various methods that a Win32 window can redirect to this class to be handled.
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)
Various methods that a Win32 window can redirect to this class to be handled.
void StartEventLoop() override
This will start up the event loop and never return.
virtual int OnKeyUp(HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags)
Various methods that a Win32 window can redirect to this class to be handled.
~vtkWin32RenderWindowInteractor() override
void Initialize() override
Initialize the event handler.
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)
Various methods that a Win32 window can redirect to this class to be handled.
static vtkWin32RenderWindowInteractor * New()
Construct object so that light follows camera motion.
void ProcessEvents() override
Run the event loop and return.
virtual int OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0)
Various methods that a Win32 window can redirect to this class to be handled.
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)
Various methods that a Win32 window can redirect to this class to be handled.
virtual int OnSize(HWND wnd, UINT nType, int X, int Y)
Various methods that a Win32 window can redirect to this class to be handled.
virtual int OnLButtonUp(HWND wnd, UINT nFlags, int X, int Y)
Various methods that a Win32 window can redirect to this class to be handled.
virtual int OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y)
Various methods that a Win32 window can redirect to this class to be handled.