shift renderer prototype to new node structure

This commit is contained in:
itsmattkc
2019-08-28 02:40:44 +10:00
parent 5afe7d523c
commit 7dc2290496
26 changed files with 264 additions and 395 deletions
+12
View File
@@ -27,6 +27,7 @@
#include "node/output.h"
NodeParam::NodeParam(const QString &id) :
time_(-1),
id_(id)
{
Q_ASSERT(!id_.isEmpty());
@@ -151,6 +152,8 @@ NodeEdgePtr NodeParam::ConnectEdge(NodeOutput *output, NodeInput *input)
output->edges_.append(edge);
input->edges_.append(edge);
input->ClearCachedValue();
// Emit a signal than an edge was added (only one signal needs emitting)
emit input->EdgeAdded(edge);
@@ -165,6 +168,8 @@ void NodeParam::DisconnectEdge(NodeEdgePtr edge)
output->edges_.removeAll(edge);
input->edges_.removeAll(edge);
input->ClearCachedValue();
emit input->EdgeRemoved(edge);
}
@@ -214,3 +219,10 @@ QString NodeParam::GetDefaultDataTypeName(const DataType& type)
return QString();
}
void NodeParam::ClearCachedValue()
{
// Since get_value() will (read: should) never receive a negative number, this will effectively invalidate any value
// currently cached
time_ = -1;
}