ExtentIterator Class Reference

Extent iterator. More...

#include <extent_iterator.hh>

Public Member Functions

 ExtentIterator (const Extent &b, unsigned int domain=SPATIAL)
 ExtentIterator (const ExtentIterator &i)
ExtentIteratoroperator= (const ExtentIterator &p)
ExtentIteratoroperator++ ()
ExtentIterator operator++ (int)
ExtentIteratoroperator-- ()
ExtentIterator operator-- (int)
void Inc ()
void Dec ()
ExtentIteratorToStart ()
ExtentIteratorToEnd ()
Extent GetExtent () const
const PointGetStart () const
const PointGetEnd () const
bool AtEnd () const
bool AtStart () const
int operator[] (int i) const
 operator Point () const

Detailed Description

Extent iterator.

The extent iterator is implicitely convertible to Point, and is therefore ideally suited for Get/Set methods which take a point as an argument.

  ImageHandle ih = get_some_image();
  for(ExtentIterator it(ih.GetExtent());!it.AtEnd();++it) {
    Real r = ih.GetReal(it);
    // do something with value
  }
See also:
View Phase Diference Example

Definition at line 52 of file extent_iterator.hh.


Constructor & Destructor Documentation

ExtentIterator ( const Extent b,
unsigned int  domain = SPATIAL 
) [explicit]

Initialize with Extent.

ExtentIterator ( const ExtentIterator i  ) 

copy ctor


Member Function Documentation

bool AtEnd (  )  const

Returns true if iterator has reached end.

bool AtStart (  )  const

Returns true if iterator is at the start.

void Dec (  ) 

Go back to previous point.

const Point& GetEnd (  )  const

Retrieve end point.

Extent GetExtent (  )  const

Retrieve original extent.

const Point& GetStart (  )  const

Retrieve start point.

void Inc (  ) 

Skip ahead to next point.

operator Point (  )  const
ExtentIterator operator++ ( int   ) 

Postfix increase operator.

ExtentIterator& operator++ (  ) 

Prefix increase operator.

ExtentIterator operator-- ( int   ) 

Postfix decrease operator.

ExtentIterator& operator-- (  ) 

Prefix decrease operator.

ExtentIterator& operator= ( const ExtentIterator p  ) 

assignement op

int operator[] ( int  i  )  const

element access

ExtentIterator& ToEnd (  ) 

Reset to end.

ExtentIterator& ToStart (  ) 

Reset to start.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 1 Mar 2018 for OpenStructure by  doxygen 1.6.1