X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Ftrack.h;h=9b70b630a5fd1f0a7e88bf418b21a66629901b1e;hb=c1f45677ffbe9ded079df99f998d8e2abfe548de;hp=fe24b9a9e1a9e0fd3740d90c531841a44785d3d5;hpb=7e382cc3cad8c4f6945b0c9d89e2ca917b42b740;p=r2c2.git diff --git a/source/3d/track.h b/source/3d/track.h index fe24b9a..9b70b63 100644 --- a/source/3d/track.h +++ b/source/3d/track.h @@ -1,46 +1,43 @@ -/* $Id$ - -This file is part of the MSP Märklin suite -Copyright © 2006-2010 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 Marklin { +namespace R2C2 { -class Layout3D; +class Endpoint3D; +class Path3D; class TrackType3D; -class Track3D +class Track3D: public Object3D, public Msp::GL::ObjectInstance { private: - Layout3D &layout; Track &track; const TrackType3D &type; - Msp::GL::Color color; + std::vector endpoints; public: Track3D(Layout3D &, Track &); + ~Track3D(); + Layout3D &get_layout() const { return layout; } Track &get_track() const { return track; } - void set_color(const Msp::GL::Color &); - void get_bounds(float, Point &, Point &) const; - void render() const; - void render_endpoints() const; - void render_path(int) const; + const TrackType3D &get_type() const { return type; } + + virtual Vector get_node() const; + virtual bool is_visible() const { return true; } + + virtual void setup_render(Msp::GL::Renderer &, const Msp::GL::Tag &) const; private: - void prepare_render(bool) const; + void link_changed(unsigned, Track *); }; -} // namespace Marklin +} // namespace R2C2 #endif