Class FPInterfaceDesc

3DS Max Plug-In SDK

Class FPInterfaceDesc

See Also: Class FPInterface, = 4) BSPSPopupOnMouseOver(event);;">Class ClassDesc, Class Interface_ID, Class FPEnum, Class FPFunctionDef, Class FPPropDef, Class ActionTable, Template Class Tab, Function Publishing System.

class FPInterfaceDesc : public FPInterface

Description:

This class is available in release 4.0 and later only.

This is the Function Publishing interface descriptor. This is usually a static instance of the implementation interface. The constructor for this class uses the same var-args technique used by the ParamBlockDesc2 constructor, enabling descriptive information for all the functions in the interface to be supplied in one constructor call.

 

The FPInterfaceDesc class, an FPInterface that contains the metadata for an interface, is a distinguished  singleton instance per interface kept in a Tab<> in ClassDesc. This class is subclassed typically by static and core interfaces and instantiated by mixins to provide their metadata.

Note the following typedef: typedef FPInterfaceDesc FPStaticInterface

Data Members:

public:

Interface_ID ID;

The unique ID of the interface.

TSTR internal_name;

The fixed internal name for the interface.

StringResID description;

The description string resource ID.

ClassDesc* cd;

Points to the publishing plug-in's ClassDesc.

USHORT flags;

The flag bits. One or more of the following values:

FP_ACTIONS

Marks this as an Action Interface, holding only UI modal, zero parameter action functions.

FP_MIXIN

Marks this as a Mixin Interface, it is implemented directly by the plug-in class, so the methods in it are virtual on the plugin's objects.

FP_CORE

Marks this as a 3ds max Core Interface, available through GetCOREInterface(Interface_ID).

FP_STATIC_METHODS

This interface is used as a static method interface in MAXScript, properties are not directly callable

FP_SCRIPTED_CLASS

Internal use only: Belongs to a scripted plug-in class.

FP_TEMPORARY

Internal use only: Temporary descriptor built during scene load.

Tab<FPFunctionDef*> functions;

A table of descriptors for individual functions in this interface.

Tab<FPPropDef*> props;

A Table of descriptors for individual properties in this interface.

Tab<FPEnum*> enumerations;

A table of any symbolic enums for the interface. This is a Tab<> of pointers to FPEnum class instances which themselves contain a Tab<> of name, code pairs.

The following data members are for scripted plug-ins if this interface belongs to a scripted plug-in class.

MSPluginClass* pc;

The scripted class if non-NULL (gc-protected by the scripted plugin class).

Rollout* rollout;

The rollout if specified (gc-protected by the scripted plugin class).

ActionTable* action_table;

The table published for this action interface.

For more information, see Class ActionTable.

Methods:

public:

Prototype:

FPInterfaceDesc();

Remarks:

Constructor. No initialization is performed.

Prototype:

FPInterfaceDesc(Interface_ID id, TCHAR* int_name, StringResID descr, ClassDesc* cd, ULONG flag, ...);

Remarks:

Constructor.

Parameters:

Interface_ID id

The unique ID of the interface.

TCHAR* int_name

The fixed internal name for the interface.

StringResID descr

A string resource ID containing the description for this interface class.

ClassDesc* cd

A pointer to a ClassDesc class descriptor of the publishing plug-in.

ULONG flag

The flag bits. One or more of the following values: FP_ACTIONS, FP_MIXIN, FP_CORE, FP_STATIC_METHODS, FP_SCRIPTED_CLASS, FP_TEMPORARY. For a description see the data members descriptions.

...

This constructor takes a variable number of arguments representing the ‘properties’ sections and function definitions. For more information see the advanced topics on Function Publishing.

Prototype:

virtual void Init();

Remarks:

This is a virtual method called by the varargs-based constructors for interface descriptors and static interfaces, so that they have an opportunity to do runtime initialization of any extra state data you add to these interfaces (usually to static interfaces). Since such interfaces are usually constructed with the built-in varargs constructor, there is no way to do custom initialization without a hook like the Init() call. Your static interface would provide an implementation of Init() to do any special initialization.

Default Implementation:

{ }

Prototype:

void LoadDescriptor(Interface_ID id, TCHAR* int_name, StringResID descr, ClassDesc* cd, ULONG flag, ...);

Remarks:

This method relates to Init(). In some cases, you really do need to provide your own constructor or set of constructors for a static interface or descriptor, but you still want to be able to load it with all the interface metadata that the built-in varargs constructor does. You can do this by calling the LoadDescriptor() method at any point in your own constructors and it takes the same arguments as the built-in varargs constructor.

Parameters:

Interface_ID id

The unique ID of the interface.

TCHAR* int_name

The fixed internal name for the interface.

StringResID descr

A string resource ID containing the description for this interface class.

ClassDesc* cd

A pointer to a ClassDesc class descriptor of the publishing plug-in.

ULONG flag

The flag bits. One or more of the following values: FP_ACTIONS, FP_MIXIN, FP_CORE, FP_STATIC_METHODS, FP_SCRIPTED_CLASS, FP_TEMPORARY. For a description see the data members descriptions.

...

This method takes a variable number of arguments representing the ‘properties’ sections and function definitions. For more information see the advanced topics on Function Publishing.

Construction Utilities

Prototype:

void SetClassDesc(ClassDesc* i_cd);

Remarks:

This method sets the ClassDesc pointer associated FPInterfaceDesc class. You can only call this method once on a descriptor and then only if it has been constructed initially with a NULL cd. See the notes in the constructor.

 

Parameters:

ClassDesc* i_cd

This points to the ClassDesc class descriptor to set.

Prototype:

va_list check_fn(va_list ap, int id);

Remarks:

This is used internally.

Prototype:

va_list scan_fn(va_list ap, int id, int index);

Remarks:

This is used internally.

Prototype:

va_list check_prop(va_list ap, int id);

Remarks:

This is used internally.

Prototype:

va_list scan_prop(va_list ap, int id, int index);

Remarks:

This is used internally.

Prototype:

va_list check_enum(va_list ap, EnumID id);

Remarks:

This is used internally.

Prototype:

va_list scan_enum(va_list ap, EnumID id, int index);

Remarks:

This is used internally.

Metadata Access

Prototype:

FPInterfaceDesc* GetDesc();

Remarks:

This method returns a pointer to the descriptor for this Function Publishing interface descriptor.

Default Implementation:

{ return this; }

Prototype:

FPFunctionDef* GetFnDef(FunctionID fid);

Remarks:

This method returns a pointer to the function definition of a specific function identified by its ID. Calls to this method, given an FPInterface*, can be made indirectly through FPInterface::GetDesc(). For example; FPFunctionDef* fd = fpi->GetDesc()->GetFnDef(foo_move);

Parameters:

FunctionID fid

The unique function ID used to identify the function.

Prototype:

ActionTable* GetActionTable();

Remarks:

This method returns a pointer to the action table.

Default Implementation:

{ return action_table; }

Global Actions

Prototype:

void EnableActions(BOOL onOff);

Remarks:

This method allows you to enable or disable the entire set of actions in the interface You might want to use this method if the actions are only to be active during certain periods in the running of 3ds max. Usually, this control is achieved via ActionTable contexts.

Parameters:

BOOL onOff;

TRUE to enable actions, FALSE to disable actions.

Overridable HInstance and resource access from owning module

Prototype:

virtual HINSTANCE HInstance();

Remarks:

This method will return a handle to the owning instance.

Prototype:

virtual TCHAR* GetRsrcString(StringResID id);

Remarks:

This method returns the string associated with a specified String Resource ID

Parameters:

StringResD id

The string resource ID for which you want to obtain the string.