Public Types | Public Member Functions | Private Attributes | List of all members
lvr2::BoundingBox< BaseVecT > Class Template Reference

A dynamic bounding box class. More...

#include <BoundingBox.hpp>

Public Types

using VectorType = BaseVecT
 

Public Member Functions

 BoundingBox ()
 Default constructor. More...
 
 BoundingBox (std::string plyPath)
 Constructs a bounding box for a given point cloud. More...
 
template<typename T >
 BoundingBox (T v1, T v2)
 Constructs a bounding box with from the given vertices. More...
 
void expand (const BoundingBox< BaseVecT > &bb)
 Calculates the surrounding bounding box of the current volume and the other given bounding box. More...
 
template<typename T >
void expand (T v)
 Expands the bounding box if the given Vector v} is outside the current volume. More...
 
BaseVecT getCentroid () const
 Returns the center Vector of the bounding box. More...
 
BaseVecT::CoordType getLongestSide () const
 Returns the longest side of the bounding box. More...
 
BaseVecT getMax () const
 Returns the upper right coordinates. More...
 
BaseVecT getMin () const
 Returns the lower left coordinates. More...
 
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. More...
 
BaseVecT::CoordType getVolume () const
 Returns the volume of the bounding box. More...
 
BaseVecT::CoordType getXSize () const
 Returns the x-size of the bounding box. More...
 
BaseVecT::CoordType getYSize () const
 Returns the y-size of the bounding box. More...
 
BaseVecT::CoordType getZSize () const
 Returns the z-size of the bounding box. More...
 
bool isValid () const
 Returns true if the bounding box has been expanded before or was initialized with a preset size. More...
 
bool overlap (const BoundingBox< BaseVecT > &bb)
 check if current volume overlap with a given bounding box More...
 

Private Attributes

BaseVecT m_centroid
 The center Vector of the bounding box. More...
 
BaseVecT m_max
 The upper right Vector of the bounding box. More...
 
BaseVecT m_min
 The lower left Vector of the bounding box. More...
 

Detailed Description

template<typename BaseVecT>
class lvr2::BoundingBox< BaseVecT >

A dynamic bounding box class.

Definition at line 49 of file BoundingBox.hpp.

Member Typedef Documentation

◆ VectorType

template<typename BaseVecT >
using lvr2::BoundingBox< BaseVecT >::VectorType = BaseVecT

Definition at line 53 of file BoundingBox.hpp.

Constructor & Destructor Documentation

◆ BoundingBox() [1/3]

template<typename BaseVecT >
lvr2::BoundingBox< BaseVecT >::BoundingBox ( )

Default constructor.

◆ BoundingBox() [2/3]

template<typename BaseVecT >
template<typename T >
lvr2::BoundingBox< BaseVecT >::BoundingBox ( v1,
v2 
)

Constructs a bounding box with from the given vertices.

Parameters
v1Lower left corner of the BoundingBox
v2Upper right corner of the BoundingBox
Returns

◆ BoundingBox() [3/3]

template<typename BaseVecT >
lvr2::BoundingBox< BaseVecT >::BoundingBox ( std::string  plyPath)

Constructs a bounding box for a given point cloud.

Parameters
plyPathpath of the point cloud

Member Function Documentation

◆ expand() [1/2]

template<typename BaseVecT >
void lvr2::BoundingBox< BaseVecT >::expand ( const BoundingBox< BaseVecT > &  bb)
inline

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

Parameters
bbAnother bounding box

◆ expand() [2/2]

template<typename BaseVecT >
template<typename T >
void lvr2::BoundingBox< BaseVecT >::expand ( v)
inline

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

Parameters
vA 3d Vector

◆ getCentroid()

template<typename BaseVecT >
BaseVecT lvr2::BoundingBox< BaseVecT >::getCentroid ( ) const

Returns the center Vector of the bounding box.

◆ getLongestSide()

template<typename BaseVecT >
BaseVecT::CoordType lvr2::BoundingBox< BaseVecT >::getLongestSide ( ) const

Returns the longest side of the bounding box.

◆ getMax()

template<typename BaseVecT >
BaseVecT lvr2::BoundingBox< BaseVecT >::getMax ( ) const

Returns the upper right coordinates.

◆ getMin()

template<typename BaseVecT >
BaseVecT lvr2::BoundingBox< BaseVecT >::getMin ( ) const

Returns the lower left coordinates.

◆ getRadius()

template<typename BaseVecT >
BaseVecT::CoordType lvr2::BoundingBox< BaseVecT >::getRadius ( ) const

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

◆ getVolume()

template<typename BaseVecT >
BaseVecT::CoordType lvr2::BoundingBox< BaseVecT >::getVolume ( ) const

Returns the volume of the bounding box.

Returns

◆ getXSize()

template<typename BaseVecT >
BaseVecT::CoordType lvr2::BoundingBox< BaseVecT >::getXSize ( ) const

Returns the x-size of the bounding box.

◆ getYSize()

template<typename BaseVecT >
BaseVecT::CoordType lvr2::BoundingBox< BaseVecT >::getYSize ( ) const

Returns the y-size of the bounding box.

◆ getZSize()

template<typename BaseVecT >
BaseVecT::CoordType lvr2::BoundingBox< BaseVecT >::getZSize ( ) const

Returns the z-size of the bounding box.

◆ isValid()

template<typename BaseVecT >
bool lvr2::BoundingBox< BaseVecT >::isValid ( ) const

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

◆ overlap()

template<typename BaseVecT >
bool lvr2::BoundingBox< BaseVecT >::overlap ( const BoundingBox< BaseVecT > &  bb)

check if current volume overlap with a given bounding box

Parameters
bbAnother bounding box
Returns
true if both boxes overlap

Member Data Documentation

◆ m_centroid

template<typename BaseVecT >
BaseVecT lvr2::BoundingBox< BaseVecT >::m_centroid
private

The center Vector of the bounding box.

Definition at line 165 of file BoundingBox.hpp.

◆ m_max

template<typename BaseVecT >
BaseVecT lvr2::BoundingBox< BaseVecT >::m_max
private

The upper right Vector of the bounding box.

Definition at line 162 of file BoundingBox.hpp.

◆ m_min

template<typename BaseVecT >
BaseVecT lvr2::BoundingBox< BaseVecT >::m_min
private

The lower left Vector of the bounding box.

Definition at line 159 of file BoundingBox.hpp.


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


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:27