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

Cylinder in Dim-dimensional space. More...

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

Public Types

using value_type = T
 

Public Member Functions

constexpr Cylinder () noexcept=default
 Default constructor.
 
constexpr Cylinder (Cylinder const &) noexcept=default
 Copy constructor.
 
template<std::convertible_to< T > U>
constexpr Cylinder (Cylinder< Dim, U > const &other) noexcept
 Converting constructor from a cylinder with a different scalar type.
 
constexpr Cylinder (Vec< Dim, T > start, Vec< Dim, T > end, T radius) noexcept
 Constructs a cylinder from two cap centers and a radius.
 
constexpr AABB< Dim, T > aabb () const noexcept
 Returns the AABB of the cylinder.
 
constexpr Vec< Dim, T > at (T t) const noexcept
 Returns the point at parameter t along the cylinder axis.
 
constexpr Vec< Dim, T > center () const noexcept
 Returns the center of the cylinder.
 
constexpr T diameter () const noexcept
 Returns the diameter of the cylinder.
 
constexpr bool isDegenerate () const noexcept
 Returns whether the cylinder is degenerate.
 
constexpr T length () const noexcept
 Returns the height (length) of the cylinder.
 
bool operator== (Cylinder const &) const =default
 Equality operator.
 
constexpr T volume () const noexcept
 Returns the volume (or area/length) of the cylinder.
 

Static Public Member Functions

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

Public Attributes

Vec< Dim, T > end
 The end point of the second cap of the cylinder.
 
radius {}
 The radius of the cylinder.
 
Vec< Dim, T > start
 The center of the first cap of the cylinder.
 

Detailed Description

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

Cylinder 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 cylinder defined by two center points (caps) and a radius.

Definition at line 67 of file cylinder.hpp.

Member Typedef Documentation

◆ value_type

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

Definition at line 68 of file cylinder.hpp.

Constructor & Destructor Documentation

◆ Cylinder() [1/2]

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr ufo::Cylinder< Dim, T >::Cylinder ( Vec< Dim, T >  start,
Vec< Dim, T >  end,
radius 
)
inlineconstexprnoexcept

Constructs a cylinder from two cap centers and a radius.

Parameters
[in]center_1The center of the first cap.
[in]center_2The center of the second cap.
[in]radiusThe radius.

Definition at line 96 of file cylinder.hpp.

◆ Cylinder() [2/2]

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

Converting constructor from a cylinder with a different scalar type.

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

Definition at line 112 of file cylinder.hpp.

Member Function Documentation

◆ aabb()

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

Returns the AABB of the cylinder.

Returns
The AABB.

Definition at line 163 of file cylinder.hpp.

◆ at()

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

Returns the point at parameter t along the cylinder axis.

Parameters
[in]tThe parameter [0..1].
Returns
The point at parameter t.

Definition at line 148 of file cylinder.hpp.

◆ center()

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

Returns the center of the cylinder.

Returns
The center.

Definition at line 129 of file cylinder.hpp.

◆ diameter()

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

Returns the diameter of the cylinder.

Returns
The diameter.

Definition at line 138 of file cylinder.hpp.

◆ dimension()

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

Returns the dimensionality of the cylinder.

Returns
The dimensionality.

Definition at line 123 of file cylinder.hpp.

◆ isDegenerate()

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

Returns whether the cylinder is degenerate.

Returns
true if degenerate, false otherwise.

Definition at line 185 of file cylinder.hpp.

◆ length()

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

Returns the height (length) of the cylinder.

Returns
The height.

Definition at line 157 of file cylinder.hpp.

◆ operator==()

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

Equality operator.

Parameters
[in]otherThe other cylinder.
Return values
trueif the cylinders are equal
falseotherwise

◆ volume()

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

Returns the volume (or area/length) of the cylinder.

Returns
The volume.

Definition at line 191 of file cylinder.hpp.

Member Data Documentation

◆ end

template<std::size_t Dim = 3, std::floating_point T = float>
Vec<Dim, T> ufo::Cylinder< Dim, T >::end

The end point of the second cap of the cylinder.

Definition at line 78 of file cylinder.hpp.

◆ radius

template<std::size_t Dim = 3, std::floating_point T = float>
T ufo::Cylinder< Dim, T >::radius {}

The radius of the cylinder.

Definition at line 83 of file cylinder.hpp.

◆ start

template<std::size_t Dim = 3, std::floating_point T = float>
Vec<Dim, T> ufo::Cylinder< Dim, T >::start

The center of the first cap of the cylinder.

Definition at line 73 of file cylinder.hpp.


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