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
+12 -2
View File
@@ -1,11 +1,21 @@
#ifndef INPUTARRAY_H
#define INPUTARRAY_H
#include "input.h"
class InputArray
class NodeInputArray : public NodeInput
{
public:
InputArray();
NodeInputArray(const QString &id);
int GetSize() const;
void SetSize(int size);
NodeInput* ParamAt(int index);
private:
QVector<NodeInput*> sub_params_;
};
#endif // INPUTARRAY_H