Visual Computing Library
Loading...
Searching...
No Matches
blocker_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_BLOCKER_EVENT_DRAWER_H
24#define VCL_RENDER_DRAWERS_BLOCKER_EVENT_DRAWER_H
25
26#include "plain_drawer.h"
27
28#include <vclib/render/input.h>
29
30namespace vcl {
31
46template<typename DerivedRenderApp>
47class BlockerEventDrawer : public PlainDrawer<DerivedRenderApp>
48{
49public:
50 static const bool CAN_BLOCK_EVENT_PROPAGATION = true;
51
52 BlockerEventDrawer() = default;
53
55
56 virtual bool onKeyPress(Key::Enum key, const KeyModifiers& modifiers)
57 {
58 return false;
59 }
60
61 virtual bool onKeyRelease(Key::Enum key, const KeyModifiers& modifiers)
62 {
63 return false;
64 }
65
66 virtual bool onMouseMove(double x, double y, const KeyModifiers& modifiers)
67 {
68 return false;
69 }
70
71 virtual bool onMousePress(
72 MouseButton::Enum button,
73 double x,
74 double y,
76 {
77 return false;
78 }
79
80 virtual bool onMouseRelease(
81 MouseButton::Enum button,
82 double x,
83 double y,
85 {
86 return false;
87 }
88
89 virtual bool onMouseDoubleClick(
90 MouseButton::Enum button,
91 double x,
92 double y,
94 {
95 return false;
96 }
97
98 virtual bool onMouseScroll(
99 double x,
100 double y,
101 const KeyModifiers& modifiers)
102 {
103 return false;
104 }
105};
106
107} // namespace vcl
108
109#endif // VCL_RENDER_DRAWERS_BLOCKER_EVENT_DRAWER_H
Special EventDrawer class for the case where the drawer can request to block the event propagation.
Definition blocker_event_drawer.h:48
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