VTK  9.4.20251007
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
18
19#ifndef vtkContextMouseEvent_h
20#define vtkContextMouseEvent_h
21
22#include "vtkRenderingContext2DModule.h" // For export macro
23#include "vtkVector.h" // Needed for vtkVector2f and vtkVector2i
24#include "vtkWin32Header.h" // For export macros.
25
26VTK_ABI_NAMESPACE_BEGIN
28
29class VTKRENDERINGCONTEXT2D_EXPORT vtkContextMouseEvent
30{
31public:
35 enum
36 {
41 };
42
46 enum
47 {
52 };
53
55
59 void SetInteractor(vtkRenderWindowInteractor* interactor) { this->Interactor = interactor; }
60
66
70 void SetPos(const vtkVector2f& pos) { this->Pos = pos; }
71 vtkVector2f GetPos() const { return this->Pos; }
72
76 void SetScenePos(const vtkVector2f& pos) { this->ScenePos = pos; }
77 vtkVector2f GetScenePos() const { return this->ScenePos; }
78
82 void SetScreenPos(const vtkVector2i& pos) { this->ScreenPos = pos; }
83 vtkVector2i GetScreenPos() const { return this->ScreenPos; }
84
88 void SetLastPos(const vtkVector2f& pos) { this->LastPos = pos; }
89 vtkVector2f GetLastPos() const { return this->LastPos; }
90
94 void SetLastScenePos(const vtkVector2f& pos) { this->LastScenePos = pos; }
95 vtkVector2f GetLastScenePos() const { return this->LastScenePos; }
96
100 void SetLastScreenPos(const vtkVector2i& pos) { this->LastScreenPos = pos; }
102
107 void SetButton(int button) { this->Button = button; }
108 int GetButton() const { return this->Button; }
109
114 int GetModifiers() const;
115
116protected:
121
126
131
136
141
146
151
153};
154
155VTK_ABI_NAMESPACE_END
156#endif // vtkContextMouseEvent_h
157// VTK-HeaderTest-Exclude: vtkContextMouseEvent.h
vtkVector2f LastPos
‘Pos’ at the previous mouse event.
vtkVector2f GetLastScenePos() const
int Button
Mouse button that caused the event, using the anonymous enumeration.
void SetButton(int button)
Set/get the mouse button that caused the event, with possible values being NO_BUTTON,...
void SetLastPos(const vtkVector2f &pos)
Set/get the position of the mouse in the item's coordinates.
vtkVector2f GetLastPos() const
void SetScenePos(const vtkVector2f &pos)
Set/get the position of the mouse in scene coordinates.
vtkVector2i GetLastScreenPos() const
vtkVector2f Pos
Position of the mouse in item coordinate system.
vtkRenderWindowInteractor * GetInteractor() const
Get the interactor for the mouse event.
vtkRenderWindowInteractor * Interactor
int GetModifiers() const
Return the modifier keys, if any, ORed together.
void SetLastScreenPos(const vtkVector2i &pos)
Set/get the position of the mouse in screen coordinates.
vtkVector2f GetScenePos() const
void SetPos(const vtkVector2f &pos)
Set/get the position of the mouse in the item's coordinates.
void SetLastScenePos(const vtkVector2f &pos)
Set/get the position of the mouse in scene coordinates.
void SetInteractor(vtkRenderWindowInteractor *interactor)
Set the interactor for the mouse event.
vtkVector2f ScenePos
Position of the mouse the scene coordinate system.
vtkContextMouseEvent()=default
void SetScreenPos(const vtkVector2i &pos)
Set/get the position of the mouse in screen coordinates.
vtkVector2i ScreenPos
Position of the mouse in screen coordinates.
vtkVector2i GetScreenPos() const
vtkVector2f GetPos() const
vtkVector2f LastScenePos
`ScenePos'at the previous mouse event.
vtkVector2i LastScreenPos
‘ScreenPos’ at the previous mouse event.
platform-independent render window interaction including picking and frame rate control.
Some derived classes for the different vectors commonly used.
Definition vtkVector.h:411