Field3D
MACField< Data_T >::const_mac_comp_iterator Class Reference

#include <MACField.h>

Public Types

typedef MACField< Data_T > class_type
 
typedef MACField< Data_T >::real_t real_t
 

Public Member Functions

 const_mac_comp_iterator (MACComponent comp, const class_type &field, const Box3i &window, const V3i &currentPos)
 
template<class Iter_T >
bool operator!= (const Iter_T &rhs) const
 
const real_toperator* () const
 
const const_mac_comp_iteratoroperator++ ()
 
const real_toperator-> () const
 
template<class Iter_T >
bool operator== (const Iter_T &rhs) const
 

Public Attributes

int x
 Current position. More...
 
int y
 
int z
 

Private Member Functions

void updatePointer ()
 

Private Attributes

MACComponent m_comp
 Component to look up. More...
 
const class_typem_field
 Reference to field being iterated over. More...
 
const real_tm_p
 Pointer to current element. More...
 
Box3i m_window
 Window to traverse. More...
 

Detailed Description

template<class Data_T>
class MACField< Data_T >::const_mac_comp_iterator

Definition at line 360 of file MACField.h.

Member Typedef Documentation

template<class Data_T>
typedef MACField<Data_T> MACField< Data_T >::const_mac_comp_iterator::class_type

Definition at line 366 of file MACField.h.

template<class Data_T>
typedef MACField<Data_T>::real_t MACField< Data_T >::const_mac_comp_iterator::real_t

Definition at line 367 of file MACField.h.

Constructor & Destructor Documentation

template<class Data_T>
MACField< Data_T >::const_mac_comp_iterator::const_mac_comp_iterator ( MACComponent  comp,
const class_type field,
const Box3i window,
const V3i currentPos 
)
inline

Definition at line 371 of file MACField.h.

375  : x(currentPos.x), y(currentPos.y), z(currentPos.z),
376  m_p(NULL), m_window(window), m_comp(comp),
377  m_field(field)
378  {
379  updatePointer();
380  }

Member Function Documentation

template<class Data_T>
const const_mac_comp_iterator& MACField< Data_T >::const_mac_comp_iterator::operator++ ( )
inline

Definition at line 384 of file MACField.h.

References MACField< Data_T >::const_mac_comp_iterator::x.

385  {
386  if (x == m_window.max.x) {
387  if (y == m_window.max.y) {
388  x = m_window.min.x;
389  y = m_window.min.y;
390  ++z;
391  } else {
392  x = m_window.min.x;
393  ++y;
394  }
395  updatePointer();
396  } else {
397  ++x;
398  ++m_p;
399  }
400  return *this;
401  }
template<class Data_T>
template<class Iter_T >
bool MACField< Data_T >::const_mac_comp_iterator::operator== ( const Iter_T &  rhs) const
inline

Definition at line 404 of file MACField.h.

405  {
406  return m_p == &(*rhs);
407  }
template<class Data_T>
template<class Iter_T >
bool MACField< Data_T >::const_mac_comp_iterator::operator!= ( const Iter_T &  rhs) const
inline

Definition at line 410 of file MACField.h.

411  {
412  return m_p != &(*rhs);
413  }
template<class Data_T>
const real_t& MACField< Data_T >::const_mac_comp_iterator::operator* ( ) const
inline

Definition at line 415 of file MACField.h.

416  {
417  return *m_p;
418  }
template<class Data_T>
const real_t* MACField< Data_T >::const_mac_comp_iterator::operator-> ( ) const
inline

Definition at line 420 of file MACField.h.

421  {
422  return m_p;
423  }
template<class Data_T>
void MACField< Data_T >::const_mac_comp_iterator::updatePointer ( )
inlineprivate

Definition at line 434 of file MACField.h.

References MACCompU, MACCompV, and MACCompW.

435  {
436  switch (m_comp) {
437  case MACCompU:
438  m_p = m_field.uPtr(x, y, z);
439  break;
440  case MACCompV:
441  m_p = m_field.vPtr(x, y, z);
442  break;
443  case MACCompW:
444  m_p = m_field.wPtr(x, y, z);
445  break;
446  default:
447  assert(false && "Illegal MACComponent in const_mac_comp_iterator");
448  }
449  }

Member Data Documentation

template<class Data_T>
int MACField< Data_T >::const_mac_comp_iterator::x

Current position.

Definition at line 428 of file MACField.h.

Referenced by MACField< Data_T >::const_mac_comp_iterator::operator++().

template<class Data_T>
int MACField< Data_T >::const_mac_comp_iterator::y

Definition at line 428 of file MACField.h.

template<class Data_T>
int MACField< Data_T >::const_mac_comp_iterator::z

Definition at line 428 of file MACField.h.

template<class Data_T>
const real_t* MACField< Data_T >::const_mac_comp_iterator::m_p
private

Pointer to current element.

Definition at line 454 of file MACField.h.

template<class Data_T>
Box3i MACField< Data_T >::const_mac_comp_iterator::m_window
private

Window to traverse.

Definition at line 456 of file MACField.h.

template<class Data_T>
MACComponent MACField< Data_T >::const_mac_comp_iterator::m_comp
private

Component to look up.

Definition at line 458 of file MACField.h.

template<class Data_T>
const class_type& MACField< Data_T >::const_mac_comp_iterator::m_field
private

Reference to field being iterated over.

Definition at line 460 of file MACField.h.


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