Class NURBSPointSurface

3DS Max Plug-In SDK

Class NURBSPointSurface

See Also: Class NURBSSurface, Class NURBSIndependentPoint.

class NURBSPointSurface : public NURBSSurface

Description:

This class is available in release 2.0 and later only.

This class defines a surface that uses points to describe its shape. This class has methods to close the surface in U and V, set the number of points in U and V, and get/set the points in U and V. There is also a method to add additional points to the surface. The point surface has a transformation matrix used to set the relative position of the surface in a NURBSSet.

All methods of this class are implemented by the system.

Friend Classes:

friend class NURBSSet

Methods:

Prototype:

NURBSPointSurface();

Remarks:

Constructor. The data members are initialized as follows:

 mType = kNPointSurface;

 mClosedInU = FALSE;

 mClosedInV = FALSE;

 mpPts = NULL;

Prototype:

virtual ~NURBSPointSurface();

Remarks:

Destructor. Any allocated points are deleted.

Prototype:

void CloseInU();

Remarks:

This method closes the surface in the U direction.

Prototype:

void CloseInV();

Remarks:

This method closes the surface in the V direction.

Prototype:

void SetNumPts(int u, int v);

Remarks:

Sets the number of points in the surface in the U and V directions. Any previously allocated points are not maintained when the new number is set.

Parameters:

int u

The number of points in U.

int v

The number of points in V.

Prototype:

int GetNumUPts();

Remarks:

Returns the number of points in the U direction.

Prototype:

int GetNumVPts();

Remarks:

Returns the number of points in the V direction.

Prototype:

void GetNumPts(int &u, int &v);

Remarks:

Retrieves the number of points in both the U and V directions.

Parameters:

int &u

The number in U is stored here.

int &v

The number in V is stored here.

Prototype:

NURBSIndependentPoint* GetPoint(int u, int v);

Remarks:

Returns a pointer to the specified point in the surface.

Parameters:

int u

The zero based index of the point in the U direction.

int v

The zero based index of the point in the V direction.

Prototype:

void SetPoint(int u, int v, NURBSIndependentPoint& pt);

Remarks:

Sets the specified point in the surface to the point passed.

Parameters:

int u

The zero based index of the point in the U direction.

int v

The zero based index of the point in the V direction.

NURBSIndependentPoint& pt

The point to set.

Prototype:

void SetTransformMatrix(TimeValue t, SetXFormPacket& mat);

Remarks:

Sets the transformation matrix for the NURBSPointSurface. This controls the relative position of the surface within a NURBSSet.

Parameters:

TimeValue t

The time at which to set the matrix.

SetXFormPacket& xPack

An instance of the XFormPacket class that describes the properties of the transformation. See Class SetXFormPacket.

Prototype:

Matrix3 GetTransformMatrix(TimeValue t);

Remarks:

Returns the transformation matrix of the NURBSPointSurface at the specified time.

Parameters:

TimeValue t

The time at which to retrieve the matrix.

Prototype:

void Refine(TimeValue t, double u, double v, int U_V_Both);

Remarks:

This method adds a new point at the specified location on the surface without changing the shape of the surface. The location may be specified as a U value or a V value, or both.

If you refine in U (U_V_Both = 0) you must specify v

If you refine in V (U_V_Both = 1) you must specify u

If you refine in U and V (U_V_Both = -1) you must specify u and v

Parameters:

TimeValue t

The time at which to refine the surface.

double u

The location for the point in U space (range 0.0 to 1.0).

double v

The location for the point in V space (range 0.0 to 1.0).

int U_V_Both

This value must be 0, 1 or -1.

If 0 the refinement is done in u (and v is specified).

If 1 the refinement is done in v (and u is specified).

If -1 the refinement is done in both u and v (and both u and v must be specified).

Operators:

Prototype:

NURBSPointSurface & operator=(const NURBSPointSurface& surf);

Remarks:

Assignment operator.

Parameters:

const NURBSPointSurface& surf

The surface to assign.