6 #include <QOpenGLShaderProgram>
7 #include <QOpenGLShader>
8 #include <QOpenGLBuffer>
44 Q_DECLARE_FLAGS(Modes,
Mode)
116 void setMesh(const QVector<
float> &vertices, const QVector<
float>& normals, const QVector<
unsigned int> &indices);
void setMode(Mesh::Mode mode)
set the mode
void clear()
clear GPU buffers
static Mode QStringToMode(QString string)
convert string to Mode enum
unsigned int m_numIndices
index count
Definition: mesh.h:200
Mode getMode() const
get render mode
void drawShader1()
render function
render mesh using two colors
Definition: mesh.h:40
render mesh using two colors with alpha blending
Definition: mesh.h:41
Base class for objects in OpenGL scene.
Definition: sceneobject.h:22
void drawSingleAlpha()
render function
void drawShader2()
render function
QOpenGLBuffer * m_indexVBO
index buffer CW
Definition: mesh.h:188
const QColor & getColorA() const
get color A
render mesh using single color with alpha blending
Definition: mesh.h:39
Mode
The rendering mode for the cloud.
Definition: mesh.h:36
void drawDoubleAlpha()
render function
void modeChanged(Mesh::Mode mode)
signal that the render mode has changed
QOpenGLBuffer * m_normalsVBO
normals buffer
Definition: mesh.h:185
render mesh using single color
Definition: mesh.h:38
virtual void makeConnections()
make signal/slot connections
void drawDouble()
render function
bool m_shader2OK
shader2 ok to use
Definition: mesh.h:209
Mesh(LangmuirViewer &viewer, QObject *parent=0)
create the Mesh
QColor m_colorA
color of side A
Definition: mesh.h:191
Mode m_mode
rendering mode
Definition: mesh.h:203
void meshChanged()
signal that the mesh has changed
QOpenGLShaderProgram m_shader2
tesselation shader
Definition: mesh.h:179
QOpenGLShaderProgram m_shader1
tesselation shader
Definition: mesh.h:176
bool m_shader1OK
shader1 ok to use
Definition: mesh.h:206
static QString modeToQString(Mode mode)
convert Mode to string
virtual void init()
initialize object
unsigned int m_numVertices
number of vertices (3 * number of points)
Definition: mesh.h:197
void setColorB(QColor color)
set color B
render mesh with shader1
Definition: mesh.h:42
Q_DECLARE_METATYPE(LangmuirView::Mesh::Mode)
QColor m_colorB
color of side B
Definition: mesh.h:194
Widget to view Langmuir Simulation in real time.
Definition: langmuirviewer.h:47
QOpenGLBuffer * m_verticesVBO
vertices buffer
Definition: mesh.h:182
void colorBChanged(QColor color)
signal that color B of has changed
void initShaders()
load the shaders
const QColor & getColorB() const
get color B
void setColorA(QColor color)
set color A
void setMesh(const QVector< float > &vertices, const QVector< float > &normals, const QVector< unsigned int > &indices)
set up the mesh on the GPU
void drawSingle()
render function
void colorAChanged(QColor color)
signal that color A of has changed
A class to represent a mesh.
Definition: mesh.h:17
virtual void draw()
perform OpenGL drawing operations