DenseField< Data_T >::const_iterator Class Reference

`#include <DenseField.h>`

## Public Types

typedef DenseField< Data_T > | class_type

## Public Member Functions

| const_iterator (const class_type &field, const Box3i &window, const V3i &currentPos)
template<class Iter_T>
bool | operator!= (const Iter_T &rhs) const
const Data_T & | operator* () const
const const_iterator & | operator++ ()
const Data_T * | operator-> () const
template<class Iter_T>
bool | operator== (const Iter_T &rhs) const

## Public Attributes

int | x
| Current position.
int | y
int | z

## Private Attributes

const class_type & | m_field
| Reference to field being iterated over.
const Data_T * | m_p
| Pointer to current element.
Box3i | m_window
| Window to traverse.

## Detailed Description

template<class Data_T>
class DenseField< Data_T >::const_iterator

Definition at line 257 of file DenseField.h.

## Member Typedef Documentation

## class_type

template<class Data_T>

typedef DenseField<Data_T> DenseField< Data_T >::const_iterator::class_type

Definition at line 271 of file DenseField.h.

## Constructor & Destructor Documentation

## const_iterator()

template<class Data_T>

DenseField< Data_T >::const_iterator::const_iterator | ( | const class_type & | field,
|  | const Box3i & | window,
|  | const V3i & | currentPos )

inline

Definition at line 275 of file DenseField.h.

: x(currentPos.x), y(currentPos.y), z(currentPos.z),
m_window(window), m_field(field)
{
if (window.intersects(currentPos))
m_p = m_field.ptr(x, y, z);
else
m_p = 0;
}
DenseField::const_iterator::x
int x
Current position.
Definition DenseField.h:332
DenseField::const_iterator::m_p
const Data_T * m_p
Pointer to current element.
Definition DenseField.h:339
DenseField::const_iterator::m_field
const class_type & m_field
Reference to field being iterated over.
Definition DenseField.h:343
DenseField::const_iterator::m_window
Box3i m_window
Window to traverse.
Definition DenseField.h:341
DenseField::const_iterator::y
int y
Definition DenseField.h:332
DenseField::const_iterator::z
int z
Definition DenseField.h:332
DenseField
This subclass of Field stores data in a contiguous std::vector.
Definition DenseField.h:87

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

Referenced by operator++().

## Member Function Documentation

## operator++()

template<class Data_T>

const const_iterator & DenseField< Data_T >::const_iterator::operator++ | ( |  | ) |

inline

Definition at line 288 of file DenseField.h.

{
if (x == m_window.max.x) {
if (y == m_window.max.y) {
if (z == m_window.max.z) {
m_p = 0;
} else {
m_p = m_field.ptr(x = m_window.min.x, y = m_window.min.y, ++z);
}
} else {
m_p = m_field.ptr(x = m_window.min.x, ++y, z);
}
} else {
++x;
++m_p;
}
return *this;
}

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

## operator==()

template<class Data_T>
template<class Iter_T>

bool DenseField< Data_T >::const_iterator::operator== | ( | const Iter_T & | rhs | ) | const

inline

Definition at line 308 of file DenseField.h.

{
return m_p == &(*rhs);
}

References m_p.

## operator!=()

template<class Data_T>
template<class Iter_T>

bool DenseField< Data_T >::const_iterator::operator!= | ( | const Iter_T & | rhs | ) | const

inline

Definition at line 314 of file DenseField.h.

{
return m_p != &(*rhs);
}

References m_p.

## operator*()

template<class Data_T>

const Data_T & DenseField< Data_T >::const_iterator::operator* | ( |  | ) | const

inline

Definition at line 319 of file DenseField.h.

{
return *m_p;
}

References m_p.

## operator->()

template<class Data_T>

const Data_T * DenseField< Data_T >::const_iterator::operator-> | ( |  | ) | const

inline

Definition at line 324 of file DenseField.h.

{
return m_p;
}

References m_p.

## Member Data Documentation

## x

template<class Data_T>

int DenseField< Data_T >::const_iterator::x

Current position.

Definition at line 332 of file DenseField.h.

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

## y

template<class Data_T>

int DenseField< Data_T >::const_iterator::y

Definition at line 332 of file DenseField.h.

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

## z

template<class Data_T>

int DenseField< Data_T >::const_iterator::z

Definition at line 332 of file DenseField.h.

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

## m_p

template<class Data_T>

const Data_T* DenseField< Data_T >::const_iterator::m_p

private

Pointer to current element.

Definition at line 339 of file DenseField.h.

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

## m_window

template<class Data_T>

Box3i DenseField< Data_T >::const_iterator::m_window

private

Window to traverse.

Definition at line 341 of file DenseField.h.

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

## m_field

template<class Data_T>

const class_type& DenseField< Data_T >::const_iterator::m_field

private

Reference to field being iterated over.

Definition at line 343 of file DenseField.h.

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

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

- export/DenseField.h