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>
template<typename TCoordinate, typename TInteger = TCoordinate, unsigned short adjacency = 8>
class DGtal::ArithmeticalDSL< TCoordinate, TInteger, adjacency >::ConstIterator
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:
it = line.begin(firstPoint),
ite = line.end(lastPoint);
it != ite; ++it )
{
board << SetMode( it->className(), "Paving" )
<< *it;
}
MyDigitalSurface::ConstIterator ConstIterator
See Digital straight lines and segments
for further details.
- See also
- ArithmeticalDSL NaiveDSL StandardDSL
-
exampleArithmeticalDSL.cpp
Definition at line 177 of file ArithmeticalDSL.h.
◆ ConstIterator() [1/3]
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
Default constructor (not valid).
◆ ConstIterator() [2/3]
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
Constructor.
- Parameters
-
aDSL | an arithmetical DSL |
aPoint | a point of the DSL containing aDSL |
◆ ConstIterator() [3/3]
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
Copy constructor.
- Parameters
-
aOther | the iterator to clone. |
◆ ~ConstIterator()
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
Destructor. Does nothing.
◆ advance()
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
Moves myCurrentPoint lying at position i to the point of the DSL lying at position i + aShift
- Parameters
-
aShift | position difference NB: in O(1) |
◆ decrement()
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
Moves myCurrentPoint to the previous point of the DSL
◆ dereference()
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
Dereference operator
- Returns
- the current point
◆ distance_to()
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
Computes the distance between *this and aOther, ie. the difference between their positions
- Parameters
-
- Returns
- distance between the two iterators
◆ equal()
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
Equality operator.
- Parameters
-
aOther | the iterator to compare with (must be defined on the same DSL). |
- Returns
- 'true' if their current points coincide.
◆ increment()
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
Moves myCurrentPoint to the next point of the DSL
◆ operator=()
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
Assignment.
- Parameters
-
aOther | the iterator to copy. |
- Returns
- a reference on 'this'.
◆ remainder()
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
- Returns
- the remainder of the current point (without any computation)
◆ boost::iterator_core_access
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
friend class boost::iterator_core_access |
|
friend |
◆ myCurrentPoint
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
◆ myCurrentRemainder
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
◆ myDSLPtr
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
Constant aliasing pointer to the DSL visited by the iterator.
Definition at line 192 of file ArithmeticalDSL.h.
◆ myQuantityToAdd
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
◆ myQuantityToRemove
template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
The documentation for this class was generated from the following file: