ScenarioPasteElementsAfter.hpp
1 #pragma once
2 #include <Process/Dataflow/Cable.hpp>
3 
4 #include <Scenario/Application/Menus/ScenarioCopy.hpp>
5 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
6 
7 #include <score/command/Command.hpp>
8 #include <score/model/Identifier.hpp>
9 #include <score/model/path/Path.hpp>
10 #include <score/selection/Selection.hpp>
11 #include <score/tools/std/Optional.hpp>
12 
13 #include <ossia/detail/flat_map.hpp>
14 #include <ossia/detail/json.hpp>
15 
16 namespace Scenario
17 {
18 struct Point;
19 class EventModel;
20 class StateModel;
21 class TimeSyncModel;
22 class IntervalModel;
23 namespace Command
24 {
25 class SCORE_PLUGIN_SCENARIO_EXPORT ScenarioPasteElementsAfter final
26  : public score::Command
27 {
28  SCORE_COMMAND_DECL(
29  CommandFactoryName(), ScenarioPasteElementsAfter, "Paste elements after sync")
30 public:
32  const Scenario::ProcessModel& path, const Scenario::TimeSyncModel& attach_sync,
33  const rapidjson::Value& obj, double scale);
34 
35  void undo(const score::DocumentContext& ctx) const override;
36  void redo(const score::DocumentContext& ctx) const override;
37 
38 protected:
39  void serializeImpl(DataStreamInput&) const override;
40  void deserializeImpl(DataStreamOutput&) override;
41 
42 private:
44  Id<TimeSyncModel> m_attachSync;
45  std::vector<Id<EventModel>> m_eventsToAttach;
46 
47  // TODO std::vector...
48  std::vector<Id<TimeSyncModel>> m_ids_timesyncs;
49  std::vector<Id<IntervalModel>> m_ids_intervals;
50  std::vector<Id<EventModel>> m_ids_events;
51  std::vector<Id<StateModel>> m_ids_states;
52 
53  std::vector<QByteArray> m_json_timesyncs;
54  std::vector<QByteArray> m_json_intervals;
55  std::vector<QByteArray> m_json_events;
56  std::vector<QByteArray> m_json_states;
57 
58  CopiedCables m_cables;
59 };
60 }
61 }
Definition: ScenarioPasteElementsAfter.hpp:27
The core hierarchical and temporal process of score.
Definition: ScenarioModel.hpp:37
Definition: TimeSyncModel.hpp:35
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:99
Definition: DataStreamHelpers.hpp:103
Definition: ScenarioCopy.hpp:87
Definition: DocumentContext.hpp:18