32 #if defined(HyperRectDomain_Iterator_RECURSES) 33 #error Recursive header files inclusion detected in HyperRectDomain_Iterator.h 34 #else // defined(HyperRectDomain_Iterator_RECURSES) 36 #define HyperRectDomain_Iterator_RECURSES 38 #if !defined HyperRectDomain_Iterator_h 40 #define HyperRectDomain_Iterator_h 46 #include "DGtal/base/Common.h" 51 template<
typename _Iterator>
53 :
public std::iterator<typename std::iterator_traits<_Iterator>::iterator_category,
54 typename std::iterator_traits<_Iterator>::value_type,
55 typename std::iterator_traits<_Iterator>::difference_type,
56 typename std::iterator_traits<_Iterator>::pointer,
57 typename std::iterator_traits<_Iterator>::reference>
65 typedef typename std::iterator_traits<_Iterator>::difference_type
67 typedef typename std::iterator_traits<_Iterator>::reference
reference;
68 typedef typename std::iterator_traits<_Iterator>::pointer
pointer;
135 {
return *(*
this + __n); }
137 template<
typename _Iterator>
141 {
return __x.
base() == __y.
base(); }
142 template<
typename _Iterator>
146 {
return !(__x == __y); }
157 template<
typename TPo
int>
174 "The lower bound must be lower than the upper bound or, for an empty domain, be equal to the upper bound + diagonal(1)." 179 "The point must be inside the domain or be equal to one of his bound." 187 "The iterator points outside the domain." 197 "The iterator points outside the domain." 228 if (( TPoint::dimension > 1 ) &&
236 if ( current_pos < TPoint::dimension )
239 while (( current_pos + 1 < TPoint::dimension ) &&
271 if (( TPoint::dimension > 1 ) &&
279 if ( current_pos < TPoint::dimension )
282 while (( current_pos + 1 < TPoint::dimension ) &&
320 template<
typename TPo
int>
333 std::initializer_list<Dimension> subDomain)
337 lower.isLower(
upper) ||
lower ==
upper + TPoint::diagonal(0).partialCopy( TPoint::diagonal(1), subDomain),
338 "The lower bound must be lower than the upper bound or, for an empty domain, be equal to the upper bound + diagonal(1)." 343 "The point must be inside the domain or be equal to one of his bound." 347 subDomain.size() <= TPoint::dimension,
348 "The sub-range cannot have more dimensions than the ambiant space." 352 for (
const unsigned int *c = subDomain.begin();
353 c != subDomain.end(); ++c )
356 *c <= TPoint::dimension,
357 "Invalid dimension in the sub-range." 368 const std::vector<Dimension> &subDomain)
372 lower.isLower(
upper) ||
lower ==
upper + TPoint::diagonal(0).partialCopy( TPoint::diagonal(1), subDomain ),
373 "The lower bound must be lower than the upper bound or, for an empty domain, be equal to the upper bound + diagonal(1)." 378 "The point must be inside the domain or be equal to one of his bound." 382 subDomain.size() <= TPoint::dimension,
383 "The sub-range cannot have more dimensions than the ambiant space." 387 for (
typename std::vector<Dimension>::const_iterator it = subDomain.begin();
388 it != subDomain.end(); ++it )
391 *it <= TPoint::dimension,
392 "Invalid dimension in the sub-range." 405 "The iterator points outside the domain." 415 "The iterator points outside the domain." 553 #endif // !defined HyperRectDomain_Iterator_h 555 #undef HyperRectDomain_Iterator_RECURSES 556 #endif // else defined(HyperRectDomain_Iterator_RECURSES) void nextSubDomainOrder()
const TPoint & operator*() const
myreverse_iterator & operator++()
myreverse_iterator & operator-=(difference_type __n)
myreverse_iterator & operator+=(difference_type __n)
myreverse_iterator operator--(int)
bool operator==(const HyperRectDomain_Iterator< TPoint > &it) const
myreverse_iterator & operator--()
reference operator[](difference_type __n) const
Vector lower(const Vector &z, unsigned int k)
std::vector< Dimension > mySubDomain
iterator_type base() const
HyperRectDomain_Iterator< TPoint > & operator--()
HyperRectDomain_Iterator(const TPoint &p, const TPoint &lower, const TPoint &upper)
bool operator!=(const HyperRectDomain_subIterator< TPoint > &aIt) const
const TPoint & operator*() const
myreverse_iterator operator++(int)
HyperRectDomain_subIterator< TPoint > & operator++()
std::iterator_traits< _Iterator >::difference_type difference_type
myreverse_iterator operator-(difference_type __n) const
HyperRectDomain_Iterator< TPoint > & operator++()
TPoint mylower
Copies of the Domain limits.
ptrdiff_t difference_type
TPoint::Dimension Dimension
void nextLexicographicOrder()
bool operator==(const HyperRectDomain_subIterator< TPoint > &it) const
HyperRectDomain_subIterator(const TPoint &p, const TPoint &lower, const TPoint &upper, std::initializer_list< Dimension > subDomain)
myreverse_iterator(iterator_type __x)
void prevSubDomainOrder()
DGtal is the top-level namespace which contains all DGtal functions and types.
myreverse_iterator operator+(difference_type __n) const
TPoint::Dimension Dimension
ptrdiff_t difference_type
TPoint mylower
Copies of the Domain limits.
bool operator!=(const Point &a, const Point &b)
HyperRectDomain_subIterator< TPoint > & operator--()
bool operator!=(const HyperRectDomain_Iterator< TPoint > &aIt) const
bool operator==(const Point &a, const Point &b)
pointer operator->() const
HyperRectDomain_subIterator(const TPoint &p, const TPoint &lower, const TPoint &upper, const std::vector< Dimension > &subDomain)
TPoint myPoint
Current Point in the domain.
std::bidirectional_iterator_tag iterator_category
myreverse_iterator(const myreverse_iterator &__x)
reference operator*() const
TPoint myPoint
Current Point in the domain.
std::iterator_traits< _Iterator >::pointer pointer
std::bidirectional_iterator_tag iterator_category
Vector upper(const Vector &z, unsigned int k)
void prevLexicographicOrder()
std::iterator_traits< _Iterator >::reference reference