Class NURBSProceeduralCurve

3DS Max Plug-In SDK

Class NURBSProceeduralCurve

See Also: Class NURBSCVCurve, Class NURBSCurve.

class NURBSProceeduralCurve

Description:

This class is available in release 3.0 and later only.

This is the base class for procedurally defined curves. Note that this is not subclassed from NURBSObject. You must use the GenNURBSCVCurveProcedurally() function.

The following typedef-ed functions are used by the GenNURBSCVCurveProcedurally() function.

Prototype:

typedef NURBSResult (*CurveParamRangeProc)(double& tMin, double& tMax);

Remarks:

The curve parameter range procedure. This retrieves the minimum and maximum valid values for u as passed to the CurveEvalProc().

Parameters:

double& tMin

The minimum value.

double& tMax

The maximum value.

Return Value:

See List of NURBS Results .

Prototype:

typedef NURBSResult (*CurveEvalProc)(double u, Point3& pt);

Remarks:

The curve evaluation procedure. This retrieves the point on the curve based on the u parameter.

Parameters:

double u

Specifies the U point along the curve to evaluate.

Point3& pt

The output point on the curve at U.

Return Value:

See List of NURBS Results .

Prototype:

typedef NURBSResult (*CurveEvalTan)(double u, Point3& pt, Point3& tan);

Remarks:

The curve point and tangent evaluation procedure. This retrieves the point and tangent at the point on the curve based on the U parameter.

Parameters:

double u

Specifies the point along the curve to evaluate.

Point3& pt

The output point at U.

Point3& tan

The output tangent at U.

Return Value:

See List of NURBS Results .

Prototype:

typedef NURBSResult (*CurveArcLengthProc)(double& arcLength);

Remarks:

Retrieves the length of the curve.

Parameters:

double& arcLength

The output arc length.

Return Value:

See List of NURBS Results .

Data Members:

public:

CurveParamRangeProc mParamProc;

The curve parameter range procedure. Note: This procedure must be implemented.

CurveEvalProc mEvalProc;

The curve evaluate procedure. Note: This procedure must be implemented.

CurveEvalTan mEvalTanProc;

The curve evaluate tangent procedure. Note: This procedure is optional.

CurveArcLengthProc mArcLengthProc;

The curve arc length procedure. Note: This procedure is optional.

Methods:

public:

Prototype:

NURBSProceeduralCurve(CurveParamRangeProc param, CurveEvalProc eval, CurveEvalTan tan, CurveArcLengthProc arclen);

Remarks:

Constructor. The data members are initialized to the values passed.

The following global function is not part of this class but is available for use:

Function:

NURBSResult GenNURBSCVCurveProceedurally(NURBSProceeduralCurve *pCrv, double tolerence, NURBSCVCurve& crv);

Remarks:

This global function is available in release 3.0 and later only.

To use this API you need to create an instance of NURBSProceeduralCurve setting at least the ParameterRange and Eval procedures. The others can be NULL unless you have fast versions of them. The call tothis function then fills in a NURBSCVCurve with the curve that is defined by the proceedures and the tolerence.

Parameters:

*pCrv

Points to the NURBSProceeduralCurve object used to generate the curve procedurally.

double tolerence

The tolerance is the allowable deviation of the approximating NURBS surface to the surface defined by the procs.

NURBSCVCurve& crv

The generated curve is returned here.

Return Value:

See List of NURBS Results .