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 {
14 {
15  static constexpr const int value = 0;
16 };
17 struct Point_tag
18 {
19  static constexpr const int value = 1;
20 };
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 
45 
49 
56 }
Utilities and base classes for 1D curves.
Definition: FocusDispatcher.hpp:12
Definition: CurvePaletteBaseEvents.hpp:29
Definition: CurvePaletteBaseEvents.hpp:14
Definition: CurvePaletteBaseEvents.hpp:18
Definition: CurvePaletteBaseEvents.hpp:22
Definition: StateMachineUtils.hpp:46