Class NURBSObject

3DS Max Plug-In SDK

Class NURBSObject

See Also: Class NURBSSurface, Class NURBSControlVertex, Class NURBSPoint, Class NURBSCurve, Class NURBSSet, List of NURBSObjects Types.

class NURBSObject

Description:

This class is available in release 2.0 and later only.

This is the base class for many of the other classes in the NURBS API. It provides a common set of methods that each of them use. It has methods to get and set the name of the item, and methods to deal with error processing. To determine the type of object the derived class is use the method GetType().

All methods of this class are implemented by the system.

Data Members:

protected:

TCHAR mName[NURBS_NAME_SIZE];

The name of the NURBS object. The maximum length of this name including the terminating NULL is specified using the following #define: #define NURBS_NAME_SIZE 80

NURBSType mType;

The type of NURBS object this is. See List of NURBSObjects Types.

NURBSKind mKind;

The kind of NURBS object this is. See List of NURBSObjecct Kinds.

NURBSId mId;

This is the ID of the NURBS object used to specify the parent object in many of the dependent point, curves and surface classes. This ID is not persistant across sessions and should not be saved to a file. A NURBSId is defined as follows: typedef unsigned long NURBSId;

Object *mpObject;

When an object is instantiated in the 3ds max scene this pointer is filled in. For example, if you use the function CreateNURBSObject() and pass a NURBSSet, this data member is filled in to point to the actual editable NURBS object in 3ds max that this NURBSObject is a part of.

NURBSSet* mpNSet;

When an object is instantiated in the 3ds max scene this pointer is filled in. This points to the NURBSSet this object is a contained within.

BOOL mSelected;

TRUE if the object is selected; otherwise FALSE.

Methods:

protected:

Prototype:

void Clean(NURBSIdTab ids);

Remarks:

This method is available in release 3.0 and later only.

Sets the mId to 0 and mpObject pointer to NULL. This effectively breaks the relation between this NURBSObject and a NURBSSet.

Parameters:

NURBSIdTab ids

This parameter is not used.

public:

Prototype:

NURBSObject();

Remarks:

Constructor. The data members are initialized as follows:

 mName[0] = '\0';

 mId = 0;

 mpObject = NULL;

 mpNSet = NULL;

 mSelected = FALSE;

Prototype:

~NURBSObject();

Remarks:

Destructor.

Prototype:

void SetName(TCHAR *name);

Remarks:

Sets the name of the item to the specified string.

Parameters:

TCHAR *name

The name to set.

Prototype:

TCHAR *GetName();

Remarks:

Returns a pointer to the name of the item.

Prototype:

NURBSType GetType();

Remarks:

Returns the specific type of object this is. See List of NURBSObjects Types.

Prototype:

NURBSType GetKind();

Remarks:

Returns the specific kind of object this is. See List of NURBSObjects Kinds.

Prototype:

NURBSId GetId();

Remarks:

Returns the NURBSId of this NURBSObject. This ID is not persistant across sessions and should not be saved to a file.

Prototype:

void SetId(NURBSId id);

Remarks:

Sets the NURBSId of this NURBSObject.

Parameters:

NURBSId id

The ID to set.

Prototype:

int GetIndex();

Remarks:

Returns the index in the NURBSSet of this object or -1 if there isn't an associated NURBSSet.

Prototype:

void SetNSet(NURBSSet *nset);

Remarks:

Sets the pointer to the NURBSSet maintained by the object.

Parameters:

NURBSSet *nset

The pointer to set.

Prototype:

NURBSSet* GetNSet();

Remarks:

Returns a pointer to the NURBSSet maintained by this class.

Prototype:

void SetObject(Object *object);

Remarks:

Sets the pointer to the 3ds max editable NURBS object maintained by this object.

Parameters:

Object *object

The pointer to set.

Prototype:

Object* GetMAXObject();

Remarks:

Returns a pointer to the Object maintained by this class.

Prototype:

BOOL IsSelected();

Remarks:

Returns TRUE if the object is selected; otherwise FALSE.

Prototype:

void SetSelected(BOOL set);

Remarks:

Sets the object to selected or not.

Parameters:

BOOL set

TRUE to select the object; FALSE to de-select it.

Operators:

Prototype:

NURBSObject & operator=(const NURBSObject& pt);

Remarks:

Assignment operator.

Parameters:

const NURBSObject& pt

The NURBSObject to assign.