Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/trackManager/src/track_manager.cc @ 3512

Last change on this file since 3512 was 3498, checked in by bensch, 20 years ago

orxonox/branches/trackManager: merged trunk back to tracManager R3440:3497 → 3498
merged with command:
svn merge ../trunk/ trackManager/ -r 3430:HEAD
conflicts resolved in favor of the Trunk

File size: 19.5 KB
RevLine 
[3311]1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
[3432]12   main-programmer: Benjamin Grauer
[3311]13   co-programmer: ...
14*/
15
16
17#include "track_manager.h"
[3498]18
19#include "p_node.h"
20
[3332]21#include <stdarg.h>
[3371]22#include "p_node.h"
[3311]23
24using namespace std;
25
[3331]26/**
27   \brief initializes a TrackElement (sets the default values)
28*/
29TrackElement::TrackElement(void)
30{
[3332]31  this->isFresh = true;
[3354]32  this->isHotPoint = false;
[3331]33  this->isSavePoint = false;
34  this->isFork = false;
35  this->isJoined = false;
[3356]36  this->mainJoin = false;
[3331]37  this->cond; //!< todo think!!
38  this->ID = -1;
[3333]39  this->startingTime = 0; //!< \todo eventually set this to the max time of TrackManager.
[3348]40  this->duration = 1;
[3373]41  this->endTime = 1;
42  this->jumpTime = 0;
[3331]43  this->curveType = BEZIERCURVE;
44  this->nodeCount = 0;
[3348]45  this->childCount = 0;
[3332]46  this->name = NULL;
[3331]47  this->curve = NULL;
48  this->children = NULL;
49}
[3311]50
[3331]51/**
[3332]52    \brief destroys all alocated memory)
[3331]53    \todo eventually when deleting a TrackElement you would not like to delete all its preceding TrackElements
54*/
55TrackElement::~TrackElement(void)
56{
[3332]57  if (this->name)
58    delete []name;
[3331]59  if (this->curve)
60    delete this->curve;
[3356]61  if ((!this->isJoined &&this->childCount > 0) || (this->isJoined && this->mainJoin))
[3331]62    {
63      for (int i=0; i < this->childCount; i++)
64        delete this->children[i];
[3356]65      delete this->children;
[3331]66    }
67}
68
[3332]69/**
70   \brief Searches through all the TrackElements for trackID.
71   \param trackID The ID to search for.
72   \returns The TrackElement if Found, NULL otherwise.
73   
74   \todo make this more modular, to search for different things
75*/
76TrackElement* TrackElement::findByID(unsigned int trackID)
77{
78  // return if Found.
79  if (this->ID == trackID)
80    return this;
81  // search on.
82  if (this->childCount > 0)
83    for (int i=0; i < this->childCount; i++)
84      {
85        TrackElement* tmpElem;
86        if ((tmpElem = this->children[i]->findByID(trackID)))
87          return tmpElem;
88      }
89  else return NULL;
90}
[3331]91
92
[3463]93/**
94   \brief checks if there are any BackLoops in the Track
95   \param trackElem the trackElement to check about
96   it simply does this by looking if the current trackElem is found again somewhere else in the Track
97*/
98bool TrackElement::backLoopCheck(TrackElement* trackElem)
99{
100  if (this->childCount == 0)
101    return true;
102  else
103    {
104      for (int i = 0; i < this->childCount; i++)
105        if(!this->children[i]->backLoopCheck(trackElem))
106          return false;
107     
108      return true;
109    }
110}
[3331]111
[3332]112
113
114/////////////////////////////////////
115///// TRACKMANAGER //////////////////
116/////////////////////////////////////
[3311]117/**
118   \brief standard constructor
119
120*/
[3354]121TrackManager::TrackManager(void)
[3311]122{
[3331]123  this->setClassName ("TrackManager");
124
125  PRINTF(3)("Initializing the TrackManager\n");
[3348]126  this->firstTrackElem = new TrackElement();
127  this->firstTrackElem->ID = 1;
[3331]128  this->currentTrackElem = firstTrackElem;
129  this->localTime = 0;
130  this->maxTime = 0;
[3348]131  this->trackElemCount = 1;
[3371]132  this->bindSlave = NULL;
[3311]133}
134
135
136/**
[3331]137   \brief standard destructor
[3311]138
139*/
[3354]140TrackManager::~TrackManager(void)
[3330]141{
[3331]142  PRINTF(3)("Destruct TrackManager\n");
[3311]143
[3331]144  PRINTF(3)("Deleting all the TrackElements\n");
145  delete this->firstTrackElem;
[3335]146
[3331]147  // we do not have a TrackManager anymore
148  singletonRef = NULL;
[3330]149}
150
[3331]151TrackManager* TrackManager::singletonRef = NULL;
152
[3330]153/**
[3331]154   \returns The reference on the TrackManager.
155
156   If the TrackManager does not exist, it will be created.
157*/
158TrackManager* TrackManager::getInstance(void) 
159{
[3463]160  if (TrackManager::singletonRef)
161    return TrackManager::singletonRef;
[3331]162  else
[3463]163    return TrackManager::singletonRef = new TrackManager();
[3331]164}
165
166/**
[3335]167   \brief reserves Space for childCount children
168   \param childCount The Count of children to make space for.
169*/
170void TrackManager::initChildren(unsigned int childCount)
171{
172  this->currentTrackElem->childCount = childCount;
[3376]173  this->currentTrackElem->mainJoin = true;
[3335]174  this->currentTrackElem->children = new TrackElement*[childCount];
175  for (int i=0; i<childCount; i++)
[3348]176    {
177      this->currentTrackElem->children[i] = new TrackElement();
178      this->currentTrackElem->children[i]->ID = ++trackElemCount;
[3431]179      this->currentTrackElem->children[i]->startingTime = this->currentTrackElem->endTime + this->currentTrackElem->jumpTime;
[3373]180      this->addPoint(this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()), this->currentTrackElem->children[i]);
[3348]181    }
[3335]182}
183
184/**
[3330]185   \brief Searches for a given trackID.
186   \param trackID the trackID to search for.
[3332]187   \returns The TrackElement #trackID if found, NULL otherwise.
[3330]188*/
[3332]189TrackElement* TrackManager::findTrackElementByID(unsigned int trackID) const
[3330]190{
[3332]191  return firstTrackElem->findByID(trackID);
[3330]192}
193
194// INITIALIZE //
195
196/**
197   \brief Sets the trackID we are working on.
198   \param trackID the trackID we are working on
199*/
[3332]200void TrackManager::workOn(unsigned int trackID)
[3330]201{
[3355]202  TrackElement* tmpElem = findTrackElementByID(trackID);
203  if (tmpElem)
204    this->currentTrackElem = tmpElem;
205  else
206    printf("TrackElement not Found, leaving unchanged\n");
207  printf("now Working on %d\n", this->currentTrackElem->ID);
208
[3330]209}
210
211/**
212   \brief Sets the Type of the Curve
213   \brief curveType The Type to set
214*/
[3373]215void TrackManager::setCurveType(CurveType curveType, TrackElement* trackElem)
[3330]216{
[3373]217  if (!trackElem->isFresh)
[3332]218    {
219      PRINTF(2)("It is not possible to change the type of a Curve after you have have appended some points to it\n");
220      return;
221    }
[3373]222  trackElem->curveType = curveType;
[3332]223  switch (curveType)
224    {
225    case BEZIERCURVE:
[3373]226      trackElem->curve = new BezierCurve();
[3332]227      break;
228    case UPOINTCURVE:
[3373]229      trackElem->curve = new UPointCurve();
[3332]230      break;
231    }
[3330]232}
233
234/**
[3333]235   \brief Sets the duration of the current path in seconds.
236   \param time The duration in seconds.
[3330]237*/
238
[3333]239void TrackManager::setDuration(float time)
[3330]240{
[3333]241  this->currentTrackElem->duration = time;
[3373]242  this->currentTrackElem->endTime = this->currentTrackElem->startingTime + time;
[3330]243}
244
245/**
246   \brief adds a point to the current TrackElement
247   \param newPoint The point to add.
248*/
[3333]249bool TrackManager::addPoint(Vector newPoint)
[3330]250{
[3352]251  return this->addPoint(newPoint, this->currentTrackElem);
252}
253
254/**
255   \brief adds a point to trackElem
256   \param newPoint The point to add.
257   \param trackElem The TrackElement to add the Point to
258*/
259bool TrackManager::addPoint(Vector newPoint, TrackElement* trackElem)
260{
261  if (trackElem->isFresh)
[3332]262    {
[3373]263      this->setCurveType(BEZIERCURVE, trackElem);
[3352]264      trackElem->isFresh = false;
[3332]265    }
[3352]266  trackElem->curve->addNode(newPoint);
267  trackElem->nodeCount++;
[3330]268}
269
270/**
271   \brief adds save/splitpoint.
272   \param newPoint The point to add.
[3333]273   \returns A Pointer to a newly appended Curve
[3330]274*/
[3333]275int TrackManager::addHotPoint(Vector newPoint)
[3330]276{
[3354]277  printf("setting up a HotPoint\n");
[3332]278  if (this->currentTrackElem->isFresh)
279    {
280      this->setCurveType(BEZIERCURVE);
281      this->currentTrackElem->isFresh = false;
282    }
[3330]283
[3332]284  // \todo HotPoint Handling.
285  this->currentTrackElem->curve->addNode(newPoint);
[3351]286  this->currentTrackElem->nodeCount++;
[3354]287  this->initChildren(1);
288  this->currentTrackElem = this->currentTrackElem->children[0];
[3330]289}
290
291/**
292   \brief Sets the last HotPoint into a savePoint.
[3333]293   \returns A Pointer to a newly appended Curve
[3330]294   
295   If no HotPoint was defined the last added Point will be rendered into a savePoint. \n
296   If the HotPoint was defined as a fork the Point will \b not be set into a savePoint.
297*/
[3333]298int TrackManager::setSavePoint(void)
[3330]299{
[3354]300  printf("setting up a SavePoint.\n");
[3332]301  if (this->currentTrackElem->isFork || this->currentTrackElem->isSavePoint)
[3333]302    return this->currentTrackElem->children[1]->ID;
[3332]303  this->currentTrackElem->isSavePoint = true;
[3354]304  this->currentTrackElem->isHotPoint = true;
[3332]305
[3335]306  this->initChildren(1);
[3348]307  this->currentTrackElem = this->currentTrackElem->children[0];
[3330]308}
309
310/**
311   \brief adds some interessting non-linear movments through the level.
312   \param count The Count of childrens the current HotPoint will have.
313
314   If no HotPoint was defined the last added Point will be rendered into a fork. \n
315   If the HotPoint was defined as a savePoint the Point will \b not be set into a fork.
316*/
[3332]317void TrackManager::fork(unsigned int count, ...)
[3330]318{
[3351]319  int* trackIDs = new int[count];
320  this->forkV(count, trackIDs);
[3332]321  va_list ID;
322  va_start (ID, count);
323  for(int i = 0; i < count; i++)
324    {
[3351]325      *va_arg (ID, int*) = trackIDs[i];
[3332]326    }
[3351]327  va_end(ID); 
[3332]328  delete []trackIDs;
[3330]329}
330
331/**
332   \brief adds some interessting non-linear movments through the level.
333   \param count The Count of childrens the current HotPoint will have.
334   \param trackIDs A Pointer to an Array of ints which will hold the trackID's (the user will have to reserve space for this).
335
336   \see void TrackManager::fork(int count, ...)
[3332]337
338   \todo initialisation is wrong!! also in setSavePoint.
[3330]339*/
[3332]340void TrackManager::forkV(unsigned int count, int* trackIDs)
[3330]341{
[3354]342  printf("Forking with %d children\n", count);
[3332]343  if (this->currentTrackElem->isSavePoint)
344    return;
345  this->currentTrackElem->isFork = true;
[3354]346  this->currentTrackElem->isHotPoint = true;
[3351]347  for(int i = 0; i < count; i++)
348    trackIDs[i]=this->trackElemCount+1+i;
[3335]349  this->initChildren(count);
[3330]350}
351
352/**
353   \brief decides under what condition a certain Path will be chosen.
354   \param groupID the ID on which to choose the preceding move
355   \param cond \todo think about this
356*/
[3332]357void TrackManager::condition(unsigned int groupID, PathCondition cond)
[3330]358{
[3332]359 
[3330]360}
361
362/**
363   \brief joins some tracks together again.
364   \param count The count of Paths to join.
365
366   Join will set the localTime to the longest time a Path has to get to this Point. \n
[3354]367   Join will join all curves to the first curve, meaning that all the tangents will be matched.
[3330]368*/
[3332]369void TrackManager::join(unsigned int count, ...)
[3330]370{
[3332]371  int* trackIDs = new int [count];
372  va_list ID;
373  va_start (ID, count);
374  for(int i = 0; i < count; i++)
375    {
376      trackIDs[i] = va_arg (ID, int);
377    }
378  va_end(ID);
379  this->joinV(count, trackIDs);
380  delete []trackIDs;
[3330]381}
382
383/**
384   \brief joins some tracks together again.
385   \param count The count of Paths to join.
386   \param trackIDs an Array with the trackID's to join
387
388   \see void TrackManager::join(int count, ...)
389*/
[3332]390void TrackManager::joinV(unsigned int count, int* trackIDs)
[3330]391{
[3431]392  printf("Joining %d tracks and merging to Track %d\n", count, trackIDs[0]);
[3354]393
[3463]394  // checking if there is a back-loop-connection and ERROR if it is.
395  TrackElement* tmpTrackElem = this->findTrackElementByID(trackIDs[0]);
396  if (!tmpTrackElem->backLoopCheck(tmpTrackElem))
397    PRINTF(1)("Backloop connection detected at joining trackElements\n");
398
[3354]399  // chanching work-on to temporary value. going back at the end.
400  int tmpCurrentWorkingID = this->currentTrackElem->ID;
401  this->workOn(trackIDs[0]);
[3431]402  TrackElement* firstJoint = this->currentTrackElem;
403  float tmpLatestTime = firstJoint->endTime;
[3354]404
405  Vector tmpEndPoint = firstJoint->curve->getNode(firstJoint->curve->getNodeCount());
[3376]406  Vector tmpTangentPoint = firstJoint->curve->getNode(firstJoint->curve->getNodeCount()-1);
407  Vector tmpc2Point = firstJoint->curve->getNode(firstJoint->curve->getNodeCount()-2);
[3354]408  firstJoint->isJoined = true;
[3376]409  //  firstJoint->mainJoin = true;
[3354]410  if(!firstJoint->isHotPoint)
411    this->setSavePoint();
[3373]412  // Timing:
413  for (int i = 0; i < count; i++)
414    {
415      TrackElement* tmpJoinElem = this->findTrackElementByID(trackIDs[i]);
416      if (tmpJoinElem->childCount == 0
417          && tmpJoinElem->endTime > tmpLatestTime)
[3430]418        tmpLatestTime = tmpJoinElem->endTime;
[3373]419    }
[3431]420  // time the main Join.
421  firstJoint->jumpTime = tmpLatestTime - firstJoint->endTime;
422 
[3373]423  // Joining:
[3354]424  for (int i = 1; i < count; i++)
[3352]425    {
426      TrackElement* tmpJoinElem = this->findTrackElementByID(trackIDs[i]);
[3354]427      if (tmpJoinElem->childCount > 0)
428        printf("!!This Curve has children, and as such will not be joined!!\n You can try joining other childless TrackElements to this one!");
429      else
430        {
[3376]431          this->addPoint(tmpc2Point, tmpJoinElem);
[3354]432          this->addPoint(tmpTangentPoint, tmpJoinElem);
433          this->addPoint(tmpEndPoint, tmpJoinElem);
[3431]434          // time all other Joins
[3373]435          tmpJoinElem->jumpTime = tmpLatestTime - tmpJoinElem->endTime;
[3354]436         
437          //Copying Joint-Info
438          tmpJoinElem->children = firstJoint->children;
439          tmpJoinElem->childCount = firstJoint->childCount;
440          tmpJoinElem->isSavePoint = firstJoint->isSavePoint;
441          tmpJoinElem->isFork = firstJoint->isFork;
[3373]442
[3354]443          tmpJoinElem->isJoined = true;
444        }
[3352]445    }
[3431]446  if(firstJoint->childCount > 0)
447    for(int i = 0; i < firstJoint->childCount; i++)
448      {
449        printf("Setting startingTime of %d to %f.\n", firstJoint->children[i]->ID, tmpLatestTime);
450        firstJoint->children[i]->startingTime = tmpLatestTime;
451        firstJoint->children[i]->endTime = tmpLatestTime+firstJoint->children[i]->duration;
452      } 
[3373]453
[3354]454  // returning to the TrackElement we were working on.
455  this->workOn(tmpCurrentWorkingID);
[3330]456}
457
[3376]458/**
459   \brief finalizes the TrackSystem. after this it will not be editable anymore
[3431]460
461   \todo check for any inconsistencies, output errors
[3376]462*/
463void TrackManager::finalize(void)
464{
465  for (int i = 1; i<= trackElemCount ;i++)
466    {
467      TrackElement* tmpElem = findTrackElementByID(i);
468      if (tmpElem->childCount>0 && tmpElem->mainJoin)
469        {
470          for (int j = 0; j < tmpElem->childCount; j++)
471            {
472             
473              // c1-continuity
474              tmpElem->children[j]->curve->addNode(tmpElem->children[j]->curve->getNode(0) +
475                                                   ((tmpElem->children[j]->curve->getNode(0) - 
476                                                    tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-1))
477                                                    ),2);
478              tmpElem->children[j]->nodeCount++;
479              // c2-continuity
480              tmpElem->children[j]->curve->addNode((tmpElem->curve->getNode(tmpElem->curve->getNodeCount())-
481                                                    tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-1)) * 4 +
482                                                   tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-2), 3);
483              tmpElem->children[j]->nodeCount++;                                                   
484              printf("accelerations: %d-in: count: %d, %f, %f, %f\n                  %d-out: count: %d %f, %f, %f\n",
485                     tmpElem->ID, tmpElem->nodeCount,
486                     tmpElem->curve->calcAcc(0.999).x, tmpElem->curve->calcAcc(0.999).y, tmpElem->curve->calcAcc(0.999).z,
487                     tmpElem->children[j]->ID, tmpElem->children[j]->nodeCount,
488                     tmpElem->children[j]->curve->calcAcc(0).x, tmpElem->children[j]->curve->calcAcc(0).y, tmpElem->children[j]->curve->calcAcc(0).z);
489            }
490        }
491    }
492}
493
494
[3330]495// RUNTIME //
496
497/**
498   \brief calculates the Position for the localTime of the Track.
499   \returns the calculated Position
500*/
[3332]501Vector TrackManager::calcPos() const
[3330]502{
[3348]503  //  PRINTF(0)("TrackElement:%d, localTime: %f\n",this->currentTrackElem->ID, this->localTime);
504  return this->currentTrackElem->curve->calcPos((this->localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration);
[3330]505}
506
507/**
508   \brief calculates the Rotation for the localTime of the Track.
509   \returns the calculated Rotation
510*/
[3332]511Vector TrackManager::calcDir() const
[3330]512{
[3373]513  return this->currentTrackElem->curve->calcDir((this->localTime - this->currentTrackElem->startingTime)/this->currentTrackElem->duration);
[3330]514}
515
516/**
517   \brief Advances the local-time of the Track around dt
518   \param dt The time about which to advance.
[3333]519
520   This function also checks, if the TrackElement has to be changed.
[3330]521*/
522void TrackManager::tick(float dt)
523{
[3371]524  dt /= 1000;
[3373]525  printf("CurrentTrackID: %d, LocalTime is: %f, timestep is: %f\n", this->currentTrackElem->ID, this->localTime, dt);
[3348]526  if (this->localTime <= this->firstTrackElem->duration)
527    this->jumpTo(this->localTime);
[3332]528  this->localTime += dt;
[3373]529  if (this->localTime > this->currentTrackElem->endTime
530      && this->currentTrackElem->children)
531    {
532      if (this->currentTrackElem->jumpTime > 0) 
533        this->jumpTo(this->localTime + this->currentTrackElem->jumpTime);
534      this->currentTrackElem = this->currentTrackElem->children[0];
535    }
[3371]536  if (this->bindSlave)
537    {
538      Vector tmp = this->calcPos();
[3375]539      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)); 
[3371]540      this->bindSlave->setAbsCoor(&tmp);
541      this->bindSlave->setAbsDir(&quat);
542    }
[3330]543}
544
545/**
[3331]546   \brief Jumps to a certain point on the Track.
547   \param time The time on the Track to jump to.
548
549   This should be used to Jump backwards on a Track, because moving forward means to change between the Path. (it then tries to choose the default.)
550   Max is trackLengthMax.
551*/
552void TrackManager::jumpTo(float time)
553{
[3348]554  if (time == 0)
555    this->currentTrackElem = this->firstTrackElem;
556  this->localTime = time;
[3331]557}
558
559/**
[3330]560   \brief a Function that decides which Path we should follow.
561   \param graphID The Path to choose.
562   
563*/
564void TrackManager::choosePath(int graphID)
565{
566
567}
568
[3371]569/**
570   \brief Sets the PNode, that should be moved along the Tack
571   \param bindSlave the PNode to set
572*/
573void TrackManager::setBindSlave(PNode* bindSlave)
574{
575  if (!this->bindSlave)
576    this->bindSlave = bindSlave;
577}
[3350]578
579
580// DEBUG //
581
582/**
583   \brief Imports a model of the Graph into the OpenGL-environment.
584   \param dt The Iterator used in seconds for Painting the Graph.
585
586   This is for testing facility only. Do this if you want to see the Path inside the Level.
587   eventually this will all be packed into a gl-list.
588*/
589void TrackManager::drawGraph(float dt) const
590{
[3352]591
[3350]592  for (int i = 1; i <= trackElemCount; i++)
593    {
[3352]594      glBegin(GL_LINE_STRIP);
[3350]595      TrackElement* tmpElem = this->findTrackElementByID(i);
596      if (tmpElem->curve)
597        for(float f = 0.0; f < 1.0; f+=dt)
598          {
599            //      printf("%f, %f, %f\n",trackManager->calcPos().x, trackManager->calcPos().y, trackManager->calcPos().z);
600            Vector tmpVector = tmpElem->curve->calcPos(f);
601            glVertex3f(tmpVector.x, tmpVector.y, tmpVector.z);
602          }
[3352]603  glEnd();
[3350]604    }
605}
606
[3431]607/**
608   \brief outputs debug information about the trackManager
609   \param level how much debug
610*/
[3350]611void TrackManager::debug(unsigned int level) const
612{
[3468]613  PRINT(0)("=========================================\n");
614  PRINT(0)("= CLASS TRACKMANAGER::debug information =\n");
615  PRINT(0)("=========================================\n");
616  //  PRINT(0)("Status is: %
617  PRINT(0)(" Consists of %d elements\n", this->trackElemCount);
618  PRINT(0)(" localTime is: %f\n", this->localTime);
[3350]619  if (level >= 2)
620    {
621      for (int i = 1; i <= trackElemCount; i++)
622        {
623          TrackElement* tmpElem = this->findTrackElementByID(i);
[3468]624          PRINT(0)("--== TrackElement:%i ==--", tmpElem->ID);
[3350]625          if(tmpElem->name)
[3468]626            PRINT(0)("Name: %s::", tmpElem->name);
[3354]627          if(tmpElem->isFresh)
[3468]628            PRINT(0)("  -- has not jet eddited in any way --\n");
629          PRINT(0)("\n   TimeTable: startingTime=%f; endTime=%f; duration=%f; jumpTime=%f\n", tmpElem->startingTime, tmpElem->endTime, tmpElem->duration, tmpElem->jumpTime);
630          PRINT(0)("   consists of %d Points\n", tmpElem->nodeCount);
[3354]631          if (tmpElem->childCount == 0)
[3468]632            PRINT(0)("   has no child\n");
[3354]633          else if (tmpElem->childCount == 1)
[3468]634            PRINT(0)("   has 1 child: =%d=\n", tmpElem->children[0]->ID);
[3354]635          else if (tmpElem->childCount > 1)
[3351]636            {
[3468]637              PRINT(0)("   has %d children: ", tmpElem->childCount);
[3351]638              for(int i = 0; i < tmpElem->childCount; i++)
[3468]639                PRINT(0)("=%d= ", tmpElem->children[i]->ID);
640              PRINT(0)("\n");
[3351]641            }
[3354]642
643          if(tmpElem->isHotPoint)
[3468]644            PRINT(0)("   is a special Point:\n");
[3354]645          if(tmpElem->isSavePoint)
[3468]646            PRINT(0)("    is a SavePoint\n");
[3354]647          if(tmpElem->isFork)
648            {
[3468]649              PRINT(0)("    is A Fork with with %d children.\n", tmpElem->childCount);
[3354]650            }
[3350]651          if(tmpElem->isJoined)
[3468]652            PRINT(0)("   is Joined at the End\n");
653
654          if(!tmpElem->backLoopCheck(tmpElem)) /* this should not happen */
655            PRINT(2)(" THERE IS A BACKLOOP TO THIS ELEMENT\n");
[3350]656        }
657    }
[3468]658  PRINT(0)("-----------------------------------------\n");
[3350]659}
Note: See TracBrowser for help on using the repository browser.