77 #ifndef SLIP_ITERATOR3D_BOX_HPP
78 #define SLIP_ITERATOR3D_BOX_HPP
111 template <
class Container3D>
120 typedef typename Container3D::pointer
pointer;
136 cont3d_(0),pos_(0),x1_(0),x2_(0),x3_(0),box_(0,0,0,0,0,0)
147 cont3d_(c),pos_((*c)[(b.front_upper_left())[0]][(b.front_upper_left())[1]] + (b.front_upper_left())[2]),x1_((b.front_upper_left())[0]),x2_((b.front_upper_left())[1]),x3_((b.front_upper_left())[2]),box_(b)
156 cont3d_(o.cont3d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),x3_(o.x3_),box_(o.box_)
177 this->cont3d_ = o.cont3d_;
249 this->pos_ = cont3d_->begin() +
250 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
251 (this->x2_*
int(cont3d_->cols())) + this->x3_;
258 this->pos_ = cont3d_->begin() +
259 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
260 (this->x2_*
int(cont3d_->cols())) + this->x3_;
267 this->pos_ = cont3d_->begin() +
268 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
269 (this->x2_*
int(cont3d_->cols())) + this->x3_;
310 this->pos_ = cont3d_->begin() +
311 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
312 (this->x2_*
int(cont3d_->cols())) + this->x3_;
319 this->pos_ = cont3d_->begin() +
320 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
321 (this->x2_*
int(cont3d_->cols())) + this->x3_;
328 this->pos_ = cont3d_->begin() +
329 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
330 (this->x2_*
int(cont3d_->cols())) + this->x3_;
367 return ( (i1.cont3d_ == i2.cont3d_) && (i1.pos_ == i2.pos_)
368 && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) && (i1.x3_ == i2.x3_));
381 return ( (i1.cont3d_ != i2.cont3d_) || (i1.pos_ != i2.pos_)
382 || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_) || (i1.x3_ != i2.x3_));
401 return ( i1.pos_ < i2.pos_);
462 this->x1_ += d.
dx1();
463 this->x2_ += d.
dx2();
464 this->x3_ += d.
dx3();
465 this->pos_ = cont3d_->begin() +
466 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
467 (this->x2_*
int(cont3d_->cols())) + this->x3_;
483 this->x1_ -= d.
dx1();
484 this->x2_ -= d.
dx2();
485 this->x3_ -= d.
dx3();
486 this->pos_ = cont3d_->begin() +
487 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
488 (this->x2_*
int(cont3d_->cols())) + this->x3_;
535 return difference_type(
int(i1.x1_ - i2.x1_),
int(i1.x2_ - i2.x2_),
int(i1.x3_ - i2.x3_));
550 return (*cont3d_)[this->x1_+d.
dx1()][this->x2_+d.
dx2()][this->x3_+d.
dx3()];
565 return (*cont3d_)[this->x1_+ d.
dx1()][this->x2_ + d.
dx2()];
580 return (*cont3d_)[this->x1_+ n];
596 return (*cont3d_)[this->x1_+ n];
699 return cont3d_->plane_upper_left(p,this->box_.
front_upper_left()[0] + xp,b);
704 return cont3d_->plane_upper_left(p,this->box_.
front_upper_left()[1] + xp,b);
707 return cont3d_->plane_upper_left(p,this->box_.
front_upper_left()[2] + xp,b);
724 return cont3d_->plane_bottom_right(p,this->box_.
front_upper_left()[0] + xp,b);
729 return cont3d_->plane_bottom_right(p,this->box_.
front_upper_left()[1] + xp,b);
732 return cont3d_->plane_bottom_right(p,this->box_.
front_upper_left()[2] + xp,b);
804 Container3D* cont3d_;
835 template <
class Container3D>
836 class const_iterator3d_box
844 typedef typename Container3D::const_pointer
pointer;
845 typedef typename Container3D::const_reference
reference;
860 cont3d_(0),pos_(0),x1_(0),x2_(0),x3_(0),box_(0,0,0,0,0,0)
870 cont3d_(c),pos_((*c)[(b.front_upper_left())[0]][(b.front_upper_left())[1]] + (b.front_upper_left())[2])
871 ,x1_((b.front_upper_left())[0]),x2_((b.front_upper_left())[1]),x3_((b.front_upper_left())[2]),box_(b)
880 cont3d_(o.cont3d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),x3_(o.x3_),box_(o.box_)
901 this->cont3d_ = o.cont3d_;
956 this->pos_ = cont3d_->begin() +
957 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
958 (this->x2_*
int(cont3d_->cols())) + this->x3_;
965 this->pos_ = cont3d_->begin() +
966 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
967 (this->x2_*
int(cont3d_->cols())) + this->x3_;
974 this->pos_ = cont3d_->begin() +
975 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
976 (this->x2_*
int(cont3d_->cols())) + this->x3_;
1017 this->pos_ = cont3d_->begin() +
1018 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
1019 (this->x2_*
int(cont3d_->cols())) + this->x3_;
1026 this->pos_ = cont3d_->begin() +
1027 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
1028 (this->x2_*
int(cont3d_->cols())) + this->x3_;
1035 this->pos_ = cont3d_->begin() +
1036 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
1037 (this->x2_*
int(cont3d_->cols())) + this->x3_;
1073 return ( (i1.cont3d_ == i2.cont3d_) && (i1.pos_ == i2.pos_)
1074 && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) && (i1.x3_ == i2.x3_) );
1087 return ( (i1.cont3d_ != i2.cont3d_) || (i1.pos_ != i2.pos_)
1088 || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_) || (i1.x3_ != i2.x3_) );
1107 return ( i1.pos_ < i2.pos_);
1167 this->x1_ += d.
dx1();
1168 this->x2_ += d.
dx2();
1169 this->x3_ += d.
dx3();
1170 this->pos_ = cont3d_->begin() +
1171 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
1172 (this->x2_*
int(cont3d_->cols())) + this->x3_;
1188 this->x1_ -= d.
dx1();
1189 this->x2_ -= d.
dx2();
1190 this->x3_ -= d.
dx3();
1191 this->pos_ = cont3d_->begin() +
1192 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
1193 (this->x2_*
int(cont3d_->cols())) + this->x3_;
1242 return difference_type(
int(i1.x1_ - i2.x1_),
int(i1.x2_ - i2.x2_),
int(i1.x3_ - i2.x3_));
1255 return (*cont3d_)[this->x1_+d.
dx1()][this->x2_+d.
dx2()][this->x3_+d.
dx3()];
1270 return (*cont3d_)[this->x1_+ d.
dx1()][this->x2_ + d.
dx2()];
1285 return (*cont3d_)[this->x1_+ n];
1299 Container3D
const * tp(cont3d_);
1314 Container3D
const * tp(cont3d_);
1329 Container3D
const * tp(cont3d_);
1361 Container3D
const * tp(cont3d_);
1392 Container3D
const * tp(cont3d_);
1418 Container3D
const * tp(cont3d_);
1502 Container3D* cont3d_;
1514 #endif //SLIP_ITERATOR3D_BOX_HPP
self operator++(int)
Postincrement a const_iterator3d_box. Iterate to the next location inside the Box3d.
int i() const
Access to the first subscript of the current const_iterator3d_box.
self & operator--()
Predecrement a iterator3d_box. Iterate to the previous location inside the Box3d. ...
Container3D::const_row_iterator row_end(size_t slice, size_type row) const
const_iterator3d_box element assignment operator.
self & operator=(const self &o)
Assign a iterator3d_box.
int x3() const
Access to the second subscript of the current const_iterator3d_box.
Provides a class to modelize 3d points.
Provides a class to modelize the difference of slip::Point2d.
void dx3(const CoordType &dx)
Accessor of the first coordinate of DPoint3d.
friend bool operator>(const self &i1, const self &i2)
operator.
CoordType width() const
compute the width of the Box3d.
pointer operator->() const
Container3D::const_col_iterator col_begin(size_t slice, size_type col) const
const_iterator3d_box element assignment operator.
Container3D::value_type value_type
pointer * operator[](int n)
iterator3d_box element assignment operator. Equivalent to *(k + n).
friend bool operator>=(const self &i1, const self &i2)
>= operator.
void dx2(const CoordType &dx)
Accessor of the second coordinate of DPoint2d.
Difference of Point3D class, specialization of DPoint<CoordType,DIM> with DIM = 3.
Container3D::col_iterator col_end(size_type slice, size_type col)
iterator3d_box element assignment operator.
Container3D::row_iterator row_begin(size_type slice, size_type row)
iterator3d_box element assignment operator.
self operator--(int)
Postdecrement a const_iterator3d_box. Iterate to the previous location inside the Box3d...
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
Container3D::size_type size_type
int x2() const
Access to the first subscript of the current const_iterator3d_box.
self & operator=(const self &o)
Assign a const_iterator3d_box.
Provides a class to tag SLIP iterators.
self operator+(const difference_type &d)
const_iterator3d_box addition.
friend bool operator==(const self &i1, const self &i2)
Equality operator.
friend bool operator<=(const self &i1, const self &i2)
<= operator.
Container3D::pointer pointer
Container3D::const_pointer pointer
DPoint3d< int > difference_type
Provides a class to modelize the difference of slip::Point3d.
self operator++(int)
Postincrement a iterator3d_box. Iterate to the next location inside the Box3d.
Container3D::const_iterator2d plane_bottom_right(const slip::PLANE_ORIENTATION p, const size_type xp)
const_iterator3d_box element assignment operator.
const_iterator3d_box()
Constructs a const_iterator3d_box.
friend bool operator<(const self &i1, const self &i2)
< operator.
Container3D::slice_iterator slice_begin(size_type row, size_type col)
iterator3d_box element assignment operator.
self & operator+=(const difference_type &d)
iterator3d_box addition.
Container3D::const_slice_iterator slice_end(size_type row, size_type col) const
const_iterator3d_box element assignment operator.
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
int x3() const
Access to the second subscript of the current iterator3d_box.
friend difference_type operator-(const self &i1, const self &i2)
const_iterator3d_box difference operator.
self & operator++()
Preincrement a const_iterator3d_box. Iterate to the next location inside the Box3d.
self & operator++()
Preincrement a iterator3d_box. Iterate to the next location inside the Box3d.
PLANE_ORIENTATION
Choose between different plane orientations.
void dx1(const CoordType &dx)
Accessor of the first coordinate of DPoint2d.
self & operator-=(const difference_type &d)
iterator3d_box substraction.
self operator+(const difference_type &d)
iterator3d_box addition.
int k() const
Access to the first subscript of the current iterator3d_box.
void front_upper_left(Point< CoordType, 3 >)
Accessor/Mutator of the front_upper_left point (p1) of Box3d.
friend bool operator<=(const self &i1, const self &i2)
<= operator.
std::random_access_iterator3d_tag iterator_category
Container3D::const_col_iterator col_end(size_t slice, size_type col) const
const_iterator3d_box element assignment operator.
Container3D::reference reference
reference operator[](difference_type d)
iterator3d_box element assignment operator. Equivalent to *(k + d) = t.
Container3D::const_slice_iterator slice_begin(size_type row, size_type col) const
const_iterator3d_box element assignment operator.
Container3D::const_reference reference
Provides a class to manipulate 3d box.
friend bool operator>(const self &i1, const self &i2)
operator.
void dx2(const CoordType &dx)
Accessor of the second coordinate of DPoint3d.
Difference of Point2D class, specialization of DPoint<CoordType,DIM> with DIM = 2.
const pointer * operator[](int n) const
iterator3d_box element assignment operator. Equivalent to *(k + n).
self operator-(const difference_type &d)
iterator3d_box substraction.
friend bool operator<(const self &i1, const self &i2)
< operator.
self operator--(int)
Postdecrement a iterator3d_box. Iterate to the previous location inside the Box3d.
reference operator*() const
Dereference operator. Returns the element that the current const_iterator3d_box i point to...
pointer operator->() const
const_iterator3d_box(const self &o)
Constructs a copy of the const_iterator3d_box o.
self operator-(const difference_type &d)
const_iterator3d_box substraction.
Container3D::iterator2d plane_bottom_right(const slip::PLANE_ORIENTATION p, const size_type xp)
iterator3d_box element assignment operator.
Container3D::size_type size_type
iterator3d_box(const self &o)
Constructs a copy of the iterator3d_box o.
int k() const
Access to the first subscript of the current const_iterator3d_box.
reference operator*()
Dereference assignment operator. Returns the element that the current iterator3d_box i point to...
CoordType depth() const
compute the depth of the Box3d.
int x1() const
Access to the first subscript of the current const_iterator3d_box.
Provides a class to iterate 3d containers throw a planes.
This is some iterator to iterate a 3d container into a Box area defined by the subscripts of the 3d c...
friend difference_type operator-(const self &i1, const self &i2)
iterator3d_box difference operator.
pointer * operator[](int n) const
const_iterator3d_box element assignment operator. Equivalent to *(k + n).
int j() const
Access to the second subscript of the current const_iterator3d_box.
Container3D::col_iterator col_begin(size_type slice, size_type col)
iterator3d_box element assignment operator.
void back_bottom_right(Point< CoordType, 3 >)
Accessor/Mutator of the back_bottom_right point (p2) of Box3d.
self & operator--()
Predecrement a const_iterator3d_box. Iterate to the previous location inside the Box3d.
const_iterator3d_box(Container3D *c, const Box3d< int > &b)
Constructs a const_iterator3d_box.
int x2() const
Access to the second subscript of the current iterator3d_box.
int j() const
Access to the second subscript of the current iterator3d_box.
pointer operator[](diff2d d) const
const_iterator3d_box element assignment operator. Equivalent to *(k + d).
self & operator+=(const difference_type &d)
const_iterator3d_box addition.
reference operator[](difference_type d) const
const_iterator3d_box element assignment operator. Equivalent to *(k + d).
iterator3d_box(Container3D *c, const Box3d< int > &b)
Constructs a iterator3d_box.
iterator3d_box()
Constructs a iterator3d_box.
Container3D::slice_iterator slice_end(size_type row, size_type col)
iterator3d_box element assignment operator.
const reference operator*() const
Dereference operator. Returns the element that the current iterator3d_box i point to...
friend bool operator==(const self &i1, const self &i2)
Equality operator.
Container3D::const_iterator2d plane_upper_left(const slip::PLANE_ORIENTATION p, const size_type xp)
const_iterator3d_box element assignment operator.
Container3D::const_row_iterator row_begin(size_t slice, size_type row) const
const_iterator3d_box element assignment operator.
Container3D::iterator2d plane_upper_left(const slip::PLANE_ORIENTATION p, const size_type xp)
iterator3d_box element assignment operator.
pointer operator[](diff2d d)
iterator3d_box element assignment operator. Equivalent to *(k + d) = t.
friend bool operator>=(const self &i1, const self &i2)
>= operator.
int i() const
Access to the first subscript of the current iterator3d_box.
Container3D::value_type value_type
void dx1(const CoordType &dx)
Accessor of the first coordinate of DPoint3d.
std::random_access_iterator3d_tag iterator_category
int x1() const
Access to the first subscript of the current iterator3d_box.
CoordType height() const
compute the height of the Box3d.
DPoint3d< int > difference_type
self & operator-=(const difference_type &d)
const_iterator3d_box substraction.
Container3D::row_iterator row_end(size_type slice, size_type row)
iterator3d_box element assignment operator.
This is some iterator to iterate a 3d container into a Box area defined by the subscripts of the 3d c...