Changeset 3463 in orxonox.OLD for orxonox/branches/trackManager/src/track_manager.cc
- Timestamp:
- Mar 9, 2005, 10:50:20 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/trackManager/src/track_manager.cc
r3432 r3463 88 88 89 89 90 /** 91 \brief checks if there are any BackLoops in the Track 92 \param trackElem the trackElement to check about 93 it simply does this by looking if the current trackElem is found again somewhere else in the Track 94 */ 95 bool TrackElement::backLoopCheck(TrackElement* trackElem) 96 { 97 if (this->childCount == 0) 98 return true; 99 else 100 { 101 for (int i = 0; i < this->childCount; i++) 102 if(!this->children[i]->backLoopCheck(trackElem)) 103 return false; 104 105 return true; 106 } 107 } 90 108 91 109 … … 137 155 TrackManager* TrackManager::getInstance(void) 138 156 { 139 if ( singletonRef)140 return singletonRef;157 if (TrackManager::singletonRef) 158 return TrackManager::singletonRef; 141 159 else 142 return singletonRef = new TrackManager();160 return TrackManager::singletonRef = new TrackManager(); 143 161 } 144 162 … … 370 388 { 371 389 printf("Joining %d tracks and merging to Track %d\n", count, trackIDs[0]); 390 391 // checking if there is a back-loop-connection and ERROR if it is. 392 TrackElement* tmpTrackElem = this->findTrackElementByID(trackIDs[0]); 393 if (!tmpTrackElem->backLoopCheck(tmpTrackElem)) 394 PRINTF(1)("Backloop connection detected at joining trackElements\n"); 372 395 373 396 // chanching work-on to temporary value. going back at the end.
Note: See TracChangeset
for help on using the changeset viewer.