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

Plane in space. More...

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

Public Types

using value_type = T
 

Public Member Functions

constexpr Plane () noexcept=default
 Default constructor.
 
constexpr Plane (Plane const &) noexcept=default
 Copy constructor.
 
template<std::convertible_to< T > U>
constexpr Plane (Plane< Dim, U > const &other) noexcept
 Conversion operator to a plane with a different scalar type.
 
constexpr Plane (Vec< Dim, T > const &normal) noexcept
 Constructs a plane from a normal.
 
constexpr Plane (Vec< Dim, T > const &normal, T distance) noexcept
 Constructs a plane from a normal and a distance.
 
constexpr Plane (Vec< Dim, T > const &v_1, Vec< Dim, T > const &v_2) noexcept
 Constructs a plane from two points.
 
constexpr Plane (Vec< Dim, T > const &v_1, Vec< Dim, T > const &v_2, Vec< Dim, T > const &v_3) noexcept
 Constructs a plane from three points.
 
constexpr AABB< Dim, T > aabb () const noexcept
 Returns the AABB of the plane.
 
constexpr T diameter () const noexcept
 Returns the diameter of the plane.
 
constexpr bool isDegenerate () const noexcept
 Returns whether the plane is degenerate.
 
bool operator== (Plane const &) const =default
 Equality operator.
 
constexpr T volume () const noexcept
 Returns the volume of the plane.
 

Static Public Member Functions

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

Public Attributes

distance {}
 The distance from the origin.
 
Vec< Dim, T > normal
 The normal of the plane.
 

Detailed Description

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

Plane in space.

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

Represents a plane defined by a normal and a distance from the origin. The plane is defined by the equation: normal . x = distance

Definition at line 69 of file plane.hpp.

Member Typedef Documentation

◆ value_type

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

Definition at line 70 of file plane.hpp.

Constructor & Destructor Documentation

◆ Plane() [1/5]

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr ufo::Plane< Dim, T >::Plane ( Vec< Dim, T > const &  normal)
inlineexplicitconstexprnoexcept

Constructs a plane from a normal.

Parameters
[in]normalThe normal of the plane.

Definition at line 96 of file plane.hpp.

◆ Plane() [2/5]

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

Constructs a plane from a normal and a distance.

Parameters
[in]normalThe normal of the plane.
[in]distanceThe distance from the origin.

Definition at line 103 of file plane.hpp.

◆ Plane() [3/5]

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

Constructs a plane from two points.

Parameters
[in]v_1The first point.
[in]v_2The second point.

Definition at line 113 of file plane.hpp.

◆ Plane() [4/5]

template<std::size_t Dim = 3, std::floating_point T = float>
constexpr ufo::Plane< Dim, T >::Plane ( Vec< Dim, T > const &  v_1,
Vec< Dim, T > const &  v_2,
Vec< Dim, T > const &  v_3 
)
inlineconstexprnoexcept

Constructs a plane from three points.

Parameters
[in]v_1The first point.
[in]v_2The second point.
[in]v_3The third point.

Definition at line 127 of file plane.hpp.

◆ Plane() [5/5]

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

Conversion operator to a plane with a different scalar type.

Definition at line 141 of file plane.hpp.

Member Function Documentation

◆ aabb()

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

Returns the AABB of the plane.

Returns
The AABB.

Definition at line 188 of file plane.hpp.

◆ diameter()

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

Returns the diameter of the plane.

Returns
The diameter (always infinity).

Definition at line 179 of file plane.hpp.

◆ dimension()

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

Returns the dimensionality of the plane.

Returns
The dimensionality.

Definition at line 150 of file plane.hpp.

◆ isDegenerate()

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

Returns whether the plane is degenerate.

Returns
true if degenerate, false otherwise.

Definition at line 164 of file plane.hpp.

◆ operator==()

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

Equality operator.

Parameters
[in]otherThe other plane.
Return values
trueif the planes are equal
falseotherwise

◆ volume()

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

Returns the volume of the plane.

Returns
The volume (always 0).

Definition at line 173 of file plane.hpp.

Member Data Documentation

◆ distance

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

The distance from the origin.

Definition at line 80 of file plane.hpp.

◆ normal

template<std::size_t Dim = 3, std::floating_point T = float>
Vec<Dim, T> ufo::Plane< Dim, T >::normal

The normal of the plane.

Definition at line 75 of file plane.hpp.


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