ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::BoundingBoxTpl< T > Class Template Reference

Bounding box structure. More...

#include <BoundingBox.h>

Inheritance diagram for cloudViewer::BoundingBoxTpl< T >:
Collaboration diagram for cloudViewer::BoundingBoxTpl< T >:

Public Member Functions

 BoundingBoxTpl ()
 Default constructor. More...
 
 BoundingBoxTpl (const Vector3Tpl< T > &minCorner, const Vector3Tpl< T > &maxCorner)
 Constructor from two vectors (lower min. and upper max. corners) More...
 
BoundingBoxTpl< T > operator+ (const BoundingBoxTpl< T > &bbox) const
 Returns the 'sum' of this bounding-box and another one. More...
 
const BoundingBoxTpl< T > & operator+= (const BoundingBoxTpl< T > &bbox)
 In place 'sum' of this bounding-box with another one. More...
 
virtual const BoundingBoxTpl< T > & operator+= (const Vector3Tpl< T > &V)
 Shifts the bounding box with a vector. More...
 
virtual const BoundingBoxTpl< T > & operator-= (const Vector3Tpl< T > &V)
 Shifts the bounding box with a vector. More...
 
virtual const BoundingBoxTpl< T > & operator*= (T scaleFactor)
 Scales the bounding box. More...
 
virtual const BoundingBoxTpl< T > & operator*= (const SquareMatrixTpl< T > &mat)
 Rotates the bounding box. More...
 
void clear ()
 Resets the bounding box. More...
 
void add (const Vector3Tpl< T > &P)
 'Enlarges' the bounding box with a point More...
 
const Vector3Tpl< T > & minCorner () const
 Returns min corner (const) More...
 
const Vector3Tpl< T > & maxCorner () const
 Returns max corner (const) More...
 
Vector3Tpl< T > & minCorner ()
 Returns min corner. More...
 
Vector3Tpl< T > & maxCorner ()
 Returns max corner. More...
 
Vector3Tpl< T > getCenter () const
 Returns center. More...
 
Vector3Tpl< T > getDiagVec () const
 Returns diagonal vector. More...
 
T getDiagNorm () const
 Returns diagonal length. More...
 
double getDiagNormd () const
 Returns diagonal length (double precision) More...
 
T getMinBoxDim () const
 Returns minimal box dimension. More...
 
T getMaxBoxDim () const
 Returns maximal box dimension. More...
 
double computeVolume () const
 Returns the bounding-box volume. More...
 
void setValidity (bool state)
 Sets bonding box validity. More...
 
bool isValid () const
 Returns whether bounding box is valid or not. More...
 
T minDistTo (const BoundingBoxTpl< T > &bbox) const
 
bool contains (const Vector3Tpl< T > &P) const
 Returns whether a points is inside the box or not. More...
 
bool containsEigen (const Eigen::Vector3d &point) const
 
std::vector< std::size_t > GetPointIndicesWithinBoundingBox (const std::vector< Eigen::Vector3d > &points) const
 
std::vector< std::size_t > GetPointIndicesWithinBoundingBox (const std::vector< Vector3Tpl< T >> &points) const
 
void addEigen (const Eigen::Vector3d &point)
 
double volume () const
 
void SetColor (const Eigen::Vector3d &color)
 Sets the bounding box color. More...
 
Eigen::Vector3d GetColor () const
 Gets the bounding box color. More...
 
double getXPercentage (double x) const
 
double getYPercentage (double y) const
 
double getZPercentage (double z) const
 
void getBounds (double bounds[6]) const
 

Protected Attributes

Vector3Tpl< T > m_bbMin
 Lower min. corner. More...
 
Vector3Tpl< T > m_bbMax
 Upper max. corner. More...
 
CCVector3d color_
 The color of the bounding box in RGB. More...
 
bool m_valid
 Validity. More...
 

Detailed Description

template<typename T>
class cloudViewer::BoundingBoxTpl< T >

Bounding box structure.

Definition at line 25 of file BoundingBox.h.

Constructor & Destructor Documentation

◆ BoundingBoxTpl() [1/2]

template<typename T >
cloudViewer::BoundingBoxTpl< T >::BoundingBoxTpl ( )
inline

Default constructor.

Definition at line 28 of file BoundingBox.h.

◆ BoundingBoxTpl() [2/2]

template<typename T >
cloudViewer::BoundingBoxTpl< T >::BoundingBoxTpl ( const Vector3Tpl< T > &  minCorner,
const Vector3Tpl< T > &  maxCorner 
)
inline

Constructor from two vectors (lower min. and upper max. corners)

Definition at line 32 of file BoundingBox.h.

Member Function Documentation

◆ add()

◆ addEigen()

template<typename T >
void cloudViewer::BoundingBoxTpl< T >::addEigen ( const Eigen::Vector3d &  point)
inline

Definition at line 260 of file BoundingBox.h.

References cloudViewer::BoundingBoxTpl< T >::add().

◆ clear()

◆ computeVolume()

template<typename T >
double cloudViewer::BoundingBoxTpl< T >::computeVolume ( ) const
inline

◆ contains()

template<typename T >
bool cloudViewer::BoundingBoxTpl< T >::contains ( const Vector3Tpl< T > &  P) const
inline

◆ containsEigen()

template<typename T >
bool cloudViewer::BoundingBoxTpl< T >::containsEigen ( const Eigen::Vector3d &  point) const
inline

◆ getBounds()

template<typename T >
void cloudViewer::BoundingBoxTpl< T >::getBounds ( double  bounds[6]) const
inline

◆ getCenter()

template<typename T >
Vector3Tpl<T> cloudViewer::BoundingBoxTpl< T >::getCenter ( ) const
inline

◆ GetColor()

template<typename T >
Eigen::Vector3d cloudViewer::BoundingBoxTpl< T >::GetColor ( ) const
inline

◆ getDiagNorm()

◆ getDiagNormd()

◆ getDiagVec()

◆ getMaxBoxDim()

◆ getMinBoxDim()

template<typename T >
T cloudViewer::BoundingBoxTpl< T >::getMinBoxDim ( ) const
inline

Returns minimal box dimension.

Definition at line 178 of file BoundingBox.h.

References cloudViewer::BoundingBoxTpl< T >::getDiagVec(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.

Referenced by qFacets::extractFacets().

◆ GetPointIndicesWithinBoundingBox() [1/2]

template<typename T >
std::vector<std::size_t> cloudViewer::BoundingBoxTpl< T >::GetPointIndicesWithinBoundingBox ( const std::vector< Eigen::Vector3d > &  points) const
inline

◆ GetPointIndicesWithinBoundingBox() [2/2]

template<typename T >
std::vector<std::size_t> cloudViewer::BoundingBoxTpl< T >::GetPointIndicesWithinBoundingBox ( const std::vector< Vector3Tpl< T >> &  points) const
inline

Definition at line 248 of file BoundingBox.h.

References cloudViewer::BoundingBoxTpl< T >::contains(), and points.

◆ getXPercentage()

template<typename T >
double cloudViewer::BoundingBoxTpl< T >::getXPercentage ( double  x) const
inline

◆ getYPercentage()

template<typename T >
double cloudViewer::BoundingBoxTpl< T >::getYPercentage ( double  y) const
inline

◆ getZPercentage()

template<typename T >
double cloudViewer::BoundingBoxTpl< T >::getZPercentage ( double  z) const
inline

◆ isValid()

template<typename T >
bool cloudViewer::BoundingBoxTpl< T >::isValid ( ) const
inline

Returns whether bounding box is valid or not.

Definition at line 203 of file BoundingBox.h.

References cloudViewer::BoundingBoxTpl< T >::m_valid.

Referenced by ecvAnnotationsTool::addAssociatedEntity(), ccClipBox::addAssociatedEntity(), ccLibAlgorithms::ApplyScaleMatchingAlgorithm(), ccBoundingBoxEditorDlg::ccBoundingBoxEditorDlg(), ccComputeOctreeDlg::ccComputeOctreeDlg(), ccVolumeCalcTool::ccVolumeCalcTool(), ccBoundingBoxEditorDlg::checkBaseInclusion(), ccRasterGrid::ComputeGridSize(), ccEntityAction::computeOctree(), ecvDisplayTools::ComputeProjectionMatrix(), ccVolumeCalcTool::ComputeVolume(), ccVolumeCalcTool::ConvertGridToCloud(), cc2Point5DimEditor::convertGridToCloud(), ccRasterGrid::convertToCloud(), ccMesh::Crop(), ccPointCloud::Crop(), ccPointCloud::crop(), DistanceMapGenerationDlg::DistanceMapGenerationDlg(), ccHObject::draw(), ccHObject::drawBB(), ccClipBox::drawMeOnly(), ccSphere::drawNameIn3D(), cloudViewer::ModelViewerWidget::EndRender(), ccRasterizeTool::ExportGeoTiff(), ccPropertiesTreeDelegate::fillWithHObject(), ccPropertiesTreeDelegate::fillWithViewProperties(), ccRasterizeTool::generateContours(), cloudViewer::PointCloudTpl< T >::getBoundingBox(), cloudViewer::ReferenceCloud::getBoundingBox(), ccSubMesh::getBoundingBox(), ccHObject::getDisplayBB_recursive(), ccKdTree::getNeighborLeaves(), ccIndexedTransformationBuffer::getOwnBB(), ccSubMesh::getOwnBB(), ccHObject::getOwnGlobalBB(), ccShiftedObject::getOwnGlobalBB(), ecvDisplayTools::GetRealCameraCenter(), ecvDisplayTools::GetVisibleObjectsBB(), ccInnerRect2DFinder::init(), ccApplyTransformationDlg::initFromDipAndDipDir(), cvDistanceTool::initTool(), cvProtractorTool::initTool(), cloudViewer::BoundingBoxTpl< T >::minDistTo(), ccClipBox::move2D(), ccClipBox::move3D(), NormalEstimation::openInputDialog(), GreedyTriangulation::openInputDialog(), MarchingCubeReconstruction::openInputDialog(), PoissonReconstruction::openInputDialog(), cloudViewer::BoundingBoxTpl< T >::operator+(), cloudViewer::BoundingBoxTpl< T >::operator+=(), CommandCrossSection::process(), ccInnerRect2DFinder::process(), ccMesh::refreshBB(), cvDistanceTool::reset(), cvProtractorTool::reset(), ccBoundingBoxEditorDlg::setBaseBBox(), PclUtils::PCLVis::SetDataAxesGridProperties(), ecvFilterTool::shiftBox(), ecvDisplayTools::UpdateConstellationCenterAndZoom(), ccBoundingBoxEditorDlg::updateCurrentBBox(), ccVolumeCalcTool::updateGrid(), ccRasterizeTool::updateGrid(), ccHObject::updateNameIn3DRecursive(), ccBoundingBoxEditorDlg::updateXWidth(), ccBoundingBoxEditorDlg::updateYWidth(), DistanceMapGenerationDlg::updateZoom(), ccBoundingBoxEditorDlg::updateZWidth(), ccPointPairRegistrationDlg::zoomGlobalOnRegistrationEntities(), MainWindow::zoomOnEntities(), and MainWindow::zoomOnSelectedEntities().

◆ maxCorner() [1/2]

template<typename T >
Vector3Tpl<T>& cloudViewer::BoundingBoxTpl< T >::maxCorner ( )
inline

Returns max corner.

Definition at line 161 of file BoundingBox.h.

References cloudViewer::BoundingBoxTpl< T >::m_bbMax.

◆ maxCorner() [2/2]

template<typename T >
const Vector3Tpl<T>& cloudViewer::BoundingBoxTpl< T >::maxCorner ( ) const
inline

Returns max corner (const)

Definition at line 156 of file BoundingBox.h.

References cloudViewer::BoundingBoxTpl< T >::m_bbMax.

Referenced by ccBoundingBoxEditorDlg::checkBaseInclusion(), PCLDisplayTools::checkEntityNeedUpdate(), ccRasterGrid::ComputeGridSize(), ccEntityAction::computeOctree(), cloudViewer::visualization::ViewControl::ConvertFromViewParameters(), ccBBox::CreateFromPoints(), ccCropTool::Crop(), DistanceMapGenerationDlg::DistanceMapGenerationDlg(), PCLDisplayTools::drawBBox(), ccClipBox::drawMeOnly(), ccRasterizeTool::ExportGeoTiff(), ccQuadric::Fit(), cloudViewer::t::geometry::AxisAlignedBoundingBox::FromLegacy(), cloudViewer::geometry::Octree::GetAxisAlignedBoundingBox(), cloudViewer::geometry::VoxelGrid::GetAxisAlignedBoundingBox(), cloudViewer::PointCloudTpl< T >::getBoundingBox(), cloudViewer::ReferenceCloud::getBoundingBox(), ccMesh::getBoundingBox(), ccSubMesh::getBoundingBox(), cloudViewer::BoundingBoxTpl< T >::getBounds(), ccKdTree::getCellBBox(), GetCellBBoxVisitor::GetCellBBoxVisitor(), cvCutFilter::getInteractorBounds(), cvProbeFilter::getInteractorBounds(), cvStreamlineFilter::getInteractorBounds(), ccPolyline::GetMaxBound(), ccClipBox::getOwnBB(), ccGenericPointCloud::getOwnBB(), ccIndexedTransformationBuffer::getOwnBB(), ccPolyline::getOwnBB(), ccHObject::getOwnGlobalBB(), ccShiftedObject::getOwnGlobalBB(), MakeSquare(), ccClipBox::move3D(), cloudViewer::BoundingBoxTpl< T >::operator+=(), ccBBox::operator+=(), CommandCrossSection::process(), ccBoundingBoxEditorDlg::reflectChanges(), DxfFilter::saveToFile(), ccOctreeSpinBox::setCloud(), PclUtils::PCLVis::SetDataAxesGridProperties(), ccClipBox::shift(), ecvFilterTool::shiftBox(), cloudViewer::geometry::Line3D::SlabAABBBase(), cloudViewer::t::geometry::AxisAlignedBoundingBox::ToLegacy(), DistanceMapGenerationDlg::updateZoom(), DrawMeOnlyVisitor::visit(), GetCellBBoxVisitor::visit(), and GetNeighborLeavesVisitor::visit().

◆ minCorner() [1/2]

template<typename T >
Vector3Tpl<T>& cloudViewer::BoundingBoxTpl< T >::minCorner ( )
inline

Returns min corner.

Definition at line 159 of file BoundingBox.h.

References cloudViewer::BoundingBoxTpl< T >::m_bbMin.

◆ minCorner() [2/2]

template<typename T >
const Vector3Tpl<T>& cloudViewer::BoundingBoxTpl< T >::minCorner ( ) const
inline

Returns min corner (const)

Definition at line 154 of file BoundingBox.h.

References cloudViewer::BoundingBoxTpl< T >::m_bbMin.

Referenced by ccBoundingBoxEditorDlg::checkBaseInclusion(), PCLDisplayTools::checkEntityNeedUpdate(), ccRasterGrid::ComputeGridSize(), ccEntityAction::computeOctree(), ccVolumeCalcTool::ComputeVolume(), cloudViewer::visualization::ViewControl::ConvertFromViewParameters(), ccRasterGrid::convertToCloud(), ccBBox::CreateFromPoints(), ccCropTool::Crop(), DistanceMapGenerationDlg::DistanceMapGenerationDlg(), PCLDisplayTools::drawBBox(), ccClipBox::drawMeOnly(), ccRasterizeTool::ExportGeoTiff(), ccQuadric::Fit(), cloudViewer::t::geometry::AxisAlignedBoundingBox::FromLegacy(), ccRasterizeTool::generateContours(), cloudViewer::geometry::Octree::GetAxisAlignedBoundingBox(), cloudViewer::geometry::VoxelGrid::GetAxisAlignedBoundingBox(), cloudViewer::PointCloudTpl< T >::getBoundingBox(), cloudViewer::ReferenceCloud::getBoundingBox(), ccMesh::getBoundingBox(), ccSubMesh::getBoundingBox(), cloudViewer::BoundingBoxTpl< T >::getBounds(), ccKdTree::getCellBBox(), GetCellBBoxVisitor::GetCellBBoxVisitor(), cvCutFilter::getInteractorBounds(), cvProbeFilter::getInteractorBounds(), cvStreamlineFilter::getInteractorBounds(), ccPolyline::GetMinBound(), ccClipBox::getOwnBB(), ccGenericPointCloud::getOwnBB(), ccIndexedTransformationBuffer::getOwnBB(), ccPolyline::getOwnBB(), ccHObject::getOwnGlobalBB(), ccShiftedObject::getOwnGlobalBB(), MakeSquare(), ccClipBox::move3D(), cloudViewer::BoundingBoxTpl< T >::operator+=(), ccBBox::operator+=(), CommandCrossSection::process(), CommandRasterize::process(), ccBoundingBoxEditorDlg::reflectChanges(), DxfFilter::saveToFile(), ccOctreeSpinBox::setCloud(), PclUtils::PCLVis::SetDataAxesGridProperties(), ccPointCloud::setRGBColorByHeight(), ccClipBox::shift(), ecvFilterTool::shiftBox(), cloudViewer::geometry::Line3D::SlabAABBBase(), cloudViewer::t::geometry::AxisAlignedBoundingBox::ToLegacy(), ccRasterizeTool::updateGrid(), DistanceMapGenerationDlg::updateZoom(), DrawMeOnlyVisitor::visit(), GetCellBBoxVisitor::visit(), and GetNeighborLeavesVisitor::visit().

◆ minDistTo()

template<typename T >
T cloudViewer::BoundingBoxTpl< T >::minDistTo ( const BoundingBoxTpl< T > &  bbox) const
inline

Computes min gap (absolute distance) between this bounding-box and another one

Returns
min gap (>=0) or -1 if at least one of the box is not valid

Definition at line 209 of file BoundingBox.h.

References cloudViewer::BoundingBoxTpl< T >::isValid(), cloudViewer::BoundingBoxTpl< T >::m_bbMax, cloudViewer::BoundingBoxTpl< T >::m_bbMin, cloudViewer::BoundingBoxTpl< T >::m_valid, Vector3Tpl< Type >::norm(), and Tuple3Tpl< Type >::u.

Referenced by GetNeighborLeavesVisitor::visit().

◆ operator*=() [1/2]

◆ operator*=() [2/2]

template<typename T >
virtual const BoundingBoxTpl<T>& cloudViewer::BoundingBoxTpl< T >::operator*= ( T  scaleFactor)
inlinevirtual

Scales the bounding box.

Reimplemented in ccBBox.

Definition at line 89 of file BoundingBox.h.

References cloudViewer::BoundingBoxTpl< T >::m_bbMax, cloudViewer::BoundingBoxTpl< T >::m_bbMin, and cloudViewer::BoundingBoxTpl< T >::m_valid.

◆ operator+()

◆ operator+=() [1/2]

template<typename T >
const BoundingBoxTpl<T>& cloudViewer::BoundingBoxTpl< T >::operator+= ( const BoundingBoxTpl< T > &  bbox)
inline

◆ operator+=() [2/2]

template<typename T >
virtual const BoundingBoxTpl<T>& cloudViewer::BoundingBoxTpl< T >::operator+= ( const Vector3Tpl< T > &  V)
inlinevirtual

◆ operator-=()

template<typename T >
virtual const BoundingBoxTpl<T>& cloudViewer::BoundingBoxTpl< T >::operator-= ( const Vector3Tpl< T > &  V)
inlinevirtual

◆ SetColor()

template<typename T >
void cloudViewer::BoundingBoxTpl< T >::SetColor ( const Eigen::Vector3d &  color)
inline

Sets the bounding box color.

Definition at line 265 of file BoundingBox.h.

References color, and cloudViewer::BoundingBoxTpl< T >::color_.

Referenced by cloudViewer::t::geometry::AxisAlignedBoundingBox::ToLegacy().

◆ setValidity()

◆ volume()

template<typename T >
double cloudViewer::BoundingBoxTpl< T >::volume ( ) const
inline

Member Data Documentation

◆ color_

template<typename T >
CCVector3d cloudViewer::BoundingBoxTpl< T >::color_
protected

The color of the bounding box in RGB.

Definition at line 298 of file BoundingBox.h.

Referenced by cloudViewer::BoundingBoxTpl< T >::GetColor(), and cloudViewer::BoundingBoxTpl< T >::SetColor().

◆ m_bbMax

◆ m_bbMin

◆ m_valid


The documentation for this class was generated from the following file: