Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Track.h

Go to the documentation of this file.
00001 // $Heading: Track.h $
00002 //   Author: T. Burnett
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> // gcc bug
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    // used to find the right segment
00050 
00051    static Ray* currentRay;
00052    static double currentArcLength;
00053    // set by findSegment
00054 
00055 
00056    static float maxKink;
00057    // maximum angle tolerated in line segment approximation to
00058    // curved tracks.
00059 
00060     bool m_charged;     // true if charged
00061    float arclength;      // length along the Track
00062 
00063 
00064    Raylist rayList; // the list of Rays
00065 };
00066 
00067 #endif
00068 

Generated at Mon Nov 26 18:18:21 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000