vtMeshFactory Class Reference
[Scene Graph]

List of all members.

Detailed Description

The vtMeshFactory class makes it easy to create meshes with a lot of vertices. You simply provide vertices, and it will create as many meshes as necessary to contain them all.

Example:
This example produces a line strip with 10000 vertices. The factory is told to limit the number of vertices in a single primitive to 3000, so it will automatically produce four meshes with 3000, 3000, 3000, and 1000 vertices each. The meshes are automatically added to the indicated geometry node.
    {
        vtGeom *pLineGeom = new vtGeom;
        vtMeshFactory mf(pLineGeom, vtMesh::LINE_STRIP, 0, 3000, 1);
        mf.PrimStart();
        for (int i = 0; i < 10000; i++)
            mf.AddVertex(FPoint3(i,i,i));
        mf.PrimEnd();
    }


Public Member Functions

 vtMeshFactory (vtGeom *pGeom, vtMeshBase::PrimType ePrimType, int iVertType, int iMaxVertsPerMesh, int iMatIndex, int iExpectedVerts=-1)
 vtMeshFactory (vtMesh *pMesh)
void PrimStart ()
void AddVertex (const FPoint3 &p)
void PrimEnd ()


Constructor & Destructor Documentation

vtMeshFactory::vtMeshFactory vtGeom pGeom,
vtMeshBase::PrimType  ePrimType,
int  iVertType,
int  iMaxVertsPerMesh,
int  iMatIndex,
int  iExpectedVerts = -1
 

Constructor.

Parameters:
pGeom The geometry node which will receive the mesh object(s) that this factory will produce.
ePrimType The type of mesh to produce.
iVertType The vertex attributes for the meshes to produce.
iMaxVertsPerMesh The largest number of vertices to allow in a single mesh. When this number is exceeded, the current mesh will be finished and another mesh begun.
iMatIndex The material index of the mesh when it is added to the geometry node.
iExpectedVerts If you know how many vertices will be mesh ahead of time, you can save a little time and memory by passing the number.

vtMeshFactory::vtMeshFactory vtMesh pMesh  ) 
 

Alternate, simpler constructor.

Parameters:
pMesh The mesh which will receive all the vertices that this factory produces.


Member Function Documentation

void vtMeshFactory::AddVertex const FPoint3 p  ) 
 

Tell the factory to add a vertex to the current primitive.

void vtMeshFactory::PrimEnd  ) 
 

Tell the factory to end a primitive.

void vtMeshFactory::PrimStart  ) 
 

Tell the factory to start a primitive.


Generated on Tue Apr 22 10:11:07 2008 for vtlib library by  doxygen 1.4.5