]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/tracktype.h
Add an SVG exporter to Designer
[r2c2.git] / source / 3d / tracktype.h
index e0bd9388af3814d5c00da2f4ee62cfd9730f740f..56a4b46ac11c091e460fa8f075bb6f89203a8f96 100644 (file)
@@ -10,6 +10,7 @@ Distributed under the GPL
 
 #include <msp/gl/mesh.h>
 #include <msp/gl/meshbuilder.h>
+#include <msp/gl/renderable.h>
 #include "libmarklin/profile.h"
 #include "libmarklin/tracktype.h"
 
@@ -17,25 +18,28 @@ namespace Marklin {
 
 class Catalogue3D;
 
-class TrackType3D
+class TrackType3D: public Msp::GL::Renderable
 {
 private:
+       const Catalogue3D &catalogue;
        Msp::GL::Mesh ballast_mesh;
        Msp::GL::Mesh rail_mesh;
+       std::vector<Msp::GL::Mesh *> path_meshes;
        std::vector<Point> border;
        float min_z;
        float max_z;
 
 public:
        TrackType3D(const Catalogue3D &, const TrackType &);
+       ~TrackType3D();
 
        void get_bounds(float, Point &, Point &) const;
+       const Msp::GL::Mesh &get_path_mesh(unsigned) const;
 
-       void render() const;
+       virtual void render(const Msp::GL::Tag &) const;
 
 private:
        void build_part(const TrackPart &, const Profile &, const Point &, Msp::GL::MeshBuilder &, unsigned &);
-       //void optimize_border();
 };
 
 } // namespace Marklin