Class NURBSCurve

3DS Max Plug-In SDK

Class NURBSCurve

See Also: Class NURBSObject, Class NURBSTrimPoint.

class NURBSCurve : public NURBSObject

Description:

This class is available in release 2.0 and later only.

This class describes the properties of a NURBS curve. This includes its number of trim points and its open/closed state. The Evaluate() method is used to compute points on the curve.

All methods of this class are implemented by the system.

Data Members:

protected:

int mMatID;

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

The material ID for the curve.

Friend Classes:

friend class NURBSCVCurve;

friend class NURBSPointCurve;

friend class NURBSBlendCurve;

friend class NURBSOffsetCurve;

friend class NURBSXFormCurve;

friend class NURBSMirrorCurve;

friend class NURBSFilletCurve;

friend class NURBSChamferCurve;

friend class NURBSIsoCurve;

friend class NURBSSurfaceEdgeCurve;

friend class NURBSProjectVectorCurve;

friend class NURBSProjectNormalCurve;

friend class NURBSSurfaceNormalCurve;

friend class NURBSNBlendSurface;

friend class NURBSRuledSurface;

friend class NURBSULoftSurface;

friend class NURBSUVLoftSurface;

friend class NURBSExtrudeSurface;

friend class NURBSLatheSurface;

friend class NURBSCapSurface;

friend class NURBS1RailSweepSurface;

friend class NURBS2RailSweepSurface;

friend class NURBSMultiCurveTrimSurface;

Methods:

public:

Prototype:

NURBSCurve();

Remarks:

Constructor. The data members are initialized as follows:

 mKind = kNURBSCurve;

 mMatID = 1;

Prototype:

~NURBSCurve();

Remarks:

Destructor.

Prototype:

BOOL IsClosed();

Remarks:

Returns TRUE if the curve is closed; otherwise FALSE.

Prototype:

int NumTrimPoints();

Remarks:

Returns the number of trim points in the curve.

Prototype:

NURBSTrimPoint GetTrimPoint(TimeValue t, int i);

Remarks:

Returns the 'i-th' trim point.

Parameters:

TimeValue t

The time to retrieve the trim point.

int i

The zero based index of the trim point to return.

Prototype:

BOOL Evaluate(TimeValue t, double u, Point3& pt, Point3& tangent);

Remarks:

Retrieves the point along the curve at the specified point and the tangent at that point.

Parameters:

TimeValue t

The time to evaluate the curve.

double u

Specifies the point along the curve to evaluate. This value must be between the uMin and uMax as returned from GetParameterRange().

Point3& pt

The point along the curve is returned here.

Point3& tangent

The tangent at the specified point is returned here.

Return Value:

TRUE if the method was able to evaluate the curve; otherwise FALSE.

Prototype:

void GetParameterRange(TimeValue t, double& uMin, double& uMax);

Remarks:

Retrieves the minimum and maximum valid values for u as passed to Evaluate().

Parameters:

TimeValue t

The time to get the parameter range of the curve.

double& uMin

The minimum value is returned here.

double& uMax

The maximum value is returned here.

Prototype:

BOOL GetNURBSData(TimeValue t, int& degree, int& numCVs, NURBSCVTab& cvs, int& numKnots, NURBSKnotTab knots);

Remarks:

This method is available in release 2.5 and later only.

Retrieves data about the NURBSCurve at the specified time.

Parameters:

TimeValue t

The time at which to get the NURBS information.

int& degree

The degree of the curve.

int& numCVs

The number of CVs.

NURBSCVTab& cvs

The table of CVs. Note: typedef Tab<NURBSControlVertex> NURBSCVTab;

int& numKnots

The number of knots.

NURBSKnotTab knots

A table of knots in U. Note: typedef Tab<double> NURBSKnotTab;

Return Value:

TRUE if the data was retrieved; otherwise FALSE.

Prototype:

int MatID();

Remarks:

This method is available in release 3.0 and later only.

Returns the material ID for the curve.

Prototype:

void MatID(int id);

Remarks:

This method is available in release 3.0 and later only.

Sets the material ID for the curve.

Parameters:

int id

The ID to set.

Operators:

Prototype:

NURBSCurve & operator=(const NURBSCurve& curve);

Remarks:

Assignment operator.

Parameters:

const NURBSCurve& curve

The curve to assign.