updated nodes for new input structure

Since all NodeInputs will generally only need their data type and default
value set once, we place it all into the constructor for cleaner and easier
to manage code.
This commit is contained in:
itsmattkc
2019-12-26 16:29:56 +11:00
parent 97c192672e
commit c62b59965e
16 changed files with 363 additions and 92 deletions
+4 -3
View File
@@ -2,8 +2,9 @@
#include "node.h"
NodeInputArray::NodeInputArray(const QString &id) :
NodeInput(id)
NodeInputArray::NodeInputArray(const QString &id, const DataType &type, const QVariant &default_value) :
NodeInput(id, type, default_value),
default_value_(default_value)
{
}
@@ -51,7 +52,7 @@ void NodeInputArray::SetSize(int size, bool lock)
Q_ASSERT(!parentNode()->HasParamWithID(sub_id));
NodeInput* new_param = new NodeInput(sub_id);
NodeInput* new_param = new NodeInput(sub_id, data_type(), default_value_);
new_param->setParent(this);
sub_params_.replace(i, new_param);