MergeEvents.hpp
1 #pragma once
2 
3 #include "MergeTimeSyncs.hpp"
4 
5 #include <Scenario/Commands/Scenario/Displacement/MoveEvent.hpp>
6 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
7 #include <Scenario/Document/Event/EventModel.hpp>
8 #include <Scenario/Process/Algorithms/GoodOldDisplacementPolicy.hpp>
9 #include <Scenario/Process/Algorithms/StandardDisplacementPolicy.hpp>
10 #include <Scenario/Process/ScenarioModel.hpp>
11 
12 #include <score/command/AggregateCommand.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>
18 #include <score/tools/Unused.hpp>
19 
20 namespace Scenario
21 {
22 
23 namespace Command
24 {
25 class SCORE_PLUGIN_SCENARIO_EXPORT MergeEvents final : public score::Command
26 {
27  SCORE_COMMAND_DECL(CommandFactoryName(), MergeEvents, "Merge events")
28 public:
30  const ProcessModel& scenario, Id<EventModel> clickedEv, Id<EventModel> hoveredEv);
31 
32  void undo(const score::DocumentContext& ctx) const override;
33  void redo(const score::DocumentContext& ctx) const override;
34  void update(unused_t, const Id<EventModel>&, const Id<EventModel>&);
35 
36 protected:
37  void serializeImpl(DataStreamInput& s) const override;
38  void deserializeImpl(DataStreamOutput& s) override;
39 
40 private:
41  Path<ProcessModel> m_scenarioPath;
42  Id<EventModel> m_movingEventId;
43  Id<EventModel> m_destinationEventId;
44 
45  QByteArray m_serializedEvent;
46  MergeTimeSyncs* m_mergeTimeSyncsCommand{};
47 };
48 
50 {
51  SCORE_COMMAND_DECL(CommandFactoryName(), MergeEventMacro, "Merge events")
52 };
53 }
54 }
Definition: MergeEvents.hpp:50
Definition: MergeEvents.hpp:26
Definition: MergeTimeSyncs.hpp:27
The core hierarchical and temporal process of score.
Definition: ScenarioModel.hpp:37
The id_base_t class.
Definition: Identifier.hpp:57
Allows for grouping of multiple commands in a single one.
Definition: AggregateCommand.hpp:15
The Command class.
Definition: Command.hpp:34
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Definition: DataStreamHelpers.hpp:99
Definition: DataStreamHelpers.hpp:103
Definition: DocumentContext.hpp:18
Definition: Unused.hpp:3