SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
component_iterator3d_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 
76 #ifndef SLIP_COMPONENT_ITERATOR3D_BOX_HPP
77 #define SLIP_COMPONENT_ITERATOR3D_BOX_HPP
78 
79 #include <iterator>
80 #include <cassert>
81 
82 #include "Point3d.hpp"
83 #include "DPoint3d.hpp"
84 #include "Box3d.hpp"
85 #include "iterator_types.hpp"
86 
87 namespace slip
88 {
108 template <class MultiComponentContainer3D, std::size_t N>
110 {
111 
112 public:
113 
115  typedef typename MultiComponentContainer3D::value_type Block;
116  typedef typename Block::value_type value_type;
118  typedef value_type* pointer;
120 
122 
123  typedef typename MultiComponentContainer3D::size_type size_type;
128 
134  cont3d_(0),pos_(0),x1_(0),x2_(0),x3_(0),cp_(0),box_(0,0,0,0,0,0)
135  {}
136 
144  component_iterator3d_box(MultiComponentContainer3D* c, std::size_t cp,
145  const Box3d<int>& b):
146  cont3d_(c),pos_(&(*c)[0][0][0][cp] +
147  ((b.front_upper_left())[0] * static_cast<int>(c->rows()) * static_cast<int>(c->cols()) * N) +
148  ((b.front_upper_left())[1] * static_cast<int>(c->cols()) * N) +
149  ((b.front_upper_left())[2] * N)),
150  x1_((b.front_upper_left())[0]),x2_((b.front_upper_left())[1]),
151  x3_((b.front_upper_left())[2]),cp_(cp),box_(b)
152  {}
153 
159  component_iterator3d_box(const self& o):
160  cont3d_(o.cont3d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),x3_(o.x3_),cp_(o.cp_),box_(o.box_)
161  {}
162 
177  self& operator=(const self& o)
178  {
179  if(this != &o)
180  {
181  this->cont3d_ = o.cont3d_;
182  this->pos_ = o.pos_;
183  this->x1_ = o.x1_;
184  this->x2_ = o.x2_;
185  this->x3_ = o.x3_;
186  this->cp_ = o.cp_;
187  this->box_ = o.box_;
188  }
189  return *this;
190  }
199  inline
201  {
202  return *pos_;
203  }
204 
205  inline
207  {
208  return &(operator*());
209  }
210 
215 
221  inline
222  self& operator++()
223  {
224  if(x3_ < (box_.back_bottom_right())[2])
225  {
226  this->x3_++;
227  this->pos_+=N;
228  }
229  else if(x2_ < (box_.back_bottom_right())[1])
230  {
231  this->x2_++;
232  this->x3_ = (box_.front_upper_left())[2];
233  this->pos_+= N * (static_cast<int>(cont3d_->cols()) - box_.width() + 1) ;
234  }
235  else if(x1_ < (box_.back_bottom_right())[0]){
236  this->x1_++;
237  this->x2_ = (box_.front_upper_left())[1];
238  this->x3_ = (box_.front_upper_left())[2];
239  this->pos_ += N * (static_cast<int>(cont3d_->cols())*(static_cast<int>(cont3d_->rows()) -
240  box_.height() + 1) - box_.width() + 1 );
241  }
242  else{
243  this->x1_ = (box_.back_bottom_right())[0] + 1;
244  this->x2_ = (box_.back_bottom_right())[1] + 1;
245  this->x3_ = (box_.back_bottom_right())[2] + 1;
246  this->pos_ += N * (static_cast<int>(cont3d_->cols()) * (static_cast<int>(cont3d_->rows())
247  + 1) + 1);
248  }
249  return *this;
250  }
251 
256  inline
257  self operator++(int)
258  {
259  self tmp = *this;
260  ++(*this);
261  return tmp;
262  }
263 
275  inline
276  self& operator--()
277  {
278  if(x3_ > (box_.front_upper_left())[2])
279  {
280  this->x3_--;
281  this->pos_-=N;
282  }
283  else if (x2_ > (box_.front_upper_left())[1])
284  {
285  this->x3_ = (box_.back_bottom_right())[2];
286  this->x2_--;
287  this->pos_ -= N * (static_cast<int>(cont3d_->cols()) - box_.width() + 1);
288  }
289  else if (x1_ > (box_.front_upper_left())[0])
290  {
291  this->x3_ = (box_.back_bottom_right())[2];
292  this->x2_ = (box_.back_bottom_right())[1];
293  this->x1_--;
294  this->pos_ -= N * (static_cast<int>(cont3d_->cols())*(static_cast<int>(cont3d_->rows()) -
295  box_.height() + 1) - box_.width() + 1);
296  }
297  else{
298  this->x3_ = (box_.front_upper_left())[2] - 1;
299  this->x2_ = (box_.front_upper_left())[1] - 1;
300  this->x1_ = (box_.front_upper_left())[0] - 1;
301  this->pos_ -= N * (static_cast<int>(cont3d_->cols()) * (static_cast<int>(cont3d_->rows())
302  + 1) + 1);
303  }
304  return *this;
305  }
306 
312  inline
313  self operator--(int)
314  {
315  self tmp = *this;
316  --(*this);
317  return tmp;
318  }
319 
333  inline
334  friend bool operator==(const self& i1,
335  const self& i2)
336  {
337 
338  return ( (i1.cont3d_ == i2.cont3d_) && (i1.pos_ == i2.pos_)
339  && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) && (i1.x3_ == i2.x3_)
340  && (i1.cp_ == i2.cp_));
341  }
342 
349  inline
350  friend bool operator!=(const self& i1,
351  const self& i2)
352  {
353  return ( (i1.cont3d_ != i2.cont3d_) || (i1.pos_ != i2.pos_)
354  || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_) || (i1.x3_ != i2.x3_)
355  || (i1.cp_ != i2.cp_));
356  }
357 
371  inline
372  friend bool operator<(const self& i1,
373  const self& i2)
374  {
375 
376  return ( i1.pos_ < i2.pos_);
377  }
378 
385  inline
386  friend bool operator>(const self& i1,
387  const self& i2)
388  {
389  return (i2 < i1);
390  }
391 
398  inline
399  friend bool operator<=(const self& i1,
400  const self& i2)
401  {
402 
403  return !(i2 < i1);
404  }
405 
412  inline
413  friend bool operator>=(const self& i1,
414  const self& i2)
415  {
416 
417  return !(i1 < i2);
418  }
433  inline
434  self& operator+=(const difference_type& d)
435  {
436  this->x1_ += d.dx1();
437  this->x2_ += d.dx2();
438  this->x3_ += d.dx3();
439  this->pos_ = &(*cont3d_)[0][0][0][this->cp_] +
440  (this->x1_ * static_cast<int>(cont3d_->cols()) * static_cast<int>(cont3d_->rows()) * N) +
441  (this->x2_ * static_cast<int>(cont3d_->cols()) * N) +
442  this->x3_ * N;
443  return *this;
444  }
445 
446 
447 
455  inline
456  self& operator-=(const difference_type& d)
457  {
458  this->x1_ -= d.dx1();
459  this->x2_ -= d.dx2();
460  this->x3_ -= d.dx3();
461  this->pos_ = &(*cont3d_)[0][0][0][this->cp_] +
462  (this->x1_ * static_cast<int>(cont3d_->cols()) * static_cast<int>(cont3d_->rows()) * N) +
463  (this->x2_ * static_cast<int>(cont3d_->cols()) * N) +
464  this->x3_ * N;
465  return *this;
466  }
467 
475  inline
476  self operator+(const difference_type& d)
477  {
478  self tmp = *this;
479  tmp += d;
480  return tmp;
481  }
482 
490  inline
491  self operator-(const difference_type& d)
492  {
493  self tmp = *this;
494  tmp -= d;
495  return tmp;
496  }
497 
498 
506  inline
507  friend difference_type operator-(const self& i1,
508  const self& i2)
509  {
510  return difference_type(static_cast<int>(i1.x1_ - i2.x1_),static_cast<int>(i1.x2_ - i2.x2_),
511  static_cast<int>(i1.x3_ - i2.x3_));
512  }
513 
514 
523  inline
525  {
526  assert( (this->x1_+d.dx1()) < cont3d_->dim1() );
527  assert( (this->x2_+d.dx2()) < cont3d_->dim2() );
528  assert( (this->x3_+d.dx3()) < cont3d_->dim3() );
529  return (*cont3d_)[this->x1_+d.dx1()][this->x2_+d.dx2()][this->x3_+d.dx3()][cp_];
530  }
531 
539  inline
540  typename MultiComponentContainer3D::component_slice_iterator slice_begin(size_type row, size_type col)
541  {
542  return cont3d_->slice_begin(this->cp_,this->box_.front_upper_left()[1] + row, this->box_.front_upper_left()[2] + col) + this->box_.front_upper_left()[0];
543  }
544 
545 
553  inline
554  typename MultiComponentContainer3D::component_slice_iterator slice_end(size_type row, size_type col)
555  {
556  return this->slice_begin(row,col) + this->box_.depth();
557  }
558 
566  inline
567  typename MultiComponentContainer3D::component_row_iterator row_begin(size_type slice, size_type row)
568  {
569  return cont3d_->row_begin(this->cp_,this->box_.front_upper_left()[0] + slice, this->box_.front_upper_left()[1] + row) + this->box_.front_upper_left()[2];
570  }
571 
572 
580  inline
581  typename MultiComponentContainer3D::component_row_iterator row_end(size_type slice, size_type row)
582  {
583  return this->row_begin(slice,row) + this->box_.width();
584  }
585 
586 
594  inline
595  typename MultiComponentContainer3D::component_col_iterator col_begin(size_type slice, size_type col)
596  {
597  return cont3d_->col_begin(this->cp_,this->box_.front_upper_left()[0] + slice, this->box_.front_upper_left()[2] + col) + this->box_.front_upper_left()[1];
598  }
599 
600 
608  inline
609  typename MultiComponentContainer3D::component_col_iterator col_end(size_type slice, size_type col)
610  {
611  return this->col_begin(slice,col) + this->box_.height();
612  }
613 
625  inline
626  int x1() const
627  {
628  return this->x1_;
629  }
630 
635  inline
636  int k() const
637  {
638  return this->x1_;
639  }
640 
641 
646  inline
647  int x2() const
648  {
649  return this->x2_;
650  }
651 
656  inline
657  int i() const
658  {
659  return this->x2_;
660  }
661 
666  inline
667  int x3() const
668  {
669  return this->x3_;
670  }
671 
676  inline
677  int j() const
678  {
679  return this->x3_;
680  }
685  inline
686  size_type cp() const
687  {
688  return this->cp_;
689  }
690 
691 
695 private:
696  MultiComponentContainer3D* cont3d_; // pointer to the 3d container
697  pointer pos_; // linear position within the container
698  int x1_; // first index position
699  int x2_; // second index position
700  int x3_; // Third index position
701  size_type cp_; // component index number
702  Box3d<int> box_; // box to iterate
703 };
704 
705 
724 template <class MultiComponentContainer3D, std::size_t N>
726 {
727 
728 public:
729 
730  //typedef std::random_access_iterator_tag iterator_category;
732  typedef typename MultiComponentContainer3D::value_type Block;
733  typedef typename Block::value_type value_type;
735  typedef value_type const * pointer;
736  typedef value_type const & reference;
737 
739 
740  typedef typename MultiComponentContainer3D::size_type size_type;
745 
751  cont3d_(0),pos_(0),x1_(0),x2_(0),x3_(0),cp_(0),box_(0,0,0,0)
752  {}
753 
761  const_component_iterator3d_box(MultiComponentContainer3D* c, std::size_t cp,
762  const Box3d<int>& b):
763  cont3d_(c),pos_(&(*c)[0][0][0][cp] +
764  ((b.front_upper_left())[0] * static_cast<int>(c->rows()) * static_cast<int>(c->cols()) * N) +
765  ((b.front_upper_left())[1] * static_cast<int>(c->cols()) * N) +
766  ((b.front_upper_left())[2] * N)),
767  x1_((b.front_upper_left())[0]),x2_((b.front_upper_left())[1]),
768  x3_((b.front_upper_left())[2]),cp_(cp),box_(b)
769  {}
770 
777  cont3d_(o.cont3d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),x3_(o.x3_),cp_(o.cp_),box_(o.box_)
778  {}
779 
794  self& operator=(const self& o)
795  {
796  if(this != &o)
797  {
798  this->cont3d_ = o.cont3d_;
799  this->pos_ = o.pos_;
800  this->x1_ = o.x1_;
801  this->x2_ = o.x2_;
802  this->x3_ = o.x3_;
803  this->cp_ = o.cp_;
804  this->box_ = o.box_;
805  }
806  return *this;
807  }
816  inline
818  {
819  return *pos_;
820  }
821 
822  inline
824  {
825  return &(operator*());
826  }
827 
832 
838  inline
839  self& operator++()
840  {
841  if(x3_ < (box_.back_bottom_right())[2])
842  {
843  this->x3_++;
844  this->pos_+=N;
845  }
846  else if(x2_ < (box_.back_bottom_right())[1])
847  {
848  this->x2_++;
849  this->x3_ = (box_.front_upper_left())[2];
850  this->pos_ += N * (static_cast<int>(cont3d_->cols()) - box_.width() + 1);
851  }
852  else if(x1_ < (box_.back_bottom_right())[0]){
853  this->x1_++;
854  this->x2_ = (box_.front_upper_left())[1];
855  this->x3_ = (box_.front_upper_left())[2];
856  this->pos_ += N * (static_cast<int>(cont3d_->cols())*(static_cast<int>(cont3d_->rows()) - box_.height() + 1)
857  - box_.width() + 1);
858  }
859  else{
860  this->x1_ = (box_.back_bottom_right())[0] + 1;
861  this->x2_ = (box_.back_bottom_right())[1] + 1;
862  this->x3_ = (box_.back_bottom_right())[2] + 1;
863  this->pos_ += N * (static_cast<int>(cont3d_->cols()) * (static_cast<int>(cont3d_->rows()) + 1) + 1);
864  }
865  return *this;
866  }
867 
872  inline
873  self operator++(int)
874  {
875  self tmp = *this;
876  ++(*this);
877  return tmp;
878  }
879 
891  inline
892  self& operator--()
893  {
894  if(x3_ > (box_.front_upper_left())[2])
895  {
896  this->x3_--;
897  this->pos_-=N;
898  }
899  else if (x2_ > (box_.front_upper_left())[1])
900  {
901  this->x3_ = (box_.back_bottom_right())[2];
902  this->x2_--;
903  this->pos_ -= N * (static_cast<int>(cont3d_->cols()) - box_.width() + 1);
904  }
905  else if (x1_ > (box_.front_upper_left())[0])
906  {
907  this->x3_ = (box_.back_bottom_right())[2];
908  this->x2_ = (box_.back_bottom_right())[1];
909  this->x1_--;
910  this->pos_ -= N * (static_cast<int>(cont3d_->cols())*(static_cast<int>(cont3d_->rows()) - box_.height() + 1)
911  - box_.width() + 1);
912  }
913  else{
914  this->x3_ = (box_.front_upper_left())[2] - 1;
915  this->x2_ = (box_.front_upper_left())[1] - 1;
916  this->x1_ = (box_.front_upper_left())[0] - 1;
917  this->pos_ -= N * (static_cast<int>(cont3d_->cols()) * (static_cast<int>(cont3d_->rows()) + 1) + 1);
918  }
919  return *this;
920  }
921 
927  inline
928  self operator--(int)
929  {
930  self tmp = *this;
931  --(*this);
932  return tmp;
933  }
934 
948  inline
949  friend bool operator==(const self& i1,
950  const self& i2)
951  {
952 
953  return ( (i1.cont3d_ == i2.cont3d_) && (i1.pos_ == i2.pos_)
954  && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) && (i1.x3_ == i2.x3_)
955  && (i1.cp_ == i2.cp_));
956  }
957 
964  inline
965  friend bool operator!=(const self& i1,
966  const self& i2)
967  {
968  return ( (i1.cont3d_ != i2.cont3d_) || (i1.pos_ != i2.pos_)
969  || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_) || (i1.x3_ != i2.x3_)
970  || (i1.cp_ != i2.cp_));
971  }
972 
986  inline
987  friend bool operator<(const self& i1,
988  const self& i2)
989  {
990 
991  return ( i1.pos_ < i2.pos_);
992  }
993 
1000  inline
1001  friend bool operator>(const self& i1,
1002  const self& i2)
1003  {
1004  return (i2 < i1);
1005  }
1006 
1013  inline
1014  friend bool operator<=(const self& i1,
1015  const self& i2)
1016  {
1017 
1018  return !(i2 < i1);
1019  }
1020 
1027  inline
1028  friend bool operator>=(const self& i1,
1029  const self& i2)
1030  {
1031 
1032  return !(i1 < i2);
1033  }
1048  inline
1049  self& operator+=(const difference_type& d)
1050  {
1051  this->x1_ += d.dx1();
1052  this->x2_ += d.dx2();
1053  this->x3_ += d.dx3();
1054  this->pos_ = &(*cont3d_)[0][0][0][this->cp_] +
1055  (this->x1_ * static_cast<int>(cont3d_->cols()) * static_cast<int>(cont3d_->rows()) * N) +
1056  (this->x2_ * static_cast<int>(cont3d_->cols()) * N) +
1057  this->x3_ * N;
1058  return *this;
1059  }
1060 
1061 
1062 
1070  inline
1071  self& operator-=(const difference_type& d)
1072  {
1073  this->x1_ -= d.dx1();
1074  this->x2_ -= d.dx2();
1075  this->x3_ -= d.dx3();
1076  this->pos_ = &(*cont3d_)[0][0][0][this->cp_] +
1077  (this->x1_ * static_cast<int>(cont3d_->cols()) * static_cast<int>(cont3d_->rows()) * N) +
1078  (this->x2_ * static_cast<int>(cont3d_->cols()) * N) +
1079  this->x3_ * N;
1080  return *this;
1081  }
1082 
1090  inline
1092  {
1093  self tmp = *this;
1094  tmp += d;
1095  return tmp;
1096  }
1097 
1105  inline
1107  {
1108  self tmp = *this;
1109  tmp -= d;
1110  return tmp;
1111  }
1112 
1113 
1121  inline
1122  friend difference_type operator-(const self& i1,
1123  const self& i2)
1124  {
1125  return difference_type(int(i1.x1_ - i2.x1_),int(i1.x2_ - i2.x2_),int(i1.x3_ - i2.x3_));
1126  }
1127 
1128 
1137  inline
1139  {
1140  assert( (this->x1_+d.dx1()) < cont3d_->dim1() );
1141  assert( (this->x2_+d.dx2()) < cont3d_->dim2() );
1142  assert( (this->x3_+d.dx3()) < cont3d_->dim3() );
1143  return (*cont3d_)[this->x1_+d.dx1()][this->x2_+d.dx2()][this->x3_+d.dx3()][cp_];
1144  }
1145 
1146 
1154  inline
1155  typename MultiComponentContainer3D::const_component_slice_iterator slice_begin(size_type row, size_type col)
1156  {
1157  return cont3d_->slice_begin(this->cp_,this->box_.front_upper_left()[1] + row, this->box_.front_upper_left()[2] + col) + this->box_.front_upper_left()[0];
1158  }
1159 
1160 
1168  inline
1169  typename MultiComponentContainer3D::const_component_slice_iterator slice_end(size_type row, size_type col)
1170  {
1171  return this->slice_begin(row,col) + this->box_.depth();
1172  }
1173 
1181  inline
1182  typename MultiComponentContainer3D::const_component_row_iterator row_begin(size_type slice, size_type row)
1183  {
1184  return cont3d_->row_begin(this->cp_,this->box_.front_upper_left()[0] + slice, this->box_.front_upper_left()[1] + row) + this->box_.front_upper_left()[2];
1185  }
1186 
1187 
1195  inline
1196  typename MultiComponentContainer3D::const_component_row_iterator row_end(size_type slice, size_type row)
1197  {
1198  return this->row_begin(slice,row) + this->box_.width();
1199  }
1200 
1201 
1209  inline
1210  typename MultiComponentContainer3D::const_component_col_iterator col_begin(size_type slice, size_type col)
1211  {
1212  return cont3d_->col_begin(this->cp_,this->box_.front_upper_left()[0] + slice, this->box_.front_upper_left()[2] + col) + this->box_.front_upper_left()[1];
1213  }
1214 
1215 
1223  inline
1224  typename MultiComponentContainer3D::const_component_col_iterator col_end(size_type slice, size_type col)
1225  {
1226  return this->col_begin(slice,col) + this->box_.height();
1227  }
1228 
1240  inline
1241  int x1() const
1242  {
1243  return this->x1_;
1244  }
1245 
1250  inline
1251  int k() const
1252  {
1253  return this->x1_;
1254  }
1255 
1256 
1261  inline
1262  int x2() const
1263  {
1264  return this->x2_;
1265  }
1266 
1271  inline
1272  int i() const
1273  {
1274  return this->x2_;
1275  }
1276 
1281  inline
1282  int x3() const
1283  {
1284  return this->x3_;
1285  }
1286 
1291  inline
1292  int j() const
1293  {
1294  return this->x3_;
1295  }
1296 
1301  inline
1302  size_type cp() const
1303  {
1304  return this->cp_;
1305  }
1306 
1307 
1311 private:
1312  MultiComponentContainer3D* cont3d_; // pointer to the 3d container
1313  pointer pos_; // linear position within the container
1314  int x1_; // first index position
1315  int x2_; // second index position
1316  int x3_; // third index position
1317  size_type cp_; // component index number
1318  Box3d<int> box_; // box to iterate
1319 };
1320 
1321 }//slip::
1322 
1323 #endif //SLIP_COMPONENT_ITERATOR3D_BOX_HPP
MultiComponentContainer3D::const_component_slice_iterator slice_end(size_type row, size_type col)
const_component_iterator3d_box element assignment operator.
int x2() const
Access to the second index of the current const_component_iterator3d_box.
const_component_iterator3d_box(const self &o)
Constructs a copy of the const_component_iterator3d_box o.
self & operator-=(const difference_type &d)
component_iterator3d_box substraction.
const_component_iterator3d_box(MultiComponentContainer3D *c, std::size_t cp, const Box3d< int > &b)
Constructs a const_component_iterator3d_box.
Provides a class to modelize 3d points.
MultiComponentContainer3D::value_type Block
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
void dx3(const CoordType &dx)
Accessor of the first coordinate of DPoint3d.
Definition: DPoint3d.hpp:273
CoordType width() const
compute the width of the Box3d.
Definition: Box3d.hpp:408
friend difference_type operator-(const self &i1, const self &i2)
const_component_iterator3d_box difference operator.
Difference of Point3D class, specialization of DPoint<CoordType,DIM> with DIM = 3.
self operator--(int)
Postdecrement a const_component_iterator3d_box. Iterate to the previous location inside the Box3d...
int x1() const
Access to the first index of the current component_iterator3d_box.
friend bool operator>=(const self &i1, const self &i2)
>= operator.
self & operator-=(const difference_type &d)
const_component_iterator3d_box substraction.
self & operator+=(const difference_type &d)
component_iterator3d_box addition.
reference operator[](difference_type d) const
const_component_iterator3d_box element assignment operator. Equivalent to *(i + d) = t...
MultiComponentContainer3D::component_col_iterator col_begin(size_type slice, size_type col)
component_iterator3d_box element assignment operator.
self operator++(int)
Postincrement a const_component_iterator3d_box. Iterate to the next location inside the Box3d...
int k() const
Access to the first index of the current component_iterator3d_box.
friend bool operator==(const self &i1, const self &i2)
Equality operator.
reference operator*() const
Dereference assignment operator. Returns the element that the current const_component_iterator3d_box ...
int i() const
Access to the second index of the current component_iterator3d_box.
Provides a class to tag SLIP iterators.
friend bool operator>=(const self &i1, const self &i2)
>= operator.
MultiComponentContainer3D::const_component_col_iterator col_end(size_type slice, size_type col)
const_component_iterator3d_box element assignment operator.
std::random_access_iterator3d_tag iterator_category
MultiComponentContainer3D::value_type Block
friend difference_type operator-(const self &i1, const self &i2)
component_iterator3d_box difference operator.
MultiComponentContainer3D::component_col_iterator col_end(size_type slice, size_type col)
component_iterator3d_box element assignment operator.
Provides a class to modelize the difference of slip::Point3d.
friend bool operator>(const self &i1, const self &i2)
operator.
reference operator[](difference_type d)
component_iterator3d_box element assignment operator. Equivalent to *(i + d) = t. ...
MultiComponentContainer3D::component_slice_iterator slice_end(size_type row, size_type col)
component_iterator3d_box element assignment operator.
int x3() const
Access to the third index of the current component_iterator3d_box.
component_iterator3d_box(const self &o)
Constructs a copy of the component_iterator3d_box o.
MultiComponentContainer3D::const_component_slice_iterator slice_begin(size_type row, size_type col)
const_component_iterator3d_box element assignment operator.
friend bool operator<=(const self &i1, const self &i2)
<= operator.
int k() const
Access to the first index of the current const_component_iterator3d_box.
friend bool operator<(const self &i1, const self &i2)
< operator.
self operator--(int)
Postdecrement a component_iterator3d_box. Iterate to the previous location inside the Box3d...
friend bool operator>(const self &i1, const self &i2)
operator.
int x3() const
Access to the third index of the current const_component_iterator3d_box.
MultiComponentContainer3D::component_slice_iterator slice_begin(size_type row, size_type col)
component_iterator3d_box element assignment operator.
MultiComponentContainer3D::component_row_iterator row_end(size_type slice, size_type row)
component_iterator3d_box element assignment operator.
void front_upper_left(Point< CoordType, 3 >)
Accessor/Mutator of the front_upper_left point (p1) of Box3d.
Definition: Box3d.hpp:355
This is some iterator to iterate a 3d MultiComponentContainer into a Box area defined by the indices ...
self operator-(const difference_type &d)
const_component_iterator3d_box substraction.
self & operator++()
Preincrement a const_component_iterator3d_box. Iterate to the next location inside the Box3d...
MultiComponentContainer3D::size_type size_type
self operator++(int)
Postincrement a component_iterator3d_box. Iterate to the next location inside the Box3d...
size_type cp() const
Access to the component index of the current component_iterator3d_box.
self & operator=(const self &o)
Assign a const_component_iterator3d_box.
Provides a class to manipulate 3d box.
int j() const
Access to the third index of the current component_iterator3d_box.
int x2() const
Access to the second index of the current component_iterator3d_box.
friend bool operator==(const self &i1, const self &i2)
Equality operator.
int x1() const
Access to the first index of the current const_component_iterator3d_box.
void dx2(const CoordType &dx)
Accessor of the second coordinate of DPoint3d.
Definition: DPoint3d.hpp:261
std::random_access_iterator3d_tag iterator_category
MultiComponentContainer3D::size_type size_type
MultiComponentContainer3D::const_component_row_iterator row_end(size_type slice, size_type row)
const_component_iterator3d_box element assignment operator.
MultiComponentContainer3D::component_row_iterator row_begin(size_type slice, size_type row)
component_iterator3d_box element assignment operator.
This is some iterator to iterate a 3d MultiComponentContainer into a Box area defined by the indices ...
int i() const
Access to the second index of the current const_component_iterator3d_box.
CoordType depth() const
compute the depth of the Box3d.
Definition: Box3d.hpp:416
self & operator=(const self &o)
Assign a component_iterator3d_box.
friend bool operator<=(const self &i1, const self &i2)
<= operator.
self operator+(const difference_type &d)
const_component_iterator3d_box addition.
friend bool operator<(const self &i1, const self &i2)
< operator.
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
void back_bottom_right(Point< CoordType, 3 >)
Accessor/Mutator of the back_bottom_right point (p2) of Box3d.
Definition: Box3d.hpp:368
self operator-(const difference_type &d)
component_iterator3d_box substraction.
size_type cp() const
Access to the component index of the current const_component_iterator3d_box.
const_component_iterator3d_box()
Constructs a const_component_iterator3d_box.
self & operator++()
Preincrement a component_iterator3d_box. Iterate to the next location inside the Box3d.
reference operator*()
Dereference assignment operator. Returns the element that the current component_iterator3d_box i poin...
component_iterator3d_box(MultiComponentContainer3D *c, std::size_t cp, const Box3d< int > &b)
Constructs a component_iterator3d_box.
MultiComponentContainer3D::const_component_col_iterator col_begin(size_type slice, size_type col)
const_component_iterator3d_box element assignment operator.
self & operator--()
Predecrement a const_component_iterator3d_box. Iterate to the previous location inside the Box3d...
self operator+(const difference_type &d)
component_iterator3d_box addition.
self & operator--()
Predecrement a component_iterator3d_box. Iterate to the previous location inside the Box3d...
void dx1(const CoordType &dx)
Accessor of the first coordinate of DPoint3d.
Definition: DPoint3d.hpp:249
CoordType height() const
compute the height of the Box3d.
Definition: Box3d.hpp:412
component_iterator3d_box()
Constructs a component_iterator3d_box.
int j() const
Access to the third index of the current const_component_iterator3d_box.
MultiComponentContainer3D::const_component_row_iterator row_begin(size_type slice, size_type row)
const_component_iterator3d_box element assignment operator.
self & operator+=(const difference_type &d)
const_component_iterator3d_box addition.