VTK  9.7.1
vtkInteractorStyleManipulator.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
21 #ifndef vtkInteractorStyleManipulator_h
22 #define vtkInteractorStyleManipulator_h
23 
24 #include "vtkInteractorStyle.h"
25 
26 #include "vtkInteractionStyleModule.h" // needed for export macro
27 
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkCollection;
31 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleManipulator : public vtkInteractorStyle
32 {
33 public:
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
39 
43  void OnMouseMove() override;
44  void OnLeftButtonDown() override;
45  void OnLeftButtonUp() override;
46  void OnMiddleButtonDown() override;
47  void OnMiddleButtonUp() override;
48  void OnRightButtonDown() override;
49  void OnRightButtonUp() override;
50  void OnMouseWheelForward() override;
51  void OnMouseWheelBackward() override;
53 
55 
60  void OnKeyDown() override;
61  void OnKeyUp() override;
63 
67  void AddManipulator(vtkCameraManipulator* m);
68 
72  void RemoveAllManipulators();
73 
75 
78  vtkGetObjectMacro(CameraManipulators, vtkCollection);
80 
82 
86  vtkSetMacro(MouseWheelZoomsToCursor, bool);
87  vtkGetMacro(MouseWheelZoomsToCursor, bool);
89 
91 
100  vtkSetMacro(MouseMotionFactor, double);
101  vtkGetMacro(MouseMotionFactor, double);
103 
104  void Dolly() override;
105 
109  vtkCameraManipulator* FindManipulator(int button, bool alt, bool control, bool shift);
110 
111 protected:
113  ~vtkInteractorStyleManipulator() override;
114 
115 private:
117  void operator=(const vtkInteractorStyleManipulator&) = delete;
118 
119  bool MouseWheelZoomsToCursor = false;
120  double MouseMotionFactor = 1.0;
121 
122  // The CameraInteractors also store there button and modifier.
123  vtkCollection* CameraManipulators;
124 
125  class vtkInternals;
126  std::unique_ptr<vtkInternals> Internals;
127  friend class vtkInternals;
128 };
129 VTK_ABI_NAMESPACE_END
130 #endif
virtual void OnLeftButtonDown()
virtual void OnMiddleButtonDown()
virtual void OnRightButtonDown()
virtual void OnLeftButtonUp()
virtual void OnKeyUp()
static vtkInteractorStyle * New()
This class must be supplied with a vtkRenderWindowInteractor wrapper or parent.
virtual void OnMiddleButtonUp()
Abstraction of style away from button.
virtual void OnMouseWheelForward()
virtual void OnRightButtonUp()
virtual void OnKeyDown()
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void OnMouseWheelBackward()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:39
provide event-driven interface to the rendering window (defines trackball mode)
interactive manipulation of the camera
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.