vtkSMVRJoystickCameraStyleProxy.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
14 #ifndef vtkSMVRJoystickCameraStyleProxy_h
15 #define vtkSMVRJoystickCameraStyleProxy_h
16 
17 #include "vtkPVIncubatorCAVEInteractionStylesModule.h" // for export macro
19 
20 class vtkCamera;
24 struct vtkVREvent;
25 
26 class VTKPVINCUBATORCAVEINTERACTIONSTYLES_EXPORT vtkSMVRJoystickCameraStyleProxy
28 {
29 public:
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
37  int GetControlledPropertySize() override { return 0; }
38 
40 
43  vtkSetMacro(LookRotationSensitivity, double);
44  vtkGetMacro(LookRotationSensitivity, double);
46 
48 
51  vtkSetMacro(MoveJoystickSensitivity, double);
52  vtkGetMacro(MoveJoystickSensitivity, double);
54 
56 
59  vtkSetMacro(MoveCameraSensitivity, double);
60  vtkGetMacro(MoveCameraSensitivity, double);
62 
64 
67  vtkSetMacro(InvertXAxis, bool);
68  vtkGetMacro(InvertXAxis, bool);
69  vtkSetMacro(InvertYAxis, bool);
70  vtkGetMacro(InvertYAxis, bool);
72 
74 
77  vtkSetMacro(InvertFwdMovement, bool);
78  vtkGetMacro(InvertFwdMovement, bool);
79  vtkSetMacro(InvertRightMovement, bool);
80  vtkGetMacro(InvertRightMovement, bool);
82 
84 
88  vtkSetMacro(FastMovementMultiplier, double);
89  vtkGetMacro(FastMovementMultiplier, double);
91 
95  enum Axis
96  {
97  X_AXIS = 0,
99  Z_AXIS
100  };
101 
103 
107  vtkSetMacro(UpAxis, Axis);
108  vtkGetMacro(UpAxis, Axis);
110 
114  bool Update() override;
115 
120  void UpdateVTKObjects() override;
121 
122 protected:
124  ~vtkSMVRJoystickCameraStyleProxy() override = default;
125 
126  void HandleButton(const vtkVREvent& event) override;
127  void HandleValuator(const vtkVREvent& event) override;
128 
129 private:
131  void operator=(const vtkSMVRJoystickCameraStyleProxy&) = delete;
132 
137  double GetMovementValue(double valuatorValue, bool invert);
138 
139  double OrientationX = 0;
140  bool InvertXAxis = false;
141  double OrientationY = 0;
142  bool InvertYAxis = false;
143 
144  double MoveForward = 0;
145  bool InvertFwdMovement = false;
146  double MoveRight = 0;
147  bool InvertRightMovement = false;
148 
149  double FastMovementMultiplier = 4.0;
150  bool FastMovement = false;
151 
152  Axis UpAxis = Y_AXIS;
153 
154  double LookRotationSensitivity = 0.01;
155  double MoveCameraSensitivity = 0.1;
156 
157  double MoveJoystickSensitivity = 2.0;
158 };
159 
160 #endif // vtkSMVRJoystickCameraStyleProxy_h
interactor style with a controller with joysticks
the base class for all interactor styles
virtual void HandleButton(const vtkVREvent &event)
Axis
Enum axis to retrieve the forward, the right and the up axis of the scene.
property representing a vector of integers
virtual void UpdateVTKObjects()
Update the VTK object on the server by pushing the values of all modified properties (un-modified pro...
implementation for View that includes render window and renderers.
property representing a vector of doubles
virtual void HandleValuator(const vtkVREvent &event)
void PrintSelf(ostream &os, vtkIndent indent) override
static vtkSMVRInteractorStyleProxy * New()
virtual bool Update()
Update() called to update all the remote vtkObjects and perhaps even to render.
int GetControlledPropertySize() override
Override this function to automatically set the controlled property.