Class ClassDirectory

3DS Max Plug-In SDK

Class ClassDirectory

See Also: Class DllDir, Class SubClassList, Class Class_ID, Class ClassDesc.

class ClassDirectory

Description:

This class is available in release 2.0 and later only.

It provides a table of SubClassList objects, one for each pluggable super class. Methods are provided for accessing specific sub class lists by specifying a super class ID, and retrieving the class descriptors or class entries of the classes in the lists.

All methods of this class are implemented by the system.

Methods:

Prototype:

int Count();

Remarks:

Returns the number of class lists in the class directory.

Prototype:

SubClassList* GetClassList(SClass_ID superClassID); 

Remarks:

Returns a pointer to the list of sub-classes derived from the specified super class ID.

Parameters:

SClass_ID superClassID

The super class ID whose list of sub-classes are to be returned.

Prototype:

ClassDesc* FindClass(SClass_ID superClassID, Class_ID subClassID);

Remarks:

Returns a pointer to the class descriptor for the class whose super class ID and class ID are passed.

Parameters:

SClass_ID superClassID

The super class ID which specifies which sub class list to search.

Class_ID subClassID

The class ID of the class to find.

Prototype:

ClassEntry *FindClassEntry(SClass_ID superClassID, Class_ID subClassID);

Remarks:

Returns a pointer to the class entry for the class whose super class ID and class ID are passed.

Parameters:

SClass_ID superClassID

The super class ID which specifies which sub class list to search.

Class_ID subClassID

The class ID of the class to find.

Prototype:

void AddSuperClass(SClass_ID superClassID);

Remarks:

This method is used internally only to add a new Super Class ID to the list maintained by this class.

Important Note: It is illegal to create your own Super Class of persistent objects in 3ds max. 3ds max will crash if a scene is saved and later loaded into a system that doesn't have a plug-in added Super Class. The problem is that 3ds max needs a stand-in class for each 'plug-able' Super Class and if a plug-in is loaded that requires (but doesn't have) a stand-in, an assertion is fired.

The only legal Super Classes that you can derive your plug-in from are listed List of Super Class IDs.

Prototype:

int AddClass(ClassDesc *cdesc, int dllNum, int index);

Remarks:

This method is used internally to add a class descriptor to the list maintained by this class.

Operators:

Prototype:

SubClassList& operator[](int i){ return(*cl[i]);}

Remarks:

Returns a reference to the 'i-th' sub class list.

Parameters:

int i

Specifies which sub class list to return a reference to. This value is between 0 and Count()-1.