GLC_Mesh2 Class Reference

GLC_Mesh2 : OpenGL 3D Mesh. More...

#include <glc_mesh2.h>

Inheritance diagram for GLC_Mesh2:

GLC_Geometry GLC_Object

List of all members.

Public Member Functions

Constructor / Destructor


 GLC_Mesh2 ()
 Construct an empty Mesh.
 GLC_Mesh2 (const GLC_Mesh2 &meshToCopy)
 Copy constructor.
virtual ~GLC_Mesh2 (void)
 Delete Mesh's faces and clear faces list.
Get Functions


int getNumberOfFaces () const
 Get number of faces.
int getNumberOfVertex () const
 Get number of vertex.
int getNumberOfSubMaterial () const
 Get number of submaterial.
GLC_MaterialgetSubMaterial (const int key)
 Get specified mesh sub material.
const bool containsMaterial (const int key) const
 return true if Material key is in the mesh
virtual GLC_BoundingBoxgetBoundingBox (void) const
 return the mesh bounding box
virtual GLC_Geometryclone () const
 Return a copy of the geometry.
const GLC_Vector3d getVertex (const int key) const
 return a vertex with key
const bool containsVertex (const int key) const
 return true if vertex key is in the mesh
const GLC_Vector3d getNormal (const int key) const
 return a normal with key
const bool containsNormal (const int key) const
 return true if normal key is in the mesh
Set Functions


void addMaterial (int Index, GLC_Material *)
 Add material to mesh.
int removeMaterial (int)
 Remove material from the mesh.
void addVertex (int Index, GLC_Vector3d Coordinate)
 Add a vertex to mesh.
void addNormal (int index, GLC_Vector3d Normal)
 Add Normal.
void addTextureCoordinate (int Index, GLC_Vector2d TextureCoordinate)
 Add texture coordinate.
void addFace (const QVector< int > &Material, const QVector< int > &Coordinate)
 Add a face without texture coordinate and Normal.
void addFace (const QVector< int > &Material, const QVector< int > &Coordinate, const QVector< int > &Normal)
 Add a face without texture coordinate.
void addFace (const QVector< int > &Material, const QVector< int > &Coordinate, const QVector< int > &Normal, const QVector< int > &TextureCoordinate)
 Add a face with texture coordinate.
void reverseNormal ()
 Reverse mesh normal.

Private Member Functions

void createSelectionList (GLenum Mode)
 Create selection lis.
void addCoordIndex (const QVector< int > &Coordinate)
 Add coordinate index of a face.
void addNormalIndex (const QVector< int > &Normal)
 Add coordinate index of a face.
void addCoordAndNormIndex (const QVector< int > &Coordinate, const QVector< int > &Normal)
 Add coordinate and normal index of a face.
void addTextureIndex (const QVector< int > &TextureCoordinate)
 Add Texture coordinate index of a face.
void addMaterialIndex (const QVector< int > &Material)
 Add Material index of a face.
OpenGL Functions


virtual void glLoadTexture (void)
 if the geometry have a texture, load it
virtual void glExecute (GLenum Mode, bool, bool forceWire=false)
 Specific glExecute method.
virtual void glDraw (void)
 Virtual interface for OpenGL Geometry set up.
virtual void createList (GLenum Mode)
 Specific createList method.

Private Attributes

Vector3dHash m_CoordinateHash
 Coordinate hash table.
IndexedList m_CoordinateIndex
 Coordinate index.
MaterialHash m_MaterialHash
 Material Hash table.
IndexedList m_MaterialIndex
 Material index.
Vector3dHash m_NormalHash
 Normal hash table.
IndexedList m_NormalIndex
 Normal Index.
Vector2dHash m_TextCoordinateHash
 Texture coordinate Hash table.
IndexedList m_TextureIndex
 Texture index.
int m_NumberOfFaces
 Mesh number of faces.
GLuint m_SelectionListID
 Selection Display list ID.
bool m_IsSelected
 Selection state.


Detailed Description

GLC_Mesh2 : OpenGL 3D Mesh.

An GLC_Mesh2 is Mesh composed of polygons

Definition at line 62 of file glc_mesh2.h.


Constructor & Destructor Documentation

GLC_Mesh2::GLC_Mesh2 (  )  [explicit]

Construct an empty Mesh.

Definition at line 35 of file glc_mesh2.cpp.

Referenced by clone().

GLC_Mesh2::GLC_Mesh2 ( const GLC_Mesh2 meshToCopy  )  [explicit]

Copy constructor.

Definition at line 52 of file glc_mesh2.cpp.

References m_MaterialHash.

GLC_Mesh2::~GLC_Mesh2 ( void   )  [virtual]


Member Function Documentation

int GLC_Mesh2::getNumberOfFaces (  )  const [inline]

int GLC_Mesh2::getNumberOfVertex (  )  const [inline]

Get number of vertex.

Definition at line 87 of file glc_mesh2.h.

References m_CoordinateHash.

Referenced by GLC_Part::getNumberOfVertex().

int GLC_Mesh2::getNumberOfSubMaterial (  )  const [inline]

Get number of submaterial.

Definition at line 89 of file glc_mesh2.h.

References m_MaterialHash.

GLC_Material* GLC_Mesh2::getSubMaterial ( const int  key  )  [inline]

Get specified mesh sub material.

Definition at line 91 of file glc_mesh2.h.

References m_MaterialHash.

const bool GLC_Mesh2::containsMaterial ( const int  key  )  const [inline]

return true if Material key is in the mesh

Definition at line 93 of file glc_mesh2.h.

References m_MaterialHash.

GLC_BoundingBox * GLC_Mesh2::getBoundingBox ( void   )  const [virtual]

return the mesh bounding box

Reimplemented from GLC_Geometry.

Definition at line 114 of file glc_mesh2.cpp.

References GLC_BoundingBox::combine(), and m_CoordinateHash.

GLC_Geometry * GLC_Mesh2::clone (  )  const [virtual]

Return a copy of the geometry.

Implements GLC_Geometry.

Definition at line 131 of file glc_mesh2.cpp.

References GLC_Mesh2().

const GLC_Vector3d GLC_Mesh2::getVertex ( const int  key  )  const [inline]

return a vertex with key

Definition at line 99 of file glc_mesh2.h.

References m_CoordinateHash.

Referenced by GLC_ObjToMesh2::computeNormal().

const bool GLC_Mesh2::containsVertex ( const int  key  )  const [inline]

return true if vertex key is in the mesh

Definition at line 101 of file glc_mesh2.h.

References m_CoordinateHash.

const GLC_Vector3d GLC_Mesh2::getNormal ( const int  key  )  const [inline]

return a normal with key

Definition at line 103 of file glc_mesh2.h.

References m_NormalHash.

const bool GLC_Mesh2::containsNormal ( const int  key  )  const [inline]

return true if normal key is in the mesh

Definition at line 105 of file glc_mesh2.h.

References m_NormalHash.

void GLC_Mesh2::addMaterial ( int  Index,
GLC_Material pMaterial 
)

int GLC_Mesh2::removeMaterial ( int  index  ) 

Remove material from the mesh.

Definition at line 161 of file glc_mesh2.cpp.

References GLC_Object::getID(), and m_MaterialHash.

Referenced by GLC_ObjToWorld::setCurrentMaterial().

void GLC_Mesh2::addVertex ( int  Index,
GLC_Vector3d  Coordinate 
)

Add a vertex to mesh.

Definition at line 169 of file glc_mesh2.cpp.

References m_CoordinateHash.

Referenced by GLC_ObjToWorld::addVertexsToCurrentMesh(), and GLC_ObjToMesh2::scanLigne().

void GLC_Mesh2::addNormal ( int  index,
GLC_Vector3d  Normal 
)

void GLC_Mesh2::addTextureCoordinate ( int  Index,
GLC_Vector2d  TextureCoordinate 
)

Add texture coordinate.

Definition at line 196 of file glc_mesh2.cpp.

References m_TextCoordinateHash.

Referenced by GLC_ObjToWorld::addTextureCoordinatesToCurrentMesh(), and GLC_ObjToMesh2::scanLigne().

void GLC_Mesh2::addFace ( const QVector< int > &  Material,
const QVector< int > &  Coordinate 
)

Add a face without texture coordinate and Normal.

Add a face without texture coordinate and normal.

Mesh list of texture index must be empty.

Definition at line 210 of file glc_mesh2.cpp.

References addCoordIndex(), addMaterialIndex(), GLC_Geometry::m_ListIsValid, and m_NumberOfFaces.

Referenced by GLC_ObjToWorld::extractFaceIndex(), and GLC_ObjToMesh2::extractFaceIndex().

void GLC_Mesh2::addFace ( const QVector< int > &  Material,
const QVector< int > &  Coordinate,
const QVector< int > &  Normal 
)

Add a face without texture coordinate.

Add a face without texture coordinate and normal.

Mesh list of texture index must be empty.

Definition at line 222 of file glc_mesh2.cpp.

References addCoordAndNormIndex(), addMaterialIndex(), GLC_Geometry::m_ListIsValid, and m_NumberOfFaces.

void GLC_Mesh2::addFace ( const QVector< int > &  Material,
const QVector< int > &  Coordinate,
const QVector< int > &  Normal,
const QVector< int > &  TextureCoordinate 
)

Add a face with texture coordinate.

Number of coordinate, Normal and texture must be equal

Definition at line 235 of file glc_mesh2.cpp.

References addCoordAndNormIndex(), addMaterialIndex(), addTextureIndex(), GLC_Geometry::m_ListIsValid, and m_NumberOfFaces.

void GLC_Mesh2::reverseNormal (  ) 

Reverse mesh normal.

Definition at line 249 of file glc_mesh2.cpp.

References GLC_Geometry::m_ListIsValid, and m_NormalHash.

Referenced by GLC_Part::reverseMeshNormal().

void GLC_Mesh2::glLoadTexture ( void   )  [private, virtual]

if the geometry have a texture, load it

Reimplemented from GLC_Geometry.

Definition at line 267 of file glc_mesh2.cpp.

References GLC_Material::glLoadTexture(), m_MaterialHash, and GLC_Geometry::m_pMaterial.

void GLC_Mesh2::glExecute ( GLenum  Mode,
bool  isSelected,
bool  forceWire = false 
) [private, virtual]

void GLC_Mesh2::glDraw ( void   )  [private, virtual]

void GLC_Mesh2::createList ( GLenum  Mode  )  [private, virtual]

Specific createList method.

Reimplemented from GLC_Geometry.

Definition at line 322 of file glc_mesh2.cpp.

References GLC_Geometry::createList(), and createSelectionList().

Referenced by glExecute().

void GLC_Mesh2::createSelectionList ( GLenum  Mode  )  [private]

Create selection lis.

Private services Functions

Definition at line 329 of file glc_mesh2.cpp.

References glDraw(), m_IsSelected, and m_SelectionListID.

Referenced by createList().

void GLC_Mesh2::addCoordIndex ( const QVector< int > &  Coordinate  )  [private]

Add coordinate index of a face.

Definition at line 440 of file glc_mesh2.cpp.

References m_CoordinateIndex.

Referenced by addFace().

void GLC_Mesh2::addNormalIndex ( const QVector< int > &  Normal  )  [private]

Add coordinate index of a face.

Definition at line 454 of file glc_mesh2.cpp.

References m_NormalIndex.

void GLC_Mesh2::addCoordAndNormIndex ( const QVector< int > &  Coordinate,
const QVector< int > &  Normal 
) [private]

Add coordinate and normal index of a face.

Definition at line 468 of file glc_mesh2.cpp.

References m_CoordinateIndex, and m_NormalIndex.

Referenced by addFace().

void GLC_Mesh2::addTextureIndex ( const QVector< int > &  TextureCoordinate  )  [private]

Add Texture coordinate index of a face.

Definition at line 493 of file glc_mesh2.cpp.

References m_TextureIndex.

Referenced by addFace().

void GLC_Mesh2::addMaterialIndex ( const QVector< int > &  Material  )  [private]

Add Material index of a face.

Definition at line 504 of file glc_mesh2.cpp.

References m_MaterialIndex.

Referenced by addFace().


Member Data Documentation

Coordinate hash table.

Definition at line 201 of file glc_mesh2.h.

Referenced by addVertex(), containsVertex(), getBoundingBox(), getNumberOfVertex(), getVertex(), glDraw(), and ~GLC_Mesh2().

Coordinate index.

Definition at line 203 of file glc_mesh2.h.

Referenced by addCoordAndNormIndex(), addCoordIndex(), glDraw(), and ~GLC_Mesh2().

Material index.

Definition at line 208 of file glc_mesh2.h.

Referenced by addMaterialIndex(), glDraw(), and ~GLC_Mesh2().

Normal hash table.

Definition at line 211 of file glc_mesh2.h.

Referenced by addNormal(), containsNormal(), getNormal(), glDraw(), reverseNormal(), and ~GLC_Mesh2().

Normal Index.

Definition at line 213 of file glc_mesh2.h.

Referenced by addCoordAndNormIndex(), addNormalIndex(), glDraw(), and ~GLC_Mesh2().

Texture coordinate Hash table.

Definition at line 216 of file glc_mesh2.h.

Referenced by addTextureCoordinate(), glDraw(), and ~GLC_Mesh2().

Texture index.

Definition at line 218 of file glc_mesh2.h.

Referenced by addTextureIndex(), glDraw(), and ~GLC_Mesh2().

Mesh number of faces.

Definition at line 221 of file glc_mesh2.h.

Referenced by addFace(), and getNumberOfFaces().

GLuint GLC_Mesh2::m_SelectionListID [private]

Selection Display list ID.

Definition at line 224 of file glc_mesh2.h.

Referenced by createSelectionList(), glExecute(), and ~GLC_Mesh2().

bool GLC_Mesh2::m_IsSelected [private]

Selection state.

Definition at line 227 of file glc_mesh2.h.

Referenced by createSelectionList(), glDraw(), and glExecute().


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

Generated on Wed Nov 16 2005 for GLC_lib by  doxygen 1.4.5

SourceForge.net Logo

©2005 Laurent Ribon