10#include "property_info.h"
24 void print(
const QString& indent =
"")
const;
30 QString
getid()
const override;
54 QVector<std::shared_ptr<IParameter>>
getfields()
const override;
60 QVector<std::shared_ptr<IParameter>>
getproperties()
const override;
62 std::shared_ptr<IParameter> getproperty(
const QString& key)
const;
68 QVector<std::shared_ptr<IFlow>>
getflows()
const override;
74 QVector<std::shared_ptr<IFlow>>
getevents()
const override;
86 QVector<std::shared_ptr<INode>>
getchildren()
const override;
110 void setId(
const QString& arg);
134 void setIcon(
const QString& iconPath);
140 void setSize(
const QSizeF& arg);
160 void addProperty(std::shared_ptr<PropertyInfo> parameter);
167 void setProperty(
const QString& key,
const maki::Value& parameter);
187 void setField(
const QString& key, std::shared_ptr<IParameter> property);
193 void addField(std::shared_ptr<IParameter> property);
202 QVector<PortConfig> ports()
const;
204 QString getParentSubFlow()
const;
205 void setParentSubFlow(
const QString& subFlowId);
210 void addFlow(std::shared_ptr<IFlow> flow);
222 void addEvent(std::shared_ptr<IFlow> event);
234 void addChild(std::shared_ptr<INode> child);
251 QJsonObject
toJson()
const;
260 friend QDataStream& operator<<(QDataStream& out,
const NodeSaveInfo& info);
261 friend QDataStream& operator>>(QDataStream& in,
NodeSaveInfo& info);
264 friend class DocumentCloner;
292QDataStream& operator<<(QDataStream& out,
const QVector<std::shared_ptr<INode>>& nodes);
300QDataStream& operator>>(QDataStream& in, QVector<std::shared_ptr<INode>>& nodes);
308QDataStream& operator<<(QDataStream& out,
const QVector<std::shared_ptr<NodeSaveInfo>>& nodes);
316QDataStream& operator>>(QDataStream& in, QVector<std::shared_ptr<NodeSaveInfo>>& nodes);
318typedef std::shared_ptr<NodeSaveInfo> PNodeSaveInfo;
Configuration for a node.
Definition config.h:236
void removeEvent(std::shared_ptr< IFlow > event)
Removes a flow from the node by reference.
Definition node_info.cpp:315
const PropertyInfo * getProperty(const QString &key) const
Gets a property by key.
Definition node_info.cpp:196
void setProperty(const QString &key, const maki::Value ¶meter)
Sets a property to the node.
Definition node_info.cpp:213
QPointF getposition() const override
Gets the position of the node.
Definition node_info.cpp:107
QString getIcon() const
Gets the icon path of the node.
Definition node_info.cpp:122
void setParentId(const QString &arg)
Sets the parent ID of the node.
Definition node_info.cpp:171
void removeFlow(const QString &flowId)
Removes a flow from the node by ID.
Definition node_info.cpp:289
QVector< std::shared_ptr< IFlow > > mFlows
A vector of children nodes.
Definition node_info.h:279
void removeProperty(const QString &key)
Removes a property from the node.
Definition node_info.cpp:234
void removeField(const QString &key)
Removes a field from the node.
Definition node_info.cpp:274
QString mParentSubFlow
The parent ID of the node.
Definition node_info.h:269
QString getNodeName() const
Gets the node name.
Definition node_info.cpp:94
NodeSaveInfo()
Constructs a new NodeSaveInfo object.
Definition node_info.cpp:18
QVector< std::shared_ptr< IParameter > > getproperties() const override
Gets the properties of the node.
Definition node_info.cpp:132
static NodeSaveInfo fromJson(const QJsonObject &data)
Creates a NodeSaveInfo object from a JSON object.
Definition node_info.cpp:412
void addFlow(std::shared_ptr< IFlow > flow)
Adds a flow to the node.
Definition node_info.cpp:279
QPointF mPosition
The subflow ID of this node.
Definition node_info.h:271
void addField(std::shared_ptr< IParameter > property)
Adds a field to the node.
Definition node_info.cpp:269
QSizeF getSize() const
Gets the size of the node.
Definition node_info.cpp:117
void setNodeId(const QString &arg)
Sets the node ID.
Definition node_info.cpp:166
PropertyInfo getField(const QString &key) const
Gets a field by key.
Definition node_info.cpp:244
void setScale(qreal arg)
Sets the scale of the node.
Definition node_info.cpp:191
QVector< std::shared_ptr< INode > > mChildren
A vector of properties for the node.
Definition node_info.h:278
qreal getScale() const
Gets the scale of the node.
Definition node_info.cpp:112
QVector< std::shared_ptr< IParameter > > mProperties
The icon path of the node.
Definition node_info.h:277
void addEvent(std::shared_ptr< IFlow > event)
Adds a flow to the node.
Definition node_info.cpp:310
void setId(const QString &arg)
Sets the ID of the node.
Definition node_info.cpp:161
void addChild(std::shared_ptr< INode > child)
Adds a child to the node.
Definition node_info.cpp:320
QVector< std::shared_ptr< IFlow > > getevents() const override
Gets the events of the node.
Definition node_info.cpp:151
void setIcon(const QString &iconPath)
Sets the icon path of the node.
Definition node_info.cpp:181
void addProperty(std::shared_ptr< PropertyInfo > parameter)
Adds a property to the node.
Definition node_info.cpp:205
QString getnodeId() const override
Gets the node ID.
Definition node_info.cpp:89
qreal mScale
The size of the node.
Definition node_info.h:273
void setField(const QString &key, std::shared_ptr< IParameter > property)
Sets a field for the node.
Definition node_info.cpp:253
QString getid() const override
Gets the ID of the node.
Definition node_info.cpp:84
void setSize(const QSizeF &arg)
Sets the size of the node.
Definition node_info.cpp:186
QSizeF mSize
The position of the node.
Definition node_info.h:272
QString mParentId
The node ID.
Definition node_info.h:268
QString mNodeId
The ID of the node.
Definition node_info.h:267
void setPosition(const QPointF &arg)
Sets the position of the node.
Definition node_info.cpp:176
QVector< std::shared_ptr< IFlow > > getflows() const override
Gets the flows of the node.
Definition node_info.cpp:146
QVector< std::shared_ptr< ITransition > > mTransitions
A vector of flows associated with the node.
Definition node_info.h:281
QVector< std::shared_ptr< IParameter > > getfields() const override
Gets the fields of the node.
Definition node_info.cpp:127
QVector< std::shared_ptr< INode > > getchildren() const override
Gets the children of the node.
Definition node_info.cpp:156
QVector< std::shared_ptr< IParameter > > mFields
A vector of transitions for the node.
Definition node_info.h:282
QVector< PortConfig > mPorts
A vector of fields for the node.
Definition node_info.h:283
QVector< std::shared_ptr< IFlow > > mEvents
A vector of flows associated with the node.
Definition node_info.h:280
QJsonObject toJson() const
Converts the node to a JSON object.
Definition node_info.cpp:357
QString mIconPath
The scale of the node.
Definition node_info.h:275
void removeChild(const QString &childId)
Removes a child from the node by ID.
Definition node_info.cpp:325
QString getparentId() const override
Gets the parent ID of the node.
Definition node_info.cpp:102
void clearChildren()
Clears all children from the node.
Definition node_info.cpp:330
Configuration for port information.
Definition config.h:147
Represents a property with configuration and options.
Definition property_info.h:16