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. | |
OpenGL Functions | |
| void | createVBOs () |
| Vbo creation. | |
| bool | useVBO (bool, GLC_MeshData::VboType) |
| Ibo Usage. | |
| void | useIBO (bool use, const int currentLod=0) |
| Ibo Usage. | |
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 | |
| QDataStream & | operator<< (QDataStream &, const GLC_MeshData &) |
| Non-member stream operator. | |
| 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. | |
| static quint32 | chunckID () |
| Return the class Chunk ID. | |
GLC_MeshData : Contains all data of the mesh.
Definition at line 43 of file glc_meshdata.h.
Enum of VBO TYPE.
Definition at line 51 of file glc_meshdata.h.
| GLC_MeshData::GLC_MeshData | ( | ) |
Default constructor.
Definition at line 34 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 156 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 243 of file glc_meshdata.cpp.
References glDeleteBuffers, 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 184 of file glc_meshdata.cpp.
References glBindBuffer, glMapBuffer, glUnmapBuffer, m_Colors, m_ColorSize, m_ColorVboId, and normalVector().
Referenced by operator<<(), and operator=().
| GLfloatVector* GLC_MeshData::colorVectorHandle | ( | ) | [inline] |
Return the Color Vector handle.
Definition at line 114 of file glc_meshdata.h.
Referenced by GLC_Mesh::activateVertexArray(), GLC_Mesh::fillVbosAndIbos(), and operator>>().
| void GLC_MeshData::createVBOs | ( | ) |
Vbo creation.
Definition at line 284 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::finishLod | ( | ) |
If the there is more than 2 LOD Swap the first and last.
Definition at line 230 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 211 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 138 of file glc_meshdata.h.
| GLuintVector GLC_MeshData::indexVector | ( | const int | i = 0 |
) | const [inline] |
Return the Index Vector of the specified LOD.
Definition at line 118 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 125 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 132 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 144 of file glc_meshdata.h.
| int GLC_MeshData::lodCount | ( | ) | const [inline] |
Return the number of lod.
Definition at line 86 of file glc_meshdata.h.
Referenced by GLC_Mesh::fillVbosAndIbos(), and GLC_Mesh::setCurrentLod().
| GLfloatVector GLC_MeshData::normalVector | ( | ) | const |
Return the normal Vector.
Definition at line 138 of file glc_meshdata.cpp.
References glBindBuffer, glMapBuffer, glUnmapBuffer, m_Normals, m_NormalVboId, and m_PositionSize.
Referenced by colorVector(), operator<<(), operator=(), and GLC_Mesh::reverseNormals().
| GLfloatVector* GLC_MeshData::normalVectorHandle | ( | ) | [inline] |
Return the Normal Vector handle.
Definition at line 106 of file glc_meshdata.h.
Referenced by GLC_Mesh::activateVertexArray(), GLC_Mesh::fillVbosAndIbos(), GLC_Mesh::glDraw(), operator>>(), and GLC_Mesh::reverseNormals().
| GLC_MeshData & GLC_MeshData::operator= | ( | const GLC_MeshData & | meshData | ) |
Overload "=" operator.
Definition at line 75 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 115 of file glc_meshdata.cpp.
References glBindBuffer, glMapBuffer, glUnmapBuffer, m_Positions, m_PositionSize, and m_VboId.
Referenced by operator<<(), and operator=().
| GLfloatVector* GLC_MeshData::positionVectorHandle | ( | ) | [inline] |
Return the Position Vector handle.
Definition at line 102 of file glc_meshdata.h.
Referenced by GLC_Mesh::activateVertexArray(), GLC_Mesh::boundingBox(), GLC_Mesh::fillVbosAndIbos(), GLC_Mesh::glDraw(), and operator>>().
| GLfloatVector GLC_MeshData::texelVector | ( | ) | const |
Return the texel Vector.
Definition at line 161 of file glc_meshdata.cpp.
References glBindBuffer, glMapBuffer, glUnmapBuffer, m_Texels, m_TexelsSize, and m_TexelVboId.
Referenced by operator<<(), and operator=().
| GLfloatVector* GLC_MeshData::texelVectorHandle | ( | ) | [inline] |
Return the Texel Vector handle.
Definition at line 110 of file glc_meshdata.h.
Referenced by GLC_Mesh::activateVertexArray(), GLC_Mesh::fillVbosAndIbos(), and operator>>().
| void GLC_MeshData::useIBO | ( | bool | use, | |
| const int | currentLod = 0 | |||
| ) | [inline] |
Ibo Usage.
Definition at line 182 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 | |||
| ) |
Ibo Usage.
Definition at line 313 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(), GLC_Mesh::fillVbosAndIbos(), and GLC_Mesh::glDraw().
| QDataStream& operator<< | ( | QDataStream & | , | |
| const GLC_MeshData & | ||||
| ) | [friend] |
Non-member stream operator.
Definition at line 348 of file glc_meshdata.cpp.
| QDataStream& operator>> | ( | QDataStream & | , | |
| GLC_MeshData & | ||||
| ) | [friend] |
Definition at line 370 of file glc_meshdata.cpp.
quint32 GLC_MeshData::m_ChunkId = 0xA704 [static, private] |
Class chunk id.
Definition at line 232 of file glc_meshdata.h.
Referenced by chunckID(), operator<<(), and operator>>().
GLfloatVector GLC_MeshData::m_Colors [private] |
Color index.
Definition at line 208 of file glc_meshdata.h.
Referenced by colorVector(), createVBOs(), finishVbo(), and operator=().
int GLC_MeshData::m_ColorSize [private] |
The size of Color VBO.
Definition at line 229 of file glc_meshdata.h.
Referenced by colorVector(), finishVbo(), and operator=().
GLuint GLC_MeshData::m_ColorVboId [private] |
Color VBO ID.
Definition at line 217 of file glc_meshdata.h.
Referenced by colorVector(), createVBOs(), and useVBO().
QList<GLC_Lod*> GLC_MeshData::m_LodList [private] |
The list of LOD.
Definition at line 220 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 202 of file glc_meshdata.h.
Referenced by clear(), finishVbo(), normalVector(), and operator=().
GLuint GLC_MeshData::m_NormalVboId [private] |
Normals VBO ID.
Definition at line 211 of file glc_meshdata.h.
Referenced by clear(), createVBOs(), normalVector(), and useVBO().
GLfloatVector GLC_MeshData::m_Positions [private] |
Vertex Position Vector.
Definition at line 199 of file glc_meshdata.h.
Referenced by clear(), finishVbo(), operator=(), and positionVector().
int GLC_MeshData::m_PositionSize [private] |
The size of Position and normal VBO.
Definition at line 223 of file glc_meshdata.h.
Referenced by clear(), finishVbo(), normalVector(), operator=(), and positionVector().
GLfloatVector GLC_MeshData::m_Texels [private] |
Vertex Texture coordinate.
Definition at line 205 of file glc_meshdata.h.
Referenced by clear(), createVBOs(), finishVbo(), operator=(), and texelVector().
int GLC_MeshData::m_TexelsSize [private] |
The size of texel VBO.
Definition at line 226 of file glc_meshdata.h.
Referenced by clear(), finishVbo(), operator=(), and texelVector().
GLuint GLC_MeshData::m_TexelVboId [private] |
Texture VBO ID.
Definition at line 214 of file glc_meshdata.h.
Referenced by clear(), createVBOs(), texelVector(), and useVBO().
GLuint GLC_MeshData::m_VboId [private] |
Main VBO ID.
Definition at line 196 of file glc_meshdata.h.
Referenced by clear(), createVBOs(), positionVector(), and useVBO().