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).
22 lines
307 B
C++
22 lines
307 B
C++
#ifndef INPUTARRAY_H
|
|
#define INPUTARRAY_H
|
|
|
|
#include "input.h"
|
|
|
|
class NodeInputArray : public NodeInput
|
|
{
|
|
public:
|
|
NodeInputArray(const QString &id);
|
|
|
|
int GetSize() const;
|
|
void SetSize(int size);
|
|
|
|
NodeInput* ParamAt(int index);
|
|
|
|
private:
|
|
QVector<NodeInput*> sub_params_;
|
|
|
|
};
|
|
|
|
#endif // INPUTARRAY_H
|