vtkSMVRFirstPersonCameraStyleProxy.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
16 #ifndef vtkSMVRFirstPersonCameraStyleProxy_h
17 #define vtkSMVRFirstPersonCameraStyleProxy_h
18 
19 #include "vtkPVIncubatorCAVEInteractionStylesModule.h" // for export macro
21 
22 class vtkCamera;
26 struct vtkVREvent;
27 
28 class VTKPVINCUBATORCAVEINTERACTIONSTYLES_EXPORT vtkSMVRFirstPersonCameraStyleProxy
30 {
31 public:
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
39  int GetControlledPropertySize() override { return 0; }
40 
42 
45  vtkSetMacro(MouseSensitivityX, double);
46  vtkGetMacro(MouseSensitivityX, double);
47  vtkSetMacro(MouseSensitivityY, double);
48  vtkGetMacro(MouseSensitivityY, double);
50 
52 
55  vtkSetMacro(MoveSpeedForward, double);
56  vtkGetMacro(MoveSpeedForward, double);
57  vtkSetMacro(MoveSpeedRight, double);
58  vtkGetMacro(MoveSpeedRight, double);
60 
62 
65  vtkSetMacro(InvertXAxis, bool);
66  vtkGetMacro(InvertXAxis, bool);
67  vtkSetMacro(InvertYAxis, bool);
68  vtkGetMacro(InvertYAxis, bool);
70 
74  enum Axis
75  {
76  X_AXIS = 0,
78  Z_AXIS
79  };
80 
82 
86  vtkSetMacro(UpAxis, Axis);
87  vtkGetMacro(UpAxis, Axis);
89 
93  bool Update() override;
94 
99  void UpdateVTKObjects() override;
100 
101 protected:
103  ~vtkSMVRFirstPersonCameraStyleProxy() override = default;
104 
105  void HandleButton(const vtkVREvent& event) override;
106  void HandleValuator(const vtkVREvent& event) override;
107 
108 private:
110  void operator=(const vtkSMVRFirstPersonCameraStyleProxy&) = delete;
111 
112  double MousePosX = 0;
113  bool InvertXAxis = false;
114  double MousePosY = 0;
115  bool InvertYAxis = false;
116  int MoveForward = 0; // -1 for moving backward and 1 for moving forward
117  int MoveRight = 0; // -1 for moving left and 1 for moving right
118 
119  Axis UpAxis = Y_AXIS;
120 
121  double MouseSensitivityX = 6.28;
122  double MouseSensitivityY = 3.14;
123  double MoveSpeedRight = 0.5;
124  double MoveSpeedForward = 1;
125 };
126 
127 #endif // vtkSMVRFirstPersonCameraStyleProxy_h
the base class for all interactor styles
interactor style with mouse and keyboard like a first person flight
virtual void HandleButton(const vtkVREvent &event)
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()
int GetControlledPropertySize() override
Override this function to automatically set the controlled property.
Axis
Enum axis to retrieve the forward, the right and the up axis of the scene.
virtual bool Update()
Update() called to update all the remote vtkObjects and perhaps even to render.