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