VTK
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 =========================================================================*/
38 #ifndef vtkXRenderWindowInteractor_h
39 #define vtkXRenderWindowInteractor_h
40 
41 //===========================================================
42 // now we define the C++ class
43 
44 #include "vtkRenderingOpenGLModule.h" // For export macro
46 #include <X11/StringDefs.h> // Needed for X types in the public interface
47 #include <X11/Intrinsic.h> // Needed for X types in the public interface
48 
49 class vtkCallbackCommand;
50 class vtkXRenderWindowInteractorInternals;
51 
52 //BTX
53 // Forward declare internal friend functions.
54 void VTKRENDERINGOPENGL_EXPORT vtkXRenderWindowInteractorCallback(Widget,XtPointer, XEvent *,Boolean *);
56 //ETX
57 
59 {
60 public:
63  void PrintSelf(ostream& os, vtkIndent indent);
64 
68  virtual void Initialize();
69 
71  void TerminateApp();
72 
74 
77  vtkGetMacro(BreakLoopFlag, int);
78  void SetBreakLoopFlag(int);
82 
84 
86  virtual void Initialize(XtAppContext app);
87  vtkGetMacro( App, XtAppContext );
89 
91 
98  virtual void Enable();
99  virtual void Disable();
101 
104  virtual void UpdateSize(int,int);
105 
107 
121  virtual void SetWidget(Widget);
122  Widget GetWidget() {return this->Top;};
124 
126 
150  virtual void SetTopLevelShell(Widget);
151  Widget GetTopLevelShell() {return this->TopLevelShell;};
153 
156  virtual void GetMousePosition(int *x, int *y);
157 
159 
160  friend void vtkXRenderWindowInteractorCallback(Widget,XtPointer,
161  XEvent *,Boolean *);
162  friend void vtkXRenderWindowInteractorTimer(XtPointer,XtIntervalId *);
164 
165 protected:
168 
169  //Using static here to avoid detroying context when many apps are open:
170  static XtAppContext App;
171  static int NumAppInitialized;
172 
173  Display *DisplayId;
174  Window WindowId;
175  Atom KillAtom;
176  Widget Top;
177  int OwnTop;
178  int OwnApp;
179  int PositionBeforeStereo[2];
181  int TimerId;
182  vtkXRenderWindowInteractorInternals* Internal;
183 
187  virtual void StartEventLoop();
188 
190 
192  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
193  virtual int InternalDestroyTimer(int platformTimerId);
195 
196  XtIntervalId AddTimeOut(XtAppContext app_context, unsigned long interval,
197  XtTimerCallbackProc proc, XtPointer client_data) ;
198  void Timer(XtPointer client_data, XtIntervalId *id);
199  void Callback(Widget w, XtPointer client_data, XEvent *event, Boolean *ctd);
200 
201  static int BreakLoopFlag;
202 
203 private:
204  vtkXRenderWindowInteractor(const vtkXRenderWindowInteractor&); // Not implemented.
205  void operator=(const vtkXRenderWindowInteractor&); // Not implemented.
206 };
207 
208 #endif
vtkXRenderWindowInteractor::AddTimeOut
XtIntervalId AddTimeOut(XtAppContext app_context, unsigned long interval, XtTimerCallbackProc proc, XtPointer client_data)
vtkXRenderWindowInteractor::GetTopLevelShell
Widget GetTopLevelShell()
Definition: vtkXRenderWindowInteractor.h:151
vtkXRenderWindowInteractor::Enable
virtual void Enable()
vtkXRenderWindowInteractorTimer
void VTKRENDERINGOPENGL_EXPORT vtkXRenderWindowInteractorTimer(XtPointer, XtIntervalId *)
vtkRenderingOpenGLModule.h
vtkXRenderWindowInteractor::BreakLoopFlagOn
void BreakLoopFlagOn()
vtkXRenderWindowInteractor::StartEventLoop
virtual void StartEventLoop()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkXRenderWindowInteractor::New
static vtkXRenderWindowInteractor * New()
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkXRenderWindowInteractor::OwnApp
int OwnApp
Definition: vtkXRenderWindowInteractor.h:178
vtkgl::event
struct _cl_event * event
Definition: vtkgl.h:14387
vtkXRenderWindowInteractor::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkXRenderWindowInteractor
an X event driven interface for a RenderWindow
Definition: vtkXRenderWindowInteractor.h:59
vtkXRenderWindowInteractor::vtkXRenderWindowInteractor
vtkXRenderWindowInteractor()
vtkXRenderWindowInteractor::TerminateApp
void TerminateApp()
vtkXRenderWindowInteractor::KillAtom
Atom KillAtom
Definition: vtkXRenderWindowInteractor.h:175
vtkXRenderWindowInteractor::UpdateSize
virtual void UpdateSize(int, int)
vtkXRenderWindowInteractor::BreakLoopFlagOff
void BreakLoopFlagOff()
vtkXRenderWindowInteractor::SetTopLevelShell
virtual void SetTopLevelShell(Widget)
vtkXRenderWindowInteractor::OwnTop
int OwnTop
Definition: vtkXRenderWindowInteractor.h:177
vtkXRenderWindowInteractor::Internal
vtkXRenderWindowInteractorInternals * Internal
Definition: vtkXRenderWindowInteractor.h:182
vtkXRenderWindowInteractor::GetMousePosition
virtual void GetMousePosition(int *x, int *y)
vtkXRenderWindowInteractor::BreakLoopFlag
static int BreakLoopFlag
Definition: vtkXRenderWindowInteractor.h:201
vtkXRenderWindowInteractor::Disable
virtual void Disable()
vtkXRenderWindowInteractor::Timer
void Timer(XtPointer client_data, XtIntervalId *id)
vtkXRenderWindowInteractor::Initialize
virtual void Initialize()
vtkXRenderWindowInteractor::InternalCreateTimer
virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkXRenderWindowInteractor::TopLevelShell
Widget TopLevelShell
Definition: vtkXRenderWindowInteractor.h:180
vtkXRenderWindowInteractor::SetWidget
virtual void SetWidget(Widget)
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkXRenderWindowInteractor::~vtkXRenderWindowInteractor
~vtkXRenderWindowInteractor()
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:80
vtkXRenderWindowInteractor::GetWidget
Widget GetWidget()
Definition: vtkXRenderWindowInteractor.h:122
vtkXRenderWindowInteractor::vtkXRenderWindowInteractorTimer
friend void vtkXRenderWindowInteractorTimer(XtPointer, XtIntervalId *)
vtkXRenderWindowInteractor::Top
Widget Top
Definition: vtkXRenderWindowInteractor.h:176
vtkXRenderWindowInteractor::InternalDestroyTimer
virtual int InternalDestroyTimer(int platformTimerId)
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkXRenderWindowInteractor::vtkXRenderWindowInteractorCallback
friend void vtkXRenderWindowInteractorCallback(Widget, XtPointer, XEvent *, Boolean *)
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:50
vtkRenderWindowInteractor.h
vtkXRenderWindowInteractor::App
static XtAppContext App
Definition: vtkXRenderWindowInteractor.h:170
vtkXRenderWindowInteractor::Callback
void Callback(Widget w, XtPointer client_data, XEvent *event, Boolean *ctd)
vtkXRenderWindowInteractor::Initialize
virtual void Initialize(XtAppContext app)
vtkgl::w
GLubyte GLubyte GLubyte GLubyte w
Definition: vtkgl.h:12054
vtkXRenderWindowInteractor::NumAppInitialized
static int NumAppInitialized
Definition: vtkXRenderWindowInteractor.h:171
vtkXRenderWindowInteractor::DisplayId
Display * DisplayId
Definition: vtkXRenderWindowInteractor.h:173
vtkXRenderWindowInteractorCallback
void VTKRENDERINGOPENGL_EXPORT vtkXRenderWindowInteractorCallback(Widget, XtPointer, XEvent *, Boolean *)
vtkXRenderWindowInteractor::TimerId
int TimerId
Definition: vtkXRenderWindowInteractor.h:181
vtkXRenderWindowInteractor::SetBreakLoopFlag
void SetBreakLoopFlag(int)
VTKRENDERINGOPENGL_EXPORT
#define VTKRENDERINGOPENGL_EXPORT
Definition: vtkRenderingOpenGLModule.h:15
vtkXRenderWindowInteractor::WindowId
Window WindowId
Definition: vtkXRenderWindowInteractor.h:174