]> git.tdb.fi Git - r2c2.git/blob - source/3d/track.h
9928e11449345d2c0f453e8889913dc12058696d
[r2c2.git] / source / 3d / track.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef MARKLIN3D_TRACK_H_
9 #define MARKLIN3D_TRACK_H_
10
11 #include <list>
12 #include <msp/gl/renderable.h>
13 #include <msp/gl/vertexarray.h>
14 #include <msp/gl/vertexarraybuilder.h>
15 #include "libmarklin/track.h"
16 #include "libmarklin/trackpart.h"
17
18 namespace Marklin {
19
20 class Endpoint3D;
21 class Layout3D;
22 class TrackType3D;
23
24 class Track3D: public Msp::GL::Renderable
25 {
26 private:
27         Layout3D &layout;
28         Track &track;
29         const TrackType3D &type;
30         std::vector<Endpoint3D *> endpoints;
31
32 public:
33         Track3D(Layout3D &, Track &);
34         ~Track3D();
35
36         Layout3D &get_layout() const { return layout; }
37         Track &get_track() const { return track; }
38         const TrackType3D &get_type() const { return type; }
39         void get_bounds(float, Point &, Point &) const;
40
41         virtual void render(const Msp::GL::Tag &) const;
42 };
43
44 } // namespace Marklin
45
46 #endif