2 #include <Process/ExpandMode.hpp>
3 #include <Process/TimeValue.hpp>
5 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
6 #include <Scenario/Document/BaseScenario/BaseScenario.hpp>
7 #include <Scenario/Document/Event/EventModel.hpp>
8 #include <Scenario/Document/TimeSync/TimeSyncModel.hpp>
9 #include <Scenario/Process/Algorithms/ProcessPolicy.hpp>
10 #include <Scenario/Process/Algorithms/StandardDisplacementPolicy.hpp>
11 #include <Scenario/Tools/dataStructures.hpp>
13 #include <score/command/Command.hpp>
14 #include <score/model/Identifier.hpp>
15 #include <score/model/path/Path.hpp>
16 #include <score/model/path/PathSerialization.hpp>
17 #include <score/tools/Unused.hpp>
28 template <
typename SimpleScenario_T>
32 template <
typename ScaleFun>
33 static void updateDuration(
34 SimpleScenario_T& scenar,
const TimeVal& newDuration, ScaleFun&& scaleMethod)
36 scenar.endEvent().setDate(newDuration);
37 scenar.endTimeSync().setDate(newDuration);
39 auto& interval = scenar.interval();
40 IntervalDurations::Algorithms::changeAllDurations(interval, newDuration);
41 for(
auto& process : interval.processes)
43 scaleMethod(process, newDuration);
50 return ::CommandFactoryName<SimpleScenario_T>();
52 const CommandKey& key()
const noexcept
override {
return static_key(); }
53 QString description()
const override
55 return QObject::tr(
"Move a %1 event")
69 double y, ExpandMode mode, LockMode)
75 m_oldDate = interval.duration.defaultDuration();
88 auto& scenar = m_path.find(ctx);
105 auto& interval = scenar.interval();
106 m_saveData.reload(interval);
111 auto& scenar = m_path.find(ctx);
133 s << m_path << m_oldDate << m_newDate << (int)m_mode << m_saveData;
138 s >> m_path >> m_oldDate >> m_newDate >> mode >> m_saveData;
139 m_mode =
static_cast<ExpandMode
>(mode);
148 ExpandMode m_mode{ExpandMode::Scale};
155 SCORE_COMMAND_DECL_T(MoveBaseEvent<Scenario::BaseScenario>)
The Process class.
Definition: score-lib-process/Process/Process.hpp:61
void setParentDuration(ExpandMode mode, const TimeVal &t) noexcept
Definition: score-lib-process/Process/Process.cpp:123
The ClearInterval class.
Definition: ClearInterval.hpp:27
Definition: MoveBaseEvent.hpp:30
Definition: IntervalModel.hpp:50
The id_base_t class.
Definition: Identifier.hpp:57
The Command class.
Definition: Command.hpp:34
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Definition: DataStreamHelpers.hpp:103
Definition: dataStructures.hpp:40
Definition: TimeValue.hpp:21
Definition: DocumentContext.hpp:18