X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Flayout.h;h=d5aad2634fbbe2343f4f2d38027347b531957f2b;hb=5116fff210cdc3f0fbdae13046cc60450aad5e8f;hp=6dbdb7bcb62ebd760c970a35c7b0a376d0d4b289;hpb=495c54e187ddbb7514c983e1829a69d82ccad5f3;p=r2c2.git diff --git a/source/3d/layout.h b/source/3d/layout.h index 6dbdb7b..d5aad26 100644 --- a/source/3d/layout.h +++ b/source/3d/layout.h @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2006-2011 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #ifndef R2C2_3D_LAYOUT_H_ #define R2C2_3D_LAYOUT_H_ @@ -19,20 +12,18 @@ Distributed under the GPL namespace R2C2 { class Object3D; -class Track3D; -class Vehicle3D; +class Utility3D; 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; + std::set utilities; Msp::GL::InstanceScene scene; Msp::GL::SimpleScene ep_scene; Msp::GL::InstanceScene path_scene; @@ -44,17 +35,21 @@ 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 &); + + template + T &get(Object &o) const + { return dynamic_cast(get(o)); } - void add_vehicle(Vehicle3D &); - void remove_vehicle(Vehicle3D &); - Vehicle3D &get_vehicle(Vehicle &) const; + void add(Utility3D &); + void remove(Utility3D &); Msp::GL::Scene &get_scene() { return scene; } Msp::GL::Scene &get_endpoint_scene() { return ep_scene; } @@ -62,10 +57,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