VTK  9.3.0
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
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 <X11/Xlib.h> // Needed for X types in the public interface
26
27VTK_ABI_NAMESPACE_BEGIN
29class vtkXRenderWindowInteractorInternals;
30
31class VTKRENDERINGUI_EXPORT vtkXRenderWindowInteractor : public vtkRenderWindowInteractor
32{
33public:
36 void PrintSelf(ostream& os, vtkIndent indent) override;
37
43 void Initialize() override;
44
48 void TerminateApp() override;
49
54 void ProcessEvents() override;
55
57
66 void Enable() override;
67 void Disable() override;
69
74 void UpdateSize(int, int) override;
75
79 void GetMousePosition(int* x, int* y) override;
80
81 void DispatchEvent(XEvent*);
82
83protected:
86
91 void UpdateSizeNoXResize(int, int);
92
93 // Using static here to avoid destroying context when many apps are open:
95
96 Display* DisplayId;
97 bool OwnDisplay = false;
98 Window WindowId;
100 int PositionBeforeStereo[2];
101 vtkXRenderWindowInteractorInternals* Internal;
102
103 // Drag and drop related
115
117
121 int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
122 int InternalDestroyTimer(int platformTimerId) override;
124
126
132 void StartEventLoop() override;
133
138
143 void Finalize();
144
145private:
147 void operator=(const vtkXRenderWindowInteractor&) = delete;
148};
149
150VTK_ABI_NAMESPACE_END
151#endif
supports function callbacks
a simple class to control print indentation
Definition vtkIndent.h:29
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 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.