Changeset 3354 in orxonox.OLD for orxonox/branches/parenting
- Timestamp:
- Jan 6, 2005, 12:57:20 PM (20 years ago)
- Location:
- orxonox/branches/parenting/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/parenting/src/Makefile.in
r3353 r3354 296 296 esac; \ 297 297 done; \ 298 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- foreignsrc/Makefile'; \298 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ 299 299 cd $(top_srcdir) && \ 300 $(AUTOMAKE) -- foreignsrc/Makefile300 $(AUTOMAKE) --gnu src/Makefile 301 301 .PRECIOUS: Makefile 302 302 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
orxonox/branches/parenting/src/track_manager.cc
r3352 r3354 29 29 { 30 30 this->isFresh = true; 31 this->isHotPoint = false; 31 32 this->isSavePoint = false; 32 33 this->isFork = false; … … 99 100 100 101 */ 101 TrackManager::TrackManager ()102 TrackManager::TrackManager(void) 102 103 { 103 104 this->setClassName ("TrackManager"); … … 117 118 118 119 */ 119 TrackManager::~TrackManager ()120 TrackManager::~TrackManager(void) 120 121 { 121 122 PRINTF(3)("Destruct TrackManager\n"); … … 180 181 { 181 182 this->currentTrackElem = findTrackElementByID(trackID); 183 printf("now Working on %d\n", trackID); 182 184 } 183 185 … … 252 254 int TrackManager::addHotPoint(Vector newPoint) 253 255 { 256 printf("setting up a HotPoint\n"); 254 257 if (this->currentTrackElem->isFresh) 255 258 { … … 261 264 this->currentTrackElem->curve->addNode(newPoint); 262 265 this->currentTrackElem->nodeCount++; 266 this->initChildren(1); 267 this->currentTrackElem = this->currentTrackElem->children[0]; 263 268 } 264 269 … … 272 277 int TrackManager::setSavePoint(void) 273 278 { 279 printf("setting up a SavePoint.\n"); 274 280 if (this->currentTrackElem->isFork || this->currentTrackElem->isSavePoint) 275 281 return this->currentTrackElem->children[1]->ID; 276 282 this->currentTrackElem->isSavePoint = true; 283 this->currentTrackElem->isHotPoint = true; 277 284 278 285 this->initChildren(1); … … 312 319 void TrackManager::forkV(unsigned int count, int* trackIDs) 313 320 { 321 printf("Forking with %d children\n", count); 314 322 if (this->currentTrackElem->isSavePoint) 315 323 return; 316 324 this->currentTrackElem->isFork = true; 325 this->currentTrackElem->isHotPoint = true; 317 326 for(int i = 0; i < count; i++) 318 327 trackIDs[i]=this->trackElemCount+1+i; … … 335 344 336 345 Join will set the localTime to the longest time a Path has to get to this Point. \n 337 Join will join all curves to the curve we are working on, meaning that all the tangents will be matched.346 Join will join all curves to the first curve, meaning that all the tangents will be matched. 338 347 */ 339 348 void TrackManager::join(unsigned int count, ...) … … 360 369 void TrackManager::joinV(unsigned int count, int* trackIDs) 361 370 { 362 Vector tmpEndPoint = this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()); 363 Vector tmpTangentPoint = this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()-1); 364 365 for (int i = 0; i < count; i++) 371 printf("Joining %d tracks to Track %d\n", count, trackIDs[0]); 372 373 // chanching work-on to temporary value. going back at the end. 374 int tmpCurrentWorkingID = this->currentTrackElem->ID; 375 this->workOn(trackIDs[0]); 376 377 TrackElement* firstJoint = this->currentTrackElem; 378 Vector tmpEndPoint = firstJoint->curve->getNode(firstJoint->curve->getNodeCount()); 379 Vector tmpTangentPoint = firstJoint->curve->getNode(firstJoint->curve->getNodeCount()-1); 380 firstJoint->isJoined = true; 381 if(!firstJoint->isHotPoint) 382 this->setSavePoint(); 383 384 for (int i = 1; i < count; i++) 366 385 { 367 386 TrackElement* tmpJoinElem = this->findTrackElementByID(trackIDs[i]); 368 this->addPoint(tmpTangentPoint, tmpJoinElem); 369 this->addPoint(tmpEndPoint, tmpJoinElem); 370 tmpJoinElem->isJoined = true; 371 } 372 this->currentTrackElem->isJoined = true; 373 387 if (tmpJoinElem->childCount > 0) 388 printf("!!This Curve has children, and as such will not be joined!!\n You can try joining other childless TrackElements to this one!"); 389 else 390 { 391 this->addPoint(tmpTangentPoint, tmpJoinElem); 392 this->addPoint(tmpEndPoint, tmpJoinElem); 393 394 //Copying Joint-Info 395 tmpJoinElem->children = firstJoint->children; 396 tmpJoinElem->childCount = firstJoint->childCount; 397 tmpJoinElem->isSavePoint = firstJoint->isSavePoint; 398 tmpJoinElem->isFork = firstJoint->isFork; 399 400 tmpJoinElem->isJoined = true; 401 } 402 } 403 // returning to the TrackElement we were working on. 404 this->workOn(tmpCurrentWorkingID); 374 405 } 375 406 … … 477 508 if(tmpElem->name) 478 509 printf("name:%s::", tmpElem->name); 510 if(tmpElem->isFresh) 511 printf(" has not jet eddited in any way\n"); 479 512 printf("\n TimeTable: starting at = %f; ends at = %f; duration = %f\n", tmpElem->startingTime, tmpElem->startingTime+tmpElem->duration, tmpElem->duration); 480 513 printf(" consists of %d Points\n", tmpElem->nodeCount); 481 482 if(tmpElem->isFresh) 483 printf(" has not jet eddited in any way\n"); 484 if(tmpElem->isSavePoint) 485 printf(" is a SavePoint\n"); 486 if(tmpElem->isFork) 514 if (tmpElem->childCount == 0) 515 printf(" has no child\n"); 516 else if (tmpElem->childCount == 1) 517 printf(" has 1 child: ==%d==\n", tmpElem->children[0]->ID); 518 else if (tmpElem->childCount > 1) 487 519 { 488 printf(" is A Fork with with%d children: ", tmpElem->childCount);520 printf(" has %d children: ", tmpElem->childCount); 489 521 for(int i = 0; i < tmpElem->childCount; i++) 490 522 printf("=%d= ", tmpElem->children[i]->ID); 491 523 printf("\n"); 492 524 } 525 526 if(tmpElem->isHotPoint) 527 printf(" is a special Point:\n"); 528 if(tmpElem->isSavePoint) 529 printf(" is a SavePoint\n"); 530 if(tmpElem->isFork) 531 { 532 printf(" is A Fork with with %d children.", tmpElem->childCount); 533 } 493 534 if(tmpElem->isJoined) 494 535 printf(" is Joined at the End\n"); 495 496 497 536 } 498 537 } -
orxonox/branches/parenting/src/track_manager.h
r3352 r3354 36 36 37 37 bool isFresh; //!< If no Points where added until now 38 bool isHotPoint; //!< If the first node is a specialPoint; 38 39 bool isSavePoint; //!< If the first node is a savePoint 39 40 bool isFork; //!< If the first node is a Fork -
orxonox/branches/parenting/src/world.cc
r3353 r3354 246 246 int fork11, fork12; 247 247 trackManager->fork(2, &fork11, &fork12); 248 printf("FORKS: %d, %d\n", fork11, fork12);249 248 trackManager->workOn(fork11); 250 249 trackManager->addPoint(Vector(170, 0, -15)); … … 255 254 trackManager->addPoint(Vector(190,2,5)); 256 255 trackManager->addPoint(Vector(200,2,5)); 257 trackManager->join(2, fork11, fork12); 256 trackManager->setSavePoint(); 257 trackManager->addPoint(Vector(220, 10,-10)); 258 trackManager->addPoint(Vector(230, 0,-10)); 259 trackManager->addPoint(Vector(240, 0, 2)); 260 trackManager->addPoint(Vector(250, 0, 0)); 261 trackManager->join(2, fork12, fork11); 258 262 259 263 /*
Note: See TracChangeset
for help on using the changeset viewer.