Commit 1098166a by Alisa Jung

added some stuff to treeitem

parent e334b7ab
......@@ -23,7 +23,6 @@ public:
protected:
int ID;
QString name;
int tesselation;
Type type;
};
......
......@@ -8,6 +8,7 @@ RigidBodyTransformation::RigidBodyTransformation(Primitive* child)
// this->child = child;
children.append(child);
name = "";
// qDebug() << "new rbt " << tx << "," << ty << "," << tz << ", rot " << rotation;
}
......
......@@ -46,3 +46,19 @@ TreeItem* TreeItem::getChild(int index){
}
return 0;
}
int TreeItem::columnCount(){
return 1;
}
QVariant TreeItem::data(int column){
if (column == 0) return QVariant(name);
else return QVariant("ERROR column index");
}
int TreeItem::childNumber(){
if (parent){
return parent->getChildren().indexOf(this);
}
return 0; //for root.
}
......@@ -14,14 +14,19 @@ public:
QList<TreeItem*> getChildren();
TreeItem* getChild(int index);//return 0 if index too large
int getChildrenCount();
int columnCount();
QVariant data(int column); //returns QVariant for name string
void addChild(TreeItem* item);
bool removeChild(TreeItem* item);
void setParent(TreeItem* parent);
int childNumber();
protected:
TreeItem* parent;
QList<TreeItem*> children;
QString name;
};
#endif // TREEITEM_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment