dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D > Class Template Reference

This class provides access to the elements of a data array along a straight path, and does the actual work of Amanatides and Woo's fast voxel traversal algorithm. More...

#include <amanatidesWoo2DIterator.h>

List of all members.

Public Member Functions

 AmanatidesWoo2DIterator (ARRAY2D &data, int U, int V, int stepU, int stepV, double tMaxU, double tMaxV, double tDeltaU, double tDeltaV, double tStart)
 The class constructor is initialized with all of the internal variables of the voxel traversal algorithm.
 AmanatidesWoo2DIterator (const AmanatidesWoo2DIterator &source)
 Copy constructor.
 ~AmanatidesWoo2DIterator ()
 Destructor.
double tEntry ()
 This method returns the ray parameter t at which the ray being followed passes into the current pixel.
double tExit ()
 This method returns the ray parameter t at which the ray being followed passes out of the current pixel.
int U ()
 This method returns the U coordinate of the current pixel.
int V ()
 This method returns the V coordinate of the current pixel.
ARRAY2D::value_type & operator* ()
 This operator returns a reference to the Array2D element at the current pixel.
ARRAY2D::value_type * operator-> ()
 This operator returns a pointer to the Array2D element at the current pixel.
AmanatidesWoo2DIteratoroperator++ ()
 The pre-increment operator increments the iterator so that it points to the next pixel along the path.
AmanatidesWoo2DIterator operator++ (int dummy)
 The post-increment operator increments the iterator so that it points to the next pixel along the path.
AmanatidesWoo2DIteratoroperator= (const AmanatidesWoo2DIterator &source)
 This is the assignment operator.
bool operator== (const AmanatidesWoo2DIterator &other)
 The equality operator returns true if both the argument and *this currently reference a valid pixel, or if both the argument and *this currently reference an invalid pixel.
bool operator!= (const AmanatidesWoo2DIterator &other)
 The equality operator returns false if both the argument and *this currently reference a valid pixel, or if both the argument and *this currently reference an invalid pixel.


Detailed Description

template<class ARRAY2D>
class dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >

This class provides access to the elements of a data array along a straight path, and does the actual work of Amanatides and Woo's fast voxel traversal algorithm.

Typically, an AmanatidesWoo2DIterator instance will be created by an AmanatidesWoo2D object in order to access a line of pixels specified through the AmanatidesWoo2D class interface. The user will probably never need to directly construct an AmanatidesWoo2DIterator. For more information on the fast voxel traversal algorithm of Amanatides and Woo, please refer to [ref].

Definition at line 38 of file amanatidesWoo2DIterator.h.


Constructor & Destructor Documentation

template<class ARRAY2D >
dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::AmanatidesWoo2DIterator ( ARRAY2D &  data,
int  U,
int  V,
int  stepU,
int  stepV,
double  tMaxU,
double  tMaxV,
double  tDeltaU,
double  tDeltaV,
double  tStart 
) [inline]

The class constructor is initialized with all of the internal variables of the voxel traversal algorithm.

Parameters:
data This parameter is a reference to the 2D data over which to iterate.
U This parameter specifies the starting U coordinate (column) in the pixel data. Its value must lie in the range [0..N), where N is the number of columns in parameter 'data'.
V This parameter specifies the starting V coordinate (row) in the pixel data. Its value must lie in the range [0..M), where M is the number of rows in parameter 'data'.
stepU This parameter specifies the increment by which the U coordinate changes as we move along the direction of the ray. It must be either 1 or -1.
stepV This parameter specifies the increment by which the V coordinate changes as we move along the direction of the ray. It must be either 1 or -1.
tMaxU This parameter specifies the value of ray parameter 't' at which the ray passes from the current column into the next column. Parameter 't' is described in the documentation for class AmanatidesWoo2D.
tMaxV This parameter specifies the value of ray parameter 't' at which the ray passes from the current row into the next row. Parameter 't' is described in the documentation for class AmanatidesWoo2D.
tDeltaU This parameter specifies the increment to ray parameter 't' which moves one exactly one column width to the left or right, where left and right describe the directions of the negative and positive U axis, respectively. Parameter 't' is described in the documentation for class AmanatidesWoo2D.
tDeltaV This parameter specifies the increment to ray parameter 't' which moves one exactly one row width up or down, where up and down describe the directions of the negative and positive V axis, respectively. Parameter 't' is described in the documentation for class AmanatidesWoo2D.
tStart This parameter specifies the value of ray parameter 't' at the very beginning point of the iteration.

Definition at line 290 of file amanatidesWoo2DIterator.h.

template<class ARRAY2D >
dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::AmanatidesWoo2DIterator ( const AmanatidesWoo2DIterator< ARRAY2D > &  source  )  [inline]

Copy constructor.

Parameters:
source This argument specifies the AmanatidesWoo2D instance to be copied.

Definition at line 321 of file amanatidesWoo2DIterator.h.

template<class ARRAY2D>
dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::~AmanatidesWoo2DIterator (  )  [inline]

Destructor.

Definition at line 100 of file amanatidesWoo2DIterator.h.


Member Function Documentation

template<class ARRAY2D >
bool dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::operator!= ( const AmanatidesWoo2DIterator< ARRAY2D > &  other  )  [inline]

The equality operator returns false if both the argument and *this currently reference a valid pixel, or if both the argument and *this currently reference an invalid pixel.

In all other cases the return is true.

NOTE: This behavior is not exactly what you'd expect for an equality operator. references the same pixel as the argument.

Parameters:
other This argument is a second AmanatidesWoo2DIterator instance that is to be compared with *this.
Returns:
The return value is false if *this and other both reference in-bounds pixels, or if *this and other both reference out-of-bounds pixels, true otherwise.

Definition at line 437 of file amanatidesWoo2DIterator.h.

References dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::operator==().

template<class ARRAY2D >
ARRAY2D::value_type & dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::operator* (  )  [inline]

This operator returns a reference to the Array2D element at the current pixel.

With each increment of the AmanatidesWoo2DIterator instance, this operator will return a reference to the next pixel along the ray.

Returns:
The return value is a reference the the relevant Array2D element.

Definition at line 344 of file amanatidesWoo2DIterator.h.

Referenced by dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::operator->().

template<class ARRAY2D >
AmanatidesWoo2DIterator< ARRAY2D > dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::operator++ ( int  dummy  )  [inline]

The post-increment operator increments the iterator so that it points to the next pixel along the path.

It differs from the pre-increment operator in its return value. Traditionally, post-increment is a little slower than pre-increment.

Parameters:
dummy This parameter is a dummy which indicates to the compiler that this operation is post-increment (rather than pre-increment).
Returns:
The return value is a copy of *this which was generated before the increment.

Definition at line 390 of file amanatidesWoo2DIterator.h.

template<class ARRAY2D >
AmanatidesWoo2DIterator< ARRAY2D > & dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::operator++ (  )  [inline]

The pre-increment operator increments the iterator so that it points to the next pixel along the path.

Returns:
The return value is a reference to *this.

Definition at line 364 of file amanatidesWoo2DIterator.h.

template<class ARRAY2D >
ARRAY2D::value_type * dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::operator-> (  )  [inline]

This operator returns a pointer to the Array2D element at the current pixel.

With each increment of the AmanatidesWoo2DIterator instance, this operator will return a pointer to the next pixel along the ray.

Returns:
The return value is a pointer the the relevant Array2D element.

Definition at line 354 of file amanatidesWoo2DIterator.h.

References dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::operator*().

template<class ARRAY2D >
AmanatidesWoo2DIterator< ARRAY2D > & dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::operator= ( const AmanatidesWoo2DIterator< ARRAY2D > &  source  )  [inline]

template<class ARRAY2D >
bool dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::operator== ( const AmanatidesWoo2DIterator< ARRAY2D > &  other  )  [inline]

The equality operator returns true if both the argument and *this currently reference a valid pixel, or if both the argument and *this currently reference an invalid pixel.

In all other cases the return is false.

NOTE: This behavior is not exactly what you'd expect for an equality operator. references the same pixel as the argument.

Parameters:
other This argument is a second AmanatidesWoo2DIterator instance that is to be compared with *this.
Returns:
The return value is true if *this and other both reference in-bounds pixels, or if *this and other both reference out-of-bounds pixels, false otherwise.

Definition at line 425 of file amanatidesWoo2DIterator.h.

References dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::m_inBounds.

Referenced by dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::operator!=().

template<class ARRAY2D>
double dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::tEntry (  )  [inline]

This method returns the ray parameter t at which the ray being followed passes into the current pixel.

In other words, the value t such that (rayOrigin + t * rayDirection) is the point of entry into the current pixel.

Returns:
The return value is the value of t at which the ray passes into the current pixel.

Definition at line 112 of file amanatidesWoo2DIterator.h.

template<class ARRAY2D>
double dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::tExit (  )  [inline]

This method returns the ray parameter t at which the ray being followed passes out of the current pixel.

In other words, the value t such that (rayOrigin + t * rayDirection) is the point of exit from the current pixel. Invoking this method carries a computational cost of 1 double precision float comparison.

Returns:
The return value is the value of t at which the ray passes out of the current pixel.

Definition at line 125 of file amanatidesWoo2DIterator.h.

template<class ARRAY2D>
int dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::U (  )  [inline]

This method returns the U coordinate of the current pixel.

The return value is int rather than size_t so that negative (out of bounds) coordinates can be returned.

Returns:
The return value is the U coordinate of the current pixel.

Definition at line 136 of file amanatidesWoo2DIterator.h.

template<class ARRAY2D>
int dlr::numeric::AmanatidesWoo2DIterator< ARRAY2D >::V (  )  [inline]

This method returns the V coordinate of the current pixel.

The return value is int rather than size_t so that negative (out of bounds) coordinates can be returned.

Returns:
The return value is the V coordinate of the current pixel.

Definition at line 147 of file amanatidesWoo2DIterator.h.


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

Generated on Wed Nov 25 00:42:47 2009 for dlrUtilities Utility Library by  doxygen 1.5.8