ScenarioCopy.hpp
1 #pragma once
2 #include <Process/Dataflow/Cable.hpp>
3 
4 #include <score/serialization/JSONVisitor.hpp>
5 
6 #include <ossia/detail/flat_map.hpp>
7 
8 #include <score_plugin_scenario_export.h>
9 
10 #include <vector>
11 
12 class QJsonObject;
13 class QObject;
14 class Selection;
15 namespace score
16 {
17 struct DocumentContext;
18 }
19 namespace Process
20 {
21 class ProcessModel;
22 }
23 
24 namespace Scenario
25 {
26 class IntervalModel;
27 class ProcessModel;
28 class EventModel;
29 class StateModel;
30 class TimeSyncModel;
31 
32 class ScenarioInterface;
33 class BaseScenario;
34 class BaseScenarioContainer;
35 
36 struct SCORE_PLUGIN_SCENARIO_EXPORT CategorisedScenario
37 {
42  CategorisedScenario(const Selection& sm);
43 
44  std::vector<const IntervalModel*> selectedIntervals;
45  std::vector<const EventModel*> selectedEvents;
46  std::vector<const StateModel*> selectedStates;
47  std::vector<const TimeSyncModel*> selectedTimeSyncs;
48 };
49 
50 void copyBaseInterval(JSONReader&, const IntervalModel&);
51 
52 SCORE_PLUGIN_SCENARIO_EXPORT
53 void copySelectedScenarioElements(JSONReader&, const Scenario::ProcessModel& sm);
54 
55 SCORE_PLUGIN_SCENARIO_EXPORT
56 void copyWholeScenario(JSONReader&, const Scenario::ProcessModel& sm);
57 
58 SCORE_PLUGIN_SCENARIO_EXPORT
59 void copySelectedScenarioElements(
61 
75 // QJsonObject copySelectedScenarioElements(
76 // const BaseScenario& sm,
77 // QObject* parent);
78 void copySelectedScenarioElements(
79  JSONReader&, const BaseScenarioContainer& sm, QObject* parent);
80 
81 bool copySelectedProcesses(JSONReader&, const score::DocumentContext& ctx);
82 
83 void copySelectedElementsToJson(
85 
87 {
88  ossia::flat_map<Id<Process::Cable>, Process::CableData> cables;
89 
90  void undo(const score::DocumentContext& ctx) const;
91  void redo(const score::DocumentContext& ctx) const;
92 };
93 }
Definition: JSONVisitor.hpp:52
Definition: BaseScenarioContainer.hpp:26
Definition: IntervalModel.hpp:50
The core hierarchical and temporal process of score.
Definition: ScenarioModel.hpp:37
Definition: ScenarioInterface.hpp:20
Definition: Selection.hpp:12
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: Cable.hpp:45
Definition: ScenarioCopy.hpp:37
Definition: ScenarioCopy.hpp:87
Definition: DocumentContext.hpp:18