X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Ftrackpart.h;h=aebe7ef7f2418cb7c9511663a928b694ce3cb1e6;hb=d27edb207810f0b4e44be8c3632d421faa5fed80;hp=de449b3a59e05e5d4c6c873b9ff8400a3db66396;hpb=3df8cb5c78fbb0b919bcb79677c6c788b8028482;p=r2c2.git diff --git a/source/libmarklin/trackpart.h b/source/libmarklin/trackpart.h index de449b3..aebe7ef 100644 --- a/source/libmarklin/trackpart.h +++ b/source/libmarklin/trackpart.h @@ -1,7 +1,7 @@ /* $Id$ This file is part of the MSP Märklin suite -Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa +Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa Distributed under the GPL */ @@ -14,8 +14,9 @@ Distributed under the GPL namespace Marklin { -struct TrackPart +class TrackPart { +public: class Loader: public Msp::DataFile::BasicLoader { public: @@ -25,17 +26,25 @@ struct TrackPart void start(float, float, float); }; - Point pos; - float dir; - float length; - float radius; - unsigned route; - bool dead_end; +private: + Point pos; + float dir; + float length; + float radius; + unsigned path; + bool dead_end; + TrackPart *links[2]; +public: TrackPart(); - void collect_endpoints(std::vector &) const; - Point get_point(float) const; + float get_length() const; + bool is_curved() const { return radius; } + TrackPoint get_point(float) const; + unsigned get_path() const { return path; } + bool is_dead_end() const { return dead_end; } + void check_link(TrackPart &); + TrackPart *get_link(unsigned) const; }; } // namespace Marklin