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

Rendering/vtkInteractorStyleFlight.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkInteractorStyleFlight.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00016 
00045 #ifndef __vtkInteractorStyleFlight_h
00046 #define __vtkInteractorStyleFlight_h
00047 
00048 #include "vtkInteractorStyle.h"
00049 class vtkCamera;
00050 class vtkPerspectiveTransform;
00051 //BTX
00052 class CPIDControl;
00053 //ETX
00054 
00055 class VTK_RENDERING_EXPORT vtkInteractorStyleFlight : public vtkInteractorStyle
00056 {
00057 public:
00058   static vtkInteractorStyleFlight *New();
00059   vtkTypeRevisionMacro(vtkInteractorStyleFlight,vtkInteractorStyle);
00060   void PrintSelf(ostream& os, vtkIndent indent);
00061 
00064   void JumpTo(double campos[3], double focpos[3]);
00065 
00067 
00068   vtkSetMacro(MotionStepSize,double);
00069   vtkGetMacro(MotionStepSize,double);
00071 
00073 
00074   vtkSetMacro(MotionAccelerationFactor,double);
00075   vtkGetMacro(MotionAccelerationFactor,double);
00077 
00079 
00080   vtkSetMacro(AngleStepSize,double);
00081   vtkGetMacro(AngleStepSize,double);
00083 
00085 
00086   vtkSetMacro(AngleAccelerationFactor,double);
00087   vtkGetMacro(AngleAccelerationFactor,double);
00089 
00091 
00092   vtkSetMacro(DisableMotion,int);
00093   vtkGetMacro(DisableMotion,int);
00094   vtkBooleanMacro(DisableMotion,int);
00096 
00098 
00103   vtkSetMacro(RestoreUpVector,int);
00104   vtkGetMacro(RestoreUpVector,int);
00105   vtkBooleanMacro(RestoreUpVector,int);
00107 
00108   // Specify "up" (by default {0,0,1} but can be changed)
00109   vtkGetVectorMacro(DefaultUpVector,double,3);
00110   vtkSetVectorMacro(DefaultUpVector,double,3);
00111 
00113 
00114   virtual void OnMouseMove();
00115   virtual void OnLeftButtonDown();
00116   virtual void OnLeftButtonUp();
00117   virtual void OnMiddleButtonDown();
00118   virtual void OnMiddleButtonUp();
00119   virtual void OnRightButtonDown();
00120   virtual void OnRightButtonUp();
00122 
00124 
00125   virtual void OnChar();
00126   virtual void OnKeyDown();
00127   virtual void OnKeyUp();
00128   virtual void OnTimer();
00129   //
00130   virtual void ForwardFly();
00131   virtual void ReverseFly();
00132   //
00133   virtual void StartForwardFly();
00134   virtual void EndForwardFly();
00135   virtual void StartReverseFly();
00136   virtual void EndReverseFly();
00138 
00139 protected:
00140    vtkInteractorStyleFlight();
00141   ~vtkInteractorStyleFlight();
00142 
00144 
00145   void UpdateSteering(vtkCamera *cam);
00146   void UpdateMouseSteering(vtkCamera *cam);
00147   void FlyByMouse(vtkCamera* cam);
00148   void FlyByKey(vtkCamera* cam);
00149   void GetLRVector(double vector[3], vtkCamera* cam);
00150   void MotionAlongVector(double vector[3], double amount, vtkCamera* cam);
00151   void SetupMotionVars(vtkCamera *cam);
00152   void FinishCamera(vtkCamera* cam);
00153   //
00154   //
00155   unsigned char KeysDown;
00156   int           DisableMotion;
00157   int           RestoreUpVector;
00158   double        DiagonalLength;
00159   double        MotionStepSize;
00160   double        MotionUserScale;
00161   double        MotionAccelerationFactor;
00162   double        AngleStepSize;
00163   double        AngleAccelerationFactor;
00164   double        DefaultUpVector[3];
00165   double        AzimuthStepSize;
00166   double        IdealFocalPoint[3];
00167   vtkPerspectiveTransform *Transform;
00168   double        DeltaYaw;
00169   double        lYaw;
00170   double        DeltaPitch;
00171   double        lPitch;
00173 //BTX
00174   CPIDControl  *PID_Yaw;
00175   CPIDControl  *PID_Pitch;
00176 //ETX
00177 private:
00178   vtkInteractorStyleFlight(const vtkInteractorStyleFlight&);  // Not implemented.
00179   void operator=(const vtkInteractorStyleFlight&);  // Not implemented.
00180 };
00181 
00182 #endif