VTK  9.2.5
vtkEvent.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkEvent.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
26#ifndef vtkEvent_h
27#define vtkEvent_h
28
29#include "vtkInteractionWidgetsModule.h" // For export macro
30#include "vtkObject.h"
31
33
34class VTKINTERACTIONWIDGETS_EXPORT vtkEvent : public vtkObject
35{
36public:
40 static vtkEvent* New();
41
43
46 vtkTypeMacro(vtkEvent, vtkObject);
47 void PrintSelf(ostream& os, vtkIndent indent) override;
49
55 {
56 AnyModifier = -1,
57 NoModifier = 0,
58 ShiftModifier = 1,
59 ControlModifier = 2,
60 AltModifier = 4
61 };
62
64
67 vtkSetMacro(EventId, unsigned long);
68 vtkGetMacro(EventId, unsigned long);
70
72
75 vtkSetMacro(Modifier, int);
76 vtkGetMacro(Modifier, int);
78
80
83 vtkSetMacro(KeyCode, char);
84 vtkGetMacro(KeyCode, char);
86
88
91 vtkSetMacro(RepeatCount, int);
92 vtkGetMacro(RepeatCount, int);
94
96
99 vtkSetStringMacro(KeySym);
100 vtkGetStringMacro(KeySym);
102
107
113 bool operator==(unsigned long VTKEvent); // event with no modifiers
114
115protected:
117 ~vtkEvent() override;
118
119 unsigned long EventId;
123 char* KeySym;
124
125private:
126 vtkEvent(const vtkEvent&) = delete;
127 void operator=(const vtkEvent&) = delete;
128};
129
130#endif
a complete specification of a VTK event including all modifiers
Definition: vtkEvent.h:35
char * KeySym
Definition: vtkEvent.h:123
unsigned long EventId
Definition: vtkEvent.h:119
bool operator==(vtkEvent *)
Used to compare whether two events are equal.
EventModifiers
Ways to specify modifiers to VTK events.
Definition: vtkEvent.h:55
static vtkEvent * New()
The object factory constructor.
int RepeatCount
Definition: vtkEvent.h:122
int Modifier
Definition: vtkEvent.h:120
~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:121
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:63
platform-independent render window interaction including picking and frame rate control.