X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Flayout.h;h=df414f2578b0cc5f85ffe7a88f01f1ffb4e87ad3;hb=7fac28fcb5afb17eff7c459474e4cf884a02719c;hp=76f1b91d7a3c21ee577c183c732f28151415df5e;hpb=d15ac13f2e170f155b4bbd124df48400c339b644;p=r2c2.git diff --git a/source/3d/layout.h b/source/3d/layout.h index 76f1b91..df414f2 100644 --- a/source/3d/layout.h +++ b/source/3d/layout.h @@ -12,20 +12,16 @@ namespace R2C2 { class Object3D; -class Track3D; -class Vehicle3D; class Layout3D: public sigc::trackable { public: - typedef std::map TrackMap; - typedef std::map VehicleMap; + typedef std::map ObjectMap; private: Layout &layout; Catalogue3D catalogue; - TrackMap tracks; - VehicleMap vehicles; + ObjectMap objects; Msp::GL::InstanceScene scene; Msp::GL::SimpleScene ep_scene; Msp::GL::InstanceScene path_scene; @@ -37,17 +33,18 @@ public: ~Layout3D(); Layout &get_layout() const { return layout; } + Catalogue3D &get_catalogue() { return catalogue; } const Catalogue3D &get_catalogue() const { return catalogue; } void get_bounds(Vector &, Vector &) const; - void add_track(Track3D &); - void remove_track(Track3D &); - const TrackMap &get_tracks() const { return tracks; } - Track3D &get_track(Track &) const; + void add(Object3D &); + Object3D &get(Object &) const; + const ObjectMap &get_all() const { return objects; } + void remove(Object3D &); - void add_vehicle(Vehicle3D &); - void remove_vehicle(Vehicle3D &); - Vehicle3D &get_vehicle(Vehicle &) const; + template + T &get(Object &o) const + { return dynamic_cast(get(o)); } Msp::GL::Scene &get_scene() { return scene; } Msp::GL::Scene &get_endpoint_scene() { return ep_scene; } @@ -55,10 +52,8 @@ public: const Msp::GL::Lighting &get_lighting() const { return lighting; } private: - void track_added(Track &); - void track_removed(Track &); - void vehicle_added(Vehicle &); - void vehicle_removed(Vehicle &); + void object_added(Object &); + void object_removed(Object &); }; } // namespace R2C2