]> git.sur5r.net Git - fstl/blob - src/mesh.h
Reinstate min/max methods
[fstl] / src / mesh.h
1 #ifndef MESH_H
2 #define MESH_H
3
4 #include <QString>
5 #include <QtOpenGL/QtOpenGL>
6
7 #include <vector>
8
9 class Mesh
10 {
11 public:
12     Mesh(std::vector<GLfloat> vertices, std::vector<GLuint> indices);
13     static Mesh* load_stl(const QString& filename);
14
15     float min(size_t start) const;
16     float max(size_t start) const;
17
18     float xmin() const { return min(0); }
19     float ymin() const { return min(1); }
20     float zmin() const { return min(2); }
21     float xmax() const { return max(0); }
22     float ymax() const { return max(1); }
23     float zmax() const { return max(2); }
24
25 private:
26     std::vector<GLfloat> vertices;
27     std::vector<GLuint> indices;
28
29     friend class GLMesh;
30 };
31
32 #endif // MESH_H