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

#include <mxsPlugin.h>

+ Inheritance diagram for MSAutoMParamDlg:

Public Member Functions

 MSAutoMParamDlg (HWND hMedit, IMtlParams *i, ReferenceTarget *mtl, MSPlugin *plugin, Rollout *ro)
 
 ~MSAutoMParamDlg ()
 
Class_ID ClassID () override
 
ReferenceTargetGetThing () override
 
void SetThing (ReferenceTarget *m) override
 
void DeleteThis () override
 
void SetTime (TimeValue t) override
 
void ReloadDialog () override
 
void ActivateDlg (BOOL onOff) override
 
int FindSubTexFromHWND (HWND hw) override
 
int FindSubMtlFromHWND (HWND hw) override
 
void InvalidateUI () override
 
void MtlChanged () override
 
int NumDlgs () override
 
void AddDlg (ParamDlg *dlg) override
 
ParamDlgGetDlg (int i) override
 
void SetDlg (int i, ParamDlg *dlg) override
 
void DeleteDlg (ParamDlg *dlg) override
 
IParamMap2GetMap () override
 
virtual void InvalidateUI ()=0
 
virtual void MtlChanged ()=0
 
virtual int NumDlgs ()=0
 
virtual void AddDlg (ParamDlg *dlg)=0
 
virtual ParamDlgGetDlg (int i)=0
 
virtual void SetDlg (int i, ParamDlg *dlg)=0
 
virtual void DeleteDlg (ParamDlg *dlg)=0
 
virtual IParamMap2GetMap ()=0
 
- Public Member Functions inherited from ParamDlg
virtual Class_ID ClassID ()=0
 
virtual void SetThing (ReferenceTarget *m)=0
 
virtual ReferenceTargetGetThing ()=0
 
virtual void SetTime (TimeValue t)=0
 
virtual void ReloadDialog ()=0
 
virtual void DeleteThis ()=0
 
virtual void ActivateDlg (BOOL onOff)=0
 
virtual int FindSubTexFromHWND (HWND hwnd)
 
virtual int FindSubMtlFromHWND (HWND hwnd)
 
virtual INT_PTR Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor.
 
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Public Attributes

Tab< ParamDlg * > secondaryDlgs
 
ParamDlgdelegateDlg
 
MSPluginplugin
 
Rolloutro
 
ReferenceTargetmtl
 
IMtlParamsip
 
TexDADMgr texDadMgr
 
MtlDADMgr mtlDadMgr
 
HWND hwmedit
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ MSAutoMParamDlg()

MSAutoMParamDlg ( HWND  hMedit,
IMtlParams i,
ReferenceTarget mtl,
MSPlugin plugin,
Rollout ro 
)

◆ ~MSAutoMParamDlg()

Member Function Documentation

◆ ClassID()

Class_ID ClassID ( )
inlineoverridevirtual
Remarks
Returns the unique Class_ID of the plug-in this dialog manages. See Class Class_ID.

Implements ParamDlg.

2830{ return mtl->ClassID(); }
virtual CoreExport Class_ID ClassID()
Retrieves a constant that uniquely identifies the plugin class.
ReferenceTarget * mtl
Definition: mxsPlugin.h:2820

◆ GetThing()

ReferenceTarget * GetThing ( )
inlineoverridevirtual
Remarks
This method returns the current material or texture being edited.

Implements ParamDlg.

2831{ return mtl; }

◆ SetThing()

void SetThing ( ReferenceTarget m)
overridevirtual
Remarks
This sets the current material or texture being edited to the material or texture passed.
Parameters:
ReferenceTarget *m

The material or texture to set as current.

Implements ParamDlg.

◆ DeleteThis()

void DeleteThis ( )
overridevirtual
Remarks
This method is called by the system to delete an instance of this class. A developer must use the same memory manager to delete the item as they did to allocate it (in MtlBase::CreateParamDlg()). For example if a developer used the new operator to allocate the memory, this method would be implemented as { delete this; }

Implements ParamDlg.

◆ SetTime()

void SetTime ( TimeValue  t)
overridevirtual
Remarks
This method is called when the current time has changed. This gives the developer an opportunity to update any user interface data that may need adjusting due to the change in time.
Parameters:
TimeValue t

The new current time.

Implements ParamDlg.

◆ ReloadDialog()

void ReloadDialog ( )
overridevirtual
Remarks
This method should stuff values into all the parameter dialog's controls, edit fields etc. In fact this method is now only called after doing a "Reset". It is also useful inside the material/map when a NotifyRefChanged() is processed it may need to be called.

Implements ParamDlg.

◆ ActivateDlg()

void ActivateDlg ( BOOL  onOff)
overridevirtual
Remarks
This method is called when the dialog box becomes active or inactive. Currently this is used when working with color swatch custom controls. Color swatches need to know when the dialog box becomes active or inactive because they change their method of drawing themselves. When the dialog is active, color swatches are drawn in pure color (this requires a color register in the palette). When the dialog becomes inactive the color swatches are drawn using dithered painting. This is needed because there are only 8 available color registers.

A method of the color swatch control is called to indicate if it is in an active or inactive dialog. See the sample code below. Also see Class IColorSwatch.
Parameters:
BOOL onOff

TRUE if the dialog is active; otherwise FALSE.
Sample Code:
void NoiseDlg::ActivateDlg(BOOL onOff)
{
for (int i=0; i<NCOLS; i++)
cs[i]->Activate(onOff);
}

Implements ParamDlg.

◆ FindSubTexFromHWND()

int FindSubTexFromHWND ( HWND  hwnd)
overridevirtual
Remarks
This method needs to be implemented if the plug-in texmap is using a TexDADMgr. It should return the index of the sub-texmap corresponding to the window whose handle is passed. If the handle is not valid return -1.
Parameters:
HWND hwnd

The window handle to check.
Default Implementation:
{ return -1;}
Sample Code:
int CellTexParamDlg::FindSubTexFromHWND(HWND hw)
{
if (hw==GetDlgItem(pmap->GetHWnd(),IDC_CELLTEX_CELLCOLOR_MAP))
return 0;
if (hw==GetDlgItem(pmap->GetHWnd(),IDC_CELLTEX_DIVCOL1_MAP))
return 1;
if (hw==GetDlgItem(pmap->GetHWnd(),IDC_CELLTEX_DIVCOL2_MAP))
return 2;
return -1;
}

Reimplemented from ParamDlg.

◆ FindSubMtlFromHWND()

int FindSubMtlFromHWND ( HWND  hwnd)
overridevirtual
Remarks
This method needs to be implemented if the plug-in material is using a MtlDADMgr. It should return the index of the sub-map corresponding to the window whose handle is passed. If the handle is not valid return -1.
Parameters:
HWND hwnd

The window handle to check.
Default Implementation:
{ return -1;}

Reimplemented from ParamDlg.

◆ InvalidateUI()

void InvalidateUI ( )
inlineoverridevirtual
Remarks
This method causes the user interface controls to be re-drawn.

Implements IAutoMParamDlg.

2840{ ReloadDialog(); }
void ReloadDialog() override

◆ MtlChanged()

void MtlChanged ( )
inlineoverridevirtual
Remarks
This method may be called to causes the viewports to be redrawn. It should be called when any parameter that affects the look of the material in the viewport has been altered. If the material is not on a visible node in a shaded view, nothing will happen. This method should not be called as a spinner is being dragged, but only upon release of the mouse button.

Implements IAutoMParamDlg.

2841{ ip->MtlChanged(); }
virtual void MtlChanged()=0
IMtlParams * ip
Definition: mxsPlugin.h:2821

◆ NumDlgs()

int NumDlgs ( )
inlineoverridevirtual
Remarks
Returns the number of secondary dialogs.

Implements IAutoMParamDlg.

2843{ return secondaryDlgs.Count(); }
Tab< ParamDlg * > secondaryDlgs
Definition: mxsPlugin.h:2816
int Count() const
Retrieves the number of items in the Tab.
Definition: tab.h:219

◆ AddDlg()

void AddDlg ( ParamDlg dlg)
overridevirtual
Remarks
Adds the specified dialog as another secondary dialog.
Parameters:
ParamDlg* dlg

Points to the parameter dialog to add.

Implements IAutoMParamDlg.

◆ GetDlg()

ParamDlg * GetDlg ( int  i)
overridevirtual
Remarks
Returns a pointer to the 'i-th' secondary dialog.
Parameters:
int i

The zero-based index of the dialog to return.

Implements IAutoMParamDlg.

◆ SetDlg()

void SetDlg ( int  i,
ParamDlg dlg 
)
overridevirtual
Remarks
Sets the 'i-th' dialog to the one passed.
Parameters:
int i

The zero-based index of the dialog to set.

ParamDlg* dlg

Points to the parameter dialog to set.

Implements IAutoMParamDlg.

◆ DeleteDlg()

void DeleteDlg ( ParamDlg dlg)
overridevirtual
Remarks
This method is used for deleting secondary dialogs from a main IAutoMParamDlg. Use this along with AddDlg() if you are dynamically changing the set of rollups for the plugin, so that the P_AUTO_UI system can correctly manage all current secondary rollups.
Parameters:
ParamDlg* dlg

Points to the ParamDlg to delete.

Implements IAutoMParamDlg.

◆ GetMap()

IParamMap2 * GetMap ( )
inlineoverridevirtual
Remarks
Returns a pointer to the parameter map2 of this main dialog.

Implements IAutoMParamDlg.

2850{ return nullptr; }

Member Data Documentation

◆ secondaryDlgs

Tab<ParamDlg*> secondaryDlgs

◆ delegateDlg

ParamDlg* delegateDlg

◆ plugin

MSPlugin* plugin

◆ ro

Rollout* ro

◆ mtl

◆ ip

◆ texDadMgr

TexDADMgr texDadMgr

◆ mtlDadMgr

MtlDADMgr mtlDadMgr

◆ hwmedit

HWND hwmedit