#include <glc_mesh2.h>

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_Material * | getSubMaterial (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_BoundingBox * | getBoundingBox (void) const |
| return the mesh bounding box | |
| virtual GLC_Geometry * | clone () 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. | |
An GLC_Mesh2 is Mesh composed of polygons
Definition at line 62 of file glc_mesh2.h.
| GLC_Mesh2::GLC_Mesh2 | ( | ) | [explicit] |
| GLC_Mesh2::GLC_Mesh2 | ( | const GLC_Mesh2 & | meshToCopy | ) | [explicit] |
| GLC_Mesh2::~GLC_Mesh2 | ( | void | ) | [virtual] |
Delete Mesh's faces and clear faces list.
Definition at line 78 of file glc_mesh2.cpp.
References GLC_Object::getID(), m_CoordinateHash, m_CoordinateIndex, m_MaterialHash, m_MaterialIndex, m_NormalHash, m_NormalIndex, m_SelectionListID, m_TextCoordinateHash, and m_TextureIndex.
| int GLC_Mesh2::getNumberOfFaces | ( | ) | const [inline] |
Get number of faces.
Definition at line 85 of file glc_mesh2.h.
References m_NumberOfFaces.
Referenced by GLC_ObjToWorld::changeGroup(), GLC_ObjToWorld::CreateWorldFromObj(), GLC_Part::getNumberOfFaces(), and GLC_ObjToWorld::setCurrentMaterial().
| 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] |
| 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] |
| 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 | |||
| ) |
Add material to mesh.
Definition at line 142 of file glc_mesh2.cpp.
References GLC_Material::addGLC_Geom(), GLC_Geometry::m_GeometryIsValid, GLC_Geometry::m_ListIsValid, and m_MaterialHash.
Referenced by GLC_ObjToWorld::changeGroup(), GLC_ObjToMesh2::loadMaterial(), and GLC_ObjToWorld::setCurrentMaterial().
| 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 | |||
| ) |
Add Normal.
Definition at line 182 of file glc_mesh2.cpp.
References m_NormalHash.
Referenced by GLC_ObjToWorld::addNormalsToCurrentMesh(), GLC_ObjToWorld::extractFaceIndex(), GLC_ObjToMesh2::extractFaceIndex(), and GLC_ObjToMesh2::scanLigne().
| 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] |
Specific glExecute method.
Reimplemented from GLC_Geometry.
Definition at line 283 of file glc_mesh2.cpp.
References createList(), GLC_Geometry::glExecute(), GLC_Geometry::glPropGeom(), GLC_Geometry::m_GeometryIsValid, m_IsSelected, GLC_Geometry::m_ListIsValid, and m_SelectionListID.
| void GLC_Mesh2::glDraw | ( | void | ) | [private, virtual] |
Virtual interface for OpenGL Geometry set up.
This Virtual function is implemented here.
Throw GLC_OpenGlException
Implements GLC_Geometry.
Definition at line 353 of file glc_mesh2.cpp.
References GLC_Geometry::getdAlpha(), GLC_Geometry::getdBlue(), GLC_Geometry::getdGreen(), GLC_Geometry::getdRed(), GLC_Material::glExecute(), GLC_SelectionMaterial::glExecute(), m_CoordinateHash, m_CoordinateIndex, m_IsSelected, m_MaterialHash, m_MaterialIndex, m_NormalHash, m_NormalIndex, GLC_Geometry::m_pMaterial, m_TextCoordinateHash, and m_TextureIndex.
Referenced by createSelectionList().
| 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().
Vector3dHash GLC_Mesh2::m_CoordinateHash [private] |
Coordinate hash table.
Definition at line 201 of file glc_mesh2.h.
Referenced by addVertex(), containsVertex(), getBoundingBox(), getNumberOfVertex(), getVertex(), glDraw(), and ~GLC_Mesh2().
IndexedList GLC_Mesh2::m_CoordinateIndex [private] |
Coordinate index.
Definition at line 203 of file glc_mesh2.h.
Referenced by addCoordAndNormIndex(), addCoordIndex(), glDraw(), and ~GLC_Mesh2().
MaterialHash GLC_Mesh2::m_MaterialHash [private] |
Material Hash table.
Definition at line 206 of file glc_mesh2.h.
Referenced by addMaterial(), containsMaterial(), getNumberOfSubMaterial(), getSubMaterial(), GLC_Mesh2(), glDraw(), glLoadTexture(), removeMaterial(), and ~GLC_Mesh2().
IndexedList GLC_Mesh2::m_MaterialIndex [private] |
Material index.
Definition at line 208 of file glc_mesh2.h.
Referenced by addMaterialIndex(), glDraw(), and ~GLC_Mesh2().
Vector3dHash GLC_Mesh2::m_NormalHash [private] |
Normal hash table.
Definition at line 211 of file glc_mesh2.h.
Referenced by addNormal(), containsNormal(), getNormal(), glDraw(), reverseNormal(), and ~GLC_Mesh2().
IndexedList GLC_Mesh2::m_NormalIndex [private] |
Normal Index.
Definition at line 213 of file glc_mesh2.h.
Referenced by addCoordAndNormIndex(), addNormalIndex(), glDraw(), and ~GLC_Mesh2().
Vector2dHash GLC_Mesh2::m_TextCoordinateHash [private] |
Texture coordinate Hash table.
Definition at line 216 of file glc_mesh2.h.
Referenced by addTextureCoordinate(), glDraw(), and ~GLC_Mesh2().
IndexedList GLC_Mesh2::m_TextureIndex [private] |
Texture index.
Definition at line 218 of file glc_mesh2.h.
Referenced by addTextureIndex(), glDraw(), and ~GLC_Mesh2().
int GLC_Mesh2::m_NumberOfFaces [private] |
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().
1.4.5