score
Home
Classes
Namespaces
Files
CurvePaletteBaseEvents.hpp
1
#pragma once
2
#include "CurvePoint.hpp"
3
4
#include <score/statemachine/StateMachineUtils.hpp>
5
#include <score/tools/Clamp.hpp>
6
7
class
QGraphicsItem;
8
namespace
Curve
9
{
10
class
SegmentModel;
11
namespace
Element
12
{
13
struct
Nothing_tag
14
{
15
static
constexpr
const
int
value = 0;
16
};
17
struct
Point_tag
18
{
19
static
constexpr
const
int
value = 1;
20
};
21
struct
Segment_tag
22
{
23
static
constexpr
const
int
value = 2;
24
};
25
}
26
27
template
<
typename
Element_T,
typename
Modifier_T>
28
struct
CurveEvent
:
public
score::PositionedEvent
<Curve::Point>
29
{
30
static
constexpr
const
int
user_type = Element_T::value + Modifier_T::value;
31
CurveEvent
(
const
Curve::Point& pt,
const
QGraphicsItem* theItem)
32
:
score::PositionedEvent<Curve::Point>
{pt, QEvent::Type(QEvent::User + user_type)}
33
, item{theItem}
34
{
35
}
36
37
const
QGraphicsItem*
const
item{};
38
};
39
40
using
ClickOnNothing_Event
41
=
CurveEvent<Element::Nothing_tag, score::Modifier::Click_tag>
;
42
using
ClickOnPoint_Event
=
CurveEvent<Element::Point_tag, score::Modifier::Click_tag>
;
43
using
ClickOnSegment_Event
44
=
CurveEvent<Element::Segment_tag, score::Modifier::Click_tag>
;
45
46
using
MoveOnNothing_Event
=
CurveEvent<Element::Nothing_tag, score::Modifier::Move_tag>
;
47
using
MoveOnPoint_Event
=
CurveEvent<Element::Point_tag, score::Modifier::Move_tag>
;
48
using
MoveOnSegment_Event
=
CurveEvent<Element::Segment_tag, score::Modifier::Move_tag>
;
49
50
using
ReleaseOnNothing_Event
51
=
CurveEvent<Element::Nothing_tag, score::Modifier::Release_tag>
;
52
using
ReleaseOnPoint_Event
53
=
CurveEvent<Element::Point_tag, score::Modifier::Release_tag>
;
54
using
ReleaseOnSegment_Event
55
=
CurveEvent<Element::Segment_tag, score::Modifier::Release_tag>
;
56
}
Curve
Utilities and base classes for 1D curves.
Definition:
FocusDispatcher.hpp:12
Curve::CurveEvent
Definition:
CurvePaletteBaseEvents.hpp:29
Curve::Element::Nothing_tag
Definition:
CurvePaletteBaseEvents.hpp:14
Curve::Element::Point_tag
Definition:
CurvePaletteBaseEvents.hpp:18
Curve::Element::Segment_tag
Definition:
CurvePaletteBaseEvents.hpp:22
score::PositionedEvent
Definition:
StateMachineUtils.hpp:46