Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3842 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Apr 17, 2005, 12:01:56 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: now the TrackManager has a name for each trackElement

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/track_manager.cc

    r3841 r3842  
    231231  PRINT(0)("--== TrackElement:%i ==--", this->ID);
    232232  if(this->getName())
    233     PRINT(0)("Name: %s::", this->getName());
     233    PRINT(0)("--++Name: %s++--", this->getName());
    234234  if(this->isFresh)
    235235    PRINT(0)("  -- has not jet eddited in any way --\n");
     
    378378  this->firstTrackElem = new TrackElement();
    379379  this->firstTrackElem->ID = 1;
     380  this->firstTrackElem->setName("root");
     381
    380382  this->currentTrackElem = firstTrackElem;
    381383
     
    449451    }
    450452
    451   // setting the Name of the new TrackElement to the name of the last one, if the childCount is one
    452   if (childCount == 1)
    453     trackElem->getChild(0)->setName(trackElem->getName());
    454 
     453  // setting the Name of the new TrackElement to the name of the last one + _childI
     454
     455  if (trackElem->getName())
     456    {
     457      for (int i = 0; i < trackElem->childCount; i++)
     458      {
     459        char* childName = new char[strlen(trackElem->getName())+10];
     460        sprintf(childName, "%s_child%d", trackElem->getName(), i);
     461        trackElem->getChild(i)->setName(childName);
     462      }
     463    }
    455464  // select the first Child to work on.
    456465  this->currentTrackElem = trackElem->getChild(0);
Note: See TracChangeset for help on using the changeset viewer.