Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4501 in orxonox.OLD for orxonox/trunk/src/util/track


Ignore:
Timestamp:
Jun 3, 2005, 11:59:34 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: loading of track works just fine now. little problems with the setSavePoint-function

Location:
orxonox/trunk/src/util/track
Files:
2 edited

Legend:

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

    r4496 r4501  
    409409       
    410410  element = root->FirstChildElement();
     411
    411412       
    412413  while( element != NULL)
    413414    {
     415      LoadParam<TrackManager>(element, "WorkOn", this, &TrackManager::workOnS, true)
     416        .describe("Selects a TrackElement (by name) to work on");
     417
    414418      LoadParam<TrackManager>(element, "Point", this, &TrackManager::addPoint, true)
    415419        .describe("Adds a new Point to the currently selected TrackElement");
     
    418422        .describe("Sets the Duration of the currently selected TrackElement");
    419423     
    420       LoadParam<TrackManager>(element, "SavePoint", this, &TrackManager::setSavePoint, true);
     424      LoadParam<TrackManager>(element, "SavePoint", this, &TrackManager::setSavePointS, true)
     425        .describe("Sets the current selected Point to a Savepoint, meaning that the curve will be ended and a new one starts, and that one starts again from this point on");
     426
     427      LoadParam<TrackManager>(element, "Fork", this, &TrackManager::forkS, true)
     428        .describe("Forks the Path into multiple forked Path names seperated by ','");
     429
     430      LoadParam<TrackManager>(element, "Join", this, &TrackManager::joinS, true)
     431        .describe("Joins multiple joining Path names seperated by ','");
    421432
    422433      /*
    423       if( !strcmp( element->Value(), "SavePoint"))
    424         {
    425           PRINTF(5)("Loaded Savepoint\n");
    426           setSavePoint();
     434        if( !strcmp( element->Value(), "Fork"))
     435        {
     436        container = element->FirstChild();
     437        if( container->ToText())
     438        {
     439        assert( container->Value() != NULL);
     440        PRINTF(4)("Loaded Fork: %s\n", container->Value());
     441        forkS(container->Value());
     442        }
    427443        }
    428444      */
    429       if( !strcmp( element->Value(), "Fork"))
    430         {
    431           container = element->FirstChild();
    432           if( container->ToText())
    433             {
    434               assert( container->Value() != NULL);
    435               PRINTF(4)("Loaded Fork: %s\n", container->Value());
    436               forkS(container->Value());
    437             }
    438         }
    439       else if( !strcmp( element->Value(), "Join"))
    440         {
    441           container = element->FirstChild();
    442           if( container->ToText())
    443             {
    444               assert( container->Value() != NULL);
    445               PRINTF0("Loaded Join: %s\n", container->Value());
    446               joinS(container->Value());
    447             }
    448         }
    449       else if( !strcmp( element->Value(), "WorkOn"))
    450         {
    451           container = element->FirstChild();
    452           if( container->ToText())
    453             {
    454               assert( container->Value() != NULL);
    455               PRINTF(4)("Loaded WorkOn: %s\n", container->Value());
    456               workOn( container->Value());
    457             }
    458         }
    459                
     445      /*
     446        if( !strcmp( element->Value(), "Join"))
     447        {
     448        container = element->FirstChild();
     449        if( container->ToText())
     450        {
     451        assert( container->Value() != NULL);
     452        PRINTF0("Loaded Join: %s\n", container->Value());
     453        joinS(container->Value());
     454        }
     455        }
     456      */       
    460457      element = element->NextSiblingElement();
    461458    }
     
    545542   \param trackName the Name of the Track to work on
    546543*/
    547 void TrackManager::workOn(const char* trackName)
     544void TrackManager::workOnS(const char* trackName)
    548545{
    549546  TrackElement* tmpElem = this->firstTrackElem->findByName(trackName);
     
    658655   \todo this must be better
    659656*/
    660 void TrackManager::setSavePoint(int isLoadable)
    661 {
    662   this->setSavePoint();
     657void TrackManager::setSavePointS(const char* nextElementName)
     658{
     659  this->firstTrackElem->findByID(this->setSavePoint(NULL))->setName(nextElementName);
    663660}
    664661
     
    743740    {
    744741      this->firstTrackElem->findByID(trackIDs[i])->setName(strings.getString(i));
    745     } 
     742    }
     743  delete []trackIDs;
    746744}
    747745
  • orxonox/trunk/src/util/track/track_manager.h

    r4496 r4501  
    146146  // Methods to change the Path (initialisation)
    147147  void workOn(unsigned int trackID);
    148   void workOn(const char* trackName);
     148  void workOnS(const char* trackName);
    149149
    150150  /** \see setCurveType(CurveType curveType, TrackElement* trackElem); \param curveType the type of the Curve */
     
    156156  void addPointV(Vector newPoint, TrackElement* trackElem = NULL);
    157157  int addHotPoint(Vector newPoint, TrackElement* trackElem = NULL);
    158   void setSavePoint(int isLoadable);
     158  void setSavePointS(const char* nextElementName);
    159159  int setSavePoint(TrackElement* trackElem = NULL);
    160160  void fork(unsigned int count, ...);
Note: See TracChangeset for help on using the changeset viewer.