Class AttachMatDlgUser
See Also: Class Object, Class Modifier.
class AttachMatDlgUser
Description:
This class is available in release 3.0 and later only.
This class provides a general way for objects to handle the attach materials dialog presented when users attach objects to each other. To use this class do the following:
1) Subclass your modifier or editable object off this class as shown below. Implement the four functions that give access to the attach/condense options.
2) Now your class simply calls the global DoAttachMatOptionDialog() function, which deals with the parameters uniformly for all users. The implementation in Edit Spline is like so:
class EditSplineMod : public Modifier, ..., AttachMatDlgUser {
. . .
static int attachMat;
static BOOL condenseMat;
. . .
// from AttachMatDlgUser
int GetAttachMat() { return attachMat; }
void SetAttachMat(int value) { attachMat = value; }
BOOL GetCondenseMat() { return condenseMat; }
void SetCondenseMat(BOOL sw) { condenseMat = sw; }
And the statics are defined as:
int EditSplineMod::condenseMat = FALSE;
int EditSplineMod::attachMat = ATTACHMAT_NEITHER;
Function:
BOOL DoAttachMatOptionDialog(IObjParam *ip, AttachMatDlgUser *user);
Remarks:
This global function is available in release 3.0 and later only.
This displays the dialog that you currently get in Edit(able) mesh when you attach objects to each other. It gives options for how to deal with combining materials, and whether or not to condense materials which have excess material slots.
Parameters:
IObjParam *ip
The interface pointer.
AttachMatDlgUser *user
Points to the AttachMatDlgUser object.
Return Value:
TRUE if the user OKed the dialog; FALSE if the user Cancelled.
Methods:
public:
Prototype:
virtual int GetAttachMat()=0;
Remarks:
Returns the attach material setting. One of the following values:
ATTACHMAT_IDTOMAT
Match material IDs to material.
ATTACHMAT_MATTOID
Match Material to Material IDs.
ATTACHMAT_NEITHER
Do not modifiy Material IDs or Material.
Prototype:
virtual void SetAttachMat(int value)=0;
Remarks:
Sets the attach material value.
Parameters:
int value
One of the following values:
ATTACHMAT_IDTOMAT
Match material IDs to material.
ATTACHMAT_MATTOID
Match Material to Material IDs.
ATTACHMAT_NEITHER
Do not modifiy Material IDs or Material.
Prototype:
virtual BOOL GetCondenseMat()=0;
Remarks:
Returns the condense material and IDs settings.
Prototype:
virtual void SetCondenseMat(BOOL sw)=0;
Remarks:
Sets the condense material and IDs setting.
Parameters:
BOOL sw
TRUE for on; FALSE for off.