MeshLib Documentation
Loading...
Searching...
No Matches
MR::SegmPoint< T > Struct Template Reference

encodes a point inside a line segment using relative distance in [0,1] More...

#include <MRSegmPoint.h>

Public Member Functions

 SegmPoint ()=default
 
 SegmPoint (T a)
 
 operator T () const
 
 operator T& ()
 
template<typename U >
interpolate (const U &v0, const U &v1) const
 given values in two vertices, computes interpolated value at this point
 
int inVertex () const
 returns [0,1] if the point is in a vertex or -1 otherwise
 
SegmPoint sym () const
 represents the same point relative to oppositely directed segment
 
bool operator== (const SegmPoint &rhs) const =default
 returns true if two points have equal (a) representation
 
bool operator== (T rhs) const
 

Public Attributes

a = 0
 a in [0,1], a=0 => point is in v0, a=1 => point is in v1
 

Static Public Attributes

static constexpr auto eps = 10 * std::numeric_limits<T>::epsilon()
 

Detailed Description

template<typename T>
struct MR::SegmPoint< T >

encodes a point inside a line segment using relative distance in [0,1]

Constructor & Destructor Documentation

◆ SegmPoint() [1/2]

template<typename T >
MR::SegmPoint< T >::SegmPoint ( )
default

◆ SegmPoint() [2/2]

template<typename T >
MR::SegmPoint< T >::SegmPoint ( T a)
inline

Member Function Documentation

◆ interpolate()

template<typename T >
template<typename U >
U MR::SegmPoint< T >::interpolate ( const U & v0,
const U & v1 ) const
inlinenodiscard

given values in two vertices, computes interpolated value at this point

◆ inVertex()

template<typename T >
int MR::SegmPoint< T >::inVertex ( ) const
inlinenodiscard

returns [0,1] if the point is in a vertex or -1 otherwise

◆ operator T()

template<typename T >
MR::SegmPoint< T >::operator T ( ) const
inline

◆ operator T&()

template<typename T >
MR::SegmPoint< T >::operator T& ( )
inline

◆ operator==() [1/2]

template<typename T >
bool MR::SegmPoint< T >::operator== ( const SegmPoint< T > & rhs) const
nodiscarddefault

returns true if two points have equal (a) representation

◆ operator==() [2/2]

template<typename T >
bool MR::SegmPoint< T >::operator== ( T rhs) const
inlinenodiscard

◆ sym()

template<typename T >
SegmPoint MR::SegmPoint< T >::sym ( ) const
inlinenodiscard

represents the same point relative to oppositely directed segment

Member Data Documentation

◆ a

template<typename T >
T MR::SegmPoint< T >::a = 0

a in [0,1], a=0 => point is in v0, a=1 => point is in v1

◆ eps

template<typename T >
auto MR::SegmPoint< T >::eps = 10 * std::numeric_limits<T>::epsilon()
staticconstexpr

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