UFO 1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
ufo::AABB< Dim, T > Struct Template Reference

Axis-Aligned Bounding Box (AABB) in Dim-dimensional space. More...

#include <lib/geometry/include/ufo/geometry/aabb.hpp>

Public Types

using value_type = T
 

Public Member Functions

constexpr AABB () noexcept=default
 Default constructor.
 
constexpr AABB (AABB const &) noexcept=default
 Copy constructor.
 
template<std::convertible_to< T > U>
constexpr AABB (AABB< Dim, U > const &other) noexcept
 Converting constructor from an AABB with a different scalar type.
 
constexpr AABB (Vec< Dim, T > const &center, T half_length) noexcept
 Constructs an AABB from a center point and a half-length.
 
constexpr AABB (Vec< Dim, T > const &min, Vec< Dim, T > const &max) noexcept
 Constructs an AABB from a minimum and maximum point.
 
constexpr AABB aabb () const noexcept
 Returns the AABB of the AABB.
 
constexpr Vec< Dim, T > center () const noexcept
 Returns the center of the AABB.
 
constexpr T diagonal () const noexcept
 Returns the diagonal length of the AABB.
 
constexpr Vec< Dim, T > halfLength () const noexcept
 Returns the half-length (extent) of the AABB in each dimension.
 
constexpr bool isDegenerate () const noexcept
 Returns whether the AABB is degenerate.
 
constexpr Vec< Dim, T > length () const noexcept
 Returns the length (extent) of the AABB in each dimension.
 
bool operator== (AABB const &) const =default
 Equality operator.
 
constexpr T volume () const noexcept
 Returns the volume of the AABB.
 

Static Public Member Functions

static constexpr std::size_t dimension () noexcept
 Returns the dimensionality of the AABB.
 

Public Attributes

Vec< Dim, T > max
 The maximum point.
 
Vec< Dim, T > min
 The minimum point.
 

Detailed Description

template<std::size_t Dim = 3, std::floating_point T = float>
struct ufo::AABB< Dim, T >

Axis-Aligned Bounding Box (AABB) in Dim-dimensional space.

Template Parameters
DimThe dimensionality of the space (default: 3).
TThe numeric type (default: float), must be a floating-point type.

Represents a bounding box defined by a minimum and maximum point.

Definition at line 70 of file aabb.hpp.

Member Typedef Documentation

◆ value_type

template<std::size_t Dim = 3, std::floating_point T = float>
using ufo::AABB< Dim, T >::value_type = T

Definition at line 71 of file aabb.hpp.

Constructor & Destructor Documentation

◆ AABB() [1/3]

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr ufo::AABB< Dim, T >::AABB ( Vec< Dim, T > const &  min,
Vec< Dim, T > const &  max 
)
inlineconstexprnoexcept

Constructs an AABB from a minimum and maximum point.

Parameters
[in]minThe minimum point.
[in]maxThe maximum point.

Definition at line 94 of file aabb.hpp.

◆ AABB() [2/3]

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr ufo::AABB< Dim, T >::AABB ( Vec< Dim, T > const &  center,
half_length 
)
inlineconstexprnoexcept

Constructs an AABB from a center point and a half-length.

Parameters
[in]centerThe center point.
[in]half_lengthThe half-length.

Definition at line 105 of file aabb.hpp.

◆ AABB() [3/3]

template<std::size_t Dim = 3, std::floating_point T = float>
template<std::convertible_to< T > U>
constexpr ufo::AABB< Dim, T >::AABB ( AABB< Dim, U > const &  other)
inlineexplicitconstexprnoexcept

Converting constructor from an AABB with a different scalar type.

Template Parameters
UThe scalar type of the other AABB.
Parameters
[in]otherThe other AABB.

Definition at line 122 of file aabb.hpp.

Member Function Documentation

◆ aabb()

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr AABB ufo::AABB< Dim, T >::aabb ( ) const
inlineconstexprnoexcept

Returns the AABB of the AABB.

Returns
The AABB.

Definition at line 181 of file aabb.hpp.

◆ center()

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr Vec< Dim, T > ufo::AABB< Dim, T >::center ( ) const
inlineconstexprnoexcept

Returns the center of the AABB.

Returns
The center.

Definition at line 137 of file aabb.hpp.

◆ diagonal()

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr T ufo::AABB< Dim, T >::diagonal ( ) const
inlineconstexprnoexcept

Returns the diagonal length of the AABB.

Returns
The diagonal length.

Definition at line 161 of file aabb.hpp.

◆ dimension()

template<std::size_t Dim = 3, std::floating_point T = float>
static constexpr std::size_t ufo::AABB< Dim, T >::dimension ( )
inlinestaticconstexprnoexcept

Returns the dimensionality of the AABB.

Returns
The dimensionality.

Definition at line 131 of file aabb.hpp.

◆ halfLength()

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr Vec< Dim, T > ufo::AABB< Dim, T >::halfLength ( ) const
inlineconstexprnoexcept

Returns the half-length (extent) of the AABB in each dimension.

Returns
The half-length.

Definition at line 152 of file aabb.hpp.

◆ isDegenerate()

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr bool ufo::AABB< Dim, T >::isDegenerate ( ) const
inlineconstexprnoexcept

Returns whether the AABB is degenerate.

Returns
true if degenerate, false otherwise.

Definition at line 187 of file aabb.hpp.

◆ length()

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr Vec< Dim, T > ufo::AABB< Dim, T >::length ( ) const
inlineconstexprnoexcept

Returns the length (extent) of the AABB in each dimension.

Returns
The length.

Definition at line 146 of file aabb.hpp.

◆ operator==()

template<std::size_t Dim = 3, std::floating_point T = float>
bool ufo::AABB< Dim, T >::operator== ( AABB< Dim, T > const &  ) const
default

Equality operator.

Parameters
[in]otherThe other AABB.
Return values
trueif the AABBs are equal
falseotherwise

◆ volume()

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr T ufo::AABB< Dim, T >::volume ( ) const
inlineconstexprnoexcept

Returns the volume of the AABB.

Returns
The volume.

Definition at line 167 of file aabb.hpp.

Member Data Documentation

◆ max

template<std::size_t Dim = 3, std::floating_point T = float>
Vec<Dim, T> ufo::AABB< Dim, T >::max

The maximum point.

Definition at line 81 of file aabb.hpp.

◆ min

template<std::size_t Dim = 3, std::floating_point T = float>
Vec<Dim, T> ufo::AABB< Dim, T >::min

The minimum point.

Definition at line 76 of file aabb.hpp.


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