Public Member Functions | Static Public Member Functions | Friends | List of all members
lvr2::Normal< CoordType > Struct Template Reference

A vector guaranteed to be normalized (length = 1). More...

#include <BaseVector.hpp>

Public Member Functions

CoordType getX () const
 
CoordType getY () const
 
CoordType getZ () const
 
 Normal ()
 
 Normal (BaseVector< CoordType > base)
 Creates a normal vector from the underlying vector representation. More...
 
 Normal (CoordType x, CoordType y, CoordType z)
 Initializes the normal with the given coordinates. More...
 
template<typename T >
Normal< CoordType > operator+ (const T &other) const
 
Normal< CoordType > operator- () const
 
template<typename T >
Normal< CoordType > operator- (const T &other) const
 
template<typename T >
Normal< CoordType > & operator= (const T &other)
 

Static Public Member Functions

template<typename CollectionT >
static Normal< CoordType > & average (const CollectionT &normals)
 Returns the average of all normals in the given collection. More...
 

Friends

template<typename T , typename S >
Normal< T > operator* (const Eigen::Matrix< S, 4, 4 > &mat, const Normal< T > &normal)
 

Detailed Description

template<typename CoordType>
struct lvr2::Normal< CoordType >

A vector guaranteed to be normalized (length = 1).

If you have an object of type Normal, you can be sure that it always has the length 1. The easiest way to create a Normal is to use the method Vector::normalized().

Definition at line 49 of file BaseVector.hpp.

Constructor & Destructor Documentation

◆ Normal() [1/3]

template<typename CoordType >
lvr2::Normal< CoordType >::Normal ( )
inline

Definition at line 62 of file Normal.hpp.

◆ Normal() [2/3]

template<typename CoordType >
lvr2::Normal< CoordType >::Normal ( BaseVector< CoordType >  base)
explicit

Creates a normal vector from the underlying vector representation.

Parameters
baseThis vector must not be the null-vector, else the behavior is undefined.

◆ Normal() [3/3]

template<typename CoordType >
lvr2::Normal< CoordType >::Normal ( CoordType  x,
CoordType  y,
CoordType  z 
)

Initializes the normal with the given coordinates.

Note that the given coordinates must not form the null-vector, else the behavior is undefined.

Member Function Documentation

◆ average()

template<typename CoordType >
template<typename CollectionT >
static Normal<CoordType>& lvr2::Normal< CoordType >::average ( const CollectionT &  normals)
static

Returns the average of all normals in the given collection.

The collection need to work with a range-based for-loop and its elements need to be normals. It has to contain at least one element.

◆ getX()

template<typename CoordType >
CoordType lvr2::Normal< CoordType >::getX ( ) const
inline

Definition at line 92 of file Normal.hpp.

◆ getY()

template<typename CoordType >
CoordType lvr2::Normal< CoordType >::getY ( ) const
inline

Definition at line 97 of file Normal.hpp.

◆ getZ()

template<typename CoordType >
CoordType lvr2::Normal< CoordType >::getZ ( ) const
inline

Definition at line 102 of file Normal.hpp.

◆ operator+()

template<typename CoordType >
template<typename T >
Normal<CoordType> lvr2::Normal< CoordType >::operator+ ( const T &  other) const

◆ operator-() [1/2]

template<typename CoordType >
Normal<CoordType> lvr2::Normal< CoordType >::operator- ( ) const

◆ operator-() [2/2]

template<typename CoordType >
template<typename T >
Normal<CoordType> lvr2::Normal< CoordType >::operator- ( const T &  other) const

◆ operator=()

template<typename CoordType >
template<typename T >
Normal<CoordType>& lvr2::Normal< CoordType >::operator= ( const T &  other)

Allows to assign Vectors to normals. Vector data will be copied and normalized.

Friends And Related Function Documentation

◆ operator*

template<typename CoordType >
template<typename T , typename S >
Normal<T> operator* ( const Eigen::Matrix< S, 4, 4 > &  mat,
const Normal< T > &  normal 
)
friend

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


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:27