vtkInteractorObserver.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00055 #ifndef __vtkInteractorObserver_h
00056 #define __vtkInteractorObserver_h
00057
00058 #include "vtkObject.h"
00059
00060 class vtkRenderWindowInteractor;
00061 class vtkRenderer;
00062 class vtkCallbackCommand;
00063
00064 class VTK_RENDERING_EXPORT vtkInteractorObserver : public vtkObject
00065 {
00066 public:
00067 vtkTypeRevisionMacro(vtkInteractorObserver,vtkObject);
00068 void PrintSelf(ostream& os, vtkIndent indent);
00069
00071
00077 virtual void SetEnabled(int) {};
00078 int GetEnabled() {return this->Enabled;}
00079 void EnabledOn() {this->SetEnabled(1);}
00080 void EnabledOff() {this->SetEnabled(0);}
00081 void On() {this->SetEnabled(1);}
00082 void Off() {this->SetEnabled(0);}
00084
00086
00091 virtual void SetInteractor(vtkRenderWindowInteractor* iren);
00092 vtkGetObjectMacro(Interactor, vtkRenderWindowInteractor);
00094
00096
00104 vtkSetClampMacro(Priority,float,0.0f,1.0f);
00105 vtkGetMacro(Priority,float);
00107
00109
00113 vtkSetMacro(KeyPressActivation,int);
00114 vtkGetMacro(KeyPressActivation,int);
00115 vtkBooleanMacro(KeyPressActivation,int);
00117
00119
00125 vtkSetMacro(KeyPressActivationValue,char);
00126 vtkGetMacro(KeyPressActivationValue,char);
00128
00130
00136 vtkGetObjectMacro(DefaultRenderer,vtkRenderer);
00137 virtual void SetDefaultRenderer(vtkRenderer*);
00139
00141
00149 vtkGetObjectMacro(CurrentRenderer,vtkRenderer);
00150 virtual void SetCurrentRenderer(vtkRenderer*);
00152
00153
00154 virtual void OnChar();
00155
00156 protected:
00157 vtkInteractorObserver();
00158 ~vtkInteractorObserver();
00159
00161
00164 virtual void StartInteraction();
00165 virtual void EndInteraction();
00167
00169
00171 static void ProcessEvents(vtkObject* object,
00172 unsigned long event,
00173 void* clientdata,
00174 void* calldata);
00176
00178
00179 void ComputeDisplayToWorld(double x, double y, double z,
00180 double worldPt[4]);
00181 void ComputeWorldToDisplay(double x, double y, double z,
00182 double displayPt[3]);
00184
00185
00186 int Enabled;
00187
00188
00189 vtkCallbackCommand* EventCallbackCommand;
00190 vtkCallbackCommand* KeyPressCallbackCommand;
00191
00192
00193 float Priority;
00194
00195
00196 int KeyPressActivation;
00197 char KeyPressActivationValue;
00198
00199
00200 vtkRenderWindowInteractor *Interactor;
00201
00202
00203 vtkRenderer *CurrentRenderer;
00204 vtkRenderer *DefaultRenderer;
00205
00206 unsigned long CharObserverTag;
00207 unsigned long DeleteObserverTag;
00208
00209 private:
00210 vtkInteractorObserver(const vtkInteractorObserver&);
00211 void operator=(const vtkInteractorObserver&);
00212
00213 };
00214
00215 #endif