Class NURBSSet

3DS Max Plug-In SDK

Class NURBSSet

See Also: Class NURBSObject, Class NURBSDisplay, Class TessApprox, Class NURBSFuseSurfaceCV, Class NURBSFuseCurveCV, Template Class Tab.

class NURBSSet : public NURBSObject

Description:

This class is available in release 2.0 and later only.

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

public:

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.

Methods:

Prototype:

NURBSSet();

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;

Prototype:

~NURBSSet();

Remarks:

Destructor. Any tesselation objects are deleted.

Prototype:

void Clean();

Remarks:

This method is available in release 3.0 and later only.

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

Prototype:

int GetNumObjects();

Remarks:

Returns the number of objects in the set.

Prototype:

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.

Prototype:

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.

Prototype:

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.

Prototype:

void SetObject(int index, NURBSObject* obj);

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.

Prototype:

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.

Return Value:

Returns the number of objects in the table prior to appending.

Prototype:

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.

Prototype:

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.

Prototype:

TessApprox* GetProdTess(NURBSTessType type=kNTessSurface);

Remarks:

This method is available in release 3.0 and later only.

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 List of NURBSTessTypes.

Prototype:

TessApprox* GetViewTess(NURBSTessType type=kNTessSurface);

Remarks:

This method is available in release 3.0 and later only.

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 List of NURBSTessTypes.

Prototype:

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 List of NURBSTessTypes.

Prototype:

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 List of NURBSTessTypes.

Prototype:

void ClearViewTess(NURBSTessType type=kNTessSurface);

Remarks:

This method is available in release 3.0 and later only.

Clears (deletes) the specified tesselation object used for viewport rendering.

Parameters:

NURBSTessType type=kNTessSurface

The type of tesselation. See List of NURBSTessTypes.

Prototype:

void ClearProdTess(NURBSTessType type=kNTessSurface);

Remarks:

This method is available in release 3.0 and later only.

Clears (deletes) the specified tesselation object used for production rendering.

Parameters:

NURBSTessType type=kNTessSurface

The type of tesselation. See List of NURBSTessTypes.

Prototype:

void GetTessMerge();

Remarks:

Returns the tesselation merge value.

Prototype:

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.

Prototype:

Object* GetMAXObject();

Remarks:

This method is available in release 3.0 and later only.

Returns a pointer to the instantiated object in the scene associated with this NURBSSet. This is NULL if there isn't one.

Prototype:

NURBSDisplay GetDisplaySettings();

Remarks:

This method is available in release 2.5 and later only.

Returns the display settings for this NURBSSet.

Prototype:

void SetDisplaySettings(NURBSDisplay& disp);

Remarks:

This method is available in release 2.5 and later only.

Sets the display settings used by this NURBSSet.

Parameters:

NURBSDisplay& disp

The settings to use.