Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4435 in orxonox.OLD


Ignore:
Timestamp:
Jun 1, 2005, 11:40:19 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: objectName is now a property of BaseObject, because pNode has nothing to do with a name

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

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

    r4145 r4435  
    8585  delete this->children;
    8686  this->parent = NULL;
    87   delete []this->objectName;
    88 
    8987}
    9088
     
    9896  this->bAbsDirChanged = false;
    9997  this->parent = parent;
    100   this->objectName = NULL;
    10198}
    10299
     
    406403  this->lastAbsCoordinate = this->absCoordinate;
    407404
    408   PRINTF(4)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
     405  PRINTF(4)("PNode::update - %s - (%f, %f, %f)\n", this->getName(), this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
    409406
    410407
     
    518515}
    519516
    520 
    521 /**
    522   \brief set the name of the node
    523 
    524   for debug purposes realy usefull, not used to work properly
    525 */
    526 void PNode::setName (const char* newName)
    527 {
    528   this->objectName = new char[strlen(newName)+1];
    529   strcpy(this->objectName,newName);
    530 }
    531 
    532 
    533 /**
    534   \brief gets the name of the node
    535 */
    536 const char* PNode::getName ()
    537 {
    538   return this->objectName;
    539 }
    540 
  • orxonox/trunk/src/lib/coord/p_node.h

    r4382 r4435  
    9999  void processTick (float dt);
    100100
    101   void setName (const char* newName);
    102   const char* getName ();
    103 
    104101  void debug ();
    105102
    106103 protected:
    107104  float timeStamp;         //!< this the timeStamp of when the abs{Coordinat, Direction} has been calculated
    108   char* objectName;        //!< The name of the Object
    109105  bool bAbsCoorChanged;    //!< If Absolute Coordinate has changed since last time we checked
    110106  bool bRelCoorChanged;    //!< If Relative Coordinate has changed since last time we checked
  • orxonox/trunk/src/lib/lang/base_object.cc

    r4321 r4435  
    3232  this->id = -1;
    3333  this->finalized = false;
     34
     35  this->objectName = NULL;
    3436}
    3537
     
    4143{
    4244  //  delete []this->className;
     45  if (this->objectName)
     46    delete []this->objectName;
    4347}
    4448
     
    96100  this->finalized = true;
    97101}
     102
     103
     104/**
     105  \brief set the name of the node
     106
     107  for debug purposes realy usefull, not used to work properly
     108*/
     109void BaseObject::setName (const char* newName)
     110{
     111  if (this->objectName)
     112    delete []this->objectName;
     113  if (newName)
     114    {
     115      this->objectName = new char[strlen(newName)+1];
     116      strcpy(this->objectName, newName);
     117    }
     118  else
     119    this->objectName = NULL;
     120}
  • orxonox/trunk/src/lib/lang/base_object.h

    r4382 r4435  
    3131  void finalize();
    3232
     33  void setName (const char* newName);
     34  const char* getName (void)const { return this->objectName; };
     35
    3336 private:
    34   const char*    className;                       //!< the name of the class
    35   int            id;                              //!< this is the id from the class_list.h enumeration
    36   bool           finalized;                       //!< is true if the object is ready to be garbage collected
     37  const char*    className;        //!< the name of the class
     38  int            id;               //!< this is the id from the class_list.h enumeration
     39  bool           finalized;        //!< is true if the object is ready to be garbage collected
     40
     41  char*    objectName;                   //!< The name of this object               
    3742};
    3843
  • orxonox/trunk/src/world_entities/world_entity.cc

    r4320 r4435  
    4242{
    4343  // name setup
    44   LoadParam<WorldEntity>(root, "name", this, &WorldEntity::setName)
    45     .describe("the name of the Object at hand");
     44  //  LoadParam<WorldEntity>(root, "name", this, &BaseObject::setName)
     45  //    .describe("the name of the Object at hand");
    4646
    4747  // Model Loading     
Note: See TracChangeset for help on using the changeset viewer.