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

Ellipsoid in Dim-dimensional space. More...

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

Public Types

using value_type = T
 

Public Member Functions

constexpr Ellipsoid () noexcept=default
 Default constructor.
 
constexpr Ellipsoid (Ellipsoid const &) noexcept=default
 Copy constructor.
 
template<std::convertible_to< T > U>
constexpr Ellipsoid (Ellipsoid< Dim, U > const &other) noexcept
 Converting constructor from an ellipsoid with a different scalar type.
 
constexpr Ellipsoid (Vec< Dim, T > center, Vec< Dim, T > radii) noexcept
 Constructs an ellipsoid from a center and radii.
 
constexpr AABB< Dim, T > aabb () const noexcept
 Returns the AABB of the ellipsoid.
 
constexpr Vec< Dim, T > const & center () const noexcept
 Returns the center of the ellipsoid.
 
constexpr Vec< Dim, T > & center () noexcept
 Returns the center of the ellipsoid.
 
constexpr T diameter () const noexcept
 Returns the diameter of the ellipsoid.
 
constexpr bool isDegenerate () const noexcept
 Returns whether the ellipsoid is degenerate.
 
constexpr Vec< Dim, T > max () const noexcept
 Returns the maximum point of the ellipsoid's AABB.
 
constexpr Vec< Dim, T > min () const noexcept
 Returns the minimum point of the ellipsoid's AABB.
 
bool operator== (Ellipsoid const &) const =default
 Equality operator.
 
constexpr T volume () const noexcept
 Returns the volume of the ellipsoid.
 

Static Public Member Functions

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

Public Attributes

Vec< Dim, T > center_
 The center of the ellipsoid.
 
Vec< Dim, T > radii
 The radii of the ellipsoid along each axis.
 

Detailed Description

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

Ellipsoid 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 an ellipsoid defined by a center point and radii along each axis.

Definition at line 67 of file ellipsoid.hpp.

Member Typedef Documentation

◆ value_type

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

Definition at line 68 of file ellipsoid.hpp.

Constructor & Destructor Documentation

◆ Ellipsoid() [1/2]

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

Constructs an ellipsoid from a center and radii.

Parameters
[in]centerThe center point.
[in]radiiThe radii along each axis.

Definition at line 90 of file ellipsoid.hpp.

◆ Ellipsoid() [2/2]

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

Converting constructor from an ellipsoid with a different scalar type.

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

Definition at line 106 of file ellipsoid.hpp.

Member Function Documentation

◆ aabb()

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

Returns the AABB of the ellipsoid.

Returns
The AABB.

Definition at line 145 of file ellipsoid.hpp.

◆ center() [1/2]

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

Returns the center of the ellipsoid.

Returns
The center.

Definition at line 121 of file ellipsoid.hpp.

◆ center() [2/2]

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

Returns the center of the ellipsoid.

Returns
The center.

Definition at line 115 of file ellipsoid.hpp.

◆ diameter()

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

Returns the diameter of the ellipsoid.

Returns
The diameter (twice the maximum radius).

Definition at line 163 of file ellipsoid.hpp.

◆ dimension()

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

Returns the dimensionality of the ellipsoid.

Returns
The dimensionality.

Definition at line 127 of file ellipsoid.hpp.

◆ isDegenerate()

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

Returns whether the ellipsoid is degenerate.

Returns
true if degenerate, false otherwise.

Definition at line 154 of file ellipsoid.hpp.

◆ max()

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

Returns the maximum point of the ellipsoid's AABB.

Returns
The maximum point.

Definition at line 139 of file ellipsoid.hpp.

◆ min()

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

Returns the minimum point of the ellipsoid's AABB.

Returns
The minimum point.

Definition at line 133 of file ellipsoid.hpp.

◆ operator==()

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

Equality operator.

Parameters
[in]otherThe other ellipsoid.
Return values
trueif the ellipsoids are equal
falseotherwise

◆ volume()

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

Returns the volume of the ellipsoid.

Returns
The volume.

Definition at line 169 of file ellipsoid.hpp.

Member Data Documentation

◆ center_

template<std::size_t Dim = 3, std::floating_point T = float>
Vec<Dim, T> ufo::Ellipsoid< Dim, T >::center_

The center of the ellipsoid.

Definition at line 73 of file ellipsoid.hpp.

◆ radii

template<std::size_t Dim = 3, std::floating_point T = float>
Vec<Dim, T> ufo::Ellipsoid< Dim, T >::radii

The radii of the ellipsoid along each axis.

Definition at line 78 of file ellipsoid.hpp.


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