Changeset 3681 in orxonox.OLD for orxonox/branches/textEngine/src/track_manager.cc
- Timestamp:
- Mar 30, 2005, 9:02:23 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/textEngine/src/track_manager.cc
r3433 r3681 14 14 */ 15 15 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_TRACK_MANAGER 16 17 17 18 #include "track_manager.h" 19 20 #include "base_object.h" 21 #include "p_node.h" 22 #include "track_node.h" 23 #include "stdincl.h" 24 #include "list.h" 25 26 27 18 28 #include <stdarg.h> 19 #include "p_node.h"20 29 21 30 using namespace std; … … 32 41 this->isJoined = false; 33 42 this->mainJoin = false; 34 this->cond; //!< todo think!!35 43 this->ID = -1; 36 this->startingTime = 0; //!< \todo eventually set this to the max time of TrackManager.37 this->duration = 1;44 this->startingTime = 0; 45 this->duration = TMAN_DEFAULT_DURATION; 38 46 this->endTime = 1; 39 47 this->jumpTime = 0; 40 this-> curveType = BEZIERCURVE;48 this->width = TMAN_DEFAULT_WIDTH; 41 49 this->nodeCount = 0; 42 50 this->childCount = 0; … … 44 52 this->curve = NULL; 45 53 this->children = NULL; 54 55 this->history = NULL; 56 57 this->condFunc = &TrackElement::random; 46 58 } 47 59 … … 58 70 if ((!this->isJoined &&this->childCount > 0) || (this->isJoined && this->mainJoin)) 59 71 { 60 for (int i=0; i < this->childCount; i++) 61 delete this->children[i]; 72 tIterator<TrackElement>* iterator = this->children->getIterator(); 73 TrackElement* enumElem = iterator->nextElement(); 74 while (enumElem) 75 { 76 delete enumElem; 77 enumElem = iterator->nextElement(); 78 } 79 delete iterator; 62 80 delete this->children; 63 81 } … … 78 96 // search on. 79 97 if (this->childCount > 0) 80 for (int i=0; i < this->childCount; i++) 81 { 82 TrackElement* tmpElem; 83 if ((tmpElem = this->children[i]->findByID(trackID))) 84 return tmpElem; 85 } 86 else return NULL; 87 } 88 89 90 91 92 93 ///////////////////////////////////// 94 ///// TRACKMANAGER ////////////////// 95 ///////////////////////////////////// 98 { 99 tIterator<TrackElement>* iterator = this->children->getIterator(); 100 TrackElement* enumElem = iterator->nextElement(); 101 TrackElement* tmpElem; 102 while (enumElem) 103 { 104 if ((tmpElem = enumElem->findByID(trackID))) 105 return tmpElem; 106 enumElem = iterator->nextElement(); 107 } 108 delete iterator; 109 } 110 else 111 return NULL; 112 } 113 114 115 /** 116 \brief checks if there are any BackLoops in the Track 117 \param trackElem the trackElement to check about 118 it simply does this by looking if the current trackElem is found again somewhere else in the Track 119 */ 120 bool TrackElement::backLoopCheck(TrackElement* trackElem) 121 { 122 if (this->childCount == 0) 123 return true; 124 else 125 { 126 tIterator<TrackElement>* iterator = this->children->getIterator(); 127 TrackElement* enumElem = iterator->nextElement(); 128 while (enumElem) 129 { 130 if(!enumElem->backLoopCheck(trackElem)) 131 return false; 132 enumElem = iterator->nextElement(); 133 } 134 delete iterator; 135 136 return true; 137 } 138 } 139 140 /** 141 \param childNumber which child to return 142 \returns the n-the children (starting at 0) 143 */ 144 TrackElement* TrackElement::getChild(int childCount) 145 { 146 if (this->childCount == 0) 147 return NULL; 148 if (childCount > this->childCount) 149 childCount = this->childCount; 150 151 TrackElement* enumElem = this->children->enumerate(); 152 for (int i = 0; i < childCount; i++) 153 enumElem = this->children->nextElement(); 154 return enumElem; 155 } 156 157 /** 158 \param name the Name to set. 159 */ 160 void TrackElement::setName(const char* name) 161 { 162 // delete the old name 163 if (this->name) 164 delete []this->name; 165 // if a name was given already. 166 if (name) 167 { 168 this->name = new char[strlen(name)+1]; 169 strcpy(this->name, name); 170 } 171 else 172 this->name = NULL; 173 } 174 175 /** 176 \returns The name of this TrackElement 177 */ 178 char* TrackElement::getName(void) const 179 { 180 return this->name; 181 } 182 183 /** 184 \brief prints out debug information about this TrackElement 185 */ 186 void TrackElement::debug(void) 187 { 188 PRINT(0)("--== TrackElement:%i ==--", this->ID); 189 if(this->getName()) 190 PRINT(0)("Name: %s::", this->getName()); 191 if(this->isFresh) 192 PRINT(0)(" -- has not jet eddited in any way --\n"); 193 PRINT(0)("\n TimeTable: startingTime=%f; endTime=%f; duration=%f; jumpTime=%f\n", this->startingTime, this->endTime, this->duration, this->jumpTime); 194 PRINT(0)(" consists of %d Points\n", this->nodeCount); 195 if (this->childCount == 0) 196 PRINT(0)(" has no child\n"); 197 else if (this->childCount == 1) 198 PRINT(0)(" has 1 child: =%d=\n", this->getChild(0)->ID); 199 else if (this->childCount > 1) 200 { 201 PRINT(0)(" has %d children: ", this->childCount); 202 TrackElement* enumElem = this->children->enumerate(); 203 while (enumElem) 204 { 205 PRINT(0)("=%d= ", enumElem->ID); 206 enumElem = this->children->nextElement(); 207 } 208 PRINT(0)("\n"); 209 } 210 211 if(this->isHotPoint) 212 PRINT(0)(" is a special Point:\n"); 213 if(this->isSavePoint) 214 PRINT(0)(" is a SavePoint\n"); 215 if(this->isFork) 216 { 217 PRINT(0)(" is A Fork with with %d children.\n", this->childCount); 218 } 219 if(this->isJoined) 220 PRINT(0)(" is Joined at the End\n"); 221 222 if(!this->backLoopCheck(this)) /* this should not happen */ 223 PRINT(2)(" THERE IS A BACKLOOP TO THIS ELEMENT\n"); 224 } 225 226 /** 227 \brief CONDITION that chooses the first child for the decision (static) 228 \param nothing Nothing in this function 229 \returns the chosen child 230 */ 231 int TrackElement::lowest(void* nothing) 232 { 233 return 0; 234 } 235 236 /** 237 \brief CONDITION that chooses the last child for the decision (static) 238 \param nothing Nothing in this function 239 \returns the chosen child 240 */ 241 int TrackElement::highest(void* nothing) 242 { 243 return this->childCount-1; 244 } 245 246 /** 247 \brief CONDITION that chooses a random child for the decision (static) 248 \param nothing Nothing in this function 249 \returns the chosen child 250 */ 251 int TrackElement::random(void* nothing) 252 { 253 int i = (int)floor ((float)rand()/(float)RAND_MAX * (float)this->childCount); 254 if (i >= this->childCount) 255 return this->childCount-1; 256 else 257 return i; 258 } 259 260 /** 261 \brief CONDITION that chooses child 0, if the node(probably Player) 262 is left of its parent (z<0)) and 1/right otherwise. 263 \param node The node to act upon. 264 \returns the chosen child 265 */ 266 int TrackElement::leftRight(void* node) 267 { 268 PNode* tmpNode = (PNode*)node; 269 270 if (tmpNode->getRelCoor()->z < 0) 271 return 0; 272 else 273 return 1; 274 } 275 276 277 /** 278 \brief CONDITION that chooses the child, that has the nearest distance to the node (probably player). 279 \param node The node to act upon. 280 \returns the chosen child 281 282 This is rather dangerous, because one must carefully set the points on the curve. 283 The best Way is to set the nodes as wide away of each other as possible, 284 but take into consideration, that if the nodes are to far from a center node, the center will be chosen. 285 (play with this!!). 286 */ 287 int TrackElement::nearest(void* node) 288 { 289 PNode* tmpNode = (PNode*)node; 290 291 Vector nodeRelCoord = *tmpNode->getRelCoor(); 292 float minDist = 100000000; 293 int childNumber = 0; 294 int i = 0; 295 296 TrackElement* enumElem = this->children->enumerate(); 297 while (enumElem) 298 { 299 float dist = (nodeRelCoord - enumElem->curve->getNode(4)).len(); 300 if (dist < minDist) 301 { 302 minDist = dist; 303 childNumber = i; 304 } 305 i++; 306 enumElem = this->children->nextElement(); 307 } 308 309 PRINTF(4)("PathDecision with nearest algorithm: %d\n", childNumber); 310 return childNumber; 311 } 312 313 314 //////////////////////// 315 ///// TRACKMANAGER ///// 316 //////////////////////// 96 317 /** 97 318 \brief standard constructor … … 100 321 TrackManager::TrackManager(void) 101 322 { 102 this->setClassName ("TrackManager"); 323 this->setClassName("TrackManager"); 324 325 TrackManager::singletonRef = this; 103 326 104 327 PRINTF(3)("Initializing the TrackManager\n"); … … 109 332 this->maxTime = 0; 110 333 this->trackElemCount = 1; 111 this-> bindSlave = NULL;334 this->setBindSlave(this->trackNode = new TrackNode()); 112 335 } 113 336 … … 115 338 /** 116 339 \brief standard destructor 117 118 340 */ 119 341 TrackManager::~TrackManager(void) … … 121 343 PRINTF(3)("Destruct TrackManager\n"); 122 344 123 PRINTF( 3)("Deleting all the TrackElements\n");345 PRINTF(4)("Deleting all the TrackElements\n"); 124 346 delete this->firstTrackElem; 125 347 126 348 // we do not have a TrackManager anymore 127 singletonRef = NULL; 128 } 129 349 TrackManager::singletonRef = NULL; 350 } 351 352 //! Singleton Reference to TrackManager 130 353 TrackManager* TrackManager::singletonRef = NULL; 131 354 … … 137 360 TrackManager* TrackManager::getInstance(void) 138 361 { 139 if (singletonRef) 140 return singletonRef; 141 else 142 return singletonRef = new TrackManager(); 362 if (!TrackManager::singletonRef) 363 TrackManager::singletonRef = new TrackManager(); 364 return TrackManager::singletonRef; 143 365 } 144 366 … … 151 373 this->currentTrackElem->childCount = childCount; 152 374 this->currentTrackElem->mainJoin = true; 153 this->currentTrackElem->children = new TrackElement*[childCount]; 154 for (int i=0; i<childCount; i++) 155 { 156 this->currentTrackElem->children[i] = new TrackElement(); 157 this->currentTrackElem->children[i]->ID = ++trackElemCount; 158 this->currentTrackElem->children[i]->startingTime = this->currentTrackElem->endTime + this->currentTrackElem->jumpTime; 159 this->addPoint(this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()), this->currentTrackElem->children[i]); 160 } 375 this->currentTrackElem->children = new tList<TrackElement>(); 376 for (int i = 0; i < childCount; i++) 377 { 378 TrackElement* newElem = new TrackElement(); 379 this->currentTrackElem->children->add(newElem); 380 newElem->ID = ++trackElemCount; 381 newElem->startingTime = this->currentTrackElem->endTime + this->currentTrackElem->jumpTime; 382 this->addPoint(this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()), this->currentTrackElem->getChild(i)); 383 } 384 if (childCount == 1) 385 this->currentTrackElem->getChild(0)->setName(this->currentTrackElem->getName()); 161 386 } 162 387 … … 183 408 this->currentTrackElem = tmpElem; 184 409 else 185 printf("TrackElement not Found, leaving unchanged\n");186 printf("now Working on %d\n", this->currentTrackElem->ID);410 PRINTF(2)("TrackElement not Found, leaving unchanged\n"); 411 PRINTF(4)("now Working on %d\n", this->currentTrackElem->ID); 187 412 188 413 } … … 190 415 /** 191 416 \brief Sets the Type of the Curve 192 \brief curveType The Type to set 417 \param curveType The Type to set 418 \param trackElem the TrackElement that should get a new Curve. 193 419 */ 194 420 void TrackManager::setCurveType(CurveType curveType, TrackElement* trackElem) … … 199 425 return; 200 426 } 201 t rackElem->curveType = curveType;427 this->curveType = curveType; 202 428 switch (curveType) 203 429 { … … 205 431 trackElem->curve = new BezierCurve(); 206 432 break; 207 case UPOINTCURVE: 208 trackElem->curve = new UPointCurve(); 209 break; 433 210 434 } 211 435 } … … 240 464 if (trackElem->isFresh) 241 465 { 242 this->setCurveType( BEZIERCURVE, trackElem);466 this->setCurveType(TMAN_DEFAULT_CURVETYPE, trackElem); 243 467 trackElem->isFresh = false; 244 468 } … … 254 478 int TrackManager::addHotPoint(Vector newPoint) 255 479 { 256 printf("setting up a HotPoint\n");480 PRINTF(4)("setting up a HotPoint\n"); 257 481 if (this->currentTrackElem->isFresh) 258 482 { … … 265 489 this->currentTrackElem->nodeCount++; 266 490 this->initChildren(1); 267 this->currentTrackElem = this->currentTrackElem-> children[0];491 this->currentTrackElem = this->currentTrackElem->getChild(0); 268 492 } 269 493 … … 277 501 int TrackManager::setSavePoint(void) 278 502 { 279 printf("setting up a SavePoint.\n");503 PRINTF(4)("setting up a SavePoint.\n"); 280 504 if (this->currentTrackElem->isFork || this->currentTrackElem->isSavePoint) 281 return this->currentTrackElem->children[1]->ID; 505 { 506 PRINTF(2)("%d is already finished \n", currentTrackElem->ID); 507 return this->currentTrackElem->getChild(0)->ID; 508 } 282 509 this->currentTrackElem->isSavePoint = true; 283 510 this->currentTrackElem->isHotPoint = true; 284 511 285 512 this->initChildren(1); 286 this->currentTrackElem = this->currentTrackElem-> children[0];513 this->currentTrackElem = this->currentTrackElem->getChild(0); 287 514 } 288 515 … … 319 546 void TrackManager::forkV(unsigned int count, int* trackIDs) 320 547 { 321 printf("Forking with %d children\n", count);548 PRINTF(4)("Forking with %d children\n", count); 322 549 if (this->currentTrackElem->isSavePoint) 323 550 return; … … 331 558 /** 332 559 \brief decides under what condition a certain Path will be chosen. 560 \param cond the CONDITION of the decision 561 \param subject the Subject that will be decided upon with CONDITION cond. 562 */ 563 void TrackManager::condition(CONDITION cond, void* subject) 564 { 565 this->condition(this->currentTrackElem->ID, cond, subject); 566 } 567 /** 568 \brief decides under what condition a certain Path will be chosen. 333 569 \param groupID the ID on which to choose the preceding move 334 \param cond \todo think about this 335 */ 336 void TrackManager::condition(unsigned int groupID, PathCondition cond) 337 { 338 339 } 570 \param cond the CONDITION of the decision 571 \param subject the Subject that will be decided upon with CONDITION cond. 572 */ 573 void TrackManager::condition(unsigned int groupID, CONDITION cond, void* subject) 574 { 575 TrackElement* tmpElem = this->findTrackElementByID(groupID); 576 if (!tmpElem->isFork) 577 { 578 PRINTF(2)("%d is not a Fork, and no condition can be set in this case\n", tmpElem->ID); 579 return; 580 } 581 else 582 { 583 switch (cond) 584 { 585 case LOWEST: 586 tmpElem->condFunc = &TrackElement::lowest; 587 break; 588 case HIGHEST: 589 tmpElem->condFunc = &TrackElement::highest; 590 break; 591 case RANDOM: 592 tmpElem->condFunc = &TrackElement::random; 593 break; 594 case LEFTRIGHT: 595 tmpElem->condFunc = &TrackElement::leftRight; 596 break; 597 case NEAREST: 598 tmpElem->condFunc = &TrackElement::nearest; 599 break; 600 case ENEMYKILLED: 601 break; 602 } 603 tmpElem->subject=subject; 604 } 605 } 606 340 607 341 608 /** … … 369 636 void TrackManager::joinV(unsigned int count, int* trackIDs) 370 637 { 371 printf("Joining %d tracks and merging to Track %d\n", count, trackIDs[0]); 638 PRINTF(3)("Joining %d tracks and merging to Track %d\n", count, trackIDs[0]); 639 640 // checking if there is a back-loop-connection and ERROR if it is. 641 TrackElement* tmpTrackElem = this->findTrackElementByID(trackIDs[0]); 642 if (!tmpTrackElem->backLoopCheck(tmpTrackElem)) 643 PRINTF(2)("Backloop connection detected at joining trackElements\n"); 372 644 373 645 // chanching work-on to temporary value. going back at the end. … … 419 691 } 420 692 if(firstJoint->childCount > 0) 421 for(int i = 0; i < firstJoint->childCount; i++) 422 { 423 printf("Setting startingTime of %d to %f.\n", firstJoint->children[i]->ID, tmpLatestTime); 424 firstJoint->children[i]->startingTime = tmpLatestTime; 425 firstJoint->children[i]->endTime = tmpLatestTime+firstJoint->children[i]->duration; 426 } 427 693 { 694 TrackElement* enumElem = firstJoint->children->enumerate(); 695 while (enumElem) 696 { 697 PRINTF(4)("Setting startingTime of %d to %f.\n", enumElem->ID, tmpLatestTime); 698 enumElem->startingTime = tmpLatestTime; 699 enumElem->endTime = tmpLatestTime + enumElem->duration; 700 701 enumElem = firstJoint->children->nextElement(); 702 } 703 } 428 704 // returning to the TrackElement we were working on. 429 705 this->workOn(tmpCurrentWorkingID); … … 440 716 { 441 717 TrackElement* tmpElem = findTrackElementByID(i); 442 if (tmpElem->childCount >0 && tmpElem->mainJoin)718 if (tmpElem->childCount > 0 && tmpElem->mainJoin) 443 719 { 444 for (int j = 0; j < tmpElem->childCount; j++) 720 721 TrackElement* enumElem = tmpElem->children->enumerate(); 722 while (enumElem) 445 723 { 446 724 447 725 // c1-continuity 448 tmpElem->children[j]->curve->addNode(tmpElem->children[j]->curve->getNode(0) +449 (( tmpElem->children[j]->curve->getNode(0) -726 enumElem->curve->addNode(enumElem->curve->getNode(0) + 727 ((enumElem->curve->getNode(0) - 450 728 tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-1)) 451 729 ),2); 452 tmpElem->children[j]->nodeCount++;730 enumElem->nodeCount++; 453 731 // c2-continuity 454 tmpElem->children[j]->curve->addNode((tmpElem->curve->getNode(tmpElem->curve->getNodeCount())-732 enumElem->curve->addNode((tmpElem->curve->getNode(tmpElem->curve->getNodeCount())- 455 733 tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-1)) * 4 + 456 734 tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-2), 3); 457 tmpElem->children[j]->nodeCount++;458 printf("accelerations: %d-in: count: %d, %f, %f, %f\n %d-out: count: %d %f, %f, %f\n",735 enumElem->nodeCount++; 736 PRINTF(5)("accelerations: %d-in: count: %d, %f, %f, %f\n %d-out: count: %d %f, %f, %f\n", 459 737 tmpElem->ID, tmpElem->nodeCount, 460 738 tmpElem->curve->calcAcc(0.999).x, tmpElem->curve->calcAcc(0.999).y, tmpElem->curve->calcAcc(0.999).z, 461 tmpElem->children[j]->ID, tmpElem->children[j]->nodeCount, 462 tmpElem->children[j]->curve->calcAcc(0).x, tmpElem->children[j]->curve->calcAcc(0).y, tmpElem->children[j]->curve->calcAcc(0).z); 739 enumElem->ID, enumElem->nodeCount, 740 enumElem->curve->calcAcc(0).x, enumElem->curve->calcAcc(0).y, enumElem->curve->calcAcc(0).z); 741 742 enumElem = tmpElem->children->nextElement(); 463 743 } 464 744 } 465 745 } 746 for (int i = 1; i <=trackElemCount;i++) 747 if (this->findTrackElementByID(i)->endTime > this->maxTime) 748 this->maxTime = findTrackElementByID(i)->endTime; // very bad implemented :/ 466 749 } 467 750 … … 475 758 Vector TrackManager::calcPos() const 476 759 { 477 // PRINTF(0)("TrackElement:%d, localTime: %f\n",this->currentTrackElem->ID, this->localTime);478 760 return this->currentTrackElem->curve->calcPos((this->localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration); 479 761 } … … 489 771 490 772 /** 773 \returns the current Width of the track 774 */ 775 float TrackManager::getWidth(void) const 776 { 777 return this->currentTrackElem->width; 778 } 779 780 /** 491 781 \brief Advances the local-time of the Track around dt 492 782 \param dt The time about which to advance. … … 497 787 { 498 788 dt /= 1000; 499 printf("CurrentTrackID: %d, LocalTime is: %f, timestep is: %f\n", this->currentTrackElem->ID, this->localTime, dt);789 PRINTF(4)("CurrentTrackID: %d, LocalTime is: %f, timestep is: %f\n", this->currentTrackElem->ID, this->localTime, dt); 500 790 if (this->localTime <= this->firstTrackElem->duration) 501 791 this->jumpTo(this->localTime); 502 this->localTime += dt; 792 if (this->localTime <= this->maxTime) 793 this->localTime += dt; 503 794 if (this->localTime > this->currentTrackElem->endTime 504 795 && this->currentTrackElem->children) 505 796 { 506 if (this->currentTrackElem->jumpTime > 0)797 if (this->currentTrackElem->jumpTime != 0.0) 507 798 this->jumpTo(this->localTime + this->currentTrackElem->jumpTime); 508 this->currentTrackElem = this->currentTrackElem->children[0]; 799 // jump to the next TrackElement and also set the history of the new Element to the old one. 800 TrackElement* tmpHistoryElem = this->currentTrackElem; 801 this->currentTrackElem = this->currentTrackElem->getChild(this->choosePath(this->currentTrackElem)); 802 this->currentTrackElem->history = tmpHistoryElem; 509 803 } 510 804 if (this->bindSlave) … … 512 806 Vector tmp = this->calcPos(); 513 807 Quaternion quat = Quaternion(this->calcDir(), Vector(this->currentTrackElem->curve->calcAcc((localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration).x,1,this->currentTrackElem->curve->calcAcc((localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration).z)); 808 809 Vector v(0.0, 1.0, 0.0); 810 Quaternion q(-PI/2, v); 811 quat = quat * q; 812 514 813 this->bindSlave->setAbsCoor(&tmp); 515 814 this->bindSlave->setAbsDir(&quat); … … 533 832 /** 534 833 \brief a Function that decides which Path we should follow. 535 \param graphIDThe Path to choose.834 \param trackElem The Path to choose. 536 835 537 836 */ 538 void TrackManager::choosePath(int graphID)539 { 540 837 int TrackManager::choosePath(TrackElement* trackElem) 838 { 839 return (trackElem->*(trackElem->condFunc))(trackElem->subject); 541 840 } 542 841 … … 547 846 void TrackManager::setBindSlave(PNode* bindSlave) 548 847 { 549 if (!this->bindSlave) 550 this->bindSlave = bindSlave; 551 } 552 848 this->bindSlave = bindSlave; 849 } 850 851 /** 852 \returns the main TrackNode 853 */ 854 PNode* TrackManager::getTrackNode(void) 855 { 856 return this->trackNode; 857 } 553 858 554 859 // DEBUG // … … 585 890 void TrackManager::debug(unsigned int level) const 586 891 { 587 printf("::CLASS TRACKMANAGER::debug information::\n"); 588 // printf("Status is: % 589 printf(" Consists of %d elements\n", this->trackElemCount); 590 printf(" localTime is: %f\n", this->localTime); 892 PRINT(0)("=========================================\n"); 893 PRINT(0)("= CLASS TRACKMANAGER::debug information =\n"); 894 PRINT(0)("=========================================\n"); 895 // PRINT(0)("Status is: % 896 PRINT(0)(" Consists of %d elements\n", this->trackElemCount); 897 PRINT(0)(" localTime is: %f\n", this->localTime); 591 898 if (level >= 2) 592 899 { … … 594 901 { 595 902 TrackElement* tmpElem = this->findTrackElementByID(i); 596 printf(" ::TrackElement:%i::", tmpElem->ID); 597 if(tmpElem->name) 598 printf("name:%s::", tmpElem->name); 599 if(tmpElem->isFresh) 600 printf(" has not jet eddited in any way\n"); 601 printf("\n TimeTable: startingTime=%f; endTime=%f; duration=%f; jumpTime=%f\n", tmpElem->startingTime, tmpElem->endTime, tmpElem->duration, tmpElem->jumpTime); 602 printf(" consists of %d Points\n", tmpElem->nodeCount); 603 if (tmpElem->childCount == 0) 604 printf(" has no child\n"); 605 else if (tmpElem->childCount == 1) 606 printf(" has 1 child: ==%d==\n", tmpElem->children[0]->ID); 607 else if (tmpElem->childCount > 1) 608 { 609 printf(" has %d children: ", tmpElem->childCount); 610 for(int i = 0; i < tmpElem->childCount; i++) 611 printf("=%d= ", tmpElem->children[i]->ID); 612 printf("\n"); 613 } 614 615 if(tmpElem->isHotPoint) 616 printf(" is a special Point:\n"); 617 if(tmpElem->isSavePoint) 618 printf(" is a SavePoint\n"); 619 if(tmpElem->isFork) 620 { 621 printf(" is A Fork with with %d children.\n", tmpElem->childCount); 622 } 623 if(tmpElem->isJoined) 624 printf(" is Joined at the End\n"); 903 tmpElem->debug(); 625 904 } 626 905 } 627 } 906 PRINT(0)("-----------------------------------------\n"); 907 }
Note: See TracChangeset
for help on using the changeset viewer.