DGtal  1.2.beta
Data Structures | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
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  HexagonState { HexagonState::Empty, HexagonState::NonConvex, HexagonState::NonPlanar, HexagonState::Planar }
 
using Predicate = TPredicate
 
using Point = typename Predicate::Point
 
using Vector = Point
 
using Integer = typename Point::Coordinate
 
using Triangle = std::array< Vector, 3 >
 
using PointOnProbingRay = detail::PointOnProbingRay< Integer >
 

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
 
UpdateOperation closestCandidate ()
 
virtual 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

PointOnProbingRay closestPointInList (std::vector< PointOnProbingRay > const &aPoints) const
 
bool isNeighbor (PointOnProbingRay const &aRay) const
 
bool isSmallest (Point const &aX, Point const &aY) const
 
Point relativePoint (PointOnProbingRay const &aRay) const
 
Point absolutePoint (PointOnProbingRay const &aRay) 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

◆ 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>

Definition at line 76 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 81 of file PlaneProbingNeighborhood.h.

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

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>
Point DGtal::PlaneProbingNeighborhood< TPredicate >::absolutePoint ( PointOnProbingRay const &  aRay) const
protected

Returns the current point on the ray.

Parameters
aRaya point on a ray.
Returns
the current point on the ray.

◆ 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>
UpdateOperation DGtal::PlaneProbingNeighborhood< TPredicate >::closestCandidate ( )

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

Returns
the update operation to apply.

◆ closestPointInList()

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

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

Parameters
aPointsthe list of points.
Returns
the closest point.

◆ getOperation()

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

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::PlaneProbingR1Neighborhood< TPredicate >, DGtal::PlaneProbingRNeighborhood< 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>
Point DGtal::PlaneProbingNeighborhood< TPredicate >::relativePoint ( PointOnProbingRay const &  aRay) const
protected

Returns the vector from the point q to the current point on the ray.

Parameters
aRaya point on a ray.
Returns
the vector from the fixed point 'q' to the current point on the ray.

◆ 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 207 of file PlaneProbingNeighborhood.h.

◆ myM

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

A reference on the frame.

Definition at line 206 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 209 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 210 of file PlaneProbingNeighborhood.h.

◆ myPredicate

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

A reference on the probing predicate.

Definition at line 204 of file PlaneProbingNeighborhood.h.

◆ myQ

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

A reference on the fixed point.

Definition at line 205 of file PlaneProbingNeighborhood.h.


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