SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
component_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 
68 
75 #ifndef SLIP_COMPONENT_ITERATOR2D_BOX_HPP
76 #define SLIP_COMPONENT_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 "iterator_types.hpp"
85 
86 namespace slip
87 {
108  template <class MultiComponentContainer2D, std::size_t N>
110  {
111 
112  public:
113 
114  //typedef std::random_access_iterator_tag iterator_category;
116  typedef typename MultiComponentContainer2D::value_type Block;
117  typedef typename Block::value_type value_type;
119  typedef value_type* pointer;
121 
123 
124  typedef typename MultiComponentContainer2D::size_type size_type;
129 
135  cont2d_(0),pos_(0),x1_(0),x2_(0),cp_(0),box_(0,0,0,0)
136  {}
137 
145  component_iterator2d_box(MultiComponentContainer2D* c, std::size_t cp,
146  const Box2d<int>& b):
147  cont2d_(c),pos_(&(*c)[0][0][cp] + ((b.upper_left())[0] * int(c->cols()) * N) + ((b.upper_left())[1] * N)),x1_((b.upper_left())[0]),x2_((b.upper_left())[1]),cp_(cp),box_(b)
148  {}
149 
155  component_iterator2d_box(const self& o):
156  cont2d_(o.cont2d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),cp_(o.cp_),box_(o.box_)
157  {}
158 
173  self& operator=(const self& o)
174  {
175  if(this != &o)
176  {
177  this->cont2d_ = o.cont2d_;
178  this->pos_ = o.pos_;
179  this->x1_ = o.x1_;
180  this->x2_ = o.x2_;
181  this->cp_ = o.cp_;
182  this->box_ = o.box_;
183  }
184  return *this;
185  }
194  inline
196  {
197  return *pos_;
198  }
199 
200  inline
202  {
203  return &(operator*());
204  }
205 
210 
216  inline
217  self& operator++()
218  {
219  if( (x1_ != (box_.bottom_right())[0]) || (x2_ != (box_.bottom_right())[1]) )
220  {
221  if( (x2_ < (box_.bottom_right())[1]) || (x1_ == (box_.bottom_right())[0]))
222  {
223  this->x2_++;
224  this->pos_+=N;
225  }
226  else
227  {
228  this->x1_++;
229  this->x2_ = (box_.upper_left())[1];
230  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
231  }
232  }
233  else
234  {
235  this->x1_ = (box_.bottom_right())[0] + 1;
236  this->x2_ = (box_.bottom_right())[1] + 1;
237  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
238  }
239 
240  return *this;
241  }
242 
247  inline
248  self operator++(int)
249  {
250  self tmp = *this;
251  ++(*this);
252  return tmp;
253  }
254 
266  inline
267  self& operator--()
268  {
269  if( (x1_ != (box_.upper_left())[0]) || (x2_ != (box_.upper_left())[1]) )
270  {
271  if( (x2_ > (box_.upper_left())[1])|| (x1_ == (box_.upper_left())[0]))
272  {
273  this->x2_--;
274  this->pos_-=N;
275  }
276  else
277  {
278  this->x1_--;
279  this->x2_ = (box_.bottom_right())[1];
280  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
281  }
282  }
283  else
284  {
285  this->x1_ = (box_.upper_left())[0] - 1;
286  this->x2_ = (box_.upper_left())[1] - 1;
287  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
288  }
289 
290  return *this;
291  }
292 
298  inline
299  self operator--(int)
300  {
301  self tmp = *this;
302  --(*this);
303  return tmp;
304  }
305 
319  inline
320  friend bool operator==(const self& i1,
321  const self& i2)
322  {
323 
324  return ( (i1.cont2d_ == i2.cont2d_) && (i1.pos_ == i2.pos_)
325  && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_)
326  && (i1.cp_ == i2.cp_));
327  }
328 
335  inline
336  friend bool operator!=(const self& i1,
337  const self& i2)
338  {
339  return ( (i1.cont2d_ != i2.cont2d_) || (i1.pos_ != i2.pos_)
340  || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_)
341  || (i1.cp_ != i2.cp_));
342  }
343 
357  inline
358  friend bool operator<(const self& i1,
359  const self& i2)
360  {
361 
362  return ( i1.pos_ < i2.pos_);
363  }
364 
371  inline
372  friend bool operator>(const self& i1,
373  const self& i2)
374  {
375  return (i2 < i1);
376  }
377 
384  inline
385  friend bool operator<=(const self& i1,
386  const self& i2)
387  {
388 
389  return !(i2 < i1);
390  }
391 
398  inline
399  friend bool operator>=(const self& i1,
400  const self& i2)
401  {
402 
403  return !(i1 < i2);
404  }
419  inline
420  self& operator+=(const difference_type& d)
421  {
422  this->x1_ += d.dx1();
423  this->x2_ += d.dx2();
424  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
425  return *this;
426  }
427 
428 
429 
437  inline
438  self& operator-=(const difference_type& d)
439  {
440  this->x1_ -= d.dx1();
441  this->x2_ -= d.dx2();
442  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
443  return *this;
444  }
445 
453  inline
454  self operator+(const difference_type& d)
455  {
456  self tmp = *this;
457  tmp += d;
458  return tmp;
459  }
460 
468  inline
469  self operator-(const difference_type& d)
470  {
471  self tmp = *this;
472  tmp -= d;
473  return tmp;
474  }
475 
476 
484  inline
485  friend difference_type operator-(const self& i1,
486  const self& i2)
487  {
488  return difference_type(int(i1.x1_ - i2.x1_),int(i1.x2_ - i2.x2_));
489  }
490 
491 
500  inline
502  {
503  assert( (this->x1_+d.dx1()) < cont2d_->dim1() );
504  assert( (this->x2_+d.dx2()) < cont2d_->dim2() );
505  return (*cont2d_)[this->x1_+d.dx1()][this->x2_+d.dx2()][cp_];
506  }
507 
508 
515  inline
516  typename MultiComponentContainer2D::component_row_iterator row_begin(size_type row)
517  {
518  return cont2d_->row_begin(this->cp_,this->box_.upper_left()[0] + row)+ this->box_.upper_left()[1];
519  }
520 
521 
528  inline
529  typename MultiComponentContainer2D::component_row_iterator row_end(size_type row)
530  {
531  return this->row_begin(row) + this->box_.width();
532  }
533 
534 
541  inline
542  typename MultiComponentContainer2D::component_col_iterator col_begin(size_type col)
543  {
544  return cont2d_->col_begin(this->cp_,this->box_.upper_left()[1] + col) + this->box_.upper_left()[0];
545  }
546 
547 
554  inline
555  typename MultiComponentContainer2D::component_col_iterator col_end(size_type col)
556  {
557  return this->col_begin(col) + this->box_.height();
558  }
559 
560 
567  inline
568  typename MultiComponentContainer2D::reverse_component_row_iterator row_rbegin(size_type row)
569  {
570  return typename MultiComponentContainer2D::reverse_component_row_iterator( typename MultiComponentContainer2D::component_row_iterator(cont2d_->row_begin(this->cp_,this->box_.upper_left()[0] + row)+ this->box_.upper_left()[1])+ this->box_.width());
571  }
572 
573 
580  inline
581  typename MultiComponentContainer2D::reverse_component_row_iterator row_rend(size_type row)
582  {
583  return typename MultiComponentContainer2D::reverse_component_row_iterator(cont2d_->row_begin(this->cp_,this->box_.upper_left()[0] + row)+ this->box_.upper_left()[1]);
584  }
585 
592  inline
593  typename MultiComponentContainer2D::reverse_component_col_iterator col_rbegin(size_type col)
594  {
595  return typename MultiComponentContainer2D::reverse_component_col_iterator( typename MultiComponentContainer2D::component_col_iterator(cont2d_->col_begin(this->cp_,this->box_.upper_left()[1] + col) + this->box_.upper_left()[0]) + this->box_.height());
596  }
597 
604  inline
605  typename MultiComponentContainer2D::reverse_component_col_iterator col_rend(size_type col)
606  {
607  return typename MultiComponentContainer2D::reverse_component_col_iterator( typename MultiComponentContainer2D::component_col_iterator(cont2d_->col_begin(this->cp_,this->box_.upper_left()[1] + col) + this->box_.upper_left()[0]));
608  }
609 
621  inline
622  int x1() const
623  {
624  return this->x1_;
625  }
630  inline
631  int i() const
632  {
633  return this->x1_;
634  }
639  inline
640  int x2() const
641  {
642  return this->x2_;
643  }
648  inline
649  int j() const
650  {
651  return this->x2_;
652  }
653 
658  inline
659  size_type cp() const
660  {
661  return this->cp_;
662  }
663 
664 
668  private:
669  MultiComponentContainer2D* cont2d_; // pointer to the 2d container
670  pointer pos_; // linear position within the container
671  int x1_; // first index position
672  int x2_; // second index position
673  size_type cp_; // component index number
674  Box2d<int> box_; // box to iterate
675  };
676 
677 
697  template <class MultiComponentContainer2D, std::size_t N>
699  {
700 
701  public:
702 
703  //typedef std::random_access_iterator_tag iterator_category;
705  typedef typename MultiComponentContainer2D::value_type Block;
706  typedef typename Block::value_type value_type;
708  typedef value_type const * pointer;
709  typedef value_type const & reference;
710 
712 
713  typedef typename MultiComponentContainer2D::size_type size_type;
718 
724  cont2d_(0),pos_(0),x1_(0),x2_(0),cp_(0),box_(0,0,0,0)
725  {}
726 
734  const_component_iterator2d_box(MultiComponentContainer2D* c, std::size_t cp,
735  const Box2d<int>& b):
736  cont2d_(c),pos_(&(*c)[0][0][cp] + ((b.upper_left())[0] * int(c->cols()) * N) + ((b.upper_left())[1] * N)),x1_((b.upper_left())[0]),x2_((b.upper_left())[1]),cp_(cp),box_(b)
737  {}
738 
745  cont2d_(o.cont2d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),cp_(o.cp_),box_(o.box_)
746  {}
747 
762  self& operator=(const self& o)
763  {
764  if(this != &o)
765  {
766  this->cont2d_ = o.cont2d_;
767  this->pos_ = o.pos_;
768  this->x1_ = o.x1_;
769  this->x2_ = o.x2_;
770  this->cp_ = o.cp_;
771  this->box_ = o.box_;
772  }
773  return *this;
774  }
783  inline
785  {
786  return *pos_;
787  }
788 
789  inline
791  {
792  return &(operator*());
793  }
794 
799 
805  inline
806  self& operator++()
807  {
808  if( (x1_ != (box_.bottom_right())[0]) || (x2_ != (box_.bottom_right())[1]) )
809  {
810  if( (x2_ < (box_.bottom_right())[1]) || (x1_ == (box_.bottom_right())[0]))
811  {
812  this->x2_++;
813  this->pos_+=N;
814  }
815  else
816  {
817  this->x1_++;
818  this->x2_ = (box_.upper_left())[1];
819  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
820  }
821  }
822  else
823  {
824  this->x1_ = (box_.bottom_right())[0] + 1;
825  this->x2_ = (box_.bottom_right())[1] + 1;
826  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
827  }
828 
829  return *this;
830  }
831 
836  inline
837  self operator++(int)
838  {
839  self tmp = *this;
840  ++(*this);
841  return tmp;
842  }
843 
855  inline
856  self& operator--()
857  {
858  if( (x1_ != (box_.upper_left())[0]) || (x2_ != (box_.upper_left())[1]) )
859  {
860  if( (x2_ > (box_.upper_left())[1])|| (x1_ == (box_.upper_left())[0]))
861  {
862  this->x2_--;
863  this->pos_-=N;
864  }
865  else
866  {
867  this->x1_--;
868  this->x2_ = (box_.bottom_right())[1];
869  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
870  }
871  }
872  else
873  {
874  this->x1_ = (box_.upper_left())[0] - 1;
875  this->x2_ = (box_.upper_left())[1] - 1;
876  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
877  }
878 
879  return *this;
880  }
881 
887  inline
888  self operator--(int)
889  {
890  self tmp = *this;
891  --(*this);
892  return tmp;
893  }
894 
908  inline
909  friend bool operator==(const self& i1,
910  const self& i2)
911  {
912 
913  return ( (i1.cont2d_ == i2.cont2d_) && (i1.pos_ == i2.pos_)
914  && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_)
915  && (i1.cp_ == i2.cp_));
916  }
917 
924  inline
925  friend bool operator!=(const self& i1,
926  const self& i2)
927  {
928  return ( (i1.cont2d_ != i2.cont2d_) || (i1.pos_ != i2.pos_)
929  || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_)
930  || (i1.cp_ != i2.cp_));
931  }
932 
946  inline
947  friend bool operator<(const self& i1,
948  const self& i2)
949  {
950 
951  return ( i1.pos_ < i2.pos_);
952  }
953 
960  inline
961  friend bool operator>(const self& i1,
962  const self& i2)
963  {
964  return (i2 < i1);
965  }
966 
973  inline
974  friend bool operator<=(const self& i1,
975  const self& i2)
976  {
977 
978  return !(i2 < i1);
979  }
980 
987  inline
988  friend bool operator>=(const self& i1,
989  const self& i2)
990  {
991 
992  return !(i1 < i2);
993  }
1008  inline
1009  self& operator+=(const difference_type& d)
1010  {
1011  this->x1_ += d.dx1();
1012  this->x2_ += d.dx2();
1013  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
1014  return *this;
1015  }
1016 
1017 
1018 
1026  inline
1027  self& operator-=(const difference_type& d)
1028  {
1029  this->x1_ -= d.dx1();
1030  this->x2_ -= d.dx2();
1031  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
1032  return *this;
1033  }
1034 
1042  inline
1044  {
1045  self tmp = *this;
1046  tmp += d;
1047  return tmp;
1048  }
1049 
1057  inline
1059  {
1060  self tmp = *this;
1061  tmp -= d;
1062  return tmp;
1063  }
1064 
1065 
1073  inline
1074  friend difference_type operator-(const self& i1,
1075  const self& i2)
1076  {
1077  return difference_type(int(i1.x1_ - i2.x1_),int(i1.x2_ - i2.x2_));
1078  }
1079 
1080 
1089  inline
1091  {
1092  assert( (this->x1_+d.dx1()) < cont2d_->dim1() );
1093  assert( (this->x2_+d.dx2()) < cont2d_->dim2() );
1094  return (*cont2d_)[this->x1_+d.dx1()][this->x2_+d.dx2()][cp_];
1095  }
1096 
1097 
1104  inline
1105  typename MultiComponentContainer2D::const_component_row_iterator row_begin(size_type row) const
1106  {
1107  return cont2d_->row_begin(this->cp_,this->box_.upper_left()[0] + row)+ this->box_.upper_left()[1];
1108  }
1109 
1110 
1117  inline
1118  typename MultiComponentContainer2D::const_component_row_iterator row_end(size_type row) const
1119  {
1120  return this->row_begin(row) + this->box_.width();
1121  }
1122 
1123 
1130  inline
1131  typename MultiComponentContainer2D::const_component_col_iterator col_begin(size_type col) const
1132  {
1133  return cont2d_->col_begin(this->cp_,this->box_.upper_left()[1] + col) + this->box_.upper_left()[0];
1134  }
1135 
1136 
1143  inline
1144  typename MultiComponentContainer2D::const_component_col_iterator col_end(size_type col) const
1145  {
1146  return this->col_begin(col) + this->box_.height();
1147  }
1148 
1155  inline
1156  typename MultiComponentContainer2D::const_reverse_component_row_iterator row_rbegin(size_type row) const
1157  {
1158  return typename MultiComponentContainer2D::const_reverse_component_row_iterator( typename MultiComponentContainer2D::const_component_row_iterator(cont2d_->row_begin(this->cp_,this->box_.upper_left()[0] + row)+ this->box_.upper_left()[1])+ this->box_.width());
1159  }
1160 
1161 
1168  inline
1169  typename MultiComponentContainer2D::const_reverse_component_row_iterator row_rend(size_type row) const
1170  {
1171  return typename MultiComponentContainer2D::const_reverse_component_row_iterator(cont2d_->row_begin(this->cp_,this->box_.upper_left()[0] + row)+ this->box_.upper_left()[1]);
1172  }
1173 
1180  inline
1181  typename MultiComponentContainer2D::const_reverse_component_col_iterator col_rbegin(size_type col) const
1182  {
1183  return typename MultiComponentContainer2D::reverse_component_col_iterator( typename MultiComponentContainer2D::const_component_col_iterator(cont2d_->col_begin(this->cp_,this->box_.upper_left()[1] + col) + this->box_.upper_left()[0]) + this->box_.height());
1184  }
1185 
1192  inline
1193  typename MultiComponentContainer2D::const_reverse_component_col_iterator col_rend(size_type col) const
1194  {
1195  return typename MultiComponentContainer2D::reverse_component_col_iterator( typename MultiComponentContainer2D::const_component_col_iterator(cont2d_->col_begin(this->cp_,this->box_.upper_left()[1] + col) + this->box_.upper_left()[0]));
1196  }
1197 
1209  inline
1210  int x1() const
1211  {
1212  return this->x1_;
1213  }
1218  inline
1219  int i() const
1220  {
1221  return this->x1_;
1222  }
1227  inline
1228  int x2() const
1229  {
1230  return this->x2_;
1231  }
1236  inline
1237  int j() const
1238  {
1239  return this->x2_;
1240  }
1241 
1246  inline
1247  size_type cp() const
1248  {
1249  return this->cp_;
1250  }
1251 
1252 
1256  private:
1257  MultiComponentContainer2D* cont2d_; // pointer to the 2d container
1258  pointer pos_; // linear position within the container
1259  int x1_; // first index position
1260  int x2_; // second index position
1261  size_type cp_; // component index number
1262  Box2d<int> box_; // box to iterate
1263  };
1264 
1265 }//slip::
1266 
1267 #endif //SLIP_COMPONENT_ITERATOR_HPP
friend bool operator>=(const self &i1, const self &i2)
>= operator.
self operator-(const difference_type &d)
const_component_iterator2d_box substraction.
MultiComponentContainer2D::const_component_row_iterator row_end(size_type row) const
const_component_iterator2d_box element assignment operator.
MultiComponentContainer2D::const_component_row_iterator row_begin(size_type row) const
const_component_iterator2d_box element assignment operator.
MultiComponentContainer2D::reverse_component_col_iterator col_rend(size_type col)
component_iterator2d_box col reverse iterator.
Provides a class to modelize the difference of slip::Point2d.
CoordType height() const
compute the height of the Box2d.
Definition: Box2d.hpp:378
const_component_iterator2d_box(const self &o)
Constructs a copy of the const_component_iterator2d_box o.
friend bool operator<=(const self &i1, const self &i2)
<= operator.
self & operator--()
Predecrement a component_iterator2d_box. Iterate to the previous location inside the Box2d...
void dx2(const CoordType &dx)
Accessor of the second coordinate of DPoint2d.
Definition: DPoint2d.hpp:241
self & operator++()
Preincrement a component_iterator2d_box. Iterate to the next location inside the Box2d.
self & operator=(const self &o)
Assign a component_iterator2d_box.
Provides a class to manipulate 2d box.
const_component_iterator2d_box(MultiComponentContainer2D *c, std::size_t cp, const Box2d< int > &b)
Constructs a const_component_iterator2d_box.
int x2() const
Access to the second index of the current component_iterator2d_box.
component_iterator2d_box(MultiComponentContainer2D *c, std::size_t cp, const Box2d< int > &b)
Constructs a component_iterator2d_box.
int j() const
Access to the second index of the current component_iterator2d_box.
Provides a class to tag SLIP iterators.
self operator-(const difference_type &d)
component_iterator2d_box substraction.
int x1() const
Access to the first index of the current const_component_iterator2d_box.
MultiComponentContainer2D::const_component_col_iterator col_begin(size_type col) const
const_component_iterator2d_box element assignment operator.
self operator--(int)
Postdecrement a component_iterator2d_box. Iterate to the previous location inside the Box2d...
CoordType width() const
compute the width of the Box2d.
Definition: Box2d.hpp:374
self & operator-=(const difference_type &d)
component_iterator2d_box substraction.
MultiComponentContainer2D::component_row_iterator row_end(size_type row)
component_iterator2d_box element assignment operator.
int i() const
Access to the first index of the current component_iterator2d_box.
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
MultiComponentContainer2D::reverse_component_col_iterator col_rbegin(size_type col)
component_iterator2d_box col reverse iterator.
self operator--(int)
Postdecrement a const_component_iterator2d_box. Iterate to the previous location inside the Box2d...
void bottom_right(Point< CoordType, 2 >)
Accessor/Mutator of the bottom_right point (p2) of Box2d.
Definition: Box2d.hpp:338
friend bool operator<(const self &i1, const self &i2)
< operator.
MultiComponentContainer2D::const_reverse_component_row_iterator row_rbegin(size_type row) const
component_iterator2d_box row reverse iterator.
std::random_access_iterator2d_tag iterator_category
self & operator-=(const difference_type &d)
const_component_iterator2d_box substraction.
friend bool operator>=(const self &i1, const self &i2)
>= operator.
reference operator[](difference_type d)
component_iterator2d_box element assignment operator. Equivalent to *(i + d) = t. ...
void dx1(const CoordType &dx)
Accessor of the first coordinate of DPoint2d.
Definition: DPoint2d.hpp:229
MultiComponentContainer2D::size_type size_type
self & operator--()
Predecrement a const_component_iterator2d_box. Iterate to the previous location inside the Box2d...
This is some iterator to iterate a 2d MultiComponentContainer into a Box area defined by the indices ...
self & operator++()
Preincrement a const_component_iterator2d_box. Iterate to the next location inside the Box2d...
MultiComponentContainer2D::const_component_col_iterator col_end(size_type col) const
const_component_iterator2d_box element assignment operator.
int i() const
Access to the first index of the current const_component_iterator2d_box.
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
self & operator+=(const difference_type &d)
component_iterator2d_box addition.
self operator+(const difference_type &d)
const_component_iterator2d_box addition.
size_type cp() const
Access to the component index of the current component_iterator2d_box.
Difference of Point2D class, specialization of DPoint<CoordType,DIM> with DIM = 2.
Definition: Array2d.hpp:129
MultiComponentContainer2D::value_type Block
const_component_iterator2d_box()
Constructs a const_component_iterator2d_box.
MultiComponentContainer2D::component_row_iterator row_begin(size_type row)
component_iterator2d_box element assignment operator.
MultiComponentContainer2D::reverse_component_row_iterator row_rbegin(size_type row)
component_iterator2d_box row reverse iterator.
MultiComponentContainer2D::component_col_iterator col_end(size_type col)
component_iterator2d_box element assignment operator.
component_iterator2d_box(const self &o)
Constructs a copy of the component_iterator2d_box o.
size_type cp() const
Access to the component index of the current const_component_iterator2d_box.
self operator+(const difference_type &d)
component_iterator2d_box addition.
std::random_access_iterator2d_tag iterator_category
MultiComponentContainer2D::component_col_iterator col_begin(size_type col)
component_iterator2d_box element assignment operator.
MultiComponentContainer2D::value_type Block
friend difference_type operator-(const self &i1, const self &i2)
component_iterator2d_box difference operator.
reference operator[](difference_type d) const
const_component_iterator2d_box element assignment operator. Equivalent to *(i + d) = t...
This is some iterator to iterate a 2d MultiComponentContainer into a Box area defined by the indices ...
friend difference_type operator-(const self &i1, const self &i2)
const_component_iterator2d_box difference operator.
void upper_left(Point< CoordType, 2 >)
Accessor/Mutator of the upper_left point (p1) of Box2d.
Definition: Box2d.hpp:325
self operator++(int)
Postincrement a component_iterator2d_box. Iterate to the next location inside the Box2d...
component_iterator2d_box()
Constructs a component_iterator2d_box.
MultiComponentContainer2D::const_reverse_component_col_iterator col_rbegin(size_type col) const
component_iterator2d_box col reverse iterator.
friend bool operator==(const self &i1, const self &i2)
Equality operator.
int x2() const
Access to the second index of the current const_component_iterator2d_box.
friend bool operator<(const self &i1, const self &i2)
< operator.
friend bool operator>(const self &i1, const self &i2)
operator.
MultiComponentContainer2D::const_reverse_component_row_iterator row_rend(size_type row) const
component_iterator2d_box row reverse iterator.
Provides a class to modelize 2d points.
reference operator*() const
Dereference assignment operator. Returns the element that the current const_component_iterator2d_box ...
self & operator=(const self &o)
Assign a const_component_iterator2d_box.
MultiComponentContainer2D::size_type size_type
friend bool operator>(const self &i1, const self &i2)
operator.
self operator++(int)
Postincrement a const_component_iterator2d_box. Iterate to the next location inside the Box2d...
int x1() const
Access to the first index of the current component_iterator2d_box.
friend bool operator==(const self &i1, const self &i2)
Equality operator.
MultiComponentContainer2D::const_reverse_component_col_iterator col_rend(size_type col) const
component_iterator2d_box col reverse iterator.
reference operator*()
Dereference assignment operator. Returns the element that the current component_iterator2d_box i poin...
self & operator+=(const difference_type &d)
const_component_iterator2d_box addition.
friend bool operator<=(const self &i1, const self &i2)
<= operator.
int j() const
Access to the second index of the current const_component_iterator2d_box.
MultiComponentContainer2D::reverse_component_row_iterator row_rend(size_type row)
component_iterator2d_box row reverse iterator.