Class FlagUser

3DS Max Plug-In SDK

Class FlagUser

See Also: Class MNMesh.

 

Class FlagUser

Description:

This class is available in release 2.0 and later only.

This is a handy class to subclass off of when you're designing a class with flags. It contains one private data member, a DWORD, with the flag info. It then implements a bunch of handy flag-related functions. All methods of this class are implemented by the system.

Data Members:

private:

DWORD FlagUserFlags;

Stores the flags.

Methods:

Prototype:

FlagUser();

Remarks:

Constructor. Sets FlagUserFlags to 0, clearing all flag bits.

Prototype:

void SetFlag(DWORD fl, bool val=TRUE);

Remarks:

Sets flags. Each bit that is set in fl is assigned the value val.

Prototype:

void ClearFlag(DWORD fl);

Remarks:

Clears flags. Each bit that is set in fl is cleared.

Prototype:

bool GetFlag(DWORD fl) const;

Remarks:

Checks if flags are set.

Return Value:

TRUE if any of the bits set in fl are set in this FlagUser. FALSE if none of them are.

Prototype:

void ClearAllFlags();

Remarks:

Sets FlagUserFlags to 0, clearing all flag bits.

Prototype:

void CopyFlags(DWORD fl);

Remarks:

This method is available in release 2.0 and later only.

Copies all flag bits over from fl.

Prototype:

void CopyFlags(const FlagUser & fu);

Remarks:

Copies all flag bits over from fu.

Prototype:

void CopyFlags(const FlagUser * fu);

Remarks:

Copies all flag bits over from *fu.

Prototype:

void CopyFlags(DWORD fl, DWORD mask);

Remarks:

Copies from fl only those bits set in mask.

Prototype:

void CopyFlags(const FlagUser &fu, DWORD mask);

Remarks:

Copies from fu only those bits set in mask.

Prototype:

void CopyFlags(const FlagUser *fu, DWORD mask);

Remarks:

Copies from *fu only those bits set in mask.

Prototype:

void OrFlags(const FlagUser & fu);

Remarks:

Sets all flags that are set in fu.

Prototype:

void OrFlags(const FlagUser * fu);

Remarks:

Sets all flags that are set in *fu.

Prototype:

void AndFlags(const FlagUser & fu);

Remarks:

Clears all flags that are clear in fu.

Prototype:

void AndFlags(const FlagUser * fu);

Remarks:

Clears all flags that are clear in *fu.

Prototype:

bool FlagMatch(DWORD fmask, DWORD fl) const;

Remarks:

Checks whether all the bits that are set in fmask are the same in this FlagUser and in fl.

Prototype:

bool FlagMatch(DWORD fmask, const FlagUser & fu) const;

Remarks:

Checks whether all the bits that are set in fmask are the same in this FlagUser and in fu.

Prototype:

bool FlagMatch(DWORD fmask, const FlagUser * fu) const;

Remarks:

Checks whether all the bits that are set in fmask are the same in this FlagUser and in *fu.

Prototype:

DWORD ExportFlags() const;

Remarks:

Returns a DWORD equal to FlagUserFlags.

Prototype:

void ImportFlags(DWORD fl);

Remarks:

Sets FlagUserFlags equal to fl. Same as CopyFlags (fl), but it’s included for "linguistic completeness".