]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/tracktype.h
Split mesh generation from Track3D to TrackType3D
[r2c2.git] / source / 3d / tracktype.h
diff --git a/source/3d/tracktype.h b/source/3d/tracktype.h
new file mode 100644 (file)
index 0000000..e0bd938
--- /dev/null
@@ -0,0 +1,43 @@
+/* $Id$
+
+This file is part of the MSP Märklin suite
+Copyright © 2010 Mikkosoft Productions, Mikko Rasa
+Distributed under the GPL
+*/
+
+#ifndef MARKLIN3D_TRACKTYPE_H_
+#define MARKLIN3D_TRACKTYPE_H_
+
+#include <msp/gl/mesh.h>
+#include <msp/gl/meshbuilder.h>
+#include "libmarklin/profile.h"
+#include "libmarklin/tracktype.h"
+
+namespace Marklin {
+
+class Catalogue3D;
+
+class TrackType3D
+{
+private:
+       Msp::GL::Mesh ballast_mesh;
+       Msp::GL::Mesh rail_mesh;
+       std::vector<Point> border;
+       float min_z;
+       float max_z;
+
+public:
+       TrackType3D(const Catalogue3D &, const TrackType &);
+
+       void get_bounds(float, Point &, Point &) const;
+
+       void render() const;
+
+private:
+       void build_part(const TrackPart &, const Profile &, const Point &, Msp::GL::MeshBuilder &, unsigned &);
+       //void optimize_border();
+};
+
+} // namespace Marklin
+
+#endif