Class MNMapFace

3DS Max Plug-In SDK

Class MNMapFace

See Also: Class MNMesh, Class MNMap.

class MNMapFace

Description:

This class is available in release 3.0 and later only.

This class is a face used to store map vertex information for a given face and map channel. It replaces the information previously contained in the MNFace::tvrt and MNFace::cvrt data members (prior to release 3).

By way of analogy: MNMapFace is to MNFace as TVFace is to Face. MNMapFace is to MNMap as MNFace is to MNMesh as TVFace is to MeshMap as Face is to Mesh.

Friend Classes:

friend class MNMesh;

Data Members:

public:

int deg

Degree of this face. Must match degree of related MNFace in MNMesh.

int *tv

Mapping vertices used by this mapping face. (This array is of size deg).

Methods:

public:

Prototype:

MNMapFace();

Remarks:

Constructor. Calls Init().

Prototype:

MNMapFace(int d);

Remarks:

Constructor. Sets the degree and hidden vertex count.

Parameters:

int d

Desired degree.

Prototype:

~MNMapFace();

Remarks:

Destructor. Calls Clear().

Prototype:

void Init();

Remarks:

Initializes MNMapFace. deg is set to 0, pointers set to NULL.

Prototype:

void Clear();

Remarks:

Clears and frees MNMapFace.

Prototype:

void SetAlloc(int d);

Remarks:

Allocates enough memory in the arrays for the face to have degree d, but does not actually set the degree. If the arrays are already large enough (or larger), it does not reallocate them.

Parameters:

int d

The degree for this map face.

Prototype:

void SetSize(int d);

Remarks:

Allocates enough memory in the arrays for the face to have degree d, but does not actually set the degree. If the arrays are already large enough (or larger), it does not reallocate them. You generally don’t need to use this method separately; MakePoly, Insert, and other methods which may require additional memory will call this if needed.

Prototype:

void MakePoly(int fdeg, int *tt);

Remarks:

Makes this face into a polygon with the specified vertices and other information.

Parameters:

int fdeg

The degree to set this face to.

int *tt

The list of vertices for this face.

Prototype:

void Insert(int pos, int num=1);

Remarks:

Inserts space for more verticies at the specified position.

Parameters:

int pos

The location within the map face where the new vertices should be added.

int num=1

The number of new vertices to add.

Prototype:

void Delete(int pos, int num=1);

Remarks:

Deletes verticies from this map face.

Parameters:

The location within the map face where the vertices should be deleted.

int num=1

The number of vertices to delete.

Prototype:

void RotateStart(int newstart);

Remarks:

Re-indexes the vertices and edges so that the vertex in position newstart becomes the new first vertex. Triangulation is also corrected.

Parameters:

int newstart

The new first vertex.

Prototype:

void Flip();

Remarks:

Reverses order of verts, effectively inverting the face.

Prototype:

int VertIndex(int vv);

Remarks:

Returns the position of vertex vv in this face’s list of vertices.

Parameters:

int vv

The vertex whose index is returned.

Prototype:

void ReplaceVert(int ov, int nv);

Remarks:

Replaces vertex ov with vertex nv in the list of vertices.

Parameters:

int ov

The vertex to replace.

int nv

The vertex to replace it with.

Prototype:

MNMapFace & operator=(const MNMapFace & from);

Remarks:

Assignment operator.

Prototype:

void MNDebugPrint(bool hinfo=TRUE);

Remarks:

Uses DebugPrint to print out information to the Debug Results window in DevStudio. This includes the tv array and optionally the htv array.

Parameters:

bool hinfo=TRUE

If TRUE the htv array is output.