Class NURBSPointCurve

3DS Max Plug-In SDK

Class NURBSPointCurve

See Also: Class NURBSCurve, Class NURBSIndependentPoint.

class NURBSPointCurve : public NURBSCurve

Description:

This class is available in release 2.0 and later only.

This class defines a curve that uses points to describe its shape. All the points lie on the curve itself. There are methods to get/set the number of points in the curve, get/set the points themselves, refine the curve (add points without changing its shape), and to get/set the transformation matrix used by the curve. This matrix is used to set the postion of the curve in the NURBSSet.

All methods of this class are implemented by the system.

Friend Classes:

friend class NURBSSet

Data Memberss:

protected:

NURBSIndependentPoint *mpPts;

Array of independent points.

BOOL mClosed;

TRUE if the curve is closed; otherwise FALSE.

int mNumPts;

The number of independent points.

Methods:

Prototype:

NURBSPointCurve();

Remarks:

Constructor. The data members are initialized as follows:

 mType = kNPointCurve;

 mClosed = FALSE;

 mpPts = NULL;

Prototype:

virtual ~NURBSPointCurve();

Remarks:

Destructor. If any points were allocated they are freed and the cache is cleared.

Prototype:

void Close();

Remarks:

Closes the point curve.

Prototype:

BOOL IsClosed();

Remarks:

This method is available in release 3.0 and later only.

Returns TRUE if the curve is closed; otherwise FALSE.

Prototype:

void SetNumPts(int num);

Remarks:

Sets the number of points in the point curve. Note that any previous point data is not maintained when the new number is set.

Parameters:

int num

The number of points in the curve.

Prototype:

int GetNumPts();

Remarks:

Returns the number of points in the curve.

Prototype:

void GetNumPts(int &num);

Remarks:

Retrieves the number of points in the curve.

Parameters:

int &num

The result is stored here.

Prototype:

NURBSIndependentPoint* GetPoint(int index);

Remarks:

Returns a pointer to the specified point.

Parameters:

int index

The zero based index of the point to get.

Prototype:

void SetPoint(int index, NURBSIndependentPoint &pt);

Remarks:

Sets the specified point in the curve.

Parameters:

int index

The zero based index of the point to set.

NURBSIndependentPoint &pt

The point to set.

Prototype:

void SetTransformMatrix(TimeValue t, SetXFormPacket& xPack);

Remarks:

Sets the transformation matrix for the NURBSPointCurve. This controls the relative position of the item 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 that controls the relative position of the point curve in the NURBSSet.

Parameters:

TimeValue t

The time at which to return the matrix.

Prototype:

void Refine(TimeValue t, double u);

Remarks:

This method adds a new point at the specified location on the curve without changing its shape. The point is specified as a distance in U parameter space. Note that calling this method causes all animation of the curve to be removed.

Parameters:

TimeValue t

The time at which to refine the curve. The curve may be animated, and thus the underlying parameter space may be changing. So when the u value is specified it must relate to the curve at a specific time.

double u

The point at which to refine the curve. Developers should use the method NURBSCurve::GetParameterRange() to get the valid range of values that may be passed here.

Operators:

Prototype:

NURBSPointCurve & operator=(const NURBSPointCurve& curve);

Remarks:

Assignment operator.

Parameters:

const NURBSPointCurve& curve

The curve to assign.