VTK  9.5.2
vtkXRenderWindowInteractor.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
16
17#ifndef vtkXRenderWindowInteractor_h
18#define vtkXRenderWindowInteractor_h
19
20//===========================================================
21// now we define the C++ class
22
24#include "vtkRenderingUIModule.h" // For export macro
25#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
26#include <X11/Xlib.h> // Needed for X types in the public interface
27
28VTK_ABI_NAMESPACE_BEGIN
30class vtkXRenderWindowInteractorInternals;
31
34{
35public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
45 void Initialize() override;
46
50 void TerminateApp() override;
51
56 void ProcessEvents() override;
57
59
68 void Enable() override;
69 void Disable() override;
71
76 void UpdateSize(int, int) override;
77
81 void GetMousePosition(int* x, int* y) override;
82
87 void GetMousePositionAndModifierKeysState(int* x, int* y, unsigned int* keys);
88
89 void DispatchEvent(XEvent*);
90
91protected:
94
99 void UpdateSizeNoXResize(int, int);
100
101 // Using static here to avoid destroying context when many apps are open:
103
104 Display* DisplayId;
105 Window WindowId;
108 vtkXRenderWindowInteractorInternals* Internal;
109
110 // Drag and drop related
122
124
128 int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
129 int InternalDestroyTimer(int platformTimerId) override;
131
133
139 void StartEventLoop() override;
140
145
149 bool CheckDisplayId(Display* dpy);
150
155 void Finalize();
156
157private:
159 void operator=(const vtkXRenderWindowInteractor&) = delete;
160};
161
162VTK_ABI_NAMESPACE_END
163#endif
supports function callbacks
a simple class to control print indentation
Definition vtkIndent.h:29
void TerminateApp() override
Break the event loop on 'q','e' keypress.
void UpdateSize(int, int) override
Update the Size data member and set the associated RenderWindow's size.
void Initialize() override
Initializes the event handlers without an XtAppContext.
int InternalDestroyTimer(int platformTimerId) override
X-specific internal timer methods.
void StartEventLoop() override
This will start up the X event loop and never return.
void WaitForEvents()
Wait for new events.
void Finalize()
Deallocate X resource that may have been allocated Also calls finalize on the render window if availa...
bool CheckDisplayId(Display *dpy)
Check if a display connection is in use by any windows.
int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override
X-specific internal timer methods.
void ProcessEvents() override
Process all user-interaction, timer events and return.
void UpdateSizeNoXResize(int, int)
Update the Size data member and set the associated RenderWindow's size but do not resize the XWindow.
static vtkXRenderWindowInteractor * New()
void DispatchEvent(XEvent *)
~vtkXRenderWindowInteractor() override
void GetMousePositionAndModifierKeysState(int *x, int *y, unsigned int *keys)
A X11 specific method to recover mouse position and modifier keys keys is a Xorg specified mask of mo...
void Enable() override
Enable/Disable interactions.
void GetMousePosition(int *x, int *y) override
Re-defines virtual function to get mouse position by querying X-server.
vtkXRenderWindowInteractorInternals * Internal
void Disable() override
Enable/Disable interactions.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_MARSHALAUTO