Field3D
Field< Data_T >::const_iterator Class Reference

#include <Field.h>

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 491 of file Field.h.

Constructor & Destructor Documentation

◆ const_iterator() [1/2]

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

Definition at line 506 of file Field.h.

507 : x(i.x), y(i.y), z(i.z),
508 m_window(i.m_window), m_field(i.m_field)
509 { }
int x
Current position.
Definition Field.h:552
const Field< Data_T > & m_field
Reference to field being iterated over.
Definition Field.h:561
Box3i m_window
Window to traverse.
Definition Field.h:559
Definition Field.h:390

References const_iterator(), m_field, m_window, x, y, and z.

Referenced by const_iterator(), and operator++().

◆ const_iterator() [2/2]

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 511 of file Field.h.

513 : x(currentPos.x), y(currentPos.y), z(currentPos.z),
515 { }

References m_field, m_window, x, y, and z.

Member Function Documentation

◆ operator++()

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

Definition at line 519 of file Field.h.

520 {
521 if (x == m_window.max.x) {
522 if (y == m_window.max.y) {
523 x = m_window.min.x;
524 y = m_window.min.y;
525 ++z;
526 } else {
527 x = m_window.min.x;
528 ++y;
529 }
530 } else {
531 ++x;
532 }
533 return *this;
534 }

References const_iterator(), m_window, x, y, and z.

◆ operator==()

template<class Data_T>
template<class Iter_T>
bool Field< Data_T >::const_iterator::operator== ( const Iter_T & rhs) const
inline

Definition at line 536 of file Field.h.

537 {
538 return x == rhs.x && y == rhs.y && z == rhs.z;
539 }

References x, y, and z.

◆ operator!=()

template<class Data_T>
template<class Iter_T>
bool Field< Data_T >::const_iterator::operator!= ( const Iter_T & rhs) const
inline

Definition at line 541 of file Field.h.

542 {
543 return x != rhs.x || y != rhs.y || z != rhs.z;
544 }

References x, y, and z.

◆ operator*()

template<class Data_T>
Data_T Field< Data_T >::const_iterator::operator* ( ) const
inline

Definition at line 545 of file Field.h.

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

References m_field, x, y, and z.

Member Data Documentation

◆ x

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

Current position.

Definition at line 552 of file Field.h.

Referenced by const_iterator(), const_iterator(), operator!=(), operator*(), operator++(), and operator==().

◆ y

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

Definition at line 552 of file Field.h.

Referenced by const_iterator(), const_iterator(), operator!=(), operator*(), operator++(), and operator==().

◆ z

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

Definition at line 552 of file Field.h.

Referenced by const_iterator(), const_iterator(), operator!=(), operator*(), operator++(), and operator==().

◆ m_window

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

Window to traverse.

Definition at line 559 of file Field.h.

Referenced by const_iterator(), const_iterator(), and operator++().

◆ m_field

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 561 of file Field.h.

Referenced by const_iterator(), const_iterator(), and operator*().


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