VTK  9.2.6
vtkXRenderWindowInteractor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXRenderWindowInteractor.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
32 #ifndef vtkXRenderWindowInteractor_h
33 #define vtkXRenderWindowInteractor_h
34 
35 //===========================================================
36 // now we define the C++ class
37 
39 #include "vtkRenderingUIModule.h" // For export macro
40 #include <X11/Xlib.h> // Needed for X types in the public interface
41 
42 class vtkCallbackCommand;
43 class vtkXRenderWindowInteractorInternals;
44 
45 class VTKRENDERINGUI_EXPORT vtkXRenderWindowInteractor : public vtkRenderWindowInteractor
46 {
47 public:
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
57  void Initialize() override;
58 
62  void TerminateApp() override;
63 
69  void ProcessEvents() override;
70 
72 
81  void Enable() override;
82  void Disable() override;
84 
89  void UpdateSize(int, int) override;
90 
94  void GetMousePosition(int* x, int* y) override;
95 
96  void DispatchEvent(XEvent*);
97 
98 protected:
100  ~vtkXRenderWindowInteractor() override;
101 
106  void UpdateSizeNoXResize(int, int);
107 
108  // Using static here to avoid destroying context when many apps are open:
109  static int NumAppInitialized;
110 
111  Display* DisplayId;
112  bool OwnDisplay = false;
113  Window WindowId;
114  Atom KillAtom;
115  int PositionBeforeStereo[2];
116  vtkXRenderWindowInteractorInternals* Internal;
117 
118  // Drag and drop related
120  Window XdndSource;
130 
132 
136  int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
137  int InternalDestroyTimer(int platformTimerId) override;
139 
140  void FireTimers();
141 
147  void StartEventLoop() override;
148 
153  void Finalize();
154 
155 private:
157  void operator=(const vtkXRenderWindowInteractor&) = delete;
158 };
159 
160 #endif
virtual void GetMousePosition(int *x, int *y)
Get the current position of the mouse.
virtual void UpdateSize(int x, int y)
Event loop notification member for window size change.
virtual void Enable()
Enable/Disable interactions.
virtual int InternalDestroyTimer(int platformTimerId)
Internal methods for creating and destroying timers that must be implemented by subclasses.
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
Internal methods for creating and destroying timers that must be implemented by subclasses.
virtual void Initialize()
Prepare for handling events and set the Enabled flag to true.
static vtkRenderWindowInteractor * New()
platform-independent render window interaction including picking and frame rate control.
supports function callbacks
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void StartEventLoop()
Run the event loop (does not return until TerminateApp is called).
vtkXRenderWindowInteractorInternals * Internal
virtual void TerminateApp(void)
This function is called on 'q','e' keypress if exitmethod is not specified and should be overridden b...
virtual void ProcessEvents()
Run the event loop and return.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
an X event driven interface for a RenderWindow