Index: orxonox/trunk/src/lib/math/curve.h
===================================================================
--- orxonox/trunk/src/lib/math/curve.h	(revision 3835)
+++ orxonox/trunk/src/lib/math/curve.h	(revision 3836)
@@ -13,5 +13,5 @@
 
 //! An Enumerator that defines what sort of Curves are availible
-enum CurveType {BEZIERCURVE};
+enum CurveType {CURVE_BEZIER};
 
 
Index: orxonox/trunk/src/track_manager.cc
===================================================================
--- orxonox/trunk/src/track_manager.cc	(revision 3835)
+++ orxonox/trunk/src/track_manager.cc	(revision 3836)
@@ -372,16 +372,19 @@
   this->setClassName("TrackManager");
   
-  TrackManager::singletonRef = this;
+  TrackManager::singletonRef = this; // do this because otherwise the TrackNode cannot get The instance of the TrackManager
 
   PRINTF(3)("Initializing the TrackManager\n");
+  // setting up the First TrackElement
   this->firstTrackElem = new TrackElement();
   this->firstTrackElem->ID = 1;
   this->currentTrackElem = firstTrackElem;
+
+  this->curveType = CURVE_BEZIER;
   this->localTime = 0;
   this->maxTime = 0;
   this->trackElemCount = 1;
-  this->setBindSlave(this->trackNode = new TrackNode());
-}
-
+  this->trackNode = new TrackNode();
+  this->setBindSlave(this->trackNode);
+}
 
 /**
@@ -394,4 +397,6 @@
   PRINTF(4)("Deleting all the TrackElements\n");
   delete this->firstTrackElem;
+
+  // the tracknode should be deleted here, but is deleted by pNode: -> null_parent
 
   // we do not have a TrackManager anymore
@@ -414,36 +419,39 @@
 }
 
+
+// INITIALIZE //
 /**
    \brief reserves Space for childCount children
    \param childCount The Count of children to make space for.
-*/
-void TrackManager::initChildren(unsigned int childCount)
-{
-  this->currentTrackElem->childCount = childCount;
-  this->currentTrackElem->mainJoin = true;
-  this->currentTrackElem->children =  new tList<TrackElement>();
+   \param trackElem The TrackElement to appy this to. (if NULL chose this->currentTrackElement)
+*/
+void TrackManager::initChildren(unsigned int childCount, TrackElement* trackElem)
+{
+  if (!trackElem)
+    trackElem = this->currentTrackElem;
+
+  trackElem->childCount = childCount;
+  trackElem->mainJoin = true;  // this tells join, that this one is the Main Join, if it tries to join multiple Tracks
+  trackElem->children =  new tList<TrackElement>();
   for (int i = 0; i < childCount; i++)
     {
+      // create a new Element
       TrackElement* newElem = new TrackElement();
-      this->currentTrackElem->children->add(newElem);
+      // setting up the new ID
       newElem->ID = ++trackElemCount;
-      newElem->startingTime = this->currentTrackElem->endTime + this->currentTrackElem->jumpTime;
-      this->addPoint(this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()), this->currentTrackElem->getChild(i));
-    }
+      // setting up the Time
+      newElem->startingTime = trackElem->endTime + trackElem->jumpTime;
+      // adds the conection Point
+      this->addPoint(trackElem->curve->getNode(trackElem->curve->getNodeCount()),
+		     newElem);
+      // add the new child to the childList.
+      trackElem->children->add(newElem);
+    }
+
+  // setting the Name of the new TrackElement to the name of the last one, if the childCount is one
   if (childCount == 1)
-    this->currentTrackElem->getChild(0)->setName(this->currentTrackElem->getName());
-}
-
-/**
-   \brief Searches for a given trackID.
-   \param trackID the trackID to search for.
-   \returns The TrackElement #trackID if found, NULL otherwise.
-*/
-TrackElement* TrackManager::findTrackElementByID(unsigned int trackID) const
-{
-  return firstTrackElem->findByID(trackID);
-}
-
-// INITIALIZE //
+    trackElem->getChild(0)->setName(trackElem->getName());
+}
+
 
 /**
@@ -453,11 +461,24 @@
 void TrackManager::workOn(unsigned int trackID)
 {
-  TrackElement* tmpElem = findTrackElementByID(trackID);
+  TrackElement* tmpElem = this->firstTrackElem->findByID(trackID);
   if (tmpElem)
     this->currentTrackElem = tmpElem;
   else
-    PRINTF(2)("TrackElement not Found, leaving unchanged\n");
+    PRINTF(2)("TrackElement %d not Found, leaving unchanged\n", trackID);
   PRINTF(4)("now Working on %d\n", this->currentTrackElem->ID);
-
+}
+
+/**
+   \brief Sets the TrackElement to work on
+   \param trackName the Name of the Track to work on
+*/
+void TrackManager::workOn(const char* trackName)
+{
+  TrackElement* tmpElem = this->firstTrackElem->findByName(trackName);
+  if (tmpElem)
+    this->currentTrackElem = tmpElem;
+  else
+    PRINTF(2)("TrackElement %s not Found, leaving unchanged\n", trackName);
+  PRINTF(4)("now Working on %d\n", this->currentTrackElem->ID);
 }
 
@@ -466,4 +487,6 @@
    \param curveType The Type to set
    \param trackElem the TrackElement that should get a new Curve.
+
+   \brief this will possibly get obsolete during the process.
 */
 void TrackManager::setCurveType(CurveType curveType, TrackElement* trackElem)
@@ -477,8 +500,7 @@
   switch (curveType)
     {
-    case BEZIERCURVE:
+    case CURVE_BEZIER:
       trackElem->curve = new BezierCurve();
       break;
-
     }
 }
@@ -486,20 +508,14 @@
 /**
    \brief Sets the duration of the current path in seconds.
-   \param time The duration in seconds.
-*/
-
-void TrackManager::setDuration(float time)
-{
-  this->currentTrackElem->duration = time;
-  this->currentTrackElem->endTime = this->currentTrackElem->startingTime + time;
-}
-
-/**
-   \brief adds a point to the current TrackElement
-   \param newPoint The point to add.
-*/
-bool TrackManager::addPoint(Vector newPoint)
-{
-  return this->addPoint(newPoint, this->currentTrackElem);
+   \param duration The duration in seconds.
+   \param trackElem The TrackElement to apply this to.
+*/
+void TrackManager::setDuration(float duration, TrackElement* trackElem)
+{
+  if (!trackElem)
+    trackElem = this->currentTrackElem;
+
+  trackElem->duration = duration;
+  trackElem->endTime = trackElem->startingTime + duration;
 }
 
@@ -511,4 +527,7 @@
 bool TrackManager::addPoint(Vector newPoint, TrackElement* trackElem)
 {
+  if (!trackElem)
+    trackElem = this->currentTrackElem;
+
   if (trackElem->isFresh)
     {
@@ -525,16 +544,18 @@
    \returns A Pointer to a newly appended Curve
 */
-int TrackManager::addHotPoint(Vector newPoint)
-{
+int TrackManager::addHotPoint(Vector newPoint, TrackElement* trackElem)
+{
+  if (!trackElem)
+    trackElem = this->currentTrackElem;
+
   PRINTF(4)("setting up a HotPoint\n");
-  if (this->currentTrackElem->isFresh)
-    {
-      this->setCurveType(BEZIERCURVE);
-      this->currentTrackElem->isFresh = false;
+  if (trackElem->isFresh)
+    {
+      trackElem->isFresh = false;
     }
 
   // \todo HotPoint Handling.
-  this->currentTrackElem->curve->addNode(newPoint);
-  this->currentTrackElem->nodeCount++;
+  trackElem->curve->addNode(newPoint);
+  trackElem->nodeCount++;
   this->initChildren(1);
   this->currentTrackElem = this->currentTrackElem->getChild(0);
@@ -622,5 +643,5 @@
 void TrackManager::condition(unsigned int groupID, CONDITION cond, void* subject)
 {
-  TrackElement* tmpElem = this->findTrackElementByID(groupID);
+  TrackElement* tmpElem = this->firstTrackElem->findByID(groupID);
   if (!tmpElem->isFork)
     {
@@ -688,5 +709,5 @@
 
   // checking if there is a back-loop-connection and ERROR if it is.
-  TrackElement* tmpTrackElem = this->findTrackElementByID(trackIDs[0]);
+  TrackElement* tmpTrackElem = this->firstTrackElem->findByID(trackIDs[0]);
   if (!tmpTrackElem->backLoopCheck(tmpTrackElem))
     PRINTF(2)("Backloop connection detected at joining trackElements\n");
@@ -708,5 +729,5 @@
   for (int i = 0; i < count; i++)
     {
-      TrackElement* tmpJoinElem = this->findTrackElementByID(trackIDs[i]);
+      TrackElement* tmpJoinElem = this->firstTrackElem->findByID(trackIDs[i]);
       if (tmpJoinElem->childCount == 0
 	  && tmpJoinElem->endTime > tmpLatestTime)
@@ -719,5 +740,5 @@
   for (int i = 1; i < count; i++)
     {
-      TrackElement* tmpJoinElem = this->findTrackElementByID(trackIDs[i]);
+      TrackElement* tmpJoinElem = this->firstTrackElem->findByID(trackIDs[i]);
       if (tmpJoinElem->childCount > 0)
 	printf("!!This Curve has children, and as such will not be joined!!\n You can try joining other childless TrackElements to this one!");
@@ -767,5 +788,5 @@
   for (int i = 1; i<= trackElemCount ;i++)
     {
-      TrackElement* tmpElem = findTrackElementByID(i);
+      TrackElement* tmpElem = this->firstTrackElem->findByID(i);
       if( tmpElem->childCount > 0 && tmpElem->mainJoin)
 	{
@@ -799,6 +820,6 @@
     }
   for (int i = 1; i <=trackElemCount;i++)
-    if (this->findTrackElementByID(i)->endTime > this->maxTime)
-      this->maxTime = findTrackElementByID(i)->endTime; // very bad implemented :/
+    if (this->firstTrackElem->findByID(i)->endTime > this->maxTime)
+      this->maxTime = this->firstTrackElem->findByID(i)->endTime; // very bad implemented :/
 }
 
@@ -925,5 +946,5 @@
     {
       glBegin(GL_LINE_STRIP);
-      TrackElement* tmpElem = this->findTrackElementByID(i);
+      TrackElement* tmpElem = this->firstTrackElem->findByID(i);
       if (tmpElem->curve)
 	for(float f = 0.0; f < 1.0; f+=dt)
@@ -953,5 +974,5 @@
       for (int i = 1; i <= trackElemCount; i++)
 	{
-	  TrackElement* tmpElem = this->findTrackElementByID(i);
+	  TrackElement* tmpElem = this->firstTrackElem->findByID(i);
 	  tmpElem->debug();
 	}
Index: orxonox/trunk/src/track_manager.h
===================================================================
--- orxonox/trunk/src/track_manager.h	(revision 3835)
+++ orxonox/trunk/src/track_manager.h	(revision 3836)
@@ -21,5 +21,5 @@
 
 //! The Default Curve-Type to set for the whole path (if not chosen otherwise).
-#define TMAN_DEFAULT_CURVETYPE BEZIERCURVE
+#define TMAN_DEFAULT_CURVETYPE CURVE_BEZIER
 #define TMAN_DEFAULT_DURATION 10
 #define TMAN_DEFAULT_WIDTH    10
@@ -139,8 +139,6 @@
   PNode* trackNode;                   //!< The main TrackNode of this Track.
   
-  void initChildren(unsigned int childCount);
+  void initChildren(unsigned int childCount, TrackElement* trackElem = NULL);
 
-  TrackElement* findTrackElementByID(unsigned int trackID) const;
-  
  public:
   virtual ~TrackManager(void);
@@ -150,11 +148,12 @@
   // Methods to change the Path (initialisation)
   void workOn(unsigned int trackID);
+  void workOn(const char* trackName);
+
   /** \see setCurveType(CurveType curveType, TrackElement* trackElem); \param curveType the type of the Curve */
   inline void setCurveType(CurveType curveType) { this->setCurveType (curveType, this->currentTrackElem);};
   void setCurveType(CurveType curveType, TrackElement* trackElem);
-  void setDuration(float time);
-  bool addPoint(Vector newPoint);
-  bool addPoint(Vector newPoint, TrackElement* trackElem);
-  int addHotPoint(Vector newPoint);
+  void setDuration(float duration, TrackElement* trackElem = NULL);
+  bool addPoint(Vector newPoint, TrackElement* trackElem = NULL);
+  int addHotPoint(Vector newPoint, TrackElement* trackElem = NULL);
   int setSavePoint(void);
   void fork(unsigned int count, ...);
Index: orxonox/trunk/src/track_node.h
===================================================================
--- orxonox/trunk/src/track_node.h	(revision 3835)
+++ orxonox/trunk/src/track_node.h	(revision 3836)
@@ -17,5 +17,6 @@
 class TrackManager;
 
-class TrackNode : public PNode {
+class TrackNode : public PNode 
+{
 
  public:
