DGtal 1.4.0
|
Aim: This class aims at representing an iterator that provides a way to scan the points of a DSL. It is both a model of readable iterator and of bidirectional iterator. More...
#include <DGtal/geometry/curves/ArithmeticalDSL.h>
Public Member Functions | |
ConstIterator () | |
ConstIterator (const ArithmeticalDSL *aDSL, const Point &aPoint) | |
ConstIterator (const ConstIterator &aOther) | |
ConstIterator & | operator= (const ConstIterator &aOther) |
~ConstIterator () | |
Integer | remainder () const |
Private Member Functions | |
Point const | dereference () const |
void | increment () |
void | decrement () |
bool | equal (const ConstIterator &aOther) const |
void | advance (const Position &aShift) |
Position | distance_to (const ConstIterator &aOther) const |
Private Attributes | |
const ArithmeticalDSL * | myDSLPtr |
Constant aliasing pointer to the DSL visited by the iterator. | |
Point | myCurrentPoint |
The current point. | |
Integer | myQuantityToAdd |
Quantity to add to the current remainder. | |
Integer | myQuantityToRemove |
Quantity to remove to the current remainder. | |
Integer | myCurrentRemainder |
Remainder of the current point. | |
Friends | |
class | boost::iterator_core_access |
Aim: This class aims at representing an iterator that provides a way to scan the points of a DSL. It is both a model of readable iterator and of bidirectional iterator.
Instances of this class are returned by begin and end methods of DSL classes as follows:
See Digital straight lines and segments for further details.
Definition at line 177 of file ArithmeticalDSL.h.
DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::ConstIterator::ConstIterator | ( | ) |
Default constructor (not valid).
DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::ConstIterator::ConstIterator | ( | const ArithmeticalDSL * | aDSL, |
const Point & | aPoint ) |
Constructor.
aDSL | an arithmetical DSL |
aPoint | a point of the DSL containing aDSL |
DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::ConstIterator::ConstIterator | ( | const ConstIterator & | aOther | ) |
Copy constructor.
aOther | the iterator to clone. |
DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::ConstIterator::~ConstIterator | ( | ) |
Destructor. Does nothing.
|
private |
Moves myCurrentPoint lying at position i to the point of the DSL lying at position i + aShift
aShift | position difference NB: in O(1) |
|
private |
Moves myCurrentPoint to the previous point of the DSL
|
private |
Dereference operator
|
private |
Computes the distance between *this and aOther, ie. the difference between their positions
aOther | any other iterator |
|
private |
Equality operator.
aOther | the iterator to compare with (must be defined on the same DSL). |
|
private |
Moves myCurrentPoint to the next point of the DSL
ConstIterator & DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::ConstIterator::operator= | ( | const ConstIterator & | aOther | ) |
Assignment.
aOther | the iterator to copy. |
Integer DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::ConstIterator::remainder | ( | ) | const |
|
friend |
Definition at line 248 of file ArithmeticalDSL.h.
|
private |
The current point.
Definition at line 195 of file ArithmeticalDSL.h.
|
private |
Remainder of the current point.
Definition at line 204 of file ArithmeticalDSL.h.
|
private |
Constant aliasing pointer to the DSL visited by the iterator.
Definition at line 192 of file ArithmeticalDSL.h.
|
private |
Quantity to add to the current remainder.
Definition at line 198 of file ArithmeticalDSL.h.
|
private |
Quantity to remove to the current remainder.
Definition at line 201 of file ArithmeticalDSL.h.