DGtal  1.5.beta
DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker > Class Template Reference

Aim: Represents a 2-dimensional slice in a DigitalSurface. In a sense, it is a 4-connected contour, open or not. To be valid, it must be connected to some digital surface and a starting surfel. More...

#include <DGtal/topology/DigitalSurface2DSlice.h>

Public Types

typedef TDigitalSurfaceTracker DigitalSurfaceTracker
 
typedef DigitalSurface2DSlice< DigitalSurfaceTrackerSelf
 
typedef DigitalSurfaceTracker::DigitalSurfaceContainer DigitalSurfaceContainer
 
typedef DigitalSurfaceContainer::KSpace KSpace
 
typedef DigitalSurfaceContainer::Surfel Surfel
 
typedef DigitalSurfaceContainer::Size Size
 
typedef DigitalSurface< DigitalSurfaceContainerTheDigitalSurface
 
typedef std::deque< SurfelStorage
 
typedef Storage::const_iterator ConstIterator
 
typedef Storage::const_reverse_iterator ConstReverseIterator
 
typedef Circulator< ConstIteratorConstCirculator
 
typedef Circulator< ConstReverseIteratorConstReverseCirculator
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CDigitalSurfaceTracker< DigitalSurfaceTracker >))
 
 ~DigitalSurface2DSlice ()
 
 DigitalSurface2DSlice (DigitalSurfaceTracker *tracker, Dimension i)
 
bool init (DigitalSurfaceTracker *tracker, Dimension i)
 
Size size () const
 The number of surfels of this slice. More...
 
bool isClosed () const
 
ConstIterator start () const
 
ConstReverseIterator rstart () const
 
ConstCirculator cstart () const
 
ConstReverseCirculator rcstart () const
 
ConstIterator begin () const
 
ConstIterator end () const
 
ConstReverseIterator rbegin () const
 
ConstReverseIterator rend () const
 
ConstCirculator c () const
 
ConstReverseCirculator rc () const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Member Functions

 DigitalSurface2DSlice ()
 

Private Member Functions

 DigitalSurface2DSlice (const DigitalSurface2DSlice &other)
 
DigitalSurface2DSliceoperator= (const DigitalSurface2DSlice &other)
 

Private Attributes

std::deque< SurfelmySurfels
 The container that stores the surfels of this slice. More...
 
bool myIsClosed
 Tells if the slice is closed (true) or open (false). More...
 
ConstIterator myStart
 

Detailed Description

template<typename TDigitalSurfaceTracker>
class DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >

Aim: Represents a 2-dimensional slice in a DigitalSurface. In a sense, it is a 4-connected contour, open or not. To be valid, it must be connected to some digital surface and a starting surfel.

Description of template class 'DigitalSurface2DSlice'

It provides the following inner types:

  • ConstIterator
  • ConstReverseIterator
  • ConstCirculator
  • ConstReverseCirculator

And the following (circular)iterator services:

  • begin() : begin ConstIterator
  • end() : end ConstIterator
  • rbegin() : begin ConstReverseIterator
  • rend() : end ConstReverseIterator
  • c() : ConstCirculator
  • rc() : ConstReverseCirculator

You can use these services to iterate over the elements. Note that c() and rc() are defined so as to start on the same surfel (when dereferenced). The same is true for cstart() and rcstart(). You should use circulators when isClosed() is true, otherwise it will connect unconnected surfels (the two extremities of the open slice contour).

Template Parameters
TDigitalSurfaceTrackerany model of CDigitalSurfaceTracker: the concrete representation chosen for tracking the digital surface.

Definition at line 93 of file DigitalSurface2DSlice.h.

Member Typedef Documentation

◆ ConstCirculator

template<typename TDigitalSurfaceTracker >
typedef Circulator<ConstIterator> DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::ConstCirculator

Definition at line 109 of file DigitalSurface2DSlice.h.

◆ ConstIterator

template<typename TDigitalSurfaceTracker >
typedef Storage::const_iterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::ConstIterator

Definition at line 107 of file DigitalSurface2DSlice.h.

◆ ConstReverseCirculator

template<typename TDigitalSurfaceTracker >
typedef Circulator<ConstReverseIterator> DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::ConstReverseCirculator

Definition at line 110 of file DigitalSurface2DSlice.h.

◆ ConstReverseIterator

template<typename TDigitalSurfaceTracker >
typedef Storage::const_reverse_iterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::ConstReverseIterator

Definition at line 108 of file DigitalSurface2DSlice.h.

◆ DigitalSurfaceContainer

template<typename TDigitalSurfaceTracker >
typedef DigitalSurfaceTracker::DigitalSurfaceContainer DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::DigitalSurfaceContainer

Definition at line 100 of file DigitalSurface2DSlice.h.

◆ DigitalSurfaceTracker

template<typename TDigitalSurfaceTracker >
typedef TDigitalSurfaceTracker DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::DigitalSurfaceTracker

Definition at line 96 of file DigitalSurface2DSlice.h.

◆ KSpace

template<typename TDigitalSurfaceTracker >
typedef DigitalSurfaceContainer::KSpace DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::KSpace

Definition at line 101 of file DigitalSurface2DSlice.h.

◆ Self

template<typename TDigitalSurfaceTracker >
typedef DigitalSurface2DSlice<DigitalSurfaceTracker> DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::Self

Definition at line 99 of file DigitalSurface2DSlice.h.

◆ Size

template<typename TDigitalSurfaceTracker >
typedef DigitalSurfaceContainer::Size DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::Size

Definition at line 103 of file DigitalSurface2DSlice.h.

◆ Storage

template<typename TDigitalSurfaceTracker >
typedef std::deque<Surfel> DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::Storage

Definition at line 106 of file DigitalSurface2DSlice.h.

◆ Surfel

template<typename TDigitalSurfaceTracker >
typedef DigitalSurfaceContainer::Surfel DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::Surfel

Definition at line 102 of file DigitalSurface2DSlice.h.

◆ TheDigitalSurface

template<typename TDigitalSurfaceTracker >
typedef DigitalSurface<DigitalSurfaceContainer> DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::TheDigitalSurface

Definition at line 104 of file DigitalSurface2DSlice.h.

Constructor & Destructor Documentation

◆ ~DigitalSurface2DSlice()

template<typename TDigitalSurfaceTracker >
DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::~DigitalSurface2DSlice ( )

Destructor.

◆ DigitalSurface2DSlice() [1/3]

template<typename TDigitalSurfaceTracker >
DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::DigitalSurface2DSlice ( DigitalSurfaceTracker tracker,
Dimension  i 
)

Constructor from tracker and Dimension. The current position of the tracker gives the starting surfel s. The 2D slice spans a 2D-plane containing axes i and sOrthDir( s ).

Parameters
trackera pointer on a tracker, which will be moved to build the slice. More precisely, if the contour is open, the tracker is moved to the first surfel when traversing in the direct orientation. If the contour is closed, the tracker is returned at the same position.
ia direction different from the orthogonal direction of the current surfel of the tracker.
See also
init

NB: O(n) complexity (at least) if n is the number of surfels of the slice.

◆ DigitalSurface2DSlice() [2/3]

template<typename TDigitalSurfaceTracker >
DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::DigitalSurface2DSlice ( )
protected

Constructor. Forbidden by default (protected to avoid g++ warnings).

◆ DigitalSurface2DSlice() [3/3]

template<typename TDigitalSurfaceTracker >
DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::DigitalSurface2DSlice ( const DigitalSurface2DSlice< TDigitalSurfaceTracker > &  other)
private

Copy constructor.

Parameters
otherthe object to clone. Forbidden by default.

Member Function Documentation

◆ begin()

template<typename TDigitalSurfaceTracker >
ConstIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::begin ( ) const

Iterator service.

Returns
begin iterator

◆ BOOST_CONCEPT_ASSERT()

template<typename TDigitalSurfaceTracker >
DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::BOOST_CONCEPT_ASSERT ( (concepts::CDigitalSurfaceTracker< DigitalSurfaceTracker >)  )

◆ c()

template<typename TDigitalSurfaceTracker >
ConstCirculator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::c ( ) const

Circulator service.

Returns
a circulator

◆ cstart()

template<typename TDigitalSurfaceTracker >
ConstCirculator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::cstart ( ) const
Returns
the circulator on the surfel that was given for initialization.

◆ end()

template<typename TDigitalSurfaceTracker >
ConstIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::end ( ) const

Iterator service.

Returns
end iterator

◆ init()

template<typename TDigitalSurfaceTracker >
bool DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::init ( DigitalSurfaceTracker tracker,
Dimension  i 
)

Initializes the slice from a tracker tracker and a direction i.

Parameters
trackera pointer on a tracker, which will be moved to build the slice. More precisely, if the contour is open, the tracker is moved to the first surfel when traversing in the direct orientation. If the contour is closed, the tracker is returned at the same position.
ia direction different from the orthogonal direction of the current surfel of the tracker.
Returns
'true' if the initialization was ok, false otherwise (for instance if i is the orthogonal direction of the current surfel of the tracker.

NB: O(n) complexity (at least) if n is the number of surfels of the slice.

◆ isClosed()

template<typename TDigitalSurfaceTracker >
bool DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::isClosed ( ) const
Returns
'true' if the contour is closed, 'false' otherwise.

◆ isValid()

template<typename TDigitalSurfaceTracker >
bool DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ operator=()

template<typename TDigitalSurfaceTracker >
DigitalSurface2DSlice& DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::operator= ( const DigitalSurface2DSlice< TDigitalSurfaceTracker > &  other)
private

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.

◆ rbegin()

template<typename TDigitalSurfaceTracker >
ConstReverseIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::rbegin ( ) const

Iterator service.

Returns
rbegin iterator

◆ rc()

template<typename TDigitalSurfaceTracker >
ConstReverseCirculator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::rc ( ) const

Circulator service.

Returns
a reverse circulator

◆ rcstart()

template<typename TDigitalSurfaceTracker >
ConstReverseCirculator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::rcstart ( ) const
Returns
the reverse circulator on the surfel that was given for initialization.

◆ rend()

template<typename TDigitalSurfaceTracker >
ConstReverseIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::rend ( ) const

Iterator service.

Returns
rend iterator

◆ rstart()

template<typename TDigitalSurfaceTracker >
ConstReverseIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::rstart ( ) const
Returns
the reverse iterator on the surfel that was given for initialization.

◆ selfDisplay()

template<typename TDigitalSurfaceTracker >
void DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ size()

template<typename TDigitalSurfaceTracker >
Size DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::size ( ) const

The number of surfels of this slice.

◆ start()

template<typename TDigitalSurfaceTracker >
ConstIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::start ( ) const
Returns
the iterator on the surfel that was given for initialization.

Field Documentation

◆ myIsClosed

template<typename TDigitalSurfaceTracker >
bool DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::myIsClosed
private

Tells if the slice is closed (true) or open (false).

Definition at line 252 of file DigitalSurface2DSlice.h.

◆ myStart

template<typename TDigitalSurfaceTracker >
ConstIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::myStart
private

The iterator on the surfel given at initialization (may be different from begin() if the slice is open.

Definition at line 255 of file DigitalSurface2DSlice.h.

◆ mySurfels

template<typename TDigitalSurfaceTracker >
std::deque<Surfel> DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::mySurfels
private

The container that stores the surfels of this slice.

Definition at line 250 of file DigitalSurface2DSlice.h.


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