VTK  9.0.1
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 =========================================================================*/
29 #ifndef vtkXRenderWindowInteractor_h
30 #define vtkXRenderWindowInteractor_h
31 
32 //===========================================================
33 // now we define the C++ class
34 
36 #include "vtkRenderingUIModule.h" // For export macro
37 #include <X11/Xlib.h> // Needed for X types in the public interface
38 
39 class vtkCallbackCommand;
40 class vtkXRenderWindowInteractorInternals;
41 
42 class VTKRENDERINGUI_EXPORT vtkXRenderWindowInteractor : public vtkRenderWindowInteractor
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
54  void Initialize() override;
55 
59  void TerminateApp() override;
60 
66  void ProcessEvents() override;
67 
69 
75  vtkGetMacro(BreakLoopFlag, int);
76  void SetBreakLoopFlag(int);
77  void BreakLoopFlagOff();
78  void BreakLoopFlagOn();
80 
82 
91  void Enable() override;
92  void Disable() override;
94 
99  void UpdateSize(int, int) override;
100 
104  void GetMousePosition(int* x, int* y) override;
105 
106  void DispatchEvent(XEvent*);
107 
108 protected:
110  ~vtkXRenderWindowInteractor() override;
111 
116  void UpdateSizeNoXResize(int, int);
117 
118  // Using static here to avoid destroying context when many apps are open:
119  static int NumAppInitialized;
120 
121  Display* DisplayId;
122  Window WindowId;
123  Atom KillAtom;
124  int PositionBeforeStereo[2];
125  vtkXRenderWindowInteractorInternals* Internal;
126 
127  // Drag and drop related
128  Window XdndSource;
134 
136 
140  int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
141  int InternalDestroyTimer(int platformTimerId) override;
143 
144  void FireTimers();
145 
146  static int BreakLoopFlag;
147 
153  void StartEventLoop() override;
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:33
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 &#39;q&#39;,&#39;e&#39; 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