00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00043 #ifndef __vtkInteractorObserver_h
00044 #define __vtkInteractorObserver_h
00045
00046 #include "vtkObject.h"
00047
00048 class vtkRenderWindowInteractor;
00049 class vtkRenderer;
00050 class vtkCallbackCommand;
00051
00052 class VTK_RENDERING_EXPORT vtkInteractorObserver : public vtkObject
00053 {
00054 public:
00055 vtkTypeRevisionMacro(vtkInteractorObserver,vtkObject);
00056 void PrintSelf(ostream& os, vtkIndent indent);
00057
00059
00065 virtual void SetEnabled(int) {};
00066 int GetEnabled() {return this->Enabled;}
00067 void EnabledOn() {this->SetEnabled(1);}
00068 void EnabledOff() {this->SetEnabled(0);}
00069 void On() {this->SetEnabled(1);}
00070 void Off() {this->SetEnabled(0);}
00072
00074
00079 virtual void SetInteractor(vtkRenderWindowInteractor* iren);
00080 vtkGetObjectMacro(Interactor, vtkRenderWindowInteractor);
00082
00084
00092 vtkSetClampMacro(Priority,float,0.0f,1.0f);
00093 vtkGetMacro(Priority,float);
00095
00097
00101 vtkSetMacro(KeyPressActivation,int);
00102 vtkGetMacro(KeyPressActivation,int);
00103 vtkBooleanMacro(KeyPressActivation,int);
00105
00107
00113 vtkSetMacro(KeyPressActivationValue,char);
00114 vtkGetMacro(KeyPressActivationValue,char);
00116
00118
00124 vtkGetObjectMacro(DefaultRenderer,vtkRenderer);
00125 virtual void SetDefaultRenderer(vtkRenderer*);
00127
00129
00137 vtkGetObjectMacro(CurrentRenderer,vtkRenderer);
00138 virtual void SetCurrentRenderer(vtkRenderer*);
00140
00141
00142 virtual void OnChar();
00143
00144
00145
00146 static void ComputeDisplayToWorld(vtkRenderer *ren, double x, double y,
00147 double z, double worldPt[4]);
00148 static void ComputeWorldToDisplay(vtkRenderer *ren, double x, double y,
00149 double z, double displayPt[3]);
00150
00151 protected:
00152 vtkInteractorObserver();
00153 ~vtkInteractorObserver();
00154
00156
00159 virtual void StartInteraction();
00160 virtual void EndInteraction();
00162
00164
00166 static void ProcessEvents(vtkObject* object,
00167 unsigned long event,
00168 void* clientdata,
00169 void* calldata);
00171
00173
00174 void ComputeDisplayToWorld(double x, double y, double z,
00175 double worldPt[4]);
00176 void ComputeWorldToDisplay(double x, double y, double z,
00177 double displayPt[3]);
00179
00180
00181 int Enabled;
00182
00183
00184 vtkCallbackCommand* EventCallbackCommand;
00185 vtkCallbackCommand* KeyPressCallbackCommand;
00186
00187
00188 float Priority;
00189
00190
00191 int KeyPressActivation;
00192 char KeyPressActivationValue;
00193
00194
00195 vtkRenderWindowInteractor *Interactor;
00196
00197
00198 vtkRenderer *CurrentRenderer;
00199 vtkRenderer *DefaultRenderer;
00200
00201 unsigned long CharObserverTag;
00202 unsigned long DeleteObserverTag;
00203
00204 private:
00205 vtkInteractorObserver(const vtkInteractorObserver&);
00206 void operator=(const vtkInteractorObserver&);
00207
00208 };
00209
00210 #endif