VTK  9.3.0
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
24#ifndef vtkInteractorStyleFlight_h
25#define vtkInteractorStyleFlight_h
26
27#include "vtkInteractionStyleModule.h" // For export macro
28#include "vtkInteractorStyle.h"
29VTK_ABI_NAMESPACE_BEGIN
30class vtkCamera;
32
33class CPIDControl;
34
35class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleFlight : public vtkInteractorStyle
36{
37public:
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
46 void JumpTo(double campos[3], double focpos[3]);
47
49
52 vtkSetMacro(MotionStepSize, double);
53 vtkGetMacro(MotionStepSize, double);
55
57
60 vtkSetMacro(MotionAccelerationFactor, double);
61 vtkGetMacro(MotionAccelerationFactor, double);
63
65
68 vtkSetMacro(AngleStepSize, double);
69 vtkGetMacro(AngleStepSize, double);
71
73
76 vtkSetMacro(AngleAccelerationFactor, double);
77 vtkGetMacro(AngleAccelerationFactor, double);
79
81
84 vtkSetMacro(DisableMotion, vtkTypeBool);
85 vtkGetMacro(DisableMotion, vtkTypeBool);
86 vtkBooleanMacro(DisableMotion, vtkTypeBool);
88
90
97 vtkSetMacro(RestoreUpVector, vtkTypeBool);
98 vtkGetMacro(RestoreUpVector, vtkTypeBool);
99 vtkBooleanMacro(RestoreUpVector, vtkTypeBool);
101
102 // Specify "up" (by default {0,0,1} but can be changed)
103 vtkGetVectorMacro(DefaultUpVector, double, 3);
104 vtkSetVectorMacro(DefaultUpVector, double, 3);
105
107
110 void OnMouseMove() override;
111 void OnLeftButtonDown() override;
112 void OnLeftButtonUp() override;
113 void OnMiddleButtonDown() override;
114 void OnMiddleButtonUp() override;
115 void OnRightButtonDown() override;
116 void OnRightButtonUp() override;
118
120
123 void OnChar() override;
124 void OnKeyDown() override;
125 void OnKeyUp() override;
126 void OnTimer() override;
127 //
128 virtual void ForwardFly();
129 virtual void ReverseFly();
130 //
131 virtual void StartForwardFly();
132 virtual void EndForwardFly();
133 virtual void StartReverseFly();
134 virtual void EndReverseFly();
136
137protected:
140
142
148 void FlyByKey(vtkCamera* cam);
149 void GetLRVector(double vector[3], vtkCamera* cam);
150 void MotionAlongVector(double vector[3], double amount, vtkCamera* cam);
153 //
154 //
155 unsigned char KeysDown;
164 double DefaultUpVector[3];
166 double IdealFocalPoint[3];
168 double DeltaYaw;
169 double lYaw;
171 double lPitch;
173
174 CPIDControl* PID_Yaw;
175 CPIDControl* PID_Pitch;
176
177private:
179 void operator=(const vtkInteractorStyleFlight&) = delete;
180};
181
182VTK_ABI_NAMESPACE_END
183#endif
a virtual camera for 3D rendering
Definition vtkCamera.h:41
a simple class to control print indentation
Definition vtkIndent.h:29
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