]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/catalogue.h
Ignore the click that causes manipulator to finish
[r2c2.git] / source / libmarklin / catalogue.h
index d529cfc07969e18f8c17983359aadc5cd543e45b..a436994ecea6ae700268bd878d8c4a25135831be 100644 (file)
@@ -10,6 +10,7 @@ Distributed under the GPL
 
 #include <map>
 #include <msp/datafile/loader.h>
+#include "articlenumber.h"
 #include "layout.h"
 #include "profile.h"
 
@@ -32,9 +33,14 @@ public:
                void rail_profile();
                void scale(float, float);
                void track(unsigned);
+               void track(ArticleNumber);
                void vehicle(unsigned);
+               void vehicle(ArticleNumber);
        };
 
+       typedef std::map<ArticleNumber, TrackType *> TrackMap;
+       typedef std::map<ArticleNumber, VehicleType *> VehicleMap;
+
        sigc::signal<void, const TrackType &> signal_track_added;
        sigc::signal<void, const VehicleType &> signal_vehicle_added;
 
@@ -44,8 +50,8 @@ private:
        Profile rail_profile;
        Profile ballast_profile;
        Profile path_profile;
-       std::map<unsigned, TrackType *> tracks;
-       std::map<unsigned, VehicleType *> vehicles;
+       TrackMap tracks;
+       VehicleMap vehicles;
        Layout layout;
 
 public:
@@ -54,17 +60,18 @@ public:
 
        float get_scale() const { return scale; }
        float get_gauge() const { return gauge; }
+       float get_rail_elevation() const;
        const Profile &get_rail_profile() const { return rail_profile; }
        const Profile &get_ballast_profile() const { return ballast_profile; }
        const Profile &get_path_profile() const { return path_profile; }
 
        void add_track(TrackType &);
-       const TrackType &get_track(unsigned) const;
-       const std::map<unsigned, TrackType *> &get_tracks() const { return tracks; }
+       const TrackType &get_track(const ArticleNumber &) const;
+       const TrackMap &get_tracks() const { return tracks; }
 
        void add_vehicle(VehicleType &);
-       const VehicleType &get_vehicle(unsigned) const;
-       const std::map<unsigned, VehicleType *> &get_vehicles() const { return vehicles; }
+       const VehicleType &get_vehicle(const ArticleNumber &) const;
+       const VehicleMap &get_vehicles() const { return vehicles; }
 
        Layout &get_layout() { return layout; }
 };