Template Class TOrientedBox_

Class Documentation

template<typename T>
class TOrientedBox_

3D oriented bounding box: defined by dimensions and pose

The box is described by the SE(3) pose of its geometric center, plus its lengths along the local (X’,Y’,Z’) axes determined by that pose.

Numbering of vertices:

    4 +---------+ 6
     /|        /|
    / |       / |
   /  |      /  |
5 +---------+ 7 |       +Z'
   |   |    |   |       ^
   |   |    |   |       |
   | 0 +----|---+ 2     +--->  +Y'
   |  /     |  /       /
   | /      | /       v
   |/       |/        +X'
1 +---------+ 3

Public Types

using plane_array_t = std::array<mrpt::math::TPlane, PLANES_PER_BOX>

Public Functions

TOrientedBox_() = default
inline TOrientedBox_(const mrpt::math::TPose3D &center_pose, const mrpt::math::TPoint3D_<T> &box_size)

Constructor pose of the center and dimensions in local coordinates

inline TOrientedBox_(const TOrientedBox_<T> &o)
inline TOrientedBox_<T> &operator=(const TOrientedBox_<T> &o)
template<typename U>
inline mrpt::math::TOrientedBox_<U> cast() const
const std::vector<mrpt::math::TPoint3D_<T>> &vertices() const

Gets the 8 vertices (cached to avoid recalculation). The order or vertices is ensured to be as defined above

inline const mrpt::math::TPose3D &pose() const

Gets the box center pose

inline void setPose(const mrpt::math::TPose3D &p)

Changes the the box center SE(3) pose

inline const mrpt::math::TPoint3D_<T> &size() const

Gets the box size (local coordinates)

inline void setSize(const mrpt::math::TPoint3D_<T> &size)

Changes the box size (local coordinates)

std::string asString() const

Returns a human-readable description of this box

TBoundingBox_<T> getAxisAlignedBox() const

Returns the axis-aligned bounding box enclosing this oriented box.

plane_array_t getBoxPlanes() const

Returns the 6 planes enclosing the 3D box. The ordering of the planes is: [0]=front, [1]=left, [2]=right, [3]=top, [4]=back, [5]=bottom. Plane normals are all pointing outwards

inline bool operator==(const TOrientedBox_<T> &o) const
inline bool operator!=(const TOrientedBox_<T> &o) const

Public Static Attributes

static constexpr std::size_t PLANES_PER_BOX = 6

The number of planes defined by a box