VTK  9.3.0
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
72 vtkSetMacro(KeyCode, char);
73 vtkGetMacro(KeyCode, char);
75
77
80 vtkSetMacro(RepeatCount, int);
81 vtkGetMacro(RepeatCount, int);
83
85
88 vtkSetStringMacro(KeySym);
89 vtkGetStringMacro(KeySym);
91
96
102 bool operator==(unsigned long VTKEvent); // event with no modifiers
103
104protected:
106 ~vtkEvent() override;
107
108 unsigned long EventId;
112 char* KeySym;
113
114private:
115 vtkEvent(const vtkEvent&) = delete;
116 void operator=(const vtkEvent&) = delete;
117};
118
119VTK_ABI_NAMESPACE_END
120#endif
a complete specification of a VTK event including all modifiers
Definition vtkEvent.h:24
char * KeySym
Definition vtkEvent.h:112
unsigned long EventId
Definition vtkEvent.h:108
bool operator==(vtkEvent *)
Used to compare whether two events are equal.
EventModifiers
Ways to specify modifiers to VTK events.
Definition vtkEvent.h:44
static vtkEvent * New()
The object factory constructor.
int RepeatCount
Definition vtkEvent.h:111
int Modifier
Definition vtkEvent.h:109
~vtkEvent() override
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros.
static int GetModifier(vtkRenderWindowInteractor *)
Convenience method computes the event modifier from an interactor.
bool operator==(unsigned long VTKEvent)
char KeyCode
Definition vtkEvent.h:110
a simple class to control print indentation
Definition vtkIndent.h:29
abstract base class for most VTK objects
Definition vtkObject.h:49
platform-independent render window interaction including picking and frame rate control.