UnitScaleData Class Reference

#include <customgui_unitscale.h>

Inheritance diagram for UnitScaleData:

详细描述

Unit scale custom data type ( CUSTOMDATATYPE_UNITSCALE ) for UnitScaleCustomGui .

注意
Has to be created with Alloc() and destroyed with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

私有成员函数

  UnitScaleData ()
  ~UnitScaleData ()

Alloc/Free

static UnitScaleData Alloc ()
static void  Free ( UnitScaleData *&data)

Unit/Scale

Bool   SetUnitScale ( Float scale, DOCUMENT_UNIT unit)
Bool   GetUnitScale ( Float &scale, DOCUMENT_UNIT &unit) const

运算符

Bool   operator== (const UnitScaleData &b) const
Bool   operator!= (const UnitScaleData &b) const

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

◆  UnitScaleData()

UnitScaleData () private

◆  ~UnitScaleData()

~ UnitScaleData () private

成员函数文档编制

◆  Alloc()

static UnitScaleData * Alloc ( )
static

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

返回
The allocated unit scale data, or nullptr if the allocation failed.

◆  Free()

static void Free ( UnitScaleData *&  data )
static

Destructs unit scale data allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in,out] data The unit scale data to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  SetUnitScale()

Bool SetUnitScale ( Float   scale ,
DOCUMENT_UNIT   unit  
)

Sets the values for the unit scale data.

参数
[in] scale The unit scale.
[in] unit The unit.
返回
true if successful, otherwise false .

◆  GetUnitScale()

Bool GetUnitScale ( Float scale ,
DOCUMENT_UNIT unit  
) const

Gets the values of the unit scale data.

参数
[out] scale Assigned the unit scale.
[out] unit Assigned the unit.
返回
true if successful, otherwise false .

◆  operator==()

Bool operator== ( const UnitScaleData b ) const

Equality operator. Checks if the unit scale data are equal.

参数
[in] b A unit scale data.
返回
true if the unit scale data are equal, otherwise false .

◆  operator!=()

Bool operator!= ( const UnitScaleData b ) const

Inequality operator. Checks if the unit scale data are different.

参数
[in] b A unit scale data.
返回
true if the unit scale data are different, otherwise false .