]> git.tdb.fi Git - r2c2.git/blob - source/libmarklin/profile.h
Split mesh generation from Track3D to TrackType3D
[r2c2.git] / source / libmarklin / profile.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 LIBMARKLIN_PROFILE_H_
9 #define LIBMARKLIN_PROFILE_H_
10
11 #include <vector>
12 #include <msp/datafile/objectloader.h>
13 #include "geometry.h"
14
15 namespace Marklin {
16
17 class Profile
18 {
19 public:
20         class Loader: public Msp::DataFile::ObjectLoader<Profile>
21         {
22         public:
23                 Loader(Profile &);
24         private:
25                 virtual void finish();
26                 void point(float, float);
27         };
28
29 private:
30         std::vector<Point> points;
31         Point min_coords;
32         Point max_coords;
33
34 public:
35         unsigned get_n_points() const { return points.size(); }
36         const Point &get_point(unsigned) const;
37         const Point &get_min_coords() const { return min_coords; }
38         const Point &get_max_coords() const { return max_coords; }
39         Point get_edge_normal(unsigned) const;
40 };
41
42 } // namespace Marklin
43
44 #endif