VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkInteractorStyleFlight.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 00041 #ifndef vtkInteractorStyleFlight_h 00042 #define vtkInteractorStyleFlight_h 00043 00044 #include "vtkInteractionStyleModule.h" // For export macro 00045 #include "vtkInteractorStyle.h" 00046 class vtkCamera; 00047 class vtkPerspectiveTransform; 00048 //BTX 00049 class CPIDControl; 00050 //ETX 00051 00052 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleFlight : public vtkInteractorStyle 00053 { 00054 public: 00055 static vtkInteractorStyleFlight *New(); 00056 vtkTypeMacro(vtkInteractorStyleFlight,vtkInteractorStyle); 00057 void PrintSelf(ostream& os, vtkIndent indent); 00058 00061 void JumpTo(double campos[3], double focpos[3]); 00062 00064 00065 vtkSetMacro(MotionStepSize,double); 00066 vtkGetMacro(MotionStepSize,double); 00068 00070 00071 vtkSetMacro(MotionAccelerationFactor,double); 00072 vtkGetMacro(MotionAccelerationFactor,double); 00074 00076 00077 vtkSetMacro(AngleStepSize,double); 00078 vtkGetMacro(AngleStepSize,double); 00080 00082 00083 vtkSetMacro(AngleAccelerationFactor,double); 00084 vtkGetMacro(AngleAccelerationFactor,double); 00086 00088 00089 vtkSetMacro(DisableMotion,int); 00090 vtkGetMacro(DisableMotion,int); 00091 vtkBooleanMacro(DisableMotion,int); 00093 00095 00100 vtkSetMacro(RestoreUpVector,int); 00101 vtkGetMacro(RestoreUpVector,int); 00102 vtkBooleanMacro(RestoreUpVector,int); 00104 00105 // Specify "up" (by default {0,0,1} but can be changed) 00106 vtkGetVectorMacro(DefaultUpVector,double,3); 00107 vtkSetVectorMacro(DefaultUpVector,double,3); 00108 00110 00111 virtual void OnMouseMove(); 00112 virtual void OnLeftButtonDown(); 00113 virtual void OnLeftButtonUp(); 00114 virtual void OnMiddleButtonDown(); 00115 virtual void OnMiddleButtonUp(); 00116 virtual void OnRightButtonDown(); 00117 virtual void OnRightButtonUp(); 00119 00121 00122 virtual void OnChar(); 00123 virtual void OnKeyDown(); 00124 virtual void OnKeyUp(); 00125 virtual void OnTimer(); 00126 // 00127 virtual void ForwardFly(); 00128 virtual void ReverseFly(); 00129 // 00130 virtual void StartForwardFly(); 00131 virtual void EndForwardFly(); 00132 virtual void StartReverseFly(); 00133 virtual void EndReverseFly(); 00135 00136 protected: 00137 vtkInteractorStyleFlight(); 00138 ~vtkInteractorStyleFlight(); 00139 00141 00142 void UpdateSteering(vtkCamera *cam); 00143 void UpdateMouseSteering(vtkCamera *cam); 00144 void FlyByMouse(vtkCamera* cam); 00145 void FlyByKey(vtkCamera* cam); 00146 void GetLRVector(double vector[3], vtkCamera* cam); 00147 void MotionAlongVector(double vector[3], double amount, vtkCamera* cam); 00148 void SetupMotionVars(vtkCamera *cam); 00149 void FinishCamera(vtkCamera* cam); 00150 // 00151 // 00152 unsigned char KeysDown; 00153 int DisableMotion; 00154 int RestoreUpVector; 00155 double DiagonalLength; 00156 double MotionStepSize; 00157 double MotionUserScale; 00158 double MotionAccelerationFactor; 00159 double AngleStepSize; 00160 double AngleAccelerationFactor; 00161 double DefaultUpVector[3]; 00162 double AzimuthStepSize; 00163 double IdealFocalPoint[3]; 00164 vtkPerspectiveTransform *Transform; 00165 double DeltaYaw; 00166 double lYaw; 00167 double DeltaPitch; 00168 double lPitch; 00169 //BTX 00170 CPIDControl *PID_Yaw; 00171 CPIDControl *PID_Pitch; 00172 //ETX 00173 private: 00174 vtkInteractorStyleFlight(const vtkInteractorStyleFlight&); // Not implemented. 00175 void operator=(const vtkInteractorStyleFlight&); // Not implemented. 00176 }; 00178 00179 #endif