CCCoreLib 31 May 2022
CloudCompare Core algorithms
Public Member Functions | Protected Attributes | List of all members
CCCoreLib::BoundingBoxTpl< T > Class Template Reference

Bounding box structure. More...

#include <BoundingBox.h>

Collaboration diagram for CCCoreLib::BoundingBoxTpl< T >:
Collaboration graph
[legend]

Public Member Functions

 BoundingBoxTpl ()
 Default constructor.
 
 BoundingBoxTpl (const Vector3Tpl< T > &minCorner, const Vector3Tpl< T > &maxCorner, bool valid)
 Constructor from two vectors (lower min. and upper max. corners)
 
BoundingBoxTpl< T > operator+ (const BoundingBoxTpl< T > &bbox) const
 Returns the 'sum' of this bounding-box and another one.
 
const BoundingBoxTpl< T > & operator+= (const BoundingBoxTpl< T > &bbox)
 In place 'sum' of this bounding-box with another one.
 
const BoundingBoxTpl< T > & operator+= (const Vector3Tpl< T > &V)
 Shifts the bounding box with a vector.
 
const BoundingBoxTpl< T > & operator-= (const Vector3Tpl< T > &V)
 Shifts the bounding box with a vector.
 
const BoundingBoxTpl< T > & operator*= (T scaleFactor)
 Scales the bounding box.
 
const BoundingBoxTpl< T > & operator*= (const SquareMatrixTpl< T > &mat)
 Rotates the bounding box.
 
void clear ()
 Resets the bounding box. More...
 
void add (const Vector3Tpl< T > &P)
 'Enlarges' the bounding box with a point
 
const Vector3Tpl< T > & minCorner () const
 Returns min corner (const)
 
const Vector3Tpl< T > & maxCorner () const
 Returns max corner (const)
 
Vector3Tpl< T > & minCorner ()
 Returns min corner.
 
Vector3Tpl< T > & maxCorner ()
 Returns max corner.
 
Vector3Tpl< T > getCenter () const
 Returns center.
 
Vector3Tpl< T > getDiagVec () const
 Returns diagonal vector.
 
getDiagNorm () const
 Returns diagonal length.
 
double getDiagNormd () const
 Returns diagonal length (double precision)
 
getMinBoxDim () const
 Returns minimal box dimension.
 
getMaxBoxDim () const
 Returns maximal box dimension.
 
double computeVolume () const
 Returns the bounding-box volume.
 
void setValidity (bool state)
 Sets bonding box validity.
 
bool isValid () const
 Returns whether bounding box is valid or not.
 
minDistTo (const BoundingBoxTpl< T > &bbox) const
 Computes min gap (absolute distance) between this bounding-box and another one. More...
 
bool contains (const Vector3Tpl< T > &P) const
 Returns whether a points is inside the box or not. More...
 

Protected Attributes

Vector3Tpl< T > m_bbMin
 Lower min. corner.
 
Vector3Tpl< T > m_bbMax
 Upper max. corner.
 
bool m_valid
 Validity.
 

Detailed Description

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

Bounding box structure.

Member Function Documentation

◆ clear()

template<typename T >
void CCCoreLib::BoundingBoxTpl< T >::clear ( )
inline

Resets the bounding box.

(0,0,0) --> (0,0,0)

◆ contains()

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

Returns whether a points is inside the box or not.

Warning: box should be valid!

◆ minDistTo()

template<typename T >
T CCCoreLib::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

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