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...
 
getDiagNorm () const
 Returns diagonal length. More...
 
double getDiagNormd () const
 Returns diagonal length (double precision) More...
 
getMinBoxDim () const
 Returns minimal box dimension. More...
 
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...
 
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()

◆ GetColor()

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

◆ getDiagNorm()

◆ getDiagNormd()

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

◆ 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(), min(), 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(), ccLibAlgorithms::ApplyScaleMatchingAlgorithm(), ccBoundingBoxEditorDlg::ccBoundingBoxEditorDlg(), ccComputeOctreeDlg::ccComputeOctreeDlg(), ccVolumeCalcTool::ccVolumeCalcTool(), ccBoundingBoxEditorDlg::checkBaseInclusion(), ccEntityAction::computeOctree(), ccVolumeCalcTool::ComputeVolume(), ccVolumeCalcTool::ConvertGridToCloud(), cc2Point5DimEditor::convertGridToCloud(), DistanceMapGenerationDlg::DistanceMapGenerationDlg(), cloudViewer::ModelViewerWidget::EndRender(), ccRasterizeTool::ExportGeoTiff(), ccPropertiesTreeDelegate::fillWithHObject(), ccPropertiesTreeDelegate::fillWithViewProperties(), ccRasterizeTool::generateContours(), cloudViewer::PointCloudTpl< T >::getBoundingBox(), cloudViewer::ReferenceCloud::getBoundingBox(), ccInnerRect2DFinder::init(), ccApplyTransformationDlg::initFromDipAndDipDir(), cloudViewer::BoundingBoxTpl< T >::minDistTo(), NormalEstimation::openInputDialog(), GreedyTriangulation::openInputDialog(), MarchingCubeReconstruction::openInputDialog(), PoissonReconstruction::openInputDialog(), cloudViewer::BoundingBoxTpl< T >::operator+(), cloudViewer::BoundingBoxTpl< T >::operator+=(), CommandCrossSection::process(), ccInnerRect2DFinder::process(), ccBoundingBoxEditorDlg::setBaseBBox(), ecvFilterTool::shiftBox(), ccBoundingBoxEditorDlg::updateCurrentBBox(), ccVolumeCalcTool::updateGrid(), ccRasterizeTool::updateGrid(), 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]

◆ 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]

◆ 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.

◆ operator*=() [1/2]

◆ operator*=() [2/2]

template<typename T >
virtual const BoundingBoxTpl<T>& cloudViewer::BoundingBoxTpl< T >::operator*= ( 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: