X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftracktype.h;h=afc85215bfe0366e0e107d21371a218ea8ab282a;hb=8b7d4054b05002d82338775ac9b4ee764a8560e4;hp=cc0cc517bffbff9686c8c6cae3a41fc139bdcfe6;hpb=d15ac13f2e170f155b4bbd124df48400c339b644;p=r2c2.git diff --git a/source/libr2c2/tracktype.h b/source/libr2c2/tracktype.h index cc0cc51..afc8521 100644 --- a/source/libr2c2/tracktype.h +++ b/source/libr2c2/tracktype.h @@ -1,14 +1,15 @@ #ifndef LIBR2C2_TRACKTYPE_H_ #define LIBR2C2_TRACKTYPE_H_ -#include +#include #include "articlenumber.h" #include "geometry.h" +#include "objecttype.h" #include "trackpart.h" namespace R2C2 { -class TrackType +class TrackType: public ObjectType { public: struct Endpoint @@ -18,9 +19,12 @@ public: unsigned paths; Endpoint(float, float, float, unsigned); + + bool has_path(unsigned p) const { return paths&(1< + class Loader: public Msp::DataFile::DerivedObjectLoader { private: bool state_bits_set; @@ -35,8 +39,6 @@ public: }; private: - ArticleNumber art_nr; - std::string description; std::vector parts; std::vector endpoints; unsigned state_bits; @@ -46,8 +48,6 @@ private: public: TrackType(const ArticleNumber &); - const ArticleNumber &get_article_number() const { return art_nr; } - const std::string &get_description() const { return description; } float get_total_length() const; float get_path_length(int) const; unsigned get_paths() const; @@ -61,6 +61,7 @@ public: const std::vector &get_endpoints() const { return endpoints; } const Endpoint &get_endpoint(unsigned) const; TrackPoint get_point(unsigned, unsigned, float) const; + TrackPoint get_nearest_point(const Vector &) const; bool collide_ray(const Vector &, const Vector &, float) const; private: