DGtal  1.5.beta
DGtal::detail::GridPointOnProbingRay< Integer, Index > Class Template Reference

Aim: Represents a grid point along a discrete ray defined on a grid. More...

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

Public Member Functions

 GridPointOnProbingRay ()=default
 
 GridPointOnProbingRay (const GridPoint< Integer, Index > &aGridPoint, const std::pair< Integer, Integer > &aDirection, const Integer &aIdx=0)
 
bool operator== (GridPointOnProbingRay const &other) const
 
bool operator!= (GridPointOnProbingRay const &other) const
 
GridPointOnProbingRay next (const Integer &aInc) const
 
GridPointOnProbingRay previous (const Integer &aDec) const
 
Integer index () const
 
GridPoint< Integer, IndexgridPoint () const
 
template<typename Point >
Point relativePoint (std::array< Point, 3 > const &aM) const
 

Private Member Functions

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

Private Attributes

GridPoint< Integer, IndexmyOrigin
 
std::pair< Integer, IntegermyDirection
 
Integer myIdx
 

Detailed Description

template<typename Integer = int, typename Index = std::size_t>
class DGtal::detail::GridPointOnProbingRay< Integer, Index >

Aim: Represents a grid point along a discrete ray defined on a grid.

Description of template class 'GridPointOnProbingRay'

More precisely, a ray consists of a starting point (represented as an instance of 'GridPoint') and a direction (respresented as a couple of coordinates for the basis of the underlying grid). A grid point along that ray is determined by an index, 0 being the starting point of the ray. The class provides several methods to compare and move points along the ray.

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

Definition at line 423 of file PlaneProbingEstimatorHelper.h.

Constructor & Destructor Documentation

◆ GridPointOnProbingRay() [1/2]

◆ GridPointOnProbingRay() [2/2]

template<typename Integer = int, typename Index = std::size_t>
DGtal::detail::GridPointOnProbingRay< Integer, Index >::GridPointOnProbingRay ( const GridPoint< Integer, Index > &  aGridPoint,
const std::pair< Integer, Integer > &  aDirection,
const Integer aIdx = 0 
)
inline

Constructor.

Parameters
aGridPointstarting point of the ray
aDirectiondirection of the ray
aIdxindex of the grid point along the ray

Definition at line 440 of file PlaneProbingEstimatorHelper.h.

443  : myOrigin(aGridPoint), myDirection(aDirection), myIdx(aIdx) {}

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT()

template<typename Integer = int, typename Index = std::size_t>
DGtal::detail::GridPointOnProbingRay< Integer, Index >::BOOST_CONCEPT_ASSERT ( (concepts::CInteger< Integer >)  )
private

◆ gridPoint()

◆ index()

template<typename Integer = int, typename Index = std::size_t>
Integer DGtal::detail::GridPointOnProbingRay< Integer, Index >::index ( ) const
inline
Returns
index of the current grid point on the ray.

Definition at line 496 of file PlaneProbingEstimatorHelper.h.

496  {
497  return myIdx;
498  }

References DGtal::detail::GridPointOnProbingRay< Integer, Index >::myIdx.

◆ next()

template<typename Integer = int, typename Index = std::size_t>
GridPointOnProbingRay DGtal::detail::GridPointOnProbingRay< Integer, Index >::next ( const Integer aInc) const
inline

Returns a grid point lying after this one along the ray. The distance is given as an input parameter.

Parameters
aIncan increment.
Returns
a new grid point on the same ray, with index, the current index incremented by 'aInc'.

Definition at line 477 of file PlaneProbingEstimatorHelper.h.

477  {
479  }

References DGtal::detail::GridPointOnProbingRay< Integer, Index >::GridPointOnProbingRay(), DGtal::detail::GridPointOnProbingRay< Integer, Index >::myDirection, DGtal::detail::GridPointOnProbingRay< Integer, Index >::myIdx, and DGtal::detail::GridPointOnProbingRay< Integer, Index >::myOrigin.

◆ operator!=()

template<typename Integer = int, typename Index = std::size_t>
bool DGtal::detail::GridPointOnProbingRay< Integer, Index >::operator!= ( GridPointOnProbingRay< Integer, Index > const &  other) const
inline

Difference test.

Parameters
otheranother instance of GridPointOnProbingRay
Returns
'true' if different, i.e. not equal, 'false' otherwise

Definition at line 465 of file PlaneProbingEstimatorHelper.h.

465  {
466  return !(*this == other);
467  }

◆ operator==()

template<typename Integer = int, typename Index = std::size_t>
bool DGtal::detail::GridPointOnProbingRay< Integer, Index >::operator== ( GridPointOnProbingRay< Integer, Index > const &  other) const
inline

Equality test. The two objects are equal iff the underlying rays are the same and the indices are the same.

Parameters
otheranother instance of GridPointOnProbingRay
Returns
'true' if equal, 'false' otherwise

Definition at line 453 of file PlaneProbingEstimatorHelper.h.

453  {
454  return ( (myOrigin == other.myOrigin) &&
455  (myDirection == other.myDirection) &&
456  (myIdx == other.myIdx) );
457  }

References DGtal::detail::GridPointOnProbingRay< Integer, Index >::myDirection, DGtal::detail::GridPointOnProbingRay< Integer, Index >::myIdx, and DGtal::detail::GridPointOnProbingRay< Integer, Index >::myOrigin.

◆ previous()

template<typename Integer = int, typename Index = std::size_t>
GridPointOnProbingRay DGtal::detail::GridPointOnProbingRay< Integer, Index >::previous ( const Integer aDec) const
inline

Returns a grid point lying before this one along the ray. The distance is given as an input parameter.

Parameters
aDeca decrement.
Returns
a new grid point on the same ray, with index, the current index decremented by 'aDec'.

Definition at line 489 of file PlaneProbingEstimatorHelper.h.

489  {
491  }

References DGtal::detail::GridPointOnProbingRay< Integer, Index >::GridPointOnProbingRay(), DGtal::detail::GridPointOnProbingRay< Integer, Index >::myDirection, DGtal::detail::GridPointOnProbingRay< Integer, Index >::myIdx, and DGtal::detail::GridPointOnProbingRay< Integer, Index >::myOrigin.

◆ relativePoint()

template<typename Integer = int, typename Index = std::size_t>
template<typename Point >
Point DGtal::detail::GridPointOnProbingRay< Integer, Index >::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 515 of file PlaneProbingEstimatorHelper.h.

515  {
516  return gridPoint().relativePoint(aM);
517  }
GridPoint< Integer, Index > gridPoint() const
Point relativePoint(std::array< Point, 3 > const &aM) const

References DGtal::detail::GridPointOnProbingRay< Integer, Index >::gridPoint(), and DGtal::detail::GridPoint< Integer, Index >::relativePoint().

Field Documentation

◆ myDirection

◆ myIdx

◆ myOrigin


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