X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Flayout.h;h=f2de127a0cc19d96117b4a63f3fb3be8c042921c;hb=9abaa89f495307c7e90cbef51ae0fedbaff001db;hp=09189ed82969df8b69d3bf1682b6387fb1119211;hpb=6c61179fe09af2f5366d50f10aadbf5f83438087;p=r2c2.git diff --git a/source/3d/layout.h b/source/3d/layout.h index 09189ed..f2de127 100644 --- a/source/3d/layout.h +++ b/source/3d/layout.h @@ -1,29 +1,62 @@ +/* $Id$ + +This file is part of the MSP Märklin suite +Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa +Distributed under the GPL +*/ + #ifndef MARKLIN3D_LAYOUT_H_ #define MARKLIN3D_LAYOUT_H_ +#include +#include #include "libmarklin/layout.h" -#include "track.h" +#include "catalogue.h" namespace Marklin { -class Layout3D +class Track3D; +class Vehicle3D; + +class Layout3D: public sigc::trackable { +public: + typedef std::map TrackMap; + typedef std::map VehicleMap; + +private: + Layout &layout; + Catalogue3D catalogue; + TrackMap tracks; + VehicleMap vehicles; + Msp::GL::Scene scene; + Msp::GL::Scene ep_scene; + Msp::GL::Scene path_scene; + public: Layout3D(Layout &); ~Layout3D(); - void set_quality(unsigned); - const Track3DSeq &get_tracks() const { return tracks; } - void render(bool =false); - Track3D *get_track(const Track *); - Track3D *pick_track(float, float, float); -private: - Layout &layout; - Track3DSeq tracks; - unsigned quality; + const Catalogue3D &get_catalogue() const { return catalogue; } + + void add_track(Track3D &); + void remove_track(Track3D &); + const TrackMap &get_tracks() const { return tracks; } + Track3D &get_track(Track &) const; + Track3D *pick_track(float, float, float) const; - void track_added(Track *); - void track_removed(Track *); + void add_vehicle(Vehicle3D &); + void remove_vehicle(Vehicle3D &); + Vehicle3D &get_vehicle(Vehicle &) const; + + 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; } + +private: + void track_added(Track &); + void track_removed(Track &); + void vehicle_added(Vehicle &); }; } // namespace Marklin