]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/profile.h
Split mesh generation from Track3D to TrackType3D
[r2c2.git] / source / libmarklin / profile.h
diff --git a/source/libmarklin/profile.h b/source/libmarklin/profile.h
new file mode 100644 (file)
index 0000000..3b194c8
--- /dev/null
@@ -0,0 +1,44 @@
+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2010 Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
+#ifndef LIBMARKLIN_PROFILE_H_
+#define LIBMARKLIN_PROFILE_H_
+
+#include <vector>
+#include <msp/datafile/objectloader.h>
+#include "geometry.h"
+
+namespace Marklin {
+
+class Profile
+{
+public:
+       class Loader: public Msp::DataFile::ObjectLoader<Profile>
+       {
+       public:
+               Loader(Profile &);
+       private:
+               virtual void finish();
+               void point(float, float);
+       };
+
+private:
+       std::vector<Point> points;
+       Point min_coords;
+       Point max_coords;
+
+public:
+       unsigned get_n_points() const { return points.size(); }
+       const Point &get_point(unsigned) const;
+       const Point &get_min_coords() const { return min_coords; }
+       const Point &get_max_coords() const { return max_coords; }
+       Point get_edge_normal(unsigned) const;
+};
+
+} // namespace Marklin
+
+#endif