Loading...
Searching...
No Matches
IntervalTransitions.hpp
1#pragma once
2#include <Scenario/Palette/ScenarioPaletteBaseTransitions.hpp>
3
4#include <QEvent>
5
6namespace Scenario
7{
8template <typename Scenario_T>
9class Transition_T<Scenario_T, ClickOnInterval> final
10 : public MatchedTransition<Scenario_T, ClickOnInterval_Event>
11{
12public:
13 using MatchedTransition<Scenario_T, ClickOnInterval_Event>::MatchedTransition;
14
15protected:
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};
25template <typename Scenario_T>
27
28template <typename Scenario_T>
29class Transition_T<Scenario_T, MoveOnInterval> final
30 : public MatchedTransition<Scenario_T, MoveOnInterval_Event>
31{
32public:
33 using MatchedTransition<Scenario_T, MoveOnInterval_Event>::MatchedTransition;
34
35protected:
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};
44template <typename Scenario_T>
46
47template <typename Scenario_T>
48class Transition_T<Scenario_T, ClickOnLeftBrace> final
49 : public MatchedTransition<Scenario_T, ClickOnLeftBrace_Event>
50{
51public:
52 using MatchedTransition<Scenario_T, ClickOnLeftBrace_Event>::MatchedTransition;
53
54protected:
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};
64template <typename Scenario_T>
66
67template <typename Scenario_T>
68class Transition_T<Scenario_T, ClickOnRightBrace> final
69 : public MatchedTransition<Scenario_T, ClickOnRightBrace_Event>
70{
71public:
72 using MatchedTransition<Scenario_T, ClickOnRightBrace_Event>::MatchedTransition;
73
74protected:
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};
84template <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:13
Definition ScenarioPaletteBaseEvents.hpp:53