SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
iterator2d_box.hpp
Go to the documentation of this file.
1 /*
2  * Copyright(c):
3  * Signal Image and Communications (SIC) Department
4  * http://www.sic.sp2mi.univ-poitiers.fr/
5  * - University of Poitiers, France http://www.univ-poitiers.fr
6  * - XLIM Institute UMR CNRS 7252 http://www.xlim.fr/
7  *
8  * and
9  *
10  * D2 Fluid, Thermic and Combustion
11  * - University of Poitiers, France http://www.univ-poitiers.fr
12  * - PPRIME Institute - UPR CNRS 3346 http://www.pprime.fr
13  * - ISAE-ENSMA http://www.ensma.fr
14  *
15  * Contributor(s):
16  * The SLIP team,
17  * Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>,
18  * Laurent David <laurent.david_AT_lea.univ-poitiers.fr>,
19  * Ludovic Chatellier <ludovic.chatellier_AT_univ-poitiers.fr>,
20  * Lionel Thomas <lionel.thomas_AT_univ-poitiers.fr>,
21  * Denis Arrivault <arrivault_AT_sic.univ-poitiers.fr>,
22  * Julien Dombre <julien.dombre_AT_univ-poitiers.fr>.
23  *
24  * Description:
25  * The Simple Library of Image Processing (SLIP) is a new image processing
26  * library. It is written in the C++ language following as much as possible
27  * the ISO/ANSI C++ standard. It is consequently compatible with any system
28  * satisfying the ANSI C++ complience. It works on different Unix , Linux ,
29  * Mircrosoft Windows and Mac OS X plateforms. SLIP is a research library that
30  * was created by the Signal, Image and Communications (SIC) departement of
31  * the XLIM, UMR 7252 CNRS Institute in collaboration with the Fluids, Thermic
32  * and Combustion departement of the P', UPR 3346 CNRS Institute of the
33  * University of Poitiers.
34  *
35  * The SLIP Library source code has been registered to the APP (French Agency
36  * for the Protection of Programs) by the University of Poitiers and CNRS,
37  * under registration number IDDN.FR.001.300034.000.S.P.2010.000.21000.
38 
39  * http://www.sic.sp2mi.univ-poitiers.fr/slip/
40  *
41  * This software is governed by the CeCILL-C license under French law and
42  * abiding by the rules of distribution of free software. You can use,
43  * modify and/ or redistribute the software under the terms of the CeCILL-C
44  * license as circulated by CEA, CNRS and INRIA at the following URL
45  * http://www.cecill.info.
46  * As a counterpart to the access to the source code and rights to copy,
47  * modify and redistribute granted by the license, users are provided only
48  * with a limited warranty and the software's author, the holder of the
49  * economic rights, and the successive licensors have only limited
50  * liability.
51  *
52  * In this respect, the user's attention is drawn to the risks associated
53  * with loading, using, modifying and/or developing or reproducing the
54  * software by the user in light of its specific status of free software,
55  * that may mean that it is complicated to manipulate, and that also
56  * therefore means that it is reserved for developers and experienced
57  * professionals having in-depth computer knowledge. Users are therefore
58  * encouraged to load and test the software's suitability as regards their
59  * requirements in conditions enabling the security of their systems and/or
60  * data to be ensured and, more generally, to use and operate it in the
61  * same conditions as regards security.
62  *
63  * The fact that you are presently reading this means that you have had
64  * knowledge of the CeCILL-C license and that you accept its terms.
65  */
66 
67 
75 #ifndef SLIP_ITERATOR2D_BOX_HPP
76 #define SLIP_ITERATOR2D_BOX_HPP
77 
78 #include <iterator>
79 #include <cassert>
80 
81 #include "Point2d.hpp"
82 #include "DPoint2d.hpp"
83 #include "Box2d.hpp"
84 #include "Range.hpp"
85 
86 #include "iterator_types.hpp"
87 
88 namespace slip
89 {
119 template <class Container2D>
120 class iterator2d_box
121 {
122 public:
123  //typedef std::random_access_iterator_tag iterator_category;
125  typedef typename Container2D::value_type value_type;
127  typedef typename Container2D::pointer pointer;
128  typedef typename Container2D::reference reference;
129 
130  typedef iterator2d_box self;
131 
132  typedef typename Container2D::size_type size_type;
137 
143  cont2d_(0),pos_(0),x1_(0),x2_(0),box_(0,0,0,0)
144  {}
145 
152  iterator2d_box(Container2D* c,
153  const Box2d<int>& b):
154  cont2d_(c),pos_((*c)[(b.upper_left())[0]] + (b.upper_left())[1]),x1_((b.upper_left())[0]),x2_((b.upper_left())[1]),box_(b)
155  {}
156 
162  iterator2d_box(const self& o):
163  cont2d_(o.cont2d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),box_(o.box_)
164  {}
165 
180  self& operator=(const self& o)
181  {
182  if(this != &o)
183  {
184  this->cont2d_ = o.cont2d_;
185  this->pos_ = o.pos_;
186  this->x1_ = o.x1_;
187  this->x2_ = o.x2_;
188  this->box_ = o.box_;
189  }
190  return *this;
191  }
200  inline
202  {
203  return *pos_;
204  }
205 
206  inline
208  {
209  return &(operator*());
210  }
211 
216 
222  inline
223  self& operator++()
224  {
225  if( (x1_ != (box_.bottom_right())[0]) || (x2_ != (box_.bottom_right())[1]) )
226  {
227  if( (x2_ < (box_.bottom_right())[1]) || (x1_ == (box_.bottom_right())[0]))
228  {
229  this->x2_++;
230  this->pos_++;
231  }
232  else
233  {
234  this->x1_++;
235  this->x2_ = (box_.upper_left())[1];
236  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
237  }
238  }
239  else
240  {
241  this->x1_ = (box_.bottom_right())[0] + 1;
242  this->x2_ = (box_.bottom_right())[1] + 1;
243  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
244  }
245 
246  return *this;
247  }
248 
254  inline
255  self operator++(int)
256  {
257  self tmp = *this;
258  ++(*this);
259  return tmp;
260  }
261 
273  inline
274  self& operator--()
275  {
276  if( (x1_ != (box_.upper_left())[0]) || (x2_ != (box_.upper_left())[1]) )
277  {
278  if( (x2_ > (box_.upper_left())[1])|| (x1_ == (box_.upper_left())[0]))
279  {
280  this->x2_--;
281  this->pos_--;
282  }
283  else
284  {
285  this->x1_--;
286  this->x2_ = (box_.bottom_right())[1];
287  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
288  }
289  }
290  else
291  {
292  this->x1_ = (box_.upper_left())[0] - 1;
293  this->x2_ = (box_.upper_left())[1] - 1;
294  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
295  }
296 
297  return *this;
298  }
299 
305  inline
306  self operator--(int)
307  {
308  self tmp = *this;
309  --(*this);
310  return tmp;
311  }
312 
326  inline
327  friend bool operator==(const self& i1,
328  const self& i2)
329  {
330 
331  return ( (i1.cont2d_ == i2.cont2d_) && (i1.pos_ == i2.pos_)
332  && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) );
333  }
334 
341  inline
342  friend bool operator!=(const self& i1,
343  const self& i2)
344  {
345  return ( (i1.cont2d_ != i2.cont2d_) || (i1.pos_ != i2.pos_)
346  || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_) );
347  }
361  inline
362  friend bool operator<(const self& i1,
363  const self& i2)
364  {
365 
366  return ( i1.pos_ < i2.pos_);
367  }
368 
375  inline
376  friend bool operator>(const self& i1,
377  const self& i2)
378  {
379 
380  return (i2 < i1);
381  }
382 
389  inline
390  friend bool operator<=(const self& i1,
391  const self& i2)
392  {
393 
394  return !(i2 < i1);
395  }
396 
403  inline
404  friend bool operator>=(const self& i1,
405  const self& i2)
406  {
407 
408  return !(i1 < i2);
409  }
424  inline
425  self& operator+=(const difference_type& d)
426  {
427  this->x1_ += d.dx1();
428  this->x2_ += d.dx2();
429  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
430  return *this;
431  }
432 
433 
434 
442  inline
443  self& operator-=(const difference_type& d)
444  {
445  this->x1_ -= d.dx1();
446  this->x2_ -= d.dx2();
447  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
448  return *this;
449  }
450 
451 
452 
460  inline
461  self operator+(const difference_type& d)
462  {
463  self tmp = *this;
464  tmp += d;
465  return tmp;
466  }
467 
468 
469 
477  inline
478  self operator-(const difference_type& d)
479  {
480  self tmp = *this;
481  tmp -= d;
482  return tmp;
483  }
484 
485 
486 
487 
495  inline
496  friend difference_type operator-(const self& i1,
497  const self& i2)
498  {
499  return difference_type(int(i1.x1_ - i2.x1_),int(i1.x2_ - i2.x2_));
500  }
501 
502 
511  inline
513  {
514  assert( (int(this->x1_)+d.dx1()) < int(cont2d_->dim1()) );
515  assert( (int(this->x2_)+d.dx2()) < int(cont2d_->dim2()) );
516  return (*cont2d_)[this->x1_+d.dx1()][this->x2_+d.dx2()];
517  }
518 
519 
520 
527  inline
528  typename Container2D::row_iterator row_begin(size_type row)
529  {
530  return cont2d_->row_begin(this->box_.upper_left()[0] + row) + this->box_.upper_left()[1];
531  }
532 
533 
540  inline
541  typename Container2D::row_iterator row_end(size_type row)
542  {
543  return this->row_begin(row) + this->box_.width();
544  }
545 
546 
553  inline
554  typename Container2D::reverse_row_iterator row_rbegin(size_type row)
555  {
556  return typename Container2D::reverse_row_iterator(this->row_end(row));
557  }
558 
565  inline
566  typename Container2D::reverse_row_iterator row_rend(size_type row)
567  {
568  return typename Container2D::reverse_row_iterator(this->row_begin(row));
569  }
570 
571 
578  inline
579  typename Container2D::col_iterator col_begin(size_type col)
580  {
581  return cont2d_->col_begin(this->box_.upper_left()[1] + col) + this->box_.upper_left()[0];
582  }
583 
584 
585 
592  inline
593  typename Container2D::col_iterator col_end(size_type col)
594  {
595  return this->col_begin(col) + this->box_.height();
596  }
597 
598 
605  inline
606  typename Container2D::reverse_col_iterator col_rbegin(size_type col)
607  {
608  return typename Container2D::reverse_col_iterator(this->col_end(col));
609  }
610 
617  inline
618  typename Container2D::reverse_col_iterator col_rend(size_type col)
619  {
620  return typename Container2D::reverse_col_iterator(this->col_begin(col));
621  }
622 
623 
631  inline
632  typename Container2D::row_range_iterator row_begin(size_type row, const slip::Range<int>& range)
633  {
634  return slip::stride_iterator<typename Container2D::row_iterator>(cont2d_->row_begin(this->box_.upper_left()[0] + row) + this->box_.upper_left()[1] + range.start(),range.stride());
635  }
636 
637 
645  inline
646  typename Container2D::row_range_iterator row_end(size_type row, const slip::Range<int>& range)
647  {
648  return ++(this->row_begin(row,range)+ range.iterations());
649  }
650 
658  inline
659  typename Container2D::col_range_iterator col_begin(size_type col, const slip::Range<int>& range)
660  {
661  return slip::stride_iterator<typename Container2D::col_iterator>(cont2d_->col_begin(this->box_.upper_left()[1] + col) + this->box_.upper_left()[0] + range.start(),range.stride());
662  }
663 
664 
665 
673  inline
674  typename Container2D::col_range_iterator col_end(size_type col, const slip::Range<int>& range)
675  {
676  return ++(this->col_begin(col,range)+ range.iterations());
677  }
678 
690  inline
691  int x1() const
692  {
693  return this->x1_;
694  }
699  inline
700  int i() const
701  {
702  return this->x1_;
703  }
708  inline
709  int x2() const
710  {
711  return this->x2_;
712  }
717  inline
718  int j() const
719  {
720  return this->x2_;
721  }
722 
727 private:
728  Container2D* cont2d_; // pointer to the 2d container
729  pointer pos_; // linear position within the container
730  int x1_; // first index position
731  int x2_; // second index position
732  Box2d<int> box_; // box to iterate
733 };
734 
735 
765 template <class Container2D>
766 class const_iterator2d_box
767 {
768 public:
769  //typedef std::random_access_iterator_tag iterator_category;
771  typedef typename Container2D::value_type value_type;
773  typedef typename Container2D::const_pointer pointer;
774  typedef typename Container2D::const_reference reference;
775 
776  typedef const_iterator2d_box self;
777 
778  typedef typename Container2D::size_type size_type;
783 
789  cont2d_(0),pos_(0),x1_(0),x2_(0),box_(0,0,0,0)
790  {}
791 
798  const_iterator2d_box(Container2D* c,
799  const Box2d<int>& b):
800  cont2d_(c),pos_((*c)[(b.upper_left())[0]] + (b.upper_left())[1]),x1_((b.upper_left())[0]),x2_((b.upper_left())[1]),box_(b)
801  {}
802 
808  const_iterator2d_box(const self& o):
809  cont2d_(o.cont2d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),box_(o.box_)
810  {}
811 
826  self& operator=(const self& o)
827  {
828  if(this != &o)
829  {
830  this->cont2d_ = o.cont2d_;
831  this->pos_ = o.pos_;
832  this->x1_ = o.x1_;
833  this->x2_ = o.x2_;
834  this->box_ = o.box_;
835  }
836  return *this;
837  }
849  inline
851  {
852  return *pos_;
853  }
854 
855 
856  inline
858  {
859  return &(operator*());
860  }
861 
866 
872  inline
873  self& operator++()
874  {
875  if( (x1_ != (box_.bottom_right())[0]) || (x2_ != (box_.bottom_right())[1]) )
876  {
877  if( (x2_ < (box_.bottom_right())[1]) || (x1_ == (box_.bottom_right())[0]))
878  {
879  this->x2_++;
880  this->pos_++;
881  }
882  else
883  {
884  this->x1_++;
885  this->x2_ = (box_.upper_left())[1];
886  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
887  }
888  }
889  else
890  {
891  this->x1_ = (box_.bottom_right())[0] + 1;
892  this->x2_ = (box_.bottom_right())[1] + 1;
893  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
894  }
895  return *this;
896  }
897 
903  inline
904  self operator++(int)
905  {
906  self tmp = *this;
907  ++(*this);
908  return tmp;
909  }
910 
921  inline
922  self& operator--()
923  {
924  if( (x1_ != (box_.upper_left())[0]) || (x2_ != (box_.upper_left())[1]) )
925  {
926  if( (x2_ > (box_.upper_left())[1])|| (x1_ == (box_.upper_left())[0]))
927  {
928  this->x2_--;
929  this->pos_--;
930  }
931  else
932  {
933  this->x1_--;
934  this->x2_ = (box_.bottom_right())[1];
935  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
936  }
937  }
938  else
939  {
940  this->x1_ = (box_.upper_left())[0] - 1;
941  this->x2_ = (box_.upper_left())[1] - 1;
942  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
943  }
944 
945  return *this;
946  }
947 
953  inline
954  self operator--(int)
955  {
956  self tmp = *this;
957  --(*this);
958  return tmp;
959  }
960 
974  inline
975  friend bool operator==(const self& i1,
976  const self& i2)
977  {
978 
979  return ( (i1.cont2d_ == i2.cont2d_) && (i1.pos_ == i2.pos_)
980  && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) );
981  }
982 
989  inline
990  friend bool operator!=(const self& i1,
991  const self& i2)
992  {
993  return ( (i1.cont2d_ != i2.cont2d_) || (i1.pos_ != i2.pos_)
994  || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_) );
995  }
1008  inline
1009  friend bool operator<(const self& i1,
1010  const self& i2)
1011  {
1012 
1013  return ( i1.pos_ < i2.pos_);
1014  }
1015 
1022  inline
1023  friend bool operator>(const self& i1,
1024  const self& i2)
1025  {
1026 
1027  return (i2 < i1);
1028  }
1029 
1036  inline
1037  friend bool operator<=(const self& i1,
1038  const self& i2)
1039  {
1040 
1041  return !(i2 < i1);
1042  }
1043 
1050  inline
1051  friend bool operator>=(const self& i1,
1052  const self& i2)
1053  {
1054 
1055  return !(i1 < i2);
1056  }
1071  inline
1072  self& operator+=(const difference_type& d)
1073  {
1074  this->x1_ += d.dx1();
1075  this->x2_ += d.dx2();
1076  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
1077  return *this;
1078  }
1079 
1080 
1081 
1089  inline
1090  self& operator-=(const difference_type& d)
1091  {
1092  this->x1_ -= d.dx1();
1093  this->x2_ -= d.dx2();
1094  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
1095  return *this;
1096  }
1097 
1098 
1099 
1107  inline
1109  {
1110  self tmp = *this;
1111  tmp += d;
1112  return tmp;
1113  }
1114 
1115 
1116 
1124  inline
1126  {
1127  self tmp = *this;
1128  tmp -= d;
1129  return tmp;
1130  }
1131 
1132 
1133 
1134 
1142  inline
1143  friend difference_type operator-(const self& i1,
1144  const self& i2)
1145  {
1146  return difference_type(int(i1.x1_ - i2.x1_),int(i1.x2_ - i2.x2_));
1147  }
1148 
1149 
1150 
1159  inline
1161  {
1162  assert( int(this->x1_+d.dx1()) < int(cont2d_->dim1()) );
1163  assert( int(this->x2_+d.dx2()) < int(cont2d_->dim2()) );
1164  return (*cont2d_)[this->x1_+d.dx1()][this->x2_+d.dx2()];
1165  }
1166 
1167 
1168 
1169 
1170 
1178  inline
1179  typename Container2D::const_row_iterator row_begin(size_type row) const
1180  {
1181  return cont2d_->row_begin(this->box_.upper_left()[0] + row) + this->box_.upper_left()[1];
1182  }
1183 
1184 
1192  inline
1193  typename Container2D::const_row_iterator row_end(size_type row) const
1194  {
1195  return this->row_begin(row) + this->box_.width();
1196  }
1197 
1198 
1205  inline
1206  typename Container2D::const_reverse_row_iterator row_rbegin(size_type row) const
1207  {
1208  return typename Container2D::const_reverse_row_iterator(this->row_end(row));
1209  }
1210 
1211 
1212 
1219  inline
1220  typename Container2D::const_reverse_row_iterator row_rend(size_type row) const
1221  {
1222  return typename Container2D::const_reverse_row_iterator(this->row_begin(row));
1223  }
1224 
1232  inline
1233  typename Container2D::const_col_iterator col_begin(size_type col) const
1234  {
1235  return cont2d_->col_begin(this->box_.upper_left()[1] + col) + this->box_.upper_left()[0];
1236  }
1237 
1238 
1246  inline
1247  typename Container2D::const_col_iterator col_end(size_type col) const
1248  {
1249  return this->col_begin(col) + this->box_.height();
1250  }
1251 
1258  inline
1259  typename Container2D::const_reverse_col_iterator col_rbegin(size_type col) const
1260  {
1261  return typename Container2D::const_reverse_col_iterator(this->col_end(col));
1262  }
1263 
1270  inline
1271  typename Container2D::const_reverse_col_iterator col_rend(size_type col) const
1272  {
1273  return typename Container2D::const_reverse_col_iterator(this->col_begin(col));
1274  }
1275 
1276 
1288  inline
1289  int x1() const
1290  {
1291  return this->x1_;
1292  }
1297  inline
1298  int i() const
1299  {
1300  return this->x1_;
1301  }
1306  inline
1307  int x2() const
1308  {
1309  return this->x2_;
1310  }
1315  inline
1316  int j() const
1317  {
1318  return this->x2_;
1319  }
1320 
1325 private:
1326  Container2D* cont2d_; // pointer to the 2d container
1327  pointer pos_; // linear position within the container
1328  int x1_; // first index position
1329  int x2_; // second index position
1330  Box2d<int> box_; // box to iterate
1331 };
1332 
1333 
1334 
1335 }//slip::
1336 
1337 #endif //SLIP_ITERATOR2D_BOX_HPP
Container2D::reference reference
std::size_t iterations() const
Rerturns the number of iterations of the range.
Definition: Range.hpp:305
Container2D::pointer pointer
self & operator+=(const difference_type &d)
const_iterator2d_box addition.
Container2D::const_reference reference
Provides a class to modelize the difference of slip::Point2d.
DPoint2d< int > difference_type
CoordType height() const
compute the height of the Box2d.
Definition: Box2d.hpp:378
friend bool operator==(const self &i1, const self &i2)
Equality operator.
const_iterator2d_box()
Constructs a const_iterator2d_box.
reference operator[](difference_type d)
iterator2d_box element assignment operator. Equivalent to *(i + d) = t.
void dx2(const CoordType &dx)
Accessor of the second coordinate of DPoint2d.
Definition: DPoint2d.hpp:241
Container2D::size_type size_type
Container2D::size_type size_type
Container2D::reverse_col_iterator col_rend(size_type col)
iterator2d_box element assignment operator.
iterator2d_box(const self &o)
Constructs a copy of the iterator2d_box o.
friend bool operator>=(const self &i1, const self &i2)
>= operator.
self & operator--()
Predecrement a const_iterator2d_box. Iterate to the previous location inside the Box2d.
int x1() const
Access to the first index of the current iterator2d_box.
Container2D::col_iterator col_begin(size_type col)
iterator2d_box element assignment operator.
Provides a class to manipulate 2d box.
self operator--(int)
Postdecrement a const_iterator2d_box. Iterate to the previous location inside the Box2d...
self operator++(int)
Postincrement a const_iterator2d_box. Iterate to the next location inside the Box2d.
self & operator++()
Preincrement a const_iterator2d_box. Iterate to the next location inside the Box2d.
Provides a class to tag SLIP iterators.
Container2D::const_reverse_row_iterator row_rend(size_type row) const
iterator2d_box element assignment operator.
std::random_access_iterator2d_tag iterator_category
Container2D::const_reverse_col_iterator col_rend(size_type col) const
iterator2d_box element assignment operator.
reference operator*() const
Dereference operator. Returns the element that the current const_iterator2d_box i point to...
CoordType width() const
compute the width of the Box2d.
Definition: Box2d.hpp:374
self & operator-=(const difference_type &d)
const_iterator2d_box substraction.
friend bool operator<=(const self &i1, const self &i2)
<= operator.
self & operator++()
Preincrement a iterator2d_box. Iterate to the next location inside the Box2d.
void bottom_right(Point< CoordType, 2 >)
Accessor/Mutator of the bottom_right point (p2) of Box2d.
Definition: Box2d.hpp:338
self operator+(const difference_type &d)
const_iterator2d_box addition.
Container2D::row_range_iterator row_begin(size_type row, const slip::Range< int > &range)
iterator2d_box element assignment operator.
self & operator--()
Predecrement a iterator2d_box. Iterate to the previous location inside the Box2d. ...
self operator+(const difference_type &d)
iterator2d_box addition.
Container2D::const_reverse_col_iterator col_rbegin(size_type col) const
iterator2d_box element assignment operator.
Container2D::const_col_iterator col_end(size_type col) const
const_iterator2d_box element assignment operator.
const_iterator2d_box(Container2D *c, const Box2d< int > &b)
Constructs a const_iterator2d_box.
self & operator-=(const difference_type &d)
iterator2d_box substraction.
iterator2d_box()
Constructs a iterator2d_box.
Container2D::row_iterator row_begin(size_type row)
iterator2d_box element assignment operator.
void dx1(const CoordType &dx)
Accessor of the first coordinate of DPoint2d.
Definition: DPoint2d.hpp:229
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
const_iterator2d_box(const self &o)
Constructs a copy of the const_iterator2d_box o.
friend bool operator==(const self &i1, const self &i2)
Equality operator.
This is some iterator to iterate a 2d container into a Box area defined by the indices of the 2d cont...
Definition: Array2d.hpp:122
Container2D::reverse_row_iterator row_rbegin(size_type row)
iterator2d_box element assignment operator.
self operator-(const difference_type &d)
const_iterator2d_box substraction.
Container2D::row_range_iterator row_end(size_type row, const slip::Range< int > &range)
iterator2d_box element assignment operator.
int x2() const
Access to the second index of the current iterator2d_box.
self & operator=(const self &o)
Assign a iterator2d_box.
friend bool operator<(const self &i1, const self &i2)
< operator.
Difference of Point2D class, specialization of DPoint<CoordType,DIM> with DIM = 2.
Definition: Array2d.hpp:129
Container2D::const_row_iterator row_begin(size_type row) const
const_iterator2d_box element assignment operator.
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
SubType start() const
Accessor of the start subscript of the Range.
Definition: Range.hpp:284
Container2D::const_pointer pointer
self & operator+=(const difference_type &d)
iterator2d_box addition.
Container2D::const_row_iterator row_end(size_type row) const
const_iterator2d_box element assignment operator.
self operator--(int)
Postdecrement a iterator2d_box. Iterate to the previous location inside the Box2d.
Container2D::reverse_row_iterator row_rend(size_type row)
iterator2d_box element assignment operator.
int i() const
Access to the first index of the current iterator2d_box.
Container2D::value_type value_type
self operator-(const difference_type &d)
iterator2d_box substraction.
friend difference_type operator-(const self &i1, const self &i2)
iterator2d_box difference operator.
This is some iterator to iterate a 2d container into a slip::Box2d area defined by the indices of the...
Definition: Array2d.hpp:116
friend bool operator>=(const self &i1, const self &i2)
>= operator.
friend bool operator>(const self &i1, const self &i2)
operator.
Container2D::row_iterator row_end(size_type row)
iterator2d_box element assignment operator.
void upper_left(Point< CoordType, 2 >)
Accessor/Mutator of the upper_left point (p1) of Box2d.
Definition: Box2d.hpp:325
int x2() const
Access to the second index of the current const_iterator2d_box.
int i() const
Access to the first index of the current const_iterator2d_box.
int j() const
Access to the second index of the current iterator2d_box.
iterator2d_box(Container2D *c, const Box2d< int > &b)
Constructs a iterator2d_box.
Container2D::const_col_iterator col_begin(size_type col) const
const_iterator2d_box element assignment operator.
friend bool operator>(const self &i1, const self &i2)
operator.
reference operator[](difference_type d) const
const_iterator2d_box element assignment operator. Equivalent to *(i + d).
int stride() const
Accessor of the stride of the Range.
Definition: Range.hpp:298
Container2D::const_reverse_row_iterator row_rbegin(size_type row) const
iterator2d_box element assignment operator.
Container2D::col_range_iterator col_begin(size_type col, const slip::Range< int > &range)
iterator2d_box element assignment operator.
Provides a class to modelize 2d points.
int j() const
Access to the second index of the current const_iterator2d_box.
self operator++(int)
Postincrement a iterator2d_box. Iterate to the next location inside the Box2d.
std::random_access_iterator2d_tag iterator_category
friend bool operator<=(const self &i1, const self &i2)
<= operator.
friend bool operator<(const self &i1, const self &i2)
< operator.
Container2D::reverse_col_iterator col_rbegin(size_type col)
iterator2d_box element assignment operator.
self & operator=(const self &o)
Assign a const_iterator2d_box.
Container2D::value_type value_type
friend difference_type operator-(const self &i1, const self &i2)
const_iterator2d_box difference operator.
Container2D::col_range_iterator col_end(size_type col, const slip::Range< int > &range)
iterator2d_box element assignment operator.
Provides a class to manipulate Ranges.
Container2D::col_iterator col_end(size_type col)
iterator2d_box element assignment operator.
int x1() const
Access to the first index of the current const_iterator2d_box.
reference operator*()
Dereference assignment operator. Returns the element that the current iterator2d_box i point to...