Public Member Functions | Protected Attributes | Friends

NURBSCVCurve Class Reference

This reference page is linked to from the following overview topics: Using the API to Create and Modify 3ds Max NURBS Models, Accessing Details of NURBS Objects.


Search for all occurrences

Detailed Description

See also:
Class NURBSCurve, Class NURBSControlVertex.

Description:
This class is available in release 2.0 and later only.

This class defines a NURBS CV Curve. CV Curves have control vertices. The position of the control vertices (CVs) controls the shape of the curve. Unlike spline vertices, CVs don't necessarily lie on the curve they define. The CVs define a control lattice which surrounds the NURBS curve.

All methods of this class are implemented by the system.
Data Members:
protected:

NURBSControlVertex *mpCVs;

Array of control vertices.

double *mpKnots;

Array of knots.

BOOL mClosed;

TRUE if the curve is closed; otherwise FALSE.

int mOrder;

The order of the curve.

int mNumKnots;

The number of knots.

int mNumCVs;

The number of control verticies.

NURBSAutoParam mAutoParam;

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

Controls automatic reparameterization. See NURBSAutoParam Types.

#include <surf_api.h>

Inheritance diagram for NURBSCVCurve:
Inheritance graph
[legend]

List of all members.

Public Member Functions

DllExport  NURBSCVCurve (void)
virtual DllExport  ~NURBSCVCurve (void)
DllExport NURBSCVCurve operator= (const NURBSCVCurve &curve)
DllExport void  Close (void)
DllExport BOOL  IsClosed (void)
DllExport void  SetOrder (int order)
DllExport int  GetOrder (void)
DllExport void  SetNumKnots (int num)
DllExport int  GetNumKnots (void)
DllExport void  SetNumCVs (int num)
DllExport void  GetNumCVs (int &num)
DllExport int  GetNumCVs (void)
DllExport double  GetKnot (int index)
DllExport void  SetKnot (int index, double value)
DllExport NURBSControlVertex GetCV (int index)
DllExport void  SetCV (int index, NURBSControlVertex &cv)
DllExport void  SetTransformMatrix (TimeValue t, SetXFormPacket &xPack)
DllExport Matrix3  GetTransformMatrix (TimeValue t)
DllExport NURBSAutoParam  AutoParam ()
DllExport void  AutoParam (TimeValue t, NURBSAutoParam param)
DllExport void  Reparameterize (TimeValue t, NURBSParamaterization param)
DllExport void  EndsOverlap (BOOL &overlap)
DllExport void  Refine (TimeValue t, double u)
DllExport void  Insert (TimeValue t, double u)

Protected Attributes

NURBSControlVertex mpCVs
double *  mpKnots
BOOL  mClosed
int  mOrder
int  mNumKnots
int  mNumCVs
NURBSAutoParam  mAutoParam

Friends

class  NURBSSet

Constructor & Destructor Documentation

DllExport NURBSCVCurve ( void  )
Remarks:
Constructor. The data members are initialized as follows:

mType = kNCVCurve;

mClosed = FALSE;

mpCVs = NULL;

mpKnots = NULL;
virtual DllExport ~NURBSCVCurve ( void  ) [virtual]
Remarks:
Destructor. If the knots and CV arrays are allocated they are freed and any caches are cleared.

Member Function Documentation

DllExport NURBSCVCurve& operator= ( const NURBSCVCurve curve )
Remarks:
Assignment operator.
Parameters:
const NURBSCVCurve& curve

The NURBSCVCurve to assign.
DllExport void Close ( void  )
Remarks:
Closes the curve.
DllExport BOOL IsClosed ( void  )
Remarks:
Returns TRUE if the curve is closed; otherwise FALSE.

Reimplemented from NURBSCurve.

DllExport void SetOrder ( int  order )
Remarks:
Sets the order of the curve. This is one more than the degree of polynomial of any segment of the curve. All curves have a degree. The degree of a curve is the highest exponent in the equation used to represent it. A linear equation is degree 1, a quadratic equation degree 2. NURBS curves typically are represented by cubic equations and have a degree of 3.
Parameters:
int order

Specifies the order of the curve.
DllExport int GetOrder ( void  )
Remarks:
Returns the order of the curve.
DllExport void SetNumKnots ( int  num )
Remarks:
Sets the number of knots in the curve. Note that the previous knot data is NOT maintained

Because they are generated mathematically, NURBS curves have a parameter space in addition to the 3D geometric space in which they are displayed. Specifically, an array of values called knots specifies the extent of influence of each control vertex (CV) on the curve or surface.
Parameters:
int num

Specifies the number of knots for the curve.
DllExport int GetNumKnots ( void  )
Remarks:
Returns the number of knots in the curve.
DllExport void SetNumCVs ( int  num )
Remarks:
Set the number of control vertices in the curve. Note that the previous control vertex data is NOT maintained.
Parameters:
int num

Specifies the number of control vertices.
DllExport void GetNumCVs ( int &  num )
Remarks:
Retrieves the number of control vertices.
Parameters:
int& num

The number is stored here.
DllExport int GetNumCVs ( void  )
Remarks:
Returns the number of control vertices.
DllExport double GetKnot ( int  index )
Remarks:
Returns the knot value whose index is passed.
Parameters:
int index

Specifies which knot value to return.
DllExport void SetKnot ( int  index,
double  value 
)
Remarks:
Sets the specified knot to the specified value.
Parameters:
int index

The 0 based index of the knot to set.

double value

Specifies the value to set.
DllExport NURBSControlVertex* GetCV ( int  index )
Remarks:
Returns a pointer to the specified control vertex of the curve.
Parameters:
int index

The 0 based index of the control vertex to return.
DllExport void SetCV ( int  index,
NURBSControlVertex cv 
)
Remarks:
Sets the specified control vertex to the CV passed.
Parameters:
int index

The 0 based index of the control vertex to set.

NURBSControlVertex &cv

The CV to set.
DllExport void SetTransformMatrix ( TimeValue  t,
SetXFormPacket xPack 
)
Remarks:
Sets the transformation matrix for the NURBSCVCurve. 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.
DllExport Matrix3 GetTransformMatrix ( TimeValue  t )
Remarks:
Returns the transformation matrix of the NURBSCVCurve at the specified time.
Parameters:
TimeValue t

The time at which to retrieve the matrix.
DllExport NURBSAutoParam AutoParam ( )
Remarks:
Returns the current settings for automatic reparameterization. See NURBSAutoParam Types.
DllExport void AutoParam ( TimeValue  t,
NURBSAutoParam  param 
)
Remarks:
Sets the automatic reparameterization settings at the specified time.
Parameters:
TimeValue t

The time to set them.

NURBSAutoParam param

The settings to establish. See NURBSAutoParam Types.
DllExport void Reparameterize ( TimeValue  t,
NURBSParamaterization  param 
)
Remarks:
This method reparameterizes this CV sub-object. This can be used to provide a better relation between control point locations and the shape of the sub-object.
Parameters:
TimeValue t

The time to reparameterize.

NURBSParamaterization param

The type of reparameterizing to perform. See NURBSMirrorAxis Types.
DllExport void EndsOverlap ( BOOL &  overlap )
Remarks:
This method determines if the ends of the curve overlap even though the curve may not be closed (that is, the tangents match at the ends).
Parameters:
BOOL& overlap

The result is returned here: TRUE if the ends overlap; otherwise FALSE.
DllExport void Refine ( TimeValue  t,
double  u 
)
Remarks:
By specifying a parameter point on the curve, this method adds a new control vertex to the curve. It moves all the other CVs but maintains the shape of the curve. Note that this causes the loss of any animation on the curve.
Parameters:
TimeValue t

The time at which to refine the curve. If the curve is animated the u parameter below is time dependent.

double u

Specifies the distance along the curve to add the CV. See the base class method GetParameterRange() for the valid range of values for this parameter.
DllExport void Insert ( TimeValue  t,
double  u 
)
Remarks:
This method places a new CV along the current CV hull at the specified parameter point. This method leaves all the other CVs in place and changes the shape of the curve. This method preserves animation.
Parameters:
TimeValue t

The time at which to refine the curve. If the curve is animated the u parameter below is time dependent.

double u

Specifies the distance along the curve to add the CV. See the base class method GetParameterRange() for the valid range of values for this parameter.
Operators:

Friends And Related Function Documentation

friend class NURBSSet [friend]

Reimplemented from NURBSObject.

Reimplemented in NURBSCurveOnSurface.


Member Data Documentation

NURBSControlVertex* mpCVs [protected]
double* mpKnots [protected]
BOOL mClosed [protected]
int mOrder [protected]
int mNumKnots [protected]
int mNumCVs [protected]

NURBSCVCurve NURBSCVCurve NURBSCVCurve NURBSCVCurve NURBSCVCurve NURBSCVCurve NURBSCVCurve NURBSCVCurve NURBSCVCurve NURBSCVCurve
NURBSCVCurve NURBSCVCurve NURBSCVCurve NURBSCVCurve NURBSCVCurve NURBSCVCurve NURBSCVCurve NURBSCVCurve NURBSCVCurve NURBSCVCurve