Class MeshChamferData

3DS Max Plug-In SDK

Class MeshChamferData

See Also: Class Mesh, Class MeshDelta, Template Class Tab.

class MeshChamferData

Description:

This class is available in release 3.0 and later only.

This class contains all the data needed to move points as the user drags a chamfer. It's created by the topological change that happens at the start of the chamfer. It is used to maintain chamfer information between several MeshDelta methods. The strategy is this: The chamfer operation is divided into two parts, the topological change and a later geometric change. (This works well for EditableMesh, where the topology change is completed first, then apply a series of geometry changes as the user spins a spinner or drags a mouse. Each geometry change is undone before the next is applied, but the topology change only happens once.)

This class is filled in by the topological change with the "directions" for all the geometric and mapping vert changes:

Data Members:

public:

Tab<Point3> vdir;

This table contains the directions of movement for each vertex, scaled in such a manner to produce a consistent chamfer.

Tab<float> vmax;

This table contains the limits of motion for each vertex - stopping the vertices at these limits will prevent them from crossing each other or over far edges.

Tab<UVVert> *mdir;

For each active map channel mp, mdir[mp] represents the directions of movement of the map verts for that channel. (Map verts need to be moved as well, otherwise the maps get distorted.)

Methods:

public:

Prototype:

MeshChamferData();

Remarks:

Constructor. This sets mdir to NULL.

Prototype:

MeshChamferData(const Mesh &m);

Remarks:

Constructor.

Parameters:

const Mesh &m

The mesh to init this MeshChamferData object from, allocating the vertex and mapping vertex tables as appropriate.

Prototype:

~MeshChamferData();

Remarks:

Destructor. If mdir is allocted it is seleted.

Prototype:

void InitToMesh(const Mesh &m);

Remarks:

This method sets up a MeshChamferData based on a given mesh, allocating the vertex and mapping vertex tables as appropriate.

Parameters:

const Mesh &m

The Mesh to init from.

Prototype:

void setNumVerts(int nv, bool keep=TRUE, int resizer=0);

Remarks:

This method simply allocates the vdir and vmax tables, and initializes the new members of vmax to 0. This method can be applied to an existing MeshChamferData to reflect an increase in vertices by VClone or VCreate operations.

Parameters:

int nv

The number of verts

bool keep=TRUE

TRUE to keep if resized; FALSE to discard.

int resizer=0

The number of elements the vdir and vmax tables are resized beyond their current size.

 

The following methods are not part of the class, but are useful for debugging

Prototype:

DllExport void MeshChamferDataDebugPrint (MeshChamferData & mcd, int mapNum);

 

Description

This function uses calls to DebugPrint() to output all the data in the specified MeshChamferData to the DebugPrint buffer during debug runs. It is available for programmers' use, providing easy access to MeshChamferData during development. It ought to be removed for release builds.

 

Parameters:

MeshChamferData & mcd

The MeshChamferData we want to investigate.

 

int mapNum

The number of map channels in the Mesh associated with this MeshChamferData. (For historical reasons, this information is not kept in the MeshChamferData class.) Generally this is retrieved with a call to Mesh::getNumMaps().