VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkInteractorStyleFlight.h,v $ 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 00038 #ifndef __vtkInteractorStyleFlight_h 00039 #define __vtkInteractorStyleFlight_h 00040 00041 #include "vtkInteractorStyle.h" 00042 class vtkCamera; 00043 class vtkPerspectiveTransform; 00044 //BTX 00045 class CPIDControl; 00046 //ETX 00047 00048 class VTK_RENDERING_EXPORT vtkInteractorStyleFlight : public vtkInteractorStyle 00049 { 00050 public: 00051 static vtkInteractorStyleFlight *New(); 00052 vtkTypeRevisionMacro(vtkInteractorStyleFlight,vtkInteractorStyle); 00053 void PrintSelf(ostream& os, vtkIndent indent); 00054 00057 void JumpTo(double campos[3], double focpos[3]); 00058 00060 00061 vtkSetMacro(MotionStepSize,double); 00062 vtkGetMacro(MotionStepSize,double); 00064 00066 00067 vtkSetMacro(MotionAccelerationFactor,double); 00068 vtkGetMacro(MotionAccelerationFactor,double); 00070 00072 00073 vtkSetMacro(AngleStepSize,double); 00074 vtkGetMacro(AngleStepSize,double); 00076 00078 00079 vtkSetMacro(AngleAccelerationFactor,double); 00080 vtkGetMacro(AngleAccelerationFactor,double); 00082 00084 00085 vtkSetMacro(DisableMotion,int); 00086 vtkGetMacro(DisableMotion,int); 00087 vtkBooleanMacro(DisableMotion,int); 00089 00091 00096 vtkSetMacro(RestoreUpVector,int); 00097 vtkGetMacro(RestoreUpVector,int); 00098 vtkBooleanMacro(RestoreUpVector,int); 00100 00101 // Specify "up" (by default {0,0,1} but can be changed) 00102 vtkGetVectorMacro(DefaultUpVector,double,3); 00103 vtkSetVectorMacro(DefaultUpVector,double,3); 00104 00106 00107 virtual void OnMouseMove(); 00108 virtual void OnLeftButtonDown(); 00109 virtual void OnLeftButtonUp(); 00110 virtual void OnMiddleButtonDown(); 00111 virtual void OnMiddleButtonUp(); 00112 virtual void OnRightButtonDown(); 00113 virtual void OnRightButtonUp(); 00115 00117 00118 virtual void OnChar(); 00119 virtual void OnKeyDown(); 00120 virtual void OnKeyUp(); 00121 virtual void OnTimer(); 00122 // 00123 virtual void ForwardFly(); 00124 virtual void ReverseFly(); 00125 // 00126 virtual void StartForwardFly(); 00127 virtual void EndForwardFly(); 00128 virtual void StartReverseFly(); 00129 virtual void EndReverseFly(); 00131 00132 protected: 00133 vtkInteractorStyleFlight(); 00134 ~vtkInteractorStyleFlight(); 00135 00137 00138 void UpdateSteering(vtkCamera *cam); 00139 void UpdateMouseSteering(vtkCamera *cam); 00140 void FlyByMouse(vtkCamera* cam); 00141 void FlyByKey(vtkCamera* cam); 00142 void GetLRVector(double vector[3], vtkCamera* cam); 00143 void MotionAlongVector(double vector[3], double amount, vtkCamera* cam); 00144 void SetupMotionVars(vtkCamera *cam); 00145 void FinishCamera(vtkCamera* cam); 00146 // 00147 // 00148 unsigned char KeysDown; 00149 int DisableMotion; 00150 int RestoreUpVector; 00151 double DiagonalLength; 00152 double MotionStepSize; 00153 double MotionUserScale; 00154 double MotionAccelerationFactor; 00155 double AngleStepSize; 00156 double AngleAccelerationFactor; 00157 double DefaultUpVector[3]; 00158 double AzimuthStepSize; 00159 double IdealFocalPoint[3]; 00160 vtkPerspectiveTransform *Transform; 00161 double DeltaYaw; 00162 double lYaw; 00163 double DeltaPitch; 00164 double lPitch; 00166 //BTX 00167 CPIDControl *PID_Yaw; 00168 CPIDControl *PID_Pitch; 00169 //ETX 00170 private: 00171 vtkInteractorStyleFlight(const vtkInteractorStyleFlight&); // Not implemented. 00172 void operator=(const vtkInteractorStyleFlight&); // Not implemented. 00173 }; 00174 00175 #endif