X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fvehicletype.h;h=c0fe0ea5136f3c56bf7a94a6089fe2cc7db64a88;hb=3fa2b4016a4573be61f48c1dd4162c1dbc3372ba;hp=b97fb921519212f8b74e7d1681514ed3dacd4971;hpb=1ff06c5bc46a677fa389ef86c6b26664368f1653;p=r2c2.git diff --git a/source/libr2c2/vehicletype.h b/source/libr2c2/vehicletype.h index b97fb92..c0fe0ea 100644 --- a/source/libr2c2/vehicletype.h +++ b/source/libr2c2/vehicletype.h @@ -10,6 +10,7 @@ Distributed under the GPL #include #include "articlenumber.h" +#include "geometry.h" namespace R2C2 { @@ -18,6 +19,9 @@ class VehicleType public: class Loader: public Msp::DataFile::ObjectLoader { + private: + std::map rod_tags; + public: Loader(VehicleType &); private: @@ -26,6 +30,7 @@ public: void function(unsigned, const std::string &); void height(float); void length(float); + void rod(); void width(float); }; @@ -67,6 +72,57 @@ public: Bogie(); }; + struct Rod + { + enum Anchor + { + BODY, + AXLE, + BOGIE_AXLE, + ROD + }; + + enum Limit + { + FIXED, + ROTATE, + SLIDE_X + }; + + class Loader: public Msp::DataFile::ObjectLoader + { + private: + const std::map &tags; + std::string tag; + + public: + Loader(Rod &, const std::map &); + const std::string &get_tag() const { return tag; } + private: + void connect(const std::string &, float, float, float, float); + void limit(Limit); + void pivot_body(); + void pivot_axle(unsigned); + void pivot_bogie_axle(unsigned, unsigned); + void pivot_rod(const std::string &); + void position(float, float, float); + void set_tag(const std::string &); + }; + + Anchor pivot; + unsigned pivot_index; + unsigned pivot_index2; + Point pivot_point; + Limit limit; + int connect_index; + Point connect_point; + Point connect_offset; + std::string object; + bool mirror_object; + + Rod(); + }; + private: ArticleNumber art_nr; std::string name; @@ -77,6 +133,7 @@ private: float height; std::vector axles; std::vector bogies; + std::vector rods; std::string object; public: @@ -92,6 +149,7 @@ public: float get_height() const { return height; } const std::vector &get_axles() const { return axles; } const std::vector &get_bogies() const { return bogies; } + const std::vector &get_rods() const { return rods; } float get_front_axle_offset() const; float get_back_axle_offset() const; const std::string &get_object() const { return object; }