VTK  9.3.20240318
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:
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:
143 
145 
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);
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
a virtual camera for 3D rendering
Definition: vtkCamera.h:150
a simple class to control print indentation
Definition: vtkIndent.h:108
provides flight motion routines
void OnLeftButtonDown() override
Concrete implementation of Mouse event bindings for flight.
unsigned char KeysDown
Routines used internally for computing motion and steering.
double AzimuthStepSize
Routines used internally for computing motion and steering.
double MotionStepSize
Routines used internally for computing motion and steering.
void OnRightButtonDown() override
Concrete implementation of Mouse event bindings for flight.
void OnRightButtonUp() override
Concrete implementation of Mouse event bindings for flight.
void OnMiddleButtonDown() override
Concrete implementation of Mouse event bindings for flight.
~vtkInteractorStyleFlight() override
void MotionAlongVector(double vector[3], double amount, vtkCamera *cam)
Routines used internally for computing motion and steering.
void GetLRVector(double vector[3], vtkCamera *cam)
Routines used internally for computing motion and steering.
void UpdateSteering(vtkCamera *cam)
Routines used internally for computing motion and steering.
double DeltaYaw
Routines used internally for computing motion and steering.
double DeltaPitch
Routines used internally for computing motion and steering.
void SetupMotionVars(vtkCamera *cam)
Routines used internally for computing motion and steering.
double DiagonalLength
Routines used internally for computing motion and steering.
virtual void ReverseFly()
Concrete implementation of Keyboard event bindings for flight.
double MotionUserScale
Routines used internally for computing motion and steering.
double AngleAccelerationFactor
Routines used internally for computing motion and steering.
void OnMouseMove() override
Concrete implementation of Mouse event bindings for flight.
vtkPerspectiveTransform * Transform
Routines used internally for computing motion and steering.
static vtkInteractorStyleFlight * New()
void FlyByMouse(vtkCamera *cam)
Routines used internally for computing motion and steering.
double MotionAccelerationFactor
Routines used internally for computing motion and steering.
void FinishCamera(vtkCamera *cam)
Routines used internally for computing motion and steering.
double lYaw
Routines used internally for computing motion and steering.
void OnKeyUp() override
Concrete implementation of Keyboard event bindings for flight.
void OnMiddleButtonUp() override
Concrete implementation of Mouse event bindings for flight.
virtual void StartForwardFly()
Concrete implementation of Keyboard event bindings for flight.
void OnLeftButtonUp() override
Concrete implementation of Mouse event bindings for flight.
virtual void StartReverseFly()
Concrete implementation of Keyboard event bindings for flight.
void JumpTo(double campos[3], double focpos[3])
Move the Eye/Camera to a specific location (no intermediate steps are taken.
virtual void EndReverseFly()
Concrete implementation of Keyboard event bindings for flight.
virtual void ForwardFly()
Concrete implementation of Keyboard event bindings for flight.
void OnChar() override
Concrete implementation of Keyboard event bindings for flight.
double lPitch
Routines used internally for computing motion and steering.
vtkTypeBool DisableMotion
Routines used internally for computing motion and steering.
vtkTypeBool RestoreUpVector
Routines used internally for computing motion and steering.
void OnKeyDown() override
Concrete implementation of Keyboard event bindings for flight.
void OnTimer() override
Concrete implementation of Keyboard event bindings for flight.
void UpdateMouseSteering(vtkCamera *cam)
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 AngleStepSize
Routines used internally for computing motion and steering.
virtual void EndForwardFly()
Concrete implementation of Keyboard event bindings for flight.
void FlyByKey(vtkCamera *cam)
Routines used internally for computing motion and steering.
provide event-driven interface to the rendering window (defines trackball mode)
describes a 4x4 matrix transformation
@ vector
Definition: vtkX3D.h:237
int vtkTypeBool
Definition: vtkABI.h:64