improved various functions to support nodeinputarrays

This commit is contained in:
itsmattkc
2019-12-06 03:42:53 +11:00
parent 50f7fac156
commit d6247078b4
6 changed files with 98 additions and 40 deletions
+9 -8
View File
@@ -5,7 +5,11 @@
NodeInputArray::NodeInputArray(const QString &id) :
NodeInput(id)
{
}
bool NodeInputArray::IsArray()
{
return true;
}
int NodeInputArray::GetSize() const
@@ -66,10 +70,13 @@ NodeInput *NodeInputArray::ParamAt(int index) const
return sub_params_.at(index);
}
const QVector<NodeInput *> &NodeInputArray::sub_params()
{
return sub_params_;
}
void NodeInputArray::InsertAt(int index)
{
qDebug() << "Inserted at";
// Add another input at the end
Append();
@@ -99,22 +106,16 @@ void NodeInputArray::InsertAt(int index)
void NodeInputArray::Append()
{
qDebug() << "Appended";
SetSize(GetSize() + 1);
}
void NodeInputArray::RemoveLast()
{
qDebug() << "Removed last";
SetSize(GetSize() - 1);
}
void NodeInputArray::RemoveAt(int index)
{
qDebug() << "Removed at";
int limit = sub_params_.size() - 1;
// Shift all connections from index down