Iterator on Coordinates.
More...
#include "Imagine/Common.h"
template<int dim>
class Imagine::CoordsIterator< dim >
Iterator on Coords. Iterates over rectangular region. Used to iterate over a MultiArray while being aware of coordinates.
- Parameters
-
- Examples:
- Common/test/test.cpp, and Images/test/test.cpp.
◆ CoordsIterator() [1/2]
Constructs a stopped iterator, useful to check end of iteration with operator!=
.
◆ CoordsIterator() [2/2]
Constructs an iterator over a rectangular region from a to b
- Parameters
-
a,b | limits of rectangular region |
CoordsIterator<2> it2(Coords<2>(1,1),Coords<2>(5,3));
◆ operator!=()
Inequality test
- Parameters
-
it | iterator for comparision |
- Returns
- true if operator==() is false
if (it1!=it2) cout << "it1 is different from it2" << endl;
◆ operator*()
Dereference: coordinate position
- Returns
- position
for (CoordsIterator<2> it(Coords<2>(0,0),Coords<2>(1,2)); it != CoordsIterator<2>() ; ++ it)
cout << *it << endl;
◆ operator++() [1/2]
Pre-increment: advance to next position. Becomes stopped if end is reached
- Returns
- self reference
for (CoordsIterator<2> it(Coords<2>(0,0),Coords<2>(1,2)); it != CoordsIterator<2>() ; ++ it)
cout << *it << endl;
◆ operator++() [2/2]
Post-increment: advance to next position. Becomes stopped if end is reached
- Returns
- value before increment
for (CoordsIterator<2> it(Coords<2>(0,0),Coords<2>(1,2)); it != CoordsIterator<2>() ; )
cout << it++->x() << endl;
◆ operator->()
Member selection: pointer to coordinate position
- Returns
- pointer to position
for (CoordsIterator<2> it(Coords<2>(0,0),Coords<2>(1,2)); it != CoordsIterator<2>() ; )
cout << it++->x() << endl;
◆ operator=()
◆ operator==()
Equality test
- Parameters
-
it | iterator for comparision |
- Returns
- true if
- both are stopped
- or both are non stopped and at same position
if (it1==it2) cout << "it1 equals it2" << endl;
The documentation for this class was generated from the following file:
- /home/pascal/Ponts/svn/ImagineQt/Imagine/Common/src/Imagine/Common/Coords.h