dlr::numeric::Index3D Class Reference

The Index3D class represents a 3 dimensional index, such as (0, 1, 4), (23, 7, -11), or (-4, 2, 0). More...

#include <index3D.h>

List of all members.

Public Member Functions

 Index3D ()
 The default constructor initializes to (0, 0, 0).
 Index3D (int slice, int row, int column)
 This constructor explicitly sets the indices.
 Index3D (const Index3D &other)
 The copy constructor deep copies its argument.
 ~Index3D ()
 The destructor destroys the Index3D instance.
void setValue (int slice, int row, int column)
 This member function explicitly sets the sets the indices.
int getColumn () const
 This member function returns the first component of the Index3D by value.
int getRow () const
 This member function returns the second component of the Index3D by value.
int getSlice () const
 This member function returns the third component of the Index3D by value.
int getU () const
 This member function returns the first component of the Index3D by value.
int getV () const
 This member function returns the second component of the Index3D by value.
int getW () const
 This member function returns the third component of the Index3D by value.
Index3Doperator= (const Index3D &other)
 The assignment operator deep copies its argument.
int operator[] (size_t index) const
 The indexing operator returns a reference to the U, V, or W component of *this as if *this were a three element array.
Index3Doperator*= (int scalar)
 This operator multiplies each component of the Index3D instance by a scalar.
Index3Doperator/= (int scalar)
 This operator divides each component of the Index3D instance by a scalar.
Index3Doperator+= (const Index3D &other)
 This operator adds a scalar to each component of the Index3D instance.
Index3Doperator-= (const Index3D &other)
 This operator subtracts a scalar from each component of the Index3D instance.
Index3D operator- ()
 This operator returns an Index3D equal to *this, but with each element negated.


Detailed Description

The Index3D class represents a 3 dimensional index, such as (0, 1, 4), (23, 7, -11), or (-4, 2, 0).

By convention, we refer to these coordinates as (U, V, W). We also refer to slice, row, and column, where column == U, row == V, and slice == W.

Definition at line 31 of file index3D.h.


Constructor & Destructor Documentation

dlr::numeric::Index3D::Index3D (  )  [inline]

The default constructor initializes to (0, 0, 0).

Definition at line 37 of file index3D.h.

Referenced by operator-().

dlr::numeric::Index3D::Index3D ( int  slice,
int  row,
int  column 
) [inline]

This constructor explicitly sets the indices.

Parameters:
slice The third (W) component of the Index3D.
row The second (U) component of the Index3D.
column The first (U) component of the Index3D.

Definition at line 50 of file index3D.h.

dlr::numeric::Index3D::Index3D ( const Index3D other  )  [inline]

The copy constructor deep copies its argument.

Parameters:
other This argument is the Index3D instance to be copied.

Definition at line 60 of file index3D.h.

dlr::numeric::Index3D::~Index3D (  )  [inline]

The destructor destroys the Index3D instance.

Definition at line 68 of file index3D.h.


Member Function Documentation

int dlr::numeric::Index3D::getColumn (  )  const [inline]

This member function returns the first component of the Index3D by value.

Returns:
The return value is the first (U) coordinate.

Definition at line 91 of file index3D.h.

Referenced by getU(), dlr::numeric::operator*(), dlr::numeric::operator+(), dlr::numeric::operator-(), dlr::numeric::operator/(), dlr::numeric::operator<<(), dlr::numeric::operator==(), and operator[]().

int dlr::numeric::Index3D::getRow (  )  const [inline]

This member function returns the second component of the Index3D by value.

Returns:
The return value is the second (V) coordinate.

Definition at line 100 of file index3D.h.

Referenced by getV(), dlr::numeric::operator*(), dlr::numeric::operator+(), dlr::numeric::operator-(), dlr::numeric::operator/(), dlr::numeric::operator<<(), dlr::numeric::operator==(), and operator[]().

int dlr::numeric::Index3D::getSlice (  )  const [inline]

This member function returns the third component of the Index3D by value.

Returns:
The return value is the third (W) coordinate.

Definition at line 109 of file index3D.h.

Referenced by getW(), dlr::numeric::operator*(), dlr::numeric::operator+(), dlr::numeric::operator-(), dlr::numeric::operator/(), dlr::numeric::operator<<(), dlr::numeric::operator==(), and operator[]().

int dlr::numeric::Index3D::getU (  )  const [inline]

This member function returns the first component of the Index3D by value.

It is a synonym for member function getColumn().

Returns:
The return value is the first (U) coordinate.

Definition at line 118 of file index3D.h.

References getColumn().

int dlr::numeric::Index3D::getV (  )  const [inline]

This member function returns the second component of the Index3D by value.

It is a synonym for member function getRow().

Returns:
The return value is the second (V) coordinate.

Definition at line 127 of file index3D.h.

References getRow().

int dlr::numeric::Index3D::getW (  )  const [inline]

This member function returns the third component of the Index3D by value.

It is a synonym for member function getSlice().

Returns:
The return value is the third (W) coordinate.

Definition at line 137 of file index3D.h.

References getSlice().

Index3D& dlr::numeric::Index3D::operator*= ( int  scalar  )  [inline]

This operator multiplies each component of the Index3D instance by a scalar.

Parameters:
scalar This argument is the scalar by which to multiply.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 184 of file index3D.h.

Index3D& dlr::numeric::Index3D::operator+= ( const Index3D other  )  [inline]

This operator adds a scalar to each component of the Index3D instance.

Parameters:
scalar This argument is the scalar to be added.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 216 of file index3D.h.

References m_column, m_row, and m_slice.

Index3D dlr::numeric::Index3D::operator- (  )  [inline]

This operator returns an Index3D equal to *this, but with each element negated.

Returns:
The return value is a negated copy of *this.

Definition at line 243 of file index3D.h.

References Index3D().

Index3D& dlr::numeric::Index3D::operator-= ( const Index3D other  )  [inline]

This operator subtracts a scalar from each component of the Index3D instance.

Parameters:
scalar This argument is the scalar to be subtracted.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 231 of file index3D.h.

References m_column, m_row, and m_slice.

Index3D& dlr::numeric::Index3D::operator/= ( int  scalar  )  [inline]

This operator divides each component of the Index3D instance by a scalar.

Parameters:
scalar This argument is the scalar by which to divide.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 198 of file index3D.h.

Index3D& dlr::numeric::Index3D::operator= ( const Index3D other  )  [inline]

The assignment operator deep copies its argument.

Parameters:
other This argument is the Index3D instance to be copied.
Returns:
The return value is a reference to *this after the operation has been performed.

Definition at line 149 of file index3D.h.

References m_column, m_row, m_slice, and setValue().

int dlr::numeric::Index3D::operator[] ( size_t  index  )  const [inline]

The indexing operator returns a reference to the U, V, or W component of *this as if *this were a three element array.

Out of bounds indices will return the W component.

Parameters:
index This argument is the index into *this.
Returns:
The return value is the selected component of *this.

Definition at line 166 of file index3D.h.

References getColumn(), getRow(), and getSlice().

void dlr::numeric::Index3D::setValue ( int  slice,
int  row,
int  column 
) [inline]

This member function explicitly sets the sets the indices.

Parameters:
slice The third (W) component of the Index3D.
row The second (U) component of the Index3D.
column The first (U) component of the Index3D.

Definition at line 80 of file index3D.h.

Referenced by operator=(), and dlr::numeric::operator>>().


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

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