goat3d
annotate src/node.cc @ 51:fa5c52ea9d59
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 17 Jan 2014 18:16:09 +0200 |
parents | cd71f0b92f44 |
children | dad392c710df ca549434dc95 |
rev | line source |
---|---|
nuclear@0 | 1 #include <algorithm> |
nuclear@0 | 2 #include <string.h> |
nuclear@0 | 3 #include "node.h" |
nuclear@0 | 4 |
nuclear@47 | 5 using namespace g3dimpl; |
nuclear@47 | 6 |
nuclear@0 | 7 Node::Node() |
nuclear@0 | 8 { |
nuclear@8 | 9 obj = 0; |
nuclear@0 | 10 } |
nuclear@0 | 11 |
nuclear@8 | 12 void Node::set_object(Object *obj) |
nuclear@0 | 13 { |
nuclear@8 | 14 this->obj = obj; |
nuclear@0 | 15 } |
nuclear@0 | 16 |
nuclear@8 | 17 Object *Node::get_object() |
nuclear@0 | 18 { |
nuclear@8 | 19 return obj; |
nuclear@0 | 20 } |
nuclear@0 | 21 |
nuclear@8 | 22 const Object *Node::get_object() const |
nuclear@0 | 23 { |
nuclear@8 | 24 return obj; |
nuclear@0 | 25 } |
nuclear@0 | 26 |
nuclear@47 | 27 void g3dimpl::delete_node_tree(Node *n) |
nuclear@0 | 28 { |
nuclear@8 | 29 for(int i=0; i<n->get_children_count(); i++) { |
nuclear@8 | 30 delete_node_tree((Node*)n->get_child(i)); |
nuclear@0 | 31 } |
nuclear@8 | 32 delete n; |
nuclear@0 | 33 } |