|
ACF $AcfVersion:0$
|
Implementation of a abstract range defined by two values - minimum and maximum. More...
#include <TRange.h>
Public Member Functions | |
| TRange () | |
| Constructs an empty range object. | |
| TRange (const TRange &range) | |
| Copy constructor. | |
| TRange (ValueType minValue, ValueType maxValue) | |
| Constructs a range object from two numbers. | |
| bool | IsValid () const |
Return true if the bottom value is smaller or equal then the top value. | |
| bool | IsEmpty () const |
Return true if the bottom value is equal to the top value. | |
| bool | IsValidNonEmpty () const |
Return true if the range is valid and it is not empty. | |
| ValueType | GetMinValue () const |
| Get the bottom value. | |
| ValueType & | GetMinValueRef () |
| Get reference to the bottom value. | |
| void | SetMinValue (ValueType minValue) |
| Set the bottom value. | |
| ValueType | GetAbsMinValue () const |
| Get the minimum by the absolute value. | |
| ValueType | GetAbsMaxValue () const |
| Get the maximum by the absolute value. | |
| ValueType | GetMaxValue () const |
| Get the top value. | |
| ValueType & | GetMaxValueRef () |
| Get reference to the top value. | |
| void | SetMaxValue (ValueType maxValue) |
| Set the top value. | |
| void | Reset () |
| Set this range to be empty. | |
| ValueType | GetLength () const |
| Get length of this range. | |
| TRange | GetValidated () const |
| Get validated range, if it was invalid. | |
| void | GetValidated (TRange &result) const |
| Get validated range, if it was invalid. | |
| void | Validate () |
| Force this range to be valid. | |
| bool | Contains (ValueType value) const |
Returns true, if value is in range between top and bottom. | |
| bool | Contains (const TRange &range) const |
Returns true, if this range is inside of the range. | |
| bool | IsIntersectedBy (const TRange &range) const |
| Check if this range is intersected by other range. | |
| bool | IsOutsideOf (const TRange &range) const |
| Check if this range is outside of the given range. | |
| TRange | GetTranslated (ValueType offset) const |
| Get translated position range. | |
| void | Translate (ValueType offset) |
| Translated position of this range. | |
| TRange | GetIntersection (const TRange &range) const |
Get intersection with the second range. | |
| void | Intersection (const TRange &range) |
| Set this range to be intersection of two ranges. | |
| TRange | GetUnion (const TRange &range) const |
Get union with the second range. | |
| TRange | GetUnion (double value) const |
Get union with the second range. | |
| void | Unite (const TRange &range) |
| Set this range to be union of two ranges. | |
| void | Unite (double value) |
| Set this range to be union of two ranges. | |
| TRange | GetExpanded (const TRange &range) const |
Get expanded range using the second range. | |
| void | Expand (const TRange &range) |
| Set this range to be expanded. | |
| ValueType | GetDistance (ValueType value) const |
| Get distance from value to range. | |
| ValueType | GetNearestInside (ValueType value) const |
| Get nearest value belonging to range. | |
| ValueType | GetClipped (ValueType value) const |
| Get value clipped to the range. | |
| TRange | GetClipped (const TRange &range) const |
| Get range clipped to the current range. | |
| ValueType | GetValueFromAlpha (double alpha) const |
| Get value based on 'alpha' factor. | |
| double | GetAlphaFromValue (ValueType value) const |
| Get value based on 'alpha' factor. | |
| ValueType | GetMappedTo (ValueType value, const TRange &range) const |
Returns the value, that corresponds the input value inputValue in the other range range. | |
| TRange | GetApply (const TRange &range) const |
| Get a combined range. | |
| TRange | GetInvertApply (const TRange &range) const |
| TRange | GetInverted () const |
| void | SetInterpolated (const TRange &first, const TRange &second, double alpha) |
| Set this range to be linear interpolated using two other ranges and adjast alpha value. | |
| TRange & | operator= (const TRange &range) |
| bool | operator== (const TRange &range) const |
| bool | operator!= (const TRange &range) const |
| TRange | operator* (double value) const |
| TRange | operator/ (double value) const |
| TRange & | operator*= (double value) |
| TRange & | operator/= (double value) |
Static Public Member Functions | |
| static const TRange & | GetNull () |
| Return null range. | |
| static const TRange & | GetInvalid () |
| Return invalid range. | |
| static TRange | GetValid (ValueType value1, ValueType value2) |
| Return always valid range. | |
Implementation of a abstract range defined by two values - minimum and maximum.
| istd::TRange< ValueType >::TRange | ( | ) |
| istd::TRange< ValueType >::TRange | ( | const TRange< ValueType > & | range | ) |
| istd::TRange< ValueType >::TRange | ( | ValueType | minValue, |
| ValueType | maxValue | ||
| ) |
|
inline |
Returns true, if this range is inside of the range.
Definition at line 451 of file TRange.h.
References istd::TRange< ValueType >::IsValid().
|
inline |
Returns true, if value is in range between top and bottom.
This range must be valid.
Definition at line 442 of file TRange.h.
Referenced by i2d::CRect::IsInside(), and i2d::CRect::IsInside().
|
inline |
Set this range to be expanded.
Expanding operation calculate simple sum for each components separately.
Definition at line 592 of file TRange.h.
Referenced by i2d::CRect::Expand().
| ValueType istd::TRange< ValueType >::GetAbsMaxValue | ( | ) | const |
| ValueType istd::TRange< ValueType >::GetAbsMinValue | ( | ) | const |
|
inline |
| TRange< ValueType > istd::TRange< ValueType >::GetApply | ( | const TRange< ValueType > & | range | ) | const |
| TRange< ValueType > istd::TRange< ValueType >::GetClipped | ( | const TRange< ValueType > & | range | ) | const |
Get range clipped to the current range.
Definition at line 644 of file TRange.h.
References istd::TRange< ValueType >::GetMaxValue(), istd::TRange< ValueType >::GetMinValue(), istd::TRange< ValueType >::SetMaxValue(), and istd::TRange< ValueType >::SetMinValue().
| ValueType istd::TRange< ValueType >::GetClipped | ( | ValueType | value | ) | const |
Get value clipped to the range.
Definition at line 630 of file TRange.h.
Referenced by icmm::TColorGradient< GradientFunction >::GetValueAt().
|
inline |
|
inline |
|
inline |
|
inlinestatic |
| TRange< ValueType > istd::TRange< ValueType >::GetInvertApply | ( | const TRange< ValueType > & | range | ) | const |
| TRange< ValueType > istd::TRange< ValueType >::GetInverted | ( | ) | const |
|
inline |
Get length of this range.
Length is difference between top and bottom values.
Definition at line 411 of file TRange.h.
Referenced by i2d::CRect::GetCenter(), i2d::CRect::GetHeight(), istd::TRange< ValueType >::GetMappedTo(), i2d::CRect::GetRectangle(), imath::CSampledFunction::GetSamplingStep(), i2d::CRect::GetSize(), and i2d::CRect::GetWidth().
|
inline |
Returns the value, that corresponds the input value inputValue in the other range range.
It is the same as range.GetValueFromAlpha(GetAlphaFromValue(value)).
| value | value definde in this range. If it is equal to minimum value in this range, it will be mapped to minimum value of range. If it is equal to maximum value in this range, it will be mapped to maximum value of range. Rest values are linear interpolated. |
Definition at line 679 of file TRange.h.
References istd::TRange< ValueType >::GetLength(), and istd::TRange< ValueType >::GetMinValue().
|
inline |
Get the top value.
Definition at line 382 of file TRange.h.
Referenced by istd::TRanges< ValueType >::GetAsList(), i2d::CRect::GetBottom(), i2d::CRectangle::GetBottom(), istd::TRange< ValueType >::GetClipped(), istd::TRanges< ValueType >::GetInverted(), i2d::CRect::GetLeftBottom(), i2d::CRect::GetRight(), i2d::CRectangle::GetRight(), i2d::CRect::GetRightBottom(), i2d::CRect::GetRightTop(), istd::TRanges< ValueType >::Invert(), istd::TRanges< ValueType >::IsInside(), istd::TRanges< ValueType >::TRanges(), i2d::CRect::Translate(), and istd::TRanges< ValueType >::Union().
|
inline |
Get reference to the top value.
Definition at line 389 of file TRange.h.
Referenced by iser::CPrimitiveTypesSerializer::SerializeRange().
|
inline |
Get the bottom value.
Definition at line 341 of file TRange.h.
Referenced by istd::TRanges< ValueType >::GetAsList(), i2d::CRect::GetCenter(), istd::TRange< ValueType >::GetClipped(), istd::TRanges< ValueType >::GetInverted(), i2d::CRect::GetLeft(), i2d::CRectangle::GetLeft(), i2d::CRect::GetLeftBottom(), i2d::CRect::GetLeftTop(), istd::TRange< ValueType >::GetMappedTo(), i2d::CRect::GetRectangle(), i2d::CRect::GetRightTop(), i2d::CRect::GetTop(), i2d::CRectangle::GetTop(), istd::TRanges< ValueType >::Invert(), istd::TRanges< ValueType >::IsInside(), istd::TRanges< ValueType >::TRanges(), i2d::CRect::Translate(), and istd::TRanges< ValueType >::Union().
|
inline |
Get reference to the bottom value.
Definition at line 348 of file TRange.h.
Referenced by iser::CPrimitiveTypesSerializer::SerializeRange().
|
inline |
|
inlinestatic |
|
inline |
| TRange< ValueType > istd::TRange< ValueType >::GetUnion | ( | const TRange< ValueType > & | range | ) | const |
Get union with the second range.
Definition at line 517 of file TRange.h.
References istd::TRange< ValueType >::IsValid().
| TRange< ValueType > istd::TRange< ValueType >::GetUnion | ( | double | value | ) | const |
|
inlinestatic |
|
inline |
|
inline |
Get validated range, if it was invalid.
Range is invalid if set min value is bigger than set max value. It returns range with smaller range value as minimum and bigger one as maximum.
Definition at line 427 of file TRange.h.
References istd::TRange< ValueType >::SetMaxValue(), and istd::TRange< ValueType >::SetMinValue().
|
inline |
Get value based on 'alpha' factor.
| alpha | alpha factor. If it is 0, minimum range value will be returned. If it is 1, maximum range value will be returned. Rest values are linear interpolated. |
Definition at line 661 of file TRange.h.
Referenced by imath::CSampledFunction::GetSampleCoordinate().
| void istd::TRange< ValueType >::Intersection | ( | const TRange< ValueType > & | range | ) |
Set this range to be intersection of two ranges.
Definition at line 502 of file TRange.h.
Referenced by i2d::CRect::Intersection().
|
inline |
Return true if the bottom value is equal to the top value.
Definition at line 327 of file TRange.h.
Referenced by i2d::CRect::IsEmpty(), istd::TRanges< ValueType >::TRanges(), and istd::TRanges< ValueType >::Union().
|
inline |
|
inline |
Check if this range is outside of the given range.
Definition at line 468 of file TRange.h.
Referenced by i2d::CRect::IsOutside().
|
inline |
Return true if the bottom value is smaller or equal then the top value.
Definition at line 320 of file TRange.h.
Referenced by istd::TRange< ValueType >::Contains(), istd::TRange< ValueType >::GetUnion(), i2d::CRect::Intersection(), i2d::CRect::IsValid(), and istd::TRange< ValueType >::Unite().
|
inline |
Return true if the range is valid and it is not empty.
Definition at line 334 of file TRange.h.
Referenced by i2d::CRect::IsValidNonEmpty().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void istd::TRange< ValueType >::Reset | ( | ) |
Set this range to be empty.
Definition at line 403 of file TRange.h.
Referenced by i2d::CRect::Reset().
| void istd::TRange< ValueType >::SetInterpolated | ( | const TRange< ValueType > & | first, |
| const TRange< ValueType > & | second, | ||
| double | alpha | ||
| ) |
|
inline |
Set the top value.
Definition at line 396 of file TRange.h.
Referenced by istd::TRange< ValueType >::GetClipped(), istd::TRange< ValueType >::GetValidated(), i2d::CRect::SetBottom(), i2d::CRect::SetLeftBottom(), i2d::CRect::SetRight(), i2d::CRect::SetRightBottom(), i2d::CRect::SetRightTop(), and i2d::CRect::Translate().
|
inline |
Set the bottom value.
Definition at line 355 of file TRange.h.
Referenced by istd::TRange< ValueType >::GetClipped(), istd::TRange< ValueType >::GetValidated(), i2d::CRect::SetLeft(), i2d::CRect::SetLeftBottom(), i2d::CRect::SetLeftTop(), i2d::CRect::SetRightTop(), i2d::CRect::SetTop(), and i2d::CRect::Translate().
|
inline |
| void istd::TRange< ValueType >::Unite | ( | const TRange< ValueType > & | range | ) |
Set this range to be union of two ranges.
Definition at line 546 of file TRange.h.
References istd::TRange< ValueType >::IsValid().
Referenced by i2d::CRect::GetUnion(), and i2d::CRect::Union().
| void istd::TRange< ValueType >::Unite | ( | double | value | ) |
|
inline |