]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/vehicletype.h
Rename Point to Vector
[r2c2.git] / source / libr2c2 / vehicletype.h
index c0fe0ea5136f3c56bf7a94a6089fe2cc7db64a88..97942af02c2381eec34e4fc5fb1fd5a11dd47379 100644 (file)
@@ -53,6 +53,8 @@ public:
                Axle();
        };
 
+       typedef std::vector<Axle> AxleArray;
+
        struct Bogie
        {
                class Loader: public Msp::DataFile::ObjectLoader<Bogie>
@@ -65,13 +67,15 @@ public:
                };
 
                float position;
-               std::vector<Axle> axles;
+               AxleArray axles;
                std::string object;
                bool rotate_object;
 
                Bogie();
        };
 
+       typedef std::vector<Bogie> BogieArray;
+
        struct Rod
        {
                enum Anchor
@@ -112,17 +116,19 @@ public:
                Anchor pivot;
                unsigned pivot_index;
                unsigned pivot_index2;
-               Point pivot_point;
+               Vector pivot_point;
                Limit limit;
                int connect_index;
-               Point connect_point;
-               Point connect_offset;
+               Vector connect_point;
+               Vector connect_offset;
                std::string object;
                bool mirror_object;
 
                Rod();
        };
 
+       typedef std::vector<Rod> RodArray;
+
 private:
        ArticleNumber art_nr;
        std::string name;
@@ -131,9 +137,9 @@ private:
        float length;
        float width;
        float height;
-       std::vector<Axle> axles;
-       std::vector<Bogie> bogies;
-       std::vector<Rod> rods;
+       AxleArray axles;
+       BogieArray bogies;
+       RodArray rods;
        std::string object;
 
 public:
@@ -147,9 +153,13 @@ public:
        float get_length() const { return length; }
        float get_width() const { return width; }
        float get_height() const { return height; }
-       const std::vector<Axle> &get_axles() const { return axles; }
-       const std::vector<Bogie> &get_bogies() const { return bogies; }
-       const std::vector<Rod> &get_rods() const { return rods; }
+       const AxleArray &get_axles() const { return axles; }
+       const Axle &get_axle(unsigned) const;
+       const BogieArray &get_bogies() const { return bogies; }
+       const Bogie &get_bogie(unsigned) const;
+       const Axle &get_bogie_axle(unsigned, unsigned) const;
+       const RodArray &get_rods() const { return rods; }
+       const Rod &get_rod(unsigned) const;
        float get_front_axle_offset() const;
        float get_back_axle_offset() const;
        const std::string &get_object() const { return object; }