X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Fcatalogue.h;h=46cdb5fb21c150d2d10c974b4969569b65d176af;hb=508ee4bfcc0f8fb1373fb7af251c59c873ef896f;hp=5a9156097380cbebbc9bb4aa5113da65c0a96838;hpb=2220ba2f11705ea9a4e480603d43ab7ed4cf5a89;p=r2c2.git diff --git a/source/libr2c2/catalogue.h b/source/libr2c2/catalogue.h index 5a91560..46cdb5f 100644 --- a/source/libr2c2/catalogue.h +++ b/source/libr2c2/catalogue.h @@ -1,67 +1,44 @@ #ifndef LIBR2C2_CATALOGUE_H_ #define LIBR2C2_CATALOGUE_H_ -#include -#include -#include "articlenumber.h" +#include +#include +#include #include "layout.h" -#include "profile.h" namespace R2C2 { class ObjectType; -class Catalogue +class Catalogue: public Msp::DataFile::Collection { public: - class Loader: public Msp::DataFile::ObjectLoader + class Loader: public Msp::DataFile::Collection::Loader { + private: + Catalogue &cat; + public: Loader(Catalogue &); private: - void ballast_profile(); - void gauge(float); void layout(); - void rail_profile(); void scale(float, float); - void signal(ArticleNumber); - void terrain(ArticleNumber); - void track(ArticleNumber); - void vehicle(ArticleNumber); }; - typedef std::map ObjectMap; - - sigc::signal signal_object_added; + sigc::signal signal_source_added; private: float scale; - float gauge; - Profile rail_profile; - Profile ballast_profile; - std::string track_technique; - ObjectMap objects; Layout layout; + std::list sources; public: Catalogue(); - ~Catalogue(); - 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 std::string &get_track_technique() const { return track_technique; } - - void add(ObjectType &); - const ObjectType &get(const ArticleNumber &) const; - const ObjectMap &get_all() const { return objects; } - - template - const T &get(const ArticleNumber &an) const - { return dynamic_cast(get(an)); } + void add_source(const Msp::FS::Path &); + const std::list &get_sources() const { return sources; } + float get_scale() const { return scale; } Layout &get_layout() { return layout; } };