You’re reading an older version of the Slamcore SDK documenation. The latest one is 23.04.

Class slamcore::Range1D

class Range1D

Captures the half-open interval [min, max)

Public Types

using ValueT = int

Public Functions

Range1D() = default
inline Range1D(const ValueT min, const ValueT max)
inline ValueT min() const

Get the min value of the range.

inline ValueT max() const

Get the max value of the range.

inline Range1D expanded(ValueT point) const

Return a new Range so that the point is within the range.

inline Range1D intersection(const Range1D &other) const

Return a new range of the intersection of this range with another.

inline ValueT length() const

Get the length of the range.

inline bool empty() const

Check if the range is empty.

inline bool contains(ValueT point) const

Check if the Range contains a point.


inline friend bool operator==(const Range1D &lhs, const Range1D &rhs)
inline friend bool operator!=(const Range1D &lhs, const Range1D &rhs)