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

Class slamcore::Range2D

class Range2D

Captures the half-open 2D interval [(x_min, y_min), (x_max, y_max))

Public Types

using ScalarT = Range1D::ValueT
using ValueT = Vector<ScalarT, 2>

Public Functions

Range2D() = default
inline Range2D(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 Range2D expanded(const ValueT &point) const

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

inline Range2D intersection(const Range2D &other) const

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

inline ScalarT area() const

Get the area of the 2D range.

inline bool empty() const

Check if the range is empty.

inline bool contains(const ValueT &point) const

Check if the Range contains a point.

Friends

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