Main Page   Class Hierarchy   Compound List   File List   Compound Members  

freecloth::GeMeshBuilder Class Reference

Class to construct a GeMesh object. More...

#include <freecloth/geom/geMeshBuilder.h>

Inheritance diagram for freecloth::GeMeshBuilder:

freecloth::GeMeshTypes List of all members.

Public Types

typedef GeMesh::FaceConstIterator FaceConstIterator
 ConstIterator for faces.


Public Member Functions

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 VertexTypegetVertex (VertexId) const
 Retrieve a vertex that has already been added.

TextureVertexId addTextureVertex (const TextureVertexType &)
TextureVertexId addTextureVertices (TextureVertexConstIterator const &beginIt, TextureVertexConstIterator const &endIt)
UInt32 getNbTextureVertices () const
 Retrieve number of texture vertices added to mesh so far.

const TextureVertexTypegetTextureVertex (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< GeMeshcreateMesh ()

Detailed Description

Class to construct a GeMesh object.

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 58 of file geMeshBuilder.h.


Member Function Documentation

GeMeshBuilder::TextureVertexId freecloth::GeMeshBuilder::addTextureVertex const TextureVertexType  
 

Add a texture vertex to the mesh. Returns the id of the new texture vertex.

Definition at line 94 of file geMeshBuilder.cpp.

References freecloth::GeMeshTypes::TextureVertexId.

GeMeshBuilder::TextureVertexId freecloth::GeMeshBuilder::addTextureVertices TextureVertexConstIterator const &    beginIt,
TextureVertexConstIterator const &    endIt
 

Add the range [beginIt,endIt). Returns the id of the first texture vertex.

Definition at line 105 of file geMeshBuilder.cpp.

References freecloth::GeMeshTypes::TextureVertexId.

RCShdPtr< GeMesh > freecloth::GeMeshBuilder::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.

Definition at line 191 of file geMeshBuilder.cpp.

References FaceConstIterator, freecloth::GeMeshTypes::FaceVertexId, getNbVertices(), freecloth::GeMeshTypes::TextureVertexId, and freecloth::GeMeshTypes::VertexId.


The documentation for this class was generated from the following files:
Generated on Wed Apr 23 15:58:47 2003 for Freecloth by doxygen1.3-rc3