X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Ftrack.h;h=e55dc21245f146920115c4719acc63267bf54142;hb=dc3b2bce73df40ea885a1960a825e5cd3a33c045;hp=adc046b9fc13c9b53f069d16ff4f10b75225c4b4;hpb=6dc18b0e518407bd2a86602bae1e9bbae05da7c8;p=r2c2.git diff --git a/source/3d/track.h b/source/3d/track.h index adc046b..e55dc21 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,44 @@ 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 Path3D; +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 > path_seq; - unsigned quality; + const TrackType3D &type; + std::vector endpoints; + Path3D *path; 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_path(int) const; -private: - void prepare_render(bool) const; - void build_object(); - void build_part(const TrackPart &, Msp::GL::VertexArrayBuilder &, unsigned &); + Path3D &get_path() { return *path; } + + virtual Point get_node() const; + virtual bool is_visible() const { return true; } + + void apply_matrix() const; + virtual void render(const Msp::GL::Tag &) const; }; } // namespace Marklin