DGtal 1.3.0
|
Aim: This class is useful to visit an object by adjacencies, layer by layer. More...
#include <DGtal/graph/Expander.h>
Public Types | |
typedef TObject | Object |
typedef Object::Size | Size |
typedef Object::Point | Point |
typedef Object::Domain | Domain |
typedef Object::DigitalSet | DigitalSet |
typedef Object::ForegroundAdjacency | ForegroundAdjacency |
typedef Domain::Space | Space |
typedef DigitalSet::ConstIterator | ConstIterator |
typedef DigitalSetDomain< DigitalSet > | ObjectDomain |
typedef DigitalSetDomain< DigitalSet > | CoreDomain |
typedef DomainAdjacency< ObjectDomain, ForegroundAdjacency > | ObjectAdjacency |
typedef CoreDomain::Predicate | InCoreDomainPredicate |
typedef functors::NotPointPredicate< InCoreDomainPredicate > | NotInCoreDomainPredicate |
Public Member Functions | |
~Expander () | |
Expander (ConstAlias< Object > object, const Point &p) | |
template<typename PointInputIterator > | |
Expander (ConstAlias< Object > object, PointInputIterator b, PointInputIterator e) | |
bool | finished () const |
Size | distance () const |
bool | nextLayer () |
const DigitalSet & | core () const |
const DigitalSet & | layer () const |
ConstIterator | begin () const |
ConstIterator | end () const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Protected Member Functions | |
Expander () | |
void | computeNextLayer (const DigitalSet &src) |
void | endLayer () |
Private Member Functions | |
Expander (const Expander &other) | |
Expander & | operator= (const Expander &other) |
Private Attributes | |
const Domain & | myEmbeddingDomain |
const Object & | myObject |
ObjectDomain | myObjectDomain |
ObjectAdjacency | myObjectAdjacency |
DigitalSet | myCore |
DigitalSet | myLayer |
Size | myDistance |
bool | myFinished |
NotInCoreDomainPredicate | myNotInCorePred |
Aim: This class is useful to visit an object by adjacencies, layer by layer.
Description of template class 'Expander'
The expander implements a breadth-first algorithm on the graph of adjacencies. It can be used not only to detect connected component but also to identify the layers of the object located at a given distance of a starting set.
The core of the expander is at the beginning the set of points at distance 0. Each layer is at a different distance from the initial core. The expander move layer by layer but the user is free to navigate on each layer.
TObject | the type of the digital object. |
Definition at line 97 of file Expander.h.
typedef DigitalSet::ConstIterator DGtal::Expander< TObject >::ConstIterator |
Definition at line 108 of file Expander.h.
typedef DigitalSetDomain<DigitalSet> DGtal::Expander< TObject >::CoreDomain |
Definition at line 110 of file Expander.h.
typedef Object::DigitalSet DGtal::Expander< TObject >::DigitalSet |
Definition at line 105 of file Expander.h.
typedef Object::Domain DGtal::Expander< TObject >::Domain |
Definition at line 104 of file Expander.h.
typedef Object::ForegroundAdjacency DGtal::Expander< TObject >::ForegroundAdjacency |
Definition at line 106 of file Expander.h.
typedef CoreDomain::Predicate DGtal::Expander< TObject >::InCoreDomainPredicate |
Definition at line 112 of file Expander.h.
typedef functors::NotPointPredicate< InCoreDomainPredicate > DGtal::Expander< TObject >::NotInCoreDomainPredicate |
Definition at line 113 of file Expander.h.
typedef TObject DGtal::Expander< TObject >::Object |
Definition at line 101 of file Expander.h.
typedef DomainAdjacency< ObjectDomain, ForegroundAdjacency> DGtal::Expander< TObject >::ObjectAdjacency |
Definition at line 111 of file Expander.h.
typedef DigitalSetDomain<DigitalSet> DGtal::Expander< TObject >::ObjectDomain |
Definition at line 109 of file Expander.h.
typedef Object::Point DGtal::Expander< TObject >::Point |
Definition at line 103 of file Expander.h.
typedef Object::Size DGtal::Expander< TObject >::Size |
Definition at line 102 of file Expander.h.
typedef Domain::Space DGtal::Expander< TObject >::Space |
Definition at line 107 of file Expander.h.
DGtal::Expander< TObject >::~Expander | ( | ) |
Destructor.
DGtal::Expander< TObject >::Expander | ( | ConstAlias< Object > | object, |
const Point & | p | ||
) |
Constructor from a point. This point provides the initial core of the expander.
object | the digital object in which the expander expands. |
p | any point in the given object. |
DGtal::Expander< TObject >::Expander | ( | ConstAlias< Object > | object, |
PointInputIterator | b, | ||
PointInputIterator | e | ||
) |
Constructor from iterators. All points visited between the iterators should be distinct two by two. The so specified set of points provides the initial core of the expander.
PointInputIterator | type of an InputIterator pointing on a Point. |
object | the digital object in which the expander expands. |
b | the begin point in a set. |
e | the end point in a set. |
|
protected |
Constructor. Forbidden by default (protected to avoid g++ warnings).
|
private |
Copy constructor.
other | the object to clone. Forbidden by default. |
ConstIterator DGtal::Expander< TObject >::begin | ( | ) | const |
|
protected |
Computes the next layer just around [src]. The member 'm_core' must be up to date (i.e, [src] is a subset of 'm_core'). 'm_layer' is cleared in this method. At first call, [src] should be 'm_core', then [src] should be 'm_layer'.
src | the set around which the new layer is computed. |
const DigitalSet & DGtal::Expander< TObject >::core | ( | ) | const |
Size DGtal::Expander< TObject >::distance | ( | ) | const |
ConstIterator DGtal::Expander< TObject >::end | ( | ) | const |
|
protected |
Push the layer into the current core and clear it. Must be called before computeNewLayer.
bool DGtal::Expander< TObject >::finished | ( | ) | const |
bool DGtal::Expander< TObject >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
const DigitalSet & DGtal::Expander< TObject >::layer | ( | ) | const |
bool DGtal::Expander< TObject >::nextLayer | ( | ) |
Extract next layer. You might used begin() and end() to access all the elements of the new layer.
|
private |
Assignment.
other | the object to copy. |
void DGtal::Expander< TObject >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
|
private |
Set representing the core of the expansion: the expansion should not enter the core.
Definition at line 235 of file Expander.h.
|
private |
Current distance to origin.
Definition at line 245 of file Expander.h.
|
private |
The domain in which the object is lying.
Definition at line 214 of file Expander.h.
|
private |
Boolean stating whether the expansion is over or not.
Definition at line 250 of file Expander.h.
|
private |
Set representing the current layer.
Definition at line 240 of file Expander.h.
|
private |
Predicate ensuring the not-in-core expansion.
Definition at line 255 of file Expander.h.
|
private |
The object where the expansion takes place.
Definition at line 219 of file Expander.h.
|
private |
The adjacency that is used in myObjectDomain.
Definition at line 229 of file Expander.h.
|
private |
The domain corresponding to the object.
Definition at line 224 of file Expander.h.