Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages
Rendering/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
00023
00095 #ifndef __vtkInteractorStyleUnicam_h
00096 #define __vtkInteractorStyleUnicam_h
00097
00098 #include "vtkInteractorStyle.h"
00099
00100 class vtkCamera;
00101 class vtkWorldPointPicker;
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 #define VTK_UNICAM_NONE 0
00113 #define VTK_UNICAM_BUTTON_LEFT 1
00114 #define VTK_UNICAM_BUTTON_MIDDLE 2
00115 #define VTK_UNICAM_BUTTON_RIGHT 3
00116
00117
00118 #define VTK_UNICAM_CAM_INT_ROT 0
00119 #define VTK_UNICAM_CAM_INT_CHOOSE 1
00120 #define VTK_UNICAM_CAM_INT_PAN 2
00121 #define VTK_UNICAM_CAM_INT_DOLLY 3
00122
00123 class VTK_RENDERING_EXPORT vtkInteractorStyleUnicam : public vtkInteractorStyle
00124 {
00125 public:
00126 static vtkInteractorStyleUnicam *New();
00127 vtkTypeRevisionMacro(vtkInteractorStyleUnicam,vtkInteractorStyle);
00128 void PrintSelf(ostream& os, vtkIndent indent);
00129
00130 void SetWorldUpVector(double a[3]) {this->SetWorldUpVector(a[0],a[1],a[2]);}
00131 void SetWorldUpVector(float a[3]) {this->SetWorldUpVector(a[0],a[1],a[2]);}
00132 void SetWorldUpVector(float x, float y, float z);
00133 vtkGetVectorMacro(WorldUpVector, float, 3);
00134
00136
00137 virtual void OnMouseMove();
00138 virtual void OnLeftButtonDown();
00139 virtual void OnLeftButtonUp();
00140 virtual void OnLeftButtonMove();
00142
00145 virtual void OnTimer();
00146
00147 protected:
00148 vtkInteractorStyleUnicam();
00149 virtual ~vtkInteractorStyleUnicam();
00150
00151 vtkWorldPointPicker *InteractionPicker;
00152
00153 int ButtonDown;
00154 double DTime;
00155 double Dist;
00156 float StartPix[2];
00157 float LastPos[2];
00158 float LastPix[2];
00159 float DownPt[3];
00160 float Center [3];
00161
00162 float WorldUpVector[3];
00163
00164 vtkActor *FocusSphere;
00165 int IsDot;
00166 vtkRenderer *FocusSphereRenderer;
00167
00168 int state;
00169
00170 void ChooseXY( int X, int Y );
00171 void RotateXY( int X, int Y );
00172 void DollyXY( int X, int Y );
00173 void PanXY( int X, int Y );
00174
00175
00176 void MyTranslateCamera(float v[3]);
00177 void MyRotateCamera(float cx, float cy, float cz,
00178 float ax, float ay, float az,
00179 float angle);
00180
00181
00182
00183
00184
00185
00186 void GetRightVandUpV(float *p, vtkCamera *cam,
00187 float *rightV, float *upV);
00188
00189
00190 void NormalizeMouseXY(int X, int Y, float *NX, float *NY);
00191
00192
00193 float WindowAspect();
00194 private:
00195 vtkInteractorStyleUnicam(const vtkInteractorStyleUnicam&);
00196 void operator=(const vtkInteractorStyleUnicam&);
00197 };
00198
00199 #endif // __vtkInteractorStyleUnicam_h
00200
00201
00202