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 =========================================================================*/
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 
78  vtkGetMacro(BreakLoopFlag, int);
79  void SetBreakLoopFlag(int);
80  void BreakLoopFlagOff();
81  void BreakLoopFlagOn();
83 
85 
94  void Enable() override;
95  void Disable() override;
97 
102  void UpdateSize(int, int) override;
103 
107  void GetMousePosition(int* x, int* y) override;
108 
109  void DispatchEvent(XEvent*);
110 
111 protected:
113  ~vtkXRenderWindowInteractor() override;
114 
119  void UpdateSizeNoXResize(int, int);
120 
121  // Using static here to avoid destroying context when many apps are open:
122  static int NumAppInitialized;
123 
124  Display* DisplayId;
125  Window WindowId;
126  Atom KillAtom;
127  int PositionBeforeStereo[2];
128  vtkXRenderWindowInteractorInternals* Internal;
129 
130  // Drag and drop related
131  Window XdndSource;
137 
139 
143  int InternalCreateTimer(int timerId, int timerType, unsigned long duration) override;
144  int InternalDestroyTimer(int platformTimerId) override;
146 
147  void FireTimers();
148 
149  static int BreakLoopFlag;
150 
156  void StartEventLoop() override;
157 
158 private:
160  void operator=(const vtkXRenderWindowInteractor&) = delete;
161 };
162 
163 #endif
vtkRenderWindowInteractor::New
static vtkRenderWindowInteractor * New()
vtkRenderWindowInteractor::InternalCreateTimer
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
Internal methods for creating and destroying timers that must be implemented by subclasses.
vtkRenderWindowInteractor::StartEventLoop
virtual void StartEventLoop()
Run the event loop (does not return until TerminateApp is called).
Definition: vtkRenderWindowInteractor.h:919
vtkXRenderWindowInteractor::XdndFinishedAtom
Atom XdndFinishedAtom
Definition: vtkXRenderWindowInteractor.h:136
vtkRenderWindowInteractor::InternalDestroyTimer
virtual int InternalDestroyTimer(int platformTimerId)
vtkXRenderWindowInteractor::BreakLoopFlag
static int BreakLoopFlag
Definition: vtkXRenderWindowInteractor.h:149
vtkRenderWindowInteractor::UpdateSize
virtual void UpdateSize(int x, int y)
Event loop notification member for window size change.
vtkXRenderWindowInteractor::XdndActionCopyAtom
Atom XdndActionCopyAtom
Definition: vtkXRenderWindowInteractor.h:134
vtkXRenderWindowInteractor::XdndStatusAtom
Atom XdndStatusAtom
Definition: vtkXRenderWindowInteractor.h:135
vtkXRenderWindowInteractor
an X event driven interface for a RenderWindow
Definition: vtkXRenderWindowInteractor.h:45
vtkRenderWindowInteractor::Disable
virtual void Disable()
Definition: vtkRenderWindowInteractor.h:149
vtkXRenderWindowInteractor::KillAtom
Atom KillAtom
Definition: vtkXRenderWindowInteractor.h:126
vtkRenderWindowInteractor::GetMousePosition
virtual void GetMousePosition(int *x, int *y)
Get the current position of the mouse.
Definition: vtkRenderWindowInteractor.h:393
vtkXRenderWindowInteractor::XdndSource
Window XdndSource
Definition: vtkXRenderWindowInteractor.h:131
vtkRenderWindowInteractor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkXRenderWindowInteractor::DisplayId
Display * DisplayId
Definition: vtkXRenderWindowInteractor.h:124
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:82
vtkRenderWindowInteractor::TerminateApp
virtual void TerminateApp(void)
This function is called on 'q','e' keypress if exitmethod is not specified and should be overridden b...
Definition: vtkRenderWindowInteractor.h:301
vtkRenderWindowInteractor::Enable
virtual void Enable()
Enable/Disable interactions.
Definition: vtkRenderWindowInteractor.h:144
vtkXRenderWindowInteractor::Internal
vtkXRenderWindowInteractorInternals * Internal
Definition: vtkXRenderWindowInteractor.h:128
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:44
vtkXRenderWindowInteractor::XdndDropAtom
Atom XdndDropAtom
Definition: vtkXRenderWindowInteractor.h:133
vtkRenderWindowInteractor.h
vtkRenderWindowInteractor::Initialize
virtual void Initialize()
Prepare for handling events and set the Enabled flag to true.
vtkRenderWindowInteractor::ProcessEvents
virtual void ProcessEvents()
Run the event loop and return.
Definition: vtkRenderWindowInteractor.h:127
vtkXRenderWindowInteractor::NumAppInitialized
static int NumAppInitialized
Definition: vtkXRenderWindowInteractor.h:122
vtkXRenderWindowInteractor::XdndPositionAtom
Atom XdndPositionAtom
Definition: vtkXRenderWindowInteractor.h:132
vtkXRenderWindowInteractor::WindowId
Window WindowId
Definition: vtkXRenderWindowInteractor.h:125