Field3D
WritableField< Data_T >::iterator Class Reference

#include <Field.h>

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. More...
 
int y
 
int z
 

Private Attributes

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

Detailed Description

template<class Data_T>
class WritableField< Data_T >::iterator

Definition at line 708 of file Field.h.

Constructor & Destructor Documentation

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

Definition at line 722 of file Field.h.

724  : x(currentPos.x), y(currentPos.y), z(currentPos.z),
725  m_window(window), m_field(field)
726  { }
Box3i m_window
Window to traverse.
Definition: Field.h:774
WritableField< Data_T > & m_field
Reference to field being iterated over.
Definition: Field.h:776
int x
Current position.
Definition: Field.h:767

Member Function Documentation

template<class Data_T>
const iterator& WritableField< Data_T >::iterator::operator++ ( )
inline

Definition at line 730 of file Field.h.

References WritableField< Data_T >::iterator::x.

731  {
732  if (x == m_window.max.x) {
733  if (y == m_window.max.y) {
734  x = m_window.min.x;
735  y = m_window.min.y;
736  ++z;
737  } else {
738  x = m_window.min.x;
739  ++y;
740  }
741  } else {
742  ++x;
743  }
744  return *this;
745  }
Box3i m_window
Window to traverse.
Definition: Field.h:774
int x
Current position.
Definition: Field.h:767
template<class Data_T>
template<class Iter_T >
bool WritableField< Data_T >::iterator::operator== ( const Iter_T &  rhs) const
inline

Definition at line 748 of file Field.h.

749  {
750  return x == rhs.x && y == rhs.y && z == rhs.z;
751  }
int x
Current position.
Definition: Field.h:767
template<class Data_T>
template<class Iter_T >
bool WritableField< Data_T >::iterator::operator!= ( const Iter_T &  rhs) const
inline

Definition at line 754 of file Field.h.

755  {
756  return x != rhs.x || y != rhs.y || z != rhs.z;
757  }
int x
Current position.
Definition: Field.h:767
template<class Data_T>
Data_T& WritableField< Data_T >::iterator::operator* ( ) const
inline

Definition at line 759 of file Field.h.

760  {
761  return m_field.lvalue(x, y, z);
762  }
WritableField< Data_T > & m_field
Reference to field being iterated over.
Definition: Field.h:776
int x
Current position.
Definition: Field.h:767

Member Data Documentation

template<class Data_T>
int WritableField< Data_T >::iterator::x

Current position.

Definition at line 767 of file Field.h.

Referenced by WritableField< Data_T >::iterator::operator++().

template<class Data_T>
int WritableField< Data_T >::iterator::y

Definition at line 767 of file Field.h.

template<class Data_T>
int WritableField< Data_T >::iterator::z

Definition at line 767 of file Field.h.

template<class Data_T>
Box3i WritableField< Data_T >::iterator::m_window
private

Window to traverse.

Definition at line 774 of file Field.h.

template<class Data_T>
WritableField<Data_T>& WritableField< Data_T >::iterator::m_field
private

Reference to field being iterated over.

Definition at line 776 of file Field.h.


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