eVision C++ API 26.10.0-beta.2.dev
Loading...
Searching...
No Matches
eVision::EFloatRange Class Reference

Represents a range of floating point values. More...

#include <eVision/Easy/EFloatRange.h>

Collaboration diagram for eVision::EFloatRange:

Public Member Functions

 EFloatRange ()
 Creates an EFloatRange::EFloatRange object.
 EFloatRange (float min, float max)
 Creates an EFloatRange::EFloatRange object.
 EFloatRange (const eVision::EFloatRange &range)
 Creates an EFloatRange::EFloatRange object.
virtual ~EFloatRange () throw ()
eVision::EFloatRange & operator= (const eVision::EFloatRange &other)
 Assignment operator.
bool operator== (const eVision::EFloatRange &other) const
 Equality operator.
bool operator!= (const eVision::EFloatRange &other) const
 Inequality operator.
void SetBounds (float min, float max)
 Sets the bounds of the range.
void SetFromBaseAndAbsoluteTolerance (float baseValue, float tolerance)
 Sets the bounds of the range from a base value and an absolute tolerance from this base value.
void SetFromBaseAndRelativeTolerance (float baseValue, float tolerance)
 Sets the bounds of the range from a base value and a relative tolerance from this base value.
void Update (float value)
 Updates the range. If the value passed is outside of the range bounds, they are modified so they include the value.
void Update (const eVision::EFloatRange &other)
 Updates the range. If the range passed is not fully included in the range bounds, they are modified to include the given range.
float GetLowerBound () const
 Lower bound of the range.
float GetUpperBound () const
 Upper bound of the range.
float GetCenter () const
 Center of the range.
float GetSize () const
 Size of the range.
bool IsValid () const
 Returns true if the range is defined and valid.
bool IsInRange (float value, bool lowerBoundInclusive, bool upperBoundInclusive) const
 Checks if a value is inside the range.
bool IsInRange (float value, bool lowerBoundInclusive) const
 Checks if a value is inside the range.
bool IsInRange (float value) const
 Checks if a value is inside the range.
 EFloatRange (CppWrapperInternal::InternalConstructor)

Public Attributes

CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

Represents a range of floating point values.

License(s): BasicTypes

Constructor & Destructor Documentation

◆ EFloatRange() [1/4]

eVision::EFloatRange::EFloatRange ( )

Creates an EFloatRange::EFloatRange object.

◆ EFloatRange() [2/4]

eVision::EFloatRange::EFloatRange ( float min,
float max )

Creates an EFloatRange::EFloatRange object.

Parameters
minLower bound of the range.
maxUpper bound of the range.

◆ EFloatRange() [3/4]

eVision::EFloatRange::EFloatRange ( const eVision::EFloatRange & range)

Creates an EFloatRange::EFloatRange object.

Parameters
rangeRange to copy.

◆ ~EFloatRange()

eVision::EFloatRange::~EFloatRange ( )
throw ( )
virtual

◆ EFloatRange() [4/4]

eVision::EFloatRange::EFloatRange ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ GetCenter()

float eVision::EFloatRange::GetCenter ( ) const

Center of the range.

◆ GetLowerBound()

float eVision::EFloatRange::GetLowerBound ( ) const

Lower bound of the range.

◆ GetSize()

float eVision::EFloatRange::GetSize ( ) const

Size of the range.

◆ GetUpperBound()

float eVision::EFloatRange::GetUpperBound ( ) const

Upper bound of the range.

◆ IsInRange() [1/3]

bool eVision::EFloatRange::IsInRange ( float value) const

Checks if a value is inside the range.

Parameters
valueValue to test.

◆ IsInRange() [2/3]

bool eVision::EFloatRange::IsInRange ( float value,
bool lowerBoundInclusive ) const

Checks if a value is inside the range.

Parameters
valueValue to test.
lowerBoundInclusiveIndicates if the lower bound should be considered inside the range (true) or outside (false).

◆ IsInRange() [3/3]

bool eVision::EFloatRange::IsInRange ( float value,
bool lowerBoundInclusive,
bool upperBoundInclusive ) const

Checks if a value is inside the range.

Parameters
valueValue to test.
lowerBoundInclusiveIndicates if the lower bound should be considered inside the range (true) or outside (false).
upperBoundInclusiveIndicates if the upper bound should be considered inside the range (true) or outside (false).

◆ IsValid()

bool eVision::EFloatRange::IsValid ( ) const

Returns true if the range is defined and valid.

◆ operator!=()

bool eVision::EFloatRange::operator!= ( const eVision::EFloatRange & other) const

Inequality operator.

Parameters
otherThe other object.

◆ operator=()

eVision::EFloatRange & eVision::EFloatRange::operator= ( const eVision::EFloatRange & other)

Assignment operator.

Parameters
otherThe other EFloatRange that we will copy into this one.

◆ operator==()

bool eVision::EFloatRange::operator== ( const eVision::EFloatRange & other) const

Equality operator.

Parameters
otherThe other object.

◆ SetBounds()

void eVision::EFloatRange::SetBounds ( float min,
float max )

Sets the bounds of the range.

Parameters
minLower bound of the range.
maxUpper bound of the range.

◆ SetFromBaseAndAbsoluteTolerance()

void eVision::EFloatRange::SetFromBaseAndAbsoluteTolerance ( float baseValue,
float tolerance )

Sets the bounds of the range from a base value and an absolute tolerance from this base value.

Parameters
baseValueBase value.
toleranceAbsolute tolerance around the base value. Must be positive.

The range will be set with a lower bound of (base - tolerance) and an upper bound of (base + tolerance).

◆ SetFromBaseAndRelativeTolerance()

void eVision::EFloatRange::SetFromBaseAndRelativeTolerance ( float baseValue,
float tolerance )

Sets the bounds of the range from a base value and a relative tolerance from this base value.

Parameters
baseValueBase value.
toleranceRelative tolerance around the base value. Must be positive.

The range will be set with a lower bound of (base - (base * tolerance)) and an upper bound of (base + (base * tolerance)).

◆ Update() [1/2]

void eVision::EFloatRange::Update ( const eVision::EFloatRange & other)

Updates the range. If the range passed is not fully included in the range bounds, they are modified to include the given range.

Parameters
otherRange to be included in the range.

◆ Update() [2/2]

void eVision::EFloatRange::Update ( float value)

Updates the range. If the value passed is outside of the range bounds, they are modified so they include the value.

Parameters
valueValue to be included in the range.

Member Data Documentation

◆ wrappedClass_

CppWrapperInternal::WrappedClass eVision::EFloatRange::wrappedClass_