Loading...
Searching...
No Matches
CreateInterval.hpp
1#pragma once
2#include <Scenario/Commands/ScenarioCommandFactory.hpp>
3
4#include <score/command/Command.hpp>
5#include <score/model/Identifier.hpp>
6#include <score/model/path/Path.hpp>
7#include <score/tools/std/Optional.hpp>
8
9#include <QString>
10
11#include <score_plugin_scenario_export.h>
12struct DataStreamInput;
13struct DataStreamOutput;
14namespace Process
15{
16class Cable;
17}
18namespace Scenario
19{
20class StateModel;
21class IntervalModel;
22class ProcessModel;
23
24namespace Command
25{
32class SCORE_PLUGIN_SCENARIO_EXPORT CreateInterval final : public score::Command
33{
34 SCORE_COMMAND_DECL(CommandFactoryName(), CreateInterval, "Create an interval")
35public:
37 const Scenario::ProcessModel& scenarioPath, Id<StateModel> startState,
38 Id<StateModel> endState, bool graphal = false);
39 CreateInterval& operator=(CreateInterval&&) = default;
40
41 const Path<Scenario::ProcessModel>& scenarioPath() const { return m_path; }
42
43 void undo(const score::DocumentContext& ctx) const override;
44 void redo(const score::DocumentContext& ctx) const override;
45
46 const Id<IntervalModel>& createdInterval() const { return m_createdIntervalId; }
47
48 const Id<StateModel>& startState() const { return m_startStateId; }
49
50protected:
51 void serializeImpl(DataStreamInput&) const override;
52 void deserializeImpl(DataStreamOutput&) override;
53
54private:
56 QString m_createdName;
57
58 Id<IntervalModel> m_createdIntervalId{};
59
60 Id<StateModel> m_startStateId{};
61 Id<StateModel> m_endStateId{};
62 double m_startStatePos{-1};
63 double m_endStatePos{-1};
64 bool m_graphal{};
65};
66}
67}
The Path class is a typesafe wrapper around ObjectPath.
Definition Path.hpp:52
The CreateEventAfterEventCommand class.
Definition CreateInterval.hpp:33
The core hierarchical and temporal process of score.
Definition ScenarioModel.hpp:37
The id_base_t class.
Definition Identifier.hpp:57
The Command class.
Definition Command.hpp:34
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1116
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13
Definition DataStreamHelpers.hpp:99
Definition DataStreamHelpers.hpp:103
Definition DocumentContext.hpp:18