GLC_MeshData : Contains all data of the mesh. More...
#include <glc_meshdata.h>
Public Types | |
| enum | VboType { GLC_Vertex = 30, GLC_Normal, GLC_Texel, GLC_Color } |
Enum of VBO TYPE. More... | |
Public Member Functions | |
Constructor / Destructor | |
| GLC_MeshData () | |
| Default constructor. | |
| GLC_MeshData (const GLC_MeshData &) | |
| Copy constructor. | |
| GLC_MeshData & | operator= (const GLC_MeshData &) |
| Overload "=" operator. | |
| virtual | ~GLC_MeshData () |
| Destructor. | |
Set Functions | |
| void | appendLod (double accuracy=0.0) |
| Add a empty Lod to the engine. | |
| void | finishVbo () |
| The mesh wich use the data is finished and VBO is used. | |
| void | finishLod () |
| If the there is more than 2 LOD Swap the first and last. | |
| void | clear () |
| Clear the content of the meshData and makes it empty. | |
| void | copyVboToClientSide () |
| Copy VBO to the Client Side. | |
| void | releaseVboClientSide (bool update=false) |
| Release client VBO. | |
| void | trianglesAdded (int lod, int number) |
| Given number of triangles added to the given lod index. | |
OpenGL Functions | |
| void | createVBOs () |
| Vbo creation. | |
| bool | useVBO (bool, GLC_MeshData::VboType) const |
| Ibo Usage. | |
| void | useIBO (bool use, const int currentLod=0) |
| Ibo Usage. | |
| void | fillVbo (GLC_MeshData::VboType vboType) |
| Fill the VBO of the given type. | |
Private Attributes | |
| GLuint | m_VboId |
| Main VBO ID. | |
| GLfloatVector | m_Positions |
| Vertex Position Vector. | |
| GLfloatVector | m_Normals |
| Vertex Normal Vector. | |
| GLfloatVector | m_Texels |
| Vertex Texture coordinate. | |
| GLfloatVector | m_Colors |
| Color index. | |
| GLuint | m_NormalVboId |
| Normals VBO ID. | |
| GLuint | m_TexelVboId |
| Texture VBO ID. | |
| GLuint | m_ColorVboId |
| Color VBO ID. | |
| QList< GLC_Lod * > | m_LodList |
| The list of LOD. | |
| int | m_PositionSize |
| The size of Position and normal VBO. | |
| int | m_TexelsSize |
| The size of texel VBO. | |
| int | m_ColorSize |
| The size of Color VBO. | |
Static Private Attributes | |
| static quint32 | m_ChunkId = 0xA704 |
| Class chunk id. | |
Friends | |
| GLC_LIB_EXPORT QDataStream & | operator<< (QDataStream &, const GLC_MeshData &) |
| Non-member stream operator. | |
| GLC_LIB_EXPORT QDataStream & | operator>> (QDataStream &, GLC_MeshData &) |
Get Functions | |
|
| |
| int | lodCount () const |
| Return the number of lod. | |
| GLfloatVector | positionVector () const |
| Return the Position Vector. | |
| GLfloatVector | normalVector () const |
| Return the normal Vector. | |
| GLfloatVector | texelVector () const |
| Return the texel Vector. | |
| GLfloatVector | colorVector () const |
| Return the color Vector. | |
| GLfloatVector * | positionVectorHandle () |
| Return the Position Vector handle. | |
| GLfloatVector * | normalVectorHandle () |
| Return the Normal Vector handle. | |
| GLfloatVector * | texelVectorHandle () |
| Return the Texel Vector handle. | |
| GLfloatVector * | colorVectorHandle () |
| Return the Color Vector handle. | |
| GLuintVector | indexVector (const int i=0) const |
| Return the Index Vector of the specified LOD. | |
| GLuintVector * | indexVectorHandle (const int i=0) const |
| Return the Index Vector handle of the specified LOD. | |
| int | indexVectorSize (const int i=0) const |
| Return the size of the triangles index Vector of the specified LOD. | |
| GLC_Lod * | getLod (int index) const |
| Return the specified LOD if the LOD doesn't exists, return NULL. | |
| bool | isEmpty () const |
| Return true if the mesh data doesn't contains vertice. | |
| unsigned int | trianglesCount (int lod) const |
| Return the number of triangle from the given lod index. | |
| static quint32 | chunckID () |
| Return the class Chunk ID. | |
GLC_MeshData : Contains all data of the mesh.
Definition at line 41 of file glc_meshdata.h.
Enum of VBO TYPE.
Definition at line 49 of file glc_meshdata.h.
| GLC_MeshData::GLC_MeshData | ( | ) |
Default constructor.
Definition at line 32 of file glc_meshdata.cpp.
| GLC_MeshData::GLC_MeshData | ( | const GLC_MeshData & | meshData | ) |
| GLC_MeshData::~GLC_MeshData | ( | ) | [virtual] |
| void GLC_MeshData::appendLod | ( | double | accuracy = 0.0 |
) | [inline] |
Add a empty Lod to the engine.
Definition at line 160 of file glc_meshdata.h.
Referenced by GLC_Mesh::setCurrentMaterial().
| quint32 GLC_MeshData::chunckID | ( | ) | [static] |
| void GLC_MeshData::clear | ( | ) |
Clear the content of the meshData and makes it empty.
Definition at line 241 of file glc_meshdata.cpp.
References glDeleteBuffers, m_Colors, m_ColorSize, m_ColorVboId, m_LodList, m_Normals, m_NormalVboId, m_Positions, m_PositionSize, m_Texels, m_TexelsSize, m_TexelVboId, and m_VboId.
Referenced by GLC_Mesh::clearMeshWireAndBoundingBox(), operator=(), operator>>(), and ~GLC_MeshData().
| GLfloatVector GLC_MeshData::colorVector | ( | ) | const |
Return the color Vector.
Definition at line 182 of file glc_meshdata.cpp.
References glBindBuffer, glMapBuffer, glUnmapBuffer, m_Colors, m_ColorSize, m_ColorVboId, and normalVector().
Referenced by copyVboToClientSide(), operator<<(), and operator=().
| GLfloatVector* GLC_MeshData::colorVectorHandle | ( | ) | [inline] |
Return the Color Vector handle.
Definition at line 112 of file glc_meshdata.h.
Referenced by GLC_Mesh::activateVertexArray().
| void GLC_MeshData::copyVboToClientSide | ( | ) |
Copy VBO to the Client Side.
Definition at line 286 of file glc_meshdata.cpp.
References colorVector(), m_Colors, m_ColorVboId, m_Normals, m_NormalVboId, m_Positions, m_Texels, m_TexelVboId, m_VboId, normalVector(), positionVector(), and texelVector().
Referenced by GLC_Mesh::copyVboToClientSide().
| void GLC_MeshData::createVBOs | ( | ) |
Vbo creation.
Definition at line 331 of file glc_meshdata.cpp.
References glGenBuffers, m_Colors, m_ColorVboId, m_LodList, m_NormalVboId, m_Texels, m_TexelVboId, and m_VboId.
Referenced by GLC_Mesh::glDraw().
| void GLC_MeshData::fillVbo | ( | GLC_MeshData::VboType | vboType | ) |
Fill the VBO of the given type.
Definition at line 393 of file glc_meshdata.cpp.
References glBufferData, GLC_Color, GLC_Normal, GLC_Texel, GLC_Vertex, m_Colors, m_ColorVboId, m_Normals, m_Positions, m_Texels, m_TexelVboId, and useVBO().
Referenced by GLC_Mesh::fillVbosAndIbos(), and releaseVboClientSide().
| void GLC_MeshData::finishLod | ( | ) |
If the there is more than 2 LOD Swap the first and last.
Definition at line 228 of file glc_meshdata.cpp.
References m_LodList.
Referenced by GLC_Mesh::finish().
| void GLC_MeshData::finishVbo | ( | ) |
The mesh wich use the data is finished and VBO is used.
Definition at line 209 of file glc_meshdata.cpp.
References m_Colors, m_ColorSize, m_LodList, m_Normals, m_Positions, m_PositionSize, m_Texels, and m_TexelsSize.
Referenced by GLC_Mesh::fillVbosAndIbos().
| GLC_Lod* GLC_MeshData::getLod | ( | int | index | ) | const [inline] |
Return the specified LOD if the LOD doesn't exists, return NULL.
Definition at line 136 of file glc_meshdata.h.
Referenced by GLC_Mesh::copyIndex().
| GLuintVector GLC_MeshData::indexVector | ( | const int | i = 0 |
) | const [inline] |
Return the Index Vector of the specified LOD.
Definition at line 116 of file glc_meshdata.h.
Referenced by GLC_Mesh::getFansIndex(), GLC_Mesh::getStripsIndex(), and GLC_Mesh::getTrianglesIndex().
| GLuintVector* GLC_MeshData::indexVectorHandle | ( | const int | i = 0 |
) | const [inline] |
Return the Index Vector handle of the specified LOD.
Definition at line 123 of file glc_meshdata.h.
Referenced by GLC_Mesh::fillVbosAndIbos(), GLC_Mesh::finishNonVbo(), GLC_Mesh::finishVbo(), GLC_Mesh::vertexArrayDrawInSelectionModePrimitivesOf(), GLC_Mesh::vertexArrayDrawPrimitivesGroupOf(), GLC_Mesh::vertexArrayDrawPrimitivesOf(), and GLC_Mesh::vertexArrayDrawSelectedPrimitivesGroupOf().
| int GLC_MeshData::indexVectorSize | ( | const int | i = 0 |
) | const [inline] |
Return the size of the triangles index Vector of the specified LOD.
Definition at line 130 of file glc_meshdata.h.
Referenced by GLC_Mesh::finishNonVbo(), and GLC_Mesh::finishVbo().
| bool GLC_MeshData::isEmpty | ( | void | ) | const [inline] |
Return true if the mesh data doesn't contains vertice.
Definition at line 142 of file glc_meshdata.h.
| int GLC_MeshData::lodCount | ( | ) | const [inline] |
Return the number of lod.
Definition at line 84 of file glc_meshdata.h.
Referenced by GLC_Mesh::createMeshFromGivenLod(), GLC_Mesh::createMeshOfGivenLod(), GLC_Mesh::fillVbosAndIbos(), and GLC_Mesh::setCurrentLod().
| GLfloatVector GLC_MeshData::normalVector | ( | ) | const |
Return the normal Vector.
Definition at line 136 of file glc_meshdata.cpp.
References glBindBuffer, glMapBuffer, glUnmapBuffer, m_Normals, m_NormalVboId, and m_PositionSize.
Referenced by colorVector(), copyVboToClientSide(), operator<<(), operator=(), and GLC_Mesh::reverseNormals().
| GLfloatVector* GLC_MeshData::normalVectorHandle | ( | ) | [inline] |
Return the Normal Vector handle.
Definition at line 104 of file glc_meshdata.h.
Referenced by GLC_Mesh::activateVertexArray(), GLC_Mesh::copyBulkData(), GLC_Mesh::glDraw(), GLC_Mesh::reverseNormals(), and GLC_Mesh::transformVertice().
| GLC_MeshData & GLC_MeshData::operator= | ( | const GLC_MeshData & | meshData | ) |
Overload "=" operator.
Definition at line 73 of file glc_meshdata.cpp.
References clear(), colorVector(), m_Colors, m_ColorSize, m_LodList, m_Normals, m_Positions, m_PositionSize, m_Texels, m_TexelsSize, normalVector(), positionVector(), and texelVector().
| GLfloatVector GLC_MeshData::positionVector | ( | ) | const |
Return the Position Vector.
Definition at line 113 of file glc_meshdata.cpp.
References glBindBuffer, glMapBuffer, glUnmapBuffer, m_Positions, m_PositionSize, and m_VboId.
Referenced by copyVboToClientSide(), operator<<(), and operator=().
| GLfloatVector* GLC_MeshData::positionVectorHandle | ( | ) | [inline] |
Return the Position Vector handle.
Definition at line 100 of file glc_meshdata.h.
Referenced by GLC_Mesh::activateVertexArray(), GLC_Mesh::boundingBox(), GLC_Mesh::copyBulkData(), GLC_Mesh::glDraw(), and GLC_Mesh::transformVertice().
| void GLC_MeshData::releaseVboClientSide | ( | bool | update = false |
) |
Release client VBO.
Definition at line 305 of file glc_meshdata.cpp.
References fillVbo(), GLC_Color, GLC_Normal, GLC_Texel, GLC_Vertex, m_Colors, m_ColorSize, m_Normals, m_Positions, m_PositionSize, m_Texels, m_TexelsSize, m_VboId, and useVBO().
Referenced by GLC_Mesh::releaseVboClientSide().
| GLfloatVector GLC_MeshData::texelVector | ( | ) | const |
Return the texel Vector.
Definition at line 159 of file glc_meshdata.cpp.
References glBindBuffer, glMapBuffer, glUnmapBuffer, m_Texels, m_TexelsSize, and m_TexelVboId.
Referenced by copyVboToClientSide(), operator<<(), and operator=().
| GLfloatVector* GLC_MeshData::texelVectorHandle | ( | ) | [inline] |
Return the Texel Vector handle.
Definition at line 108 of file glc_meshdata.h.
Referenced by GLC_Mesh::activateVertexArray(), and GLC_Mesh::copyBulkData().
| void GLC_MeshData::trianglesAdded | ( | int | lod, | |
| int | number | |||
| ) | [inline] |
Given number of triangles added to the given lod index.
Definition at line 179 of file glc_meshdata.h.
Referenced by GLC_Mesh::addTriangles(), GLC_Mesh::addTrianglesFan(), and GLC_Mesh::addTrianglesStrip().
| unsigned int GLC_MeshData::trianglesCount | ( | int | lod | ) | const [inline] |
Return the number of triangle from the given lod index.
Definition at line 146 of file glc_meshdata.h.
Referenced by GLC_Mesh::faceCount(), and GLC_Mesh::glDraw().
| void GLC_MeshData::useIBO | ( | bool | use, | |
| const int | currentLod = 0 | |||
| ) | [inline] |
Ibo Usage.
Definition at line 200 of file glc_meshdata.h.
References glBindBuffer.
Referenced by GLC_Mesh::activateVboAndIbo(), GLC_Mesh::fillVbosAndIbos(), and GLC_Mesh::glDraw().
| bool GLC_MeshData::useVBO | ( | bool | use, | |
| GLC_MeshData::VboType | type | |||
| ) | const |
Ibo Usage.
Definition at line 360 of file glc_meshdata.cpp.
References glBindBuffer, GLC_Color, GLC_Normal, GLC_Texel, GLC_Vertex, m_ColorVboId, m_NormalVboId, m_TexelVboId, and m_VboId.
Referenced by GLC_Mesh::activateVboAndIbo(), fillVbo(), GLC_Mesh::glDraw(), and releaseVboClientSide().
| GLC_LIB_EXPORT QDataStream& operator<< | ( | QDataStream & | , | |
| const GLC_MeshData & | ||||
| ) | [friend] |
Non-member stream operator.
Definition at line 427 of file glc_meshdata.cpp.
| GLC_LIB_EXPORT QDataStream& operator>> | ( | QDataStream & | , | |
| GLC_MeshData & | ||||
| ) | [friend] |
Definition at line 449 of file glc_meshdata.cpp.
quint32 GLC_MeshData::m_ChunkId = 0xA704 [static, private] |
Class chunk id.
Definition at line 253 of file glc_meshdata.h.
Referenced by chunckID(), operator<<(), and operator>>().
GLfloatVector GLC_MeshData::m_Colors [private] |
Color index.
Definition at line 229 of file glc_meshdata.h.
Referenced by clear(), colorVector(), copyVboToClientSide(), createVBOs(), fillVbo(), finishVbo(), operator=(), operator>>(), and releaseVboClientSide().
int GLC_MeshData::m_ColorSize [private] |
The size of Color VBO.
Definition at line 250 of file glc_meshdata.h.
Referenced by clear(), colorVector(), finishVbo(), operator=(), and releaseVboClientSide().
GLuint GLC_MeshData::m_ColorVboId [private] |
Color VBO ID.
Definition at line 238 of file glc_meshdata.h.
Referenced by clear(), colorVector(), copyVboToClientSide(), createVBOs(), fillVbo(), and useVBO().
QList<GLC_Lod*> GLC_MeshData::m_LodList [private] |
The list of LOD.
Definition at line 241 of file glc_meshdata.h.
Referenced by clear(), createVBOs(), finishLod(), finishVbo(), GLC_MeshData(), operator<<(), operator=(), and operator>>().
GLfloatVector GLC_MeshData::m_Normals [private] |
Vertex Normal Vector.
Definition at line 223 of file glc_meshdata.h.
Referenced by clear(), copyVboToClientSide(), fillVbo(), finishVbo(), normalVector(), operator=(), operator>>(), and releaseVboClientSide().
GLuint GLC_MeshData::m_NormalVboId [private] |
Normals VBO ID.
Definition at line 232 of file glc_meshdata.h.
Referenced by clear(), copyVboToClientSide(), createVBOs(), normalVector(), and useVBO().
GLfloatVector GLC_MeshData::m_Positions [private] |
Vertex Position Vector.
Definition at line 220 of file glc_meshdata.h.
Referenced by clear(), copyVboToClientSide(), fillVbo(), finishVbo(), operator=(), operator>>(), positionVector(), and releaseVboClientSide().
int GLC_MeshData::m_PositionSize [private] |
The size of Position and normal VBO.
Definition at line 244 of file glc_meshdata.h.
Referenced by clear(), finishVbo(), normalVector(), operator=(), positionVector(), and releaseVboClientSide().
GLfloatVector GLC_MeshData::m_Texels [private] |
Vertex Texture coordinate.
Definition at line 226 of file glc_meshdata.h.
Referenced by clear(), copyVboToClientSide(), createVBOs(), fillVbo(), finishVbo(), operator=(), operator>>(), releaseVboClientSide(), and texelVector().
int GLC_MeshData::m_TexelsSize [private] |
The size of texel VBO.
Definition at line 247 of file glc_meshdata.h.
Referenced by clear(), finishVbo(), operator=(), releaseVboClientSide(), and texelVector().
GLuint GLC_MeshData::m_TexelVboId [private] |
Texture VBO ID.
Definition at line 235 of file glc_meshdata.h.
Referenced by clear(), copyVboToClientSide(), createVBOs(), fillVbo(), texelVector(), and useVBO().
GLuint GLC_MeshData::m_VboId [private] |
Main VBO ID.
Definition at line 217 of file glc_meshdata.h.
Referenced by clear(), copyVboToClientSide(), createVBOs(), positionVector(), releaseVboClientSide(), and useVBO().