VTK: Rendering/Context2D/vtkContextKeyEvent.h Source File

| VTK 9.3.1

vtkContextKeyEvent.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
13 #ifndef vtkContextKeyEvent_h
14 #define vtkContextKeyEvent_h
15
16 #include "vtkRenderingContext2DModule.h" // For export macro
17 #include "vtkVector.h" // For vtkVector2i
18 #include "vtkWeakPointer.h" // For vtkWeakPointer
19
20 VTK_ABI_NAMESPACE_BEGIN
21 class vtkRenderWindowInteractor;
22
23 class VTKRENDERINGCONTEXT2D_EXPORT vtkContextKeyEvent
24 {
25 public:
26 vtkContextKeyEvent();
27
31 void SetInteractor(vtkRenderWindowInteractor* interactor);
32
37 vtkRenderWindowInteractor* GetInteractor() const;
38
42 void SetPosition(const vtkVector2i& position) { this->Position = position; }
43
47 vtkVector2i GetPosition() const { return this->Position; }
48
49 char GetKeyCode() const;
50
51 protected:
52 vtkWeakPointer<vtkRenderWindowInteractor> Interactor;
53 vtkVector2i Position;
54 };
55
56 VTK_ABI_NAMESPACE_END
57 #endif // vtkContextKeyEvent_h
58 // VTK-HeaderTest-Exclude: vtkContextKeyEvent.h
vtkContextKeyEvent
data structure to represent key events.
Definition: vtkContextKeyEvent.h:24
vtkContextKeyEvent::vtkContextKeyEvent
vtkContextKeyEvent()
vtkContextKeyEvent::Interactor
vtkWeakPointer< vtkRenderWindowInteractor > Interactor
Definition: vtkContextKeyEvent.h:52
vtkContextKeyEvent::GetPosition
vtkVector2i GetPosition() const
Get the position of the mouse when the key was pressed.
Definition: vtkContextKeyEvent.h:47
vtkContextKeyEvent::SetPosition
void SetPosition(const vtkVector2i &position)
Set the position of the mouse when the key was pressed.
Definition: vtkContextKeyEvent.h:42
vtkContextKeyEvent::GetInteractor
vtkRenderWindowInteractor * GetInteractor() const
Get the interactor for the key event.
vtkContextKeyEvent::GetKeyCode
char GetKeyCode() const
vtkContextKeyEvent::Position
vtkVector2i Position
Definition: vtkContextKeyEvent.h:53
vtkContextKeyEvent::SetInteractor
void SetInteractor(vtkRenderWindowInteractor *interactor)
Set the interactor for the key event.
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:82
vtkVector2i
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:450
vtkWeakPointer< vtkRenderWindowInteractor >
vtkParticleTracerBaseNamespace::Position
struct Position_t Position
Definition: vtkParticleTracerBase.h:55
vtkX3D::position
@ position
Definition: vtkX3D.h:261
vtkVector.h
vtkWeakPointer.h