Loading...
Searching...
No Matches
TimeSyncTransitions.hpp
1#pragma once
2#include <Scenario/Palette/ScenarioPaletteBaseTransitions.hpp>
3#include <Scenario/Process/ScenarioInterface.hpp>
4namespace Scenario
5{
6template <typename Scenario_T>
7class Transition_T<Scenario_T, ClickOnTimeSync> final
8 : public MatchedTransition<Scenario_T, ClickOnTimeSync_Event>
9{
10public:
11 using MatchedTransition<Scenario_T, ClickOnTimeSync_Event>::MatchedTransition;
12
13protected:
14 void onTransition(QEvent* ev) override
15 {
16 auto qev = static_cast<ClickOnTimeSync_Event*>(ev);
17 this->state().clear();
18
19 this->state().clickedTimeSync = qev->id;
20 this->state().currentPoint = qev->point;
21 }
22};
23template <typename Scenario_T>
25
26template <typename Scenario_T>
28 : public MatchedTransition<Scenario_T, ClickOnTimeSync_Event>
29{
30public:
31 using MatchedTransition<Scenario_T, ClickOnTimeSync_Event>::MatchedTransition;
32
33protected:
34 bool eventTest(QEvent* e) override
35 {
36 if(e->type() == QEvent::Type(QEvent::User + ClickOnTimeSync_Event::user_type))
37 {
38 auto qev = static_cast<ClickOnTimeSync_Event*>(e);
39 return qev->id == Scenario::endId<TimeSyncModel>();
40 }
41 return false;
42 }
43
44 void onTransition(QEvent* ev) override
45 {
46 auto qev = static_cast<ClickOnTimeSync_Event*>(ev);
47 this->state().clear();
48
49 this->state().clickedTimeSync = qev->id;
50 this->state().currentPoint = qev->point;
51 }
52};
53
54template <typename Scenario_T>
55class Transition_T<Scenario_T, MoveOnTimeSync> final
56 : public MatchedTransition<Scenario_T, MoveOnTimeSync_Event>
57{
58public:
59 using MatchedTransition<Scenario_T, MoveOnTimeSync_Event>::MatchedTransition;
60
61protected:
62 void onTransition(QEvent* ev) override
63 {
64 auto qev = static_cast<MoveOnTimeSync_Event*>(ev);
65
66 this->state().hoveredTimeSync = qev->id;
67 this->state().currentPoint = qev->point;
68 }
69};
70template <typename Scenario_T>
72
73template <typename Scenario_T>
74class Transition_T<Scenario_T, ReleaseOnTimeSync> final
75 : public MatchedTransition<Scenario_T, ReleaseOnTimeSync_Event>
76{
77public:
78 using MatchedTransition<Scenario_T, ReleaseOnTimeSync_Event>::MatchedTransition;
79
80protected:
81 void onTransition(QEvent* ev) override
82 {
83 auto qev = static_cast<ReleaseOnTimeSync_Event*>(ev);
84
85 this->state().hoveredTimeSync = qev->id;
86 this->state().currentPoint = qev->point;
87 }
88};
89template <typename Scenario_T>
91}
Definition TimeSyncTransitions.hpp:29
Definition ScenarioPaletteBaseTransitions.hpp:15
Definition TimeSyncTransitions.hpp:9
Definition TimeSyncTransitions.hpp:57
Definition TimeSyncTransitions.hpp:76
Definition ScenarioPaletteBaseTransitions.hpp:23
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13
Definition ScenarioPaletteBaseEvents.hpp:53