#include <freecloth/geom/geMeshBuilder.h>
Inheritance diagram for GeMeshBuilder:
Public Types | |
typedef GeMesh::FaceConstIterator | FaceConstIterator |
ConstIterator for faces. | |
Public Methods | |
GeMeshBuilder () | |
void | preallocVertices (UInt32) |
Reserve space for the given number of vertices. | |
void | preallocTextureVertices (UInt32) |
Reserve space for the given number of texture vertices. | |
void | preallocFaces (UInt32 nb) |
Reserve space for the given number of faces. | |
VertexId | addVertex (const VertexType &) |
Add a vertex to the mesh. Returns the id of the new vertex. | |
VertexId | addVertices (VertexConstIterator const &beginIt, VertexConstIterator const &endIt) |
Add the range [beginIt,endIt). Returns the id of the first vertex. | |
UInt32 | getNbVertices () const |
Retrieve number of vertices added to mesh so far. | |
const VertexType & | getVertex (VertexId) const |
Retrieve a vertex that has already been added. | |
TextureVertexId | addTextureVertex (const TextureVertexType &) |
Add a texture vertex to the mesh. Returns the id of the new texture vertex. | |
TextureVertexId | addTextureVertices (TextureVertexConstIterator const &beginIt, TextureVertexConstIterator const &endIt) |
Add the range [beginIt,endIt). Returns the id of the first texture vertex. | |
UInt32 | getNbTextureVertices () const |
Retrieve number of texture vertices added to mesh so far. | |
const TextureVertexType & | getTextureVertex (TextureVertexId) const |
Retrieve a texture vertex that has already been added. | |
FaceId | addFace (VertexId v1, VertexId v2, VertexId v3, TextureVertexId tv1, TextureVertexId tv2, TextureVertexId tv3) |
Add a face to the mesh. Returns the id of the new face. | |
FaceId | addFace (VertexId vids[GeMesh::FaceType::NB_VERTICES], TextureVertexId tvids[GeMesh::FaceType::NB_VERTICES]) |
Add a face to the mesh. Returns the id of the new face. | |
FaceId | addFaces (FaceConstIterator const &beginIt, FaceConstIterator const &endIt) |
Add the range [beginIt,endIt). Returns the id of the first face. | |
UInt32 | getNbFaces () const |
Retrieve number of faces added to mesh so far. | |
RCShdPtr< GeMesh > | createMesh () |
Creates a GeMesh object using the vertices, texture vertices and faces added to the builder so far. Returns a pointer to the built GeMesh object. Subsequently, resets the builder in preparation for the construction of a new GeMesh object. | |
Private Methods | |
GeMeshBuilder (const GeMeshBuilder &) | |
Disallowed. | |
GeMeshBuilder & | operator= (const GeMeshBuilder &) |
Disallowed. | |
Private Attributes | |
RCShdPtr< GeMesh > | _meshPtr |
Vertices, texture vertices and faces can be added, and the mesh will be created with a final call to createMesh().
For added efficiency, the prealloc* routines can be called before the add* routines to reserve space for vertices, texture vertices or faces.
During construction, vertices and texture vertices are given temporary IDs and can be retrieved from the partially constructed mesh.
Pattern: Builder
Definition at line 59 of file geMeshBuilder.h.