created NodeInputArray parameter type

It seems unwise to let NodeInputs take more than one value, but at times
it makes sense to create a list or array of inputs. This class will create
sub-parameters as an easy way to provide variable inputs while also enforcing
one connection per input parameter.

This is also the primary motivation for the previous commit (disambiguating
when a NodeParam's parent is a Node vs some other type).
This commit is contained in:
itsmattkc
2019-12-01 00:01:25 +11:00
parent 092d76f41a
commit da680094bf
4 changed files with 70 additions and 8 deletions
+6 -5
View File
@@ -28,6 +28,7 @@
#include "common/rational.h"
#include "node/dependency.h"
#include "node/input.h"
#include "node/inputarray.h"
#include "node/output.h"
/**
@@ -254,6 +255,11 @@ public:
*/
virtual QVariant Value(NodeOutput* output);
/**
* @brief Return whether a parameter with ID `id` has already been added to this Node
*/
bool HasParamWithID(const QString& id);
protected:
/**
* @brief Add a parameter to this node
@@ -309,11 +315,6 @@ signals:
void EdgeRemoved(NodeEdgePtr edge);
private:
/**
* @brief Return whether a parameter with ID `id` has already been added to this Node
*/
bool HasParamWithID(const QString& id);
bool HasParamOfType(NodeParam::Type type, bool must_be_connected);
QList<NodeParam *> params_;