Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.28
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Ra::Dataflow::QtGui::GraphEditor::GraphModel Class Reference

#include <Dataflow/QtGui/GraphEditor/GraphModel.hpp>

+ Collaboration diagram for Ra::Dataflow::QtGui::GraphEditor::GraphModel:

Signals

void node_edited (std::shared_ptr< Core::Node > node)
 

Public Member Functions

 GraphModel (std::shared_ptr< Core::DataflowGraph > graph)
 
std::unordered_set< NodeId > allNodeIds () const override
 
std::unordered_set< ConnectionId > allConnectionIds (NodeId const nodeId) const override
 
std::unordered_set< ConnectionId > connections (NodeId nodeId, PortType portType, PortIndex portIndex) const override
 
bool connectionExists (ConnectionId const connectionId) const override
 
void addInputOutputNodesForGraph ()
 
NodeId addNode (QString const nodeType=QString()) override
 
bool connectionPossible (ConnectionId const connectionId) const override
 
void addConnection (ConnectionId const connectionId) override
 
bool nodeExists (NodeId const nodeId) const override
 
QWidget * getWidget (std::shared_ptr< Core::Node > node) const
 
QVariant nodeData (NodeId nodeId, NodeRole role) const override
 
bool setNodeData (NodeId nodeId, NodeRole role, QVariant value) override
 
QVariant portData (NodeId nodeId, PortType portType, PortIndex portIndex, PortRole role) const override
 
bool setPortData (NodeId nodeId, PortType portType, PortIndex portIndex, QVariant const &value, PortRole role=PortRole::Data) override
 
bool deleteConnection (ConnectionId const connectionId) override
 
bool deleteNode (NodeId const nodeId) override
 
NodeId newNodeId () override
 
void loadNode (QJsonObject const &nodeJson) override
 needed for undo/redo
 
QJsonObject saveNode (NodeId const) const override
 
void setGraph (std::shared_ptr< Core::DataflowGraph > graph)
 
void sync_data ()
 
void clear_node_widget (Core::Node *node)
 
auto node_ptr (NodeId node_id) -> std::shared_ptr< Core::Node >
 

Detailed Description

Adapter between DataflowGraph and QtNodes, bare minimal, based on simple_graph QtNodes example.

Definition at line 32 of file GraphModel.hpp.

Constructor & Destructor Documentation

◆ GraphModel()

Ra::Dataflow::QtGui::GraphEditor::GraphModel::GraphModel ( std::shared_ptr< Core::DataflowGraph > graph)

Definition at line 13 of file GraphModel.cpp.

◆ ~GraphModel()

Ra::Dataflow::QtGui::GraphEditor::GraphModel::~GraphModel ( )
override

Definition at line 19 of file GraphModel.cpp.

Member Function Documentation

◆ addConnection()

void Ra::Dataflow::QtGui::GraphEditor::GraphModel::addConnection ( ConnectionId const connectionId)
override

Definition at line 116 of file GraphModel.cpp.

◆ addInputOutputNodesForGraph()

void Ra::Dataflow::QtGui::GraphEditor::GraphModel::addInputOutputNodesForGraph ( )

Definition at line 70 of file GraphModel.cpp.

◆ addNode()

GraphModel::NodeId Ra::Dataflow::QtGui::GraphEditor::GraphModel::addNode ( QString const nodeType = QString())
override

Definition at line 75 of file GraphModel.cpp.

◆ allConnectionIds()

std::unordered_set< GraphModel::ConnectionId > Ra::Dataflow::QtGui::GraphEditor::GraphModel::allConnectionIds ( NodeId const nodeId) const
override

Definition at line 38 of file GraphModel.cpp.

◆ allNodeIds()

std::unordered_set< GraphModel::NodeId > Ra::Dataflow::QtGui::GraphEditor::GraphModel::allNodeIds ( ) const
override

Definition at line 33 of file GraphModel.cpp.

◆ clear_node_widget()

void Ra::Dataflow::QtGui::GraphEditor::GraphModel::clear_node_widget ( Core::Node * node)

Definition at line 572 of file GraphModel.cpp.

◆ connectionExists()

bool Ra::Dataflow::QtGui::GraphEditor::GraphModel::connectionExists ( ConnectionId const connectionId) const
override

Definition at line 66 of file GraphModel.cpp.

◆ connectionPossible()

bool Ra::Dataflow::QtGui::GraphEditor::GraphModel::connectionPossible ( ConnectionId const connectionId) const
override

Connection is possible when graph contains no connectivity data in both directions Out -> In and In -> Out.

Definition at line 100 of file GraphModel.cpp.

◆ connections()

std::unordered_set< GraphModel::ConnectionId > Ra::Dataflow::QtGui::GraphEditor::GraphModel::connections ( NodeId nodeId,
PortType portType,
PortIndex portIndex ) const
override

Definition at line 52 of file GraphModel.cpp.

◆ deleteConnection()

bool Ra::Dataflow::QtGui::GraphEditor::GraphModel::deleteConnection ( ConnectionId const connectionId)
override

Definition at line 377 of file GraphModel.cpp.

◆ deleteNode()

bool Ra::Dataflow::QtGui::GraphEditor::GraphModel::deleteNode ( NodeId const nodeId)
override

Definition at line 396 of file GraphModel.cpp.

◆ getWidget()

QWidget * Ra::Dataflow::QtGui::GraphEditor::GraphModel::getWidget ( std::shared_ptr< Core::Node > node) const

Definition at line 137 of file GraphModel.cpp.

◆ loadNode()

void Ra::Dataflow::QtGui::GraphEditor::GraphModel::loadNode ( QJsonObject const & nodeJson)
override

needed for undo/redo

Definition at line 441 of file GraphModel.cpp.

+ Here is the call graph for this function:

◆ newNodeId()

NodeId Ra::Dataflow::QtGui::GraphEditor::GraphModel::newNodeId ( )
inlineoverride

Definition at line 96 of file GraphModel.hpp.

◆ node_ptr()

auto Ra::Dataflow::QtGui::GraphEditor::GraphModel::node_ptr ( NodeId node_id) -> std::shared_ptr<Core::Node>
inline

Definition at line 105 of file GraphModel.hpp.

◆ nodeData()

QVariant Ra::Dataflow::QtGui::GraphEditor::GraphModel::nodeData ( NodeId nodeId,
NodeRole role ) const
override

Definition at line 176 of file GraphModel.cpp.

◆ nodeExists()

bool Ra::Dataflow::QtGui::GraphEditor::GraphModel::nodeExists ( NodeId const nodeId) const
override

Definition at line 133 of file GraphModel.cpp.

◆ portData()

QVariant Ra::Dataflow::QtGui::GraphEditor::GraphModel::portData ( NodeId nodeId,
PortType portType,
PortIndex portIndex,
PortRole role ) const
override

Definition at line 282 of file GraphModel.cpp.

◆ saveNode()

QJsonObject Ra::Dataflow::QtGui::GraphEditor::GraphModel::saveNode ( NodeId const nodeId) const
override

Definition at line 416 of file GraphModel.cpp.

◆ setGraph()

void Ra::Dataflow::QtGui::GraphEditor::GraphModel::setGraph ( std::shared_ptr< Core::DataflowGraph > graph)

Definition at line 472 of file GraphModel.cpp.

◆ setNodeData()

bool Ra::Dataflow::QtGui::GraphEditor::GraphModel::setNodeData ( NodeId nodeId,
NodeRole role,
QVariant value )
override

Definition at line 233 of file GraphModel.cpp.

◆ setPortData()

bool Ra::Dataflow::QtGui::GraphEditor::GraphModel::setPortData ( NodeId nodeId,
PortType portType,
PortIndex portIndex,
QVariant const & value,
PortRole role = PortRole::Data )
override

Definition at line 363 of file GraphModel.cpp.

◆ sync_data()

void Ra::Dataflow::QtGui::GraphEditor::GraphModel::sync_data ( )

Definition at line 477 of file GraphModel.cpp.


The documentation for this class was generated from the following files: