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 
41 #ifndef vtkInteractorStyleFlight_h
42 #define vtkInteractorStyleFlight_h
43 
44 #include "vtkInteractionStyleModule.h" // For export macro
45 #include "vtkInteractorStyle.h"
46 class vtkCamera;
48 //BTX
49 class CPIDControl;
50 //ETX
51 
53 {
54 public:
55  static vtkInteractorStyleFlight *New();
57  void PrintSelf(ostream& os, vtkIndent indent);
58 
61  void JumpTo(double campos[3], double focpos[3]);
62 
64 
65  vtkSetMacro(MotionStepSize,double);
66  vtkGetMacro(MotionStepSize,double);
68 
70 
71  vtkSetMacro(MotionAccelerationFactor,double);
72  vtkGetMacro(MotionAccelerationFactor,double);
74 
76 
77  vtkSetMacro(AngleStepSize,double);
78  vtkGetMacro(AngleStepSize,double);
80 
82 
83  vtkSetMacro(AngleAccelerationFactor,double);
84  vtkGetMacro(AngleAccelerationFactor,double);
86 
88 
89  vtkSetMacro(DisableMotion,int);
90  vtkGetMacro(DisableMotion,int);
91  vtkBooleanMacro(DisableMotion,int);
93 
95 
100  vtkSetMacro(RestoreUpVector,int);
101  vtkGetMacro(RestoreUpVector,int);
102  vtkBooleanMacro(RestoreUpVector,int);
104 
105  // Specify "up" (by default {0,0,1} but can be changed)
106  vtkGetVectorMacro(DefaultUpVector,double,3);
107  vtkSetVectorMacro(DefaultUpVector,double,3);
108 
110 
111  virtual void OnMouseMove();
112  virtual void OnLeftButtonDown();
113  virtual void OnLeftButtonUp();
114  virtual void OnMiddleButtonDown();
115  virtual void OnMiddleButtonUp();
116  virtual void OnRightButtonDown();
117  virtual void OnRightButtonUp();
119 
121 
122  virtual void OnChar();
123  virtual void OnKeyDown();
124  virtual void OnKeyUp();
125  virtual void OnTimer();
126  //
127  virtual void ForwardFly();
128  virtual void ReverseFly();
129  //
130  virtual void StartForwardFly();
131  virtual void EndForwardFly();
132  virtual void StartReverseFly();
133  virtual void EndReverseFly();
135 
136 protected:
139 
141 
142  void UpdateSteering(vtkCamera *cam);
143  void UpdateMouseSteering(vtkCamera *cam);
144  void FlyByMouse(vtkCamera* cam);
145  void FlyByKey(vtkCamera* cam);
146  void GetLRVector(double vector[3], vtkCamera* cam);
147  void MotionAlongVector(double vector[3], double amount, vtkCamera* cam);
148  void SetupMotionVars(vtkCamera *cam);
149  void FinishCamera(vtkCamera* cam);
150  //
151  //
152  unsigned char KeysDown;
161  double DefaultUpVector[3];
163  double IdealFocalPoint[3];
165  double DeltaYaw;
166  double lYaw;
167  double DeltaPitch;
168  double lPitch;
169 //BTX
170  CPIDControl *PID_Yaw;
171  CPIDControl *PID_Pitch;
172 //ETX
173 private:
174  vtkInteractorStyleFlight(const vtkInteractorStyleFlight&); // Not implemented.
175  void operator=(const vtkInteractorStyleFlight&); // Not implemented.
176 };
178 
179 #endif
virtual void OnLeftButtonDown()
virtual void OnMiddleButtonDown()
virtual void OnRightButtonDown()
virtual void OnLeftButtonUp()
virtual void OnKeyUp()
static vtkInteractorStyle * New()
provides flight motion routines
#define VTKINTERACTIONSTYLE_EXPORT
virtual void OnMiddleButtonUp()
virtual void OnTimer()
virtual void OnRightButtonUp()
void PrintSelf(ostream &os, vtkIndent indent)
virtual void OnKeyDown()
a simple class to control print indentation
Definition: vtkIndent.h:38
a virtual camera for 3D rendering
Definition: vtkCamera.h:48
virtual void OnChar()
provide event-driven interface to the rendering window (defines trackball mode)
virtual void OnMouseMove()
vtkPerspectiveTransform * Transform
describes a 4x4 matrix transformation