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

Line segment in Dim-dimensional space. More...

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

Public Types

using value_type = T
 

Public Member Functions

constexpr LineSegment () noexcept=default
 Default constructor.
 
constexpr LineSegment (LineSegment const &) noexcept=default
 Copy constructor.
 
template<std::convertible_to< T > U>
constexpr LineSegment (LineSegment< Dim, U > const &other) noexcept
 Converting constructor from a line segment with a different scalar type.
 
constexpr LineSegment (Vec< Dim, T > const &start, Vec< Dim, T > const &end) noexcept
 Constructs a line segment from a start and an end point.
 
constexpr AABB< Dim, T > aabb () const noexcept
 Returns the AABB of the line segment.
 
constexpr Vec< Dim, T > at (T t) const noexcept
 Returns the point at parameter t along the line segment.
 
constexpr Vec< Dim, T > center () const noexcept
 Returns the center of the line segment.
 
constexpr T diameter () const noexcept
 Returns the diameter of the line segment.
 
constexpr bool isDegenerate (T eps=std::numeric_limits< T >::epsilon()) const noexcept
 Returns whether the line segment is degenerate.
 
constexpr T length () const noexcept
 Returns the length of the line segment.
 
bool operator== (LineSegment const &) const =default
 Equality operator.
 
constexpr T volume () const noexcept
 Returns the volume of the line segment.
 

Static Public Member Functions

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

Public Attributes

Vec< Dim, T > end
 The end point of the line segment.
 
Vec< Dim, T > start
 The start point of the line segment.
 

Detailed Description

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

Line segment in Dim-dimensional space.

Represents a line segment defined by a start and an end point.

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

Definition at line 68 of file line_segment.hpp.

Member Typedef Documentation

◆ value_type

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

Definition at line 69 of file line_segment.hpp.

Constructor & Destructor Documentation

◆ LineSegment() [1/2]

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

Constructs a line segment from a start and an end point.

Parameters
[in]startThe start point.
[in]endThe end point.

Definition at line 92 of file line_segment.hpp.

◆ LineSegment() [2/2]

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

Converting constructor from a line segment with a different scalar type.

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

Definition at line 109 of file line_segment.hpp.

Member Function Documentation

◆ aabb()

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

Returns the AABB of the line segment.

Returns
The AABB.

Definition at line 168 of file line_segment.hpp.

◆ at()

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

Returns the point at parameter t along the line segment.

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

Definition at line 133 of file line_segment.hpp.

◆ center()

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

Returns the center of the line segment.

Returns
The center.

Definition at line 142 of file line_segment.hpp.

◆ diameter()

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

Returns the diameter of the line segment.

Returns
The length of the segment.

Definition at line 151 of file line_segment.hpp.

◆ dimension()

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

Returns the dimensionality of the line segment.

Returns
The dimensionality.

Definition at line 118 of file line_segment.hpp.

◆ isDegenerate()

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

Returns whether the line segment is degenerate.

Parameters
[in]epsThe epsilon value for the check.
Returns
true if degenerate, false otherwise.

Definition at line 158 of file line_segment.hpp.

◆ length()

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

Returns the length of the line segment.

Returns
The length.

Definition at line 125 of file line_segment.hpp.

◆ volume()

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

Returns the volume of the line segment.

Returns
The volume (always 0).

Definition at line 177 of file line_segment.hpp.

Member Data Documentation

◆ end

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

The end point of the line segment.

Definition at line 79 of file line_segment.hpp.

◆ start

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

The start point of the line segment.

Definition at line 74 of file line_segment.hpp.


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