#include <customgui_range.h>
Range data type (CUSTOMDATATYPE_RANGE) for RangeCustomGui.
- Note
- Has to be created with Alloc() and destroyed with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Since
- R19
◆ RangeData()
◆ ~RangeData()
◆ Alloc()
Allocates a RangeData. Destroy the allocated RangeData with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Returns
- The allocated range data, or nullptr if the allocation failed.
◆ Free()
Destructs RangeDatas allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Parameters
-
[in,out] | data | The RangeData to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards. |
◆ Init()
Initializes the range data with the passed range number. The interval in between ranges will be the same.
- Parameters
-
[in] | rangeNumber | The number of ranges. |
- Returns
- true if successful, otherwise false.
◆ Reset()
void Reset |
( |
Bool |
invalidateObject = false | ) |
|
Resets the range data to the initial state.
- Parameters
-
[in] | invalidateObject | true to initialize the ranges after reset operation, otherwise the object will be initialized but functions with one single range. |
◆ CopyTo()
Copy the range data over to dst.
- Parameters
-
[in,out] | dst | The destination range data. The caller owns the pointed range data.. |
◆ AddValue()
Adds a value and split existing range.
- Parameters
-
[in] | value | The value to add. |
- Returns
- true if successful, otherwise false.
◆ GetCurrentValue()
Float GetCurrentValue |
( |
| ) |
const |
Retrieves The current value.
- Returns
- The current value.
◆ SetCurrentValue()
void SetCurrentValue |
( |
Float |
value | ) |
|
Sets the current value.
- Parameters
-
[in] | value | The value, must be in the range [0.0, 1.0]. |
◆ GetKnotsCount()
Int GetKnotsCount |
( |
| ) |
const |
Retrieves the numbers of knots.
- Returns
- The numbers of knots.
◆ SetKnotValue()
Sets the value at the specified knot index.
- Parameters
-
[in] | knotIndex | The knot index to set the value. |
[in] | value | The value to set. |
- Returns
- true if successful, otherwise false.
◆ GetKnotValue()
Float GetKnotValue |
( |
Int |
knotIndex | ) |
const |
Retrieves the value at the specified knot index.
- Parameters
-
[in] | knotIndex | The knot index. |
- Returns
- The value.
◆ GetKnotIndexByValue()
Int GetKnotIndexByValue |
( |
Float |
value | ) |
const |
Searches for a knot with the passed value.
- Parameters
-
[in] | value | The value used to search the knot. |
- Returns
- The knot index, or NOTOK if not found.
◆ DeleteKnot()
void DeleteKnot |
( |
Int |
knotIndex | ) |
|
Deletes a knot at the specified knot index.
- Parameters
-
[in] | knotIndex | The knot index to delete. |
◆ GetSelectedKnot()
Int GetSelectedKnot |
( |
| ) |
const |
Retrieves the selected knot.
- Returns
- The selected knot index, or NOTOK if not found.
◆ SetSelectedKnot()
void SetSelectedKnot |
( |
Int |
knotIndex | ) |
|
Sets the selected knot.
- Parameters
-
[in] | knotIndex | The index to select, or NOTOK to deselect all. |
◆ GetRangesCount()
Int GetRangesCount |
( |
| ) |
const |
The number of ranges, must be >= 1.
- Returns
- The number of ranges.
◆ GetRange()
Retrieves the range at the specified index.
- Parameters
-
[in] | index | The range index. |
- Returns
- The range.
◆ GetRangeIndex()
Returns a range index a value for the specified value.
- Parameters
-
[in] | value | The value, must be in range [0.0, 1.0]. |
- Returns
- The range index.
◆ GetRangeColor()
Retrieves the range color for the specified range index.
- Parameters
-
[in] | index | The range index to get the color. |
- Returns
- The range Color.
◆ SetRangeColor()
void SetRangeColor |
( |
Int |
index, |
|
|
const Vector & |
color |
|
) |
| |
Sets the range color at the specified range index.
- Note
- If IsPerRangeColorMode() returns false the range index is not evaluated and the color is stored always at the first index.
- Parameters
-
[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.
- Returns
- The selected range index, or NOTOK if not found.
◆ SetSelectedRange()
void SetSelectedRange |
( |
Int |
rangeIndex | ) |
|
Sets the selected range.
- Parameters
-
[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.
- Returns
- 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.
- Parameters
-
[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.
- Returns
- true if the colors are randomized, otherwise false.
◆ SetRandomColorMode()
void SetRandomColorMode |
( |
Bool |
random | ) |
|
Sets the random color mode.
- Parameters
-
[in] | random | true to randomize colors, otherwise false. |