DGtal  1.5.beta
DGtal::PlaneProbingNeighborhood< TPredicate > Class Template Referenceabstract

Aim: A base virtual class that represents a way to probe a neighborhood, used in the plane probing based estimators, see DGtal::PlaneProbingTetrahedronEstimator or DGtal::PlaneProbingParallelepipedEstimator. More...

#include <DGtal/geometry/surfaces/estimation/PlaneProbingNeighborhood.h>

Inheritance diagram for DGtal::PlaneProbingNeighborhood< TPredicate >:
[legend]

Data Structures

struct  UpdateOperation
 

Public Types

enum class  HexagonState { Empty , NonConvex , NonPlanar , Planar }
 
using Predicate = TPredicate
 
using Point = typename Predicate::Point
 
using Vector = Point
 
using Integer = typename Point::Coordinate
 
using Triangle = std::array< Vector, 3 >
 
using Index = std::size_t
 
using PointOnProbingRay = detail::PointOnProbingRay< Integer, Index >
 

Public Member Functions

 PlaneProbingNeighborhood ()=delete
 
 PlaneProbingNeighborhood (Predicate const &aPredicate, Point const &aQ, Triangle const &aM)
 
virtual ~PlaneProbingNeighborhood ()
 
 PlaneProbingNeighborhood (const PlaneProbingNeighborhood &other)=delete
 
 PlaneProbingNeighborhood (PlaneProbingNeighborhood &&other)=delete
 
PlaneProbingNeighborhoodoperator= (const PlaneProbingNeighborhood &other)=delete
 
PlaneProbingNeighborhoodoperator= (PlaneProbingNeighborhood &&other)=delete
 
void setNeighbors (std::vector< PointOnProbingRay > const &aNeighbors)
 
virtual HexagonState hexagonState ()=0
 
virtual UpdateOperation closestCandidate ()
 
UpdateOperation getOperation (PointOnProbingRay const &aClosest) const
 
HexagonState classify (std::array< bool, 6 > const &aState) const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Member Functions

template<class TPointAdapter >
TPointAdapter closestPointInList (std::vector< TPointAdapter > const &aPoints) const
 
bool isNeighbor (PointOnProbingRay const &aRay) const
 
bool isSmallest (Point const &aX, Point const &aY) const
 
template<class TPointAdapter >
Point relativePoint (TPointAdapter const &aPoint) const
 
template<class TPointAdapter >
Point absolutePoint (TPointAdapter const &aPoint) const
 

Protected Attributes

Predicate const & myPredicate
 
Point const & myQ
 
Triangle const & myM
 
std::vector< PointOnProbingRaymyCandidates
 
std::vector< PointOnProbingRaymyNeighbors
 

Static Protected Attributes

static const PointOnProbingRay myNeighborhood [6]
 

Private Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CPointPredicate< TPredicate >))
 

Detailed Description

template<typename TPredicate>
class DGtal::PlaneProbingNeighborhood< TPredicate >

Aim: A base virtual class that represents a way to probe a neighborhood, used in the plane probing based estimators, see DGtal::PlaneProbingTetrahedronEstimator or DGtal::PlaneProbingParallelepipedEstimator.

Description of template class 'PlaneProbingNeighborhood'

Template Parameters
TPredicatethe probing predicate, a model of concepts::CPointPredicate.

Definition at line 65 of file PlaneProbingNeighborhood.h.

Member Typedef Documentation

◆ Index

template<typename TPredicate >
using DGtal::PlaneProbingNeighborhood< TPredicate >::Index = std::size_t

Definition at line 76 of file PlaneProbingNeighborhood.h.

◆ Integer

template<typename TPredicate >
using DGtal::PlaneProbingNeighborhood< TPredicate >::Integer = typename Point::Coordinate

Definition at line 74 of file PlaneProbingNeighborhood.h.

◆ Point

template<typename TPredicate >
using DGtal::PlaneProbingNeighborhood< TPredicate >::Point = typename Predicate::Point

Definition at line 72 of file PlaneProbingNeighborhood.h.

◆ PointOnProbingRay

template<typename TPredicate >
using DGtal::PlaneProbingNeighborhood< TPredicate >::PointOnProbingRay = detail::PointOnProbingRay<Integer,Index>

Definition at line 77 of file PlaneProbingNeighborhood.h.

◆ Predicate

template<typename TPredicate >
using DGtal::PlaneProbingNeighborhood< TPredicate >::Predicate = TPredicate

Definition at line 71 of file PlaneProbingNeighborhood.h.

◆ Triangle

template<typename TPredicate >
using DGtal::PlaneProbingNeighborhood< TPredicate >::Triangle = std::array<Vector, 3>

Definition at line 75 of file PlaneProbingNeighborhood.h.

◆ Vector

template<typename TPredicate >
using DGtal::PlaneProbingNeighborhood< TPredicate >::Vector = Point

Definition at line 73 of file PlaneProbingNeighborhood.h.

Member Enumeration Documentation

◆ HexagonState

template<typename TPredicate >
enum DGtal::PlaneProbingNeighborhood::HexagonState
strong

Represents a configuration of the H-neighborhood.

Enumerator
Empty 

None of the 6 points of the H-neighborhood belongs to the digital plane.

NonConvex 

At least 2 points aligned with q in the digital plane.

NonPlanar 

At least 3 consecutive points (a, b, c) where a and c are in the digital plane and b is not.

Planar 

The underlying digital set represents a piece of digital plane.

Definition at line 82 of file PlaneProbingNeighborhood.h.

83  {
84  Empty,
85  NonConvex,
86  NonPlanar,
87  Planar,
88  };

Constructor & Destructor Documentation

◆ PlaneProbingNeighborhood() [1/4]

template<typename TPredicate >
DGtal::PlaneProbingNeighborhood< TPredicate >::PlaneProbingNeighborhood ( )
delete

Default constructor.

◆ PlaneProbingNeighborhood() [2/4]

template<typename TPredicate >
DGtal::PlaneProbingNeighborhood< TPredicate >::PlaneProbingNeighborhood ( Predicate const &  aPredicate,
Point const &  aQ,
Triangle const &  aM 
)

Constructor.

Parameters
aPredicatea probing predicate.
aQthe fixed point 'q'.
aMa frame composed of the three vectors.

◆ ~PlaneProbingNeighborhood()

template<typename TPredicate >
virtual DGtal::PlaneProbingNeighborhood< TPredicate >::~PlaneProbingNeighborhood ( )
virtual

Destructor.

◆ PlaneProbingNeighborhood() [3/4]

template<typename TPredicate >
DGtal::PlaneProbingNeighborhood< TPredicate >::PlaneProbingNeighborhood ( const PlaneProbingNeighborhood< TPredicate > &  other)
delete

Copy constructor.

Parameters
otherthe object to clone.

◆ PlaneProbingNeighborhood() [4/4]

template<typename TPredicate >
DGtal::PlaneProbingNeighborhood< TPredicate >::PlaneProbingNeighborhood ( PlaneProbingNeighborhood< TPredicate > &&  other)
delete

Move constructor.

Parameters
otherthe object to move.

Member Function Documentation

◆ absolutePoint()

template<typename TPredicate >
template<class TPointAdapter >
Point DGtal::PlaneProbingNeighborhood< TPredicate >::absolutePoint ( TPointAdapter const &  aPoint) const
protected

Returns the geometric realization of the input representation of the current point on the ray.

Parameters
aPointa representation of the current point.
Template Parameters
TPointAdaptera type for the representation of the input point.
Returns
the current point.

◆ BOOST_CONCEPT_ASSERT()

template<typename TPredicate >
DGtal::PlaneProbingNeighborhood< TPredicate >::BOOST_CONCEPT_ASSERT ( (concepts::CPointPredicate< TPredicate >)  )
private

◆ classify()

template<typename TPredicate >
HexagonState DGtal::PlaneProbingNeighborhood< TPredicate >::classify ( std::array< bool, 6 > const &  aState) const

Classify the state of the H-neighborhood encoded as an array of 6 booleans.

Parameters
aState
Returns
the hexagon state, see HexagonState.

◆ closestCandidate()

template<typename TPredicate >
virtual UpdateOperation DGtal::PlaneProbingNeighborhood< TPredicate >::closestCandidate ( )
virtual

Computes the closest candidate point, used for updating a frame in a plane probing based estimator.

Returns
the update operation to apply.

Reimplemented in DGtal::PlaneProbingLNeighborhood< TPredicate >.

◆ closestPointInList()

template<typename TPredicate >
template<class TPointAdapter >
TPointAdapter DGtal::PlaneProbingNeighborhood< TPredicate >::closestPointInList ( std::vector< TPointAdapter > const &  aPoints) const
protected

Computes the closest point, among a list of candidates, using a Delaunay-based criterion.

Parameters
aPointsthe list of points.
Template Parameters
TPointAdaptera type for the input list of points
Returns
the closest point.

◆ getOperation()

template<typename TPredicate >
UpdateOperation DGtal::PlaneProbingNeighborhood< TPredicate >::getOperation ( PointOnProbingRay const &  aClosest) const

Constructs an update operation from the closest candidate point.

Parameters
aClosestthe closest candidate point.
Returns
the update operation.

◆ hexagonState()

template<typename TPredicate >
virtual HexagonState DGtal::PlaneProbingNeighborhood< TPredicate >::hexagonState ( )
pure virtual

Computes the current state of the neighborhood. This is the function that is overloaded for the different probing modes.

Returns
the hexagon state, see HexagonState.

Implemented in DGtal::PlaneProbingRNeighborhood< TPredicate >, DGtal::PlaneProbingR1Neighborhood< TPredicate >, DGtal::PlaneProbingLNeighborhood< TPredicate >, and DGtal::PlaneProbingHNeighborhood< TPredicate >.

◆ isNeighbor()

template<typename TPredicate >
bool DGtal::PlaneProbingNeighborhood< TPredicate >::isNeighbor ( PointOnProbingRay const &  aRay) const
protected

Tests whether a ray should be probed or not, according to the current set of 'neighbors'.

Parameters
aRaythe ray point to test.
Returns
'true' if aRay should be considered, 'false' otherwise.

◆ isSmallest()

template<typename TPredicate >
bool DGtal::PlaneProbingNeighborhood< TPredicate >::isSmallest ( Point const &  aX,
Point const &  aY 
) const
protected

Computes the relative position of a point with respect to a sphere passing through 4 points (the three vertices of the current frame plus one point).

Parameters
aX1 more input point.
aYthe test point.
Returns
'true' if aY lies inside the sphere passing through vertices and aX.

◆ isValid()

template<typename TPredicate >
bool DGtal::PlaneProbingNeighborhood< TPredicate >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ operator=() [1/2]

template<typename TPredicate >
PlaneProbingNeighborhood& DGtal::PlaneProbingNeighborhood< TPredicate >::operator= ( const PlaneProbingNeighborhood< TPredicate > &  other)
delete

Copy assignment operator.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.

◆ operator=() [2/2]

template<typename TPredicate >
PlaneProbingNeighborhood& DGtal::PlaneProbingNeighborhood< TPredicate >::operator= ( PlaneProbingNeighborhood< TPredicate > &&  other)
delete

Move assignment operator.

Parameters
otherthe object to move.
Returns
a reference on 'this'.

◆ relativePoint()

template<typename TPredicate >
template<class TPointAdapter >
Point DGtal::PlaneProbingNeighborhood< TPredicate >::relativePoint ( TPointAdapter const &  aPoint) const
protected

Returns the vector from the point q to the current point, represented by the input object.

Parameters
aPointa representation of the current point.
Template Parameters
TPointAdaptera type for the representation of the input point.
Returns
the vector from the fixed point 'q' to the current point.

◆ selfDisplay()

template<typename TPredicate >
void DGtal::PlaneProbingNeighborhood< TPredicate >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ setNeighbors()

template<typename TPredicate >
void DGtal::PlaneProbingNeighborhood< TPredicate >::setNeighbors ( std::vector< PointOnProbingRay > const &  aNeighbors)

Field Documentation

◆ myCandidates

template<typename TPredicate >
std::vector<PointOnProbingRay> DGtal::PlaneProbingNeighborhood< TPredicate >::myCandidates
protected

Will contain the candidates at one step.

Definition at line 208 of file PlaneProbingNeighborhood.h.

◆ myM

template<typename TPredicate >
Triangle const& DGtal::PlaneProbingNeighborhood< TPredicate >::myM
protected

A reference on the frame.

Definition at line 207 of file PlaneProbingNeighborhood.h.

◆ myNeighborhood

template<typename TPredicate >
const PointOnProbingRay DGtal::PlaneProbingNeighborhood< TPredicate >::myNeighborhood[6]
staticprotected

The six rays defining the H-neighborhood.

Definition at line 210 of file PlaneProbingNeighborhood.h.

◆ myNeighbors

template<typename TPredicate >
std::vector<PointOnProbingRay> DGtal::PlaneProbingNeighborhood< TPredicate >::myNeighbors
protected

An array of rays to filter the neighborhood.

Definition at line 211 of file PlaneProbingNeighborhood.h.

◆ myPredicate

template<typename TPredicate >
Predicate const& DGtal::PlaneProbingNeighborhood< TPredicate >::myPredicate
protected

A reference on the probing predicate.

Definition at line 205 of file PlaneProbingNeighborhood.h.

◆ myQ

template<typename TPredicate >
Point const& DGtal::PlaneProbingNeighborhood< TPredicate >::myQ
protected

A reference on the fixed point.

Definition at line 206 of file PlaneProbingNeighborhood.h.


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