RemoveSelection.hpp
1 #pragma once
2 #include <Scenario/Commands/Event/SplitEvent.hpp>
3 #include <Scenario/Commands/Interval/SetRigidity.hpp>
4 #include <Scenario/Commands/ScenarioCommandFactory.hpp>
5 #include <Scenario/Commands/TimeSync/SplitTimeSync.hpp>
6 
7 #include <Dataflow/Commands/CableHelpers.hpp>
8 
9 #include <score/command/Command.hpp>
10 #include <score/model/Identifier.hpp>
11 #include <score/model/path/Path.hpp>
12 #include <score/selection/Selection.hpp>
13 #include <score/tools/std/Optional.hpp>
14 
15 #include <QByteArray>
16 #include <QPair>
17 #include <QVector>
18 
19 struct DataStreamInput;
20 struct DataStreamOutput;
21 
22 namespace Scenario
23 {
24 class IntervalModel;
25 class EventModel;
26 class StateModel;
27 class TimeSyncModel;
28 class CommentBlockModel;
29 class ProcessModel;
30 namespace Command
31 {
37 class SCORE_PLUGIN_SCENARIO_EXPORT RemoveSelection final : public score::Command
38 {
39  SCORE_COMMAND_DECL(CommandFactoryName(), RemoveSelection, "Remove selected elements")
40 public:
42 
43  void undo(const score::DocumentContext& ctx) const override;
44  void redo(const score::DocumentContext& ctx) const override;
45 
46 protected:
47  void serializeImpl(DataStreamInput&) const override;
48  void deserializeImpl(DataStreamOutput&) override;
49 
50 private:
52 
53  std::vector<std::pair<Id<CommentBlockModel>, QByteArray>> m_removedComments;
54  std::vector<std::pair<Id<StateModel>, QByteArray>> m_removedStates;
55  std::vector<std::pair<Id<EventModel>, QByteArray>> m_cleanedEvents;
56  std::vector<std::pair<Id<TimeSyncModel>, QByteArray>> m_cleanedTimeSyncs;
57  std::vector<std::pair<Id<IntervalModel>, QByteArray>> m_removedIntervals;
58  std::vector<SetRigidity> m_cmds_set_rigidity;
59  Dataflow::SerializedCables m_cables;
60 };
61 }
62 }
The RemoveSelection class.
Definition: RemoveSelection.hpp:38
The core hierarchical and temporal process of score.
Definition: ScenarioModel.hpp:37
Definition: Selection.hpp:12
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