SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
slip::iterator3d_box< T > Class Template Reference

This is some iterator to iterate a 3d container into a Box area defined by the subscripts of the 3d container. More...

#include <DenseVector3dField3d.hpp>

Public Types

typedef
std::random_access_iterator3d_tag 
iterator_category
 
typedef Container3D::value_type value_type
 
typedef DPoint3d< int > difference_type
 
typedef DPoint2d< int > diff2d
 
typedef Container3D::pointer pointer
 
typedef Container3D::reference reference
 
typedef iterator3d_box self
 
typedef Container3D::size_type size_type
 

Public Member Functions

reference operator* ()
 Dereference assignment operator. Returns the element that the current iterator3d_box i point to. More...
 
const reference operator* () const
 Dereference operator. Returns the element that the current iterator3d_box i point to. More...
 
pointer operator-> () const
 
pointer operator-> ()
 
Constructors & Destructors
 iterator3d_box ()
 Constructs a iterator3d_box. More...
 
 iterator3d_box (Container3D *c, const Box3d< int > &b)
 Constructs a iterator3d_box. More...
 
 iterator3d_box (const self &o)
 Constructs a copy of the iterator3d_box o. More...
 
Assignment operators and methods
selfoperator= (const self &o)
 Assign a iterator3d_box. More...
 
Forward operators addons
selfoperator++ ()
 Preincrement a iterator3d_box. Iterate to the next location inside the Box3d. More...
 
self operator++ (int)
 Postincrement a iterator3d_box. Iterate to the next location inside the Box3d. More...
 
Bidirectional operators addons
selfoperator-- ()
 Predecrement a iterator3d_box. Iterate to the previous location inside the Box3d. More...
 
self operator-- (int)
 Postdecrement a iterator3d_box. Iterate to the previous location inside the Box3d. More...
 
Subscripts accessors
int x1 () const
 Access to the first subscript of the current iterator3d_box. More...
 
int k () const
 Access to the first subscript of the current iterator3d_box. More...
 
int x2 () const
 Access to the second subscript of the current iterator3d_box. More...
 
int i () const
 Access to the first subscript of the current iterator3d_box. More...
 
int x3 () const
 Access to the second subscript of the current iterator3d_box. More...
 
int j () const
 Access to the second subscript of the current iterator3d_box. More...
 

Friends

Equality comparable operators
bool operator== (const self &i1, const self &i2)
 Equality operator. More...
 
bool operator!= (const self &i1, const self &i2)
 Inequality operator. More...
 
Strict Weakly comparable operators
bool operator< (const self &i1, const self &i2)
 < operator. More...
 
bool operator> (const self &i1, const self &i2)
 

operator.

More...
 
bool operator<= (const self &i1, const self &i2)
 <= operator. More...
 
bool operator>= (const self &i1, const self &i2)
 >= operator. More...
 

iterator3d_box operators addons

selfoperator+= (const difference_type &d)
 iterator3d_box addition. More...
 
selfoperator-= (const difference_type &d)
 iterator3d_box substraction. More...
 
self operator+ (const difference_type &d)
 iterator3d_box addition. More...
 
self operator- (const difference_type &d)
 iterator3d_box substraction. More...
 
reference operator[] (difference_type d)
 iterator3d_box element assignment operator. Equivalent to *(k + d) = t. More...
 
pointer operator[] (diff2d d)
 iterator3d_box element assignment operator. Equivalent to *(k + d) = t. More...
 
pointeroperator[] (int n)
 iterator3d_box element assignment operator. Equivalent to *(k + n). More...
 
const pointeroperator[] (int n) const
 iterator3d_box element assignment operator. Equivalent to *(k + n). More...
 
Container3D::slice_iterator slice_begin (size_type row, size_type col)
 iterator3d_box element assignment operator. More...
 
Container3D::slice_iterator slice_end (size_type row, size_type col)
 iterator3d_box element assignment operator. More...
 
Container3D::row_iterator row_begin (size_type slice, size_type row)
 iterator3d_box element assignment operator. More...
 
Container3D::row_iterator row_end (size_type slice, size_type row)
 iterator3d_box element assignment operator. More...
 
Container3D::col_iterator col_begin (size_type slice, size_type col)
 iterator3d_box element assignment operator. More...
 
Container3D::col_iterator col_end (size_type slice, size_type col)
 iterator3d_box element assignment operator. More...
 
Container3D::iterator2d plane_upper_left (const slip::PLANE_ORIENTATION p, const size_type xp)
 iterator3d_box element assignment operator. More...
 
Container3D::iterator2d plane_bottom_right (const slip::PLANE_ORIENTATION p, const size_type xp)
 iterator3d_box element assignment operator. More...
 
difference_type operator- (const self &i1, const self &i2)
 iterator3d_box difference operator. More...
 

Detailed Description

template<class T>
class slip::iterator3d_box< T >

This is some iterator to iterate a 3d container into a Box area defined by the subscripts of the 3d container.

Author
Denis Arrivault <arrivault_AT_sic.univ-poitiers.fr>
Version
0.0.1
Date
2007/12/10
Parameters
Container3DType of 3d container in the iterator3d_box
Description:
This iterator is an 3d extension of the random_access_iterator. It is compatible with the bidirectional_iterator of the Standard library. It iterate into a box area defined inside the subscripts range of the 3d container. Those subscripts are defined as follows :
iterator3d_conventions.jpg
axis and notation conventions

Definition at line 110 of file DenseVector3dField3d.hpp.

Member Typedef Documentation

template<class T >
typedef DPoint2d<int> slip::iterator3d_box< T >::diff2d

Definition at line 119 of file iterator3d_box.hpp.

template<class T >
typedef DPoint3d<int> slip::iterator3d_box< T >::difference_type

Definition at line 118 of file iterator3d_box.hpp.

Definition at line 116 of file iterator3d_box.hpp.

template<class T >
typedef Container3D::pointer slip::iterator3d_box< T >::pointer

Definition at line 120 of file iterator3d_box.hpp.

template<class T >
typedef Container3D::reference slip::iterator3d_box< T >::reference

Definition at line 121 of file iterator3d_box.hpp.

template<class T >
typedef iterator3d_box slip::iterator3d_box< T >::self

Definition at line 123 of file iterator3d_box.hpp.

template<class T >
typedef Container3D::size_type slip::iterator3d_box< T >::size_type

Definition at line 124 of file iterator3d_box.hpp.

template<class T >
typedef Container3D::value_type slip::iterator3d_box< T >::value_type

Definition at line 117 of file iterator3d_box.hpp.

Constructor & Destructor Documentation

template<class T >
slip::iterator3d_box< T >::iterator3d_box ( )
inline

Constructs a iterator3d_box.

The box to iterate is in this case the full container

Definition at line 135 of file iterator3d_box.hpp.

template<class T >
slip::iterator3d_box< T >::iterator3d_box ( Container3D *  c,
const Box3d< int > &  b 
)
inline

Constructs a iterator3d_box.

Parameters
cpointer to an existing 3d container
bBox3d<int> defining the range of subscripts to iterate
Precondition
box subscripts must be inside those of the 3d container

Definition at line 145 of file iterator3d_box.hpp.

template<class T >
slip::iterator3d_box< T >::iterator3d_box ( const self o)
inline

Constructs a copy of the iterator3d_box o.

Parameters
oiterator3d_box to copy.

Definition at line 155 of file iterator3d_box.hpp.

Member Function Documentation

template<class T >
Container3D::col_iterator slip::iterator3d_box< T >::col_begin ( size_type  slice,
size_type  col 
)
inline

iterator3d_box element assignment operator.

Parameters
sliceslice offset.
colcol offset.
Returns
a col_iterator to the first element of the col col and slice of the box
Todo:
add assert

Definition at line 665 of file iterator3d_box.hpp.

template<class T >
Container3D::col_iterator slip::iterator3d_box< T >::col_end ( size_type  slice,
size_type  col 
)
inline

iterator3d_box element assignment operator.

Parameters
sliceslice offset.
colcol offset.
Returns
a col_iterator to the first element of the col col and slice of the box
Todo:
add assert

Definition at line 679 of file iterator3d_box.hpp.

template<class T >
int slip::iterator3d_box< T >::i ( ) const
inline

Access to the first subscript of the current iterator3d_box.

Returns
the second subscript.

Definition at line 776 of file iterator3d_box.hpp.

template<class T >
int slip::iterator3d_box< T >::j ( ) const
inline

Access to the second subscript of the current iterator3d_box.

Returns
the third subscript.

Definition at line 794 of file iterator3d_box.hpp.

template<class T >
int slip::iterator3d_box< T >::k ( ) const
inline

Access to the first subscript of the current iterator3d_box.

Returns
the first subscript.

Definition at line 758 of file iterator3d_box.hpp.

template<class T >
reference slip::iterator3d_box< T >::operator* ( )
inline

Dereference assignment operator. Returns the element that the current iterator3d_box i point to.

Returns
a iterator3d_box reference.

Definition at line 195 of file iterator3d_box.hpp.

template<class T >
const reference slip::iterator3d_box< T >::operator* ( ) const
inline

Dereference operator. Returns the element that the current iterator3d_box i point to.

Returns
a const iterator3d_box reference.

Definition at line 209 of file iterator3d_box.hpp.

template<class T >
self slip::iterator3d_box< T >::operator+ ( const difference_type d)
inline

iterator3d_box addition.

Parameters
ddifference_type
Returns
a iterator3d_box reference
Precondition
All the iterators between the current iterator i and i + d must be dereferenceable.

Definition at line 502 of file iterator3d_box.hpp.

template<class T >
self& slip::iterator3d_box< T >::operator++ ( )
inline

Preincrement a iterator3d_box. Iterate to the next location inside the Box3d.

Definition at line 238 of file iterator3d_box.hpp.

template<class T >
self slip::iterator3d_box< T >::operator++ ( int  )
inline

Postincrement a iterator3d_box. Iterate to the next location inside the Box3d.

Definition at line 280 of file iterator3d_box.hpp.

template<class T >
self& slip::iterator3d_box< T >::operator+= ( const difference_type d)
inline

iterator3d_box addition.

Parameters
ddifference_type
Returns
a iterator3d_box reference
Precondition
All the iterators between the current iterator i and i + d must be dereferenceable.

Definition at line 460 of file iterator3d_box.hpp.

template<class T >
self slip::iterator3d_box< T >::operator- ( const difference_type d)
inline

iterator3d_box substraction.

Parameters
ddifference_type
Returns
a iterator3d_box reference
Precondition
All the iterators between the current iterator i and i - d must be dereferenceable.

Definition at line 517 of file iterator3d_box.hpp.

template<class T >
self& slip::iterator3d_box< T >::operator-- ( )
inline

Predecrement a iterator3d_box. Iterate to the previous location inside the Box3d.

Definition at line 299 of file iterator3d_box.hpp.

template<class T >
self slip::iterator3d_box< T >::operator-- ( int  )
inline

Postdecrement a iterator3d_box. Iterate to the previous location inside the Box3d.

Definition at line 342 of file iterator3d_box.hpp.

template<class T >
self& slip::iterator3d_box< T >::operator-= ( const difference_type d)
inline

iterator3d_box substraction.

Parameters
ddifference_type
Returns
a iterator3d_box reference
Precondition
All the iterators between the current iterator i and i - d must be dereferenceable.

Definition at line 481 of file iterator3d_box.hpp.

template<class T >
pointer slip::iterator3d_box< T >::operator-> ( ) const
inline

Definition at line 216 of file iterator3d_box.hpp.

template<class T >
pointer slip::iterator3d_box< T >::operator-> ( )
inline

Definition at line 222 of file iterator3d_box.hpp.

template<class T >
self& slip::iterator3d_box< T >::operator= ( const self o)
inline

Assign a iterator3d_box.

Assign elements of iterator3d_box in o.

Parameters
oiterator3d_box to get the values from.
Returns
a iterator3d_box reference.

Definition at line 173 of file iterator3d_box.hpp.

template<class T >
reference slip::iterator3d_box< T >::operator[] ( difference_type  d)
inline

iterator3d_box element assignment operator. Equivalent to *(k + d) = t.

Parameters
ddifference_type.
Returns
a reference to the 3d container elements
Precondition
(k + d) exists and is dereferenceable.
Postcondition
k[d] is a copy of reference.

Definition at line 548 of file iterator3d_box.hpp.

template<class T >
pointer slip::iterator3d_box< T >::operator[] ( diff2d  d)
inline

iterator3d_box element assignment operator. Equivalent to *(k + d) = t.

Parameters
doffset.
Returns
a pointer to the 3d container elements
Precondition
(k + d) exists and is dereferenceable.
Postcondition
k[d] is a copy of pointer.
Todo:
add assert

Definition at line 563 of file iterator3d_box.hpp.

template<class T >
pointer* slip::iterator3d_box< T >::operator[] ( int  n)
inline

iterator3d_box element assignment operator. Equivalent to *(k + n).

Parameters
noffset.
Returns
a pointer of pointer to the 3d container elements
Precondition
(k + n) exists and is dereferenceable.
Postcondition
k[n] is a copy of pointer of pointer.
Todo:
add assert

Definition at line 578 of file iterator3d_box.hpp.

template<class T >
const pointer* slip::iterator3d_box< T >::operator[] ( int  n) const
inline

iterator3d_box element assignment operator. Equivalent to *(k + n).

Parameters
noffset.
Returns
a const pointer of pointer to the 3d container elements
Precondition
(k + n) exists and is dereferenceable.
Todo:
add assert

Definition at line 594 of file iterator3d_box.hpp.

template<class T >
Container3D::iterator2d slip::iterator3d_box< T >::plane_bottom_right ( const slip::PLANE_ORIENTATION  p,
const size_type  xp 
)
inline

iterator3d_box element assignment operator.

Parameters
pThe index of the plane axe (axe of the constant component).
xpThe constant coordinate within the box
Returns
an iterator2d that points to the past the end element of the plane in the box.
Todo:
add assert

Definition at line 719 of file iterator3d_box.hpp.

template<class T >
Container3D::iterator2d slip::iterator3d_box< T >::plane_upper_left ( const slip::PLANE_ORIENTATION  p,
const size_type  xp 
)
inline

iterator3d_box element assignment operator.

Parameters
pThe index of the plane axe (axe of the constant component).
xpThe constant coordinate within the box
Returns
an iterator2d that points to the first element of the plane in the box. It points to the upper left element of the plane
Todo:
add assert

Definition at line 694 of file iterator3d_box.hpp.

template<class T >
Container3D::row_iterator slip::iterator3d_box< T >::row_begin ( size_type  slice,
size_type  row 
)
inline

iterator3d_box element assignment operator.

Parameters
sliceslice offset.
rowoffset.
Returns
a row_iterator to the first element of the row row and slice of the box
Todo:
add assert

Definition at line 637 of file iterator3d_box.hpp.

template<class T >
Container3D::row_iterator slip::iterator3d_box< T >::row_end ( size_type  slice,
size_type  row 
)
inline

iterator3d_box element assignment operator.

Parameters
sliceslice offset.
rowoffset.
Returns
a row_iterator to the past-the-end element of the row row and slice of the box
Todo:
add assert

Definition at line 651 of file iterator3d_box.hpp.

template<class T >
Container3D::slice_iterator slip::iterator3d_box< T >::slice_begin ( size_type  row,
size_type  col 
)
inline

iterator3d_box element assignment operator.

Parameters
rowoffset.
coloffset
Returns
a slice_iterator to the first element of the line (row,col) threw the slices in the box.
Todo:
add assert

Definition at line 608 of file iterator3d_box.hpp.

template<class T >
Container3D::slice_iterator slip::iterator3d_box< T >::slice_end ( size_type  row,
size_type  col 
)
inline

iterator3d_box element assignment operator.

Parameters
rowrow offset.
colcol offset.
Returns
a slice_iterator to the last element of line (row,col) threw the slices in the box.
Todo:
add assert

Definition at line 622 of file iterator3d_box.hpp.

template<class T >
int slip::iterator3d_box< T >::x1 ( ) const
inline

Access to the first subscript of the current iterator3d_box.

Returns
the first subscript.

Definition at line 749 of file iterator3d_box.hpp.

template<class T >
int slip::iterator3d_box< T >::x2 ( ) const
inline

Access to the second subscript of the current iterator3d_box.

Returns
the second subscript.

Definition at line 767 of file iterator3d_box.hpp.

template<class T >
int slip::iterator3d_box< T >::x3 ( ) const
inline

Access to the second subscript of the current iterator3d_box.

Returns
the third subscript.

Definition at line 785 of file iterator3d_box.hpp.

Friends And Related Function Documentation

template<class T >
bool operator!= ( const self i1,
const self i2 
)
friend

Inequality operator.

Parameters
i1first iterator3d_box.
i2second iterator3d_box.
Returns
true if !(i1 == i2)

Definition at line 378 of file iterator3d_box.hpp.

template<class T >
difference_type operator- ( const self i1,
const self i2 
)
friend

iterator3d_box difference operator.

Parameters
i1first iterator3d_box.
i2second iterator3d_box.
Returns
a difference_type d such that i1 = i2 + d.
Precondition
Either i1 is reachable from i2, or i2 is reachable from i1.

Definition at line 532 of file iterator3d_box.hpp.

template<class T >
bool operator< ( const self i1,
const self i2 
)
friend

< operator.

Parameters
i1first iterator3d_box.
i2second iterator3d_box.
Returns
true i1.pos_ < i2_pos

Definition at line 397 of file iterator3d_box.hpp.

template<class T >
bool operator<= ( const self i1,
const self i2 
)
friend

<= operator.

Parameters
i1first iterator3d_box.
i2second iterator3d_box.
Returns
true if !(i2 < i1)

Definition at line 425 of file iterator3d_box.hpp.

template<class T >
bool operator== ( const self i1,
const self i2 
)
friend

Equality operator.

Parameters
i1first iterator3d_box.
i2second iterator3d_box.
Returns
true if i1 and i2 point to the same element of the 3d container

Definition at line 363 of file iterator3d_box.hpp.

template<class T >
bool operator> ( const self i1,
const self i2 
)
friend

operator.

Parameters
i1first iterator3d_box.
i2second iterator3d_box.
Returns
true i2 < i1

Definition at line 411 of file iterator3d_box.hpp.

template<class T >
bool operator>= ( const self i1,
const self i2 
)
friend

>= operator.

Parameters
i1first iterator3d_box.
i2second iterator3d_box.
Returns
true if !(i1 < i2)

Definition at line 439 of file iterator3d_box.hpp.


The documentation for this class was generated from the following files: