IntervalTransitions.hpp
1 #pragma once
2 #include <Scenario/Palette/ScenarioPaletteBaseTransitions.hpp>
3 
4 #include <QEvent>
5 
6 namespace Scenario
7 {
8 template <typename Scenario_T>
9 class Transition_T<Scenario_T, ClickOnInterval> final
10  : public MatchedTransition<Scenario_T, ClickOnInterval_Event>
11 {
12 public:
14 
15 protected:
16  void onTransition(QEvent* ev) override
17  {
18  auto qev = static_cast<ClickOnInterval_Event*>(ev);
19  this->state().clear();
20 
21  this->state().clickedInterval = qev->id;
22  this->state().currentPoint = qev->point;
23  }
24 };
25 template <typename Scenario_T>
27 
28 template <typename Scenario_T>
29 class Transition_T<Scenario_T, MoveOnInterval> final
30  : public MatchedTransition<Scenario_T, MoveOnInterval_Event>
31 {
32 public:
34 
35 protected:
36  void onTransition(QEvent* ev) override
37  {
38  auto qev = static_cast<MoveOnInterval_Event*>(ev);
39 
40  this->state().hoveredInterval = qev->id;
41  this->state().currentPoint = qev->point;
42  }
43 };
44 template <typename Scenario_T>
46 
47 template <typename Scenario_T>
48 class Transition_T<Scenario_T, ClickOnLeftBrace> final
49  : public MatchedTransition<Scenario_T, ClickOnLeftBrace_Event>
50 {
51 public:
53 
54 protected:
55  void onTransition(QEvent* ev) override
56  {
57  auto qev = static_cast<ClickOnLeftBrace_Event*>(ev);
58  this->state().clear();
59 
60  this->state().clickedInterval = qev->id;
61  this->state().currentPoint = qev->point;
62  }
63 };
64 template <typename Scenario_T>
66 
67 template <typename Scenario_T>
68 class Transition_T<Scenario_T, ClickOnRightBrace> final
69  : public MatchedTransition<Scenario_T, ClickOnRightBrace_Event>
70 {
71 public:
73 
74 protected:
75  void onTransition(QEvent* ev) override
76  {
77  auto qev = static_cast<ClickOnRightBrace_Event*>(ev);
78  this->state().clear();
79 
80  this->state().clickedInterval = qev->id;
81  this->state().currentPoint = qev->point;
82  }
83 };
84 template <typename Scenario_T>
86 
87 } // namespace Scenario
Definition: ScenarioPaletteBaseTransitions.hpp:15
Definition: IntervalTransitions.hpp:11
Definition: IntervalTransitions.hpp:50
Definition: IntervalTransitions.hpp:70
Definition: IntervalTransitions.hpp:31
Definition: ScenarioPaletteBaseTransitions.hpp:23
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Definition: ScenarioPaletteBaseEvents.hpp:53