CCCoreLib 31 May 2022
CloudCompare Core algorithms
|
Bounding box structure. More...
#include <BoundingBox.h>
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. | |
T | getDiagNorm () const |
Returns diagonal length. | |
double | getDiagNormd () const |
Returns diagonal length (double precision) | |
T | getMinBoxDim () const |
Returns minimal box dimension. | |
T | 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. | |
T | 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. | |
Bounding box structure.
|
inline |
Resets the bounding box.
(0,0,0) --> (0,0,0)
|
inline |
Returns whether a points is inside the box or not.
Warning: box should be valid!
|
inline |
Computes min gap (absolute distance) between this bounding-box and another one.