Class NURBSCVSurface

3DS Max Plug-In SDK

Class NURBSCVSurface

See Also: Class NURBSSurface.

class NURBSCVSurface : public NURBSSurface

Description:

This class is available in release 2.0 and later only.

This class defines a surface that uses control vertices (CVs) to describe its shape. The CVs define a control lattice which surrounds the surface. This class has methods to close the surface in U and V, set its order in U and V, set the number of knots and CVs in U and V, and get/set the knots and CVs in U and V. There is also a method to add additional CVs to the surface. The CV surface has a transformation matrix used to position the surface within a NURBSSet.

All methods of this class are implemented by the system.

Methods:

Prototype:

NURBSCVSurface();

Remarks:

Constructor. The data members are initialized as follows:

 mType = kNCVSurface;

 mRigid = FALSE;

 mClosedInU = FALSE;

 mClosedInV = FALSE;

 mpCVs = NULL;

 mpUKnots = NULL;

 mpVKnots = NULL;

 mNumUCVs = 0;

 mNumVCVs = 0;

 mNumUKnots = 0;

 mNumVKnots = 0;

 mUOrder = 0;

 mVOrder = 0;

 mAutoParam = kNotAutomatic;

Prototype:

virtual ~NURBSCVSurface();

Remarks:

Destructor.

Prototype:

BOOL IsRigid();

Remarks:

This method is available in release 3.0 and later only.

Returns TRUE if the surface is 'rigid'; otherwise FALSE.

Prototype:

void SetRigid(BOOL isRigid);

Remarks:

This method is available in release 3.0 and later only.

Sets the 'rigid' state of the surface.

Parameters:

BOOL isRigid

TRUE for on; FALSE for off.

Prototype:

NURBSAutoParam AutoParam();

Remarks:

This method is available in release 3.0 and later only.

Returns the automatic parameterization setting. See List of NURBSAutoParam Types.

Prototype:

void AutoParam(TimeValue t, NURBSAutoParam param);

Remarks:

This method is available in release 3.0 and later only.

Sets the automatic parameterization setting at the specified time.

Parameters:

TimeValue t

The time at which to set the parameterization.

NURBSAutoParam param

See List of NURBSAutoParam Types_.

Prototype:

void Reparameterize(TimeValue t, NURBSParamaterization param);

Remarks:

This method is available in release 3.0 and later only.

Sets the reparameterization type at the specified time.

Parameters:

TimeValue t

The time at which to sets the reparameterization type.

NURBSParamaterization param

See List of NURBSParamaterization Types.

Prototype:

void CloseInU();

Remarks:

This method closes the surface in the U direction. The aligns the surface edge to edge in U and sets the tangents to match.

Prototype:

void CloseInV();

Remarks:

This method closes the surface in the V direction. The aligns the surface edge to edge in V and sets the tangents to match.

Prototype:

void SetUOrder(int order);

Remarks:

Sets the order of the surface in the U direction.

Parameters:

int order

Specifies the order of the surface in the U direction.

Prototype:

int GetUOrder();

Remarks:

Returns the order of the surface in the U direction.

Prototype:

int GetVOrder();

Remarks:

Returns the order of the surface in the V direction.

Prototype:

void SetVOrder(int order);

Remarks:

Sets the order of the surface in the V direction.

Parameters:

int order

Specifies the order of the surface in the V direction.

Prototype:

void SetNumUKnots(int num);

Remarks:

Sets the number of knots in the U direction. Note that the knot data is not maintained.

Parameters:

int num

Specifies the number of knots in the U direction.

Prototype:

void SetNumVKnots(int num);

Remarks:

Sets the number of knots in the V direction. Note that the knot data is not maintained.

Parameters:

int num

Specifies the number of knots in the V direction.

Prototype:

int GetNumUKnots();

Remarks:

Returns the number of knots in the U direction.

Prototype:

int GetNumVKnots();

Remarks:

Returns the number of knots in the V direction.

Prototype:

void SetNumCVs(int u, int v);

Remarks:

Sets the number of control vertices in both the U and V directions. Note that the CV data is not maintained.

Parameters:

int u

Specifies the number of control vertices in the U direction.

int v

Specifies the number of control vertices in the V direction.

Prototype:

int GetNumUCVs();

Remarks:

Returns the number of control vertices in the U direction.

Prototype:

int GetNumVCVs();

Remarks:

Returns the number of control vertices in the V direction.

Prototype:

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

Remarks:

Returns the number of control vertices in both the U and V directions.

Parameters:

int &u

The number of CVs in the U direction is returned here.

int &v

The number of CVs in the V direction is returned here.

Prototype:

double GetUKnot(int index);

Remarks:

Returns the specified knot value in the U direction.

Parameters:

int index

The 0 based index of the knot value to return.

Prototype:

double GetVKnot(int index);

Remarks:

Returns the specified knot value in the V direction.

Parameters:

int index

The 0 based index of the knot value to return.

Prototype:

void SetUKnot(int index, double value);

Remarks:

Sets the specified knot in the U direction to the specified value.

Parameters:

int index

The 0 based index of the knot value to set.

double value

The value to set.

Prototype:

void SetVKnot(int index, double value);

Remarks:

Sets the specified knot in the U direction to the specified value.

Parameters:

int index

The 0 based index of the knot value to set.

double value

The value to set.

Prototype:

NURBSControlVertex &GetCV(int u, int v);

Remarks:

Returns the specified control vertex of this surface.

Parameters:

int u

The 0 based index in the U direction.

int v

The 0 based index in the V direction.

Prototype:

void SetCV(int u, int v, NURBSControlVertex &cv);

Remarks:

Sets the specified control vertex.

Parameters:

int u

The 0 based index in the U direction.

int v

The 0 based index in the V direction.

NURBSControlVertex &cv

The control vertex to set.

Prototype:

void SetTransformMatrix(TimeValue t, SetXFormPacket& mat);

Remarks:

Sets the transformation matrix for the NURBSCVSurface. This matrix 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 (specifically if it's being moved, rotated, or scaled). See Class SetXFormPacket.

Prototype:

Matrix3 GetTransformMatrix(TimeValue t);

Remarks:

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

Parameters:

TimeValue t

The time at which to retrieve the matrix.

Prototype:

void EdgesOverlap(BOOL& uOverlap, BOOL& vOverlap);

Remarks:

This method determines if the edges of the surface overlap in U and/or V even though the surface may not be closed (that is, the tangents match at the edges).

Parameters:

BOOL& uOverlap

The U result is returned here: TRUE if the edges overlap in U; otherwise FALSE.

BOOL& vOverlap

The V result is returned here: TRUE if the edges overlap in V; otherwise FALSE.

Prototype:

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

Remarks:

This method adds a control vertex at the specified point on the surface without changing the shape of the surface. The other CV points will move to maintain the current shape. The point 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 position for the point in U space.

double v

The position for the point in V space.

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).

Prototype:

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

Remarks:

This method is available in release 2.5 and later only.

This method adds a new CV to the surface and changes its shape. The other CVs will not move as they do in Refine(). This method preserves any existing animation of the surface.

Parameters:

TimeValue t

The time at which to refine the surface.

double u

The position for the point in U space.

double v

The position for the point in V space.

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:

NURBSCVSurface & operator=(const NURBSCVSurface& surf);

Remarks:

Assignment operator.

Parameters:

const NURBSCVSurface& surf

The CV surface to assign.