-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSceneNode.cpp
More file actions
42 lines (34 loc) · 814 Bytes
/
Copy pathSceneNode.cpp
File metadata and controls
42 lines (34 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "SceneNode.h"
#include <iostream>
using std::cerr;
using std::endl;
SceneNode::SceneNode(const string& id_) : id_(id_) {
#ifdef __debug
cerr << "CONSTRUCTED: \t" << id_ << endl;
#endif
}
SceneNode::~SceneNode() {
STLDeleteContainerPointers(children_.begin(), children_.end());
children_.clear();
#ifdef __debug
cerr << "DESTROYED: \t" << id_ << endl;
#endif
}
const string& SceneNode::getID() const {
return id_;
}
void SceneNode::render() {
#ifdef __debug
cerr << "RENDERING: \t" << id_ << endl;
#endif
for (list<SceneNode*>::iterator it = children_.begin();
it != children_.end();
++it)
(*it)->render();
}
void SceneNode::addChild(SceneNode* child) {
children_.push_back(child);
}
int SceneNode::getNumChildren() const {
return children_.size();
}