GLC_Mesh Class Reference

GLC_Mesh : OpenGL 3D Mesh. More...

#include <glc_mesh.h>

Inheritance diagram for GLC_Mesh:
GLC_Geometry GLC_Box GLC_Cone GLC_Cylinder GLC_Disc GLC_Rectangle GLC_Sphere

List of all members.

Public Types

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

Public Member Functions

Constructor / Destructor

 GLC_Mesh ()
 Default constructor.
 GLC_Mesh (const GLC_Mesh &)
 Copy constructor.
GLC_Meshoperator= (const GLC_Mesh &)
 Overload "=" operator.
virtual ~GLC_Mesh ()
 Destructor.
Set Functions

virtual void clear ()
 Clear the content of the mesh and super class and makes them empty.
void clearMeshWireAndBoundingBox ()
 Clear only the content off the mesh and makes it empty.
void addVertice (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.
GLC_uint addTriangles (GLC_Material *, const IndexList &, const int lod=0, double accuracy=0.0)
 Add triangles.
GLC_uint addTrianglesStrip (GLC_Material *, const IndexList &, const int lod=0, double accuracy=0.0)
 Add triangles Strip and return his id.
GLC_uint addTrianglesFan (GLC_Material *, const IndexList &, const int lod=0, double accuracy=0.0)
 Add triangles Fan and return his id.
void reverseNormals ()
 Reverse mesh normal.
void setColorPearVertex (bool flag)
 Set color per vertex flag to use indexed color.
void finish ()
 Copy vertex list in a vector list for Vertex Array Use.
virtual void setCurrentLod (const int)
 Set the lod Index.
virtual void replaceMasterMaterial (GLC_Material *)
 Replace the Master material.
void replaceMaterial (const GLC_uint, GLC_Material *)
 Replace the material specified by id with another one.
void setNextPrimitiveLocalId (GLC_uint id)
 Set the mesh next primitive local id.
void setWireColor (const QColor &color)
 Set the mesh wire color.
virtual void copyVboToClientSide ()
 Copy VBO to the Client Side.
virtual void releaseVboClientSide (bool update)
 Release client VBO.
virtual void setVboUsage (bool usage)
 Set VBO usage.
Binary serialisation Functions

void loadFromDataStream (QDataStream &, const MaterialHash &, const QHash< GLC_uint, GLC_uint > &)
 Load the mesh from binary data stream.
void saveToDataStream (QDataStream &) const
 Save the mesh to binary data stream.

Protected Member Functions

OpenGL Functions

virtual void glDraw (const GLC_RenderProperties &)
 Virtual interface for OpenGL Geometry set up.

Private Member Functions

Private services Functions

GLC_uint setCurrentMaterial (GLC_Material *, const int, double)
 Set the current material.
void fillVbosAndIbos ()
 Fill VBOs and IBOs.
void finishSerialized ()
 Set primitive group offset after loading mesh from binary.
void moveIndexToMeshDataLod ()
 Move Indexs from the primitive groups to the mesh Data LOD and Set IBOs offsets.
void vboDrawPrimitivesOf (GLC_PrimitiveGroup *)
 Use VBO to Draw primitives from the specified GLC_PrimitiveGroup.
void vertexArrayDrawPrimitivesOf (GLC_PrimitiveGroup *)
 Use Vertex Array to Draw primitives from the specified GLC_PrimitiveGroup.
void vboDrawInSelectionModePrimitivesOf (GLC_PrimitiveGroup *)
 Use VBO to Draw primitives in selection mode from the specified GLC_PrimitiveGroup.
void vertexArrayDrawInSelectionModePrimitivesOf (GLC_PrimitiveGroup *)
 Use Vertex Array to Draw primitives in selection mode from the specified GLC_PrimitiveGroup.
void vboDrawPrimitivesGroupOf (GLC_PrimitiveGroup *, GLC_Material *, bool, bool, QHash< GLC_uint, GLC_Material * > *)
 Use VBO to Draw primitives with specific materials from the specified GLC_PrimitiveGroup.
void vertexArrayDrawPrimitivesGroupOf (GLC_PrimitiveGroup *, GLC_Material *, bool, bool, QHash< GLC_uint, GLC_Material * > *)
 Use Vertex Array to Draw primitives with specific materials from the specified GLC_PrimitiveGroup.
void vboDrawSelectedPrimitivesGroupOf (GLC_PrimitiveGroup *, GLC_Material *, bool, bool, const GLC_RenderProperties &)
 Use VBO to Draw primitives with selection materials from the specified GLC_PrimitiveGroup.
void vertexArrayDrawSelectedPrimitivesGroupOf (GLC_PrimitiveGroup *, GLC_Material *, bool, bool, const GLC_RenderProperties &)
 Use Vertex Array to Draw primitives with selection materials from the specified GLC_PrimitiveGroup.
void activateVboAndIbo ()
 Activate mesh VBOs and IBO of the current LOD.
void activateVertexArray ()
 Activate vertex Array.
void normalRenderLoop (const GLC_RenderProperties &, bool)
 The normal display loop.
void OverwriteMaterialRenderLoop (const GLC_RenderProperties &, bool)
 The overwrite material render loop.
void OverwriteTransparencyRenderLoop (const GLC_RenderProperties &, bool)
 The overwrite transparency render loop.
void OverwriteTransparencyAndMaterialRenderLoop (const GLC_RenderProperties &, bool)
 The overwrite transparency and material render loop.
void bodySelectionRenderLoop (bool)
 The body selection render loop.
void primitiveSelectionRenderLoop (bool)
 The primitive selection render loop.
void primitiveRenderLoop (const GLC_RenderProperties &, bool)
 The primitive render loop.
void primitiveSelectedRenderLoop (const GLC_RenderProperties &, bool)
 The primitive Selected render loop.
void copyIndex (int lod, GLC_Mesh *pLodMesh, QHash< GLuint, GLuint > &sourceToTargetIndexMap, QHash< GLuint, GLuint > &tagetToSourceIndexMap, int &maxIndex, int targetLod)
 Copy index of this mesh from the given LOD into the given mesh.
void copyBulkData (GLC_Mesh *pLodMesh, const QHash< GLuint, GLuint > &tagetToSourceIndexMap, int maxIndex)
 Copy Bulk data.
IndexList equivalentTrianglesIndexOfstripsIndex (int lodIndex, GLC_uint materialId)
 Return the equivalent triangles index of the strips index of given LOD and material ID.
IndexList equivalentTrianglesIndexOfFansIndex (int lodIndex, GLC_uint materialId)
 Return the equivalent triangles index of the fan index of given LOD and material ID.

Private Attributes

GLC_uint m_NextPrimitiveLocalId
 The next primitive local id.
PrimitiveGroupsHash m_PrimitiveGroups
 The hash table of Hash table of primitive group.
GLC_uint m_DefaultMaterialId
 The default material Id.
unsigned int m_NumberOfVertice
 Mesh number of vertice.
unsigned int m_NumberOfNormals
 Mesh number of normals.
bool m_ColorPearVertex
 Color pear vertex.
GLC_MeshData m_MeshData
 Data of the mesh (Bulk Data + LOD with indexs).
int m_CurrentLod
 The current LOD index.

Static Private Attributes

static quint32 m_ChunkId = 0xA701
 Class chunk id.

Friends

QDataStream & operator<< (QDataStream &, const GLC_Mesh &)
QDataStream & operator>> (QDataStream &, GLC_Mesh &)

Get Functions



virtual unsigned int faceCount (int lod) const
 Get number of faces.
virtual unsigned int VertexCount () const
 Get number of vertex.
unsigned int numberOfNormals () const
 Get number of normals.
virtual const GLC_BoundingBoxboundingBox (void)
 return the mesh bounding box
virtual GLC_Geometryclone () const
 Return a copy of the Mesh as GLC_Geometry pointer.
bool ColorPearVertexIsAcivated () const
 Return true if color pear vertex is activated.
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.
bool containsTriangles (int lod, GLC_uint materialId) const
 Return true if the mesh contains triangles in the specified LOD.
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 in the specified LOD.
bool containsStrips (int lod, GLC_uint materialId) const
 Return true if the mesh contains trips in the specified LOD with the specified material id.
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 in the specified LOD with the specified material id.
bool containsFans (int lod, GLC_uint materialId) const
 Return true if the mesh contains fans in the specified LOD with the specified material id.
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 in the specified LOD with the specified material id.
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 contains the specified material.
double getLodAccuracy (int lod) const
 Return the specified LOD accuracy.
GLC_uint nextPrimitiveLocalId () const
 Return the next primitive local id.
bool isEmpty () const
 Return true if the mesh position data is empty.
QColor wireColor () const
 Return the mesh wire color.
GLC_MeshcreateMeshOfGivenLod (int lodIndex)
 Create a mesh of the given LOD index.
GLC_MeshcreateMeshFromGivenLod (int lodIndex)
 Create a mesh from the given LOD index.
GLC_MeshtransformVertice (const GLC_Matrix4x4 &matrix)
 Transform mesh vertice by the given matrix.
virtual double volume ()
 Return the volume of this mesh.
static quint32 chunckID ()
 Return the class Chunk ID.

Detailed Description

GLC_Mesh : OpenGL 3D Mesh.

An GLC_Mesh is Mesh composed of triangles, strips and fan

Definition at line 49 of file glc_mesh.h.


Member Typedef Documentation

Definition at line 55 of file glc_mesh.h.

Definition at line 56 of file glc_mesh.h.


Constructor & Destructor Documentation

GLC_Mesh::GLC_Mesh (  ) 

Default constructor.

Definition at line 32 of file glc_mesh.cpp.

Referenced by clone().

GLC_Mesh::GLC_Mesh ( const GLC_Mesh mesh  ) 

Copy constructor.

Definition at line 46 of file glc_mesh.cpp.

References m_PrimitiveGroups.

GLC_Mesh::~GLC_Mesh (  )  [virtual]

Destructor.

Definition at line 123 of file glc_mesh.cpp.

References m_PrimitiveGroups.


Member Function Documentation

void GLC_Mesh::activateVboAndIbo (  )  [inline, private]
void GLC_Mesh::activateVertexArray (  )  [inline, private]
void GLC_Mesh::addColors ( const GLfloatVector colors  )  [inline]

Add Colors.

Definition at line 224 of file glc_mesh.h.

Referenced by GLC_OffToWorld::CreateWorldFromOff().

void GLC_Mesh::addNormals ( const GLfloatVector normals  )  [inline]
void GLC_Mesh::addTexels ( const GLfloatVector texels  )  [inline]
GLC_uint GLC_Mesh::addTriangles ( GLC_Material pMaterial,
const IndexList indexList,
const int  lod = 0,
double  accuracy = 0.0 
)
GLC_uint GLC_Mesh::addTrianglesFan ( GLC_Material pMaterial,
const IndexList indexList,
const int  lod = 0,
double  accuracy = 0.0 
)
GLC_uint GLC_Mesh::addTrianglesStrip ( GLC_Material pMaterial,
const IndexList indexList,
const int  lod = 0,
double  accuracy = 0.0 
)
void GLC_Mesh::addVertice ( const GLfloatVector vertices  )  [inline]
void GLC_Mesh::bodySelectionRenderLoop ( bool  vboIsUsed  )  [private]

The body selection render loop.

Definition at line 1327 of file glc_mesh.cpp.

References GLC_State::isInSelectionMode(), m_CurrentLod, m_PrimitiveGroups, vboDrawPrimitivesOf(), and vertexArrayDrawPrimitivesOf().

Referenced by glDraw().

const GLC_BoundingBox & GLC_Mesh::boundingBox ( void   )  [virtual]
quint32 GLC_Mesh::chunckID (  )  [static]

Return the class Chunk ID.

Reimplemented in GLC_Cone, GLC_Cylinder, and GLC_Sphere.

Definition at line 144 of file glc_mesh.cpp.

References m_ChunkId.

void GLC_Mesh::clear (  )  [virtual]

Clear the content of the mesh and super class and makes them empty.

Reimplemented from GLC_Geometry.

Definition at line 517 of file glc_mesh.cpp.

References clearMeshWireAndBoundingBox().

void GLC_Mesh::clearMeshWireAndBoundingBox (  ) 
GLC_Geometry * GLC_Mesh::clone (  )  const [virtual]

Return a copy of the Mesh as GLC_Geometry pointer.

Implements GLC_Geometry.

Reimplemented in GLC_Box, GLC_Cone, GLC_Cylinder, GLC_Disc, GLC_Rectangle, and GLC_Sphere.

Definition at line 191 of file glc_mesh.cpp.

References GLC_Mesh().

bool GLC_Mesh::ColorPearVertexIsAcivated (  )  const [inline]

Return true if color pear vertex is activated.

Definition at line 100 of file glc_mesh.h.

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

Return true if the mesh contains fans in the specified LOD with the specified material id.

Definition at line 305 of file glc_mesh.cpp.

References m_PrimitiveGroups.

Referenced by copyIndex(), equivalentTrianglesIndexOfFansIndex(), getFansIndex(), volume(), and GLC_WorldTo3dxml::writeGeometryFace().

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

Return true if the mesh contains the specified LOD.

Definition at line 150 of file glc_mesh.h.

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

Return true if the mesh contains trips in the specified LOD with the specified material id.

Definition at line 241 of file glc_mesh.cpp.

References m_PrimitiveGroups.

Referenced by copyIndex(), equivalentTrianglesIndexOfstripsIndex(), getStripsIndex(), volume(), and GLC_WorldTo3dxml::writeGeometryFace().

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

Return true if the mesh contains triangles in the specified LOD.

Definition at line 197 of file glc_mesh.cpp.

References m_PrimitiveGroups.

Referenced by copyIndex(), getTrianglesIndex(), volume(), and GLC_WorldTo3dxml::writeGeometryFace().

void GLC_Mesh::copyBulkData ( GLC_Mesh pLodMesh,
const QHash< GLuint, GLuint > &  tagetToSourceIndexMap,
int  maxIndex 
) [private]
void GLC_Mesh::copyIndex ( int  lod,
GLC_Mesh pLodMesh,
QHash< GLuint, GLuint > &  sourceToTargetIndexMap,
QHash< GLuint, GLuint > &  tagetToSourceIndexMap,
int &  maxIndex,
int  targetLod 
) [private]
void GLC_Mesh::copyVboToClientSide (  )  [virtual]

Copy VBO to the Client Side.

Reimplemented from GLC_Geometry.

Definition at line 733 of file glc_mesh.cpp.

References GLC_MeshData::copyVboToClientSide(), and m_MeshData.

Referenced by createMeshFromGivenLod(), createMeshOfGivenLod(), and transformVertice().

GLC_Mesh * GLC_Mesh::createMeshFromGivenLod ( int  lodIndex  ) 
GLC_Mesh * GLC_Mesh::createMeshOfGivenLod ( int  lodIndex  ) 
IndexList GLC_Mesh::equivalentTrianglesIndexOfFansIndex ( int  lodIndex,
GLC_uint  materialId 
) [private]

Return the equivalent triangles index of the fan index of given LOD and material ID.

Definition at line 1594 of file glc_mesh.cpp.

References containsFans(), and getFansIndex().

Referenced by volume().

IndexList GLC_Mesh::equivalentTrianglesIndexOfstripsIndex ( int  lodIndex,
GLC_uint  materialId 
) [private]

Return the equivalent triangles index of the strips index of given LOD and material ID.

Definition at line 1559 of file glc_mesh.cpp.

References containsStrips(), and getStripsIndex().

Referenced by volume().

unsigned int GLC_Mesh::faceCount ( int  lod  )  const [virtual]

Get number of faces.

Reimplemented from GLC_Geometry.

Definition at line 150 of file glc_mesh.cpp.

References m_MeshData, and GLC_MeshData::trianglesCount().

Referenced by GLC_ObjToWorld::addCurrentObjMeshToWorld().

void GLC_Mesh::fillVbosAndIbos (  )  [private]
void GLC_Mesh::finish (  ) 
void GLC_Mesh::finishSerialized (  )  [private]

Set primitive group offset after loading mesh from binary.

Definition at line 1087 of file glc_mesh.cpp.

References m_PrimitiveGroups.

Referenced by loadFromDataStream().

QList< QVector< GLuint > > GLC_Mesh::getFansIndex ( int  lod,
GLC_uint  materialId 
) const
double GLC_Mesh::getLodAccuracy ( int  lod  )  const [inline]

Return the specified LOD accuracy.

The specified LOD must exists

Definition at line 162 of file glc_mesh.h.

Referenced by GLC_WorldTo3dxml::writeGeometry().

QList< QVector< GLuint > > GLC_Mesh::getStripsIndex ( int  lod,
GLC_uint  materialId 
) const
QVector< GLuint > GLC_Mesh::getTrianglesIndex ( int  lod,
GLC_uint  materialId 
) const
void GLC_Mesh::glDraw ( const GLC_RenderProperties renderProperties  )  [protected, virtual]

Virtual interface for OpenGL Geometry set up.

This Virtual function is implemented here.

Implements GLC_Geometry.

Reimplemented in GLC_Box, GLC_Cone, GLC_Cylinder, GLC_Disc, GLC_Rectangle, and GLC_Sphere.

Definition at line 861 of file glc_mesh.cpp.

References activateVboAndIbo(), activateVertexArray(), GLC_RenderStatistics::addBodies(), addTriangles(), glc::BodySelection, bodySelectionRenderLoop(), GLC_MeshData::createVBOs(), GLC_Context::current(), fillVbosAndIbos(), GLC_Context::glcEnableLighting(), GLC_WireData::glDraw(), GLC_RenderProperties::hashOfOverwritePrimitiveMaterialsIsEmpty(), GLC_MeshData::initPositionSize(), GLC_WireData::isEmpty(), GLC_State::isInSelectionMode(), m_ColorPearVertex, m_CurrentLod, GLC_Geometry::m_GeometryIsValid, GLC_Geometry::m_IsSelected, m_MeshData, GLC_Geometry::m_WireColor, GLC_Geometry::m_WireData, normalRenderLoop(), glc::NormalRenderMode, glc::OverwriteMaterial, OverwriteMaterialRenderLoop(), glc::OverwritePrimitiveMaterial, glc::OverwriteTransparency, glc::OverwriteTransparencyAndMaterial, OverwriteTransparencyAndMaterialRenderLoop(), OverwriteTransparencyRenderLoop(), GLC_MeshData::positionSizeIsSet(), primitiveRenderLoop(), glc::PrimitiveSelected, primitiveSelectedRenderLoop(), glc::PrimitiveSelection, primitiveSelectionRenderLoop(), GLC_RenderProperties::renderingFlag(), GLC_RenderProperties::renderingMode(), GLC_RenderProperties::savedRenderingMode(), GLC_RenderProperties::setOfSelectedPrimitiveIdIsEmpty(), GLC_MeshData::trianglesCount(), GLC_Geometry::typeIsWire(), GLC_Geometry::vboIsUsed(), GLC_State::vboSupported(), and glc::WireRenderFlag.

bool GLC_Mesh::isEmpty ( void   )  const [inline]
void GLC_Mesh::loadFromDataStream ( QDataStream &  stream,
const MaterialHash materialHash,
const QHash< GLC_uint, GLC_uint > &  materialIdMap 
)

Load the mesh from binary data stream.

The MaterialHash contains a hash table of GLC_Material that the mesh can use The QHash<GLC_uint, GLC_uint> is used to map serialised material ID to the new constructed materials

Definition at line 755 of file glc_mesh.cpp.

References GLC_Geometry::addMaterial(), GLC_Geometry::containsMaterial(), finishSerialized(), lodCount(), m_ChunkId, m_MeshData, m_NumberOfNormals, m_NumberOfVertice, m_PrimitiveGroups, GLC_Geometry::m_WireData, GLC_Geometry::setName(), and setNextPrimitiveLocalId().

Referenced by operator>>().

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

Return true if the specified LOD contains the specified material.

Definition at line 154 of file glc_mesh.h.

Referenced by GLC_WorldTo3dxml::writeGeometry().

int GLC_Mesh::lodCount (  )  const [inline]

Return the number of lod.

Definition at line 104 of file glc_mesh.h.

Referenced by createMeshFromGivenLod(), loadFromDataStream(), and GLC_WorldTo3dxml::writeGeometry().

void GLC_Mesh::moveIndexToMeshDataLod (  )  [private]

Move Indexs from the primitive groups to the mesh Data LOD and Set IBOs offsets.

Move Indexs from the primitive groups to the mesh Data LOD and Set Index offsets

Definition at line 1143 of file glc_mesh.cpp.

References GLC_MeshData::indexVectorHandle(), GLC_MeshData::indexVectorSize(), m_MeshData, and m_PrimitiveGroups.

Referenced by finish().

GLC_uint GLC_Mesh::nextPrimitiveLocalId (  )  const [inline]

Return the next primitive local id.

Definition at line 169 of file glc_mesh.h.

Referenced by saveToDataStream().

void GLC_Mesh::normalRenderLoop ( const GLC_RenderProperties renderProperties,
bool  vboIsUsed 
) [private]
GLfloatVector GLC_Mesh::normalVector (  )  const [inline]

Return the normal Vector.

Definition at line 112 of file glc_mesh.h.

Referenced by GLC_Cone::createMeshAndWire(), and GLC_WorldTo3dxml::writeGeometry().

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

Return the number of fans in the specified LOD with the specified material id.

Return the number of fans.

Definition at line 315 of file glc_mesh.cpp.

References m_PrimitiveGroups.

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

Get number of normals.

Definition at line 90 of file glc_mesh.h.

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

Return the number of strips in the specified LOD with the specified material id.

Definition at line 296 of file glc_mesh.cpp.

References m_PrimitiveGroups.

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

Return the number of triangles in the specified LOD.

Definition at line 232 of file glc_mesh.cpp.

References m_PrimitiveGroups.

GLC_Mesh & GLC_Mesh::operator= ( const GLC_Mesh mesh  ) 
void GLC_Mesh::OverwriteMaterialRenderLoop ( const GLC_RenderProperties renderProperties,
bool  vboIsUsed 
) [private]
void GLC_Mesh::OverwriteTransparencyAndMaterialRenderLoop ( const GLC_RenderProperties renderProperties,
bool  vboIsUsed 
) [private]
void GLC_Mesh::OverwriteTransparencyRenderLoop ( const GLC_RenderProperties renderProperties,
bool  vboIsUsed 
) [private]
GLfloatVector GLC_Mesh::positionVector (  )  const [inline]

Return the Position Vector.

Definition at line 108 of file glc_mesh.h.

Referenced by GLC_WorldTo3dxml::writeGeometry().

void GLC_Mesh::primitiveRenderLoop ( const GLC_RenderProperties renderProperties,
bool  vboIsUsed 
) [private]
void GLC_Mesh::primitiveSelectedRenderLoop ( const GLC_RenderProperties renderProperties,
bool  vboIsUsed 
) [private]
void GLC_Mesh::primitiveSelectionRenderLoop ( bool  vboIsUsed  )  [private]

The primitive selection render loop.

Definition at line 1346 of file glc_mesh.cpp.

References GLC_State::isInSelectionMode(), m_CurrentLod, m_PrimitiveGroups, vboDrawInSelectionModePrimitivesOf(), and vertexArrayDrawInSelectionModePrimitivesOf().

Referenced by glDraw().

void GLC_Mesh::releaseVboClientSide ( bool  update  )  [virtual]

Release client VBO.

Reimplemented from GLC_Geometry.

Definition at line 739 of file glc_mesh.cpp.

References m_MeshData, and GLC_MeshData::releaseVboClientSide().

Referenced by createMeshFromGivenLod(), createMeshOfGivenLod(), and transformVertice().

void GLC_Mesh::replaceMasterMaterial ( GLC_Material pMat  )  [virtual]
void GLC_Mesh::replaceMaterial ( const GLC_uint  oldId,
GLC_Material pMat 
)
void GLC_Mesh::reverseNormals (  )  [virtual]
void GLC_Mesh::saveToDataStream ( QDataStream &  stream  )  const

Save the mesh to binary data stream.

Definition at line 814 of file glc_mesh.cpp.

References m_ChunkId, m_MeshData, m_NumberOfNormals, m_NumberOfVertice, m_PrimitiveGroups, GLC_Geometry::m_WireData, GLC_Geometry::name(), and nextPrimitiveLocalId().

Referenced by operator<<().

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

Set color per vertex flag to use indexed color.

Definition at line 240 of file glc_mesh.h.

Referenced by GLC_OffToWorld::CreateWorldFromOff().

void GLC_Mesh::setCurrentLod ( const int  value  )  [virtual]

Set the lod Index.

Reimplemented from GLC_Geometry.

Definition at line 659 of file glc_mesh.cpp.

References GLC_MeshData::lodCount(), m_CurrentLod, and m_MeshData.

GLC_uint GLC_Mesh::setCurrentMaterial ( GLC_Material pMaterial,
const  int,
double  accuracy 
) [private]
void GLC_Mesh::setNextPrimitiveLocalId ( GLC_uint  id  )  [inline]

Set the mesh next primitive local id.

Definition at line 256 of file glc_mesh.h.

Referenced by loadFromDataStream().

void GLC_Mesh::setVboUsage ( bool  usage  )  [virtual]

Set VBO usage.

Reimplemented from GLC_Geometry.

Definition at line 745 of file glc_mesh.cpp.

References isEmpty(), m_MeshData, and GLC_MeshData::setVboUsage().

void GLC_Mesh::setWireColor ( const QColor &  color  )  [inline]

Set the mesh wire color.

Reimplemented from GLC_Geometry.

Definition at line 260 of file glc_mesh.h.

GLfloatVector GLC_Mesh::texelVector (  )  const [inline]
GLC_Mesh & GLC_Mesh::transformVertice ( const GLC_Matrix4x4 matrix  ) 
void GLC_Mesh::vboDrawInSelectionModePrimitivesOf ( GLC_PrimitiveGroup pCurrentGroup  )  [inline, private]
void GLC_Mesh::vboDrawPrimitivesGroupOf ( GLC_PrimitiveGroup pCurrentGroup,
GLC_Material pCurrentMaterial,
bool  materialIsRenderable,
bool  isTransparent,
QHash< GLC_uint, GLC_Material * > *  pMaterialHash 
) [inline, private]
void GLC_Mesh::vboDrawPrimitivesOf ( GLC_PrimitiveGroup pCurrentGroup  )  [inline, private]
void GLC_Mesh::vboDrawSelectedPrimitivesGroupOf ( GLC_PrimitiveGroup pCurrentGroup,
GLC_Material pCurrentMaterial,
bool  materialIsRenderable,
bool  isTransparent,
const GLC_RenderProperties renderProperties 
) [inline, private]
void GLC_Mesh::vertexArrayDrawInSelectionModePrimitivesOf ( GLC_PrimitiveGroup pCurrentGroup  )  [inline, private]
void GLC_Mesh::vertexArrayDrawPrimitivesGroupOf ( GLC_PrimitiveGroup pCurrentGroup,
GLC_Material pCurrentMaterial,
bool  materialIsRenderable,
bool  isTransparent,
QHash< GLC_uint, GLC_Material * > *  pMaterialHash 
) [inline, private]
void GLC_Mesh::vertexArrayDrawPrimitivesOf ( GLC_PrimitiveGroup pCurrentGroup  )  [inline, private]
void GLC_Mesh::vertexArrayDrawSelectedPrimitivesGroupOf ( GLC_PrimitiveGroup pCurrentGroup,
GLC_Material pCurrentMaterial,
bool  materialIsRenderable,
bool  isTransparent,
const GLC_RenderProperties renderProperties 
) [inline, private]
unsigned int GLC_Mesh::VertexCount (  )  const [virtual]

Get number of vertex.

Reimplemented from GLC_Geometry.

Definition at line 156 of file glc_mesh.cpp.

References m_NumberOfVertice.

double GLC_Mesh::volume (  )  [virtual]
QColor GLC_Mesh::wireColor (  )  const [inline]

Return the mesh wire color.

Reimplemented from GLC_Geometry.

Definition at line 177 of file glc_mesh.h.

Referenced by GLC_WorldTo3dxml::writeEdges().


Friends And Related Function Documentation

QDataStream& operator<< ( QDataStream &  ,
const GLC_Mesh  
) [friend]
QDataStream& operator>> ( QDataStream &  ,
GLC_Mesh  
) [friend]

Member Data Documentation

quint32 GLC_Mesh::m_ChunkId = 0xA701 [static, private]

Class chunk id.

Reimplemented in GLC_Cone, GLC_Cylinder, and GLC_Sphere.

Definition at line 421 of file glc_mesh.h.

Referenced by chunckID(), loadFromDataStream(), and saveToDataStream().

Color pear vertex.

Definition at line 412 of file glc_mesh.h.

Referenced by activateVboAndIbo(), activateVertexArray(), clearMeshWireAndBoundingBox(), glDraw(), and operator=().

int GLC_Mesh::m_CurrentLod [private]

The default material Id.

Definition at line 403 of file glc_mesh.h.

Referenced by clearMeshWireAndBoundingBox(), operator=(), and setCurrentMaterial().

The next primitive local id.

Definition at line 397 of file glc_mesh.h.

Referenced by addTriangles(), addTrianglesFan(), addTrianglesStrip(), clearMeshWireAndBoundingBox(), and operator=().

unsigned int GLC_Mesh::m_NumberOfNormals [private]

Mesh number of normals.

Definition at line 409 of file glc_mesh.h.

Referenced by clearMeshWireAndBoundingBox(), loadFromDataStream(), operator=(), and saveToDataStream().

unsigned int GLC_Mesh::m_NumberOfVertice [private]

Mesh number of vertice.

Definition at line 406 of file glc_mesh.h.

Referenced by clearMeshWireAndBoundingBox(), loadFromDataStream(), operator=(), saveToDataStream(), and VertexCount().


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

SourceForge.net Logo

©2005-2011 Laurent Ribon