74 #ifndef SLIP_ITERATOR3D_PLANE_HPP
75 #define SLIP_ITERATOR3D_PLANE_HPP
136 template <
class Container3D>
149 this->pos_ = cont3d_->begin() +
150 (this->xp_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
151 (this->x1_*
int(cont3d_->cols())) + this->x2_;
153 else if(zerodim_ == 1)
155 this->pos_ = cont3d_->begin() +
156 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
157 (this->xp_*
int(cont3d_->cols())) + this->x2_;
161 this->pos_ = cont3d_->begin() +
162 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
163 (this->x2_*
int(cont3d_->cols())) + this->xp_;
172 typedef typename Container3D::pointer
pointer;
188 cont3d_(0),pos_(0),zerodim_(0),xp_(0),x1_(0),x2_(0),box_(0,0,0,0)
203 cont3d_(c),pos_(0),zerodim_(P),xp_(plane_coordinate),x1_(b.upper_left()[0]),x2_(b.upper_left()[1]),box_(b)
218 cont3d_(c),pos_(0),zerodim_(0),xp_(0),x1_(0),x2_(0),box_(0,0,0,0)
221 zerodim_ = ((dim[0] == 0)?0:((dim[1] == 0)?1:((dim[2] == 0)?2:-1)));
222 assert(zerodim_ != -1);
230 else if (zerodim_ == 1)
251 cont3d_(o.cont3d_),pos_(o.pos_),zerodim_(o.zerodim_),xp_(o.xp_),x1_(o.x1_),x2_(o.x2_),box_(o.box_)
272 this->cont3d_ = o.cont3d_;
274 this->zerodim_ = o.zerodim_;
435 return ( (i1.cont3d_ == i2.cont3d_) && (i1.pos_ == i2.pos_)
436 && (i1.zerodim_ == i2.zerodim_) && (i1.xp_ == i2.xp_)
437 && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) );
450 return ( (i1.cont3d_ != i2.cont3d_) || (i1.pos_ != i2.pos_)
451 || (i1.zerodim_ != i2.zerodim_) || (i1.xp_ != i2.xp_)
452 || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_));
471 return ( i1.pos_ < i2.pos_);
532 this->x1_ += d.
dx1();
533 this->x2_ += d.
dx2();
550 this->x1_ -= d.
dx1();
551 this->x2_ -= d.
dx2();
615 return (*cont3d_)[this->xp_][this->x1_+d.
dx1()][this->x2_+d.
dx2()];
617 return (*cont3d_)[this->x1_+d.
dx1()][this->xp_][this->x2_+d.
dx2()];
618 return (*cont3d_)[this->x1_+d.
dx1()][this->x2_+d.
dx2()][this->xp_];
634 return (*cont3d_)[this->xp_+ n];
635 return (*cont3d_)[this->x1_+ n];
682 return this->zerodim_;
690 Container3D* cont3d_;
721 template <
class Container3D>
735 this->pos_ = cont3d_->begin() +
736 (this->xp_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
737 (this->x1_*
int(cont3d_->cols())) + this->x2_;
739 else if(zerodim_ == 1)
741 this->pos_ = cont3d_->begin() +
742 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
743 (this->xp_*
int(cont3d_->cols())) + this->x2_;
747 this->pos_ = cont3d_->begin() +
748 (this->x1_ * int(cont3d_->rows() * int(cont3d_->cols()))) +
749 (this->x2_*
int(cont3d_->cols())) + this->xp_;
758 typedef typename Container3D::pointer
pointer;
760 typedef typename Container3D::const_reference
reference;
775 cont3d_(0),pos_(0),zerodim_(0),xp_(0),x1_(0),x2_(0),box_(0,0,0,0)
791 cont3d_(c),pos_(0),zerodim_(P),xp_(plane_coordinate),x1_(b.upper_left()[0]),x2_(b.upper_left()[1]),box_(b)
806 cont3d_(c),pos_(0),zerodim_(0),xp_(0),x1_(0),x2_(0),box_(0,0,0,0)
809 zerodim_ = ((dim[0] == 0)?0:((dim[1] == 0)?1:((dim[2] == 0)?2:-1)));
810 assert(zerodim_ != -1);
818 else if (zerodim_ == 1)
839 cont3d_(o.cont3d_),pos_(o.pos_),zerodim_(o.zerodim_),xp_(o.xp_),x1_(o.x1_),x2_(o.x2_),box_(o.box_)
861 this->cont3d_ = o.cont3d_;
863 this->zerodim_ = o.zerodim_;
1006 return ( (i1.cont3d_ == i2.cont3d_) && (i1.pos_ == i2.pos_)
1007 && (i1.zerodim_ == i2.zerodim_) && (i1.xp_ == i2.xp_)
1008 && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) );
1021 return ( (i1.cont3d_ != i2.cont3d_) || (i1.pos_ != i2.pos_)
1022 || (i1.zerodim_ != i2.zerodim_) || (i1.xp_ != i2.xp_)
1023 || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_));
1041 return ( i1.pos_ < i2.pos_);
1098 this->x1_ += d.
dx1();
1099 this->x2_ += d.
dx2();
1114 this->x1_ -= d.
dx1();
1115 this->x2_ -= d.
dx2();
1177 return (*cont3d_)[this->xp_][this->x1_+d.
dx1()][this->x2_+d.
dx2()];
1179 return (*cont3d_)[this->x1_+d.
dx1()][this->xp_][this->x2_+d.
dx2()];
1180 return (*cont3d_)[this->x1_+d.
dx1()][this->x2_+d.
dx2()][this->xp_];
1195 return (*cont3d_)[this->xp_+ n];
1196 return (*cont3d_)[this->x1_+ n];
1245 return this->zerodim_;
1253 Container3D* cont3d_;
1265 #endif //SLIP_ITERATOR3D_PLANE_HPP
int xp() const
Access to the plane subscript of the current iterator3d_plane.
const_pointer operator->() const
This is some iterator to iterate a 3d container into a plane area defined by the subscripts of the 3d...
int zerodim() const
Access to the plane axe number of the current iterator3d_plane.
Provides a class to modelize the difference of slip::Point2d.
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
const_iterator3d_plane()
Constructs a const_iterator3d_plane.
self operator++(int)
Postincrement a iterator3d_plane. Iterate to the next location inside the Box3d.
std::random_access_iterator2d_tag iterator_category
self & operator--()
Predecrement a iterator3d_plane. Iterate to the previous location inside the Box3d.
const_iterator3d_plane(Container3D *c, PLANE_ORIENTATION P, const int plane_coordinate, const Box2d< int > &b)
Constructs a iterator3d_plane.
void dx2(const CoordType &dx)
Accessor of the second coordinate of DPoint2d.
int xp() const
Access to the plane subscript of the current const_iterator3d_plane.
self operator+(const difference_type &d)
iterator3d_plane addition.
Container3D::size_type size_type
self & operator+=(const difference_type &d)
iterator3d_plane addition.
Provides a class to manipulate 2d box.
reference operator[](difference_type d) const
const_iterator3d_plane element assignment operator. Equivalent to *(k + d).
self & operator-=(const difference_type &d)
const_iterator3d_plane substraction.
DPoint2d< int > difference_type
Provides a class to tag SLIP iterators.
iterator3d_plane(const self &o)
Constructs a copy of the iterator3d_plane o.
friend bool operator<(const self &i1, const self &i2)
< operator.
friend bool operator<=(const self &i1, const self &i2)
<= operator.
self operator--(int)
Postdecrement a iterator3d_plane. Iterate to the previous location inside the Box3d.
void bottom_right(Point< CoordType, 2 >)
Accessor/Mutator of the bottom_right point (p2) of Box2d.
self operator++(int)
Postincrement a const_iterator3d_plane. Iterate to the next location inside the Box3d.
self & operator++()
Preincrement a const_iterator3d_plane. Iterate to the next location inside the Box3d.
Container3D::value_type value_type
const reference operator*() const
Dereference operator. Returns the element that the current iterator3d_plane i point to...
Container3D::const_reference reference
pointer operator->() const
self operator+(const difference_type &d)
const_iterator3d_plane addition.
PLANE_ORIENTATION
Choose between different plane orientations.
reference operator*() const
Dereference operator. Returns the element that the current const_iterator3d_plane i point to...
void dx1(const CoordType &dx)
Accessor of the first coordinate of DPoint2d.
self & operator--()
Predecrement a const_iterator3d_plane. Iterate to the previous location inside the Box3d...
friend bool operator>=(const self &i1, const self &i2)
>= operator.
self & operator=(const self &o)
Assign a iterator3d_plane.
friend bool operator<(const self &i1, const self &i2)
< operator.
self & operator=(const self &o)
Assign a const_iterator3d_plane.
void front_upper_left(Point< CoordType, 3 >)
Accessor/Mutator of the front_upper_left point (p1) of Box3d.
Provides a class to manipulate 3d box.
iterator3d_plane(Container3D *c, const Box3d< int > &b)
Constructs a iterator3d_plane.
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
Define an abstract DPoint structure.
Container3D::pointer pointer
DPoint2d< int > difference_type
const_pointer * operator[](int n) const
const_iterator3d_plane element assignment operator. Equivalent to *(k + n).
Difference of Point2D class, specialization of DPoint<CoordType,DIM> with DIM = 2.
int x2() const
Access to the first subscript of the current const_iterator3d_plane.
self & operator++()
Preincrement a iterator3d_plane. Iterate to the next location inside the Box3d.
self & operator+=(const difference_type &d)
const_iterator3d_plane addition.
Container3D::size_type size_type
Container3D::pointer pointer
iterator3d_plane(Container3D *c, PLANE_ORIENTATION P, const int plane_coordinate, const Box2d< int > &b)
Constructs a iterator3d_plane.
iterator3d_plane()
Constructs a iterator3d_plane.
friend bool operator==(const self &i1, const self &i2)
Equality operator.
friend bool operator<=(const self &i1, const self &i2)
<= operator.
reference operator*()
Dereference assignment operator. Returns the element that the current iterator3d_plane i point to...
self operator-(const difference_type &d)
iterator3d_plane substraction.
const_iterator3d_plane(const self &o)
Constructs a copy of the const_iterator3d_plane o.
std::random_access_iterator2d_tag iterator_category
void upper_left(Point< CoordType, 2 >)
Accessor/Mutator of the upper_left point (p1) of Box2d.
self & operator-=(const difference_type &d)
iterator3d_plane substraction.
void back_bottom_right(Point< CoordType, 3 >)
Accessor/Mutator of the back_bottom_right point (p2) of Box3d.
friend bool operator>=(const self &i1, const self &i2)
>= operator.
self operator--(int)
Postdecrement a const_iterator3d_plane. Iterate to the previous location inside the Box3d...
friend difference_type operator-(const self &i1, const self &i2)
iterator3d_plane difference operator.
friend bool operator>(const self &i1, const self &i2)
operator.
int x1() const
Access to the first subscript of the current const_iterator3d_plane.
This is some iterator to iterate a 3d container into a plane area defined by the subscripts of the 3d...
Provides a class to modelize 2d points.
const_iterator3d_plane(Container3D *c, const Box3d< int > &b)
Constructs a const_iterator3d_plane.
Container3D::reference reference
self operator-(const difference_type &d)
const_iterator3d_plane substraction.
friend bool operator>(const self &i1, const self &i2)
operator.
Container3D::const_pointer const_pointer
int zerodim() const
Access to the plane axe number of the current const_iterator3d_plane.
friend bool operator==(const self &i1, const self &i2)
Equality operator.
int x1() const
Access to the first subscript of the current iterator3d_plane.
friend difference_type operator-(const self &i1, const self &i2)
const_iterator3d_plane difference operator.
int x2() const
Access to the second subscript of the current iterator3d_plane.
pointer * operator[](int n)
iterator3d_plane element assignment operator. Equivalent to *(k + n).
reference operator[](difference_type d)
iterator3d_plane element assignment operator. Equivalent to *(k + d) = t.
Container3D::value_type value_type
Provides an abstract class to modelize the difference of slip::Point.