76 #ifndef SLIP_COMPONENT_ITERATOR3D_BOX_HPP
77 #define SLIP_COMPONENT_ITERATOR3D_BOX_HPP
108 template <
class MultiComponentContainer3D, std::
size_t N>
115 typedef typename MultiComponentContainer3D::value_type
Block;
123 typedef typename MultiComponentContainer3D::size_type
size_type;
134 cont3d_(0),pos_(0),x1_(0),x2_(0),x3_(0),cp_(0),box_(0,0,0,0,0,0)
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)
160 cont3d_(o.cont3d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),x3_(o.x3_),cp_(o.cp_),box_(o.box_)
181 this->cont3d_ = o.cont3d_;
233 this->pos_+= N * (
static_cast<int>(cont3d_->cols()) - box_.
width() + 1) ;
239 this->pos_ += N * (
static_cast<int>(cont3d_->cols())*(static_cast<int>(cont3d_->rows()) -
246 this->pos_ += N * (
static_cast<int>(cont3d_->cols()) * (static_cast<int>(cont3d_->rows())
287 this->pos_ -= N * (
static_cast<int>(cont3d_->cols()) - box_.
width() + 1);
294 this->pos_ -= N * (
static_cast<int>(cont3d_->cols())*(static_cast<int>(cont3d_->rows()) -
301 this->pos_ -= N * (
static_cast<int>(cont3d_->cols()) * (static_cast<int>(cont3d_->rows())
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_));
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_));
376 return ( i1.pos_ < i2.pos_);
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) +
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) +
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_));
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_];
696 MultiComponentContainer3D* cont3d_;
724 template <
class MultiComponentContainer3D, std::
size_t N>
732 typedef typename MultiComponentContainer3D::value_type
Block;
740 typedef typename MultiComponentContainer3D::size_type
size_type;
751 cont3d_(0),pos_(0),x1_(0),x2_(0),x3_(0),cp_(0),box_(0,0,0,0)
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)
777 cont3d_(o.cont3d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),x3_(o.x3_),cp_(o.cp_),box_(o.box_)
798 this->cont3d_ = o.cont3d_;
850 this->pos_ += N * (
static_cast<int>(cont3d_->cols()) - box_.
width() + 1);
856 this->pos_ += N * (
static_cast<int>(cont3d_->cols())*(static_cast<int>(cont3d_->rows()) - box_.
height() + 1)
863 this->pos_ += N * (
static_cast<int>(cont3d_->cols()) * (static_cast<int>(cont3d_->rows()) + 1) + 1);
903 this->pos_ -= N * (
static_cast<int>(cont3d_->cols()) - box_.
width() + 1);
910 this->pos_ -= N * (
static_cast<int>(cont3d_->cols())*(static_cast<int>(cont3d_->rows()) - box_.
height() + 1)
917 this->pos_ -= N * (
static_cast<int>(cont3d_->cols()) * (static_cast<int>(cont3d_->rows()) + 1) + 1);
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_));
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_));
991 return ( i1.pos_ < i2.pos_);
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) +
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) +
1125 return difference_type(
int(i1.x1_ - i2.x1_),
int(i1.x2_ - i2.x2_),
int(i1.x3_ - i2.x3_));
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_];
1312 MultiComponentContainer3D* cont3d_;
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.
CoordType width() const
compute the width of the Box3d.
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 ...
DPoint3d< int > difference_type
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
Block::value_type value_type
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.
DPoint3d< int > difference_type
pointer operator->() const
value_type const * pointer
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.
value_type const & reference
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.
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.
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.
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.
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.
Block::value_type value_type
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.
CoordType height() const
compute the height of the Box3d.
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.