VTK
vtkInteractorStyleFlight.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkInteractorStyleFlight.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
36 #ifndef vtkInteractorStyleFlight_h
37 #define vtkInteractorStyleFlight_h
38 
39 #include "vtkInteractionStyleModule.h" // For export macro
40 #include "vtkInteractorStyle.h"
41 class vtkCamera;
43 
44 class CPIDControl;
45 
46 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleFlight : public vtkInteractorStyle
47 {
48 public:
49  static vtkInteractorStyleFlight *New();
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
57  void JumpTo(double campos[3], double focpos[3]);
58 
60 
63  vtkSetMacro(MotionStepSize,double);
64  vtkGetMacro(MotionStepSize,double);
66 
68 
71  vtkSetMacro(MotionAccelerationFactor,double);
72  vtkGetMacro(MotionAccelerationFactor,double);
74 
76 
79  vtkSetMacro(AngleStepSize,double);
80  vtkGetMacro(AngleStepSize,double);
82 
84 
87  vtkSetMacro(AngleAccelerationFactor,double);
88  vtkGetMacro(AngleAccelerationFactor,double);
90 
92 
95  vtkSetMacro(DisableMotion,int);
96  vtkGetMacro(DisableMotion,int);
97  vtkBooleanMacro(DisableMotion,int);
99 
101 
108  vtkSetMacro(RestoreUpVector,int);
109  vtkGetMacro(RestoreUpVector,int);
110  vtkBooleanMacro(RestoreUpVector,int);
112 
113  // Specify "up" (by default {0,0,1} but can be changed)
114  vtkGetVectorMacro(DefaultUpVector,double,3);
115  vtkSetVectorMacro(DefaultUpVector,double,3);
116 
118 
121  virtual void OnMouseMove();
122  virtual void OnLeftButtonDown();
123  virtual void OnLeftButtonUp();
124  virtual void OnMiddleButtonDown();
125  virtual void OnMiddleButtonUp();
126  virtual void OnRightButtonDown();
127  virtual void OnRightButtonUp();
129 
131 
134  virtual void OnChar();
135  virtual void OnKeyDown();
136  virtual void OnKeyUp();
137  virtual void OnTimer();
138  //
139  virtual void ForwardFly();
140  virtual void ReverseFly();
141  //
142  virtual void StartForwardFly();
143  virtual void EndForwardFly();
144  virtual void StartReverseFly();
145  virtual void EndReverseFly();
147 
148 protected:
151 
153 
156  void UpdateSteering(vtkCamera *cam);
157  void UpdateMouseSteering(vtkCamera *cam);
158  void FlyByMouse(vtkCamera* cam);
159  void FlyByKey(vtkCamera* cam);
160  void GetLRVector(double vector[3], vtkCamera* cam);
161  void MotionAlongVector(double vector[3], double amount, vtkCamera* cam);
162  void SetupMotionVars(vtkCamera *cam);
163  void FinishCamera(vtkCamera* cam);
164  //
165  //
166  unsigned char KeysDown;
175  double DefaultUpVector[3];
177  double IdealFocalPoint[3];
179  double DeltaYaw;
180  double lYaw;
181  double DeltaPitch;
182  double lPitch;
184 
185  CPIDControl *PID_Yaw;
186  CPIDControl *PID_Pitch;
187 
188 private:
189  vtkInteractorStyleFlight(const vtkInteractorStyleFlight&) VTK_DELETE_FUNCTION;
190  void operator=(const vtkInteractorStyleFlight&) VTK_DELETE_FUNCTION;
191 };
192 
193 #endif
virtual void OnLeftButtonDown()
double AngleStepSize
Routines used internally for computing motion and steering.
double MotionAccelerationFactor
Routines used internally for computing motion and steering.
virtual void OnMiddleButtonDown()
virtual void OnRightButtonDown()
virtual void OnLeftButtonUp()
virtual void OnKeyUp()
static vtkInteractorStyle * New()
This class must be supplied with a vtkRenderWindowInteractor wrapper or parent.
provides flight motion routines
virtual void OnMiddleButtonUp()
double AngleAccelerationFactor
Routines used internally for computing motion and steering.
double DeltaPitch
Routines used internally for computing motion and steering.
int RestoreUpVector
Routines used internally for computing motion and steering.
unsigned char KeysDown
Routines used internally for computing motion and steering.
virtual void OnTimer()
OnTimer calls Rotate, Rotate etc which should be overridden by style subclasses.
virtual void OnRightButtonUp()
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void OnKeyDown()
a simple class to control print indentation
Definition: vtkIndent.h:39
a virtual camera for 3D rendering
Definition: vtkCamera.h:50
double DiagonalLength
Routines used internally for computing motion and steering.
double lYaw
Routines used internally for computing motion and steering.
double lPitch
Routines used internally for computing motion and steering.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
double MotionStepSize
Routines used internally for computing motion and steering.
virtual void OnChar()
OnChar is triggered when an ASCII key is pressed.
double AzimuthStepSize
Routines used internally for computing motion and steering.
provide event-driven interface to the rendering window (defines trackball mode)
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
double MotionUserScale
Routines used internally for computing motion and steering.
double DeltaYaw
Routines used internally for computing motion and steering.
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.
int DisableMotion
Routines used internally for computing motion and steering.
vtkPerspectiveTransform * Transform
Routines used internally for computing motion and steering.
describes a 4x4 matrix transformation