DGtal  0.9.4beta
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker > Class Template Reference

#include <DGtal/topology/DigitalSurface2DSlice.h>

Collaboration diagram for DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >:
[legend]

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
 
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
 
bool myIsClosed
 
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:

And the following (circular)iterator services:

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.
Examples:
geometry/curves/exampleGridCurve3d-2.cpp, and topology/digitalSurfaceSlice.cpp.

Definition at line 92 of file DigitalSurface2DSlice.h.

Member Typedef Documentation

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

Definition at line 108 of file DigitalSurface2DSlice.h.

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

Definition at line 106 of file DigitalSurface2DSlice.h.

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

Definition at line 109 of file DigitalSurface2DSlice.h.

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

Definition at line 107 of file DigitalSurface2DSlice.h.

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

Definition at line 99 of file DigitalSurface2DSlice.h.

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

Definition at line 95 of file DigitalSurface2DSlice.h.

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

Definition at line 100 of file DigitalSurface2DSlice.h.

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

Definition at line 98 of file DigitalSurface2DSlice.h.

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

Definition at line 102 of file DigitalSurface2DSlice.h.

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

Definition at line 105 of file DigitalSurface2DSlice.h.

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

Definition at line 101 of file DigitalSurface2DSlice.h.

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

Definition at line 103 of file DigitalSurface2DSlice.h.

Constructor & Destructor Documentation

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

Destructor.

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.

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

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

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

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

Iterator service.

Returns
begin iterator
template<typename TDigitalSurfaceTracker >
DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::BOOST_CONCEPT_ASSERT ( (concepts::CDigitalSurfaceTracker< DigitalSurfaceTracker >)  )
template<typename TDigitalSurfaceTracker >
ConstCirculator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::c ( ) const

Circulator service.

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

Iterator service.

Returns
end iterator
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.

template<typename TDigitalSurfaceTracker >
bool DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::isClosed ( ) const
Returns
'true' if the contour is closed, 'false' otherwise.
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.
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.
template<typename TDigitalSurfaceTracker >
ConstReverseIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::rbegin ( ) const

Iterator service.

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

Circulator service.

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

Iterator service.

Returns
rend iterator
template<typename TDigitalSurfaceTracker >
ConstReverseIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::rstart ( ) const
Returns
the reverse iterator on the surfel that was given for initialization.
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.
template<typename TDigitalSurfaceTracker >
Size DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::size ( ) const

The number of surfels of this slice.

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

Field Documentation

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

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

Definition at line 251 of file DigitalSurface2DSlice.h.

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 254 of file DigitalSurface2DSlice.h.

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

The container that stores the surfels of this slice.

Definition at line 249 of file DigitalSurface2DSlice.h.


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