dust3d/src/mesh.h

45 lines
875 B
C
Raw Normal View History

#ifndef MESH_H
#define MESH_H
#include <QObject>
#include <QOpenGLFunctions>
2018-03-20 07:56:49 +00:00
#include <vector>
#include <QVector3D>
#pragma pack(push)
#pragma pack(1)
typedef struct
{
GLfloat posX;
GLfloat posY;
GLfloat posZ;
GLfloat normX;
GLfloat normY;
GLfloat normZ;
2018-03-19 13:56:10 +00:00
GLfloat colorR;
GLfloat colorG;
GLfloat colorB;
} Vertex;
#pragma pack(pop)
class Mesh
{
public:
2018-03-19 13:56:10 +00:00
Mesh(void *meshlite, int meshId);
~Mesh();
2018-03-19 13:56:10 +00:00
Vertex *triangleVertices();
int triangleVertexCount();
Vertex *edgeVertices();
int edgeVertexCount();
2018-03-20 07:56:49 +00:00
const std::vector<QVector3D> &vertices();
const std::vector<std::vector<int>> &faces();
private:
2018-03-19 13:56:10 +00:00
Vertex *m_triangleVertices;
int m_triangleVertexCount;
Vertex *m_edgeVertices;
int m_edgeVertexCount;
2018-03-20 07:56:49 +00:00
std::vector<QVector3D> m_vertices;
std::vector<std::vector<int>> m_faces;
};
#endif