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

Public Types

using value_type = T
 

Public Member Functions

constexpr Line () noexcept=default
 Default constructor.
 
constexpr Line (Line const &) noexcept=default
 Copy constructor.
 
template<std::convertible_to< T > U>
constexpr Line (Line< Dim, U > const &other) noexcept
 Converting constructor from a line with a different scalar type.
 
constexpr Line (Vec< Dim, T > const &origin, Vec< Dim, T > const &direction) noexcept
 Constructs a line from an origin and a direction.
 
constexpr AABB< Dim, T > aabb () const noexcept
 Returns the AABB of the line.
 
constexpr Vec< Dim, T > at (T t) const noexcept
 Returns the point at distance t along the line.
 
constexpr Vec< Dim, T > center () const noexcept
 Returns the center of the line.
 
constexpr T diameter () const noexcept
 Returns the diameter of the line.
 
constexpr bool isDegenerate () const noexcept
 Returns whether the line is degenerate.
 
constexpr Lineoperator= (Line const &) noexcept=default
 Copy assignment operator.
 
constexpr T volume () const noexcept
 Returns the volume of the line.
 

Static Public Member Functions

static constexpr std::size_t dimension () noexcept
 Returns the dimensionality of the line.
 
static constexpr Line fromPoints (Vec< Dim, T > const &v_1, Vec< Dim, T > const &v_2) noexcept
 Constructs a line from two points.
 

Public Attributes

Vec< Dim, T > direction
 The direction of the line.
 
Vec< Dim, T > origin
 The origin point of the line.
 

Detailed Description

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

Definition at line 59 of file line.hpp.

Member Typedef Documentation

◆ value_type

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

Definition at line 60 of file line.hpp.

Constructor & Destructor Documentation

◆ Line() [1/2]

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

Constructs a line from an origin and a direction.

Parameters
[in]originThe origin of the line.
[in]directionThe direction of the line.

Definition at line 88 of file line.hpp.

◆ Line() [2/2]

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

Converting constructor from a line with a different scalar type.

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

Definition at line 113 of file line.hpp.

Member Function Documentation

◆ aabb()

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

Returns the AABB of the line.

Returns
The AABB.

Definition at line 173 of file line.hpp.

◆ at()

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

Returns the point at distance t along the line.

Parameters
[in]tThe distance along the line.
Returns
The point at distance t.

Definition at line 149 of file line.hpp.

◆ center()

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

Returns the center of the line.

Returns
The origin of the line.

Definition at line 142 of file line.hpp.

◆ diameter()

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

Returns the diameter of the line.

Returns
The diameter (always infinity).

Definition at line 158 of file line.hpp.

◆ dimension()

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

Returns the dimensionality of the line.

Returns
The dimensionality.

Definition at line 122 of file line.hpp.

◆ fromPoints()

template<std::size_t Dim = 3, std::floating_point T = float>
static constexpr Line ufo::Line< Dim, T >::fromPoints ( Vec< Dim, T > const &  v_1,
Vec< Dim, T > const &  v_2 
)
inlinestaticconstexprnoexcept

Constructs a line from two points.

Parameters
[in]v_1The first point.
[in]v_2The second point.
Returns
The line passing through v_1 and v_2.

Definition at line 100 of file line.hpp.

◆ isDegenerate()

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

Returns whether the line is degenerate.

Returns
true if degenerate, false otherwise.

Definition at line 133 of file line.hpp.

◆ volume()

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

Returns the volume of the line.

Returns
The volume (always 0).

Definition at line 167 of file line.hpp.

Member Data Documentation

◆ direction

template<std::size_t Dim = 3, std::floating_point T = float>
Vec<Dim, T> ufo::Line< Dim, T >::direction

The direction of the line.

Definition at line 70 of file line.hpp.

◆ origin

template<std::size_t Dim = 3, std::floating_point T = float>
Vec<Dim, T> ufo::Line< Dim, T >::origin

The origin point of the line.

Definition at line 65 of file line.hpp.


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