14#include "canvas_info.h"
15#include "document_event.h"
16#include "event_dispatcher.h"
18#include "mission_parameter.h"
20#include "property_info.h"
21#include "transition_info.h"
57 QVector<std::shared_ptr<INode>>
getnodes()
const override;
72 QVector<maki::MissionParameter> missionParameters()
const;
74 QVector<std::pair<QString, QString>> getLinkNodes()
const;
76 void setParameters(
const QVector<maki::MissionParameter>& parameters);
78 maki::MissionParameter getParameter(
int index)
const;
79 void addParameter(
const maki::MissionParameter& parameter);
80 void setParameter(
int index,
const maki::MissionParameter& parameter);
81 void removeParameter(
const maki::MissionParameter& parameter);
87 void addNode(std::shared_ptr<NodeSaveInfo> node);
101 QJsonObject
toJson()
const;
131 QVector<std::shared_ptr<IParameter>>
getPossibleStates(
const QString& nodeId)
const;
138 QVector<std::shared_ptr<NodeSaveInfo>>
getPossibleCallers(
const QString& nodeId,
const Types::ControlTypes type)
const;
145 QVector<std::shared_ptr<FlowSaveInfo>>
getEventsFromNode(
const QString& nodeId)
const;
147 QVector<std::shared_ptr<FlowSaveInfo>> getFlowsFromNode(
const QString& nodeId)
const;
155 QVector<std::shared_ptr<FlowSaveInfo>>
getEventsOfTypeFromNode(
const QString& nodeId,
const QList<Types::CallType>& types)
const;
163 std::shared_ptr<FlowSaveInfo>
getEventFromNode(
const QString& nodeId,
const QString& flowName)
const;
165 std::shared_ptr<FlowSaveInfo> getFlowFromNode(
const QString& nodeId,
const QString& flowName)
const;
172 std::shared_ptr<NodeSaveInfo>
getNodeWithId(
const QString& nodeId);
179 std::shared_ptr<FlowSaveInfo>
getFlowWithId(
const QString& flowId);
186 std::shared_ptr<TransitionSaveInfo>
getTransitionWithId(
const QString& transitionId)
const;
188 QVector<std::shared_ptr<FlowSaveInfo>> pipelines()
const;
190 void addPipeline(std::shared_ptr<FlowSaveInfo> pipeline);
191 void removePipeline(std::shared_ptr<FlowSaveInfo> pipeline);
193 bool taskHasCapability(
const QString& taskId,
const QString& capabilityId)
const;
200 void unblockEvents();
202 void addFlowToNode(
const QString& nodeId, std::shared_ptr<FlowSaveInfo> flow,
const QList<QPointF>& initialNodePositions);
203 void removeFlowFromNode(
const QString& flowId,
const QString& nodeId);
204 void addNodeToFlow(
const QString& flowId, std::shared_ptr<INode> node);
205 void addTransitionToFlow(
const QString& flowId, std::shared_ptr<ITransition> transition);
226 QVector<std::shared_ptr<NodeSaveInfo>>
findFamilyOfFlowNode(
const QString& nodeId,
const QVector<std::shared_ptr<INode>>& nodes,
227 const Types::ControlTypes type)
const;
229 void findChildrenOfTask(
const std::shared_ptr<INode> task, QVector<std::shared_ptr<NodeSaveInfo>>& nodes,
const Types::ControlTypes type)
const;
237 std::shared_ptr<NodeSaveInfo>
findOwnerTaskOfFlowNode(
const QString& nodeId,
const std::shared_ptr<INode> node)
const;
245 QVector<std::shared_ptr<FlowSaveInfo>>
getEventsFromNode(
const QString& nodeId, QVector<std::shared_ptr<INode>> nodes)
const;
247 QVector<std::shared_ptr<FlowSaveInfo>> getFlowsFromNode(
const QString& nodeId, QVector<std::shared_ptr<INode>> nodes)
const;
255 std::shared_ptr<NodeSaveInfo>
getNodeWithId(
const QString& nodeId,
const QVector<std::shared_ptr<INode>>& nodes);
263 std::shared_ptr<FlowSaveInfo>
getFlowWithId(
const QString& flowId,
const QVector<std::shared_ptr<INode>>& nodes);
271 std::shared_ptr<TransitionSaveInfo>
getTransitionWithId(
const QString& transitionId,
const QVector<std::shared_ptr<INode>>& nodes)
const;
Represents information needed to save and load a canvas state.
Definition canvas_info.h:13
Definition event_dispatcher.h:30
Definition event_dispatcher.h:16
QVector< std::shared_ptr< IParameter > > getPossibleStates(const QString &nodeId) const
Get possible states for a node.
Definition save_info.cpp:326
QVector< std::shared_ptr< FlowSaveInfo > > mPipelines
A vector of shared pointers to INode objects representing structural nodes.
Definition save_info.h:215
std::shared_ptr< NodeSaveInfo > findOwnerTaskOfFlowNode(const QString &nodeId, const std::shared_ptr< INode > node) const
Find the parent of a construct.
Definition save_info.cpp:304
QVector< const IParameter * > getparameters() const override
Get all user defined mission parameters.
Definition save_info.cpp:204
static SaveInfo fromJson(const QJsonObject &data)
Create a SaveInfo object from a JSON object.
Definition save_info.cpp:580
std::shared_ptr< EventDispatcher< DocumentEvent > > mScheduler
A vector to the available mission parameters.
Definition save_info.h:218
CanvasSaveInfo canvasInfo() const
Get the canvas save info.
Definition save_info.cpp:30
QJsonObject toJson() const
Convert the object to JSON format.
Definition save_info.cpp:564
QVector< std::shared_ptr< NodeSaveInfo > > getPossibleCallers(const QString &nodeId, const Types::ControlTypes type) const
Get possible callers for a node.
Definition save_info.cpp:345
std::shared_ptr< NodeSaveInfo > getNodeWithId(const QString &nodeId)
Get a node by ID.
Definition save_info.cpp:435
QVector< std::shared_ptr< NodeSaveInfo > > findFamilyOfFlowNode(const QString &nodeId, const QVector< std::shared_ptr< INode > > &nodes, const Types::ControlTypes type) const
Find the family of a construct.
Definition save_info.cpp:262
QVector< std::shared_ptr< FlowSaveInfo > > getEventsFromNode(const QString &nodeId) const
Get events from a node.
Definition save_info.cpp:351
QVector< maki::MissionParameter > mMissionParameters
A vector of shared pointers to IFlow objects representing the available pipelines.
Definition save_info.h:216
QVector< std::shared_ptr< FlowSaveInfo > > getEventsOfTypeFromNode(const QString &nodeId, const QList< Types::CallType > &types) const
Get events of a specific type from a node.
Definition save_info.cpp:377
std::shared_ptr< FlowSaveInfo > getEventFromNode(const QString &nodeId, const QString &flowName) const
Get an event from a node by name.
Definition save_info.cpp:415
std::shared_ptr< FlowSaveInfo > getFlowWithId(const QString &flowId)
Get a flow by ID.
Definition save_info.cpp:464
friend QDataStream & operator>>(QDataStream &in, SaveInfo &info)
Deserialize the object from a QDataStream.
Definition save_info.cpp:602
QVector< std::shared_ptr< INode > > mStructuralNodes
The canvas save info.
Definition save_info.h:214
const koda::types::TypeRegistry * getTypesRegistry() const override
Get MAKI's type registry.
Definition save_info.cpp:199
void removeNode(const QString &nodeId)
Remove a node.
Definition save_info.cpp:155
friend QDataStream & operator<<(QDataStream &out, const SaveInfo &info)
Serialize the object to a QDataStream.
Definition save_info.cpp:594
void addNode(std::shared_ptr< NodeSaveInfo > node)
Add a node.
Definition save_info.cpp:137
void setCanvasInfo(const CanvasSaveInfo &info)
Set the canvas save info.
Definition save_info.cpp:35
QVector< std::shared_ptr< INode > > getnodes() const override
Get all nodes.
Definition save_info.cpp:194
std::shared_ptr< TransitionSaveInfo > getTransitionWithId(const QString &transitionId) const
Get a transition by ID.
Definition save_info.cpp:485
SaveInfo()=default
Default constructor.
Definition document_event.h:49