Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkXRenderWindowInteractor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkXRenderWindowInteractor.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00038 #ifndef __vtkXRenderWindowInteractor_h
00039 #define __vtkXRenderWindowInteractor_h
00040 
00041 //===========================================================
00042 // now we define the C++ class
00043 
00044 #include "vtkRenderWindowInteractor.h"
00045 #include <X11/StringDefs.h> // Needed for X types in the public interface
00046 #include <X11/Intrinsic.h> // Needed for X types in the public interface
00047 
00048 class vtkCallbackCommand;
00049 
00050 //BTX
00051 // Forward declare internal friend functions.
00052 void vtkXRenderWindowInteractorCallback(Widget,XtPointer, XEvent *,Boolean *);
00053 void vtkXRenderWindowInteractorTimer(XtPointer,XtIntervalId *);
00054 //ETX
00055 
00056 class VTK_RENDERING_EXPORT vtkXRenderWindowInteractor : public vtkRenderWindowInteractor
00057 {
00058 public:
00059   static vtkXRenderWindowInteractor *New();
00060   vtkTypeRevisionMacro(vtkXRenderWindowInteractor,vtkRenderWindowInteractor);
00061   void PrintSelf(ostream& os, vtkIndent indent);
00062 
00066   virtual void Initialize();
00067 
00069   void TerminateApp(void) { exit(0); }
00070 
00072 
00075   vtkSetMacro(BreakLoopFlag, int);
00076   vtkGetMacro(BreakLoopFlag, int);
00077   vtkBooleanMacro(BreakLoopFlag, int);
00079 
00081 
00082   int CreateTimer(int timertype);
00083   int DestroyTimer(void);
00085 
00087 
00089   virtual void Initialize(XtAppContext app);
00090   vtkGetMacro( App, XtAppContext );
00092   
00094 
00101   virtual void Enable();
00102   virtual void Disable();
00104 
00108   virtual void Start();
00109 
00111 
00125   virtual void SetWidget(Widget);
00126   Widget GetWidget() {return this->Top;};
00128   
00130 
00154   virtual void SetTopLevelShell(Widget);
00155   Widget GetTopLevelShell() {return this->TopLevelShell;};
00157   
00160   virtual void GetMousePosition(int *x, int *y); 
00161 
00163 
00164   friend void vtkXRenderWindowInteractorCallback(Widget,XtPointer,
00165                                                  XEvent *,Boolean *);
00166   friend void vtkXRenderWindowInteractorTimer(XtPointer,XtIntervalId *);
00168 
00169 protected:
00170   vtkXRenderWindowInteractor();
00171   ~vtkXRenderWindowInteractor();
00172 
00173   //Using static here to avoid detroying context when many apps are open:
00174   static XtAppContext App;
00175   static int NumAppInitialized;
00176 
00177   Display *DisplayId;
00178   Window WindowId;
00179   Atom KillAtom;
00180   Widget Top;
00181   int OwnTop;
00182   int OwnApp;
00183   int PositionBeforeStereo[2];
00184   Widget TopLevelShell;
00185 
00186   int BreakLoopFlag;
00187   XtIntervalId AddTimeOut(XtAppContext app_context, unsigned long interval,
00188                           XtTimerCallbackProc proc, XtPointer client_data) ;
00189   void Timer(XtPointer client_data, XtIntervalId *id); 
00190   void Callback(Widget w, XtPointer client_data, XEvent *event, Boolean *ctd);
00191 
00192   vtkCallbackCommand* BreakXtLoopCallback;
00193   static void BreakXtLoop(vtkObject*, unsigned long, void*, void*);
00194 private:
00195   vtkXRenderWindowInteractor(const vtkXRenderWindowInteractor&);  // Not implemented.
00196   void operator=(const vtkXRenderWindowInteractor&);  // Not implemented.
00197 };
00198 
00199 #endif
00200 
00201 
00202 

Generated on Mon Jan 21 23:07:37 2008 for VTK by  doxygen 1.4.3-20050530