DGtal  0.9.4beta
Data Structures | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate > Class Template Reference

#include <DGtal/topology/ExplicitDigitalSurface.h>

Collaboration diagram for DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >:
[legend]

Data Structures

class  Tracker
 

Public Types

typedef ExplicitDigitalSurface< TKSpace, TSurfelPredicate > Self
 
typedef TKSpace KSpace
 
typedef KSpace::SCell Surfel
 
typedef KSpace::Size Size
 
typedef TSurfelPredicate SurfelPredicate
 
typedef std::vector< SurfelSurfelStorage
 
typedef SurfelStorage::const_iterator SurfelConstIterator
 
typedef KSpace::Space Space
 
typedef KSpace::Point Point
 
typedef Tracker DigitalSurfaceTracker
 
typedef SurfelAdjacency< KSpace::dimension > Adjacency
 
typedef KSpace::Cell Cell
 
typedef KSpace::SCell SCell
 
typedef KSpace::CellSet CellSet
 
typedef KSpace::SCellSet SCellSet
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CSurfelPredicate< SurfelPredicate >))
 
 ~ExplicitDigitalSurface ()
 
 ExplicitDigitalSurface (const ExplicitDigitalSurface &other)
 
 ExplicitDigitalSurface (ConstAlias< KSpace > aKSpace, const SurfelPredicate &aSP, const Adjacency &adj, const Surfel &s, bool closed=false)
 
const AdjacencysurfelAdjacency () const
 
AdjacencysurfelAdjacency ()
 
const SurfelPredicatesurfelPredicate () const
 
const KSpacespace () const
 
bool isInside (const Surfel &s) const
 
SurfelConstIterator begin () const
 
SurfelConstIterator end () const
 
Size nbSurfels () const
 
bool empty () const
 
DigitalSurfaceTrackernewTracker (const Surfel &s) const
 
Connectedness connectedness () const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Member Functions

void computeSurfels (const Surfel &p, bool closed)
 

Private Member Functions

ExplicitDigitalSurfaceoperator= (const ExplicitDigitalSurface &other)
 

Private Attributes

const KSpacemyKSpace
 
const SurfelPredicatemySurfelPredicate
 
Adjacency mySurfelAdjacency
 
SurfelStorage mySurfels
 

Detailed Description

template<typename TKSpace, typename TSurfelPredicate>
class DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >

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. Compute once the boundary of the surface with a tracking.

Description of template class 'ExplicitDigitalSurface'

Note that in the 2D case, this object corresponds to a digital contour made of linels, ordered as a direct orientation sequence. If the contour is open, then begin() returns one extremity while end() is the surfel past the last extremity. If the contour is closed, then begin() is the surfel given at the instantiation of the object.

Template Parameters
TKSpacea model of CCellularGridSpaceND: the type chosen for the cellular grid space.
TSurfelPredicatea model of CSurfelPredicate: this functor defines the digital surface as a characteristic function returning true iff the surfel belongs to it.
Examples:
topology/frontierAndBoundary.cpp.

Definition at line 81 of file ExplicitDigitalSurface.h.

Member Typedef Documentation

template<typename TKSpace, typename TSurfelPredicate>
typedef SurfelAdjacency<KSpace::dimension> DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Adjacency

Definition at line 187 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
typedef KSpace::Cell DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Cell

Definition at line 188 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
typedef KSpace::CellSet DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::CellSet

Definition at line 190 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
typedef Tracker DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::DigitalSurfaceTracker

Definition at line 183 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
typedef TKSpace DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::KSpace

Model of cellular grid space.

Definition at line 167 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
typedef KSpace::Point DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Point

Definition at line 182 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
typedef KSpace::SCell DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::SCell

Definition at line 189 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
typedef KSpace::SCellSet DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::SCellSet

Definition at line 191 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
typedef ExplicitDigitalSurface<TKSpace,TSurfelPredicate> DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Self

Definition at line 165 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
typedef KSpace::Size DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Size

Type for sizes (unsigned integral type).

Definition at line 171 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
typedef KSpace::Space DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Space

Definition at line 181 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
typedef KSpace::SCell DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::Surfel

Type for surfels.

Definition at line 169 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
typedef SurfelStorage::const_iterator DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::SurfelConstIterator

Definition at line 180 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
typedef TSurfelPredicate DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::SurfelPredicate

Definition at line 173 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
typedef std::vector<Surfel> DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::SurfelStorage

Definition at line 179 of file ExplicitDigitalSurface.h.

Constructor & Destructor Documentation

template<typename TKSpace, typename TSurfelPredicate>
DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::~ExplicitDigitalSurface ( )

Destructor.

template<typename TKSpace, typename TSurfelPredicate>
DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::ExplicitDigitalSurface ( const ExplicitDigitalSurface< TKSpace, TSurfelPredicate > &  other)

Copy constructor.

Parameters
otherthe object to clone.

NB: O(N) computational complexity operation, where N is the number of surfels of the surface. This is due to the fact that the surface is stored explicitly.

template<typename TKSpace, typename TSurfelPredicate>
DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::ExplicitDigitalSurface ( ConstAlias< KSpace aKSpace,
const SurfelPredicate aSP,
const Adjacency adj,
const Surfel s,
bool  closed = false 
)

Constructor from digital set.

Parameters
aKSpacea cellular grid space (referenced).
aSPa surfel predicate defining the shape (referenced).
adjthe surfel adjacency (for instance Adjacency( true ) is interior to exterior adjacency ).
sany surfel of aKSpace such that aSP is true in the interior and false in the exterior.
closedwhen 'true', the surface is known to be closed, hence faster extraction can be performed, default is 'false'.

NB: O(N) computational complexity operation, where N is the number of surfels of the surface. This is due to the fact that, at construction, the surface is extracted and stored.

See also
computeSurfels

Member Function Documentation

template<typename TKSpace, typename TSurfelPredicate>
SurfelConstIterator DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::begin ( ) const
Returns
an iterator pointing on the first surfel of the digital surface (unspecified order).
template<typename TKSpace, typename TSurfelPredicate>
DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::BOOST_CONCEPT_ASSERT ( (concepts::CSurfelPredicate< SurfelPredicate >)  )
template<typename TKSpace, typename TSurfelPredicate>
void DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::computeSurfels ( const Surfel p,
bool  closed 
)
protected

Recomputes the set of boundary surfels from the point predicate and some initial surfel.

Parameters
pany surfel of the surface
closedwhen 'true', the surface is known to be closed, hence faster extraction can be performed.
template<typename TKSpace, typename TSurfelPredicate>
Connectedness DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::connectedness ( ) const
Returns
the connectedness of this surface. By construction CONNECTED.
template<typename TKSpace, typename TSurfelPredicate>
bool DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::empty ( ) const
Returns
'true' is the surface has no surfels, 'false' otherwise. NB: O(1) operation.
template<typename TKSpace, typename TSurfelPredicate>
SurfelConstIterator DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::end ( ) const
Returns
an iterator after the last surfel of the digital surface (unspecified order).
template<typename TKSpace, typename TSurfelPredicate>
bool DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::isInside ( const Surfel s) const
Parameters
sany surfel of the space.
Returns
'true' if s belongs to this digital surface.
template<typename TKSpace, typename TSurfelPredicate>
bool DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TKSpace, typename TSurfelPredicate>
Size DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::nbSurfels ( ) const
Returns
the number of surfels of this digital surface. NB: O(1)
template<typename TKSpace, typename TSurfelPredicate>
DigitalSurfaceTracker* DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::newTracker ( const Surfel s) const
Parameters
sany surfel of the space.
Precondition
'isInside( s )'
Returns
a dyn. alloc. pointer on a tracker positionned at s.
template<typename TKSpace, typename TSurfelPredicate>
ExplicitDigitalSurface& DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::operator= ( const ExplicitDigitalSurface< TKSpace, TSurfelPredicate > &  other)
private

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.
template<typename TKSpace, typename TSurfelPredicate>
void DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.
template<typename TKSpace, typename TSurfelPredicate>
const KSpace& DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::space ( ) const
Returns
the cellular space in which lives the surface.
template<typename TKSpace, typename TSurfelPredicate>
const Adjacency& DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::surfelAdjacency ( ) const

accessor to surfel adjacency.

template<typename TKSpace, typename TSurfelPredicate>
Adjacency& DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::surfelAdjacency ( )

mutator to surfel adjacency.

template<typename TKSpace, typename TSurfelPredicate>
const SurfelPredicate& DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::surfelPredicate ( ) const

accessor to point predicate.

Field Documentation

template<typename TKSpace, typename TSurfelPredicate>
const KSpace& DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::myKSpace
private

a reference to the cellular space.

Definition at line 302 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
Adjacency DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::mySurfelAdjacency
private

the surfel adjacency used to determine neighbors.

Definition at line 306 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
const SurfelPredicate& DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::mySurfelPredicate
private

a reference to the surfel predicate defining the shape.

Definition at line 304 of file ExplicitDigitalSurface.h.

template<typename TKSpace, typename TSurfelPredicate>
SurfelStorage DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::mySurfels
private

a vector storing all the surfels of the boundary.

Definition at line 308 of file ExplicitDigitalSurface.h.


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