Field3D
WritableField::iterator Class Reference

#include <Field.h>

List of all members.

Public Member Functions

 iterator (WritableField< Data_T > &field, const Box3i &window, const V3i &currentPos)
template<class Iter_T >
bool operator!= (const Iter_T &rhs) const
Data_T & operator* () const
const iteratoroperator++ ()
template<class Iter_T >
bool operator== (const Iter_T &rhs) const

Public Attributes

int x
 Current position.
int y
int z

Private Attributes

WritableField< Data_T > & m_field
 Reference to field being iterated over.
Box3i m_window
 Window to traverse.

Constructor & Destructor Documentation

WritableField::iterator::iterator ( WritableField< Data_T > &  field,
const Box3i window,
const V3i currentPos 
) [inline]

Definition at line 725 of file Field.h.

    : x(currentPos.x), y(currentPos.y), z(currentPos.z), 
      m_window(window), m_field(field)
  { }

Member Function Documentation

const iterator& WritableField::iterator::operator++ ( ) [inline]

Definition at line 733 of file Field.h.

References x.

  {
    if (x == m_window.max.x) {
      if (y == m_window.max.y) {
        x = m_window.min.x;
        y = m_window.min.y;
        ++z;
      } else {
        x = m_window.min.x;
        ++y;
      }
    } else {
      ++x;
    }
    return *this;
  }
template<class Iter_T >
bool WritableField::iterator::operator== ( const Iter_T &  rhs) const [inline]

Definition at line 751 of file Field.h.

  {
    return x == rhs.x && y == rhs.y && z == rhs.z;
  }
template<class Iter_T >
bool WritableField::iterator::operator!= ( const Iter_T &  rhs) const [inline]

Definition at line 757 of file Field.h.

  {
    return x != rhs.x || y != rhs.y || z != rhs.z;
  }
Data_T& WritableField::iterator::operator* ( ) const [inline]

Definition at line 762 of file Field.h.

  {
    return m_field.lvalue(x, y, z);
  }

Member Data Documentation

Current position.

Definition at line 770 of file Field.h.

Referenced by operator++().

Definition at line 770 of file Field.h.

Definition at line 770 of file Field.h.

Window to traverse.

Definition at line 777 of file Field.h.

Reference to field being iterated over.

Definition at line 779 of file Field.h.


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