Class GenSubObjType

3DS Max Plug-In SDK

Class GenSubObjType

See Also: Class ISubObjType, Class BaseObject, Class MaxIcon.

class GenSubObjType : public ISubObjType

Description:

This class is available in release 4.0 and later only.

This class provides a generic implementation for sub-object types. Instead of having to create a sub-class of ISubObjType the constructors of this class may be used to initialize private data members of the class. Then implementations of the GetName() and GetIcon() methods of ISubObjType are provided which simply return the data members.

This SubObjectType will either use the subObjectIcons_16i.bmp and SubObjectIcons_16a.bmp bitmaps in the UI\ICONS directory (for the GenSubObjType(int idx) constructor), or any other bmp file that is specified in the GenSubObjType(TCHAR *nm, TCHAR* pFilePrefix, int idx) constructor. The bitmap files have to reside in the UI\ICONS directory.

All methods of this class are implemented by the System.

Methods:

public:

Prototype:

GenSubObjType(TCHAR *nm, TCHAR* pFilePrefix, int idx) : name(nm), mIcon(NULL), mIdx(idx), mFilePrefix(pFilePrefix);

Remarks:

Constructor. The private data members are inialized to the values passed and the corresponding Get methods of this class will return these data members.

Parameters:

TCHAR *nm

The name for this sub-object type.

TCHAR* pFilePrefix

The BMP imagelist file name prefix for this sub-object type. This is the file name, without the extension, and with the assumption that the file is in the ui\icons directory. For example specifying _T("SubObjectIcons") for this parameter indicates the file UI\ICONS\SubObjectIcons_16i.bmp if the small icons are in use and SubObjectIcons_24i.bmp if the large icons are in use.

int idx

This is the one based index into the image list of the icon to use.

Prototype:

GenSubObjType(int idx) : mIcon(NULL), mIdx(idx), mFilePrefix(_T("SubObjectIcons"));

Remarks:

This constructor assumes that the icons are in either UI\ICONS\SubObjectIcons_16i.bmp or SubObjectIcons_24i.bmp depending on which size icons are in use by the system. In this case only the index into the image list is required.

Parameters:

int idx

This is the one based index into the image list of the icon to use.

Prototype:

~GenSubObjType();

Remarks:

Destructor.

Prototype:

void SetName(TCHAR *nm);

Remarks:

Sets the name for this sub-object type.

Parameters:

TCHAR *nm

The name to set.

Prototype:

TCHAR *GetName();

Remarks:

Returns the name for this sub-object type. This is the implementation of the ISubObjType method.

Prototype:

MaxIcon *GetIcon();

Remarks:

Returns the icon for this sub-object type. This is the implementation of the ISubObjType method.