X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Ftrack.h;h=f3bfb458bb93333dae9716f365563d238b98d1f5;hb=a993f204ba2cd282637814caec3ab115040fc0cc;hp=7131877de8174688e4fff8801d759bcf4c8b9a43;hpb=3e9c210ddc036cd015228504cc0803c909e27f84;p=r2c2.git diff --git a/source/3d/track.h b/source/3d/track.h index 7131877..f3bfb45 100644 --- a/source/3d/track.h +++ b/source/3d/track.h @@ -1,50 +1,49 @@ -/* $Id$ - -This file is part of the MSP Märklin suite -Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - -#ifndef MARKLIN3D_TRACK_H_ -#define MARKLIN3D_TRACK_H_ +#ifndef R2C2_3D_TRACK_H_ +#define R2C2_3D_TRACK_H_ #include -#include -#include -#include -#include "libmarklin/track.h" -#include "libmarklin/trackpart.h" +#include +#include +#include +#include "libr2c2/track.h" +#include "libr2c2/trackpart.h" +#include "object.h" + +namespace R2C2 { -namespace Marklin { +class Endpoint3D; +class Layout3D; +class Path3D; +class TrackType3D; -class Track3D +class Track3D: public Object3D, public Msp::GL::ObjectInstance, public sigc::trackable { private: - 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; + Layout3D &layout; + Track &track; + const TrackType3D &type; + std::vector endpoints; + Path3D *path; public: - Track3D(Track &, unsigned); + Track3D(Layout3D &, Track &); + ~Track3D(); - void set_color(const Msp::GL::Color &c) { color=c; } - void set_quality(unsigned); - void get_bounds(float, Point &, Point &) const; + Layout3D &get_layout() const { return layout; } Track &get_track() const { return track; } - void render() const; - void render_endpoints() const; - void render_route(int) const; + const TrackType3D &get_type() const { return type; } + void get_bounds(float, Vector &, Vector &) const; + Path3D &get_path() { return *path; } + + virtual Vector get_node() const; + virtual bool is_visible() const { return true; } + + Msp::GL::Matrix create_matrix() const; + virtual void setup_render(Msp::GL::Renderer &, const Msp::GL::Tag &) const; private: - void prepare_render() const; - void build_object(); - void build_part(const TrackPart &, Msp::GL::VertexArrayBuilder &, unsigned &); + void link_changed(unsigned, Track *); }; -} // namespace Marklin +} // namespace R2C2 #endif