Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4761 in orxonox.OLD for orxonox/trunk/src/lib/coord


Ignore:
Timestamp:
Jul 2, 2005, 1:28:28 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Global identifiers and PNode-parenting via LoadParam works

Location:
orxonox/trunk/src/lib/coord
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/coord/p_node.cc

    r4742 r4761  
    2121
    2222#include "p_node.h"
     23#include "null_parent.h"
     24
     25#include "load_param.h"
     26#include "class_list.h"
     27
    2328#include "stdincl.h"
    2429#include "compiler.h"
    25 
    2630#include "error.h"
    2731#include "debug.h"
    2832#include "list.h"
    2933#include "vector.h"
    30 #include "null_parent.h"
    31 #include "load_param.h"
    3234
    3335//#include "vector.h"
     
    123125  LoadParam<PNode>(root, "rel-coor", this, &PNode::setRelCoor)
    124126      .describe("Sets The relative position of the Node to its parent.");
     127
     128  LoadParam<PNode>(root, "parent", this, &PNode::setParent)
     129      .describe("the Name of the Parent of this PNode");
    125130}
    126131
     
    328333}
    329334
     335/**
     336 * @see PNode::setParent(PNode* parent);
     337 * @param parentName the name of the Parent to set to this PNode
     338 */
     339void PNode::setParent (const char* parentName)
     340{
     341  PNode* parentNode = dynamic_cast<PNode*>(ClassList::getObject(parentName, CL_PARENT_NODE));
     342
     343
     344  printf("%p\n", parentNode);
     345  printf("%s\n", parentNode->getName());
     346
     347  if (parentNode != NULL)
     348    parentNode->addChild(this);
     349}
    330350
    331351/**
  • orxonox/trunk/src/lib/coord/p_node.h

    r4746 r4761  
    8888
    8989  void setParent (PNode* parent);
     90  void setParent (const char* name);
     91
    9092  void setParentMode (unsigned int parentingMode);
    9193  /** \returns the Parenting mode of this node */
Note: See TracChangeset for help on using the changeset viewer.