Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Rendering/vtkXRenderWindowInteractor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkXRenderWindowInteractor.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00055 #ifndef __vtkXRenderWindowInteractor_h
00056 #define __vtkXRenderWindowInteractor_h
00057 
00058 //===========================================================
00059 // now we define the C++ class
00060 
00061 #include "vtkRenderWindowInteractor.h"
00062 #include <X11/StringDefs.h> // Needed for X types in the public interface
00063 #include <X11/Intrinsic.h> // Needed for X types in the public interface
00064 
00065 class vtkCallbackCommand;
00066 
00067 class VTK_RENDERING_EXPORT vtkXRenderWindowInteractor : public vtkRenderWindowInteractor
00068 {
00069 public:
00070   static vtkXRenderWindowInteractor *New();
00071   vtkTypeRevisionMacro(vtkXRenderWindowInteractor,vtkRenderWindowInteractor);
00072   void PrintSelf(ostream& os, vtkIndent indent);
00073 
00077   virtual void Initialize();
00078 
00080   void TerminateApp(void) { exit(0); }
00081 
00083 
00086   vtkSetMacro(BreakLoopFlag, int);
00087   vtkGetMacro(BreakLoopFlag, int);
00088   vtkBooleanMacro(BreakLoopFlag, int);
00090 
00092 
00093   int CreateTimer(int timertype);
00094   int DestroyTimer(void);
00096 
00098 
00100   virtual void Initialize(XtAppContext app);
00101   vtkGetMacro( App, XtAppContext );
00103   
00105 
00112   virtual void Enable();
00113   virtual void Disable();
00115 
00119   virtual void Start();
00120 
00122 
00136   virtual void SetWidget(Widget);
00137   Widget GetWidget() {return this->Top;};
00139   
00141 
00165   virtual void SetTopLevelShell(Widget);
00166   Widget GetTopLevelShell() {return this->TopLevelShell;};
00168   
00171   virtual void GetMousePosition(int *x, int *y); 
00172 
00174 
00175   friend void vtkXRenderWindowInteractorCallback(Widget,XtPointer,
00176                                                  XEvent *,Boolean *);
00177   friend void vtkXRenderWindowInteractorTimer(XtPointer,XtIntervalId *);
00179 
00180 protected:
00181   vtkXRenderWindowInteractor();
00182   ~vtkXRenderWindowInteractor();
00183 
00184   Display *DisplayId;
00185   Window WindowId;
00186   Widget Top;
00187   int OwnTop;
00188   XtAppContext App;
00189   int PositionBeforeStereo[2];
00190   Widget TopLevelShell;
00191 
00192   int BreakLoopFlag;
00193   XtIntervalId AddTimeOut(XtAppContext app_context, unsigned long interval,
00194                           XtTimerCallbackProc proc, XtPointer client_data) ;
00195   void Timer(XtPointer client_data, XtIntervalId *id); 
00196   void Callback(Widget w, XtPointer client_data, XEvent *event, Boolean *ctd);
00197 
00198   vtkCallbackCommand* BreakXtLoopCallback;
00199   static void BreakXtLoop(vtkObject*, unsigned long, void*, void*);
00200 private:
00201   vtkXRenderWindowInteractor(const vtkXRenderWindowInteractor&);  // Not implemented.
00202   void operator=(const vtkXRenderWindowInteractor&);  // Not implemented.
00203 };
00204 
00205 #endif
00206 
00207 
00208