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.
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.
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.
static quint32 chunckID ()
 Return the class Chunk ID.

Detailed Description

GLC_MeshData : Contains all data of the mesh.

Definition at line 43 of file glc_meshdata.h.


Member Enumeration Documentation

Enum of VBO TYPE.

Enumerator:
GLC_Vertex 
GLC_Normal 
GLC_Texel 
GLC_Color 

Definition at line 51 of file glc_meshdata.h.


Constructor & Destructor Documentation

GLC_MeshData::GLC_MeshData (  ) 

Default constructor.

Definition at line 34 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 101 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 156 of file glc_meshdata.h.

Referenced by GLC_Mesh::setCurrentMaterial().

quint32 GLC_MeshData::chunckID (  )  [static]

Return the class Chunk ID.

Definition at line 109 of file glc_meshdata.cpp.

References m_ChunkId.

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]
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  ) 
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 
)

Friends And Related Function Documentation

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.


Member Data Documentation

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

Color index.

Definition at line 208 of file glc_meshdata.h.

Referenced by colorVector(), createVBOs(), finishVbo(), and operator=().

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

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

Vertex Position Vector.

Definition at line 199 of file glc_meshdata.h.

Referenced by clear(), finishVbo(), operator=(), and positionVector().

The size of Position and normal VBO.

Definition at line 223 of file glc_meshdata.h.

Referenced by clear(), finishVbo(), normalVector(), operator=(), and positionVector().

Vertex Texture coordinate.

Definition at line 205 of file glc_meshdata.h.

Referenced by clear(), createVBOs(), finishVbo(), operator=(), and texelVector().

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


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

SourceForge.net Logo

©2005 Laurent Ribon