DGtal  1.5.beta
DGtal::SurfelNeighborhood< TKSpace > Class Template Reference

Aim: This helper class is useful to compute the neighboring surfels of a given surfel, especially over a digital surface or over an object boundary. Two signed surfels are incident if they share a common n-2 cell. This class uses a SurfelAdjacency so as to determine adjacent surfels (either looking for them from interior to exterior or inversely). More...

#include <DGtal/topology/SurfelNeighborhood.h>

Inheritance diagram for DGtal::SurfelNeighborhood< TKSpace >:
[legend]

Public Types

typedef TKSpace KSpace
 
typedef KSpace::Point Point
 
typedef KSpace::Cell Cell
 
typedef KSpace::SCell SCell
 

Public Member Functions

 ~SurfelNeighborhood ()
 
 SurfelNeighborhood ()
 
 SurfelNeighborhood (const SurfelNeighborhood &other)
 
SurfelNeighborhoodoperator= (const SurfelNeighborhood &other)
 
void init (const KSpace *space, const SurfelAdjacency< KSpace::dimension > *adj, const SCell &aSurfel)
 
void setSurfel (const SCell &aSurfel)
 
const SCellsurfel () const
 
Dimension orthDir () const
 
SCell innerSpel () const
 
SCell outerSpel () const
 
SCell innerAdjacentSpel (Dimension track_dir, bool pos) const
 
SCell outerAdjacentSpel (Dimension track_dir, bool pos) const
 
SCell follower1 (Dimension track_dir, bool pos) const
 
SCell follower2 (Dimension track_dir, bool pos) const
 
SCell follower3 (Dimension track_dir, bool pos) const
 
template<typename SpelSet >
unsigned int getAdjacentOnSpelSet (SCell &adj_surfel, const SpelSet &obj, Dimension track_dir, bool pos) const
 
template<typename DigitalSet >
unsigned int getAdjacentOnDigitalSet (SCell &adj_surfel, const DigitalSet &obj, Dimension track_dir, bool pos) const
 
template<typename PointPredicate >
unsigned int getAdjacentOnPointPredicate (SCell &adj_surfel, const PointPredicate &pp, Dimension track_dir, bool pos) const
 
template<typename SurfelPredicate >
unsigned int getAdjacentOnSurfelPredicate (SCell &adj_surfel, const SurfelPredicate &sp, Dimension track_dir, bool pos) const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Private Attributes

const KSpacemySpace
 
const SurfelAdjacency< KSpace::dimension > * mySurfelAdj
 
SCell mySurfel
 
Dimension myOrthDir
 
bool myOrthDirect
 

Detailed Description

template<typename TKSpace>
class DGtal::SurfelNeighborhood< TKSpace >

Aim: This helper class is useful to compute the neighboring surfels of a given surfel, especially over a digital surface or over an object boundary. Two signed surfels are incident if they share a common n-2 cell. This class uses a SurfelAdjacency so as to determine adjacent surfels (either looking for them from interior to exterior or inversely).

Description of template class 'SurfelNeighborhood'

Template Parameters
TKSpacethe type of celluler grid space (for instance, a KhalimskySpaceND).

Essentially a backport from ImaGene.

Definition at line 68 of file SurfelNeighborhood.h.

Member Typedef Documentation

◆ Cell

template<typename TKSpace >
typedef KSpace::Cell DGtal::SurfelNeighborhood< TKSpace >::Cell

Definition at line 75 of file SurfelNeighborhood.h.

◆ KSpace

template<typename TKSpace >
typedef TKSpace DGtal::SurfelNeighborhood< TKSpace >::KSpace

Definition at line 73 of file SurfelNeighborhood.h.

◆ Point

template<typename TKSpace >
typedef KSpace::Point DGtal::SurfelNeighborhood< TKSpace >::Point

Definition at line 74 of file SurfelNeighborhood.h.

◆ SCell

template<typename TKSpace >
typedef KSpace::SCell DGtal::SurfelNeighborhood< TKSpace >::SCell

Definition at line 76 of file SurfelNeighborhood.h.

Constructor & Destructor Documentation

◆ ~SurfelNeighborhood()

template<typename TKSpace >
DGtal::SurfelNeighborhood< TKSpace >::~SurfelNeighborhood ( )

Destructor.

◆ SurfelNeighborhood() [1/2]

template<typename TKSpace >
DGtal::SurfelNeighborhood< TKSpace >::SurfelNeighborhood ( )

Constructor. The object is not valid.

◆ SurfelNeighborhood() [2/2]

template<typename TKSpace >
DGtal::SurfelNeighborhood< TKSpace >::SurfelNeighborhood ( const SurfelNeighborhood< TKSpace > &  other)

Copy constructor.

Parameters
otherthe object to clone.

Member Function Documentation

◆ follower1()

template<typename TKSpace >
SCell DGtal::SurfelNeighborhood< TKSpace >::follower1 ( Dimension  track_dir,
bool  pos 
) const
Parameters
track_dirthe direction where to look for the follower (different from 'orthDir()'.
poswhen 'true', indicates to look for the follower along the positive direction of the tracking axis, otherwise along the negative direction.
Returns
the first follower of 'surfel()'.

◆ follower2()

template<typename TKSpace >
SCell DGtal::SurfelNeighborhood< TKSpace >::follower2 ( Dimension  track_dir,
bool  pos 
) const
Parameters
track_dirthe direction where to look for the follower (different from 'orthDir()'.
poswhen 'true', indicates to look for the follower along the positive direction of the tracking axis, otherwise along the negative direction.
Returns
the second follower of 'surfel()'.

◆ follower3()

template<typename TKSpace >
SCell DGtal::SurfelNeighborhood< TKSpace >::follower3 ( Dimension  track_dir,
bool  pos 
) const
Parameters
track_dirthe direction where to look for the follower (different from 'orthDir()'.
poswhen 'true', indicates to look for the follower along the positive direction of the tracking axis, otherwise along the negative direction.
Returns
the third follower of 'surfel()'.

◆ getAdjacentOnDigitalSet()

template<typename TKSpace >
template<typename DigitalSet >
unsigned int DGtal::SurfelNeighborhood< TKSpace >::getAdjacentOnDigitalSet ( SCell adj_surfel,
const DigitalSet obj,
Dimension  track_dir,
bool  pos 
) const

Go to the next direct or indirect adjacent bel on the boundary of some digital [obj]. The boundary may be open (it touches the space borders).

Template Parameters
DigitalSetany model of digital set, i.e. a set of digital points, having 'find( const Point & ) : const_iterator'.
Parameters
adj_surfel(returns) the signed adjacent surfel in direction [track_dir] if there is one.
objany set of unsigned spels (n-cells).
track_dirthe direction where to look for the spel.
poswhen 'true' look in positive direction along [track_dir] axis, 'false' look in negative direction.
Returns
0 if the move was impossible (no bels in this direction), 1 if it was the first interior, 2 if it was the second interior, 3 if it was the third interior.

Referenced by testSurfelAdjacency().

◆ getAdjacentOnPointPredicate()

template<typename TKSpace >
template<typename PointPredicate >
unsigned int DGtal::SurfelNeighborhood< TKSpace >::getAdjacentOnPointPredicate ( SCell adj_surfel,
const PointPredicate &  pp,
Dimension  track_dir,
bool  pos 
) const

Go to the next direct or indirect adjacent bel on the boundary of some digital set defined by a PointPredicate [pp]. The boundary may be open (it touches the space borders).

Template Parameters
PointPredicateany model of predicate on point, i.e. a boolean functor returning 'true' when the point belongs to the object. It is a model of concepts::CPointPredicate. The type SurfelNeighborhood::Point should be the same as PointPredicate::Point.
Parameters
adj_surfel(returns) the signed adjacent surfel in direction [track_dir] if there is one.
ppany predicate taking a Point and returning 'true' whenever the point belongs to the object.
track_dirthe direction where to look for the spel.
poswhen 'true' look in positive direction along [track_dir] axis, 'false' look in negative direction.
Returns
0 if the move was impossible (no bels in this direction), 1 if it was the first interior, 2 if it was the second interior, 3 if it was the third interior.

◆ getAdjacentOnSpelSet()

template<typename TKSpace >
template<typename SpelSet >
unsigned int DGtal::SurfelNeighborhood< TKSpace >::getAdjacentOnSpelSet ( SCell adj_surfel,
const SpelSet &  obj,
Dimension  track_dir,
bool  pos 
) const

Go to the next direct or indirect adjacent bel on the boundary of some set of unsigned spels [obj]. The boundary may be open (it touches the space borders).

Template Parameters
SpelSetany model of a set of unsigned spels, having 'find( const Spel & ) : const_iterator'.
Parameters
adj_surfel(returns) the signed adjacent surfel in direction [track_dir] if there is one.
objany set of unsigned spels (n-cells).
track_dirthe direction where to look for the spel.
poswhen 'true' look in positive direction along [track_dir] axis, 'false' look in negative direction.
Returns
0 if the move was impossible (no bels in this direction), 1 if it was the first interior, 2 if it was the second interior, 3 if it was the third interior.

◆ getAdjacentOnSurfelPredicate()

template<typename TKSpace >
template<typename SurfelPredicate >
unsigned int DGtal::SurfelNeighborhood< TKSpace >::getAdjacentOnSurfelPredicate ( SCell adj_surfel,
const SurfelPredicate &  sp,
Dimension  track_dir,
bool  pos 
) const

Go to the next direct or indirect adjacent bel on some set of surfels defined by a SurfelPredicate [sp]. The digital surface may be open (for instance, it may touch the space borders or may be open).

Template Parameters
SurfelPredicateany model of predicate on surfel, i.e. a boolean functor returning 'true' when the surfel belongs to the digital surface. It is a model of CSurfelPredicate.
Parameters
adj_surfel(returns) the signed adjacent surfel in direction [track_dir] if there is one.
spany predicate taking a Surfel and returning 'true' whenever the surfel belongs to the surface.
track_dirthe direction where to look for the spel.
poswhen 'true' look in positive direction along [track_dir] axis, 'false' look in negative direction.
Returns
0 if the move was impossible (no bels in this direction), 1 if it was the first interior, 2 if it was the second interior, 3 if it was the third interior.

◆ init()

template<typename TKSpace >
void DGtal::SurfelNeighborhood< TKSpace >::init ( const KSpace space,
const SurfelAdjacency< KSpace::dimension > *  adj,
const SCell aSurfel 
)

Initializes space, adjacency, surfel.

Parameters
spacethe cellular grid space (only referenced).
adjthe chosen surfel adjacency (only referenced).
aSurfelany signed surfel of [space] ((n-1)-cell).

Referenced by testSurfelAdjacency().

◆ innerAdjacentSpel()

template<typename TKSpace >
SCell DGtal::SurfelNeighborhood< TKSpace >::innerAdjacentSpel ( Dimension  track_dir,
bool  pos 
) const
Parameters
track_dirthe direction where to look for the spel.
poswhen 'true', looks along the positive direction of the tracking axis, otherwise along the negative direction.
Returns
the (positively oriented) spel adjacent to 'innerSpel()' in the direction [track_dir] and orientation [pos].

◆ innerSpel()

template<typename TKSpace >
SCell DGtal::SurfelNeighborhood< TKSpace >::innerSpel ( ) const
Returns
the positively oriented spel touching the surfel 'surfel()'.

◆ isValid()

template<typename TKSpace >
bool DGtal::SurfelNeighborhood< TKSpace >::isValid ( ) const

Checks the validity/consistency of the object.

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

◆ operator=()

template<typename TKSpace >
SurfelNeighborhood& DGtal::SurfelNeighborhood< TKSpace >::operator= ( const SurfelNeighborhood< TKSpace > &  other)

Assignment.

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

◆ orthDir()

template<typename TKSpace >
Dimension DGtal::SurfelNeighborhood< TKSpace >::orthDir ( ) const
Returns
the orthogonal direction to the current surfel.

◆ outerAdjacentSpel()

template<typename TKSpace >
SCell DGtal::SurfelNeighborhood< TKSpace >::outerAdjacentSpel ( Dimension  track_dir,
bool  pos 
) const
Parameters
track_dirthe direction where to look for the spel.
poswhen 'true', looks along the positive direction of the tracking axis, otherwise along the negative direction.
Returns
the (negatively oriented) spel adjacent to 'outerSpel()' in the direction [track_dir] and orientation [pos].

◆ outerSpel()

template<typename TKSpace >
SCell DGtal::SurfelNeighborhood< TKSpace >::outerSpel ( ) const
Returns
the negatively oriented spel touching the surfel 'surfel()'.

◆ selfDisplay()

template<typename TKSpace >
void DGtal::SurfelNeighborhood< TKSpace >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ setSurfel()

template<typename TKSpace >
void DGtal::SurfelNeighborhood< TKSpace >::setSurfel ( const SCell aSurfel)

Sets the neighborhood to the given [surfel].

Parameters
aSurfelany signed surfel of this space ((n-1)-cell).

◆ surfel()

template<typename TKSpace >
const SCell& DGtal::SurfelNeighborhood< TKSpace >::surfel ( ) const
Returns
the current surfel.

Field Documentation

◆ myOrthDir

template<typename TKSpace >
Dimension DGtal::SurfelNeighborhood< TKSpace >::myOrthDir
private

The orthogonal direction to [mySurfel].

See also
mySurfel

Definition at line 332 of file SurfelNeighborhood.h.

◆ myOrthDirect

template<typename TKSpace >
bool DGtal::SurfelNeighborhood< TKSpace >::myOrthDirect
private

The direct orientation in the orthogonal direction wrt [mySurfel].

See also
m_surfel

Definition at line 335 of file SurfelNeighborhood.h.

◆ mySpace

template<typename TKSpace >
const KSpace* DGtal::SurfelNeighborhood< TKSpace >::mySpace
private

A pointer to the digital space.

Definition at line 326 of file SurfelNeighborhood.h.

◆ mySurfel

template<typename TKSpace >
SCell DGtal::SurfelNeighborhood< TKSpace >::mySurfel
private

The current surfel.

Definition at line 330 of file SurfelNeighborhood.h.

◆ mySurfelAdj

template<typename TKSpace >
const SurfelAdjacency<KSpace::dimension>* DGtal::SurfelNeighborhood< TKSpace >::mySurfelAdj
private

A pointer to the bel adjacency.

Definition at line 328 of file SurfelNeighborhood.h.


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