X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Ftrack.h;h=94865cfdf4afcf96837d84a552cebd2471cf26af;hb=bc8ac89bbe774bb133b758416182aa18e5e0a5a5;hp=660d1cff5fca9105a5d7dc04e03164c9b6cc56b2;hpb=449fb5de95ddb2ac9da4bd72a1c12150505d5549;p=r2c2.git diff --git a/source/3d/track.h b/source/3d/track.h index 660d1cf..94865cf 100644 --- a/source/3d/track.h +++ b/source/3d/track.h @@ -1,7 +1,7 @@ /* $Id$ This file is part of the MSP Märklin suite -Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa +Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa Distributed under the GPL */ @@ -9,40 +9,39 @@ Distributed under the GPL #define MARKLIN3D_TRACK_H_ #include -#include +#include #include #include #include "libmarklin/track.h" #include "libmarklin/trackpart.h" +#include "object.h" namespace Marklin { -class Track3D +class Endpoint3D; +class Layout3D; +class TrackType3D; + +class Track3D: public Object3D, public Msp::GL::Renderable { private: + Layout3D &layout; Track &track; - Msp::GL::Color color; - std::vector border; - Msp::GL::VertexArray varray; - std::vector base_seq; - std::vector rail_seq; - std::vector > route_seq; - unsigned quality; + const TrackType3D &type; + std::vector endpoints; public: - Track3D(Track &, unsigned); + Track3D(Layout3D &, Track &); + ~Track3D(); + Layout3D &get_layout() const { return layout; } Track &get_track() const { return track; } - void set_color(const Msp::GL::Color &); - void set_quality(unsigned); + const TrackType3D &get_type() const { return type; } void get_bounds(float, Point &, Point &) const; - void render() const; - void render_endpoints() const; - void render_route(int) const; -private: - void prepare_render() const; - void build_object(); - void build_part(const TrackPart &, Msp::GL::VertexArrayBuilder &, unsigned &); + + virtual Point get_node() const; + + virtual void render(const Msp::GL::Tag &) const; }; } // namespace Marklin