00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00070 #ifndef __vtkInteractorStyleFlight_h
00071 #define __vtkInteractorStyleFlight_h
00072 
00073 #include "vtkInteractorStyle.h"
00074 
00075 class VTK_EXPORT vtkInteractorStyleFlight : public vtkInteractorStyle
00076 {
00077 public:
00078   static vtkInteractorStyleFlight *New();
00079   vtkTypeMacro(vtkInteractorStyleFlight,vtkInteractorStyle);
00080   void PrintSelf(ostream& os, vtkIndent indent);
00081 
00083   virtual   void OnRightButtonDown (int ctrl, int shift, int X, int Y);
00084   virtual   void OnRightButtonUp   (int ctrl, int shift, int X, int Y);
00085   virtual   void OnMiddleButtonDown(int ctrl, int shift, int X, int Y);
00086   virtual   void OnMiddleButtonUp  (int ctrl, int shift, int X, int Y);
00087   virtual   void OnLeftButtonDown  (int ctrl, int shift, int X, int Y);
00088   virtual   void OnLeftButtonUp    (int ctrl, int shift, int X, int Y);
00089   virtual   void OnMouseMove       (int ctrl, int shift, int X, int Y);
00090 
00092   virtual void OnChar   (int ctrl, int shift, char keycode, int repeatcount);
00093   virtual void OnKeyDown(int ctrl, int shift, char keycode, int repeatcount);
00094   virtual void OnKeyUp  (int ctrl, int shift, char keycode, int repeatcount);
00095 
00098   virtual void OnTimer(void);
00099 
00102   void JumpTo(double campos[3], double focpos[3]);
00103 
00108   void PerformAzimuthalScan(int numsteps);
00109 
00111   vtkSetMacro(MotionStepSize,double);
00112   vtkGetMacro(MotionStepSize,double);
00113 
00115   vtkSetMacro(MotionAccelerationFactor,double);
00116   vtkGetMacro(MotionAccelerationFactor,double);
00117 
00119   vtkSetMacro(AngleStepSize,double);
00120   vtkGetMacro(AngleStepSize,double);
00121 
00123   vtkSetMacro(AngleAccelerationFactor,double);
00124   vtkGetMacro(AngleAccelerationFactor,double);
00125 
00127   vtkSetMacro(DisableMotion,int);
00128   vtkGetMacro(DisableMotion,int);
00129   vtkBooleanMacro(DisableMotion,int);
00130 
00132   vtkSetMacro(FixUpVector,int);
00133   vtkGetMacro(FixUpVector,int);
00134   vtkBooleanMacro(FixUpVector,int);
00135 
00136   
00137   vtkGetVectorMacro(FixedUpVector,double,3);
00138   vtkSetVectorMacro(FixedUpVector,double,3);
00139 
00140 protected:
00141   vtkInteractorStyleFlight();
00142   ~vtkInteractorStyleFlight();
00143   vtkInteractorStyleFlight(const vtkInteractorStyleFlight&) {};
00144   void operator=(const vtkInteractorStyleFlight&) {};
00145   
00147   void DoTimerStart(void);
00148   void DoTimerStop(void);
00149   void UpdateMouseSteering(int x, int y);
00150   void FlyByMouse(void);
00151   void FlyByKey(void);
00152   void ComputeLRVector(double vector[3]);
00153   void MotionAlongVector(double vector[3], double amount);
00154   void SetupMotionVars(void);
00155   void AzimuthScan(void);
00156   
00157   
00158   unsigned char KeysDown;
00159   int           Flying;
00160   int           Reversing;
00161   int           TimerRunning;
00162   int           AzimuthScanning;
00163   int           DisableMotion;
00164   int           FixUpVector;
00165   double        OldX;
00166   double        OldY;
00167   double        X2;
00168   double        Y2;
00169   double        DiagonalLength;
00170   double        MotionStepSize;
00171   double        MotionUserScale;
00172   double        MotionAccelerationFactor;
00173   double        AngleStepSize;
00174   double        AngleAccelerationFactor;
00175   double        YawAngle;
00176   double        PitchAngle;
00177   double        FixedUpVector[3];
00178   double        AzimuthStepSize;
00179 };
00180 
00181 #endif