VTK  9.3.20240424
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
20#ifndef vtkXRenderWindowInteractor_h
21#define vtkXRenderWindowInteractor_h
22
23//===========================================================
24// now we define the C++ class
25
27#include "vtkRenderingUIModule.h" // For export macro
28#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
29#include <X11/Xlib.h> // Needed for X types in the public interface
30
31VTK_ABI_NAMESPACE_BEGIN
33class vtkXRenderWindowInteractorInternals;
34
37{
38public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
48 void Initialize() override;
49
53 void TerminateApp() override;
54
59 void ProcessEvents() override;
60
62
71 void Enable() override;
72 void Disable() override;
74
79 void UpdateSize(int, int) override;
80
84 void GetMousePosition(int* x, int* y) override;
85
90 void GetMousePositionAndModifierKeysState(int* x, int* y, unsigned int* keys);
91
92 void DispatchEvent(XEvent*);
93
94protected:
97
102 void UpdateSizeNoXResize(int, int);
103
104 // Using static here to avoid destroying context when many apps are open:
106
107 Display* DisplayId;
108 bool OwnDisplay = false;
109 Window WindowId;
111 int PositionBeforeStereo[2];
112 vtkXRenderWindowInteractorInternals* Internal;
113
114 // Drag and drop related
126
128
132 int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
133 int InternalDestroyTimer(int platformTimerId) override;
135
137
143 void StartEventLoop() override;
144
149
154 void Finalize();
155
156private:
158 void operator=(const vtkXRenderWindowInteractor&) = delete;
159};
160
161VTK_ABI_NAMESPACE_END
162#endif
supports function callbacks
a simple class to control print indentation
Definition vtkIndent.h:108
platform-independent render window interaction including picking and frame rate control.
an X event driven interface for a RenderWindow
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...
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