Class IParamMap

3DS Max Plug-In SDK

Class IParamMap

See Also:, Parameter Maps, Class ParamMapUserDlgProc, Class ParamUIDesc, Parameter Blocks, Class IParamArray, Class Interface.

Description:

This class provides methods to work with parameter maps. These are things like invalidating the parameter map so it gets redrawn, working with the parameter blocks associated with the parameter map, and establishing an optional dialog proc to handle controls not directly handled by the pmap. This section also documents several functions that are available for creating and destroying parameter maps but are not part of this class.

Note: The use of this class requires the explicit inclusion the IPARAMM.H header file.

The following functions are not part of this class but are available to create the parameter maps:

Prototype:

IParamMap *CreateCPParamMap(ParamUIDesc *desc,int count,IParamArray *pb,Interface *ip,HINSTANCE hInst,TCHAR *dlgTemplate,TCHAR *title,DWORD flags);

Remarks:

Creates a parameter map to handle the display of parameters in the command panel. This will add the rollup page to the command panel.

Parameters:

ParamUIDesc *desc

The array of ParamUIDescs, one element for each control to be managed.

int count

The number of items in the array above.

IParamArray *pb

Pointer to an instance of the class IParamArray. This is the pointer to the = 4) BSPSPopupOnMouseOver(event);;">virtual array of parameters.

Interface *ip

The interface pointer passed into the BeginEditParams() method.

HINSTANCE hInst

The DLL instance handle of the plug-in

TCHAR *dlgTemplate

Dialog template for the rollup page (created using the resource editor)

TCHAR *title

The title displayed in the rollup page title bar.

DWORD flags

A set of flags to control settings of the rollup page.

APPENDROLL_CLOSED

Starts the page in the rolled up state.

Return Value:

A pointer to the parameter map that is created.

Prototype:

IParamMap *ReplaceCPParamMap(HWND oldhw, ParamUIDesc *desc,int count, IParamArray *pb, Interface *ip, HINSTANCE hInst, TCHAR *dlgTemplate, TCHAR *title, DWORD flags);

Remarks:

This method is available in release 3.0 and later only.

This method allows one to switch rollups in the command panel. It creates the new parameter map and calls Interface:: ReplaceRollupPage().

Parameters:

HWND oldhw

The window handle of the old rollup.

ParamUIDesc *desc

The array of ParamUIDescs, one element for each control to be managed.

int count

The number of items in the array above.

IParamArray *pb

Pointer to an instance of the class IParamArray. This is the pointer to the virtual array of parameters.

Interface *ip

The interface pointer passed into the BeginEditParams() method.

HINSTANCE hInst

The DLL instance handle of the plug-in

TCHAR *dlgTemplate

Dialog template for the rollup page (created using the resource editor)

TCHAR *title

The title displayed in the rollup page title bar.

DWORD flags

A set of flags to control settings of the rollup page.

APPENDROLL_CLOSED

Starts the page in the rolled up state.

Return Value:

A pointer to the parameter map that is created.

Prototype:

void DestroyCPParamMap(IParamMap *m);

Remarks:

This function destroys a command panel parameter map. The rollup page from the command panel is removed and the parameter map is deleted.

Parameters:

IParamMap *m

A pointer to the parameter map to destroy.

Prototype:

BOOL CreateModalParamMap(ParamUIDesc *desc,int count,IParamArray *pb,TimeValue t,HINSTANCE hInst,TCHAR *dlgTemplate,HWND hParent,ParamMapUserDlgProc *proc=NULL);

Remarks:

This function creates a parameter map that will handle a parameter block in a modal dialog where time does not change and the viewport is not redrawn. Note that there is no need to destroy it. It executes the dialog and then destroys itself.

Parameters:

ParamUIDesc *desc

The array of ParamUIDescs, one element for each control to be managed.

int count

The number of items in the array above.

IParamArray *pb

Pointer to an instance of the class IParamArray. This is the pointer to the = 4) BSPSPopupOnMouseOver(event);;">virtual array of parameters.

TimeValue t

This is just the current time when the user is bringing up the dialog.

HINSTANCE hInst

The DLL instance handle of the plug-in

TCHAR *dlgTemplate

Dialog template for the dialog box.

HWND hParent

The parent window handle.

ParamMapUserDlgProc *proc=NULL

If there is some custom handling required by a particular control, the client can derive a class from ParamMapUserDlgProc and set it as the parameter map's user callback. See Class ParamMapUserDlgProc.

Return Value:

TRUE if the user selected OK; otherwise FALSE.

Prototype:

IParamMap *CreateRParamMap(ParamUIDesc *desc,int count,IParamArray *pb, IRendParams *ip, HINSTANCE hInst,TCHAR *dlgTemplate, TCHAR *title, DWORD flags);

Remarks:

This function creates a parameter map to handle the display of render parameters or atmospheric plug-in parameters.

Parameters:

ParamUIDesc *desc

The array of ParamUIDescs, one element for each control to be managed.

int count

The number of items in the array above.

IParamArray *pb

Pointer to an instance of the class IParamArray. This is the pointer to the array of parameters.

IRendParams *ip

The interface pointer passed into CreateParamDlg().

HINSTANCE hInst

The DLL instance handle of the plug-in

TCHAR *dlgTemplate

Dialog template for the rollup page (created using the resource editor)

TCHAR *title

The title displayed in the rollup page title bar.

DWORD flags

A flag to control the settings of the rollup page:

APPENDROLL_CLOSED

Starts the page in the rolled up state.

Return Value:

A pointer to the parameter map that is created.

Prototype:

void DestroyRParamMap(IParamMap *m);

Remarks:

This function destroys a parameter map created by CreateRParamMap(). The rollup page is removed and the parameter map is deleted.

Parameters:

IParamMap *m

A pointer to the parameter map to destroy.

Prototype:

IParamMap *CreateMParamMap(ParamUIDesc *desc, int count, IParamArray *pb, IMtlParams *ip, HINSTANCE hInst, TCHAR *dlgTemplate, TCHAR *title, DWORD flags);

Remarks:

This function is available in release 2.0 and later only.

This function creates a parameter map to handle the display of texture map or material parameters in the material editor.

Parameters:

ParamUIDesc *desc

The array of ParamUIDescs, one element for each control to be managed.

int count

The number of items in the array above.

IParamArray *pb

Pointer to an instance of the class IParamArray. This is the pointer to the array of parameters.

IMtlParams *ip

The interface pointer. See Class IMtlParams.

HINSTANCE hInst

The DLL instance handle of the plug-in

TCHAR *dlgTemplate

Dialog template for the rollup page (created using the resource editor)

TCHAR *title

The title displayed in the rollup page title bar.

DWORD flags

A flag to control the settings of the rollup page:

APPENDROLL_CLOSED

Starts the page in the rolled up state.

Return Value:

A pointer to the parameter map that is created.

Prototype:

void DestroyMParamMap(IParamMap *m);

Remarks:

This function is available in release 2.0 and later only.

This function destroys a parameter map created by CreateMParamMap(). The rollup page is removed and the parameter map is deleted.

Parameters:

IParamMap *m

A pointer to the parameter map to destroy.

Methods:

Prototype:

void Invalidate()

Remarks:

Implemented by the System.

Call this method to update (redraw) the user interface controls. This marks the UI controls as needing to be updated and the parameter map will take care of it.

Prototype:

void SetParamBlock(IParamArray *pb)

Remarks:

Implemented by the System.

This method swaps the existing parameter block with a new one and updates the user interface. Consider the following example to understand how this is used: If a user is in create mode, and has created a sphere object, and then goes to create another sphere, the user interface stays up. The parameter map that manages the UI is not deleted. When the user creates the second sphere, the parameter map needs to refer to the new sphere's parameter block (not the previous one any longer). This method is used to set the parameter map to point to the new parameter block.

Parameters:

IParamArray *pb

A pointer to the new parameter block.

Prototype:

void SetUserDlgProc(ParamMapUserDlgProc *proc=NULL)

Remarks:

Implemented by the System.

This method allows the developer to provide special handling for a control. The developer provides a dialog proc to process the message from the control. 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 that if the proc is non-NULL when the ParamMap is deleted its DeleteThis() method will be called.

Parameters:

ParamMapUserDlgProc *proc=NULL

A pointer to the user dialog proc class to process the control.

Prototype:

virtual void SetPBlockIndex(int mapIndex, int blockIndex)=0;

Remarks:

Implemented by the System.

This method changes a parameter map entry to refer to a different item in the parameter block. This is used for example by the Optimize modifier. This modifier has two sets of parameters that may be adjusted (L1 and L2). Optimize only maintains a single parameter block however. This pblock contains both sets of parameters. When the user switches between these two sets, this method is called to point the UI controls at different indices in the parameter block.

Parameters:

int mapIndex

The map entry to change.

int blockIndex

The new parameter block index.

Prototype:

HWND GetHWnd()

Remarks:

Implemented by the System.

Returns the window handle of the rollup page (or dialog).

Prototype:

IParamArray *GetParamBlock()

Remarks:

Implemented by the System.

Returns a pointer to the parameter block managed by the parameter map.