dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D > 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 <amanatidesWoo3DIterator.h>

List of all members.

Public Member Functions

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


Detailed Description

template<class ARRAY3D>
class dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >

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 AmanatidesWoo3DIterator instance will be created by an AmanatidesWoo3D object in order to access a line of voxels specified through the AmanatidesWoo3D class interface. The user will probably never need to directly construct an AmanatidesWoo3DIterator. For more information on the fast voxel traversal algorithm of Amanatides and Woo, please refer to [ref].

Definition at line 38 of file amanatidesWoo3DIterator.h.


Constructor & Destructor Documentation

template<class ARRAY3D >
dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >::AmanatidesWoo3DIterator ( ARRAY3D &  data,
int  U,
int  V,
int  W,
int  stepU,
int  stepV,
int  stepW,
double  tMaxU,
double  tMaxV,
double  tMaxW,
double  tDeltaU,
double  tDeltaV,
double  tDeltaW,
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 3D data over which to iterate.
U This parameter specifies the starting U coordinate (column) in the voxel 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 voxel data. Its value must lie in the range [0..M), where M is the number of rows in parameter 'data'.
W This parameter specifies the starting W coordinate (row) in the voxel 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.
stepW This parameter specifies the increment by which the W 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 AmanatidesWoo3D.
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 AmanatidesWoo3D.
tMaxW This parameter specifies the value of ray parameter 't' at which the ray passes from the current slice into the next slice. Parameter 't' is described in the documentation for class AmanatidesWoo3D.
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 AmanatidesWoo3D.
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 AmanatidesWoo3D.
tDeltaW This parameter specifies the increment to ray parameter 't' which moves one exactly one slice width up or down, where up and down describe the directions of the negative and positive Z axis, respectively. Parameter 't' is described in the documentation for class AmanatidesWoo3D.
tStart This parameter specifies the value of ray parameter 't' at the very beginning point of the iteration.

Definition at line 321 of file amanatidesWoo3DIterator.h.

template<class ARRAY3D >
dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >::AmanatidesWoo3DIterator ( const AmanatidesWoo3DIterator< ARRAY3D > &  source  )  [inline]

Copy constructor.

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

Definition at line 359 of file amanatidesWoo3DIterator.h.

template<class ARRAY3D>
dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >::~AmanatidesWoo3DIterator (  )  [inline]

Destructor.

Definition at line 115 of file amanatidesWoo3DIterator.h.


Member Function Documentation

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

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

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 voxel as the argument.

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

Definition at line 503 of file amanatidesWoo3DIterator.h.

References dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >::operator==().

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

This operator returns a reference to the Array3D element at the current voxel.

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

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

Definition at line 387 of file amanatidesWoo3DIterator.h.

Referenced by dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >::operator->().

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

The post-increment operator increments the iterator so that it points to the next voxel 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 451 of file amanatidesWoo3DIterator.h.

template<class ARRAY3D >
AmanatidesWoo3DIterator< ARRAY3D > & dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >::operator++ (  )  [inline]

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

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

Definition at line 407 of file amanatidesWoo3DIterator.h.

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

This operator returns a pointer to the Array3D element at the current voxel.

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

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

Definition at line 397 of file amanatidesWoo3DIterator.h.

References dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >::operator*().

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

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

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

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 voxel as the argument.

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

Definition at line 491 of file amanatidesWoo3DIterator.h.

References dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >::m_inBounds.

Referenced by dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >::operator!=().

template<class ARRAY3D>
double dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >::tEntry (  )  [inline]

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

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

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

Definition at line 127 of file amanatidesWoo3DIterator.h.

template<class ARRAY3D>
double dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >::tExit (  )  [inline]

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

In other words, the value t such that (rayOrigin + t * rayDirection) is the point of exit from the current voxel. 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 voxel.

Definition at line 140 of file amanatidesWoo3DIterator.h.

template<class ARRAY3D>
int dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >::U (  )  [inline]

This method returns the U coordinate of the current voxel.

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 voxel.

Definition at line 151 of file amanatidesWoo3DIterator.h.

template<class ARRAY3D>
int dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >::V (  )  [inline]

This method returns the V coordinate of the current voxel.

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 voxel.

Definition at line 162 of file amanatidesWoo3DIterator.h.

template<class ARRAY3D>
int dlr::numeric::AmanatidesWoo3DIterator< ARRAY3D >::W (  )  [inline]

This method returns the W coordinate of the current voxel.

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 W coordinate of the current voxel.

Definition at line 173 of file amanatidesWoo3DIterator.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