DGtal 1.3.0
|
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>
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) | |
SurfelNeighborhood & | operator= (const SurfelNeighborhood &other) |
void | init (const KSpace *space, const SurfelAdjacency< KSpace::dimension > *adj, const SCell &aSurfel) |
void | setSurfel (const SCell &aSurfel) |
const SCell & | surfel () 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 KSpace * | mySpace |
const SurfelAdjacency< KSpace::dimension > * | mySurfelAdj |
SCell | mySurfel |
Dimension | myOrthDir |
bool | myOrthDirect |
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'
TKSpace | the type of celluler grid space (for instance, a KhalimskySpaceND). |
Essentially a backport from ImaGene.
Definition at line 68 of file SurfelNeighborhood.h.
typedef KSpace::Cell DGtal::SurfelNeighborhood< TKSpace >::Cell |
Definition at line 75 of file SurfelNeighborhood.h.
typedef TKSpace DGtal::SurfelNeighborhood< TKSpace >::KSpace |
Definition at line 73 of file SurfelNeighborhood.h.
typedef KSpace::Point DGtal::SurfelNeighborhood< TKSpace >::Point |
Definition at line 74 of file SurfelNeighborhood.h.
typedef KSpace::SCell DGtal::SurfelNeighborhood< TKSpace >::SCell |
Definition at line 76 of file SurfelNeighborhood.h.
DGtal::SurfelNeighborhood< TKSpace >::~SurfelNeighborhood | ( | ) |
Destructor.
DGtal::SurfelNeighborhood< TKSpace >::SurfelNeighborhood | ( | ) |
Constructor. The object is not valid.
DGtal::SurfelNeighborhood< TKSpace >::SurfelNeighborhood | ( | const SurfelNeighborhood< TKSpace > & | other | ) |
Copy constructor.
other | the object to clone. |
SCell DGtal::SurfelNeighborhood< TKSpace >::follower1 | ( | Dimension | track_dir, |
bool | pos | ||
) | const |
SCell DGtal::SurfelNeighborhood< TKSpace >::follower2 | ( | Dimension | track_dir, |
bool | pos | ||
) | const |
SCell DGtal::SurfelNeighborhood< TKSpace >::follower3 | ( | Dimension | track_dir, |
bool | pos | ||
) | const |
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).
DigitalSet | any model of digital set, i.e. a set of digital points, having 'find( const Point & ) : const_iterator'. |
adj_surfel | (returns) the signed adjacent surfel in direction [track_dir] if there is one. |
obj | any set of unsigned spels (n-cells). |
track_dir | the direction where to look for the spel. |
pos | when 'true' look in positive direction along [track_dir] axis, 'false' look in negative direction. |
Referenced by testSurfelAdjacency().
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).
PointPredicate | any 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. |
adj_surfel | (returns) the signed adjacent surfel in direction [track_dir] if there is one. |
pp | any predicate taking a Point and returning 'true' whenever the point belongs to the object. |
track_dir | the direction where to look for the spel. |
pos | when 'true' look in positive direction along [track_dir] axis, 'false' look in negative direction. |
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).
SpelSet | any model of a set of unsigned spels, having 'find( const Spel & ) : const_iterator'. |
adj_surfel | (returns) the signed adjacent surfel in direction [track_dir] if there is one. |
obj | any set of unsigned spels (n-cells). |
track_dir | the direction where to look for the spel. |
pos | when 'true' look in positive direction along [track_dir] axis, 'false' look in negative direction. |
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).
SurfelPredicate | any 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. |
adj_surfel | (returns) the signed adjacent surfel in direction [track_dir] if there is one. |
sp | any predicate taking a Surfel and returning 'true' whenever the surfel belongs to the surface. |
track_dir | the direction where to look for the spel. |
pos | when 'true' look in positive direction along [track_dir] axis, 'false' look in negative direction. |
void DGtal::SurfelNeighborhood< TKSpace >::init | ( | const KSpace * | space, |
const SurfelAdjacency< KSpace::dimension > * | adj, | ||
const SCell & | aSurfel | ||
) |
Initializes space, adjacency, surfel.
space | the cellular grid space (only referenced). |
adj | the chosen surfel adjacency (only referenced). |
aSurfel | any signed surfel of [space] ((n-1)-cell). |
Referenced by testSurfelAdjacency().
SCell DGtal::SurfelNeighborhood< TKSpace >::innerAdjacentSpel | ( | Dimension | track_dir, |
bool | pos | ||
) | const |
track_dir | the direction where to look for the spel. |
pos | when 'true', looks along the positive direction of the tracking axis, otherwise along the negative direction. |
SCell DGtal::SurfelNeighborhood< TKSpace >::innerSpel | ( | ) | const |
bool DGtal::SurfelNeighborhood< TKSpace >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
SurfelNeighborhood & DGtal::SurfelNeighborhood< TKSpace >::operator= | ( | const SurfelNeighborhood< TKSpace > & | other | ) |
Assignment.
other | the object to copy. |
Dimension DGtal::SurfelNeighborhood< TKSpace >::orthDir | ( | ) | const |
SCell DGtal::SurfelNeighborhood< TKSpace >::outerAdjacentSpel | ( | Dimension | track_dir, |
bool | pos | ||
) | const |
track_dir | the direction where to look for the spel. |
pos | when 'true', looks along the positive direction of the tracking axis, otherwise along the negative direction. |
SCell DGtal::SurfelNeighborhood< TKSpace >::outerSpel | ( | ) | const |
void DGtal::SurfelNeighborhood< TKSpace >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
void DGtal::SurfelNeighborhood< TKSpace >::setSurfel | ( | const SCell & | aSurfel | ) |
Sets the neighborhood to the given [surfel].
aSurfel | any signed surfel of this space ((n-1)-cell). |
const SCell & DGtal::SurfelNeighborhood< TKSpace >::surfel | ( | ) | const |
|
private |
The orthogonal direction to [mySurfel].
Definition at line 332 of file SurfelNeighborhood.h.
|
private |
The direct orientation in the orthogonal direction wrt [mySurfel].
Definition at line 335 of file SurfelNeighborhood.h.
|
private |
A pointer to the digital space.
Definition at line 326 of file SurfelNeighborhood.h.
|
private |
The current surfel.
Definition at line 330 of file SurfelNeighborhood.h.
|
private |
A pointer to the bel adjacency.
Definition at line 328 of file SurfelNeighborhood.h.