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.
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 finishVbo ()
 Move Indexs from the primitive groups to the mesh Data LOD and Set IBOs offsets.
void finishNonVbo ()
 Move Indexs from the primitive groups to the mesh Data LOD and Set Index 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 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.

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.
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 31 of file glc_mesh.cpp.

Referenced by clone().

GLC_Mesh::GLC_Mesh ( const GLC_Mesh mesh  ) 

Copy constructor.

Definition at line 45 of file glc_mesh.cpp.

References m_PrimitiveGroups.

GLC_Mesh::~GLC_Mesh (  )  [virtual]

Destructor.

Definition at line 122 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 222 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 1247 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 143 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 463 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 190 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 304 of file glc_mesh.cpp.

References m_PrimitiveGroups.

Referenced by copyIndex(), getFansIndex(), 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 240 of file glc_mesh.cpp.

References m_PrimitiveGroups.

Referenced by copyIndex(), getStripsIndex(), 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 196 of file glc_mesh.cpp.

References m_PrimitiveGroups.

Referenced by copyIndex(), getTrianglesIndex(), 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 683 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  ) 
unsigned int GLC_Mesh::faceCount ( int  lod  )  const [virtual]

Get number of faces.

Reimplemented from GLC_Geometry.

Definition at line 149 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::finishNonVbo (  )  [private]

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

Definition at line 1102 of file glc_mesh.cpp.

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

Referenced by finish().

void GLC_Mesh::finishSerialized (  )  [private]

Set primitive group offset after loading mesh from binary.

Definition at line 1044 of file glc_mesh.cpp.

References m_PrimitiveGroups, and GLC_State::vboUsed().

Referenced by loadFromDataStream().

void GLC_Mesh::finishVbo (  )  [private]

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

Definition at line 1063 of file glc_mesh.cpp.

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

Referenced by finish().

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

Return the fans index.

The specified LOD must exists and uses the specified material id

Definition at line 323 of file glc_mesh.cpp.

References containsFans(), GLC_PrimitiveGroup::fansOffset(), GLC_PrimitiveGroup::fansOffseti(), GLC_PrimitiveGroup::fansSizes(), GLC_MeshData::indexVector(), m_MeshData, m_PrimitiveGroups, and GLC_State::vboUsed().

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

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

Return the strips index.

The specified LOD must exists and uses the specified material id

Definition at line 250 of file glc_mesh.cpp.

References containsStrips(), GLC_MeshData::indexVector(), m_MeshData, m_PrimitiveGroups, GLC_PrimitiveGroup::stripsOffset(), GLC_PrimitiveGroup::stripsOffseti(), GLC_PrimitiveGroup::stripsSizes(), and GLC_State::vboUsed().

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

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, and GLC_Rectangle.

Definition at line 803 of file glc_mesh.cpp.

References activateVboAndIbo(), activateVertexArray(), GLC_RenderStatistics::addBodies(), addTriangles(), glc::BodySelection, bodySelectionRenderLoop(), GLC_MeshData::createVBOs(), fillVbosAndIbos(), glBufferData, GLC_MeshData::GLC_Normal, GLC_WireData::glDraw(), GLC_RenderProperties::hashOfOverwritePrimitiveMaterialsIsEmpty(), 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_MeshData::normalVectorHandle(), glc::OverwriteMaterial, OverwriteMaterialRenderLoop(), glc::OverwritePrimitiveMaterial, glc::OverwriteTransparency, OverwriteTransparencyRenderLoop(), GLC_MeshData::positionVectorHandle(), 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_MeshData::useIBO(), GLC_MeshData::useVBO(), GLC_State::vboUsed(), 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 696 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().

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 314 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 295 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 231 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::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 1266 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 689 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]

Reverse mesh normal.

Reimplemented from GLC_Geometry.

Definition at line 572 of file glc_mesh.cpp.

References GLC_Geometry::m_GeometryIsValid, m_MeshData, GLC_MeshData::normalVector(), and GLC_MeshData::normalVectorHandle().

void GLC_Mesh::saveToDataStream ( QDataStream &  stream  )  const

Save the mesh to binary data stream.

Definition at line 756 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 238 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 609 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 254 of file glc_mesh.h.

Referenced by loadFromDataStream().

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

Set the mesh wire color.

Reimplemented from GLC_Geometry.

Definition at line 258 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 155 of file glc_mesh.cpp.

References m_NumberOfVertice.

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 406 of file glc_mesh.h.

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

Color pear vertex.

Definition at line 397 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 388 of file glc_mesh.h.

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

The next primitive local id.

Definition at line 382 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 394 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 391 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