VTK: Interaction/Style/vtkInteractorStyleFlight.h Source File

| 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;
34 class vtkPerspectiveTransform;
35
36 class CPIDControl;
37
38 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleFlight : public vtkInteractorStyle
39 {
40 public:
41 static vtkInteractorStyleFlight* New();
42 vtkTypeMacro(vtkInteractorStyleFlight, vtkInteractorStyle);
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:
141 vtkInteractorStyleFlight();
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;
159 vtkTypeBool DisableMotion;
160 vtkTypeBool RestoreUpVector;
161 double DiagonalLength;
162 double MotionStepSize;
163 double MotionUserScale;
164 double MotionAccelerationFactor;
165 double AngleStepSize;
166 double AngleAccelerationFactor;
167 double DefaultUpVector[3];
168 double AzimuthStepSize;
169 double IdealFocalPoint[3];
170 vtkPerspectiveTransform* Transform;
171 double DeltaYaw;
172 double lYaw;
173 double DeltaPitch;
174 double lPitch;
176
177 CPIDControl* PID_Yaw;
178 CPIDControl* PID_Pitch;
179
180 private:
181 vtkInteractorStyleFlight(const vtkInteractorStyleFlight&) = delete;
182 void operator=(const vtkInteractorStyleFlight&) = delete;
183 };
184
185 VTK_ABI_NAMESPACE_END
186 #endif
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:50
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInteractorStyleFlight
provides flight motion routines
Definition: vtkInteractorStyleFlight.h:39
vtkInteractorStyleFlight::OnLeftButtonDown
void OnLeftButtonDown() override
Concrete implementation of Mouse event bindings for flight.
vtkInteractorStyleFlight::KeysDown
unsigned char KeysDown
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:158
vtkInteractorStyleFlight::AzimuthStepSize
double AzimuthStepSize
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:168
vtkInteractorStyleFlight::MotionStepSize
double MotionStepSize
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:162
vtkInteractorStyleFlight::OnRightButtonDown
void OnRightButtonDown() override
Concrete implementation of Mouse event bindings for flight.
vtkInteractorStyleFlight::OnRightButtonUp
void OnRightButtonUp() override
Concrete implementation of Mouse event bindings for flight.
vtkInteractorStyleFlight::OnMiddleButtonDown
void OnMiddleButtonDown() override
Concrete implementation of Mouse event bindings for flight.
vtkInteractorStyleFlight::~vtkInteractorStyleFlight
~vtkInteractorStyleFlight() override
vtkInteractorStyleFlight::MotionAlongVector
void MotionAlongVector(double vector[3], double amount, vtkCamera *cam)
Routines used internally for computing motion and steering.
vtkInteractorStyleFlight::GetLRVector
void GetLRVector(double vector[3], vtkCamera *cam)
Routines used internally for computing motion and steering.
vtkInteractorStyleFlight::UpdateSteering
void UpdateSteering(vtkCamera *cam)
Routines used internally for computing motion and steering.
vtkInteractorStyleFlight::DeltaYaw
double DeltaYaw
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:171
vtkInteractorStyleFlight::DeltaPitch
double DeltaPitch
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:173
vtkInteractorStyleFlight::SetupMotionVars
void SetupMotionVars(vtkCamera *cam)
Routines used internally for computing motion and steering.
vtkInteractorStyleFlight::DiagonalLength
double DiagonalLength
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:161
vtkInteractorStyleFlight::ReverseFly
virtual void ReverseFly()
Concrete implementation of Keyboard event bindings for flight.
vtkInteractorStyleFlight::MotionUserScale
double MotionUserScale
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:163
vtkInteractorStyleFlight::AngleAccelerationFactor
double AngleAccelerationFactor
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:166
vtkInteractorStyleFlight::OnMouseMove
void OnMouseMove() override
Concrete implementation of Mouse event bindings for flight.
vtkInteractorStyleFlight::vtkInteractorStyleFlight
vtkInteractorStyleFlight()
vtkInteractorStyleFlight::Transform
vtkPerspectiveTransform * Transform
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:170
vtkInteractorStyleFlight::New
static vtkInteractorStyleFlight * New()
vtkInteractorStyleFlight::FlyByMouse
void FlyByMouse(vtkCamera *cam)
Routines used internally for computing motion and steering.
vtkInteractorStyleFlight::MotionAccelerationFactor
double MotionAccelerationFactor
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:164
vtkInteractorStyleFlight::FinishCamera
void FinishCamera(vtkCamera *cam)
Routines used internally for computing motion and steering.
vtkInteractorStyleFlight::lYaw
double lYaw
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:172
vtkInteractorStyleFlight::OnKeyUp
void OnKeyUp() override
Concrete implementation of Keyboard event bindings for flight.
vtkInteractorStyleFlight::OnMiddleButtonUp
void OnMiddleButtonUp() override
Concrete implementation of Mouse event bindings for flight.
vtkInteractorStyleFlight::StartForwardFly
virtual void StartForwardFly()
Concrete implementation of Keyboard event bindings for flight.
vtkInteractorStyleFlight::OnLeftButtonUp
void OnLeftButtonUp() override
Concrete implementation of Mouse event bindings for flight.
vtkInteractorStyleFlight::StartReverseFly
virtual void StartReverseFly()
Concrete implementation of Keyboard event bindings for flight.
vtkInteractorStyleFlight::JumpTo
void JumpTo(double campos[3], double focpos[3])
Move the Eye/Camera to a specific location (no intermediate steps are taken.
vtkInteractorStyleFlight::EndReverseFly
virtual void EndReverseFly()
Concrete implementation of Keyboard event bindings for flight.
vtkInteractorStyleFlight::ForwardFly
virtual void ForwardFly()
Concrete implementation of Keyboard event bindings for flight.
vtkInteractorStyleFlight::OnChar
void OnChar() override
Concrete implementation of Keyboard event bindings for flight.
vtkInteractorStyleFlight::lPitch
double lPitch
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:174
vtkInteractorStyleFlight::DisableMotion
vtkTypeBool DisableMotion
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:159
vtkInteractorStyleFlight::RestoreUpVector
vtkTypeBool RestoreUpVector
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:160
vtkInteractorStyleFlight::OnKeyDown
void OnKeyDown() override
Concrete implementation of Keyboard event bindings for flight.
vtkInteractorStyleFlight::OnTimer
void OnTimer() override
Concrete implementation of Keyboard event bindings for flight.
vtkInteractorStyleFlight::UpdateMouseSteering
void UpdateMouseSteering(vtkCamera *cam)
Routines used internally for computing motion and steering.
vtkInteractorStyleFlight::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkInteractorStyleFlight::PID_Yaw
CPIDControl * PID_Yaw
Definition: vtkInteractorStyleFlight.h:177
vtkInteractorStyleFlight::AngleStepSize
double AngleStepSize
Routines used internally for computing motion and steering.
Definition: vtkInteractorStyleFlight.h:165
vtkInteractorStyleFlight::EndForwardFly
virtual void EndForwardFly()
Concrete implementation of Keyboard event bindings for flight.
vtkInteractorStyleFlight::PID_Pitch
CPIDControl * PID_Pitch
Definition: vtkInteractorStyleFlight.h:178
vtkInteractorStyleFlight::FlyByKey
void FlyByKey(vtkCamera *cam)
Routines used internally for computing motion and steering.
vtkInteractorStyle
provide event-driven interface to the rendering window (defines trackball mode)
Definition: vtkInteractorStyle.h:148
vtkPerspectiveTransform
describes a 4x4 matrix transformation
Definition: vtkPerspectiveTransform.h:55
vtkX3D::vector
@ vector
Definition: vtkX3D.h:237
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkInteractorStyle.h