![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
A bounding box oriented along an arbitrary frame of reference. More...
#include <OrientedBoundingBox.h>

Public Member Functions | |
| OrientedBoundingBox () | |
| Default constructor. More... | |
| OrientedBoundingBox (const Eigen::Vector3d ¢er, const Eigen::Matrix3d &R, const Eigen::Vector3d &extent) | |
| Parameterized constructor. More... | |
| virtual | ~OrientedBoundingBox () |
| OrientedBoundingBox & | Clear () |
| const Eigen::Vector3d & | GetExtent () const |
| CCVector3 | getCenter () const |
| Returns center. More... | |
| Eigen::Vector3d | GetHalfExtent () const |
| Returns the half extent of the bounding box in its frame of reference. More... | |
| double | GetMaxExtent () const |
| Returns the max extent of the bounding box in its frame of reference. More... | |
| void | SetColor (const Eigen::Vector3d &color) |
| Sets the bounding box color. More... | |
| const Eigen::Vector3d & | GetColor () const |
| Gets the bounding box color. More... | |
| const Eigen::Matrix3d & | GetRotation () const |
| const Eigen::Vector3d & | GetPosition () const |
| double | volume () const |
| Returns the volume of the bounding box. More... | |
| std::vector< Eigen::Vector3d > | GetBoxPoints () const |
| std::vector< size_t > | GetPointIndicesWithinBoundingBox (const std::vector< Eigen::Vector3d > &points) const |
| Return indices to points that are within the bounding box. More... | |
| std::vector< size_t > | GetPointIndicesWithinBoundingBox (const std::vector< CCVector3 > &points) const |
Static Public Member Functions | |
| static OrientedBoundingBox | CreateFromAxisAlignedBoundingBox (const BoundingBox &aabox) |
Public Attributes | |
| Eigen::Vector3d | center_ |
| The center point of the bounding box. More... | |
| Eigen::Matrix3d | R_ |
| Eigen::Vector3d | extent_ |
| The extent of the bounding box in its frame of reference. More... | |
| Eigen::Vector3d | color_ |
| The color of the bounding box in RGB. More... | |
A bounding box oriented along an arbitrary frame of reference.
The oriented bounding box is defined by its center position, rotation maxtrix and extent.
Definition at line 22 of file OrientedBoundingBox.h.
|
inline |
Default constructor.
Creates an empty Oriented Bounding Box.
Definition at line 27 of file OrientedBoundingBox.h.
|
inline |
Parameterized constructor.
| center | Specifies the center position of the bounding box. |
| R | The rotation matrix specifying the orientation of the bounding box with the original frame of reference. |
| extent | The extent of the bounding box. |
Definition at line 38 of file OrientedBoundingBox.h.
|
inlinevirtual |
Definition at line 42 of file OrientedBoundingBox.h.
| OrientedBoundingBox & OrientedBoundingBox::Clear | ( | ) |
Definition at line 22 of file OrientedBoundingBox.cpp.
References center_, color_, extent_, and R_.
Referenced by cloudViewer::geometry::pybind_boundingvolume().
|
static |
Returns an oriented bounding box from the AxisAlignedBoundingBox.
| aabox | AxisAlignedBoundingBox object from which OrientedBoundingBox is created. |
Definition at line 74 of file OrientedBoundingBox.cpp.
References center_, extent_, Vector3Tpl< double >::fromArray(), cloudViewer::BoundingBoxTpl< T >::getCenter(), cloudViewer::BoundingBoxTpl< T >::getDiagVec(), and R_.
| std::vector< Eigen::Vector3d > OrientedBoundingBox::GetBoxPoints | ( | ) | const |
Returns the eight points that define the bounding box.
/// ------- x /// /| /// / | /// / | z /// y /// 0 ------------------- 1 /// /| /| /// / | / | /// / | / | /// / | / | /// 2 ------------------- 7 | /// | |____________|____| 6 /// | /3 | / /// | / | / /// | / | / /// |/ |/ /// 5 ------------------- 4 ///
Definition at line 34 of file OrientedBoundingBox.cpp.
References center_, extent_, points, and R_.
Referenced by cloudViewer::geometry::pybind_boundingvolume().
|
inline |
|
inline |
Gets the bounding box color.
Definition at line 63 of file OrientedBoundingBox.h.
Referenced by cloudViewer::t::geometry::OrientedBoundingBox::FromLegacy(), and cloudViewer::geometry::pybind_boundingvolume().
|
inline |
Get the extent/length of the bounding box in x, y, and z dimension in its frame of reference.
Definition at line 49 of file OrientedBoundingBox.h.
References extent_.
Referenced by cloudViewer::t::geometry::OrientedBoundingBox::FromLegacy(), and cloudViewer::geometry::pybind_boundingvolume().
|
inline |
Returns the half extent of the bounding box in its frame of reference.
Definition at line 55 of file OrientedBoundingBox.h.
Referenced by GetPointIndicesWithinBoundingBox(), and cloudViewer::geometry::pybind_boundingvolume().
|
inline |
Returns the max extent of the bounding box in its frame of reference.
Definition at line 58 of file OrientedBoundingBox.h.
References extent_.
Referenced by cloudViewer::geometry::pybind_boundingvolume().
| std::vector< size_t > OrientedBoundingBox::GetPointIndicesWithinBoundingBox | ( | const std::vector< CCVector3 > & | points | ) | const |
Definition at line 56 of file OrientedBoundingBox.cpp.
References abs(), center_, Vector3Tpl< double >::fromArray(), GetHalfExtent(), points, and R_.
| std::vector< size_t > OrientedBoundingBox::GetPointIndicesWithinBoundingBox | ( | const std::vector< Eigen::Vector3d > & | points | ) | const |
Return indices to points that are within the bounding box.
Definition at line 50 of file OrientedBoundingBox.cpp.
References Vector3Tpl< PointCoordinateType >::fromArrayContainer(), and points.
|
inline |
Definition at line 67 of file OrientedBoundingBox.h.
References center_.
Referenced by cloudViewer::t::geometry::OrientedBoundingBox::FromLegacy().
|
inline |
Definition at line 65 of file OrientedBoundingBox.h.
References R_.
Referenced by cloudViewer::t::geometry::OrientedBoundingBox::FromLegacy().
|
inline |
Sets the bounding box color.
Definition at line 61 of file OrientedBoundingBox.h.
References color.
Referenced by cloudViewer::geometry::pybind_boundingvolume(), and cloudViewer::t::geometry::OrientedBoundingBox::ToLegacy().
| double OrientedBoundingBox::volume | ( | ) | const |
Returns the volume of the bounding box.
Definition at line 30 of file OrientedBoundingBox.cpp.
References extent_.
Referenced by ecvOrientedBBox::IsEmpty(), and cloudViewer::geometry::pybind_boundingvolume().
| Eigen::Vector3d cloudViewer::OrientedBoundingBox::center_ |
The center point of the bounding box.
Definition at line 110 of file OrientedBoundingBox.h.
Referenced by Clear(), CreateFromAxisAlignedBoundingBox(), GetBoxPoints(), GetPointIndicesWithinBoundingBox(), and cloudViewer::geometry::pybind_boundingvolume().
| Eigen::Vector3d cloudViewer::OrientedBoundingBox::color_ |
The color of the bounding box in RGB.
Definition at line 117 of file OrientedBoundingBox.h.
Referenced by Clear(), and cloudViewer::geometry::pybind_boundingvolume().
| Eigen::Vector3d cloudViewer::OrientedBoundingBox::extent_ |
The extent of the bounding box in its frame of reference.
Definition at line 115 of file OrientedBoundingBox.h.
Referenced by Clear(), CreateFromAxisAlignedBoundingBox(), GetBoxPoints(), cloudViewer::geometry::pybind_boundingvolume(), and volume().
| Eigen::Matrix3d cloudViewer::OrientedBoundingBox::R_ |
The rotation matrix of the bounding box to transform the original frame of reference to the frame of this box.
Definition at line 113 of file OrientedBoundingBox.h.
Referenced by Clear(), CreateFromAxisAlignedBoundingBox(), GetBoxPoints(), GetPointIndicesWithinBoundingBox(), and cloudViewer::geometry::pybind_boundingvolume().