DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate > Class Template Reference

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. More...

#include <DGtal/topology/ExplicitDigitalSurface.h>

Data Structures

class  Tracker
 

Public Types

typedef ExplicitDigitalSurface< TKSpace, TSurfelPredicate > Self
 
typedef TKSpace KSpace
 Model of cellular grid space.
 
typedef KSpace::SCell Surfel
 Type for surfels.
 
typedef KSpace::Size Size
 Type for sizes (unsigned integral type).
 
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::dimensionAdjacency
 
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
 accessor to surfel adjacency.
 
AdjacencysurfelAdjacency ()
 mutator to surfel adjacency.
 
const SurfelPredicatesurfelPredicate () const
 accessor to point predicate.
 
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
 a reference to the cellular space.
 
const SurfelPredicatemySurfelPredicate
 a reference to the surfel predicate defining the shape.
 
Adjacency mySurfelAdjacency
 the surfel adjacency used to determine neighbors.
 
SurfelStorage mySurfels
 a vector storing all the surfels of the boundary.
 

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

◆ Adjacency

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

Definition at line 187 of file ExplicitDigitalSurface.h.

◆ Cell

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

Definition at line 188 of file ExplicitDigitalSurface.h.

◆ CellSet

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

Definition at line 190 of file ExplicitDigitalSurface.h.

◆ DigitalSurfaceTracker

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

Definition at line 183 of file ExplicitDigitalSurface.h.

◆ KSpace

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.

◆ Point

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

Definition at line 182 of file ExplicitDigitalSurface.h.

◆ SCell

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

Definition at line 189 of file ExplicitDigitalSurface.h.

◆ SCellSet

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

Definition at line 191 of file ExplicitDigitalSurface.h.

◆ Self

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

Definition at line 165 of file ExplicitDigitalSurface.h.

◆ Size

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.

◆ Space

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

Definition at line 181 of file ExplicitDigitalSurface.h.

◆ Surfel

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

Type for surfels.

Definition at line 169 of file ExplicitDigitalSurface.h.

◆ SurfelConstIterator

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

Definition at line 180 of file ExplicitDigitalSurface.h.

◆ SurfelPredicate

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

Definition at line 173 of file ExplicitDigitalSurface.h.

◆ SurfelStorage

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

◆ ~ExplicitDigitalSurface()

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

Destructor.

◆ ExplicitDigitalSurface() [1/2]

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.

◆ ExplicitDigitalSurface() [2/2]

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

◆ begin()

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).

◆ BOOST_CONCEPT_ASSERT()

template<typename TKSpace , typename TSurfelPredicate >
DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::BOOST_CONCEPT_ASSERT ( (concepts::CSurfelPredicate< SurfelPredicate >) )

◆ computeSurfels()

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.

◆ connectedness()

template<typename TKSpace , typename TSurfelPredicate >
Connectedness DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::connectedness ( ) const
Returns
the connectedness of this surface. By construction CONNECTED.

◆ empty()

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.

◆ end()

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).

◆ isInside()

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.

◆ isValid()

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.

◆ nbSurfels()

template<typename TKSpace , typename TSurfelPredicate >
Size DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::nbSurfels ( ) const
Returns
the number of surfels of this digital surface. NB: O(1)

◆ newTracker()

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.

◆ operator=()

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.

◆ selfDisplay()

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.

◆ space()

template<typename TKSpace , typename TSurfelPredicate >
const KSpace & DGtal::ExplicitDigitalSurface< TKSpace, TSurfelPredicate >::space ( ) const
Returns
the cellular space in which lives the surface.

◆ surfelAdjacency() [1/2]

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

mutator to surfel adjacency.

◆ surfelAdjacency() [2/2]

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

accessor to surfel adjacency.

◆ surfelPredicate()

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

accessor to point predicate.

Field Documentation

◆ myKSpace

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.

◆ mySurfelAdjacency

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.

◆ mySurfelPredicate

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.

◆ mySurfels

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: