vtkInteractorStyleUnicam.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00092 #ifndef __vtkInteractorStyleUnicam_h
00093 #define __vtkInteractorStyleUnicam_h
00094
00095 #include "vtkInteractorStyle.h"
00096
00097 class vtkCamera;
00098 class vtkWorldPointPicker;
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109 #define VTK_UNICAM_NONE 0
00110 #define VTK_UNICAM_BUTTON_LEFT 1
00111 #define VTK_UNICAM_BUTTON_MIDDLE 2
00112 #define VTK_UNICAM_BUTTON_RIGHT 3
00113
00114
00115 #define VTK_UNICAM_CAM_INT_ROT 0
00116 #define VTK_UNICAM_CAM_INT_CHOOSE 1
00117 #define VTK_UNICAM_CAM_INT_PAN 2
00118 #define VTK_UNICAM_CAM_INT_DOLLY 3
00119
00120 class VTK_RENDERING_EXPORT vtkInteractorStyleUnicam : public vtkInteractorStyle
00121 {
00122 public:
00123 static vtkInteractorStyleUnicam *New();
00124 vtkTypeRevisionMacro(vtkInteractorStyleUnicam,vtkInteractorStyle);
00125 void PrintSelf(ostream& os, vtkIndent indent);
00126
00127 void SetWorldUpVector(double a[3]) {this->SetWorldUpVector(a[0],a[1],a[2]);}
00128 void SetWorldUpVector(double x, double y, double z);
00129 vtkGetVectorMacro(WorldUpVector, double, 3);
00130
00132
00133 virtual void OnMouseMove();
00134 virtual void OnLeftButtonDown();
00135 virtual void OnLeftButtonUp();
00136 virtual void OnLeftButtonMove();
00138
00141 virtual void OnTimer();
00142
00143 protected:
00144 vtkInteractorStyleUnicam();
00145 virtual ~vtkInteractorStyleUnicam();
00146
00147 vtkWorldPointPicker *InteractionPicker;
00148
00149 int ButtonDown;
00150 double DTime;
00151 double Dist;
00152 double StartPix[2];
00153 double LastPos[2];
00154 double LastPix[2];
00155 double DownPt[3];
00156 double Center [3];
00157
00158 double WorldUpVector[3];
00159
00160 vtkActor *FocusSphere;
00161 int IsDot;
00162 vtkRenderer *FocusSphereRenderer;
00163
00164 int state;
00165
00166 void ChooseXY( int X, int Y );
00167 void RotateXY( int X, int Y );
00168 void DollyXY( int X, int Y );
00169 void PanXY( int X, int Y );
00170
00171
00172 void MyTranslateCamera(double v[3]);
00173 void MyRotateCamera(double cx, double cy, double cz,
00174 double ax, double ay, double az,
00175 double angle);
00176
00177
00178
00179
00180
00181
00182 void GetRightVandUpV(double *p, vtkCamera *cam,
00183 double *rightV, double *upV);
00184
00185
00186 void NormalizeMouseXY(int X, int Y, double *NX, double *NY);
00187
00188
00189 double WindowAspect();
00190 private:
00191 vtkInteractorStyleUnicam(const vtkInteractorStyleUnicam&);
00192 void operator=(const vtkInteractorStyleUnicam&);
00193 };
00194
00195 #endif // __vtkInteractorStyleUnicam_h
00196
00197
00198