Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkInteractorStyleFlight.h

Go to the documentation of this file.
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 
00053 #ifndef __vtkInteractorStyleFlight_h
00054 #define __vtkInteractorStyleFlight_h
00055 
00056 #include "vtkInteractorStyle.h"
00057 class vtkCamera;
00058 class vtkPerspectiveTransform;
00059 //BTX
00060 class CPIDControl;
00061 //ETX
00062 
00063 class VTK_RENDERING_EXPORT vtkInteractorStyleFlight : public vtkInteractorStyle
00064 {
00065 public:
00066   static vtkInteractorStyleFlight *New();
00067   vtkTypeRevisionMacro(vtkInteractorStyleFlight,vtkInteractorStyle);
00068   void PrintSelf(ostream& os, vtkIndent indent);
00069 
00072   void JumpTo(double campos[3], double focpos[3]);
00073 
00075 
00076   vtkSetMacro(MotionStepSize,double);
00077   vtkGetMacro(MotionStepSize,double);
00079 
00081 
00082   vtkSetMacro(MotionAccelerationFactor,double);
00083   vtkGetMacro(MotionAccelerationFactor,double);
00085 
00087 
00088   vtkSetMacro(AngleStepSize,double);
00089   vtkGetMacro(AngleStepSize,double);
00091 
00093 
00094   vtkSetMacro(AngleAccelerationFactor,double);
00095   vtkGetMacro(AngleAccelerationFactor,double);
00097 
00099 
00100   vtkSetMacro(DisableMotion,int);
00101   vtkGetMacro(DisableMotion,int);
00102   vtkBooleanMacro(DisableMotion,int);
00104 
00106 
00111   vtkSetMacro(RestoreUpVector,int);
00112   vtkGetMacro(RestoreUpVector,int);
00113   vtkBooleanMacro(RestoreUpVector,int);
00115 
00116   // Specify "up" (by default {0,0,1} but can be changed)
00117   vtkGetVectorMacro(DefaultUpVector,double,3);
00118   vtkSetVectorMacro(DefaultUpVector,double,3);
00119 
00121 
00122   virtual void OnMouseMove();
00123   virtual void OnLeftButtonDown();
00124   virtual void OnLeftButtonUp();
00125   virtual void OnMiddleButtonDown();
00126   virtual void OnMiddleButtonUp();
00127   virtual void OnRightButtonDown();
00128   virtual void OnRightButtonUp();
00130 
00132 
00133   virtual void OnChar();
00134   virtual void OnKeyDown();
00135   virtual void OnKeyUp();
00136   virtual void OnTimer();
00137   //
00138   virtual void ForwardFly();
00139   virtual void ReverseFly();
00140   //
00141   virtual void StartForwardFly();
00142   virtual void EndForwardFly();
00143   virtual void StartReverseFly();
00144   virtual void EndReverseFly();
00146 
00147 protected:
00148    vtkInteractorStyleFlight();
00149   ~vtkInteractorStyleFlight();
00150 
00152 
00153   void UpdateSteering(vtkCamera *cam);
00154   void UpdateMouseSteering(vtkCamera *cam);
00155   void FlyByMouse(vtkCamera* cam);
00156   void FlyByKey(vtkCamera* cam);
00157   void GetLRVector(double vector[3], vtkCamera* cam);
00158   void MotionAlongVector(double vector[3], double amount, vtkCamera* cam);
00159   void SetupMotionVars(vtkCamera *cam);
00160   void FinishCamera(vtkCamera* cam);
00161   //
00162   //
00163   unsigned char KeysDown;
00164   int           DisableMotion;
00165   int           RestoreUpVector;
00166   double        DiagonalLength;
00167   double        MotionStepSize;
00168   double        MotionUserScale;
00169   double        MotionAccelerationFactor;
00170   double        AngleStepSize;
00171   double        AngleAccelerationFactor;
00172   double        DefaultUpVector[3];
00173   double        AzimuthStepSize;
00174   double        IdealFocalPoint[3];
00175   vtkPerspectiveTransform *Transform;
00176   double        DeltaYaw;
00177   double        lYaw;
00178   double        DeltaPitch;
00179   double        lPitch;
00181 //BTX
00182   CPIDControl  *PID_Yaw;
00183   CPIDControl  *PID_Pitch;
00184 //ETX
00185 private:
00186   vtkInteractorStyleFlight(const vtkInteractorStyleFlight&);  // Not implemented.
00187   void operator=(const vtkInteractorStyleFlight&);  // Not implemented.
00188 };
00189 
00190 #endif