Public Member Functions | Public Attributes

MeshCapper Class Reference

This reference page is linked to from the following overview topics: Capping a Shape with a Mesh.


Search for all occurrences

Detailed Description

See also:
Class MeshCapInfo, Class PolyShape, Class MeshCapPoly.

Description:
This class is used to apply the MeshCapInfo data to a mesh. It will modify the mesh as required to add the cap. Simply fill in the vertices and faces bordering the cap, then call the CapMesh() method. All methods of this class are implemented by the system.
Data Members:
int numPolys;

The number of polygons in the shape.

MeshCapPoly *polys;

One for each polygon in the shape.

#include <captypes.h>

Inheritance diagram for MeshCapper:
Inheritance graph
[legend]

List of all members.

Public Member Functions

CoreExport  MeshCapper (PolyShape &shape)
CoreExport  ~MeshCapper ()
CoreExport MeshCapPoly operator[] (int index)
CoreExport int  CapMesh (Mesh &mesh, MeshCapInfo &capInfo, BOOL flip, DWORD smooth, Matrix3 *tm=NULL, int mtlID=-1)

Public Attributes

int  numPolys
MeshCapPoly polys

Constructor & Destructor Documentation

CoreExport MeshCapper ( PolyShape shape )
Remarks:
Constructor. This gets the capper ready for the topology of the specified PolyShape.
Parameters:
PolyShape &shape

The PolyShape to initialize the cap data from.
CoreExport ~MeshCapper ( )
Remarks:
Destructor.
Operators:

Member Function Documentation

CoreExport MeshCapPoly& operator[] ( int  index )
Remarks:
Array access operator. Returns the MeshCapPoly as specified by the index.
CoreExport int CapMesh ( Mesh mesh,
MeshCapInfo capInfo,
BOOL  flip,
DWORD  smooth,
Matrix3 tm = NULL,
int  mtlID = -1 
)
Remarks:
This method is used to modify the mesh based on the MeshCapInfo, the flipped state, the smoothing group and an orientation matrix.
Parameters:
Mesh &mesh

The Mesh to modify.

MeshCapInfo &capInfo

The MeshCapInfo describing the properties of the cap.

BOOL flip

A switch to indicate if the cap should be oriented normally or flipped. The MeshCapInfo is used for both the front and back side of a cap. Either the front or the back will have to be flipped. This switch is used to indicate if a particular one is flipped.

DWORD smooth

The smoothing group for all the faces in the cap.

Matrix3 *tm=NULL

The orientation matrix. A grid cap generates new vertices inside the shape that make up the grid. In the case of a SurfRev for example, the end cap might be rotated, or scaled in some manner. A matrix is required so the capper knows how to orient the vertices into the correct location. This matrix is ignored for non-grid capping.

int mtlID=-1

This parameter is available in release 2.0 and later only.

Specifies the material ID of the faces that make up the cap. The default for this value is -1, which causes the capper to use material ID 0 for non-flipped caps and ID 1 for flipped caps. Note that these ID values are zero-based, while the UI display is 1-based.
Returns:
Nonzero if the mesh was modified; otherwise zero.

Member Data Documentation

int numPolys

MeshCapper MeshCapper MeshCapper MeshCapper MeshCapper MeshCapper MeshCapper MeshCapper MeshCapper MeshCapper
MeshCapper MeshCapper MeshCapper MeshCapper MeshCapper MeshCapper MeshCapper MeshCapper MeshCapper MeshCapper