Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class 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 =========================================================================*/
00042 #ifndef __vtkXRenderWindowInteractor_h
00043 #define __vtkXRenderWindowInteractor_h
00044 
00045 //===========================================================
00046 // now we define the C++ class
00047 
00048 #include "vtkRenderWindowInteractor.h"
00049 #include <X11/StringDefs.h> // Needed for X types in the public interface
00050 #include <X11/Intrinsic.h> // Needed for X types in the public interface
00051 
00052 class vtkCallbackCommand;
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(void) { exit(0); }
00068 
00070 
00073   vtkSetMacro(BreakLoopFlag, int);
00074   vtkGetMacro(BreakLoopFlag, int);
00075   vtkBooleanMacro(BreakLoopFlag, int);
00077 
00079 
00080   int CreateTimer(int timertype);
00081   int DestroyTimer(void);
00083 
00085 
00087   virtual void Initialize(XtAppContext app);
00088   vtkGetMacro( App, XtAppContext );
00090   
00092 
00099   virtual void Enable();
00100   virtual void Disable();
00102 
00106   virtual void Start();
00107 
00109 
00123   virtual void SetWidget(Widget);
00124   Widget GetWidget() {return this->Top;};
00126   
00128 
00152   virtual void SetTopLevelShell(Widget);
00153   Widget GetTopLevelShell() {return this->TopLevelShell;};
00155   
00158   virtual void GetMousePosition(int *x, int *y); 
00159 
00161 
00162   friend void vtkXRenderWindowInteractorCallback(Widget,XtPointer,
00163                                                  XEvent *,Boolean *);
00164   friend void vtkXRenderWindowInteractorTimer(XtPointer,XtIntervalId *);
00166 
00167 protected:
00168   vtkXRenderWindowInteractor();
00169   ~vtkXRenderWindowInteractor();
00170 
00171   Display *DisplayId;
00172   Window WindowId;
00173   Widget Top;
00174   int OwnTop;
00175   XtAppContext App;
00176   int PositionBeforeStereo[2];
00177   Widget TopLevelShell;
00178 
00179   int BreakLoopFlag;
00180   XtIntervalId AddTimeOut(XtAppContext app_context, unsigned long interval,
00181                           XtTimerCallbackProc proc, XtPointer client_data) ;
00182   void Timer(XtPointer client_data, XtIntervalId *id); 
00183   void Callback(Widget w, XtPointer client_data, XEvent *event, Boolean *ctd);
00184 
00185   vtkCallbackCommand* BreakXtLoopCallback;
00186   static void BreakXtLoop(vtkObject*, unsigned long, void*, void*);
00187 private:
00188   vtkXRenderWindowInteractor(const vtkXRenderWindowInteractor&);  // Not implemented.
00189   void operator=(const vtkXRenderWindowInteractor&);  // Not implemented.
00190 };
00191 
00192 #endif
00193 
00194 
00195