NURBSSet Class Reference

#include <surf_api.h>

Class Description

See also
Class NURBSObject, Class NURBSDisplay, Class TessApprox, Class NURBSFuseSurfaceCV, Class NURBSFuseCurveCV, Template Class Tab.

Description:
This class contains a table of NURBSObject entities used to make up the set. Additionally it has two fuse tables: one for fuse curves and one for fuse surfaces. These are used to allow the CVs in the curves or surfaces to be 'stitched' together so if one curve or surface moves the other moves with it. This class also has information required to tessellate the objects to triangle meshes for use in the viewports and the production renderer.

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

TessApprox *mpVTess;

This object describes the properties of a tesselation approximation to the mathematical surface for representation in the viewports.

TessApprox *mpRTess;

This object describes the properties of a tesselation approximation to the mathematical surface for the production renderer.

TessApprox *mpRTessDisp;

This object describes the tesselation properties for displacement mapping in the production renderer.

TessApprox *mpVTessCurve;

This object describes the properties of a tesselation approximation to the mathematical curve for representation in the viewports.

TessApprox *mpRTessCurve;

This object describes the properties of a tesselation approximation to the mathematical curve for the production renderer.

float mTessMerge;

Controls the tessellation of surface sub-objects whose edges are joined or very nearly joined. When input to a modifier – such as Mesh Select – requires a mesh, and when NURBS surfaces are tessellated for production rendering, by default 3ds Max adjusts the tessellation of adjoining surfaces to match each other, in terms of the number of faces along the edges. The Merge parameter controls how this is done. If Merge is zero, adjoining faces are unchanged. Increasing the value of Merge increases the distance 3ds Max uses to calculate how edges should match, guaranteeing no gaps between the surfaces when they are rendered.

Tab<NURBSObject*> mObjects;

A table of pointers to the NURBSObjects in the set.

Object *mpObject;

The instantiated object in the scene associated with this NURBSSet. This is NULL if there isn't one.

NURBSDisplay mDisplay;

Controls the display of the object in the viewport..

Tab<NURBSFuseSurfaceCV> mSurfFuse;

A table of objects used to allow surfaces in the set to relate to on another.

Tab<NURBSFuseCurveCV> mCurveFuse;

A table of objects used to allow curves in the set to relate to on another.
+ Inheritance diagram for NURBSSet:

Public Member Functions

DllExport NURBSSet (void)
 
virtual DllExport ~NURBSSet (void)
 
DllExport void Clean ()
 
DllExport int GetNumObjects ()
 
DllExport void SetObject (int index, NURBSObject *obj)
 
DllExport int AppendObject (NURBSObject *obj)
 
DllExport void RemoveObject (int index)
 
DllExport void DeleteObjects ()
 
DllExport NURBSObjectGetNURBSObject (int index)
 
DllExport NURBSObjectGetNURBSObject (NURBSId id)
 
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)
 
DllExport float GetTessMerge ()
 
DllExport void SetTessMerge (float merge)
 
DllExport ObjectGetMAXObject ()
 
DllExport NURBSDisplay GetDisplaySettings ()
 
DllExport void SetDisplaySettings (NURBSDisplay &disp)
 

Public Attributes

Tab< NURBSFuseSurfaceCVmSurfFuse
 
Tab< NURBSFuseCurveCVmCurveFuse
 

Protected Attributes

TessApproxmpVTess
 
TessApproxmpRTess
 
TessApproxmpRTessDisp
 
TessApproxmpVTessCurve
 
TessApproxmpRTessCurve
 
float mTessMerge
 
Tab< NURBSObject * > mObjects
 
ObjectmpObject
 
NURBSDisplay mDisplay
 

Friends

DllExport ObjectCreateNURBSObject (IObjParam *ip, NURBSSet *nset, Matrix3 &mat)
 
DllExport int AddNURBSObjects (Object *MAXobj, IObjParam *ip, NURBSSet *nset)
 
DllExport BOOL GetNURBSSet (Object *object, TimeValue t, NURBSSet &nset, BOOL Relational)
 

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

Constructor & Destructor Documentation

Remarks
Constructor. The data members are initialized as follows:

mpObject = NULL;

mpVTess = NULL;

mpRTess = NULL;

mpRTessDisp = NULL;

mpVTessCurve = NULL;

mpRTessCurve = NULL;

mTessMerge = 0.01f;

mDisplay.mDisplayCurves = TRUE;

mDisplay.mDisplaySurfaces = TRUE;

mDisplay.mDisplayLattices = FALSE;

mDisplay.mDisplayShadedLattice = FALSE;

mDisplay.mDisplaySurfCVLattices = TRUE;

mDisplay.mDisplayCurveCVLattices = TRUE;

mDisplay.mDisplayDependents = TRUE;

mDisplay.mDisplayTrimming = TRUE;

mDisplay.mDegradeOnMove = TRUE;
virtual DllExport ~NURBSSet ( void  )
virtual
Remarks
Destructor. Any tesselation objects are deleted.

Member Function Documentation

DllExport void Clean ( )
Remarks
This removes the NURBS Set connection to a live NURBS object. One use of this is so you can call CreateNURBSObject() twice with the same NURBSSet. You call Clean() in between the calls. Another use is if you want to use the API to copy a NURBS object. You could call GetNURBSSet() followed by a Clea() followed by a CreateNURBSObject().
DllExport int GetNumObjects ( )
Remarks
Returns the number of objects in the set.
DllExport void SetObject ( int  index,
NURBSObject obj 
)
Remarks
This method sets an object in the table of objects maintained by the set. If the index is to an existing object in the set this will replace that object. If it is a new index, all the objects which follow this one in the set are set to NULL and the one passed is set.
Parameters:
int index

If the index is an existing object in the set this will replace the object. If it is a new index, all the objects which follow this one are set to NULL and the one passed is set.

NURBSObject* obj

Points to the object to add to the table.
\remarks Sets the specified NURBSObject pointer in the table to the
specified pointer. If the value of index is greater than the number of items in the table, the table is resized and any non-initialized pointers are set to NULL.
Parameters:
int index

The zero based index of the object to set.

NURBSObject* obj

Points to the object to set.
DllExport int AppendObject ( NURBSObject obj)
Remarks
Adds the specified object pointer to the end of the table of object pointers.

Note: This method is ONLY used for adding an object to a NURBSSet that is not yet in the scene. To add an object to an existing scene use the global function AddNURBSObjects().
Parameters:
NURBSObject* obj

The pointer to the object to append.
Returns
Returns the number of objects in the table prior to appending.
DllExport void RemoveObject ( int  index)
Remarks
Removes the specified object pointer from the table.
Parameters:
int index

The zero based index of the object to remove.
DllExport void DeleteObjects ( )
Remarks
Deletes all the objects that are in the table.

This method frees all the NURBSObjects in a NURBSSet. A developer using a NURBSSet must call this method to free all the memory when done.
DllExport NURBSObject* GetNURBSObject ( int  index)
Remarks
Returns a pointer to the specified object in the table.
Parameters:
int index

The zero based index of the object to return.
DllExport NURBSObject* GetNURBSObject ( NURBSId  id)
Remarks
Returns a pointer to the specified object in the table.
Parameters:
NURBSId id

The Id of the object to return.
DllExport TessApprox* GetProdTess ( NURBSTessType  type = kNTessSurface)
Remarks
Returns a pointer to the TessApprox object for the production renderer for the specified tesselation operation.
Parameters:
NURBSTessType type=kNTessSurface

The type of tesselation. See NURBSTess Types.
DllExport TessApprox* GetViewTess ( NURBSTessType  type = kNTessSurface)
Remarks
Returns a pointer to the TessApprox object for the viewport renderer for the specified tesselation operation.
Parameters:
NURBSTessType type=kNTessSurface

The type of tesselation. See NURBSTess Types.
DllExport void SetProdTess ( TessApprox tess,
NURBSTessType  type = kNTessSurface 
)
Remarks
Sets the TessApprox object for the production renderer for the specified tesselation operation.
Parameters:
TessApprox& tess

The tesselation object.

NURBSTessType type=kNTessSurface

This parameter is available in release 3.0 and later only.

The type of tesselation. See NURBSTess Types.
DllExport void SetViewTess ( TessApprox tess,
NURBSTessType  type = kNTessSurface 
)
Remarks
Sets the TessApprox object for the viewport renderer for the specified tesselation operation.
Parameters:
TessApprox& tess

The tesselation object.

NURBSTessType type=kNTessSurface

This parameter is available in release 3.0 and later only.

The type of tesselation. See NURBSTess Types.
DllExport void ClearViewTess ( NURBSTessType  type = kNTessSurface)
Remarks
Clears (deletes) the specified tesselation object used for viewport rendering.
Parameters:
NURBSTessType type=kNTessSurface

The type of tesselation. See NURBSTess Types.
DllExport void ClearProdTess ( NURBSTessType  type = kNTessSurface)
Remarks
Clears (deletes) the specified tesselation object used for production rendering.
Parameters:
NURBSTessType type=kNTessSurface

The type of tesselation. See NURBSTess Types.
DllExport float GetTessMerge ( )
Remarks
Returns the tesselation merge value.
DllExport void SetTessMerge ( float  merge)
Remarks
Sets the tesselation merge value.
Parameters:
float merge

The tessellation merge value. Controls the tessellation of surface sub-objects whose edges are joined or very nearly joined. When input to a modifier – such as Mesh Select – requires a mesh, and when NURBS surfaces are tessellated for production rendering, by default 3ds Max adjusts the tessellation of adjoining surfaces to match each other, in terms of the number of faces along the edges. The Merge parameter controls how this is done. If Merge is zero, adjoining faces are unchanged. Increasing the value of Merge increases the distance 3ds Max uses to calculate how edges should match, guaranteeing no gaps between the surfaces when they are rendered.
DllExport Object* GetMAXObject ( )
Remarks
Returns a pointer to the instantiated object in the scene associated with this NURBSSet. This is NULL if there isn't one.
DllExport NURBSDisplay GetDisplaySettings ( )
Remarks
Returns the display settings for this NURBSSet.
DllExport void SetDisplaySettings ( NURBSDisplay disp)
Remarks
Sets the display settings used by this NURBSSet.
Parameters:
NURBSDisplay& disp

The settings to use.

Friends And Related Function Documentation

DllExport Object* CreateNURBSObject ( IObjParam ip,
NURBSSet nset,
Matrix3 mat 
)
friend
DllExport int AddNURBSObjects ( Object MAXobj,
IObjParam ip,
NURBSSet nset 
)
friend
DllExport BOOL GetNURBSSet ( Object object,
TimeValue  t,
NURBSSet nset,
BOOL  Relational 
)
friend

Member Data Documentation

TessApprox* mpVTess
protected
TessApprox* mpRTess
protected
TessApprox* mpRTessDisp
protected
TessApprox* mpVTessCurve
protected
TessApprox* mpRTessCurve
protected
float mTessMerge
protected
Tab<NURBSObject*> mObjects
protected
Object* mpObject
protected
NURBSDisplay mDisplay
protected
Tab<NURBSFuseSurfaceCV> mSurfFuse
Tab<NURBSFuseCurveCV> mCurveFuse