Class PatchVec

3DS Max Plug-In SDK

Class PatchVec

See Also: Class PatchMesh, Working with Patches.

class PatchVec

Description:

This class represents a patch vector. This can be either an interior vector or an edge vector. All methods of this class are implemented by the system.

Data Members:

public:

Point3 p;

The vertex location.

int vert;

The vertex which owns this vector.

IntTab patches;

These are the patches that share this vector. If the edge is open there will only be one patch. In this case patches[0] will be used and patches[1] will be -1. Note: As of R4.0 the previous array of [2] has been replaced with the IntTab because vectors can now be used by more than two patches.

DWORD flags;

The patch vector flag:

PVEC_INTERIOR

This indicates the vector is an interior vector. These are the three vectors inside a tri patch or the four inside a quad patch.

int aux1;

This data member is available in release 3.0 and later only.

Used to track topology changes during editing (Edit Patch).

int aux2;

This data member is available in release 3.0 and later only.

Used to track topology changes during editing (PatchMesh).

Methods:

Prototype:

PatchVec();

Remarks:

Constructor. The location is set to 0,0,0. The vertex owner is set to undefined. The patches using the vector is set to undefined. The flags are set to 0.

Prototype:

PatchVec(PatchVec &from);

Remarks:

Constructor. The data members are initialized to those of the from patch vector.

Parameters:

PatchVec &from

The vector to copy from.

Prototype:

void ResetData();

Remarks:

Resets the data members. The vertex owner is set to undefined. The patches using the vector is set to undefined.

Prototype:

BOOL AddPatch(int index);

Remarks:

Adds the specified patch to this vector table.

Parameters:

int index

The index in the PatchMesh class patches table (patches) of the patch to add.

Return Value:

Returns TRUE if the patch was added; otherwise FALSE.

Prototype:

void Transform(Matrix3 &tm);

Remarks:

This method is available in release 3.0 and later only.

Transforms the vertex location p by the specified matrix.

Parameters:

Matrix3 &tm

The matrix to transform the vertex.

Prototype:

IOResult Save(ISave* isave);

Remarks:

This is used internally to save the data to the .MAX file.

Prototype:

IOResult Load(ILoad* iload);

Remarks:

This is used internally to load the data from the .MAX file.

Operators:

Prototype:

PatchVec& operator=(PatchVec& from);

Remarks:

Assignment operator.

Parameters:

PatchVec& from

The patch vector to copy from.