VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
33 VTK_ABI_NAMESPACE_BEGIN
34 class vtkCamera;
36 
37 class CPIDControl;
38 
39 class VTKINTERACTIONSTYLE_EXPORT VTK_MARSHALAUTO vtkInteractorStyleFlight
40  : public vtkInteractorStyle
41 {
42 public:
43  static vtkInteractorStyleFlight* New();
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 
142 protected:
144  ~vtkInteractorStyleFlight() override;
145 
147 
150  void UpdateSteering(vtkCamera* cam);
151  void UpdateMouseSteering(vtkCamera* cam);
152  void FlyByMouse(vtkCamera* cam);
153  void FlyByKey(vtkCamera* cam);
154  void GetLRVector(double vector[3], vtkCamera* cam);
155  void MotionAlongVector(double vector[3], double amount, vtkCamera* cam);
156  void SetupMotionVars(vtkCamera* cam);
157  void FinishCamera(vtkCamera* cam);
158  //
159  //
160  unsigned char KeysDown;
169  double DefaultUpVector[3];
171  double IdealFocalPoint[3];
173  double DeltaYaw;
174  double lYaw;
175  double DeltaPitch;
176  double lPitch;
178 
179  CPIDControl* PID_Yaw;
180  CPIDControl* PID_Pitch;
181 
182 private:
184  void operator=(const vtkInteractorStyleFlight&) = delete;
185 };
186 
187 VTK_ABI_NAMESPACE_END
188 #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:41
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)
#define VTK_MARSHALAUTO
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.