/
cdrawobjectquadspheres.h
47 lines (35 loc) · 1.19 KB
/
cdrawobjectquadspheres.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef CDRAWOBJECTQUADSPHERES_H
#define CDRAWOBJECTQUADSPHERES_H
#include "cadrawobject.h"
#include <QtOpenGL>
#include <QOpenGLVertexArrayObject>
template <typename T>
class cDrawObjectQuadSpheres : public caDrawObject
{
public:
cDrawObjectQuadSpheres(QGLFunctions *func);
cDrawObjectQuadSpheres(QGLFunctions *func, T *vertex, size_t size, GLenum type=GL_QUADS);
cDrawObjectQuadSpheres(QGLFunctions *func, T *vertex, unsigned char *detection, size_t size, GLenum type=GL_QUADS);
virtual ~cDrawObjectQuadSpheres();
void setVertices(T *vertices, size_t size);
T* getVertices();
void setColor(GLubyte *color);
GLubyte* getColor();
void setType(GLenum target);
void drawObject();
void drawIndexObject(std::vector<unsigned int> *indices);
private:
QGLFunctions *m_glFunc;
GLenum m_Type;
QGLBuffer *m_VertexBuffer;
GLuint m_texture;
QGLBuffer *m_TextureCoordBuffer;
QOpenGLVertexArrayObject *m_vao;
T *m_VertexPtr;
unsigned char *m_DetectionPtr;
unsigned int m_size;
void createVBO();
void generateQuads(T *points, T *quads, float *texCoord);
};
#include "cdrawobjectquadspheres.tcc"
#endif // CDRAWOBJECTQUADSPHERES_H