00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00065 #ifndef __vtkRenderWindowInteractor_h
00066 #define __vtkRenderWindowInteractor_h
00067
00068 #include "vtkObject.h"
00069 #include "vtkRenderWindow.h"
00070 #include "vtkAbstractPropPicker.h"
00071
00072
00073 #define VTKI_TIMER_FIRST 0
00074 #define VTKI_TIMER_UPDATE 1
00075
00076 class vtkInteractorStyle;
00077
00078 class VTK_EXPORT vtkRenderWindowInteractor : public vtkObject
00079 {
00080 public:
00081 static vtkRenderWindowInteractor *New();
00082 vtkTypeMacro(vtkRenderWindowInteractor,vtkObject);
00083 void PrintSelf(ostream& os, vtkIndent indent);
00084
00087 virtual void Initialize() {this->Initialized=1; this->Enable();
00088 this->RenderWindow->Render();}
00089
00092 void UnRegister(vtkObject *o);
00093
00097 virtual void Start() {};
00098
00106 virtual void Enable() { this->Enabled = 1; this->Modified();};
00107 virtual void Disable() { this->Enabled = 0; this->Modified();};
00108 vtkGetMacro(Enabled, int);
00109
00111 void SetRenderWindow(vtkRenderWindow *aren);
00112 vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
00113
00115 virtual void UpdateSize(int x,int y);
00116
00122 vtkSetVector2Macro(Size,int);
00123 vtkGetVector2Macro(Size,int);
00124
00130 virtual int CreateTimer(int ) { return 1; };
00131 virtual int DestroyTimer() { return 1; };
00132
00136 virtual void TerminateApp(void) {};
00137
00139 virtual void SetInteractorStyle(vtkInteractorStyle *);
00140 vtkGetObjectMacro(InteractorStyle,vtkInteractorStyle);
00141
00144 vtkSetMacro(LightFollowCamera,int);
00145 vtkGetMacro(LightFollowCamera,int);
00146 vtkBooleanMacro(LightFollowCamera,int);
00147
00150 vtkSetVector2Macro(EventPosition,int);
00151 vtkGetVectorMacro(EventPosition,int,2);
00152
00157 vtkSetClampMacro(DesiredUpdateRate,float,0.0001,VTK_LARGE_FLOAT);
00158 vtkGetMacro(DesiredUpdateRate,float);
00159
00162 vtkSetClampMacro(StillUpdateRate,float,0.0001,VTK_LARGE_FLOAT);
00163 vtkGetMacro(StillUpdateRate,float);
00164
00166 vtkGetMacro(Initialized,int);
00167
00172 vtkSetObjectMacro(Picker,vtkAbstractPicker);
00173 vtkGetObjectMacro(Picker,vtkAbstractPicker);
00174
00177 virtual vtkAbstractPropPicker *CreateDefaultPicker();
00178
00180 void SetStartPickMethod(void (*f)(void *), void *arg);
00181
00184 void SetStartPickMethodArgDelete(void (*f)(void *));
00185
00187 void SetEndPickMethod(void (*f)(void *), void *arg);
00188
00191 void SetEndPickMethodArgDelete(void (*f)(void *));
00192
00194 void SetUserMethod(void (*f)(void *), void *arg);
00195
00198 void SetUserMethodArgDelete(void (*f)(void *));
00199
00201 void SetExitMethod(void (*f)(void *), void *arg);
00202
00205 void SetExitMethodArgDelete(void (*f)(void *));
00206
00209 virtual void ExitCallback();
00210 virtual void UserCallback();
00211 virtual void StartPickCallback();
00212 virtual void EndPickCallback();
00213
00215 virtual void GetMousePosition(int *x, int *y) { *x = 0 ; *y = 0; };
00216
00219 void HideCursor() { this->RenderWindow->HideCursor(); };
00220 void ShowCursor() { this->RenderWindow->ShowCursor(); };
00221
00224 void Render();
00225
00226 protected:
00227 vtkRenderWindowInteractor();
00228 ~vtkRenderWindowInteractor();
00229 vtkRenderWindowInteractor(const vtkRenderWindowInteractor&) {};
00230 void operator=(const vtkRenderWindowInteractor&) {};
00231
00232 vtkRenderWindow *RenderWindow;
00233 vtkInteractorStyle *InteractorStyle;
00234
00235
00236 vtkAbstractPicker *Picker;
00237
00238
00239 int Initialized;
00240 int Enabled;
00241 int Style;
00242 int LightFollowCamera;
00243 int ActorMode;
00244 float DesiredUpdateRate;
00245 float StillUpdateRate;
00246 int EventPosition[2];
00247 int Size[2];
00248
00249
00250 unsigned long StartPickTag;
00251 unsigned long EndPickTag;
00252 unsigned long UserTag;
00253 unsigned long ExitTag;
00254 };
00255
00256 #endif