VTK  9.3.1
vtkInteractorStyleFlight.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
27 #ifndef vtkInteractorStyleFlight_h
28 #define vtkInteractorStyleFlight_h
29 
30 #include "vtkInteractionStyleModule.h" // For export macro
31 #include "vtkInteractorStyle.h"
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkCamera;
35 
36 class CPIDControl;
37 
38 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleFlight : public vtkInteractorStyle
39 {
40 public:
41  static vtkInteractorStyleFlight* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
49  void JumpTo(double campos[3], double focpos[3]);
50 
52 
55  vtkSetMacro(MotionStepSize, double);
56  vtkGetMacro(MotionStepSize, double);
58 
60 
63  vtkSetMacro(MotionAccelerationFactor, double);
64  vtkGetMacro(MotionAccelerationFactor, double);
66 
68 
71  vtkSetMacro(AngleStepSize, double);
72  vtkGetMacro(AngleStepSize, double);
74 
76 
79  vtkSetMacro(AngleAccelerationFactor, double);
80  vtkGetMacro(AngleAccelerationFactor, double);
82 
84 
87  vtkSetMacro(DisableMotion, vtkTypeBool);
88  vtkGetMacro(DisableMotion, vtkTypeBool);
89  vtkBooleanMacro(DisableMotion, vtkTypeBool);
91 
93 
100  vtkSetMacro(RestoreUpVector, vtkTypeBool);
101  vtkGetMacro(RestoreUpVector, vtkTypeBool);
102  vtkBooleanMacro(RestoreUpVector, vtkTypeBool);
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 
113  void OnMouseMove() override;
114  void OnLeftButtonDown() override;
115  void OnLeftButtonUp() override;
116  void OnMiddleButtonDown() override;
117  void OnMiddleButtonUp() override;
118  void OnRightButtonDown() override;
119  void OnRightButtonUp() override;
121 
123 
126  void OnChar() override;
127  void OnKeyDown() override;
128  void OnKeyUp() override;
129  void OnTimer() override;
130  //
131  virtual void ForwardFly();
132  virtual void ReverseFly();
133  //
134  virtual void StartForwardFly();
135  virtual void EndForwardFly();
136  virtual void StartReverseFly();
137  virtual void EndReverseFly();
139 
140 protected:
142  ~vtkInteractorStyleFlight() override;
143 
145 
148  void UpdateSteering(vtkCamera* cam);
149  void UpdateMouseSteering(vtkCamera* cam);
150  void FlyByMouse(vtkCamera* cam);
151  void FlyByKey(vtkCamera* cam);
152  void GetLRVector(double vector[3], vtkCamera* cam);
153  void MotionAlongVector(double vector[3], double amount, vtkCamera* cam);
154  void SetupMotionVars(vtkCamera* cam);
155  void FinishCamera(vtkCamera* cam);
156  //
157  //
158  unsigned char KeysDown;
167  double DefaultUpVector[3];
169  double IdealFocalPoint[3];
171  double DeltaYaw;
172  double lYaw;
173  double DeltaPitch;
174  double lPitch;
176 
177  CPIDControl* PID_Yaw;
178  CPIDControl* PID_Pitch;
179 
180 private:
182  void operator=(const vtkInteractorStyleFlight&) = delete;
183 };
184 
185 VTK_ABI_NAMESPACE_END
186 #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()
void OnChar() override
OnChar is triggered when an ASCII key is pressed.
virtual void OnLeftButtonUp()
virtual void OnKeyUp()
vtkTypeBool RestoreUpVector
Routines used internally for computing motion and steering.
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.
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.
int vtkTypeBool
Definition: vtkABI.h:64
virtual void OnRightButtonUp()
virtual void OnKeyDown()
a simple class to control print indentation
Definition: vtkIndent.h:28
a virtual camera for 3D rendering
Definition: vtkCamera.h:40
double DiagonalLength
Routines used internally for computing motion and steering.
double lYaw
Routines used internally for computing motion and steering.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double lPitch
Routines used internally for computing motion and steering.
double MotionStepSize
Routines used internally for computing motion and steering.
double AzimuthStepSize
Routines used internally for computing motion and steering.
provide event-driven interface to the rendering window (defines trackball mode)
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.
vtkPerspectiveTransform * Transform
Routines used internally for computing motion and steering.
describes a 4x4 matrix transformation
vtkTypeBool DisableMotion
Routines used internally for computing motion and steering.