mirror of
https://github.com/ConjureETS/LOG750-LAB2.git
synced 2026-03-24 03:21:19 +00:00
43 lines
791 B
C++
43 lines
791 B
C++
#include "scenegroup.h"
|
|
|
|
SceneGroup::SceneGroup()
|
|
{
|
|
|
|
}
|
|
|
|
std::vector<GlNode*>* SceneGroup::getChildren() {
|
|
return &children;
|
|
}
|
|
|
|
GlNode* SceneGroup::childAt(int i) {
|
|
return children.at(i);
|
|
}
|
|
|
|
GlNode* SceneGroup::getChild(){
|
|
// Automatically loops
|
|
if(childIndex >= children.size() || childIndex < 0){ //just in case
|
|
childIndex = 0;
|
|
}
|
|
return children.at(childIndex++);
|
|
}
|
|
|
|
bool SceneGroup::hasNext()
|
|
{
|
|
if(childIndex >= children.size() || childIndex < 0) {
|
|
childIndex = 0;
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
void SceneGroup::addChild(GlNode* child){
|
|
|
|
children.push_back(child);
|
|
//children.push_back(std::shared_ptr<GlNode>(child));
|
|
}
|
|
|
|
void SceneGroup::accept(Visitor &v) {
|
|
v.visit(*this);
|
|
}
|