Class MNMeshBorder

3DS Max Plug-In SDK

Class MNMeshBorder

See Also: Class MNMesh, Template Class Tab, Class BitArray.

class MNMeshBorder

Description:

This class is available in release 2.0 and later only.

MNMeshBorder is a small class used to hold boundary information for an MNMesh mesh. The principal data contained is a table of tables of int’s, which represent edge lists in the MNMesh. These edge lists form closed loops of one-sided edges: boundaries, or borders, of the mesh. These edges are stored in order such that E(loop(i)[j])->v1 is the same as E(loop(i)[j+1])->v2, E(loop(i)[j+1])->v1 == E(loop(i)[j+2])->v2, and so on. (This is the right-hand, counterclockwise order when looking down on the hole from outside the mesh.)

Most 3ds max primitives have no borders, but the Patch Grid, when converted to a mesh, is an example of one with a single border.

All methods of this class are implemented by the system.

Data Members:

private:

Tab<IntTab *> bdr

IntTab is itself a Tab<int>. We use a table of Tab<int> pointers (rather than a table of Tab<int>’s) for clean memory allocation & freeing. However, this is an unwieldy structure, so it’s kept private.

BitArray btarg

This is simply an array of targeting bits for each of the boundary loops in bdr.

Methods:

Prototype:

~MNMeshBorder();

Remarks:

Destructor; frees all reserved memory. There is no Constructor for this class, since both data members have their own, adequate constructors.

Prototype:

void Clear();

Remarks:

Frees all reserved memory and reinitializes the data, producing an empty border.

Prototype:

int Num();

Remarks:

Returns the number of border loops for the MNMesh analyzed.

Prototype:

IntTab *Loop(int i);

Remarks:

Returns a pointer to the i’th border loop.

Prototype:

bool LoopTarg(int i);

Remarks:

Indicates whether border loop i is targeted or not.

Prototype:

MNDebugPrint(MNMesh *m);

Remarks:

This method is available in release 2.5 and later only.

Uses DebugPrint to print out the MNMesh borders to the Debug Results window in DevStudio. This can be useful for tracking down bugs. Be careful not to leave MNDebugPrint calls in your final build; they will slow down your effect to no purpose.

Parameters:

MNMesh *m

The MNMesh to which this MNMeshBorder refers is required to give more details about the border.