00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00035 #ifndef __vtkXRenderWindowInteractor_h
00036 #define __vtkXRenderWindowInteractor_h
00037
00038
00039
00040
00041 #include "vtkRenderWindowInteractor.h"
00042 #include <X11/StringDefs.h>
00043 #include <X11/Intrinsic.h>
00044
00045 class vtkCallbackCommand;
00046 class vtkXRenderWindowInteractorInternals;
00047
00048
00049
00050 void VTK_RENDERING_EXPORT vtkXRenderWindowInteractorCallback(Widget,XtPointer, XEvent *,Boolean *);
00051 void VTK_RENDERING_EXPORT vtkXRenderWindowInteractorTimer(XtPointer,XtIntervalId *);
00052
00053
00054 class VTK_RENDERING_EXPORT vtkXRenderWindowInteractor : public vtkRenderWindowInteractor
00055 {
00056 public:
00057 static vtkXRenderWindowInteractor *New();
00058 vtkTypeRevisionMacro(vtkXRenderWindowInteractor,vtkRenderWindowInteractor);
00059 void PrintSelf(ostream& os, vtkIndent indent);
00060
00064 virtual void Initialize();
00065
00067 void TerminateApp();
00068
00070
00073 vtkGetMacro(BreakLoopFlag, int);
00074 void SetBreakLoopFlag(int);
00075 void BreakLoopFlagOff();
00076 void BreakLoopFlagOn();
00078
00080
00082 virtual void Initialize(XtAppContext app);
00083 vtkGetMacro( App, XtAppContext );
00085
00087
00094 virtual void Enable();
00095 virtual void Disable();
00097
00101 virtual void Start();
00102
00105 virtual void UpdateSize(int,int);
00106
00108
00122 virtual void SetWidget(Widget);
00123 Widget GetWidget() {return this->Top;};
00125
00127
00151 virtual void SetTopLevelShell(Widget);
00152 Widget GetTopLevelShell() {return this->TopLevelShell;};
00154
00157 virtual void GetMousePosition(int *x, int *y);
00158
00160
00161 friend void vtkXRenderWindowInteractorCallback(Widget,XtPointer,
00162 XEvent *,Boolean *);
00163 friend void vtkXRenderWindowInteractorTimer(XtPointer,XtIntervalId *);
00165
00166 protected:
00167 vtkXRenderWindowInteractor();
00168 ~vtkXRenderWindowInteractor();
00169
00170
00171 static XtAppContext App;
00172 static int NumAppInitialized;
00173
00174 Display *DisplayId;
00175 Window WindowId;
00176 Atom KillAtom;
00177 Widget Top;
00178 int OwnTop;
00179 int OwnApp;
00180 int PositionBeforeStereo[2];
00181 Widget TopLevelShell;
00182 int TimerId;
00183 vtkXRenderWindowInteractorInternals* Internal;
00184
00186
00188 virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
00189 virtual int InternalDestroyTimer(int platformTimerId);
00191
00192 XtIntervalId AddTimeOut(XtAppContext app_context, unsigned long interval,
00193 XtTimerCallbackProc proc, XtPointer client_data) ;
00194 void Timer(XtPointer client_data, XtIntervalId *id);
00195 void Callback(Widget w, XtPointer client_data, XEvent *event, Boolean *ctd);
00196
00197 int BreakLoopFlag;
00198
00199 private:
00200 vtkXRenderWindowInteractor(const vtkXRenderWindowInteractor&);
00201 void operator=(const vtkXRenderWindowInteractor&);
00202 };
00203
00204 #endif