Visual Computing Library
Loading...
Searching...
No Matches
event_drawer.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2025 *
6 * Visual Computing Lab *
7 * ISTI - Italian National Research Council *
8 * *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the Mozilla Public License Version 2.0 as published *
13 * by the Mozilla Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * Mozilla Public License Version 2.0 *
20 * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
21 ****************************************************************************/
22
23#ifndef VCL_RENDER_DRAWERS_EVENT_DRAWER_H
24#define VCL_RENDER_DRAWERS_EVENT_DRAWER_H
25
26#include "plain_drawer.h"
27
28#include <vclib/render/input.h>
29
30namespace vcl {
31
42template<typename DerivedRenderApp>
43class EventDrawer : public PlainDrawer<DerivedRenderApp>
44{
45public:
46 static const bool CAN_BLOCK_EVENT_PROPAGATION = false;
47
48 EventDrawer() = default;
49
51
52 virtual void onKeyPress(Key::Enum key, const KeyModifiers& modifiers) {}
53
54 virtual void onKeyRelease(Key::Enum key, const KeyModifiers& modifiers) {}
55
56 virtual void onMouseMove(double x, double y, const KeyModifiers& modifiers)
57 {
58 }
59
60 virtual void onMousePress(
61 MouseButton::Enum button,
62 double x,
63 double y,
65 {
66 }
67
68 virtual void onMouseRelease(
69 MouseButton::Enum button,
70 double x,
71 double y,
73 {
74 }
75
76 virtual void onMouseDoubleClick(
77 MouseButton::Enum button,
78 double x,
79 double y,
81 {
82 }
83
84 virtual void onMouseScroll(
85 double x,
86 double y,
88 {
89 }
90};
91
92} // namespace vcl
93
94#endif // VCL_RENDER_DRAWERS_EVENT_DRAWER_H
The EventDrawer class is a base class for drawers that can handle events.
Definition event_drawer.h:44
Definition plain_drawer.h:32
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43