]> git.tdb.fi Git - r2c2.git/blob - source/3d/tracktype.h
e0bd9388af3814d5c00da2f4ee62cfd9730f740f
[r2c2.git] / source / 3d / tracktype.h
1 /* $Id$
2
3 This file is part of the MSP Märklin suite
4 Copyright © 2010 Mikkosoft Productions, Mikko Rasa
5 Distributed under the GPL
6 */
7
8 #ifndef MARKLIN3D_TRACKTYPE_H_
9 #define MARKLIN3D_TRACKTYPE_H_
10
11 #include <msp/gl/mesh.h>
12 #include <msp/gl/meshbuilder.h>
13 #include "libmarklin/profile.h"
14 #include "libmarklin/tracktype.h"
15
16 namespace Marklin {
17
18 class Catalogue3D;
19
20 class TrackType3D
21 {
22 private:
23         Msp::GL::Mesh ballast_mesh;
24         Msp::GL::Mesh rail_mesh;
25         std::vector<Point> border;
26         float min_z;
27         float max_z;
28
29 public:
30         TrackType3D(const Catalogue3D &, const TrackType &);
31
32         void get_bounds(float, Point &, Point &) const;
33
34         void render() const;
35
36 private:
37         void build_part(const TrackPart &, const Profile &, const Point &, Msp::GL::MeshBuilder &, unsigned &);
38         //void optimize_border();
39 };
40
41 } // namespace Marklin
42
43 #endif