![]() |
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.
|
inline |
Default constructor.
Creates an empty Oriented Bounding Box.
|
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. |
|
inlinevirtual |
| OrientedBoundingBox & OrientedBoundingBox::Clear | ( | ) |
|
static |
Returns an oriented bounding box from the AxisAlignedBoundingBox.
| aabox | AxisAlignedBoundingBox object from which OrientedBoundingBox is created. |
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 ///
References center_, extent_, points, and R_.
Referenced by cloudViewer::geometry::LineSet::CreateFromOrientedBoundingBox(), ecvOrientedBBox::GetAxisAlignedBoundingBox(), ecvOrientedBBox::GetMaxBound(), and ecvOrientedBBox::GetMinBound().
|
inline |
Returns center.
References center_.
|
inline |
Gets the bounding box color.
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.
References extent_.
Referenced by cloudViewer::t::geometry::OrientedBoundingBox::FromLegacy().
|
inline |
Returns the half extent of the bounding box in its frame of reference.
Referenced by GetPointIndicesWithinBoundingBox().
|
inline |
Returns the max extent of the bounding box in its frame of reference.
References extent_.
| std::vector< size_t > OrientedBoundingBox::GetPointIndicesWithinBoundingBox | ( | const std::vector< CCVector3 > & | points | ) | const |
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.
References Vector3Tpl< PointCoordinateType >::fromArrayContainer(), and points.
Referenced by ccPointCloud::crop(), ccPointCloud::Crop(), and ccMesh::Crop().
|
inline |
References center_.
Referenced by cloudViewer::t::geometry::OrientedBoundingBox::FromLegacy().
|
inline |
References R_.
Referenced by cloudViewer::t::geometry::OrientedBoundingBox::FromLegacy().
|
inline |
Sets the bounding box color.
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.
References extent_.
Referenced by ecvOrientedBBox::IsEmpty().
| Eigen::Vector3d cloudViewer::OrientedBoundingBox::center_ |
The center point of the bounding box.
Referenced by Clear(), ecvOrientedBBox::CreateFromAxisAlignedBoundingBox(), 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.
Referenced by Clear().
| Eigen::Vector3d cloudViewer::OrientedBoundingBox::extent_ |
The extent of the bounding box in its frame of reference.
Referenced by Clear(), ecvOrientedBBox::CreateFromAxisAlignedBoundingBox(), 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.
Referenced by Clear(), ecvOrientedBBox::CreateFromAxisAlignedBoundingBox(), CreateFromAxisAlignedBoundingBox(), ecvOrientedBBox::CreateFromPoints(), GetBoxPoints(), GetPointIndicesWithinBoundingBox(), and ecvOrientedBBox::Rotate().