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
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 <X11/Xlib.h> // Needed for X types in the public interface
29 
30 VTK_ABI_NAMESPACE_BEGIN
31 class vtkCallbackCommand;
32 class vtkXRenderWindowInteractorInternals;
33 
34 class VTKRENDERINGUI_EXPORT vtkXRenderWindowInteractor : public vtkRenderWindowInteractor
35 {
36 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
46  void Initialize() override;
47 
51  void TerminateApp() override;
52 
57  void ProcessEvents() override;
58 
60 
69  void Enable() override;
70  void Disable() override;
72 
77  void UpdateSize(int, int) override;
78 
82  void GetMousePosition(int* x, int* y) override;
83 
84  void DispatchEvent(XEvent*);
85 
86 protected:
89 
94  void UpdateSizeNoXResize(int, int);
95 
96  // Using static here to avoid destroying context when many apps are open:
97  static int NumAppInitialized;
98 
99  Display* DisplayId;
100  bool OwnDisplay = false;
101  Window WindowId;
102  Atom KillAtom;
103  int PositionBeforeStereo[2];
104  vtkXRenderWindowInteractorInternals* Internal;
105 
106  // Drag and drop related
108  Window XdndSource;
118 
120 
124  int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
125  int InternalDestroyTimer(int platformTimerId) override;
127 
128  void FireTimers();
129 
135  void StartEventLoop() override;
136 
141 
146  void Finalize();
147 
148 private:
150  void operator=(const vtkXRenderWindowInteractor&) = delete;
151 };
152 
153 VTK_ABI_NAMESPACE_END
154 #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.
static vtkXRenderWindowInteractor * New()
void UpdateSizeNoXResize(int, int)
Update the Size data member and set the associated RenderWindow's size but do not resize the XWindow.
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.