#include <lib_sculptbrush.h>
A specialized class for sculpting that is optimized to store Boolean states.
Each Boolean state is represented by a single bit which reduces the memory requirements.
Public Member Functions | |
Bool | Init (UInt32 count) |
void | Clear () |
UInt32 | GetCount () |
void | Set (UInt32 index) |
Bool | CheckSet (UInt32 index) |
Bool | Check (UInt32 index) |
void | UnSet (UInt32 index) |
Static Public Member Functions | |
static SculptFlagChecker * | Alloc () |
static void | Free (SculptFlagChecker *&fc) |
Private Member Functions | |
SculptFlagChecker () | |
~SculptFlagChecker () | |
|
private |
|
private |
|
static |
Allocates a SculptFlagChecker object. Destroy the allocated SculptFlagChecker object with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
|
static |
Destructs SculptFlagChecker objects allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.
[in,out] | fc | The SculptFlagChecker object to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards. |
Initializes with the number of states to check. Data will be allocated so that each boolean state will only use a single bit for each state.
[in] | count | The number of states that need to be set. |
void Clear | ( | ) |
Clears the currently set states. This method is optimized for speed to only clear the memory for the bits that were actually set.
UInt32 GetCount | ( | ) |
void Set | ( | UInt32 | index | ) |
Sets the state of the bit to true at the given index.
[in] | index | The index of the bit to set: <= index < GetCount() |
Checks the state of the bit at the given index and also sets it to true if it was not previously set.
[in] | index | The index of the bit to check: <= index < GetCount() |
Checks the state of the bit at the given index.
[in] | index | The index of the bit to check: <= index < GetCount() |
void UnSet | ( | UInt32 | index | ) |
Clears the state of the bit at the given index.
[in] | index | The index of the bit to unset: <= index < GetCount() |