ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
vtkPVInteractorStyle.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include "qPCL.h" // needed for export macro
11 #include "vtkInteractorStyleTrackballCamera.h"
12 
14 class vtkCollection;
15 
17  : public vtkInteractorStyleTrackballCamera {
18 public:
20  vtkTypeMacro(vtkPVInteractorStyle, vtkInteractorStyleTrackballCamera);
21  void PrintSelf(ostream& os, vtkIndent indent) override;
22 
24 
28  void OnMouseMove() override;
29  void OnLeftButtonDown() override;
30  void OnLeftButtonUp() override;
31  void OnMiddleButtonDown() override;
32  void OnMiddleButtonUp() override;
33  void OnRightButtonDown() override;
34  void OnRightButtonUp() override;
36 
38 
43  void OnKeyDown() override;
44  void OnKeyUp() override;
46 
51  void OnChar() override;
52 
56  void AddManipulator(vtkCameraManipulator* m);
57 
61  void RemoveAllManipulators();
62 
64 
67  vtkGetObjectMacro(CameraManipulators, vtkCollection);
69 
71 
80  vtkSetVector3Macro(CenterOfRotation, double);
81  vtkGetVector3Macro(CenterOfRotation, double);
83 
85 
94  vtkSetMacro(RotationFactor, double);
95  vtkGetMacro(RotationFactor, double);
97 
101  virtual vtkCameraManipulator* FindManipulator(int button,
102  int shift,
103  int control);
104 
108  static void DollyToPosition(double fact,
109  int* position,
110  vtkRenderer* renderer);
111 
115  static void TranslateCamera(
116  vtkRenderer* renderer, int toX, int toY, int fromX, int fromY);
117 
118  using vtkInteractorStyleTrackballCamera::Dolly;
119 
120 protected:
122  ~vtkPVInteractorStyle() override;
123 
124  void Dolly(double factor) override;
125 
127  double CenterOfRotation[3];
129 
130  // The CameraInteractors also store there button and modifier.
131  vtkCollection* CameraManipulators;
132 
133  void OnButtonDown(int button, int shift, int control);
134  void OnButtonUp(int button);
135  void ResetLights();
136 
138  void operator=(const vtkPVInteractorStyle&) = delete;
139 };
math::float3 position
vtkPVInteractorStyle(const vtkPVInteractorStyle &)=delete
vtkTypeMacro(vtkPVInteractorStyle, vtkInteractorStyleTrackballCamera)
vtkGetObjectMacro(CameraManipulators, vtkCollection)
vtkGetMacro(RotationFactor, double)
vtkSetVector3Macro(CenterOfRotation, double)
static vtkPVInteractorStyle * New()
vtkSetMacro(RotationFactor, double)
vtkCameraManipulator * CurrentManipulator
vtkGetVector3Macro(CenterOfRotation, double)
vtkCollection * CameraManipulators
void operator=(const vtkPVInteractorStyle &)=delete
#define QPCL_ENGINE_LIB_API
Definition: qPCL.h:15