VTK: Rendering/Context2D/vtkContextMouseEvent.h Source File

| VTK 9.3.1

vtkContextMouseEvent.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
3
28 #ifndef vtkContextMouseEvent_h
29 #define vtkContextMouseEvent_h
30
31 #include "vtkRenderingContext2DModule.h" // For export macro
32 #include "vtkVector.h" // Needed for vtkVector2f and vtkVector2i
33 #include "vtkWin32Header.h" // For export macros.
34
35 VTK_ABI_NAMESPACE_BEGIN
36 class vtkRenderWindowInteractor;
37
38 class VTKRENDERINGCONTEXT2D_EXPORT vtkContextMouseEvent
39 {
40 public:
44 enum
45 {
46 NO_BUTTON = 0,
47 LEFT_BUTTON = 1,
48 MIDDLE_BUTTON = 2,
49 RIGHT_BUTTON = 4
50 };
51
55 enum
56 {
57 NO_MODIFIER = 0,
58 ALT_MODIFIER = 1,
59 SHIFT_MODIFIER = 2,
60 CONTROL_MODIFIER = 4
61 };
62
63 vtkContextMouseEvent() = default;
64
68 void SetInteractor(vtkRenderWindowInteractor* interactor) { this->Interactor = interactor; }
69
74 vtkRenderWindowInteractor* GetInteractor() const { return this->Interactor; }
75
79 void SetPos(const vtkVector2f& pos) { this->Pos = pos; }
80 vtkVector2f GetPos() const { return this->Pos; }
81
85 void SetScenePos(const vtkVector2f& pos) { this->ScenePos = pos; }
86 vtkVector2f GetScenePos() const { return this->ScenePos; }
87
91 void SetScreenPos(const vtkVector2i& pos) { this->ScreenPos = pos; }
92 vtkVector2i GetScreenPos() const { return this->ScreenPos; }
93
97 void SetLastPos(const vtkVector2f& pos) { this->LastPos = pos; }
98 vtkVector2f GetLastPos() const { return this->LastPos; }
99
103 void SetLastScenePos(const vtkVector2f& pos) { this->LastScenePos = pos; }
104 vtkVector2f GetLastScenePos() const { return this->LastScenePos; }
105
109 void SetLastScreenPos(const vtkVector2i& pos) { this->LastScreenPos = pos; }
110 vtkVector2i GetLastScreenPos() const { return this->LastScreenPos; }
111
116 void SetButton(int button) { this->Button = button; }
117 int GetButton() const { return this->Button; }
118
123 int GetModifiers() const;
124
125 protected:
129 vtkVector2f Pos;
130
134 vtkVector2f ScenePos;
135
139 vtkVector2i ScreenPos;
140
144 vtkVector2f LastPos;
145
149 vtkVector2f LastScenePos;
150
154 vtkVector2i LastScreenPos;
155
159 int Button;
160
161 vtkRenderWindowInteractor* Interactor;
162 };
163
164 VTK_ABI_NAMESPACE_END
165 #endif // vtkContextMouseEvent_h
166 // VTK-HeaderTest-Exclude: vtkContextMouseEvent.h
vtkContextMouseEvent
data structure to represent mouse events.
Definition: vtkContextMouseEvent.h:39
vtkContextMouseEvent::LastPos
vtkVector2f LastPos
‘Pos’ at the previous mouse event.
Definition: vtkContextMouseEvent.h:144
vtkContextMouseEvent::GetLastScenePos
vtkVector2f GetLastScenePos() const
Definition: vtkContextMouseEvent.h:104
vtkContextMouseEvent::GetButton
int GetButton() const
Definition: vtkContextMouseEvent.h:117
vtkContextMouseEvent::GetInteractor
vtkRenderWindowInteractor * GetInteractor() const
Get the interactor for the mouse event.
Definition: vtkContextMouseEvent.h:74
vtkContextMouseEvent::Button
int Button
Mouse button that caused the event, using the anonymous enumeration.
Definition: vtkContextMouseEvent.h:159
vtkContextMouseEvent::SetButton
void SetButton(int button)
Set/get the mouse button that caused the event, with possible values being NO_BUTTON,...
Definition: vtkContextMouseEvent.h:116
vtkContextMouseEvent::SetLastPos
void SetLastPos(const vtkVector2f &pos)
Set/get the position of the mouse in the item's coordinates.
Definition: vtkContextMouseEvent.h:97
vtkContextMouseEvent::GetLastPos
vtkVector2f GetLastPos() const
Definition: vtkContextMouseEvent.h:98
vtkContextMouseEvent::SetScenePos
void SetScenePos(const vtkVector2f &pos)
Set/get the position of the mouse in scene coordinates.
Definition: vtkContextMouseEvent.h:85
vtkContextMouseEvent::GetLastScreenPos
vtkVector2i GetLastScreenPos() const
Definition: vtkContextMouseEvent.h:110
vtkContextMouseEvent::Pos
vtkVector2f Pos
Position of the mouse in item coordinate system.
Definition: vtkContextMouseEvent.h:129
vtkContextMouseEvent::Interactor
vtkRenderWindowInteractor * Interactor
Definition: vtkContextMouseEvent.h:161
vtkContextMouseEvent::GetModifiers
int GetModifiers() const
Return the modifier keys, if any, ORed together.
vtkContextMouseEvent::SetLastScreenPos
void SetLastScreenPos(const vtkVector2i &pos)
Set/get the position of the mouse in screen coordinates.
Definition: vtkContextMouseEvent.h:109
vtkContextMouseEvent::GetScenePos
vtkVector2f GetScenePos() const
Definition: vtkContextMouseEvent.h:86
vtkContextMouseEvent::SetPos
void SetPos(const vtkVector2f &pos)
Set/get the position of the mouse in the item's coordinates.
Definition: vtkContextMouseEvent.h:79
vtkContextMouseEvent::SetLastScenePos
void SetLastScenePos(const vtkVector2f &pos)
Set/get the position of the mouse in scene coordinates.
Definition: vtkContextMouseEvent.h:103
vtkContextMouseEvent::SetInteractor
void SetInteractor(vtkRenderWindowInteractor *interactor)
Set the interactor for the mouse event.
Definition: vtkContextMouseEvent.h:68
vtkContextMouseEvent::ScenePos
vtkVector2f ScenePos
Position of the mouse the scene coordinate system.
Definition: vtkContextMouseEvent.h:134
vtkContextMouseEvent::vtkContextMouseEvent
vtkContextMouseEvent()=default
vtkContextMouseEvent::SetScreenPos
void SetScreenPos(const vtkVector2i &pos)
Set/get the position of the mouse in screen coordinates.
Definition: vtkContextMouseEvent.h:91
vtkContextMouseEvent::ScreenPos
vtkVector2i ScreenPos
Position of the mouse in screen coordinates.
Definition: vtkContextMouseEvent.h:139
vtkContextMouseEvent::GetScreenPos
vtkVector2i GetScreenPos() const
Definition: vtkContextMouseEvent.h:92
vtkContextMouseEvent::GetPos
vtkVector2f GetPos() const
Definition: vtkContextMouseEvent.h:80
vtkContextMouseEvent::LastScenePos
vtkVector2f LastScenePos
`ScenePos'at the previous mouse event.
Definition: vtkContextMouseEvent.h:149
vtkContextMouseEvent::LastScreenPos
vtkVector2i LastScreenPos
‘ScreenPos’ at the previous mouse event.
Definition: vtkContextMouseEvent.h:154
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:82
vtkVector2f
Definition: vtkVector.h:463
vtkVector2i
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:450
vtkVector.h
vtkWin32Header.h