]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/tracktype.h
Render tracks through GL::Objects
[r2c2.git] / source / 3d / tracktype.h
index 7bf1b2d5b9241ab931afefe140ec242366afa6e1..3c06c58d8234047d7b198f2d0f9a68cfb1744f4a 100644 (file)
@@ -10,7 +10,7 @@ Distributed under the GPL
 
 #include <msp/gl/mesh.h>
 #include <msp/gl/meshbuilder.h>
-#include <msp/gl/renderable.h>
+#include <msp/gl/object.h>
 #include "libr2c2/profile.h"
 #include "libr2c2/tracktype.h"
 
@@ -18,26 +18,25 @@ namespace R2C2 {
 
 class Catalogue3D;
 
-class TrackType3D: public Msp::GL::Renderable
+class TrackType3D
 {
 private:
-       const Catalogue3D &catalogue;
-       Msp::GL::Mesh ballast_mesh;
-       Msp::GL::Mesh rail_mesh;
+       Catalogue3D &catalogue;
+       Msp::GL::Mesh mesh;
+       Msp::GL::Object object;
        std::vector<Msp::GL::Mesh *> path_meshes;
        std::vector<Point> border;
        float min_z;
        float max_z;
 
 public:
-       TrackType3D(const Catalogue3D &, const TrackType &);
+       TrackType3D(Catalogue3D &, const TrackType &);
        ~TrackType3D();
 
        void get_bounds(float, Point &, Point &) const;
+       const Msp::GL::Object &get_object() const { return object; }
        const Msp::GL::Mesh &get_path_mesh(unsigned) const;
 
-       virtual void render(const Msp::GL::Tag &) const;
-
 private:
        void build_part(const TrackPart &, const Profile &, const Point &, Msp::GL::MeshBuilder &, unsigned &);
 };