Changeset 3552 in orxonox.OLD for orxonox/trunk/src/lib/coord
- Timestamp:
- Mar 14, 2005, 11:58:59 PM (20 years ago)
- Location:
- orxonox/trunk/src/lib/coord
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/coord/null_parent.h
r3551 r3552 18 18 virtual ~NullParent (); 19 19 20 static NullParent* singletonRef;21 20 22 21 virtual void update (); … … 25 24 NullParent (); 26 25 NullParent (Vector* absCoordinate); 26 static NullParent* singletonRef; 27 27 28 28 }; -
orxonox/trunk/src/lib/coord/p_node.cc
r3551 r3552 34 34 PNode::PNode () 35 35 { 36 this->children = new tList<PNode>(); 37 this->bRelCoorChanged = true; 38 this->bAbsCoorChanged = false; 39 this->bRelDirChanged = true; 40 this->bAbsDirChanged = false; 41 this->parent = NULL; 42 this->objectName = NULL; 36 init(NULL); 43 37 44 38 NullParent* np = NullParent::getInstance(); … … 57 51 this->relCoordinate = this->absCoordinate - parent->getAbsCoor (); 58 52 59 this->children = new tList<PNode>(); 60 this->bRelCoorChanged = true; 61 this->bAbsCoorChanged = false; 62 this->bRelDirChanged = true; 63 this->bAbsDirChanged = false; 64 this->parent = parent; 65 this->objectName = NULL; 53 this->init(parent); 66 54 67 55 parent->addChild (this); … … 84 72 PNode::PNode(char* name) 85 73 { 86 this->children = new tList<PNode>(); 87 this->bRelCoorChanged = true; 88 this->bAbsCoorChanged = false; 89 this->bRelDirChanged = true; 90 this->bAbsDirChanged = false; 91 this->parent = NULL; 92 this->objectName = NULL; 74 this->init(NULL); 93 75 } 94 76 … … 121 103 delete this->children; 122 104 123 } 124 105 delete []this->objectName; 106 } 107 108 void PNode::init(PNode* parent) 109 { 110 this->children = new tList<PNode>(); 111 this->bRelCoorChanged = true; 112 this->bAbsCoorChanged = false; 113 this->bRelDirChanged = true; 114 this->bAbsDirChanged = false; 115 this->parent = parent; 116 this->objectName = NULL; 117 } 125 118 126 119 /** … … 540 533 void PNode::setName (char* newName) 541 534 { 542 this->objectName = newName; 535 this->objectName = new char[strlen(newName)+1]; 536 strcpy(this->objectName,newName); 543 537 } 544 538 -
orxonox/trunk/src/lib/coord/p_node.h
r3551 r3552 83 83 void debug (); 84 84 85 private: 86 void init(PNode* parent); 87 85 88 protected: 86 89 PNode(char*);
Note: See TracChangeset
for help on using the changeset viewer.