X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Flayout.h;h=c5169bd6f07ae4c201ff45e25c68a4b9121b0de3;hb=b3cc0d29a0fda2d48443d66881214c81a04b1729;hp=8456fa8e7404d62fbcec19a0792e3b35cc56e56a;hpb=e214fd389b9819eac0379cfb78e0f446e267b839;p=r2c2.git diff --git a/source/3d/layout.h b/source/3d/layout.h index 8456fa8..c5169bd 100644 --- a/source/3d/layout.h +++ b/source/3d/layout.h @@ -8,26 +8,23 @@ #include #include "libr2c2/layout.h" #include "catalogue.h" +#include "typemap.h" namespace R2C2 { -class Signal3D; -class Track3D; -class Vehicle3D; +class Object3D; +class Utility3D; class Layout3D: public sigc::trackable { public: - typedef std::map TrackMap; - typedef std::map VehicleMap; - typedef std::map SignalMap; + typedef std::map ObjectMap; private: Layout &layout; Catalogue3D catalogue; - TrackMap tracks; - VehicleMap vehicles; - SignalMap signals; + ObjectMap objects; + std::set utilities; Msp::GL::InstanceScene scene; Msp::GL::SimpleScene ep_scene; Msp::GL::InstanceScene path_scene; @@ -39,27 +36,29 @@ 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_3d(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 + typename TypeMap3D::Type3D &get_3d(T &o) const + { return dynamic_cast::Type3D &>(get_3d(static_cast(o))); } - void add_signal(Signal3D &); - void remove_signal(Signal3D &); - Signal3D &get_signal(Signal &) const; + void add(Utility3D &); + void remove(Utility3D &); Msp::GL::Scene &get_scene() { return scene; } Msp::GL::Scene &get_endpoint_scene() { return ep_scene; } Msp::GL::Scene &get_path_scene() { return path_scene; } + const Msp::GL::Light &get_sun() const { return sun; } const Msp::GL::Lighting &get_lighting() const { return lighting; } + void tick(); + private: void object_added(Object &); void object_removed(Object &);