]> git.tdb.fi Git - r2c2.git/blob - source/3d/track.h
Style fixes, including:
[r2c2.git] / source / 3d / track.h
1 #ifndef MARKLIN3D_TRACK_H_
2 #define MARKLIN3D_TRACK_H_
3
4 #include <list>
5 #include <msp/gl/color.h>
6 #include <msp/gl/vertexarray.h>
7 #include <msp/gl/vertexarraybuilder.h>
8 #include "libmarklin/track.h"
9 #include "libmarklin/trackpart.h"
10
11 namespace Marklin {
12
13 class Track3D
14 {
15 private:
16         Track        &track;
17         Msp::GL::Color color;
18         std::vector<Point> border;
19         Msp::GL::VertexArray varray;
20         std::vector<unsigned> base_seq;
21         std::vector<unsigned> rail_seq;
22         std::vector<std::vector<unsigned> > route_seq;
23         unsigned quality;
24
25 public:
26         Track3D(Track &, unsigned);
27
28         void set_color(const Msp::GL::Color &c)  { color=c; }
29         void set_quality(unsigned);
30         void get_bounds(float, Point &, Point &) const;
31         Track &get_track() const { return track; }
32         void render() const;
33         void render_endpoints() const;
34         void render_route(int) const;
35 private:
36         void prepare_render() const;
37         void build_object();
38         void build_part(const TrackPart &, Msp::GL::VertexArrayBuilder &, unsigned &);
39 };
40
41 } // namespace Marklin
42
43 #endif