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 
39 #ifndef vtkInteractorStyleFlight_h
40 #define vtkInteractorStyleFlight_h
41 
42 #include "vtkInteractionStyleModule.h" // For export macro
43 #include "vtkInteractorStyle.h"
44 class vtkCamera;
46 
47 class CPIDControl;
48 
49 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleFlight : public vtkInteractorStyle
50 {
51 public:
52  static vtkInteractorStyleFlight *New();
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
60  void JumpTo(double campos[3], double focpos[3]);
61 
63 
66  vtkSetMacro(MotionStepSize,double);
67  vtkGetMacro(MotionStepSize,double);
69 
71 
74  vtkSetMacro(MotionAccelerationFactor,double);
75  vtkGetMacro(MotionAccelerationFactor,double);
77 
79 
82  vtkSetMacro(AngleStepSize,double);
83  vtkGetMacro(AngleStepSize,double);
85 
87 
90  vtkSetMacro(AngleAccelerationFactor,double);
91  vtkGetMacro(AngleAccelerationFactor,double);
93 
95 
98  vtkSetMacro(DisableMotion,int);
99  vtkGetMacro(DisableMotion,int);
100  vtkBooleanMacro(DisableMotion,int);
102 
104 
111  vtkSetMacro(RestoreUpVector,int);
112  vtkGetMacro(RestoreUpVector,int);
113  vtkBooleanMacro(RestoreUpVector,int);
115 
116  // Specify "up" (by default {0,0,1} but can be changed)
117  vtkGetVectorMacro(DefaultUpVector,double,3);
118  vtkSetVectorMacro(DefaultUpVector,double,3);
119 
121 
124  virtual void OnMouseMove();
125  virtual void OnLeftButtonDown();
126  virtual void OnLeftButtonUp();
127  virtual void OnMiddleButtonDown();
128  virtual void OnMiddleButtonUp();
129  virtual void OnRightButtonDown();
130  virtual void OnRightButtonUp();
132 
134 
137  virtual void OnChar();
138  virtual void OnKeyDown();
139  virtual void OnKeyUp();
140  virtual void OnTimer();
141  //
142  virtual void ForwardFly();
143  virtual void ReverseFly();
144  //
145  virtual void StartForwardFly();
146  virtual void EndForwardFly();
147  virtual void StartReverseFly();
148  virtual void EndReverseFly();
150 
151 protected:
154 
156 
159  void UpdateSteering(vtkCamera *cam);
160  void UpdateMouseSteering(vtkCamera *cam);
161  void FlyByMouse(vtkCamera* cam);
162  void FlyByKey(vtkCamera* cam);
163  void GetLRVector(double vector[3], vtkCamera* cam);
164  void MotionAlongVector(double vector[3], double amount, vtkCamera* cam);
165  void SetupMotionVars(vtkCamera *cam);
166  void FinishCamera(vtkCamera* cam);
167  //
168  //
169  unsigned char KeysDown;
178  double DefaultUpVector[3];
180  double IdealFocalPoint[3];
182  double DeltaYaw;
183  double lYaw;
184  double DeltaPitch;
185  double lPitch;
187 
188  CPIDControl *PID_Yaw;
189  CPIDControl *PID_Pitch;
190 
191 private:
192  vtkInteractorStyleFlight(const vtkInteractorStyleFlight&) VTK_DELETE_FUNCTION;
193  void operator=(const vtkInteractorStyleFlight&) VTK_DELETE_FUNCTION;
194 };
195 
196 #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