VTK  9.4.20250102
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
33VTK_ABI_NAMESPACE_BEGIN
34class vtkCamera;
36
37class CPIDControl;
38
39class VTKINTERACTIONSTYLE_EXPORT VTK_MARSHALAUTO vtkInteractorStyleFlight
40 : public vtkInteractorStyle
41{
42public:
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
51 void JumpTo(double campos[3], double focpos[3]);
52
54
57 vtkSetMacro(MotionStepSize, double);
58 vtkGetMacro(MotionStepSize, double);
60
62
65 vtkSetMacro(MotionAccelerationFactor, double);
66 vtkGetMacro(MotionAccelerationFactor, double);
68
70
73 vtkSetMacro(AngleStepSize, double);
74 vtkGetMacro(AngleStepSize, double);
76
78
81 vtkSetMacro(AngleAccelerationFactor, double);
82 vtkGetMacro(AngleAccelerationFactor, double);
84
86
89 vtkSetMacro(DisableMotion, vtkTypeBool);
90 vtkGetMacro(DisableMotion, vtkTypeBool);
91 vtkBooleanMacro(DisableMotion, vtkTypeBool);
93
95
102 vtkSetMacro(RestoreUpVector, vtkTypeBool);
103 vtkGetMacro(RestoreUpVector, vtkTypeBool);
104 vtkBooleanMacro(RestoreUpVector, vtkTypeBool);
106
107 // Specify "up" (by default {0,0,1} but can be changed)
108 vtkGetVectorMacro(DefaultUpVector, double, 3);
109 vtkSetVectorMacro(DefaultUpVector, double, 3);
110
112
115 void OnMouseMove() override;
116 void OnLeftButtonDown() override;
117 void OnLeftButtonUp() override;
118 void OnMiddleButtonDown() override;
119 void OnMiddleButtonUp() override;
120 void OnRightButtonDown() override;
121 void OnRightButtonUp() override;
123
125
128 void OnChar() override;
129 void OnKeyDown() override;
130 void OnKeyUp() override;
131 void OnTimer() override;
132 //
133 virtual void ForwardFly();
134 virtual void ReverseFly();
135 //
136 virtual void StartForwardFly();
137 virtual void EndForwardFly();
138 virtual void StartReverseFly();
139 virtual void EndReverseFly();
141
142protected:
145
147
153 void FlyByKey(vtkCamera* cam);
154 void GetLRVector(double vector[3], vtkCamera* cam);
155 void MotionAlongVector(double vector[3], double amount, vtkCamera* cam);
158 //
159 //
160 unsigned char KeysDown;
169 double DefaultUpVector[3];
171 double IdealFocalPoint[3];
173 double DeltaYaw;
174 double lYaw;
176 double lPitch;
178
179 CPIDControl* PID_Yaw;
180 CPIDControl* PID_Pitch;
181
182private:
184 void operator=(const vtkInteractorStyleFlight&) = delete;
185};
186
187VTK_ABI_NAMESPACE_END
188#endif
a virtual camera for 3D rendering
Definition vtkCamera.h:151
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.
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.
static vtkInteractorStyleFlight * New()
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
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_MARSHALAUTO