3ds Max C++ API Reference
NURBSCVCurve Class Reference

#include <surf_api.h>

+ Inheritance diagram for NURBSCVCurve:

Public Member Functions

DllExport NURBSCVCurve (void)
 
virtual DllExport ~NURBSCVCurve (void)
 
DllExport NURBSCVCurveoperator= (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 NURBSControlVertexGetCV (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)
 
- Public Member Functions inherited from NURBSCurve
DllExport NURBSCurve (void)
 
virtual DllExport ~NURBSCurve (void)
 
DllExport NURBSCurveoperator= (const NURBSCurve &curve)
 
DllExport BOOL IsClosed (void)
 
DllExport int NumTrimPoints ()
 
DllExport NURBSTrimPoint GetTrimPoint (TimeValue t, int i)
 
DllExport BOOL Evaluate (TimeValue t, double u, Point3 &pt, Point3 &tangent)
 
DllExport void GetParameterRange (TimeValue t, double &uMin, double &uMax)
 
DllExport BOOL GetNURBSData (TimeValue t, int &degree, int &numCVs, NURBSCVTab &cvs, int &numKnots, NURBSKnotTab &knots)
 
DllExport int MatID ()
 
DllExport void MatID (int id)
 
- Public Member Functions inherited from NURBSObject
DllExport NURBSObject (void)
 
virtual DllExport ~NURBSObject (void)
 
DllExport NURBSObjectoperator= (const NURBSObject &pt)
 
DllExport void SetName (const MCHAR *name)
 
DllExport const MCHARGetName (void)
 
DllExport NURBSType GetType () const
 
DllExport NURBSKind GetKind () const
 
DllExport NURBSId GetId () const
 
DllExport void SetId (NURBSId id)
 
DllExport void SetNSet (NURBSSet *nset)
 
DllExport void SetObject (Object *object)
 
DllExport ObjectGetMAXObject ()
 
DllExport NURBSSetGetNSet ()
 
DllExport int GetIndex ()
 
DllExport BOOL IsSelected ()
 
DllExport void SetSelected (BOOL set)
 

Protected Attributes

NURBSControlVertexmpCVs
 
double * mpKnots
 
BOOL mClosed
 
int mOrder
 
int mNumKnots
 
int mNumCVs
 
NURBSAutoParam mAutoParam
 
- Protected Attributes inherited from NURBSCurve
int mMatID
 
- Protected Attributes inherited from NURBSObject
MCHAR mName [NURBS_NAME_SIZE]
 
NURBSType mType
 
NURBSKind mKind
 
NURBSId mId
 
ObjectmpObject
 
NURBSSetmpNSet
 
BOOL mSelected
 

Friends

class NURBSSet
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 
- Protected Member Functions inherited from NURBSObject
DllExport void Clean (NURBSIdTab ids)
 

Detailed Description

See also
Class NURBSCurve, Class NURBSControlVertex.

Description:
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.

Constructor & Destructor Documentation

◆ NURBSCVCurve()

Remarks
Constructor. The data members are initialized as follows:

mType = kNCVCurve;

mClosed = FALSE;

mpCVs = NULL;

mpKnots = NULL;

◆ ~NURBSCVCurve()

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

◆ operator=()

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

The NURBSCVCurve to assign.

◆ Close()

DllExport void Close ( void  )
Remarks
Closes the curve.

◆ IsClosed()

DllExport BOOL IsClosed ( void  )

◆ SetOrder()

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.

◆ GetOrder()

DllExport int GetOrder ( void  )
Remarks
Returns the order of the curve.

◆ SetNumKnots()

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.

◆ GetNumKnots()

DllExport int GetNumKnots ( void  )
Remarks
Returns the number of knots in the curve.

◆ SetNumCVs()

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.

◆ GetNumCVs() [1/2]

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

The number is stored here.

◆ GetNumCVs() [2/2]

DllExport int GetNumCVs ( void  )
Remarks
Returns the number of control vertices.

◆ GetKnot()

DllExport double GetKnot ( int  index)
Remarks
Returns the knot value whose index is passed.
Parameters:
int index

Specifies which knot value to return.

◆ SetKnot()

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.

◆ GetCV()

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.

◆ SetCV()

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.

◆ SetTransformMatrix()

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.

◆ GetTransformMatrix()

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.

◆ AutoParam() [1/2]

DllExport NURBSAutoParam AutoParam ( )
Remarks
Returns the current settings for automatic reparameterization. See NURBSAutoParam Types.

◆ AutoParam() [2/2]

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.

◆ Reparameterize()

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.

◆ EndsOverlap()

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.

◆ Refine()

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.

◆ Insert()

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

◆ NURBSSet

friend class NURBSSet
friend

Member Data Documentation

◆ mpCVs

NURBSControlVertex* mpCVs
protected

◆ mpKnots

double* mpKnots
protected

◆ mClosed

BOOL mClosed
protected

◆ mOrder

int mOrder
protected

◆ mNumKnots

int mNumKnots
protected

◆ mNumCVs

int mNumCVs
protected

◆ mAutoParam

NURBSAutoParam mAutoParam
protected