GLC_MeshData Class Reference

GLC_MeshData : Contains all data of the mesh. More...

#include <glc_meshdata.h>

List of all members.

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_MeshDataoperator= (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.
GLfloatVectorpositionVectorHandle ()
 Return the Position Vector handle.
GLfloatVectornormalVectorHandle ()
 Return the Normal Vector handle.
GLfloatVectortexelVectorHandle ()
 Return the Texel Vector handle.
GLfloatVectorcolorVectorHandle ()
 Return the Color Vector handle.
GLuintVector indexVector (const int i=0) const
 Return the Index Vector of the specified LOD.
GLuintVectorindexVectorHandle (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_LodgetLod (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.

Detailed Description

GLC_MeshData : Contains all data of the mesh.

Definition at line 41 of file glc_meshdata.h.


Member Enumeration Documentation

Enum of VBO TYPE.

Enumerator:
GLC_Vertex 
GLC_Normal 
GLC_Texel 
GLC_Color 

Definition at line 49 of file glc_meshdata.h.


Constructor & Destructor Documentation

GLC_MeshData::GLC_MeshData (  ) 

Default constructor.

Definition at line 32 of file glc_meshdata.cpp.

GLC_MeshData::GLC_MeshData ( const GLC_MeshData meshData  ) 

Copy constructor.

Definition at line 50 of file glc_meshdata.cpp.

References m_LodList.

GLC_MeshData::~GLC_MeshData (  )  [virtual]

Destructor.

Definition at line 99 of file glc_meshdata.cpp.

References clear().


Member Function Documentation

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]

Return the class Chunk ID.

Definition at line 107 of file glc_meshdata.cpp.

References m_ChunkId.

void GLC_MeshData::clear (  ) 
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 (  ) 
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]
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]
GLfloatVector GLC_MeshData::normalVector (  )  const
GLfloatVector* GLC_MeshData::normalVectorHandle (  )  [inline]
GLC_MeshData & GLC_MeshData::operator= ( const GLC_MeshData meshData  ) 
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  ) 
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

Friends And Related Function Documentation

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.


Member Data Documentation

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>>().

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>>().

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().

Vertex Position Vector.

Definition at line 220 of file glc_meshdata.h.

Referenced by clear(), copyVboToClientSide(), fillVbo(), finishVbo(), operator=(), operator>>(), positionVector(), and releaseVboClientSide().

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().

Vertex Texture coordinate.

Definition at line 226 of file glc_meshdata.h.

Referenced by clear(), copyVboToClientSide(), createVBOs(), fillVbo(), finishVbo(), operator=(), operator>>(), releaseVboClientSide(), and texelVector().

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().


The documentation for this class was generated from the following files:

SourceForge.net Logo

©2005-2011 Laurent Ribon