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(vtkPVCameraManipulator* m);
66 
70  void RemoveAllManipulators();
71 
73 
76  vtkGetObjectMacro(CameraManipulators, vtkCollection);
78 
80 
84  vtkSetMacro(MouseWheelZoomsToCursor, bool);
85  vtkGetMacro(MouseWheelZoomsToCursor, bool);
87 
89 
98  vtkSetMacro(RotationFactor, double);
99  vtkGetMacro(RotationFactor, double);
101 
105  virtual vtkPVCameraManipulator* FindManipulator(int button, int shift, int control);
106 
110  static void DollyToPosition(double fact, int* position, vtkRenderer* renderer);
111 
115  static void TranslateCamera(vtkRenderer* renderer, int toX, int toY, int fromX, int fromY);
116 
118 
119 protected:
121  ~vtkPVInteractorStyle() override;
122 
123  void Dolly(double factor) override;
124 
126  bool MouseWheelZoomsToCursor = false;
128 
129  // The CameraInteractors also store there button and modifier.
131 
132  void OnButtonDown(int button, int shift, int control);
133  void OnButtonUp(int button);
134  void ResetLights();
135 
137  void operator=(const vtkPVInteractorStyle&) = delete;
138 };
139 
140 #endif
vtkPVCameraManipulator * CurrentManipulator
virtual void OnKeyUp()
void PrintSelf(ostream &os, vtkIndent indent)
vtkCollection * CameraManipulators
static vtkInteractorStyleTrackballCamera * New()
#define VTKPVVTKEXTENSIONSINTERACTIONSTYLE_EXPORT
virtual void OnKeyDown()
Abstraction of style away from button.
virtual void OnChar()
interactive manipulation of the camera
void operator=(const vtkObjectBase &)