3ds Max C++ API Reference
NURBSCVSurface Class Reference

#include <surf_api.h>

+ Inheritance diagram for NURBSCVSurface:

Public Member Functions

DllExport NURBSCVSurface (void)
 
virtual DllExport ~NURBSCVSurface (void)
 
DllExport NURBSCVSurfaceoperator= (const NURBSCVSurface &surf)
 
DllExport BOOL IsRigid ()
 
DllExport void SetRigid (BOOL isRigid)
 
DllExport NURBSAutoParam AutoParam ()
 
DllExport void AutoParam (TimeValue t, NURBSAutoParam param)
 
DllExport void Reparameterize (TimeValue t, NURBSParamaterization param)
 
DllExport void CloseInU (void)
 
DllExport void CloseInV (void)
 
DllExport void SetUOrder (int order)
 
DllExport int GetUOrder (void)
 
DllExport int GetVOrder (void)
 
DllExport void SetVOrder (int order)
 
DllExport void SetNumUKnots (int num)
 
DllExport void SetNumVKnots (int num)
 
DllExport int GetNumUKnots (void)
 
DllExport int GetNumVKnots (void)
 
DllExport void SetNumCVs (int u, int v)
 
DllExport int GetNumUCVs (void)
 
DllExport int GetNumVCVs (void)
 
DllExport void GetNumCVs (int &u, int &v)
 
DllExport double GetUKnot (int index)
 
DllExport double GetVKnot (int index)
 
DllExport void SetUKnot (int index, double value)
 
DllExport void SetVKnot (int index, double value)
 
DllExport NURBSControlVertexGetCV (int u, int v)
 
DllExport void SetCV (int u, int v, NURBSControlVertex &cv)
 
DllExport void SetTransformMatrix (TimeValue t, SetXFormPacket &mat)
 
DllExport Matrix3 GetTransformMatrix (TimeValue t)
 
DllExport void EdgesOverlap (BOOL &uOverlap, BOOL &vOverlap)
 
DllExport void Refine (TimeValue t, double u, double v, int U_V_Both)
 
DllExport void Insert (TimeValue t, double u, double v, int U_V_Both)
 
- Public Member Functions inherited from NURBSSurface
voidGetSurfCache ()
 
const voidGetSurfCache () const
 
void SetSurfCache (void *pCache)
 
DllExport NURBSSurface (void)
 
virtual DllExport ~NURBSSurface (void)
 
DllExport NURBSSurfaceoperator= (const NURBSSurface &surf)
 
DllExport BOOL Renderable ()
 
DllExport void Renderable (BOOL state)
 
DllExport BOOL FlipNormals ()
 
DllExport void FlipNormals (BOOL state)
 
DllExport BOOL GenerateUVs (int channel=0)
 
DllExport void SetGenerateUVs (BOOL state, int channel=0)
 
DllExport int MatID ()
 
DllExport void MatID (int id)
 
DllExport Point2 GetTextureUVs (TimeValue t, int i, int channel=0)
 
DllExport void SetTextureUVs (TimeValue t, int i, Point2 pt, int channel=0)
 
DllExport void GetTileOffset (TimeValue t, float &ut, float &vt, float &uo, float &vo, float &a, int channel=0)
 
DllExport void SetTileOffset (TimeValue t, float ut, float vt, float uo, float vo, float a, int channel=0)
 
DllExport NURBSTextureSurfaceGetTextureSurface (int channel)
 
DllExport void SetTextureSurface (int channel, NURBSTextureSurface &texSurf)
 
DllExport int NumChannels ()
 
DllExport int GetChannelFromIndex (int index)
 
DllExport BOOL IsClosedInU (void)
 
DllExport BOOL IsClosedInV (void)
 
DllExport BOOL Evaluate (TimeValue t, double u, double v, Point3 &pt, Point3 &dPdU, Point3 &dPdV) const
 
DllExport BOOL Evaluate (TimeValue t, double u, double v, Point3 &pt, Point3 &dPdU, Point3 &dPdV, Point3 &d2PdU2, Point3 &d2PdV2, Point3 &d2PdUdV) const
 
DllExport void GetParameterRange (TimeValue t, double &uMin, double &uMax, double &vMin, double &vMax) const
 
DllExport BOOL GetNURBSData (TimeValue t, int &degreeInU, int &degreeInV, int &numInU, int &numInV, NURBSCVTab &cvs, int &numKnotsInU, int &numKnotsInV, NURBSKnotTab &uKnots, NURBSKnotTab &vKnots)
 
DllExport BOOL GetCLPTextureSurfaceData (TimeValue t, int channel, int &degreeInU, int &degreeInV, int &numInU, int &numInV, NURBSCVTab &cvs, int &numKnotsInU, int &numKnotsInV, NURBSKnotTab &uKnots, NURBSKnotTab &vKnots)
 
DllExport int NumTrimLoops (TimeValue t)
 
DllExport int NumCurvesInLoop (TimeValue t, int loop)
 
DllExport BOOL Get2dTrimCurveData (TimeValue t, int loop, int curve, int &degree, int &numCVs, NURBSCVTab &cvs, int &numKnots, NURBSKnotTab &knots)
 
DllExport BOOL Get3dTrimCurveData (TimeValue t, int loop, int curve, int &degree, int &numCVs, NURBSCVTab &cvs, int &numKnots, NURBSKnotTab &knots)
 
DllExport TessApproxGetProdTess (NURBSTessType type=kNTessSurface)
 
DllExport TessApproxGetViewTess (NURBSTessType type=kNTessSurface)
 
DllExport void SetProdTess (TessApprox &tess, NURBSTessType type=kNTessSurface)
 
DllExport void SetViewTess (TessApprox &tess, NURBSTessType type=kNTessSurface)
 
DllExport void ClearViewTess (NURBSTessType type=kNTessSurface)
 
DllExport void ClearProdTess (NURBSTessType type=kNTessSurface)
 
- 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)
 

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)
 
- Protected Attributes inherited from NURBSSurface
NURBSTextureChannelSet mTextureChannelSet
 
BOOL mFlipNormals
 
BOOL mRenderable
 
int mMatID
 
BOOL mClosedInU
 
BOOL mClosedInV
 
TessApproxmpVTess
 
TessApproxmpRTess
 
TessApproxmpRTessDisp
 
TessApproxmpVTessCurve
 
TessApproxmpRTessCurve
 
voidmpSurfCache
 
- Protected Attributes inherited from NURBSObject
MCHAR mName [NURBS_NAME_SIZE]
 
NURBSType mType
 
NURBSKind mKind
 
NURBSId mId
 
ObjectmpObject
 
NURBSSetmpNSet
 
BOOL mSelected
 

Detailed Description

See also
Class NURBSSurface.

Description:
This class defines a surface that uses control vertices (CVs) to describe its shape. The CVs define a control lattice which surrounds the surface. This class has methods to close the surface in U and V, set its order in U and V, set the number of knots and CVs in U and V, and get/set the knots and CVs in U and V. There is also a method to add additional CVs to the surface. The CV surface has a transformation matrix used to position the surface within a NURBSSet.

All methods of this class are implemented by the system.

Constructor & Destructor Documentation

◆ NURBSCVSurface()

Remarks
Constructor. The data members are initialized as follows:

mType = kNCVSurface;

mRigid = FALSE;

mClosedInU = FALSE;

mClosedInV = FALSE;

mpCVs = NULL;

mpUKnots = NULL;

mpVKnots = NULL;

mNumUCVs = 0;

mNumVCVs = 0;

mNumUKnots = 0;

mNumVKnots = 0;

mUOrder = 0;

mVOrder = 0;

mAutoParam = kNotAutomatic;

◆ ~NURBSCVSurface()

virtual DllExport ~NURBSCVSurface ( void  )
virtual
Remarks
Destructor.

Member Function Documentation

◆ operator=()

DllExport NURBSCVSurface& operator= ( const NURBSCVSurface surf)
Remarks
Assignment operator.
Parameters:
const NURBSCVSurface& surf

The CV surface to assign.

◆ IsRigid()

DllExport BOOL IsRigid ( )
Remarks
Returns TRUE if the surface is 'rigid'; otherwise FALSE.

◆ SetRigid()

DllExport void SetRigid ( BOOL  isRigid)
Remarks
Sets the 'rigid' state of the surface.
Parameters:
BOOL isRigid

TRUE for on; FALSE for off.

◆ AutoParam() [1/2]

DllExport NURBSAutoParam AutoParam ( )
Remarks
Returns the automatic parameterization setting. See NURBSAutoParam Types.

◆ AutoParam() [2/2]

DllExport void AutoParam ( TimeValue  t,
NURBSAutoParam  param 
)
Remarks
Sets the automatic parameterization setting at the specified time.
Parameters:
TimeValue t

The time at which to set the parameterization.

NURBSAutoParam param

See NURBSAutoParam Types.

◆ Reparameterize()

DllExport void Reparameterize ( TimeValue  t,
NURBSParamaterization  param 
)
Remarks
Sets the reparameterization type at the specified time.
Parameters:
TimeValue t

The time at which to sets the reparameterization type.

NURBSParamaterization param

See nurbParameterizationTypes.

◆ CloseInU()

DllExport void CloseInU ( void  )
Remarks
This method closes the surface in the U direction. The aligns the surface edge to edge in U and sets the tangents to match.

◆ CloseInV()

DllExport void CloseInV ( void  )
Remarks
This method closes the surface in the V direction. The aligns the surface edge to edge in V and sets the tangents to match.

◆ SetUOrder()

DllExport void SetUOrder ( int  order)
Remarks
Sets the order of the surface in the U direction.
Parameters:
int order

Specifies the order of the surface in the U direction.

◆ GetUOrder()

DllExport int GetUOrder ( void  )
Remarks
Returns the order of the surface in the U direction.

◆ GetVOrder()

DllExport int GetVOrder ( void  )
Remarks
Returns the order of the surface in the V direction.

◆ SetVOrder()

DllExport void SetVOrder ( int  order)
Remarks
Sets the order of the surface in the V direction.
Parameters:
int order

Specifies the order of the surface in the V direction.

◆ SetNumUKnots()

DllExport void SetNumUKnots ( int  num)
Remarks
Sets the number of knots in the U direction. Note that the knot data is not maintained.
Parameters:
int num

Specifies the number of knots in the U direction.

◆ SetNumVKnots()

DllExport void SetNumVKnots ( int  num)
Remarks
Sets the number of knots in the V direction. Note that the knot data is not maintained.
Parameters:
int num

Specifies the number of knots in the V direction.

◆ GetNumUKnots()

DllExport int GetNumUKnots ( void  )
Remarks
Returns the number of knots in the U direction.

◆ GetNumVKnots()

DllExport int GetNumVKnots ( void  )
Remarks
Returns the number of knots in the V direction.

◆ SetNumCVs()

DllExport void SetNumCVs ( int  u,
int  v 
)
Remarks
Sets the number of control vertices in both the U and V directions. Note that the CV data is not maintained.
Parameters:
int u

Specifies the number of control vertices in the U direction.

int v

Specifies the number of control vertices in the V direction.

◆ GetNumUCVs()

DllExport int GetNumUCVs ( void  )
Remarks
Returns the number of control vertices in the U direction.

◆ GetNumVCVs()

DllExport int GetNumVCVs ( void  )
Remarks
Returns the number of control vertices in the V direction.

◆ GetNumCVs()

DllExport void GetNumCVs ( int u,
int v 
)
Remarks
Returns the number of control vertices in both the U and V directions.
Parameters:
int &u

The number of CVs in the U direction is returned here.

int &v

The number of CVs in the V direction is returned here.

◆ GetUKnot()

DllExport double GetUKnot ( int  index)
Remarks
Returns the specified knot value in the U direction.
Parameters:
int index

The 0 based index of the knot value to return.

◆ GetVKnot()

DllExport double GetVKnot ( int  index)
Remarks
Returns the specified knot value in the V direction.
Parameters:
int index

The 0 based index of the knot value to return.

◆ SetUKnot()

DllExport void SetUKnot ( int  index,
double  value 
)
Remarks
Sets the specified knot in the U direction to the specified value.
Parameters:
int index

The 0 based index of the knot value to set.

double value

The value to set.

◆ SetVKnot()

DllExport void SetVKnot ( int  index,
double  value 
)
Remarks
Sets the specified knot in the U direction to the specified value.
Parameters:
int index

The 0 based index of the knot value to set.

double value

The value to set.

◆ GetCV()

DllExport NURBSControlVertex* GetCV ( int  u,
int  v 
)
Remarks
Returns the specified control vertex of this surface.
Parameters:
int u

The 0 based index in the U direction.

int v

The 0 based index in the V direction.

◆ SetCV()

DllExport void SetCV ( int  u,
int  v,
NURBSControlVertex cv 
)
Remarks
Sets the specified control vertex.
Parameters:
int u

The 0 based index in the U direction.

int v

The 0 based index in the V direction.

NURBSControlVertex &cv

The control vertex to set.

◆ SetTransformMatrix()

DllExport void SetTransformMatrix ( TimeValue  t,
SetXFormPacket mat 
)
Remarks
Sets the transformation matrix for the NURBSCVSurface. This matrix controls the relative position of the surface 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 (specifically if it's being moved, rotated, or scaled). See Class SetXFormPacket.

◆ GetTransformMatrix()

DllExport Matrix3 GetTransformMatrix ( TimeValue  t)
Remarks
Returns the transformation matrix of the NURBSCVSurface at the specified time.
Parameters:
TimeValue t

The time at which to retrieve the matrix.

◆ EdgesOverlap()

DllExport void EdgesOverlap ( BOOL &  uOverlap,
BOOL &  vOverlap 
)
Remarks
This method determines if the edges of the surface overlap in U and/or V even though the surface may not be closed (that is, the tangents match at the edges).
Parameters:
BOOL& uOverlap

The U result is returned here: TRUE if the edges overlap in U; otherwise FALSE.

BOOL& vOverlap

The V result is returned here: TRUE if the edges overlap in V; otherwise FALSE.

◆ Refine()

DllExport void Refine ( TimeValue  t,
double  u,
double  v,
int  U_V_Both 
)
Remarks
This method adds a control vertex at the specified point on the surface without changing the shape of the surface. The other CV points will move to maintain the current shape. The point may be specified as a U value or a V value, or both.

If you refine in U (U_V_Both = 0) you must specify v

If you refine in V (U_V_Both = 1) you must specify u

If you refine in U and V (U_V_Both = -1) you must specify u and v
Parameters:
TimeValue t

The time at which to refine the surface.

double u

The position for the point in U space.

double v

The position for the point in V space.

int U_V_Both

This value must be 0, 1 or -1.

If 0 the refinement is done in u (and v is specified).

If 1 the refinement is done in v (and u is specified).

If -1 the refinement is done in both u and v (and both u and v must be specified).

◆ Insert()

DllExport void Insert ( TimeValue  t,
double  u,
double  v,
int  U_V_Both 
)
Remarks
This method adds a new CV to the surface and changes its shape. The other CVs will not move as they do in Refine(). This method preserves any existing animation of the surface.
Parameters:
TimeValue t

The time at which to refine the surface.

double u

The position for the point in U space.

double v

The position for the point in V space.

int U_V_Both

This value must be 0, 1 or -1.

If 0 the refinement is done in u (and v is specified).

If 1 the refinement is done in v (and u is specified).

If -1 the refinement is done in both u and v (and both u and v must be specified).
Operators:

Friends And Related Function Documentation

◆ NURBSSet

friend class NURBSSet
friend