DGtal  1.4.beta
DGtal::concepts::CDigitalSurfaceContainer< T > Struct Template Reference

Aim: The digital surface container concept describes a minimal set of inner types and methods so as to describe the data of digital surfaces. More...

#include <DGtal/topology/CDigitalSurfaceContainer.h>

Inheritance diagram for DGtal::concepts::CDigitalSurfaceContainer< T >:
[legend]

Public Types

typedef T::KSpace KSpace
 
typedef T::Surfel Surfel
 
typedef T::SurfelConstIterator SurfelConstIterator
 
typedef T::DigitalSurfaceTracker DigitalSurfaceTracker
 
typedef T::Size Size
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((boost_concepts::SinglePassIteratorConcept< SurfelConstIterator >))
 
 BOOST_CONCEPT_ASSERT ((boost_concepts::ReadableIteratorConcept< SurfelConstIterator >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CCellularGridSpaceND< KSpace >))
 
 BOOST_CONCEPT_ASSERT ((CDigitalSurfaceTracker< DigitalSurfaceTracker >))
 
 BOOST_CONCEPT_USAGE (CDigitalSurfaceContainer)
 
void checkConstConstraints () const
 

Private Attributes

myX
 
KSpace myKSpace
 
Surfel mySurfel
 
bool myBool
 
SurfelConstIterator mySurfelCIt
 
DigitalSurfaceTrackermyPtrTracker
 
Connectedness myConnectedness
 
Size mySize
 

Detailed Description

template<typename T>
struct DGtal::concepts::CDigitalSurfaceContainer< T >

Aim: The digital surface container concept describes a minimal set of inner types and methods so as to describe the data of digital surfaces.

Description of concept 'CDigitalSurfaceContainer'

Digital surfaces arise in many different contexts:

  • an explicit set of oriented surfels
  • the boundary of an explicit set of spels
  • the boundary of an explicit set of digital points
  • the boundary of a set of digital points, defined implicitly by a predicate: Point -> bool
  • a set of oriented surfels, defined implicitly by a predicate: Surfel -> bool
  • a set of oriented surfels, implicitly by a predicate: Oriented Surfel -> bool
  • the boundary of a region in a labelled image
  • the frontier between two regions in a labelled image
  • ...

Since there are so many digital surfaces, it is necessary to provide a mechanism to handle them generically. The class DigitalSurface will be the common proxy to hide models of CDigitalSurfaceContainer.

Hence CDigitalSurfaceContainer describes how to access the data representing the digital surface in common way.

See Models of digital surface containers

Refinement of boost::CopyConstructible

Associated types

  • KSpace: the type of cellular grid space in which lies the digital surface.
  • Surfel: the type of an oriented n-1-cell in this space.
  • SurfelConstIterator: the type for iterating over the of surfels of the digital surface, must be a model of boost_concepts::SinglePassIteratorConcept, boost_concepts::ReadableIteratorConcept
  • DigitalSurfaceTracker: the type for tracking surfels over the digital surface
  • Size: the integral type for counting elements.

Notation

Definitions

Valid expressions and semantics

Name Expression Type requirements Return type Precondition Semantics Post condition Complexity
space accessor x.space() const KSpace & returns a reference to the cellular grid space in which lies the digital surface.
inside test x.isInside( s ) bool returns true iff the surfel s belongs to this digital surface.
begin of range x.begin() SurfelConstIterator returns a const iterator pointing to the first element in the digital surface, seen as a collection of surfels.
end of range x.end() SurfelConstIterator returns an iterator pointing past the last element in the digital surface, seen as a collection of surfels.
tracker instanciation x.newTracker( s ) DigitalSurfaceTracker* returns a dynamically allocated instance of tracker initialized at the surfel s.
connectedness test x.connectedness() enum Connectedness returns either DISCONNECTED, CONNECTED, UNKNOWN depending on the surface.
number of surfels x.nbSurfels() Size returns the number of surfels of this surface.
empty container test x.empty() bool returns true iff the digital surface contains no surfel.

Invariants

Models

Notes

Template Parameters
Tthe type that should be a model of CDigitalSurfaceContainer.

Definition at line 127 of file CDigitalSurfaceContainer.h.

Member Typedef Documentation

◆ DigitalSurfaceTracker

template<typename T >
typedef T::DigitalSurfaceTracker DGtal::concepts::CDigitalSurfaceContainer< T >::DigitalSurfaceTracker

Definition at line 134 of file CDigitalSurfaceContainer.h.

◆ KSpace

template<typename T >
typedef T::KSpace DGtal::concepts::CDigitalSurfaceContainer< T >::KSpace

Definition at line 131 of file CDigitalSurfaceContainer.h.

◆ Size

template<typename T >
typedef T::Size DGtal::concepts::CDigitalSurfaceContainer< T >::Size

Definition at line 135 of file CDigitalSurfaceContainer.h.

◆ Surfel

template<typename T >
typedef T::Surfel DGtal::concepts::CDigitalSurfaceContainer< T >::Surfel

Definition at line 132 of file CDigitalSurfaceContainer.h.

◆ SurfelConstIterator

template<typename T >
typedef T::SurfelConstIterator DGtal::concepts::CDigitalSurfaceContainer< T >::SurfelConstIterator

Definition at line 133 of file CDigitalSurfaceContainer.h.

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT() [1/4]

◆ BOOST_CONCEPT_ASSERT() [2/4]

◆ BOOST_CONCEPT_ASSERT() [3/4]

template<typename T >
DGtal::concepts::CDigitalSurfaceContainer< T >::BOOST_CONCEPT_ASSERT ( (CDigitalSurfaceTracker< DigitalSurfaceTracker >)  )

◆ BOOST_CONCEPT_ASSERT() [4/4]

template<typename T >
DGtal::concepts::CDigitalSurfaceContainer< T >::BOOST_CONCEPT_ASSERT ( (concepts::CCellularGridSpaceND< KSpace >)  )

◆ BOOST_CONCEPT_USAGE()

template<typename T >
DGtal::concepts::CDigitalSurfaceContainer< T >::BOOST_CONCEPT_USAGE ( CDigitalSurfaceContainer< T >  )
inline

Definition at line 143 of file CDigitalSurfaceContainer.h.

144  {
145  // check const methods.
147  }

References DGtal::concepts::CDigitalSurfaceContainer< T >::checkConstConstraints().

◆ checkConstConstraints()

template<typename T >
void DGtal::concepts::CDigitalSurfaceContainer< T >::checkConstConstraints ( ) const
inline

Definition at line 148 of file CDigitalSurfaceContainer.h.

149  {
150  // x.space() const, returns a const KSpace &
151  ConceptUtils::sameType( myKSpace, myX.space() );
152  // x.isInside( Surfel ) const, returns bool.
153  ConceptUtils::sameType( myBool, myX.isInside( mySurfel ) );
154  // x.begin() const, returns SurfelConstIterator
156  // x.end() const, returns SurfelConstIterator
158  // x.newTracker( Surfel ) const, returns DigitalSurfaceTracker*
160  // x.connectedness() const, returns Connectedness
161  ConceptUtils::sameType( myConnectedness, myX.connectedness() );
162  // x.nbSurfels() const, returns Connectedness
163  ConceptUtils::sameType( mySize, myX.nbSurfels() );
164  // x.empty() const, returns bool
165  ConceptUtils::sameType( myBool, myX.empty() );
166  }
void sameType(const T &, const T &)
Definition: ConceptUtils.h:117

References DGtal::concepts::CDigitalSurfaceContainer< T >::myBool, DGtal::concepts::CDigitalSurfaceContainer< T >::myConnectedness, DGtal::concepts::CDigitalSurfaceContainer< T >::myKSpace, DGtal::concepts::CDigitalSurfaceContainer< T >::myPtrTracker, DGtal::concepts::CDigitalSurfaceContainer< T >::mySize, DGtal::concepts::CDigitalSurfaceContainer< T >::mySurfel, DGtal::concepts::CDigitalSurfaceContainer< T >::mySurfelCIt, DGtal::concepts::CDigitalSurfaceContainer< T >::myX, and DGtal::concepts::ConceptUtils::sameType().

Referenced by DGtal::concepts::CDigitalSurfaceContainer< T >::BOOST_CONCEPT_USAGE().

Field Documentation

◆ myBool

template<typename T >
bool DGtal::concepts::CDigitalSurfaceContainer< T >::myBool
private

◆ myConnectedness

◆ myKSpace

◆ myPtrTracker

◆ mySize

◆ mySurfel

◆ mySurfelCIt

◆ myX


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