VTK  9.4.20250206
vtkEvent.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
14#ifndef vtkEvent_h
15#define vtkEvent_h
16
17#include "vtkInteractionWidgetsModule.h" // For export macro
18#include "vtkObject.h"
19
20VTK_ABI_NAMESPACE_BEGIN
22
23class VTKINTERACTIONWIDGETS_EXPORT vtkEvent : public vtkObject
24{
25public:
29 static vtkEvent* New();
30
32
35 vtkTypeMacro(vtkEvent, vtkObject);
36 void PrintSelf(ostream& os, vtkIndent indent) override;
38
44 {
45 AnyModifier = -1,
46 NoModifier = 0,
47 ShiftModifier = 1,
48 ControlModifier = 2,
49 AltModifier = 4
50 };
51
53
56 vtkSetMacro(EventId, unsigned long);
57 vtkGetMacro(EventId, unsigned long);
59
61
64 vtkSetMacro(Modifier, int);
65 vtkGetMacro(Modifier, int);
67
69
73 vtkSetMacro(KeyCode, char);
74 vtkGetMacro(KeyCode, char);
76
78
81 vtkSetMacro(RepeatCount, int);
82 vtkGetMacro(RepeatCount, int);
84
86
90 vtkSetStringMacro(KeySym);
91 vtkGetStringMacro(KeySym);
93
98
103 bool operator==(vtkEvent*) const;
104 bool operator==(unsigned long VTKEvent) const; // event with no modifiers
105
106protected:
108 ~vtkEvent() override;
109
110 unsigned long EventId;
114 char* KeySym;
115
116private:
117 vtkEvent(const vtkEvent&) = delete;
118 void operator=(const vtkEvent&) = delete;
119};
120
121VTK_ABI_NAMESPACE_END
122#endif
a complete specification of a VTK event including all modifiers
Definition vtkEvent.h:24
char * KeySym
Definition vtkEvent.h:114
unsigned long EventId
Definition vtkEvent.h:110
EventModifiers
Ways to specify modifiers to VTK events.
Definition vtkEvent.h:44
static vtkEvent * New()
The object factory constructor.
bool operator==(unsigned long VTKEvent) const
int RepeatCount
Definition vtkEvent.h:113
int Modifier
Definition vtkEvent.h:111
bool operator==(vtkEvent *) const
Used to compare whether two events are equal.
~vtkEvent() override
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros.
static int GetModifier(vtkRenderWindowInteractor *)
Convenience method computes the event modifier from an interactor.
char KeyCode
Definition vtkEvent.h:112
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
platform-independent render window interaction including picking and frame rate control.