32class RA_DATAFLOW_GUI_API
GraphModel :
public QtNodes::AbstractGraphModel
34 using ConnectionId = QtNodes::ConnectionId;
35 using ConnectionPolicy = QtNodes::ConnectionPolicy;
36 using NodeFlag = QtNodes::NodeFlag;
37 using NodeId = QtNodes::NodeId;
38 using NodeRole = QtNodes::NodeRole;
39 using PortIndex = QtNodes::PortIndex;
40 using PortRole = QtNodes::PortRole;
41 using PortType = QtNodes::PortType;
42 using StyleCollection = QtNodes::StyleCollection;
46 struct NodeGeometryData {
61 connections( NodeId nodeId, PortType portType, PortIndex portIndex )
const override;
63 bool connectionExists( ConnectionId
const connectionId )
const override;
65 void addInputOutputNodesForGraph();
66 NodeId addNode( QString
const nodeType = QString() )
override;
72 bool connectionPossible( ConnectionId
const connectionId )
const override;
74 void addConnection( ConnectionId
const connectionId )
override;
76 bool nodeExists( NodeId
const nodeId )
const override;
79 QVariant nodeData( NodeId nodeId, NodeRole role )
const override;
81 bool setNodeData( NodeId nodeId, NodeRole role, QVariant value )
override;
84 portData( NodeId nodeId, PortType portType, PortIndex portIndex, PortRole role )
const override;
86 bool setPortData( NodeId nodeId,
89 QVariant
const& value,
90 PortRole role = PortRole::Data )
override;
92 bool deleteConnection( ConnectionId
const connectionId )
override;
94 bool deleteNode( NodeId
const nodeId )
override;
96 NodeId newNodeId()
override {
return m_next_node_id++; }
98 void loadNode( QJsonObject
const& nodeJson )
override;
99 QJsonObject saveNode( NodeId
const )
const override;
106 return m_node_id_to_ptr.at( node_id );
125 NodeId m_next_node_id;
127 void fill_factory_map();