DGtal 1.3.0
|
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as connected surfels. The shape is determined by a predicate telling whether a given surfel belongs or not to the shape boundary. The whole boundary is not precomputed nor stored. You may use an iterator to visit it. More...
#include <DGtal/topology/LightExplicitDigitalSurface.h>
Data Structures | |
class | Tracker |
struct | VertexMap |
Public Types | |
typedef LightExplicitDigitalSurface< TKSpace, TSurfelPredicate > | Self |
typedef TKSpace | KSpace |
Model of cellular grid space. More... | |
typedef KSpace::SCell | Surfel |
Type for surfels. More... | |
typedef KSpace::Size | Size |
Type for sizes (unsigned integral type). More... | |
typedef TSurfelPredicate | SurfelPredicate |
typedef SurfelAdjacency< KSpace::dimension > | Adjacency |
typedef KSpace::Cell | Cell |
typedef KSpace::SCell | SCell |
typedef KSpace::CellSet | CellSet |
typedef KSpace::SCellSet | SCellSet |
typedef Surfel | Vertex |
typedef SCellSet | VertexSet |
typedef BreadthFirstVisitor< Self > | SelfVisitor |
typedef GraphVisitorRange< SelfVisitor > | SelfVisitorRange |
typedef SelfVisitorRange::ConstIterator | SurfelConstIterator |
typedef KSpace::Space | Space |
typedef KSpace::Point | Point |
typedef Tracker | DigitalSurfaceTracker |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::CSurfelPredicate< SurfelPredicate >)) | |
~LightExplicitDigitalSurface () | |
LightExplicitDigitalSurface (const LightExplicitDigitalSurface &other) | |
LightExplicitDigitalSurface (ConstAlias< KSpace > aKSpace, ConstAlias< SurfelPredicate > aSP, const Adjacency &adj, const Surfel &s) | |
const Adjacency & | surfelAdjacency () const |
accessor to surfel adjacency. More... | |
Adjacency & | surfelAdjacency () |
mutator to surfel adjacency. More... | |
const SurfelPredicate & | surfelPredicate () const |
accessor to surfel predicate. More... | |
const Surfel & | surfel () const |
accessor to starting surfel. More... | |
void | setSurfel (const Surfel &aSurfel) |
mutator to starting surfel. More... | |
const KSpace & | space () const |
bool | isInside (const Surfel &s) const |
SurfelConstIterator | begin () const |
SurfelConstIterator | end () const |
Size | nbSurfels () const |
bool | empty () const |
DigitalSurfaceTracker * | newTracker (const Surfel &s) const |
Connectedness | connectedness () const |
Size | degree (const Vertex &v) const |
template<typename OutputIterator > | |
void | writeNeighbors (OutputIterator &it, const Vertex &v) const |
template<typename OutputIterator , typename VertexPredicate > | |
void | writeNeighbors (OutputIterator &it, const Vertex &v, const VertexPredicate &pred) const |
Size | bestCapacity () const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Private Member Functions | |
LightExplicitDigitalSurface & | operator= (const LightExplicitDigitalSurface &other) |
Private Attributes | |
const KSpace & | myKSpace |
a reference to the cellular space. More... | |
const SurfelPredicate & | mySurfelPredicate |
a reference to the surfel predicate defining the shape. More... | |
Adjacency | mySurfelAdjacency |
the surfel adjacency used to determine neighbors. More... | |
Surfel | mySurfel |
a surfel belonging to the surface. More... | |
Tracker | myTracker |
Internal tracker for visiting surfels. More... | |
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as connected surfels. The shape is determined by a predicate telling whether a given surfel belongs or not to the shape boundary. The whole boundary is not precomputed nor stored. You may use an iterator to visit it.
Description of template class 'LightExplicitDigitalSurface'
It is also a model of CUndirectedSimpleLocalGraph, so as to be able to visit itself with a BreadthFirstVisitor. The "Light" or lazyness is implemented this way.
TKSpace | a model of CCellularGridSpaceND: the type chosen for the cellular grid space. |
TSurfelPredicate | a model of CSurfelPredicate: this functor defines the digital surface as a characteristic function returning true iff the surfel belongs to it. |
You may use this range only once ! This is because the iterators are only single pass. If you wish to visit twice the range, you must indeed creates two ranges by calling begin() twice (end() is not compulsory here, but advised).
Definition at line 118 of file LightExplicitDigitalSurface.h.
typedef SurfelAdjacency<KSpace::dimension> DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Adjacency |
Definition at line 217 of file LightExplicitDigitalSurface.h.
typedef KSpace::Cell DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Cell |
Definition at line 218 of file LightExplicitDigitalSurface.h.
typedef KSpace::CellSet DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::CellSet |
Definition at line 220 of file LightExplicitDigitalSurface.h.
typedef Tracker DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::DigitalSurfaceTracker |
Definition at line 238 of file LightExplicitDigitalSurface.h.
typedef TKSpace DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::KSpace |
Model of cellular grid space.
Definition at line 204 of file LightExplicitDigitalSurface.h.
typedef KSpace::Point DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Point |
Definition at line 237 of file LightExplicitDigitalSurface.h.
typedef KSpace::SCell DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::SCell |
Definition at line 219 of file LightExplicitDigitalSurface.h.
typedef KSpace::SCellSet DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::SCellSet |
Definition at line 221 of file LightExplicitDigitalSurface.h.
typedef LightExplicitDigitalSurface<TKSpace,TSurfelPredicate> DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Self |
Definition at line 202 of file LightExplicitDigitalSurface.h.
typedef BreadthFirstVisitor< Self > DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::SelfVisitor |
Definition at line 233 of file LightExplicitDigitalSurface.h.
typedef GraphVisitorRange< SelfVisitor > DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::SelfVisitorRange |
Definition at line 234 of file LightExplicitDigitalSurface.h.
typedef KSpace::Size DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Size |
Type for sizes (unsigned integral type).
Definition at line 208 of file LightExplicitDigitalSurface.h.
typedef KSpace::Space DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Space |
Definition at line 236 of file LightExplicitDigitalSurface.h.
typedef KSpace::SCell DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Surfel |
Type for surfels.
Definition at line 206 of file LightExplicitDigitalSurface.h.
typedef SelfVisitorRange::ConstIterator DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::SurfelConstIterator |
Definition at line 235 of file LightExplicitDigitalSurface.h.
typedef TSurfelPredicate DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::SurfelPredicate |
Definition at line 210 of file LightExplicitDigitalSurface.h.
typedef Surfel DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Vertex |
Definition at line 225 of file LightExplicitDigitalSurface.h.
typedef SCellSet DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::VertexSet |
Definition at line 226 of file LightExplicitDigitalSurface.h.
DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::~LightExplicitDigitalSurface | ( | ) |
Destructor.
DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::LightExplicitDigitalSurface | ( | const LightExplicitDigitalSurface< TKSpace, TSurfelPredicate > & | other | ) |
Copy constructor.
other | the object to clone. |
DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::LightExplicitDigitalSurface | ( | ConstAlias< KSpace > | aKSpace, |
ConstAlias< SurfelPredicate > | aSP, | ||
const Adjacency & | adj, | ||
const Surfel & | s | ||
) |
Constructor from digital set.
aKSpace | a cellular grid space (referenced). |
aSP | a surfel predicate defining the shape (referenced). |
adj | the surfel adjacency (for instance Adjacency( true ) is interior to exterior adjacency ). |
s | any surfel of aKSpace such that aPP is true in the interior and false in the exterior. |
SurfelConstIterator DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::begin | ( | ) | const |
Size DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::bestCapacity | ( | ) | const |
Should return a reasonable estimation of the number of neighbors for all vertices. For instance a planar triangulation should return 6-8, a quad-mesh should return 4, digital surface is 2*(K::dimension-1).
DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::BOOST_CONCEPT_ASSERT | ( | (concepts::CSurfelPredicate< SurfelPredicate >) | ) |
Connectedness DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::connectedness | ( | ) | const |
Size DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::degree | ( | const Vertex & | v | ) | const |
v | any vertex of this graph |
bool DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::empty | ( | ) | const |
SurfelConstIterator DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::end | ( | ) | const |
bool DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::isInside | ( | const Surfel & | s | ) | const |
s | any surfel of the space. |
bool DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
Size DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::nbSurfels | ( | ) | const |
DigitalSurfaceTracker * DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::newTracker | ( | const Surfel & | s | ) | const |
s | any surfel of the space. |
|
private |
Assignment.
other | the object to copy. |
void DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
void DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::setSurfel | ( | const Surfel & | aSurfel | ) |
mutator to starting surfel.
const KSpace & DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::space | ( | ) | const |
const Surfel & DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::surfel | ( | ) | const |
accessor to starting surfel.
Adjacency & DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::surfelAdjacency | ( | ) |
mutator to surfel adjacency.
const Adjacency & DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::surfelAdjacency | ( | ) | const |
accessor to surfel adjacency.
const SurfelPredicate & DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::surfelPredicate | ( | ) | const |
accessor to surfel predicate.
void DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::writeNeighbors | ( | OutputIterator & | it, |
const Vertex & | v | ||
) | const |
Writes the neighbors of [v] in the output iterator [it]. Neighbors are given in no specific order.
OutputIterator | the type for the output iterator (e.g. back_insert_iterator<std::vector<Vertex> >). |
[in,out] | it | any output iterator on Vertex (*it++ should be allowed), which specifies where neighbors are written. |
[in] | v | any vertex of this graph |
void DGtal::LightExplicitDigitalSurface< TKSpace, TSurfelPredicate >::writeNeighbors | ( | OutputIterator & | it, |
const Vertex & | v, | ||
const VertexPredicate & | pred | ||
) | const |
Writes the neighbors of [v], verifying the predicate [pred] in the output iterator [it]. Neighbors are given in no specific order.
OutputIterator | the type for the output iterator (e.g. back_insert_iterator<std::vector<Vertex> >). |
VertexPredicate | any type of predicate taking a Vertex as input. |
[in,out] | it | any output iterator on Vertex (*it++ should be allowed), which specifies where neighbors are written. |
[in] | v | any vertex of this graph |
[in] | pred | the predicate for selecting neighbors. |
|
private |
a reference to the cellular space.
Definition at line 398 of file LightExplicitDigitalSurface.h.
|
private |
a surfel belonging to the surface.
Definition at line 404 of file LightExplicitDigitalSurface.h.
|
private |
the surfel adjacency used to determine neighbors.
Definition at line 402 of file LightExplicitDigitalSurface.h.
|
private |
a reference to the surfel predicate defining the shape.
Definition at line 400 of file LightExplicitDigitalSurface.h.
|
mutableprivate |
Internal tracker for visiting surfels.
Definition at line 406 of file LightExplicitDigitalSurface.h.