3ds Max C++ API Reference
Loading...
Searching...
No Matches
FPInterfaceDesc Class Reference

#include <ifnpub.h>

+ Inheritance diagram for FPInterfaceDesc:

Public Member Functions

CoreExport FPInterfaceDesc ()
 
CoreExport FPInterfaceDesc (Interface_ID id, const MCHAR *int_name, StringResID descr, ClassDesc *cd, ULONG flag,...)
 
CoreExport ~FPInterfaceDesc ()
 
virtual void Init ()
 
LifetimeType LifetimeControl ()
 
virtual BaseInterfaceGetInterface (Interface_ID id)
 
CoreExport void LoadDescriptor (Interface_ID id, const MCHAR *int_name, StringResID descr, ClassDesc *pCD, ULONG flag,...)
 
CoreExport void AppendFunction (int id,...)
 Add a new function to this interface descriptor.
 
CoreExport void AppendProperty (int id,...)
 Add a new property to this interface descriptor.
 
CoreExport void AppendEnum (int id,...)
 Add a new enum to this interface descriptor.
 
CoreExport void SetClassDesc (ClassDesc *i_cd)
 
CoreExport va_list check_fn (va_list ap, int id)
 
CoreExport va_list scan_fn (va_list ap, int id, int index)
 
CoreExport va_list check_prop (va_list ap, int id)
 
CoreExport va_list scan_prop (va_list ap, int id, int index)
 
CoreExport va_list check_enum (va_list ap, EnumID id)
 
CoreExport va_list scan_enum (va_list ap, EnumID id, int index)
 
FPInterfaceDescGetDesc ()
 
Interface_ID GetID ()
 
CoreExport FPFunctionDefGetFnDef (FunctionID fid)
 
ActionTableGetActionTable ()
 
CoreExport void EnableActions (BOOL onOff)
 
virtual CoreExport HINSTANCE HInstance ()
 
virtual CoreExport const MCHARGetRsrcString (StringResID id)
 
- Public Member Functions inherited from FPInterface
virtual BaseInterfaceGetInterface (Interface_ID id)
 
virtual FPInterfaceDescGetDesc ()=0
 
virtual CoreExport FPStatus Invoke (FunctionID fid, TimeValue t=0, FPParams *params=NULL)
 
virtual FPStatus Invoke (FunctionID fid, FPParams *params)
 
virtual CoreExport FPStatus Invoke (FunctionID fid, TimeValue t, FPValue &result, FPParams *params=NULL)
 
virtual FPStatus Invoke (FunctionID fid, FPValue &result, FPParams *params=NULL)
 
virtual CoreExport FunctionID FindFn (const MCHAR *name)
 
virtual CoreExport BOOL IsEnabled (FunctionID actionID)
 
virtual CoreExport BOOL IsChecked (FunctionID actionID)
 
virtual CoreExport BOOL IsVisible (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsEnabled (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsChecked (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsVisible (FunctionID actionID)
 
virtual ActionTableGetActionTable ()
 
virtual void EnableActions (BOOL onOff)
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor.
 
UtilExport BaseInterfaceGetInterface (Interface_ID id) override
 
virtual UtilExport Interface_ID GetID ()
 
virtual LifetimeType LifetimeControl ()
 
virtual bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
virtual void DeleteInterface ()
 
virtual BaseInterfaceCloneInterface (void *remapDir=nullptr)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor.
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Public Attributes

Interface_ID ID
 
MSTR internal_name
 
StringResID description
 
ClassDesccd
 
USHORT flags
 
Tab< FPFunctionDef * > functions
 
Tab< FPPropDef * > props
 
Tab< FPEnum * > enumerations
 
MSPluginClasspc
 
Rolloutrollout
 
ActionTableaction_table
 

Protected Member Functions

CoreExport void load_descriptor (Interface_ID id, const MCHAR *int_name, StringResID descr, ClassDesc *cd, USHORT flag, va_list ap)
 
- Protected Member Functions inherited from FPInterface
virtual FPStatus _dispatch_fn (FunctionID fid, TimeValue t, FPValue &result, FPParams *p)
 

Additional Inherited Members

- Public Types inherited from BaseInterface
enum  LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled }
 
- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 
- Static Public Attributes inherited from FPInterface
static CoreExport FPInterfaceDesc nullInterface
 

Detailed Description

See also
Class FPInterface, Class ClassDesc, Class Interface_ID, Class FPEnum, Class FPFunctionDef, Class FPPropDef, Class ActionTable, Template Class Tab, Function Publishing.

Description:
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:
Interface_ID ID;

The unique ID of the interface.

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

Constructor & Destructor Documentation

◆ FPInterfaceDesc() [1/2]

Remarks
Constructor. No initialization is performed.

◆ FPInterfaceDesc() [2/2]

CoreExport FPInterfaceDesc ( Interface_ID  id,
const MCHAR int_name,
StringResID  descr,
ClassDesc cd,
ULONG  flag,
  ... 
)
Remarks
Constructor.
Parameters:
Interface_ID id

The unique ID of the interface.

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

◆ ~FPInterfaceDesc()

Member Function Documentation

◆ load_descriptor()

CoreExport void load_descriptor ( Interface_ID  id,
const MCHAR int_name,
StringResID  descr,
ClassDesc cd,
USHORT  flag,
va_list  ap 
)
protected

◆ Init()

virtual void Init ( )
inlinevirtual
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:
{ }
381{ }

◆ LifetimeControl()

LifetimeType LifetimeControl ( )
inlinevirtual
Remarks
This method allows inquiries into the actual lifetime policy of a client and provide a server-controlled delete notify callback.
Returns
One of the following LifetimeTypes:

noRelease

Do not call release, use interface as long as you like. This is the default.

immediateRelease

The interface is only good for one call. The release is implied so a call to release is not required.

wantsRelease

The clients are controlling the lifetime, so the interface needs a Release() when the client has finished.

serverControlled

The server controls the lifetime and will use the InterfaceNotifyCallback to inform the code when it is gone.
Default Implementation:
{ return noRelease; }

Reimplemented from BaseInterface.

384{ return noRelease; }
@ noRelease
Definition: baseinterface.h:104

◆ GetInterface()

virtual BaseInterface * GetInterface ( Interface_ID  id)
inlinevirtual
Remarks
Returns a pointer to the interface whose ID is specified.
Parameters:
Interface_ID id

The ID of the interface to return.
Default Implementation:
{ return NULL; }

Reimplemented from FPInterface.

Reimplemented in UnifiedRenderer, and Interface.

387{ if (id == FPINTERFACEDESC_ID) return this; else return FPInterface::GetInterface(id); }
virtual BaseInterface * GetInterface(Interface_ID id)
Definition: ifnpub.h:142
#define FPINTERFACEDESC_ID
Definition: ifnpub.h:62

◆ LoadDescriptor()

CoreExport void LoadDescriptor ( Interface_ID  id,
const MCHAR int_name,
StringResID  descr,
ClassDesc pCD,
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.

MCHAR* int_name

The fixed internal name for the interface.

StringResID descr

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

ClassDesc* pCD

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.

◆ AppendFunction()

CoreExport void AppendFunction ( int  id,
  ... 
)

Add a new function to this interface descriptor.

Uses the same parameter syntax as LoadDescriptor and the Constructor. Note that it is mandatory to mark the end of the variable arguments list with end. Failure to do so will result in undefined behaviour.

◆ AppendProperty()

CoreExport void AppendProperty ( int  id,
  ... 
)

Add a new property to this interface descriptor.

Uses the same parameter syntax as LoadDescriptor and the Constructor. Note that it is mandatory to mark the end of the variable arguments list with end. Failure to do so will result in undefined behaviour.

◆ AppendEnum()

CoreExport void AppendEnum ( int  id,
  ... 
)

Add a new enum to this interface descriptor.

Uses the same parameter syntax as LoadDescriptor and the Constructor. Note that it is mandatory to mark the end of the variable arguments list with end. Failure to do so will result in undefined behaviour.

◆ SetClassDesc()

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

◆ check_fn()

CoreExport va_list check_fn ( va_list  ap,
int  id 
)
Remarks
This is used internally.

◆ scan_fn()

CoreExport va_list scan_fn ( va_list  ap,
int  id,
int  index 
)
Remarks
This is used internally.

◆ check_prop()

CoreExport va_list check_prop ( va_list  ap,
int  id 
)
Remarks
This is used internally.

◆ scan_prop()

CoreExport va_list scan_prop ( va_list  ap,
int  id,
int  index 
)
Remarks
This is used internally.

◆ check_enum()

CoreExport va_list check_enum ( va_list  ap,
EnumID  id 
)
Remarks
This is used internally.

◆ scan_enum()

CoreExport va_list scan_enum ( va_list  ap,
EnumID  id,
int  index 
)
Remarks
This is used internally.

◆ GetDesc()

FPInterfaceDesc * GetDesc ( )
inlinevirtual
Remarks
This method returns a pointer to the descriptor for this Function Publishing interface descriptor.
Default Implementation:
{ return this; }

Implements FPInterface.

472{ return this; }

◆ GetID()

Interface_ID GetID ( )
inlinevirtual
Remarks
This method returns the unique interface ID.

Reimplemented from BaseInterface.

473{ return ID; }
Interface_ID ID
Definition: ifnpub.h:331

◆ GetFnDef()

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

◆ GetActionTable()

ActionTable * GetActionTable ( )
inlinevirtual
Remarks
This method returns a pointer to the action table.
Default Implementation:
{ return action_table; }

Reimplemented from FPInterface.

488{ return action_table; }
ActionTable * action_table
Definition: ifnpub.h:343

◆ EnableActions()

CoreExport void EnableActions ( BOOL  onOff)
virtual
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.

Reimplemented from FPInterface.

◆ HInstance()

virtual CoreExport HINSTANCE HInstance ( )
virtual
Remarks
This method will return a handle to the owning instance.

Reimplemented in MSPluginDesc, and UnifiedRenderer.

◆ GetRsrcString()

virtual CoreExport const MCHAR * GetRsrcString ( StringResID  id)
virtual
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.

Reimplemented in MSPluginDesc.

Member Data Documentation

◆ ID

◆ internal_name

MSTR internal_name

◆ description

StringResID description

◆ cd

ClassDesc* cd

◆ flags

USHORT flags

◆ functions

Tab<FPFunctionDef*> functions

◆ props

Tab<FPPropDef*> props

◆ enumerations

Tab<FPEnum*> enumerations

◆ pc

◆ rollout

Rollout* rollout

◆ action_table

ActionTable* action_table