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 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.
void setVboUsage (bool usage)
 Set VBO usage.
void initPositionSize ()
 Init the position size.
OpenGL Functions

void createVBOs ()
 Vbo creation.
bool useVBO (bool, GLC_MeshData::VboType)
 Ibo Usage.
void useIBO (bool use, const int currentLod=0)
 Ibo Usage.
void fillLodIbo ()
 Fill all LOD IBO.
void fillVbo (GLC_MeshData::VboType vboType)
 Fill the VBO of the given type.

Private Attributes

QGLBuffer m_VertexBuffer
 The vertex Buffer.
GLfloatVector m_Positions
 Vertex Position Vector.
GLfloatVector m_Normals
 Vertex Normal Vector.
GLfloatVector m_Texels
 Vertex Texture coordinate.
GLfloatVector m_Colors
 Color index.
QGLBuffer m_NormalBuffer
 Normals Buffer.
QGLBuffer m_TexelBuffer
 Texture Buffer.
QGLBuffer m_ColorBuffer
 Color Buffer.
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.
bool m_UseVbo
 Use 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.
bool positionSizeIsSet () const
 Return true if the position size is set.
static quint32 chunckID ()
 Return the class Chunk ID.

Detailed Description

GLC_MeshData : Contains all data of the mesh.

Definition at line 42 of file glc_meshdata.h.


Member Enumeration Documentation

Enum of VBO TYPE.

Enumerator:
GLC_Vertex 
GLC_Normal 
GLC_Texel 
GLC_Color 

Definition at line 50 of file glc_meshdata.h.


Constructor & Destructor Documentation

GLC_MeshData::GLC_MeshData (  ) 

Default constructor.

Definition at line 33 of file glc_meshdata.cpp.

GLC_MeshData::GLC_MeshData ( const GLC_MeshData meshData  ) 

Copy constructor.

Definition at line 52 of file glc_meshdata.cpp.

References m_LodList.

GLC_MeshData::~GLC_MeshData (  )  [virtual]

Destructor.

Definition at line 103 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 165 of file glc_meshdata.h.

Referenced by GLC_Mesh::setCurrentMaterial().

quint32 GLC_MeshData::chunckID (  )  [static]

Return the class Chunk ID.

Definition at line 111 of file glc_meshdata.cpp.

References m_ChunkId.

void GLC_MeshData::clear (  ) 
GLfloatVector GLC_MeshData::colorVector (  )  const

Return the color Vector.

Definition at line 190 of file glc_meshdata.cpp.

References m_ColorBuffer, m_Colors, m_ColorSize, and normalVector().

Referenced by copyVboToClientSide(), operator<<(), operator=(), and setVboUsage().

GLfloatVector* GLC_MeshData::colorVectorHandle (  )  [inline]

Return the Color Vector handle.

Definition at line 113 of file glc_meshdata.h.

Referenced by GLC_Mesh::activateVertexArray().

void GLC_MeshData::copyVboToClientSide (  ) 
void GLC_MeshData::createVBOs (  ) 

Vbo creation.

Definition at line 367 of file glc_meshdata.cpp.

References m_ColorBuffer, m_Colors, m_LodList, m_NormalBuffer, m_TexelBuffer, m_Texels, and m_VertexBuffer.

Referenced by GLC_Mesh::glDraw(), and setVboUsage().

void GLC_MeshData::fillLodIbo (  ) 

Fill all LOD IBO.

Definition at line 492 of file glc_meshdata.cpp.

References lodCount(), and m_LodList.

Referenced by GLC_Mesh::fillVbosAndIbos().

void GLC_MeshData::fillVbo ( GLC_MeshData::VboType  vboType  ) 
void GLC_MeshData::finishLod (  ) 

If the there is more than 2 LOD Swap the first and last.

Definition at line 217 of file glc_meshdata.cpp.

References m_LodList.

Referenced by GLC_Mesh::finish().

GLC_Lod* GLC_MeshData::getLod ( int  index  )  const [inline]

Return the specified LOD if the LOD doesn't exists, return NULL.

Definition at line 137 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 117 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 131 of file glc_meshdata.h.

Referenced by GLC_Mesh::moveIndexToMeshDataLod().

void GLC_MeshData::initPositionSize (  )  [inline]

Init the position size.

Definition at line 192 of file glc_meshdata.h.

Referenced by GLC_Mesh::glDraw().

bool GLC_MeshData::isEmpty ( void   )  const [inline]

Return true if the mesh data doesn't contains vertice.

Definition at line 143 of file glc_meshdata.h.

Referenced by GLC_Mesh::volume().

int GLC_MeshData::lodCount (  )  const [inline]
GLfloatVector GLC_MeshData::normalVector (  )  const

Return the normal Vector.

Definition at line 144 of file glc_meshdata.cpp.

References m_NormalBuffer, m_Normals, and m_PositionSize.

Referenced by colorVector(), copyVboToClientSide(), operator<<(), operator=(), GLC_Mesh::reverseNormals(), and setVboUsage().

GLfloatVector* GLC_MeshData::normalVectorHandle (  )  [inline]

Return the Normal Vector handle.

Definition at line 105 of file glc_meshdata.h.

Referenced by GLC_Mesh::activateVertexArray(), GLC_Mesh::copyBulkData(), GLC_Mesh::reverseNormals(), and GLC_Mesh::transformVertice().

GLC_MeshData & GLC_MeshData::operator= ( const GLC_MeshData meshData  ) 
bool GLC_MeshData::positionSizeIsSet (  )  const [inline]

Return true if the position size is set.

Definition at line 154 of file glc_meshdata.h.

Referenced by GLC_Mesh::glDraw().

GLfloatVector GLC_MeshData::positionVector (  )  const

Return the Position Vector.

Definition at line 117 of file glc_meshdata.cpp.

References m_Positions, m_PositionSize, and m_VertexBuffer.

Referenced by copyVboToClientSide(), operator<<(), operator=(), setVboUsage(), and GLC_Mesh::volume().

GLfloatVector* GLC_MeshData::positionVectorHandle (  )  [inline]

Return the Position Vector handle.

Definition at line 101 of file glc_meshdata.h.

Referenced by GLC_Mesh::activateVertexArray(), GLC_Mesh::boundingBox(), GLC_Mesh::copyBulkData(), and GLC_Mesh::transformVertice().

void GLC_MeshData::releaseVboClientSide ( bool  update = false  ) 
void GLC_MeshData::setVboUsage ( bool  usage  ) 
GLfloatVector GLC_MeshData::texelVector (  )  const

Return the texel Vector.

Definition at line 167 of file glc_meshdata.cpp.

References m_TexelBuffer, m_Texels, and m_TexelsSize.

Referenced by copyVboToClientSide(), operator<<(), operator=(), and setVboUsage().

GLfloatVector* GLC_MeshData::texelVectorHandle (  )  [inline]

Return the Texel Vector handle.

Definition at line 109 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 181 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 147 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 209 of file glc_meshdata.h.

Referenced by GLC_Mesh::activateVboAndIbo().

bool GLC_MeshData::useVBO ( bool  use,
GLC_MeshData::VboType  type 
)

Friends And Related Function Documentation

GLC_LIB_EXPORT QDataStream& operator<< ( QDataStream &  ,
const GLC_MeshData  
) [friend]

Non-member stream operator.

Definition at line 502 of file glc_meshdata.cpp.

GLC_LIB_EXPORT QDataStream& operator>> ( QDataStream &  ,
GLC_MeshData  
) [friend]

Definition at line 524 of file glc_meshdata.cpp.


Member Data Documentation

quint32 GLC_MeshData::m_ChunkId = 0xA704 [static, private]

Class chunk id.

Definition at line 268 of file glc_meshdata.h.

Referenced by chunckID(), operator<<(), and operator>>().

QGLBuffer GLC_MeshData::m_ColorBuffer [private]

Color Buffer.

Definition at line 250 of file glc_meshdata.h.

Referenced by clear(), colorVector(), copyVboToClientSide(), createVBOs(), fillVbo(), setVboUsage(), and useVBO().

The size of Color VBO.

Definition at line 262 of file glc_meshdata.h.

Referenced by clear(), colorVector(), fillVbo(), operator=(), releaseVboClientSide(), and setVboUsage().

QList<GLC_Lod*> GLC_MeshData::m_LodList [private]

The list of LOD.

Definition at line 253 of file glc_meshdata.h.

Referenced by clear(), createVBOs(), fillLodIbo(), finishLod(), GLC_MeshData(), operator<<(), operator=(), operator>>(), and setVboUsage().

QGLBuffer GLC_MeshData::m_NormalBuffer [private]

Normals Buffer.

Definition at line 244 of file glc_meshdata.h.

Referenced by clear(), copyVboToClientSide(), createVBOs(), fillVbo(), normalVector(), setVboUsage(), and useVBO().

Vertex Normal Vector.

Definition at line 235 of file glc_meshdata.h.

Referenced by clear(), copyVboToClientSide(), fillVbo(), normalVector(), operator=(), operator>>(), releaseVboClientSide(), and setVboUsage().

Vertex Position Vector.

Definition at line 232 of file glc_meshdata.h.

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

The size of Position and normal VBO.

Definition at line 256 of file glc_meshdata.h.

Referenced by clear(), fillVbo(), normalVector(), operator=(), positionVector(), releaseVboClientSide(), and setVboUsage().

QGLBuffer GLC_MeshData::m_TexelBuffer [private]

Texture Buffer.

Definition at line 247 of file glc_meshdata.h.

Referenced by clear(), copyVboToClientSide(), createVBOs(), fillVbo(), setVboUsage(), texelVector(), and useVBO().

Vertex Texture coordinate.

Definition at line 238 of file glc_meshdata.h.

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

The size of texel VBO.

Definition at line 259 of file glc_meshdata.h.

Referenced by clear(), fillVbo(), operator=(), releaseVboClientSide(), setVboUsage(), and texelVector().

bool GLC_MeshData::m_UseVbo [private]

Use VBO.

Definition at line 265 of file glc_meshdata.h.

Referenced by operator=(), and setVboUsage().

QGLBuffer GLC_MeshData::m_VertexBuffer [private]

The vertex Buffer.

Definition at line 229 of file glc_meshdata.h.

Referenced by clear(), copyVboToClientSide(), createVBOs(), fillVbo(), positionVector(), releaseVboClientSide(), setVboUsage(), and useVBO().


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

SourceForge.net Logo

©2005-2011 Laurent Ribon