![]() |
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 | ( | ) |
|
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::LineSet::CreateFromOrientedBoundingBox(), ecvOrientedBBox::GetAxisAlignedBoundingBox(), ecvOrientedBBox::GetMaxBound(), and ecvOrientedBBox::GetMinBound().
|
inline |
|
inline |
Gets the bounding box color.
Definition at line 63 of file OrientedBoundingBox.h.
Referenced by PclUtils::PCLVis::addOrientedCube(), cloudViewer::geometry::LineSet::CreateFromOrientedBoundingBox(), and cloudViewer::t::geometry::OrientedBoundingBox::FromLegacy().
|
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().
|
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().
|
inline |
Returns the max extent of the bounding box in its frame of reference.
Definition at line 58 of file OrientedBoundingBox.h.
References extent_.
| std::vector< size_t > OrientedBoundingBox::GetPointIndicesWithinBoundingBox | ( | const std::vector< CCVector3 > & | points | ) | const |
Definition at line 56 of file OrientedBoundingBox.cpp.
References 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.
Referenced by ccMesh::Crop(), ccPointCloud::Crop(), and ccPointCloud::crop().
|
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 ecvOrientedBBox::draw(), ccGBLSensor::drawMeOnly(), 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().
| Eigen::Vector3d cloudViewer::OrientedBoundingBox::center_ |
The center point of the bounding box.
Definition at line 110 of file OrientedBoundingBox.h.
Referenced by Clear(), CreateFromAxisAlignedBoundingBox(), ecvOrientedBBox::CreateFromAxisAlignedBoundingBox(), ecvOrientedBBox::CreateFromPoints(), GetBoxPoints(), ecvOrientedBBox::GetCenter(), GetPointIndicesWithinBoundingBox(), ecvOrientedBBox::Rotate(), ecvOrientedBBox::Scale(), and ecvOrientedBBox::Translate().
| Eigen::Vector3d cloudViewer::OrientedBoundingBox::color_ |
The color of the bounding box in RGB.
Definition at line 117 of file OrientedBoundingBox.h.
Referenced by Clear().
| 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(), ecvOrientedBBox::CreateFromAxisAlignedBoundingBox(), ecvOrientedBBox::CreateFromPoints(), GetBoxPoints(), ecvOrientedBBox::Scale(), 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(), ecvOrientedBBox::CreateFromAxisAlignedBoundingBox(), ecvOrientedBBox::CreateFromPoints(), GetBoxPoints(), GetPointIndicesWithinBoundingBox(), and ecvOrientedBBox::Rotate().