vtkPVInteractorStyle.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
15 #ifndef vtkPVInteractorStyle_h
16 #define vtkPVInteractorStyle_h
17 
19 #include "vtkPVVTKExtensionsInteractionStyleModule.h" // needed for export macro
20 
22 class vtkCollection;
23 
26 {
27 public:
28  static vtkPVInteractorStyle* New();
30  void PrintSelf(ostream& os, vtkIndent indent) override;
31 
33 
37  void OnMouseMove() override;
38  void OnLeftButtonDown() override;
39  void OnLeftButtonUp() override;
40  void OnMiddleButtonDown() override;
41  void OnMiddleButtonUp() override;
42  void OnRightButtonDown() override;
43  void OnRightButtonUp() override;
45 
47 
52  void OnKeyDown() override;
53  void OnKeyUp() override;
55 
60  void OnChar() override;
61 
65  void AddManipulator(vtkCameraManipulator* m);
66 
70  void RemoveAllManipulators();
71 
73 
76  vtkGetObjectMacro(CameraManipulators, vtkCollection);
78 
80 
84  vtkSetMacro(MouseWheelZoomsToCursor, bool);
85  vtkGetMacro(MouseWheelZoomsToCursor, bool);
87 
89 
98  vtkSetVector3Macro(CenterOfRotation, double);
99  vtkGetVector3Macro(CenterOfRotation, double);
101 
103 
112  vtkSetMacro(RotationFactor, double);
113  vtkGetMacro(RotationFactor, double);
115 
119  virtual vtkCameraManipulator* FindManipulator(int button, int shift, int control);
120 
124  static void DollyToPosition(double fact, int* position, vtkRenderer* renderer);
125 
129  static void TranslateCamera(vtkRenderer* renderer, int toX, int toY, int fromX, int fromY);
130 
132 
133 protected:
135  ~vtkPVInteractorStyle() override;
136 
137  void Dolly(double factor) override;
138 
140  bool MouseWheelZoomsToCursor = false;
141  double CenterOfRotation[3];
143 
144  // The CameraInteractors also store there button and modifier.
146 
147  void OnButtonDown(int button, int shift, int control);
148  void OnButtonUp(int button);
149  void ResetLights();
150 
152  void operator=(const vtkPVInteractorStyle&) = delete;
153 };
154 
155 #endif
virtual void OnKeyUp()
void PrintSelf(ostream &os, vtkIndent indent)
vtkCollection * CameraManipulators
Abstraction of style away from button.
static vtkInteractorStyleTrackballCamera * New()
#define VTKPVVTKEXTENSIONSINTERACTIONSTYLE_EXPORT
virtual void OnKeyDown()
virtual void OnChar()
interactive manipulation of the camera
void operator=(const vtkObjectBase &)
vtkCameraManipulator * CurrentManipulator