2#include "CurvePaletteBaseStates.hpp"
3#include "CurvePoint.hpp"
5#include <Curve/Point/CurvePointModel.hpp>
6#include <Curve/Point/CurvePointView.hpp>
7#include <Curve/Segment/CurveSegmentModel.hpp>
8#include <Curve/Segment/CurveSegmentView.hpp>
10#include <score/statemachine/StateMachineUtils.hpp>
11#include <score/tools/Clamp.hpp>
12#include <score/tools/SafeCast.hpp>
22 static constexpr const int value = 0;
26 static constexpr const int value = 1;
30 static constexpr const int value = 2;
34template <
typename Element_T,
typename Modifier_T>
37 static constexpr const int user_type = Element_T::value + Modifier_T::value;
40 CurveEvent(
const Curve::Point& pt,
const QGraphicsItem* item)
41 :
score::PositionedEvent<
Curve::Point>{pt, QEvent::Type(QEvent::User + user_type)}
43 if constexpr(std::is_same_v<Element_T, Element::Point_tag>)
45 auto& m = safe_cast<const PointView*>(item)->model();
46 pointId = {m.previous(), m.following()};
48 else if constexpr(std::is_same_v<Element_T, Element::Segment_tag>)
50 segmentId = safe_cast<const SegmentView*>(item)->model().id();
58using ClickOnNothing_Event
59 = CurveEvent<Element::Nothing_tag, score::Modifier::Click_tag>;
60using ClickOnPoint_Event = CurveEvent<Element::Point_tag, score::Modifier::Click_tag>;
61using ClickOnSegment_Event
62 = CurveEvent<Element::Segment_tag, score::Modifier::Click_tag>;
64using MoveOnNothing_Event = CurveEvent<Element::Nothing_tag, score::Modifier::Move_tag>;
65using MoveOnPoint_Event = CurveEvent<Element::Point_tag, score::Modifier::Move_tag>;
66using MoveOnSegment_Event = CurveEvent<Element::Segment_tag, score::Modifier::Move_tag>;
68using ReleaseOnNothing_Event
69 = CurveEvent<Element::Nothing_tag, score::Modifier::Release_tag>;
70using ReleaseOnPoint_Event
71 = CurveEvent<Element::Point_tag, score::Modifier::Release_tag>;
72using ReleaseOnSegment_Event
73 = CurveEvent<Element::Segment_tag, score::Modifier::Release_tag>;
The id_base_t class.
Definition Identifier.hpp:59
Utilities and base classes for 1D curves.
Definition FocusDispatcher.hpp:12
Base toolkit upon which the software is built.
Definition Application.cpp:83
Definition CurvePaletteBaseEvents.hpp:36
CurveEvent(const Curve::Point &pt, const QGraphicsItem *item)
Definition CurvePaletteBaseEvents.hpp:40
Definition CurvePaletteBaseEvents.hpp:21
Definition CurvePaletteBaseEvents.hpp:25
Definition CurvePaletteBaseEvents.hpp:29
Definition StateMachineUtils.hpp:46