00001
00002
00003
00004
00005 #ifndef GEOMETRY_TRACK_H
00006 #define GEOMETRY_TRACK_H
00007
00008 #include "geometry/GeomObject.h"
00009 #include "geometry/Point.h"
00010 class Ray;
00011 #include <string>
00012 #include <vector>
00013
00015 class Track : public GeomObject
00016 {
00017 public:
00019 Track( Ray* first, bool charged=true);
00021 ~Track();
00022
00023 GeomObject& transform(const CoordTransform&);
00024
00026 void addSegment( Ray* next );
00027
00029 Point position( double s ) const;
00030 Vector direction( double s ) const;
00031
00032 bool charged()const{return m_charged;}
00033
00034 const char *nameOf() const { return "Track"; }
00035 void printOn( std::ostream& os = std::cout ) const;
00036
00037
00038 typedef std::vector<Ray*> Raylist;
00039
00040 typedef Raylist::const_iterator const_iterator;
00041 typedef Raylist::iterator iterator;
00042 const_iterator begin()const{return rayList.begin();}
00043 const_iterator end()const{return rayList.end();}
00044 iterator begin() {return rayList.begin();}
00045 iterator end() {return rayList.end();}
00046
00047 private:
00048 void findSegment( double s );
00049
00050
00051 static Ray* currentRay;
00052 static double currentArcLength;
00053
00054
00055
00056 static float maxKink;
00057
00058
00059
00060 bool m_charged;
00061 float arclength;
00062
00063
00064 Raylist rayList;
00065 };
00066
00067 #endif
00068