DGtal 1.3.0
|
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< DigitalSurfaceTracker > | Self |
typedef DigitalSurfaceTracker::DigitalSurfaceContainer | DigitalSurfaceContainer |
typedef DigitalSurfaceContainer::KSpace | KSpace |
typedef DigitalSurfaceContainer::Surfel | Surfel |
typedef DigitalSurfaceContainer::Size | Size |
typedef DigitalSurface< DigitalSurfaceContainer > | TheDigitalSurface |
typedef std::deque< Surfel > | Storage |
typedef Storage::const_iterator | ConstIterator |
typedef Storage::const_reverse_iterator | ConstReverseIterator |
typedef Circulator< ConstIterator > | ConstCirculator |
typedef Circulator< ConstReverseIterator > | ConstReverseCirculator |
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) | |
DigitalSurface2DSlice & | operator= (const DigitalSurface2DSlice &other) |
Private Attributes | |
std::deque< Surfel > | mySurfels |
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 |
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).
TDigitalSurfaceTracker | any model of CDigitalSurfaceTracker: the concrete representation chosen for tracking the digital surface. |
Definition at line 93 of file DigitalSurface2DSlice.h.
typedef Circulator<ConstIterator> DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::ConstCirculator |
Definition at line 109 of file DigitalSurface2DSlice.h.
typedef Storage::const_iterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::ConstIterator |
Definition at line 107 of file DigitalSurface2DSlice.h.
typedef Circulator<ConstReverseIterator> DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::ConstReverseCirculator |
Definition at line 110 of file DigitalSurface2DSlice.h.
typedef Storage::const_reverse_iterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::ConstReverseIterator |
Definition at line 108 of file DigitalSurface2DSlice.h.
typedef DigitalSurfaceTracker::DigitalSurfaceContainer DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::DigitalSurfaceContainer |
Definition at line 100 of file DigitalSurface2DSlice.h.
typedef TDigitalSurfaceTracker DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::DigitalSurfaceTracker |
Definition at line 96 of file DigitalSurface2DSlice.h.
typedef DigitalSurfaceContainer::KSpace DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::KSpace |
Definition at line 101 of file DigitalSurface2DSlice.h.
typedef DigitalSurface2DSlice<DigitalSurfaceTracker> DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::Self |
Definition at line 99 of file DigitalSurface2DSlice.h.
typedef DigitalSurfaceContainer::Size DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::Size |
Definition at line 103 of file DigitalSurface2DSlice.h.
typedef std::deque<Surfel> DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::Storage |
Definition at line 106 of file DigitalSurface2DSlice.h.
typedef DigitalSurfaceContainer::Surfel DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::Surfel |
Definition at line 102 of file DigitalSurface2DSlice.h.
typedef DigitalSurface<DigitalSurfaceContainer> DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::TheDigitalSurface |
Definition at line 104 of file DigitalSurface2DSlice.h.
DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::~DigitalSurface2DSlice | ( | ) |
Destructor.
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 ).
tracker | a 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. |
i | a direction different from 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.
|
protected |
Constructor. Forbidden by default (protected to avoid g++ warnings).
|
private |
Copy constructor.
other | the object to clone. Forbidden by default. |
ConstIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::begin | ( | ) | const |
Iterator service.
DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::BOOST_CONCEPT_ASSERT | ( | (concepts::CDigitalSurfaceTracker< DigitalSurfaceTracker >) | ) |
ConstCirculator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::c | ( | ) | const |
Circulator service.
ConstCirculator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::cstart | ( | ) | const |
ConstIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::end | ( | ) | const |
Iterator service.
bool DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::init | ( | DigitalSurfaceTracker * | tracker, |
Dimension | i | ||
) |
Initializes the slice from a tracker tracker and a direction i.
tracker | a 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. |
i | a direction different from 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.
bool DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::isClosed | ( | ) | const |
bool DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
|
private |
Assignment.
other | the object to copy. |
ConstReverseIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::rbegin | ( | ) | const |
Iterator service.
ConstReverseCirculator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::rc | ( | ) | const |
Circulator service.
ConstReverseCirculator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::rcstart | ( | ) | const |
ConstReverseIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::rend | ( | ) | const |
Iterator service.
ConstReverseIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::rstart | ( | ) | const |
void DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Size DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::size | ( | ) | const |
The number of surfels of this slice.
ConstIterator DGtal::DigitalSurface2DSlice< TDigitalSurfaceTracker >::start | ( | ) | const |
|
private |
Tells if the slice is closed (true) or open (false).
Definition at line 252 of file DigitalSurface2DSlice.h.
|
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.
|
private |
The container that stores the surfels of this slice.
Definition at line 250 of file DigitalSurface2DSlice.h.