use strings to connect nodes

This makes the node system somewhat more high-level with the intent of making
working with them far more flexible and stable. By making the architecture more
abstracted, it becomes far less rigid which should allow us to do even more
with it and make it much less crash prone.
This commit is contained in:
itsmattkc
2021-02-09 15:48:37 +11:00
parent d1a3e22eaa
commit 81c1922911
138 changed files with 4487 additions and 3913 deletions
+5 -6
View File
@@ -78,10 +78,9 @@ public:
/**
* @brief Returns GLOBAL point that edges should connect to for any NodeParam member of this object
*/
QPointF GetInputPoint(NodeInput* input, const QPointF &source_pos) const;
QPointF GetInputPoint(int input, const QPointF &source_pos) const;
QPointF GetInputPoint(const QString& input, int element, const QPointF &source_pos) const;
QPointF GetOutputPoint() const;
QPointF GetOutputPoint(const QString &output) const;
/**
* @brief Sets the direction nodes are flowing
@@ -105,9 +104,9 @@ public:
int GetIndexAt(QPointF pt) const;
NodeInput* GetInputAtIndex(int index) const
NodeInput GetInputAtIndex(int index) const
{
return node_inputs_.at(index);
return NodeInput(node_, node_inputs_.at(index));
}
void SetHighlightedIndex(int index);
@@ -143,7 +142,7 @@ private:
/**
* @brief Cached list of node inputs
*/
QList<NodeInput*> node_inputs_;
QVector<QString> node_inputs_;
/**
* @brief Rectangle of the Node's title bar (equal to rect() when collapsed)