VTK  9.6.20260327
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
20
21#ifndef vtkInteractorStyleManipulator_h
22#define vtkInteractorStyleManipulator_h
23
24#include "vtkInteractorStyle.h"
25
26#include "vtkInteractionStyleModule.h" // needed for export macro
27
28VTK_ABI_NAMESPACE_BEGIN
29class vtkCollection;
31class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleManipulator : public vtkInteractorStyle
32{
33public:
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
68
73
75
78 vtkGetObjectMacro(CameraManipulators, vtkCollection);
80
82
86 vtkSetMacro(MouseWheelZoomsToCursor, bool);
87 vtkGetMacro(MouseWheelZoomsToCursor, bool);
89
91
100 vtkSetVector3Macro(CenterOfRotation, double);
101 vtkGetVector3Macro(CenterOfRotation, double);
103
105
114 vtkSetMacro(MouseMotionFactor, double);
115 vtkGetMacro(MouseMotionFactor, double);
117
118 void Dolly() override;
119
123 vtkCameraManipulator* FindManipulator(int button, bool alt, bool control, bool shift);
124
125protected:
128
129private:
131 void operator=(const vtkInteractorStyleManipulator&) = delete;
132
133 bool MouseWheelZoomsToCursor = false;
134 double CenterOfRotation[3] = { 0.0, 0.0, 0.0 };
135 double MouseMotionFactor = 1.0;
136
137 // The CameraInteractors also store there button and modifier.
138 vtkCollection* CameraManipulators;
139
140 class vtkInternals;
141 std::unique_ptr<vtkInternals> Internals;
142 friend class vtkInternals;
143};
144VTK_ABI_NAMESPACE_END
145#endif
Abstraction of style away from button.
create and manipulate ordered lists of objects
a simple class to control print indentation
Definition vtkIndent.h:108
~vtkInteractorStyleManipulator() override
vtkCameraManipulator * FindManipulator(int button, bool alt, bool control, bool shift)
Returns the chosen manipulator based on the modifiers.
void OnMiddleButtonDown() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
void RemoveAllManipulators()
Removes all manipulators.
void OnRightButtonDown() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
void OnMouseMove() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
void OnKeyUp() override
Unlike mouse events, these are forwarded to all camera manipulators since we don't have a mechanism t...
void OnLeftButtonUp() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void OnRightButtonUp() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
void OnMouseWheelBackward() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
void OnKeyDown() override
Unlike mouse events, these are forwarded to all camera manipulators since we don't have a mechanism t...
void OnLeftButtonDown() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
void AddManipulator(vtkCameraManipulator *m)
Access to adding or removing manipulators.
static vtkInteractorStyleManipulator * New()
void OnMouseWheelForward() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.
void OnMiddleButtonUp() override
Event bindings controlling the effects of pressing mouse buttons or moving the mouse.