Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4489 in orxonox.OLD for orxonox/trunk/src/util


Ignore:
Timestamp:
Jun 3, 2005, 1:21:05 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: track: doxy-tags, redesign, and minor speed-update

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

Legend:

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

    r4320 r4489  
    148148   \brief checks if there are any BackLoops in the Track (Backloops only
    149149   \param trackElem the trackElement to check about
     150   \param depth the depth to search in
    150151   \returns true if NO loop was found, false Otherwise
    151152   You actually have to act on false!!
    152153   it simply does this by looking if the current trackElem is found again somewhere else in the Track
     154
     155   \todo this has to be reimplemented
    153156*/
    154157bool TrackElement::backLoopCheck(const TrackElement* trackElem, unsigned int depth) const
     
    177180
    178181/**
    179    \param childNumber which child to return
     182   \param childCount which child to return
    180183   \returns the n-the children (starting at 0).
    181184   Be aware, that when the trackElement has no Children, NULL will be returned
     
    217220
    218221/**
    219    \returns The name of this TrackElement
    220 */
    221 const char* TrackElement::getName(void) const
    222 {
    223   return this->name;
    224 }
    225 
    226 /**
    227222   \brief prints out debug information about this TrackElement
    228223*/
     
    404399   \param root the TiXmlElement to load the Data from
    405400*/
    406 bool TrackManager::load( TiXmlElement* root)
     401bool TrackManager::loadParams( TiXmlElement* root)
    407402{
    408403  TiXmlElement* element;
     
    489484}
    490485
    491 
    492 
    493486/**
    494487   \brief standard destructor
     
    509502//! Singleton Reference to TrackManager
    510503TrackManager* TrackManager::singletonRef = NULL;
    511 
    512 /**
    513    \returns The reference on the TrackManager.
    514 
    515    If the TrackManager does not exist, it will be created.
    516 */
    517 TrackManager* TrackManager::getInstance(void)
    518 {
    519   if (!TrackManager::singletonRef)
    520     TrackManager::singletonRef = new TrackManager();
    521   return TrackManager::singletonRef;
    522 }
    523 
    524504
    525505// INITIALIZE //
     
    655635   \brief adds save/splitpoint.
    656636   \param newPoint The point to add.
     637   \param trackElem if supplied it will add a hotpoint on this TrackElement
    657638   \returns A Pointer to a newly appended Curve
    658639*/
     
    721702
    722703/**
    723    \param string the String to parse.
     704   \param count how many children to produce
     705   \param ... the information on the children (these are the Stings of their names
    724706   \see TrackManager::fork(unsigned int count, ...)
    725707
     
    760742   \param count The Count of childrens the current HotPoint will have.
    761743   \param trackIDs A Pointer to an Array of ints which will hold the trackID's (the user will have to reserve space for this).
     744   \param trackNames the names for the tracks as a char-arrey-array
    762745   \param trackElem The TrackElement to appy this to. (if NULL choose this->currentTrackElement)
    763746   \see TrackManager::fork(unsigned int count, ...)
  • orxonox/trunk/src/util/track/track_manager.h

    r4381 r4489  
    1616
    1717#ifndef NULL
    18 #define NULL 0
     18#define NULL   0  //!< NULL
    1919#endif
    2020
     
    2828// Static Definitions
    2929
    30 //! The Default Curve-Type to set for the whole path (if not chosen otherwise).
    31 #define TMAN_DEFAULT_CURVETYPE CURVE_BEZIER
    32 #define TMAN_DEFAULT_DURATION 10
    33 #define TMAN_DEFAULT_WIDTH    10
     30//! The default Curve-Type to set for the whole path (if not chosen otherwise).
     31#define TMAN_DEFAULT_CURVETYPE    CURVE_BEZIER
     32//! A default value for the duration for each TrackElement
     33#define TMAN_DEFAULT_DURATION     10
     34//! A default width for the width of a TrackElement
     35#define TMAN_DEFAULT_WIDTH        10
    3436
    3537//! A Graph-Element, that holds the curve-structure of a Level.
     
    5052  TrackElement* getChild(int childNumber) const;
    5153  void setName(const char* name);
    52   const char* getName(void) const;
     54  /** \returns the Name of this TrackElement */
     55  inline const char* getName(void) const { return this->name; };
     56
    5357
    5458  // atributes
    55   bool isFresh;              //!< If no Points where added until now
    56   bool isHotPoint;           //!< If the first node is a specialPoint;
    57   bool isSavePoint;          //!< If the first node is a savePoint
    58   bool isFork;               //!< If the first node is a Fork
    59   bool isJoined;             //!< If the End of the Curve is joined.
    60   bool mainJoin;             //!< If the End of the Curve is joined, and this is the one Curve the others join to.
    61   int ID;                    //!< The ID of this TrackElement
    62   float startingTime;        //!< The time at which this Track begins.
    63   float duration;            //!< The time used to cross this TrackElement (curve).
    64   float endTime;             //!< The time at which this Track ends.
    65   float jumpTime;            //!< The Time this Track has to jump to its preceding Track (only >0 if Track isJoined==true)
    66   float width;               //!< Th width of the Path. This tells the Player(s), how far he(they) can go to the left/right.
    67   int nodeCount;             //!< The count of points this TrackElement has.
    68   Curve* curve;              //!< The Curve of this TrackElement
    69   int childCount;            //!< The number of Children This TrackElement has.
    70   tList<TrackElement>* children;   //!< A TrackElement can have a Tree of following TrackElements.
     59  bool                  isFresh;              //!< If no Points where added until now
     60  bool                  isHotPoint;           //!< If the first node is a specialPoint;
     61  bool                  isSavePoint;          //!< If the first node is a savePoint
     62  bool                  isFork;               //!< If the first node is a Fork
     63  bool                  isJoined;             //!< If the End of the Curve is joined.
     64  bool                  mainJoin;             //!< If the End of the Curve is joined, and this is the one Curve the others join to.
     65  int                   ID;                   //!< The ID of this TrackElement
     66  float                 startingTime;         //!< The time at which this Track begins.
     67  float                 duration;             //!< The time used to cross this TrackElement (curve).
     68  float                 endTime;              //!< The time at which this Track ends.
     69  float                 jumpTime;             //!< The Time this Track has to jump to its preceding Track (only >0 if Track isJoined==true)
     70  float                 width;                //!< Th width of the Path. This tells the Player(s), how far he(they) can go to the left/right.
     71  int                   nodeCount;            //!< The count of points this TrackElement has.
     72  Curve*                curve;                //!< The Curve of this TrackElement
     73  int                   childCount;           //!< The number of Children This TrackElement has.
     74  tList<TrackElement>*  children;             //!< A TrackElement can have a Tree of following TrackElements.
    7175
    7276
     
    133137class TrackManager : public BaseObject
    134138{
    135  private:
    136   TrackManager(void);
    137 
    138   static TrackManager* singletonRef;  //!< There may only be one TrackManager.
    139 
    140   TrackElement* firstTrackElem;       //!< The first TrackElement that exists.
    141   TrackElement* currentTrackElem;     //!< The TrackElement we are working on.
    142   CurveType curveType;                //!< The CurveType the entire TrackSystem will have.
    143   float localTime;                    //!< The time that has been passed since the traveling the Track.
    144   float maxTime;                      //!< The maximal time the track has.
    145   int trackElemCount;                 //!< The count of TrackElements that exist.
    146 
    147   // external
    148   PNode* bindSlave;                   //!< The node that is slave to the TrackManager. This node will be moved while update the TrackManager, and must NOT move itself.
    149   PNode* trackNode;                   //!< The main TrackNode of this Track.
    150   Text* trackText;                    //!< The text to display when switching between Worlds.
    151   tAnimation<Text>* textAnimation;    //!< An Animation for the Text.
    152  
    153   void initChildren(unsigned int childCount, TrackElement* trackElem = NULL);
    154 
    155139 public:
    156140  virtual ~TrackManager(void);
    157 
    158   static TrackManager* getInstance(void);
    159 
    160   bool load(TiXmlElement* root);
     141  /** \returns a Pointer to the only object of this Class */
     142  inline static TrackManager* getInstance(void) { if (!singletonRef) singletonRef = new TrackManager();  return singletonRef; };
     143
     144  bool loadParams(TiXmlElement* root);
    161145
    162146  // Methods to change the Path (initialisation)
     
    197181  void drawGraph(float dt) const;
    198182  void debug(unsigned int level) const;
     183
     184 private:
     185  TrackManager(void);
     186  void initChildren(unsigned int childCount, TrackElement* trackElem = NULL);
     187
     188 private:
     189  static TrackManager* singletonRef;           //!< There may only be one TrackManager.
     190
     191  TrackElement*        firstTrackElem;         //!< The first TrackElement that exists.
     192  TrackElement*        currentTrackElem;       //!< The TrackElement we are working on.
     193  CurveType            curveType;              //!< The CurveType the entire TrackSystem will have.
     194  float                localTime;              //!< The time that has been passed since the traveling the Track.
     195  float                maxTime;                //!< The maximal time the track has.
     196  int                  trackElemCount;         //!< The count of TrackElements that exist.
     197
     198  // external
     199  PNode*               bindSlave;              //!< The node that is slave to the TrackManager. This node will be moved while update the TrackManager, and must NOT move itself.
     200  PNode*               trackNode;              //!< The main TrackNode of this Track.
     201  Text*                trackText;              //!< The text to display when switching between Worlds.
     202  tAnimation<Text>*    textAnimation;          //!< An Animation for the Text. (for fading it out on trackName-change)
    199203};
    200204
  • orxonox/trunk/src/util/track/track_node.cc

    r4444 r4489  
    2727/**
    2828   \brief standard constructor
    29 
    30    \todo this constructor is not jet implemented - do it
    3129*/
    3230TrackNode::TrackNode ()
     
    4341/**
    4442   \brief standard deconstructor
    45 
    46    \todo this deconstructor is not jet implemented - do it
    4743*/
    4844TrackNode::~TrackNode ()
  • orxonox/trunk/src/util/track/track_node.h

    r4262 r4489  
    1717class TrackManager;
    1818
     19//! A node that follows the track.
    1920class TrackNode : public PNode
    2021{
     
    2223 public:
    2324  TrackNode ();
    24   TrackNode (const Vector& absCoordinate);
    25 
    2625  virtual ~TrackNode ();
    2726
    2827 private:
    29   TrackManager* trackManager;
     28  TrackManager* trackManager;         //!< reference to the TrackManager
    3029
    3130};
Note: See TracChangeset for help on using the changeset viewer.