MeshCapper Class Reference

#include <captypes.h>

Class 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.

See also
Class MeshCapInfo, Class PolyShape, Class MeshCapPoly.
+ Inheritance diagram for MeshCapper:

Public Member Functions

CoreExport MeshCapper (PolyShape &shape)
 Constructor. More...
 
CoreExport ~MeshCapper ()
 Destructor. More...
 
CoreExport MeshCapPolyoperator[] (int index)
 Array access operator. More...
 
CoreExport int CapMesh (Mesh &mesh, MeshCapInfo &capInfo, BOOL flip, DWORD smooth, Matrix3 *tm=NULL, int mtlID=-1)
 This method is used to modify the mesh based on the MeshCapInfo, the flipped state, the smoothing group and an orientation matrix. More...
 
CoreExport int CapMNMesh (MNMesh &mesh, MeshCapInfo &capInfo, bool flip, DWORD smooth, Matrix3 *tm=nullptr, int mtlID=-1)
 This method is used to modify the MNMesh based on the MeshCapInfo, the flipped state, the smoothing group and an orientation matrix. More...
 

Public Attributes

int numPolys
 The number of polygons in the shape. More...
 
MeshCapPolypolys
 One polygon for each polygon in the shape. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Constructor & Destructor Documentation

Constructor.

This gets the capper ready for the topology of the specified PolyShape.

Parameters
shape- The PolyShape to initialize the cap data from.

Destructor.

Member Function Documentation

CoreExport MeshCapPoly& operator[] ( int  index)

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 
)

This method is used to modify the mesh based on the MeshCapInfo, the flipped state, the smoothing group and an orientation matrix.

Parameters
mesh- The Mesh to modify.
capInfo- The MeshCapInfo describing the properties of the cap.
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.
smooth- The smoothing group for all the faces in the cap.
tm- 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.
mtlID- 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.
CoreExport int CapMNMesh ( MNMesh mesh,
MeshCapInfo capInfo,
bool  flip,
DWORD  smooth,
Matrix3 tm = nullptr,
int  mtlID = -1 
)

This method is used to modify the MNMesh based on the MeshCapInfo, the flipped state, the smoothing group and an orientation matrix.

Parameters
mesh- The Mesh to modify.
capInfo- The MeshCapInfo describing the properties of the cap.
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.
smooth- The smoothing group for all the faces in the cap.
tm- 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.
mtlID- 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

The number of polygons in the shape.

MeshCapPoly* polys

One polygon for each polygon in the shape.