Changeset 3529 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Mar 13, 2005, 10:39:28 PM (20 years ago)
- Location:
- orxonox/trunk/src/lib/coord
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/coord/null_parent.cc
r3488 r3529 36 36 \todo this constructor is not jet implemented - do it 37 37 */ 38 NullParent::NullParent () 38 NullParent::NullParent () : PNode("NullParent") 39 39 { 40 printf("NullParent::NullParent() - making new NullParent, there can only be one..\n"); 40 41 this->parent = this; 41 42 this->mode = ALL; 43 this->setName("NullParent"); 42 44 } 43 45 44 46 45 NullParent::NullParent (Vector* absCoordinate) 47 NullParent::NullParent (Vector* absCoordinate) : PNode("NullParent") 46 48 { 47 49 this->parent = this; 48 50 this->mode = ALL; 49 51 this->absCoordinate = *absCoordinate; 52 this->setName("NullParent"); 50 53 } 51 54 … … 58 61 NullParent::~NullParent () 59 62 { 60 delete singletonRef;63 //delete singletonRef; 61 64 singletonRef = NULL; 62 65 } -
orxonox/trunk/src/lib/coord/p_node.cc
r3521 r3529 40 40 this->bAbsDirChanged = false; 41 41 this->parent = NULL; 42 43 printf("PNode::PNode() - constructor, now adding\n"); 44 NullParent* np = NullParent::getInstance(); 45 np->addChild(this); 46 printf("PNode::PNode() - finished adding\n"); 42 47 } 43 48 … … 63 68 } 64 69 70 71 /** 72 \brief this constructor is very special. 73 \param with the name of the class 74 75 this constuctor exists, because there was a little issue with a 76 PNode<->NullPointer relation. It is crutial, that this construcor 77 exists, and is never used except from the NullParent itself. If you 78 delete it, there will probably be a endless loop, because in the 79 default constcutor of PNode NullPointer is generated, and NullPointer 80 gerenates itself again and again... 81 dont't think about it... 82 \todo patrick think about this one here... 83 */ 84 PNode::PNode(char* name) 85 { 86 printf("PNode::PNode(char*) - start\n"); 87 this->children = new tList<PNode>(); 88 this->bRelCoorChanged = true; 89 this->bAbsCoorChanged = false; 90 this->bRelDirChanged = true; 91 this->bAbsDirChanged = false; 92 this->parent = NULL; 93 printf("PNode::PNode(char*) - end\n"); 94 } 65 95 66 96 /** … … 96 126 pn = this->children->nextElement(); 97 127 } 128 /* this deletes all children in the list */ 98 129 this->children->destroy (); 99 130 } … … 280 311 void PNode::addChild (PNode* pNode, parentingMode mode) 281 312 { 282 if( pNode->parent == NULL )313 if( pNode->parent != NULL ) 283 314 { 284 p Node->mode = mode;285 pNode->parent = this;286 this->children->add(pNode);315 printf("PNode::addChild() - removing child from old parent \n"); 316 PRINTF(2)("PNode::addChild() - reparenting node: removing it and adding it again\n"); 317 pNode->parent->removeChild(pNode); 287 318 } 288 else289 {290 PRINTF(1)("PNode::addChild() - this node has already been added - closed Loop MARK \n");291 }319 pNode->mode = mode; 320 pNode->parent = this; 321 this->children->add(pNode); 322 printf("PNode::addChild() - Parent added\n"); 292 323 } 293 324 … … 358 389 void PNode::update (float timeStamp) 359 390 { 360 printf ("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z); 391 //printf ("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z); 392 // printf("%s", this->objectName); 361 393 362 394 if( this->mode == MOVEMENT || this->mode == ALL) -
orxonox/trunk/src/lib/coord/p_node.h
r3521 r3529 23 23 24 24 #include "stdincl.h" 25 25 26 26 27 class PNode; /* forward decleration, so that parentEntry has access to PNode */ … … 80 81 81 82 protected: 83 PNode(char*); 84 82 85 float timeStamp; //!< this the timeStamp of when the abs{Coordinat, Direction} has been calculated 83 86 char* objectName; //!< The name of the Object … … 95 98 96 99 #endif /* _P_NODE_H */ 100
Note: See TracChangeset
for help on using the changeset viewer.