VTK  9.5.2
vtkWin32RenderWindowInteractor.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
17
18#ifndef vtkWin32RenderWindowInteractor_h
19#define vtkWin32RenderWindowInteractor_h
20
22#include "vtkRenderingUIModule.h" // For export macro
23#include "vtkWindows.h" // For windows API.
24#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
25
26#include <memory> // for std::unique_ptr
27
28#include "vtkTDxConfigure.h" // defines VTK_USE_TDX
29#ifdef VTK_USE_TDX
30VTK_ABI_NAMESPACE_BEGIN
31class vtkTDxWinDevice;
32VTK_ABI_NAMESPACE_END
33#endif
34
35VTK_ABI_NAMESPACE_BEGIN
38{
39public:
44
46 void PrintSelf(ostream& os, vtkIndent indent) override;
47
51 void Initialize() override;
52
54
63 void Enable() override;
64 void Disable() override;
66
71 void ProcessEvents() override;
72
74
80 vtkSetMacro(InstallMessageProc, int);
81 vtkGetMacro(InstallMessageProc, int);
82 vtkBooleanMacro(InstallMessageProc, int);
84
90 void TerminateApp() override;
91
92 friend VTKRENDERINGUI_EXPORT LRESULT CALLBACK vtkHandleMessage(
93 HWND hwnd, UINT uMsg, WPARAM w, LPARAM l);
94 friend VTKRENDERINGUI_EXPORT LRESULT CALLBACK vtkHandleMessage2(
95 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);
120 virtual int OnDropFiles(HWND wnd, WPARAM wParam);
122
124
130 static void SetClassExitMethod(void (*f)(void*), void* arg);
131 static void SetClassExitMethodArgDelete(void (*f)(void*));
133
138 void ExitCallback() override;
139
140protected:
143
145 WNDPROC OldProc;
149
151
156 static void (*ClassExitMethod)(void*);
157 static void (*ClassExitMethodArgDelete)(void*);
158 static void* ClassExitMethodArg;
160
162
166 int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
167 int InternalDestroyTimer(int platformTimerId) override;
169
175 void StartEventLoop() override;
176
177#ifdef VTK_USE_TDX
178 vtkTDxWinDevice* Device;
179#endif
180
181private:
183 void operator=(const vtkWin32RenderWindowInteractor&) = delete;
184
185 class vtkInternals;
186 std::unique_ptr<vtkInternals> Internals;
187};
188
189VTK_ABI_NAMESPACE_END
190#endif
a simple class to control print indentation
Definition vtkIndent.h:29
virtual int OnKillFocus(HWND wnd, UINT nFlags)
Various methods that a Win32 window can redirect to this class to be handled.
static void(* ClassExitMethod)(void *)
Class variables so an exit method can be defined for this class (used to set different exit methods f...
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.
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.
void TerminateApp() override
Win32 specific application terminate, calls ClassExitMethod then calls PostQuitMessage(0) to terminat...
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 void(* ClassExitMethodArgDelete)(void *)
Class variables so an exit method can be defined for this class (used to set different exit methods f...
static vtkWin32RenderWindowInteractor * New()
Construct object so that light follows camera motion.
void ProcessEvents() override
Process all user-interaction, timer events 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.
#define VTK_MARSHALAUTO