SculptFlagChecker Class Reference 雕刻

| Library » Sculpt Brush

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

公共成员函数

Bool   Init ( UInt32 count)
void  清零 ()
UInt32   GetCount ()
void  Set ( UInt32 index)
Bool   CheckSet ( UInt32 index)
Bool   Check ( UInt32 index)
void  UnSet ( UInt32 index)

静态公共成员函数

static SculptFlagChecker Alloc ()
static void  Free ( SculptFlagChecker *&fc)

私有成员函数

  SculptFlagChecker ()
  ~SculptFlagChecker ()

构造函数 & 析构函数文档编制

◆  SculptFlagChecker()

SculptFlagChecker () private

◆  ~SculptFlagChecker()

~ SculptFlagChecker () private

成员函数文档编制

◆  Alloc()

static SculptFlagChecker * Alloc ( )
static

Allocates a SculptFlagChecker object. Destroy the allocated SculptFlagChecker object with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

返回
The allocated SculptFlagChecker object, or nullptr if the allocation failed.

◆  Free()

static void Free ( SculptFlagChecker *&  fc )
static

Destructs SculptFlagChecker objects allocated with Alloc() 。使用 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.

◆  Init()

Bool Init ( UInt32   count )

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.
返回
true if the memory could be allocated to store the required number of bits, otherwise false .

◆  Clear()

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.

◆  GetCount()

UInt32 GetCount ( )

Gets the number of states set in the Init() 方法。

返回
The value set from the Init() 方法。

◆  Set()

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()

◆  CheckSet()

Bool CheckSet ( UInt32   index )

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()
返回
true if the bit is true at the given index , otherwise false .

◆  Check()

Bool Check ( UInt32   index )

Checks the state of the bit at the given index .

参数
[in] index The index of the bit to check: <= index < GetCount()
返回
true if the bit is true at the given index , otherwise false .

◆  UnSet()

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()