Field3D
Field< Data_T >::const_iterator Class Reference

#include <Field.h>

List of all members.

Public Member Functions

 const_iterator (const const_iterator &i)
 const_iterator (const Field< 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 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

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

Detailed Description

template<class Data_T>
class Field< Data_T >::const_iterator

Definition at line 517 of file Field.h.


Constructor & Destructor Documentation

template<class Data_T>
Field< Data_T >::const_iterator::const_iterator ( const const_iterator i) [inline]

Definition at line 524 of file Field.h.

    :  x(i.x), y(i.y), z(i.z), 
       m_window(i.m_window), m_field(i.m_field) 
  { }
template<class Data_T>
Field< Data_T >::const_iterator::const_iterator ( const Field< Data_T > &  field,
const Box3i window,
const V3i currentPos 
) [inline]

Definition at line 529 of file Field.h.

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

Member Function Documentation

template<class Data_T>
const const_iterator& Field< Data_T >::const_iterator::operator++ ( ) [inline]

Definition at line 537 of file Field.h.

References Field< Data_T >::const_iterator::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 Data_T>
template<class Iter_T >
bool Field< Data_T >::const_iterator::operator== ( const Iter_T &  rhs) const [inline]

Definition at line 554 of file Field.h.

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

Definition at line 559 of file Field.h.

  {
    return x != rhs.x || y != rhs.y || z != rhs.z;
  }
template<class Data_T>
Data_T Field< Data_T >::const_iterator::operator* ( ) const [inline]

Definition at line 563 of file Field.h.

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

Member Data Documentation

template<class Data_T>
int Field< Data_T >::const_iterator::x

Current position.

Definition at line 570 of file Field.h.

Referenced by SparseField< Data_T >::const_iterator::operator++(), and Field< Data_T >::const_iterator::operator++().

template<class Data_T>
int Field< Data_T >::const_iterator::y

Definition at line 570 of file Field.h.

template<class Data_T>
int Field< Data_T >::const_iterator::z

Definition at line 570 of file Field.h.

template<class Data_T>
Box3i Field< Data_T >::const_iterator::m_window [private]

Window to traverse.

Definition at line 577 of file Field.h.

template<class Data_T>
const Field<Data_T>& Field< Data_T >::const_iterator::m_field [private]

Reference to field being iterated over.

Definition at line 579 of file Field.h.


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