GLC_ExtendedMesh Class Reference

GLC_ExtendedMesh : OpenGL 3D Mesh. More...

#include <glc_extendedmesh.h>

Inheritance diagram for GLC_ExtendedMesh:

GLC_VboGeom

List of all members.

OpenGL Functions



virtual void glExecute (bool, bool transparent=false)
 Specific glExecute method.
virtual void glDraw (bool transparent=false)
 Virtual interface for OpenGL Geometry set up.

Public Types

typedef QHash< GLC_uint,
GLC_PrimitiveGroup * > 
PrimitiveGroups
typedef QHash< const int,
PrimitiveGroups * > 
PrimitiveGroupsHash

Public Member Functions

Constructor / Destructor


 GLC_ExtendedMesh ()
 Default constructor.
 GLC_ExtendedMesh (const GLC_ExtendedMesh &)
 Copy constructor.
virtual ~GLC_ExtendedMesh ()
Get Functions


virtual unsigned int numberOfFaces () const
 Get number of faces.
virtual unsigned int numberOfVertex () const
 Get number of vertex.
unsigned int numberOfNormals () const
 Get number of normals.
virtual GLC_BoundingBoxboundingBox (void)
 return the mesh bounding box
virtual GLC_VboGeomclone () const
 Return a copy of the geometry.
bool ColorPearVertexIsAcivated () const
 Return true if color pear vertex is activated.
int numberOfLod ()
 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.
bool containsTriangles (int lod, GLC_uint materialId) const
 Return true if the mesh contains triangles.
QVector< GLuint > getTrianglesIndex (int lod, GLC_uint materialId) const
 Return the triangle index.
int numberOfTriangles (int lod, GLC_uint materialId) const
 Return the number of triangles.
bool containsStrips (int lod, GLC_uint materialId) const
 Return true if the mesh contains trips.
QList< QVector< GLuint > > getStripsIndex (int lod, GLC_uint materialId) const
 Return the strips index.
int numberOfStrips (int lod, GLC_uint materialId) const
 Return the number of strips.
bool containsFans (int lod, GLC_uint materialId) const
 Return true if the mesh contains fans.
QList< QVector< GLuint > > getFansIndex (int lod, GLC_uint materialId) const
 Return the fans index.
int numberOfFans (int lod, GLC_uint materialId) const
 Return the number of fans.
bool containsLod (int lod) const
 Return true if the mesh contains the specified LOD.
bool lodContainsMaterial (int lod, GLC_uint materialId) const
 Return true if the specified LOD conatins the specified material.
double getLodAccuracy (int lod) const
 Return the specified LOD accuracy.
Set Functions


void addVertices (const GLfloatVector &vertices)
 Add vertices coordinate.
void addNormals (const GLfloatVector &normals)
 Add Normals.
void addTexels (const GLfloatVector &texels)
 Add texel.
void addColors (const GLfloatVector &colors)
 Add Colors.
void addTriangles (GLC_Material *, const IndexList &, const int lod=0, double accuracy=0.0)
 Add triangles.
void addTrianglesStrip (GLC_Material *, const IndexList &, const int lod=0, double accuracy=0.0)
 Add triangles Strip.
void addTrianglesFan (GLC_Material *, const IndexList &, const int lod=0, double accuracy=0.0)
 Add triangles Fan.
void reverseNormals ()
 Reverse mesh normal.
void setColorPearVertex (bool flag)
 Set color per vertex flag.
void finished ()
 Copy vertex list in a vector list for Vertex Array Use.
virtual void setCurrentLod (const int)
 Set the lod Index.

Private Member Functions

Private services Functions


GLC_uint setCurrentMaterial (GLC_Material *, const int, double)
 Set the current material.
void createVbos ()
 Create VBO and IBO.
void finishVbo ()
 Finish VBO mesh.
void finishNonVbo ()
 Finish non Vbo mesh.

Private Attributes

PrimitiveGroupsHash m_PrimitiveGroups
 the list of Hash table of primitive group
GLC_uint m_DefaultMaterialId
 the default material Id
unsigned int m_NumberOfFaces
 Mesh number of faces.
unsigned int m_NumberOfVertice
 Mesh number of vertice.
unsigned int m_NumberOfNormals
 Mesh number of normals.
bool m_IsSelected
 Selection state.
bool m_ColorPearVertex
 Color pear vertex.
GLC_ExtendedGeomEngine m_ExtendedGeomEngine
 Geom engine.
int m_CurrentLod
 The current LOD index.


Detailed Description

GLC_ExtendedMesh : OpenGL 3D Mesh.

An GLC_ExtendedMesh is Mesh composed of triangles, strips and fan

Definition at line 47 of file glc_extendedmesh.h.


Member Typedef Documentation

Definition at line 50 of file glc_extendedmesh.h.

Definition at line 51 of file glc_extendedmesh.h.


Constructor & Destructor Documentation

GLC_ExtendedMesh::GLC_ExtendedMesh (  ) 

Default constructor.

Definition at line 31 of file glc_extendedmesh.cpp.

Referenced by clone().

GLC_ExtendedMesh::GLC_ExtendedMesh ( const GLC_ExtendedMesh mesh  ) 

Copy constructor.

Definition at line 46 of file glc_extendedmesh.cpp.

References m_DefaultMaterialId, GLC_VboGeom::m_MaterialHashMap, and m_PrimitiveGroups.

GLC_ExtendedMesh::~GLC_ExtendedMesh (  )  [virtual]

Definition at line 88 of file glc_extendedmesh.cpp.

References m_PrimitiveGroups.


Member Function Documentation

unsigned int GLC_ExtendedMesh::numberOfFaces (  )  const [virtual]

Get number of faces.

Reimplemented from GLC_VboGeom.

Definition at line 111 of file glc_extendedmesh.cpp.

References m_NumberOfFaces.

Referenced by GLC_ObjToWorld::addCurrentObjMeshToWorld().

unsigned int GLC_ExtendedMesh::numberOfVertex (  )  const [virtual]

Get number of vertex.

Reimplemented from GLC_VboGeom.

Definition at line 117 of file glc_extendedmesh.cpp.

References m_NumberOfVertice.

unsigned int GLC_ExtendedMesh::numberOfNormals (  )  const [inline]

Get number of normals.

Definition at line 78 of file glc_extendedmesh.h.

References m_NumberOfNormals.

GLC_BoundingBox & GLC_ExtendedMesh::boundingBox ( void   )  [virtual]

GLC_VboGeom * GLC_ExtendedMesh::clone (  )  const [virtual]

Return a copy of the geometry.

Implements GLC_VboGeom.

Definition at line 151 of file glc_extendedmesh.cpp.

References GLC_ExtendedMesh().

bool GLC_ExtendedMesh::ColorPearVertexIsAcivated (  )  const [inline]

Return true if color pear vertex is activated.

Definition at line 88 of file glc_extendedmesh.h.

References m_ColorPearVertex.

int GLC_ExtendedMesh::numberOfLod (  )  [inline]

Return the number of lod.

Definition at line 92 of file glc_extendedmesh.h.

References m_ExtendedGeomEngine, and GLC_ExtendedGeomEngine::numberOfLod().

Referenced by setCurrentLod().

GLfloatVector GLC_ExtendedMesh::positionVector (  )  const [inline]

Return the Position Vector.

Definition at line 96 of file glc_extendedmesh.h.

References m_ExtendedGeomEngine, and GLC_ExtendedGeomEngine::positionVector().

Referenced by GLC_Distance::addMeshTrianglesToPQP().

GLfloatVector GLC_ExtendedMesh::normalVector (  )  const [inline]

Return the normal Vector.

Definition at line 100 of file glc_extendedmesh.h.

References m_ExtendedGeomEngine, and GLC_ExtendedGeomEngine::normalVector().

GLfloatVector GLC_ExtendedMesh::texelVector (  )  const [inline]

Return the texel Vector.

Definition at line 104 of file glc_extendedmesh.h.

References m_ExtendedGeomEngine, and GLC_ExtendedGeomEngine::texelVector().

bool GLC_ExtendedMesh::containsTriangles ( int  lod,
GLC_uint  materialId 
) const

Return true if the mesh contains triangles.

Definition at line 157 of file glc_extendedmesh.cpp.

References m_PrimitiveGroups.

Referenced by GLC_Distance::addMeshTrianglesToPQP(), and getTrianglesIndex().

QVector< GLuint > GLC_ExtendedMesh::getTrianglesIndex ( int  lod,
GLC_uint  materialId 
) const

int GLC_ExtendedMesh::numberOfTriangles ( int  lod,
GLC_uint  materialId 
) const

Return the number of triangles.

Definition at line 192 of file glc_extendedmesh.cpp.

References m_PrimitiveGroups.

bool GLC_ExtendedMesh::containsStrips ( int  lod,
GLC_uint  materialId 
) const

Return true if the mesh contains trips.

Definition at line 201 of file glc_extendedmesh.cpp.

References m_PrimitiveGroups.

Referenced by GLC_Distance::addMeshTrianglesToPQP(), and getStripsIndex().

QList< QVector< GLuint > > GLC_ExtendedMesh::getStripsIndex ( int  lod,
GLC_uint  materialId 
) const

int GLC_ExtendedMesh::numberOfStrips ( int  lod,
GLC_uint  materialId 
) const

Return the number of strips.

Definition at line 256 of file glc_extendedmesh.cpp.

References m_PrimitiveGroups.

bool GLC_ExtendedMesh::containsFans ( int  lod,
GLC_uint  materialId 
) const

Return true if the mesh contains fans.

Definition at line 265 of file glc_extendedmesh.cpp.

References m_PrimitiveGroups.

Referenced by GLC_Distance::addMeshTrianglesToPQP(), and getFansIndex().

QList< QVector< GLuint > > GLC_ExtendedMesh::getFansIndex ( int  lod,
GLC_uint  materialId 
) const

int GLC_ExtendedMesh::numberOfFans ( int  lod,
GLC_uint  materialId 
) const

Return the number of fans.

Definition at line 275 of file glc_extendedmesh.cpp.

References m_PrimitiveGroups.

bool GLC_ExtendedMesh::containsLod ( int  lod  )  const [inline]

Return true if the mesh contains the specified LOD.

Definition at line 135 of file glc_extendedmesh.h.

References GLC_ExtendedGeomEngine::getLod(), and m_ExtendedGeomEngine.

Referenced by getLodAccuracy().

bool GLC_ExtendedMesh::lodContainsMaterial ( int  lod,
GLC_uint  materialId 
) const [inline]

Return true if the specified LOD conatins the specified material.

Definition at line 139 of file glc_extendedmesh.h.

References m_PrimitiveGroups.

Referenced by GLC_Distance::addMeshTrianglesToPQP().

double GLC_ExtendedMesh::getLodAccuracy ( int  lod  )  const [inline]

Return the specified LOD accuracy.

Definition at line 146 of file glc_extendedmesh.h.

References GLC_EngineLod::accuracy(), containsLod(), GLC_ExtendedGeomEngine::getLod(), and m_ExtendedGeomEngine.

void GLC_ExtendedMesh::addVertices ( const GLfloatVector vertices  )  [inline]

void GLC_ExtendedMesh::addNormals ( const GLfloatVector normals  )  [inline]

void GLC_ExtendedMesh::addTexels ( const GLfloatVector texels  )  [inline]

void GLC_ExtendedMesh::addColors ( const GLfloatVector colors  )  [inline]

void GLC_ExtendedMesh::addTriangles ( GLC_Material pMaterial,
const IndexList indexList,
const int  lod = 0,
double  accuracy = 0.0 
)

void GLC_ExtendedMesh::addTrianglesStrip ( GLC_Material pMaterial,
const IndexList indexList,
const int  lod = 0,
double  accuracy = 0.0 
)

Add triangles Strip.

Definition at line 346 of file glc_extendedmesh.cpp.

References GLC_VboGeom::m_GeometryIsValid, m_NumberOfFaces, m_PrimitiveGroups, and setCurrentMaterial().

Referenced by GLC_3dxmlToWorld::loadFace().

void GLC_ExtendedMesh::addTrianglesFan ( GLC_Material pMaterial,
const IndexList indexList,
const int  lod = 0,
double  accuracy = 0.0 
)

Add triangles Fan.

Definition at line 358 of file glc_extendedmesh.cpp.

References GLC_VboGeom::m_GeometryIsValid, m_NumberOfFaces, m_PrimitiveGroups, and setCurrentMaterial().

Referenced by GLC_3dxmlToWorld::loadFace().

void GLC_ExtendedMesh::reverseNormals (  )  [virtual]

void GLC_ExtendedMesh::setColorPearVertex ( bool  flag  )  [inline]

Set color per vertex flag.

Definition at line 195 of file glc_extendedmesh.h.

References m_ColorPearVertex.

Referenced by GLC_OffToWorld::CreateWorldFromOff().

void GLC_ExtendedMesh::finished (  ) 

void GLC_ExtendedMesh::setCurrentLod ( const   int  )  [virtual]

Set the lod Index.

Reimplemented from GLC_VboGeom.

Definition at line 402 of file glc_extendedmesh.cpp.

References m_CurrentLod, m_ExtendedGeomEngine, GLC_ExtendedGeomEngine::numberOfLod(), and numberOfLod().

void GLC_ExtendedMesh::glExecute ( bool  isSelected,
bool  transparent = false 
) [virtual]

Specific glExecute method.

Reimplemented from GLC_VboGeom.

Definition at line 420 of file glc_extendedmesh.cpp.

References GLC_VboGeom::glExecute(), and m_IsSelected.

void GLC_ExtendedMesh::glDraw ( bool  transparent = false  )  [private, virtual]

Virtual interface for OpenGL Geometry set up.

This Virtual function is implemented here.
Throw GLC_OpenGlException

Implements GLC_VboGeom.

Definition at line 428 of file glc_extendedmesh.cpp.

References GLC_ExtendedGeomEngine::colorVectorHandle(), GLC_PrimitiveGroup::containsFan(), GLC_PrimitiveGroup::containsStrip(), GLC_PrimitiveGroup::containsTriangles(), createVbos(), GLC_ExtendedGeomEngine::createVBOs(), GLC_Material::diffuseColor(), GLC_PrimitiveGroup::fansOffset(), GLC_PrimitiveGroup::fansOffseti(), GLC_PrimitiveGroup::fansSizes(), glBufferData, GLC_ExtendedGeomEngine::GLC_Color, GLC_ExtendedGeomEngine::GLC_Normal, GLC_ExtendedGeomEngine::GLC_Texel, GLC_ExtendedGeomEngine::GLC_Vertex, GLC_SelectionMaterial::glExecute(), GLC_Material::glExecute(), GLC_Material::hasTexture(), GLC_PrimitiveGroup::id(), GLC_ExtendedGeomEngine::indexVectorHandle(), GLC_State::isInSelectionMode(), GLC_Material::isTransparent(), m_ColorPearVertex, m_CurrentLod, m_ExtendedGeomEngine, GLC_VboGeom::m_GeometryIsValid, m_IsSelected, GLC_VboGeom::m_MaterialHash, m_PrimitiveGroups, GLC_ExtendedGeomEngine::normalVectorHandle(), GLC_ExtendedGeomEngine::positionVectorHandle(), GLC_State::selectionShaderUsed(), GLC_PrimitiveGroup::stripsOffset(), GLC_PrimitiveGroup::stripsOffseti(), GLC_PrimitiveGroup::stripsSizes(), GLC_ExtendedGeomEngine::texelVectorHandle(), GLC_PrimitiveGroup::trianglesIndexOffset(), GLC_PrimitiveGroup::trianglesIndexOffseti(), GLC_PrimitiveGroup::trianglesIndexSize(), GLC_ExtendedGeomEngine::useIBO(), GLC_ExtendedGeomEngine::useVBO(), and GLC_State::vboUsed().

GLC_uint GLC_ExtendedMesh::setCurrentMaterial ( GLC_Material pMaterial,
const   int,
double  accuracy 
) [private]

void GLC_ExtendedMesh::createVbos (  )  [private]

void GLC_ExtendedMesh::finishVbo (  )  [private]

void GLC_ExtendedMesh::finishNonVbo (  )  [private]


Member Data Documentation

the default material Id

Definition at line 250 of file glc_extendedmesh.h.

Referenced by GLC_ExtendedMesh(), and setCurrentMaterial().

unsigned int GLC_ExtendedMesh::m_NumberOfFaces [private]

Mesh number of faces.

Definition at line 253 of file glc_extendedmesh.h.

Referenced by addTriangles(), addTrianglesFan(), addTrianglesStrip(), and numberOfFaces().

unsigned int GLC_ExtendedMesh::m_NumberOfVertice [private]

Mesh number of vertice.

Definition at line 256 of file glc_extendedmesh.h.

Referenced by addVertices(), and numberOfVertex().

unsigned int GLC_ExtendedMesh::m_NumberOfNormals [private]

Mesh number of normals.

Definition at line 259 of file glc_extendedmesh.h.

Referenced by addNormals(), and numberOfNormals().

Selection state.

Definition at line 262 of file glc_extendedmesh.h.

Referenced by glDraw(), and glExecute().

Color pear vertex.

Definition at line 265 of file glc_extendedmesh.h.

Referenced by ColorPearVertexIsAcivated(), glDraw(), and setColorPearVertex().

The current LOD index.

Definition at line 271 of file glc_extendedmesh.h.

Referenced by glDraw(), and setCurrentLod().


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

SourceForge.net Logo

©2005 Laurent Ribon