DGtal  1.5.beta
DGtal::detail::PointOnProbingRay< Integer > Class Template Reference

A ray consists of a permutation \( \sigma \) and an integer index \( \lambda \) (position on the ray). For a triplet of vectors \( (m_k)_{0 \leq k \leq 2} \) and a point \( q \), a point on the ray is defined as: \( q - m_{\sigma(0)} + m_{\sigma(1)} + \lambda m_{\sigma(2)} \). \( q - m_{\sigma(0)} + m_{\sigma(1)} \) is called the base point. More...

#include <DGtal/geometry/helpers/PlaneProbingEstimatorHelper.h>

Public Types

using Permutation = std::array< int, 3 >
 

Public Member Functions

 PointOnProbingRay ()=default
 
 PointOnProbingRay (Permutation const &aSigma, Integer const &aIndex=Integer(0))
 
PointOnProbingRay getBase () const
 
Permutation const & sigma () const
 
int sigma (int aIndex) const
 
Integer const & index () const
 
template<typename Point >
Point relativePoint (std::array< Point, 3 > const &aM) const
 
bool operator== (PointOnProbingRay const &aRay) const
 
bool operator!= (PointOnProbingRay const &aRay) const
 
bool operator<= (PointOnProbingRay const &aRay) const
 
PointOnProbingRay next (Integer const &aInc) const
 
PointOnProbingRay previous (Integer const &aDec) const
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CInteger< Integer >))
 

Private Attributes

Permutation mySigma
 
Integer myIndex
 

Detailed Description

template<typename Integer = int>
class DGtal::detail::PointOnProbingRay< Integer >

A ray consists of a permutation \( \sigma \) and an integer index \( \lambda \) (position on the ray). For a triplet of vectors \( (m_k)_{0 \leq k \leq 2} \) and a point \( q \), a point on the ray is defined as: \( q - m_{\sigma(0)} + m_{\sigma(1)} + \lambda m_{\sigma(2)} \). \( q - m_{\sigma(0)} + m_{\sigma(1)} \) is called the base point.

Description of template class 'PointOnProbingRay'

This class is used to represent points on rays for a plane-probing estimator, so in practice the point \( q \) is the fixed point and the three vectors \( (m_k)_{0 \leq k \leq 2} \) are the vectors defining the current probing frame.

Template Parameters
Integerthe integer type, model of concepts::CInteger.

Definition at line 112 of file PlaneProbingEstimatorHelper.h.

Member Typedef Documentation

◆ Permutation

template<typename Integer = int>
using DGtal::detail::PointOnProbingRay< Integer >::Permutation = std::array<int, 3>

Definition at line 118 of file PlaneProbingEstimatorHelper.h.

Constructor & Destructor Documentation

◆ PointOnProbingRay() [1/2]

template<typename Integer = int>
DGtal::detail::PointOnProbingRay< Integer >::PointOnProbingRay ( )
default

Default constructor.

◆ PointOnProbingRay() [2/2]

template<typename Integer = int>
DGtal::detail::PointOnProbingRay< Integer >::PointOnProbingRay ( Permutation const &  aSigma,
Integer const &  aIndex = Integer(0) 
)

Constructs a ray with a permutation and an index.

Parameters
aSigmaa permutation.
aIndexan index.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename Integer = int>
DGtal::detail::PointOnProbingRay< Integer >::BOOST_CONCEPT_ASSERT ( (concepts::CInteger< Integer >)  )
private

◆ getBase()

template<typename Integer = int>
PointOnProbingRay DGtal::detail::PointOnProbingRay< Integer >::getBase ( ) const
Returns
the base point of the ray (with index 0).

◆ index()

template<typename Integer = int>
Integer const& DGtal::detail::PointOnProbingRay< Integer >::index ( ) const
Returns
index of the current point on the ray.

◆ next()

template<typename Integer = int>
PointOnProbingRay DGtal::detail::PointOnProbingRay< Integer >::next ( Integer const &  aInc) const
Parameters
aIncan increment.
Returns
a new point on a ray, with index the current index incremented by aInc.

◆ operator!=()

template<typename Integer = int>
bool DGtal::detail::PointOnProbingRay< Integer >::operator!= ( PointOnProbingRay< Integer > const &  aRay) const

Inequality test between two rays.

Parameters
aRayan other ray.
Returns
true if the two rays are different, false otherwise.

◆ operator<=()

template<typename Integer = int>
bool DGtal::detail::PointOnProbingRay< Integer >::operator<= ( PointOnProbingRay< Integer > const &  aRay) const

Comparison operator between two rays: one ray is less than another if they have the same internal permutation and the first one has a smaller index than the second one.

Parameters
aRayan other ray.
Returns
true if *this <= aRay, false otherwise.

◆ operator==()

template<typename Integer = int>
bool DGtal::detail::PointOnProbingRay< Integer >::operator== ( PointOnProbingRay< Integer > const &  aRay) const

Equality test between two rays: the internal permutations and indices must be the same.

Parameters
aRayan other ray.
Returns
true if the two rays are the same, false otherwise.

◆ previous()

template<typename Integer = int>
PointOnProbingRay DGtal::detail::PointOnProbingRay< Integer >::previous ( Integer const &  aDec) const
Parameters
aDeca decrement.
Returns
a new point on a ray, with index the current index decremented by aInc.

◆ relativePoint()

template<typename Integer = int>
template<typename Point >
Point DGtal::detail::PointOnProbingRay< Integer >::relativePoint ( std::array< Point, 3 > const &  aM) const
inline

Returns the geometric realization of this grid point.

Parameters
aMan array of three points.
Template Parameters
Pointa type for points.
Returns
the computed point.

Definition at line 163 of file PlaneProbingEstimatorHelper.h.

163  {
164  return -aM[mySigma[0]] + aM[mySigma[1]] + aM[mySigma[2]] * myIndex;
165  }

References DGtal::detail::PointOnProbingRay< Integer >::myIndex, and DGtal::detail::PointOnProbingRay< Integer >::mySigma.

◆ sigma() [1/2]

template<typename Integer = int>
Permutation const& DGtal::detail::PointOnProbingRay< Integer >::sigma ( ) const
Returns
the permutation that defines the ray.

◆ sigma() [2/2]

template<typename Integer = int>
int DGtal::detail::PointOnProbingRay< Integer >::sigma ( int  aIndex) const
Parameters
aIndexan index between 0 and 2.
Returns
the i-th element of the permutation that defines the ray.

Field Documentation

◆ myIndex

template<typename Integer = int>
Integer DGtal::detail::PointOnProbingRay< Integer >::myIndex
private

◆ mySigma

template<typename Integer = int>
Permutation DGtal::detail::PointOnProbingRay< Integer >::mySigma
private

The permutation.

Definition at line 208 of file PlaneProbingEstimatorHelper.h.

Referenced by DGtal::detail::PointOnProbingRay< Integer >::relativePoint().


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