Public Member Functions | Protected Member Functions

ClassDesc2 Class Reference

This reference page is linked to from the following overview topics: Lesson 1: Sample utility plug-in, Lesson 5: Geometric Objects, Lesson 6: Parameter Blocks, Lesson 7: Writing .Net Plug-ins, SDK Change Details, General Best Practices, Creating a Parameter Block, Parameter Block UI Specification Arguments, Multiple Parameter Blocks, ParamMap2 Buttons, Required DLL Functions, Class Descriptors, Creating and Destroying Plug-in Instances, Creating Parameter Blocks.


Search for all occurrences

Detailed Description

See also:
Class ClassDesc, Class Animatable, Class ParamBlockDesc2, Class IParamMap2, Class IObjParam, Class ParamMap2UserDlgProc, Class IAutoMParamDlg.

Description:
A subclass of ClassDesc which you specialize to provide a class descriptor for plug-in classes that will use the ParamBlock2 system. It contains a table of ParamBlockDesc2s for all the parameter blocks used in the plug-in and a number of sets of methods including access to the block descriptors, auto user interface management, auto param block2 construction, and access to any automatically-maintained ParamMap2s.

#include <iparamb2.h>

Inheritance diagram for ClassDesc2:
Inheritance graph
[legend]

List of all members.

Public Member Functions

PB2Export  ClassDesc2 ()
PB2Export  ~ClassDesc2 ()
PB2Export void  ResetClassParams (BOOL fileReset)
PB2Export int  NumParamBlockDescs ()
PB2Export ParamBlockDesc2 GetParamBlockDesc (int i)
PB2Export ParamBlockDesc2 GetParamBlockDescByID (BlockID id)
PB2Export ParamBlockDesc2 GetParamBlockDescByName (MCHAR *name)
PB2Export void  AddParamBlockDesc (ParamBlockDesc2 *pbd)
PB2Export void  ClearParamBlockDescs ()
PB2Export void  BeginEditParams (IObjParam *ip, ReferenceMaker *obj, ULONG flags, Animatable *prev)
PB2Export void  EndEditParams (IObjParam *ip, ReferenceMaker *obj, ULONG flags, Animatable *prev)
PB2Export void  InvalidateUI ()
PB2Export void  InvalidateUI (ParamBlockDesc2 *pbd)
PB2Export void  InvalidateUI (ParamBlockDesc2 *pbd, ParamID id, int tabIndex=-1)
PB2Export void  MakeAutoParamBlocks (ReferenceMaker *owner)
PB2Export int  NumParamMaps ()
PB2Export IParamMap2 GetParamMap (int i)
PB2Export IParamMap2 GetParamMap (ParamBlockDesc2 *pbd, MapID map_id=0)
PB2Export void  SetUserDlgProc (ParamBlockDesc2 *pbd, MapID map_id, ParamMap2UserDlgProc *proc=NULL)
void  SetUserDlgProc (ParamBlockDesc2 *pbd, ParamMap2UserDlgProc *proc=NULL)
PB2Export ParamMap2UserDlgProc GetUserDlgProc (ParamBlockDesc2 *pbd, MapID map_id=0)
PB2Export IAutoMParamDlg CreateParamDlgs (HWND hwMtlEdit, IMtlParams *imp, ReferenceTarget *obj)
PB2Export IAutoMParamDlg CreateParamDlg (BlockID id, HWND hwMtlEdit, IMtlParams *imp, ReferenceTarget *obj, MapID mapID=0)
PB2Export IAutoEParamDlg CreateParamDialogs (IRendParams *ip, SpecialFX *obj)
PB2Export IAutoEParamDlg CreateParamDialog (BlockID id, IRendParams *ip, SpecialFX *obj, MapID mapID=0)
PB2Export void  MasterDlgDeleted (IAutoMParamDlg *dlg)
PB2Export void  MasterDlgDeleted (IAutoEParamDlg *dlg)
PB2Export IAutoMParamDlg GetMParamDlg ()
PB2Export IAutoEParamDlg GetEParamDlg ()
PB2Export void  RestoreRolloutState ()
PB2Export ParamID  LastNotifyParamID (ReferenceMaker *owner, IParamBlock2 *&pb)
PB2Export void  Reset (ReferenceMaker *owner, BOOL updateUI=TRUE, BOOL callSetHandlers=TRUE)
PB2Export void  GetValidity (ReferenceMaker *owner, TimeValue t, Interval &valid)
PB2Export void  RemoveParamBlockDesc (ParamBlockDesc2 *pbd)

Protected Member Functions

void  SetMParamDlg (IAutoMParamDlg *dlg)
  Sets the root level material ParamDlg.
void  SetEParamDlg (IAutoEParamDlg *dlg)
  Sets the root level effect ParamDlg.
Tab< IParamMap2 * > &  GetParamMaps ()

Constructor & Destructor Documentation

PB2Export ClassDesc2 ( )
Remarks:
Constructor. The master ParamDlg and Effect ParamDlg pointers are set to NULL.
PB2Export ~ClassDesc2 ( )
Remarks:
Destructor.

Member Function Documentation

void SetMParamDlg ( IAutoMParamDlg dlg ) [inline, protected]

Sets the root level material ParamDlg.

This method may be called by derived classes that want to handle the material ParamDlg creation themselves, instead of using one of the "paramdlg" creation methods of class ClassDesc2.

Parameters:
[in] dlg - The new master Material dialog pointer
{ masterMDlg = dlg; }
void SetEParamDlg ( IAutoEParamDlg dlg ) [inline, protected]

Sets the root level effect ParamDlg.

/*! This method may be called by derived classes that want to handle the effect ParamDlg creation themselves, instead of using one of the "paramdlg" creation methods of class ClassDesc2.

Parameters:
[in] dlg - The new master effect dialog pointer
{ masterEDlg = dlg; }
Tab<IParamMap2*>& GetParamMaps ( ) [inline, protected]
Remarks:
Allows access to the parameter maps currently posted to the UI.
Returns:
A Tab containing any current parameter maps
{ return paramMaps; }
PB2Export void ResetClassParams ( BOOL  fileReset ) [virtual]
Remarks:
This method may be called to restore all sticky parameters to their default values.
Parameters:
fileReset This parameter is not used.

Reimplemented from ClassDesc.

Reimplemented in MSPluginDesc.

PB2Export int NumParamBlockDescs ( ) [inline, virtual]
Remarks:
Implemented by the System.

This is a method of the base class ClassDesc. This class provides an implementation of the method used by plug-ins using the ParamBlock2 system.

Returns the number of parameter block2 descriptors used by this plug-in class.

Reimplemented from ClassDesc.

{ return pbDescs.Count(); }
PB2Export ParamBlockDesc2* GetParamBlockDesc ( int  i ) [inline, virtual]
Remarks:
Implemented by the System.

This is a method of the base class ClassDesc. This class provides an implementation of the method used by plug-ins using the ParamBlock2 system.

Returns a pointer to the 'i-th' parameter block2 descriptor.
Parameters:
i The zero based index of the parameter block2 descriptor to return.

Reimplemented from ClassDesc.

{ return pbDescs[i]; }
PB2Export ParamBlockDesc2* GetParamBlockDescByID ( BlockID  id ) [virtual]
Remarks:
Implemented by the System.

This is a method of the base class ClassDesc. This class provides an implementation of the method used by plug-ins using the ParamBlock2 system.

Returns a pointer to the parameter block2 descriptor as specified by its BlockID.

Note: typedef short BlockID;
Parameters:
id The permanent ID for the parameter block.

Reimplemented from ClassDesc.

PB2Export ParamBlockDesc2* GetParamBlockDescByName ( MCHAR *  name )
Remarks:
Returns a pointer to the parameter block2 descriptor as specified by the descriptor's internal name.
Parameters:
name The internal name of the parameter block descriptor.
PB2Export void AddParamBlockDesc ( ParamBlockDesc2 pbd ) [virtual]
Remarks:
Implemented by the System.

This is a method of the base class ClassDesc. This class provides an implementation of the method used by plug-ins using the ParamBlock2 system.

Adds a parameter block2 to the list of those maintained by this class descriptor.
Parameters:
pbd Points to the parameter block2 descriptor of the parameter block2 to add.

Reimplemented from ClassDesc.

PB2Export void ClearParamBlockDescs ( ) [inline]
Remarks:
Implemented by the System.

Removes all the parameter block 2 descriptors maintained by this plug-in.
{ pbDescs.ZeroCount(); }
PB2Export void BeginEditParams ( IObjParam ip,
ReferenceMaker obj,
ULONG  flags,
Animatable prev 
) [virtual]
Remarks:
Implemented by the System.

This is a method of the base class ClassDesc. This class provides an implementation of the method used by plug-ins using the ParamBlock2 system.

This method is called to handle the beginning of the automatic command panel user interface management provided by the param map 2 system. This method is called by the plug-in from its Animatable::BeginEditParams() method. The parameters passed to that method are simply passed along to this method.
Parameters:
ip The interface pointer passed to the plug-in.
obj Points to the plug-in class calling this method.
flags The flags passed along to the plug-in in Animatable::BeginEditParams().
prev The pointer passed to the plug-in in Animatable::BeginEditParams().

Reimplemented from ClassDesc.

PB2Export void EndEditParams ( IObjParam ip,
ReferenceMaker obj,
ULONG  flags,
Animatable prev 
) [virtual]
Remarks:
Implemented by the System.

This is a method of the base class ClassDesc. This class provides an implementation of the method used by plug-ins using the ParamBlock2 system.

This method is called to handle the ending of the automatic command panel user interface management provided by the param map 2 system. This method is called by the plug-in from its Animatable::EndEditParams() method. The parameters passed to that method are simply passed along to this method.
Parameters:
ip The interface pointer passed to the plug-in.
obj Points to the plug-in class calling this method.
flags The flags passed along to the plug-in in Animatable::EndEditParams().
prev The pointer passed to the plug-in in Animatable::EndEditParams().

Reimplemented from ClassDesc.

PB2Export void InvalidateUI ( )
Remarks:
Implemented by the System.

This invalidates the entire UI for every parameter map of the plug-in.
PB2Export void InvalidateUI ( ParamBlockDesc2 pbd ) [virtual]
Remarks:
Implemented by the System.

This is a method of the base class ClassDesc. This class provides an implementation of the method used by plug-ins using the ParamBlock2 system.

This is called if the user interface parameters needs to be updated. This invalidates the entire UI managed by the param map whose description is passed.
Parameters:
pbd Points to the parameter block descriptor for the rollup.

Reimplemented from ClassDesc.

PB2Export void InvalidateUI ( ParamBlockDesc2 pbd,
ParamID  id,
int  tabIndex = -1 
)
Remarks:
Implemented by the System.

This is called if a certain user interface parameter of the specified parameter map needs to be updated. The parameter ID of the control is passed. If the parameter is a Tab<> then the index into the table of the parameter is passed.
Parameters:
pbd Points to the parameter block descriptor for the rollup.
id The permanent parameter ID of the parameter.
tabIndex If the parameter is a Tab<> then this is the zero based index into the table. The default value of -1 indicates it is not a table.
PB2Export void MakeAutoParamBlocks ( ReferenceMaker owner ) [virtual]
Remarks:
Implemented by the System.

This is a method of the base class ClassDesc. This class provides an implementation of the method used by plug-ins using the ParamBlock2 system.

This method is called to create the parameter blocks for the plug-in.
Parameters:
owner Points to the plug-in class calling this method.

Reimplemented from ClassDesc.

PB2Export int NumParamMaps ( ) [inline, virtual]
Remarks:
Implemented by the System.

This is a method of the base class ClassDesc. This class provides an implementation of the method used by plug-ins using the ParamBlock2 system.

Returns the number of automatically-maintained parameter map2s.

Reimplemented from ClassDesc.

{ return paramMaps.Count(); }
PB2Export IParamMap2* GetParamMap ( int  i ) [inline, virtual]
Remarks:
Implemented by the System.

This is a method of the base class ClassDesc. This class provides an implementation of the method used by plug-ins using the ParamBlock2 system.

Parameters:
i Points to the parameter block descriptor2 associated with this parameter map.
Returns:
A pointer to the parameter map2 as specified by the parameter block2 pointer passed.

Reimplemented from ClassDesc.

{ return paramMaps[i]; }
PB2Export IParamMap2* GetParamMap ( ParamBlockDesc2 pbd,
MapID  map_id = 0 
)
Remarks:
Implemented by the System.

This is a method of the base class ClassDesc. This class provides an implementation of the method used by plug-ins using the ParamBlock2 system.

Returns a pointer to the parameter map2 as specified by the parameter block2 pointer passed.
Parameters:
pbd Points to the parameter block descriptor2 associated with this parameter map.
map_id This parameter specifies the ID of the map/rollout to get.
PB2Export void SetUserDlgProc ( ParamBlockDesc2 pbd,
MapID  map_id,
ParamMap2UserDlgProc proc = NULL 
)
Remarks:
This overload of SetUserDlgProc() has a new parameter, map_id, that specifies the ID of the parameter map/rollup to set the user dialog proc for. See original function for the rest of the description.
void SetUserDlgProc ( ParamBlockDesc2 pbd,
ParamMap2UserDlgProc proc = NULL 
) [inline, virtual]
Remarks:
Implemented by the System.

This is a method of the base class ClassDesc. This class provides an implementation of the method used by plug-ins using the ParamBlock2 system.

This method allows the developer to provide special handling for controls not processed automatically by the parameter map (or those that need additional processing). The developer provides a dialog proc to process the messages from the controls. This method is used to tell the parameter map that the developer defined method should be called. The given proc will be called after default processing is done.

Note, in version 4.0 and later, this actually maps to a call on the explicit map ID overload of SetUserDlgProc() with default map ID of 0.
Parameters:
pbd Points to the parameter block descriptor for the parameter map.
proc Points to the class derived from ParamMap2UserDlgProc which handles the controls.

Reimplemented from ClassDesc.

{ SetUserDlgProc(pbd, 0, proc); }
PB2Export ParamMap2UserDlgProc* GetUserDlgProc ( ParamBlockDesc2 pbd,
MapID  map_id = 0 
)
Remarks:
Implemented by the System.

This is a method of the base class ClassDesc. This class provides an implementation of the method used by plug-ins using the ParamBlock2 system.

Returns a pointer to the user dialog proc associated with the parameter map as specified by the parameter block descriptor2 pointer.
Parameters:
pbd Points to the parameter block descriptor for the parameter map.
map_id Specifies the ID of the map/rollout to get the user dialog proc for.
PB2Export IAutoMParamDlg* CreateParamDlgs ( HWND  hwMtlEdit,
IMtlParams imp,
ReferenceTarget obj 
)
Remarks:
Implemented by the System.

This method creates and returns a pointer to the object which handles the automatic processing of the user interface in the materials editor. This method loops over all parameter blocks which specify AUTO_UI and makes the AutoMParamDlgs for them. The first one becomes the master and the others are added to it.
Parameters:
hwMtlEdit The window handle of the materials editor.
imp The interface pointer provided for calling methods in 3ds Max.
obj Points to the plug-in class calling this method.
PB2Export IAutoMParamDlg* CreateParamDlg ( BlockID  id,
HWND  hwMtlEdit,
IMtlParams imp,
ReferenceTarget obj,
MapID  mapID = 0 
)
Remarks:
Implemented by the System.

This method creates and returns a pointer to the object which handles the automatic processing of the user interface in the materials editor. This method makes an AutoMParamDlg for the specified parameter block.
Parameters:
id The permanent ID of the parameter block.
hwMtlEdit The window handle of the materials editor.
imp The interface pointer provided for calling methods in 3ds Max.
obj Points to the plug-in class calling this method.
mapID Specifies the ID of the map/rollout in the parameter block to create AutoMParamDlg for.
PB2Export IAutoEParamDlg* CreateParamDialogs ( IRendParams ip,
SpecialFX obj 
)
Remarks:
Implemented by the System.

This method creates and returns a pointer to the object which handles the automatic processing of the user interface in the rendering effects dialog. This method loops over all parameter blocks which specify AUTO_UI and makes the AutoMParamDlgs for them. The first one becomes the master and the others are added to it.
Parameters:
ip The interface pointer provided for calling methods in 3ds Max.
obj Points to the plug-in class calling this method. See Class SpecialFX.
PB2Export IAutoEParamDlg* CreateParamDialog ( BlockID  id,
IRendParams ip,
SpecialFX obj,
MapID  mapID = 0 
)
Remarks:
Implemented by the System.

This method creates and returns a pointer to the object which handles the automatic processing of the user interface in the rendering effects dialog. This method makes an AutoEParamDlg for the specified parameter block.
Parameters:
id The permanent ID of the parameter block.
ip The interface pointer provided for calling methods in 3ds Max.
obj Points to the plug-in class calling this method. See Class SpecialFX.
mapID Specifies the ID of the map/rollout in the parameter block to create AutoEParamDlg for.
PB2Export void MasterDlgDeleted ( IAutoMParamDlg dlg )
Remarks:
Implemented by the System.

This method is called when an AutoMParamDlg is deleted.
Parameters:
dlg Pointer to the object which handles the automatic processing of the user interface in the materials editor.
PB2Export void MasterDlgDeleted ( IAutoEParamDlg dlg )
Remarks:
Implemented by the System.

This method is called when an AutoEParamDlg is deleted.
Parameters:
dlg Pointer to the object which handles the automatic processing of the user interface in the rendering effects dialog.
PB2Export IAutoMParamDlg* GetMParamDlg ( ) [inline]
Remarks:
Implemented by the System.

Returns the master dialog processing routine for the materials editor plug-in.
{ return masterMDlg; }
PB2Export IAutoEParamDlg* GetEParamDlg ( ) [inline]
Remarks:
Implemented by the System.

Returns the master dialog processing routine for the rendering effects plug-in.
{ return masterEDlg; }
PB2Export void RestoreRolloutState ( )
Remarks:
This method may be called to restore any saved rollout state (open/closed condition and scrolling position) for any parameter map maintained by the plug-in.
PB2Export ParamID LastNotifyParamID ( ReferenceMaker owner,
IParamBlock2 *&  pb 
)
Remarks:
This method scans all the parameter blocks in the owner and returns the ParamID and parameter block making the most recent change notification.
Parameters:
owner The owner of the parameter blocks.
pb The parameter block which made the most recent notification.
Returns:
The parameter ID of the parameter which made the most recent notification.
PB2Export void Reset ( ReferenceMaker owner,
BOOL  updateUI = TRUE,
BOOL  callSetHandlers = TRUE 
)
Remarks:
This method may be called to reset all the parameters of all known parameter blocks to their default values and optionally update the user interface.
Parameters:
owner The owner of this ClassDesc2.
updateUI If TRUE to user interface is updated. If FALSE it's not.
callSetHandlers TRUE to call PBAccessor::Set() for all the parameters; otherwise FALSE.
PB2Export void GetValidity ( ReferenceMaker owner,
TimeValue  t,
Interval valid 
)
Remarks:
This method updates the validity interval passed with the cumulative validity interval of all the owner's parameter blocks.
Parameters:
owner The owner of this ClassDesc2.
t The time about which to compute the interval.
valid The interval to update.
PB2Export void RemoveParamBlockDesc ( ParamBlockDesc2 pbd )
Remarks:
Implemented by the System.

Removes a parameter block descriptor from the list of those maintained by this class descriptor, but does not delete it. This method would typically be used when a ParamBlockDesc2 is dynamically created and its life cycle is controlled by the plugin. You would then be able to remove the parameter block descriptor from the class descriptor when no instances of the plug-in require it.
Parameters:
pbd A pointer to the parameter block descriptor to remove.

ClassDesc2 ClassDesc2 ClassDesc2 ClassDesc2 ClassDesc2 ClassDesc2 ClassDesc2 ClassDesc2 ClassDesc2 ClassDesc2
ClassDesc2 ClassDesc2 ClassDesc2 ClassDesc2 ClassDesc2 ClassDesc2 ClassDesc2 ClassDesc2 ClassDesc2 ClassDesc2