EBGeometry  1.0
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
BoundingVolumes::AABBT< T > Class Template Reference

Axis-aligned bounding box as bounding volume. More...

#include <EBGeometry_BoundingVolumes.hpp>

Public Types

using Vec3 = Vec3T< T >
 Alias which cuts down on typing.
 

Public Member Functions

 AABBT () noexcept
 Default constructor (does nothing)
 
 AABBT (const Vec3T< T > &a_lo, const Vec3T< T > &a_hi) noexcept
 Full constructor taking the low/high corners of the bounding box. More...
 
 AABBT (const AABBT &a_other) noexcept
 Copy constructor of another bounding box. More...
 
 AABBT (const std::vector< AABBT< T >> &a_others) noexcept
 Constructor which creates an AABB which encloses a set of other AABBs. More...
 
template<class P >
 AABBT (const std::vector< Vec3T< P >> &a_points) noexcept
 Template constructor (since mixed precision allowed) which creates an AABB that encloses a set of 3D points. More...
 
virtual ~AABBT () noexcept
 Destructor (does nothing)
 
AABBToperator= (const AABBT< T > &a_other)=default
 Copy assignment. More...
 
template<class P >
void define (const std::vector< Vec3T< P >> &a_points) noexcept
 Define function (since mixed precision allowed) which sets this AABB such that it encloses a set of 3D points. More...
 
bool intersects (const AABBT &a_other) const noexcept
 Check if this AABB intersects another AABB. More...
 
Vec3T< T > & getLowCorner () noexcept
 Get the modifiable lower-left corner of the AABB.
 
const Vec3T< T > & getLowCorner () const noexcept
 Get the immutable lower-left corner of the AABB.
 
Vec3T< T > & getHighCorner () noexcept
 Get the modifiable upper-right corner of the AABB.
 
const Vec3T< T > & getHighCorner () const noexcept
 Get the immutable upper-right corner of the AABB.
 
Vec3 getCentroid () const noexcept
 Get bounding volume centroid.
 
getOverlappingVolume (const AABBT< T > &a_other) const noexcept
 Compute the overlapping volume between this AABB and another AABB. More...
 
getDistance (const Vec3 &a_x0) const noexcept
 Get the distance to this AABB (points inside the bounding box have a zero distance) More...
 
getVolume () const noexcept
 Compute the bounding box volume.
 
getArea () const noexcept
 Compute the bounding box area.
 

Protected Attributes

Vec3 m_loCorner
 Lower-left corner of bounding box.
 
Vec3 m_hiCorner
 Upper-right corner of bounding box.
 

Friends

std::ostream & operator<< (std::ostream &os, const AABBT< T > &aabb)
 For outputting a vector to an output stream.
 

Detailed Description

template<class T>
class BoundingVolumes::AABBT< T >

Axis-aligned bounding box as bounding volume.

This class represents a Cartesian box that encloses a set of 3D points.

Note
The template parameter T is the precision.

Constructor & Destructor Documentation

◆ AABBT() [1/4]

template<class T >
BoundingVolumes::AABBT< T >::AABBT ( const Vec3T< T > &  a_lo,
const Vec3T< T > &  a_hi 
)
inlinenoexcept

Full constructor taking the low/high corners of the bounding box.

Parameters
[in]a_loLow corner
[in]a_hiHigh

◆ AABBT() [2/4]

template<class T >
BoundingVolumes::AABBT< T >::AABBT ( const AABBT< T > &  a_other)
inlinenoexcept

Copy constructor of another bounding box.

Parameters
[in]a_otherOther bounding box

◆ AABBT() [3/4]

template<class T >
BoundingVolumes::AABBT< T >::AABBT ( const std::vector< AABBT< T >> &  a_others)
inlinenoexcept

Constructor which creates an AABB which encloses a set of other AABBs.

Parameters
[in]a_othersOther bounding boxes

◆ AABBT() [4/4]

template<class T >
template<class P >
BoundingVolumes::AABBT< T >::AABBT ( const std::vector< Vec3T< P >> &  a_points)
inlinenoexcept

Template constructor (since mixed precision allowed) which creates an AABB that encloses a set of 3D points.

Parameters
[in]a_pointsSet of 3D points
Note
Calls the define function

Member Function Documentation

◆ define()

template<class T >
template<class P >
void BoundingVolumes::AABBT< T >::define ( const std::vector< Vec3T< P >> &  a_points)
inlinenoexcept

Define function (since mixed precision allowed) which sets this AABB such that it encloses a set of 3D points.

Parameters
[in]a_pointsSet of 3D points

◆ getDistance()

template<class T >
T BoundingVolumes::AABBT< T >::getDistance ( const Vec3 a_x0) const
inlinenoexcept

Get the distance to this AABB (points inside the bounding box have a zero distance)

Parameters
[in]a_x03D point
Returns
Returns the distance to the bounding box (a point inside has a zero distance)

◆ getOverlappingVolume()

template<class T >
T BoundingVolumes::AABBT< T >::getOverlappingVolume ( const AABBT< T > &  a_other) const
inlinenoexcept

Compute the overlapping volume between this AABB and another AABB.

Parameters
[in]a_otherThe other AABB
Returns
Returns overlapping volume

◆ intersects()

template<class T >
bool BoundingVolumes::AABBT< T >::intersects ( const AABBT< T > &  a_other) const
inlinenoexcept

Check if this AABB intersects another AABB.

Parameters
[in]a_otherThe other AABB
Returns
True if they intersect and false otherwise.

◆ operator=()

template<class T >
AABBT& BoundingVolumes::AABBT< T >::operator= ( const AABBT< T > &  a_other)
default

Copy assignment.

Parameters
[in]a_otherOther bounding box

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