Template Class BoundingBox

Class Documentation

template<typename BaseVecT>
class BoundingBox

A dynamic bounding box class.

Public Types

using VectorType = BaseVecT

Public Functions

BoundingBox()

Default constructor.

template<typename T>
BoundingBox(T v1, T v2)

Constructs a bounding box with from the given vertices.

Parameters:
Returns:

explicit BoundingBox(std::string plyPath)

Constructs a bounding box for a given point cloud.

Parameters:

plyPath – path of the point cloud

template<typename T>
inline void expand(T v)

Expands the bounding box if the given Vector v} is outside the current volume.

Parameters:

v – A 3d Vector

inline void expand(const BoundingBox<BaseVecT> &bb)

Calculates the surrounding bounding box of the current volume and the other given bounding box.

Parameters:

bb – Another bounding box

BaseVecT::CoordType getRadius() const

Returns the radius of the current volume, i.e. the distance between the centroid and the most distant corner from this Vector.

bool isValid() const

Returns true if the bounding box has been expanded before or was initialized with a preset size.

BaseVecT getCentroid() const

Returns the center Vector of the bounding box.

bool contains(const BaseVecT &v) const

Checks if the given Vector is inside the bounding box.

Parameters:

v – The Vector

bool overlap(const BoundingBox<BaseVecT> &bb) const

check if current volume overlap with a given bounding box

Parameters:

bb – Another bounding box

Returns:

true if both boxes overlap

BaseVecT::CoordType getLongestSide() const

Returns the longest side of the bounding box.

BaseVecT::CoordType getXSize() const

Returns the x-size of the bounding box.

BaseVecT::CoordType getYSize() const

Returns the y-size of the bounding box.

BaseVecT::CoordType getZSize() const

Returns the z-size of the bounding box.

BaseVecT::CoordType getVolume() const

Returns the volume of the bounding box.

Returns:

BaseVecT getMax() const

Returns the upper right coordinates.

BaseVecT getMin() const

Returns the lower left coordinates.