RangeData Class Reference

#include <customgui_range.h>

Inheritance diagram for RangeData:

详细描述

Range data type ( CUSTOMDATATYPE_RANGE ) for RangeCustomGui .

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

Private Constructor/Destructor

  RangeData ()
  ~RangeData ()

Alloc/Free

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

Init

Bool   Init ( Int rangeNumber)

重置

void  重置 ( Bool invalidateObject=false)

拷贝

void  CopyTo ( RangeData *dst)

Bool   AddValue ( Float value)
Float   GetCurrentValue () const
void  SetCurrentValue ( Float value)

Knots

Int   GetKnotsCount () const
Bool   SetKnotValue ( Int knotIndex, Float value)
Float   GetKnotValue ( Int knotIndex) const
Int   GetKnotIndexByValue ( Float value) const
void  DeleteKnot ( Int knotIndex)
Int   GetSelectedKnot () const
void  SetSelectedKnot ( Int knotIndex)

Range

Int   GetRangesCount () const
RangePair   GetRange ( Int index) const
Int   GetRangeIndex ( Float value) const
向量   GetRangeColor ( Int index) const
void  SetRangeColor ( Int index, const 向量 &color)
Int   GetSelectedRange () const
void  SetSelectedRange ( Int rangeIndex)

Color Modes

Bool   IsPerRangeColorMode () const
void  SetColorMode ( Bool perRange)
Bool   IsRandomColorMode () const
void  SetRandomColorMode ( Bool random)

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

◆  RangeData()

RangeData () private

◆  ~RangeData()

~ RangeData () private

成员函数文档编制

◆  Alloc()

static RangeData * Alloc ( )
static

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

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

◆  Free()

static void Free ( RangeData *&  data )
static

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

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

◆  Init()

Bool Init ( Int   rangeNumber )

Initializes the range data with the passed range number. The interval in between ranges will be the same.

参数
[in] rangeNumber The number of ranges.
返回
true if successful, otherwise false .

◆  Reset()

void Reset ( Bool   invalidateObject = false )

Resets the range data to the initial state.

参数
[in] invalidateObject true to initialize the ranges after reset operation, otherwise the object will be initialized but functions with one single range.

◆  CopyTo()

void CopyTo ( RangeData dst )

Copy the range data over to dst .

参数
[in,out] dst The destination range data. The caller owns the pointed range data..

◆  AddValue()

Bool AddValue ( Float   value )

Adds a value and split existing range.

参数
[in] value The value to add.
返回
true if successful, otherwise false .

◆  GetCurrentValue()

Float GetCurrentValue ( ) const

Retrieves The current value.

返回
The current value.

◆  SetCurrentValue()

void SetCurrentValue ( Float   value )

Sets the current value.

参数
[in] value The value, must be in the range [0.0, 1.0].

◆  GetKnotsCount()

Int GetKnotsCount ( ) const

Retrieves the numbers of knots.

返回
The numbers of knots.

◆  SetKnotValue()

Bool SetKnotValue ( Int   knotIndex ,
Float   value  
)

Sets the value at the specified knot index.

参数
[in] knotIndex The knot index to set the value.
[in] value The value to set.
返回
true if successful, otherwise false .

◆  GetKnotValue()

Float GetKnotValue ( Int   knotIndex ) const

Retrieves the value at the specified knot index.

参数
[in] knotIndex The knot index.
返回
The value.

◆  GetKnotIndexByValue()

Int GetKnotIndexByValue ( Float   value ) const

Searches for a knot with the passed value.

参数
[in] value The value used to search the knot.
返回
The knot index, or NOTOK if not found.

◆  DeleteKnot()

void DeleteKnot ( Int   knotIndex )

Deletes a knot at the specified knot index.

参数
[in] knotIndex The knot index to delete.

◆  GetSelectedKnot()

Int GetSelectedKnot ( ) const

Retrieves the selected knot.

返回
The selected knot index, or NOTOK if not found.

◆  SetSelectedKnot()

void SetSelectedKnot ( Int   knotIndex )

Sets the selected knot.

参数
[in] knotIndex The index to select, or NOTOK to deselect all.

◆  GetRangesCount()

Int GetRangesCount ( ) const

The number of ranges, must be >= 1 .

返回
The number of ranges.

◆  GetRange()

RangePair GetRange ( Int   index ) const

Retrieves the range at the specified index .

参数
[in] index The range index.
返回
The range.

◆  GetRangeIndex()

Int GetRangeIndex ( Float   value ) const

Returns a range index a value for the specified value .

参数
[in] value The value, must be in range [0.0, 1.0].
返回
The range index.

◆  GetRangeColor()

向量 GetRangeColor ( Int   index ) const

Retrieves the range color for the specified range index .

参数
[in] index The range index to get the color.
返回
The range Color.

◆  SetRangeColor()

void SetRangeColor ( Int   index ,
const 向量 color  
)

Sets the range color at the specified range index .

注意
IsPerRangeColorMode() returns false the range index is not evaluated and the color is stored always at the first index.
参数
[in] index The index of the range to set the color.
[in] color The color to be assigned to the range.

◆  GetSelectedRange()

Int GetSelectedRange ( ) const

Retrieves the selected range.

返回
The selected range index, or NOTOK if not found.

◆  SetSelectedRange()

void SetSelectedRange ( Int   rangeIndex )

Sets the selected range.

参数
[in] rangeIndex The index to select, or NOTOK to deselect all.

◆  IsPerRangeColorMode()

Bool IsPerRangeColorMode ( ) const

Checks if the color mode is stored per range, or just as single color.

返回
true if the color is stored is stored per range, otherwise false .

◆  SetColorMode()

void SetColorMode ( Bool   perRange )

Sets the mode indicating if the color need to be stored per range, or just as single color.

参数
[in] perRange true to store the color per range, false to store it just as single color.

◆  IsRandomColorMode()

Bool IsRandomColorMode ( ) const

Checks if the colors are randomized or user defined.

返回
true if the colors are randomized, otherwise false .

◆  SetRandomColorMode()

void SetRandomColorMode ( Bool   random )

Sets the random color mode.

参数
[in] random true to randomize colors, otherwise false .