dlr::numeric::Transform2D Class Reference

The Transform2D class represents a homogeneous coordinate transform from one 2D coordinate system to another 2D coordinate system. More...

#include <transform2D.h>

List of all members.

Public Member Functions

 Transform2D ()
 Default constructor.
 Transform2D (double a00, double a01, double a02, double a10, double a11, double a12, double a20, double a21, double a22)
 Build a Transform2D instance by explicitly setting element values as if setting the elements of a 3x3 transformation matrix: [[a00, a01, a02], [a10, a11, a12], [a20, a21, a22]].
 Transform2D (const Array2D< double > &source)
 Build a Transform2D from a homogeneous 3x3 matrix.
 Transform2D (const Transform2D &src)
 The copy constructor simply duplicates its argument.
 ~Transform2D ()
 Destructor.
Transform2DFunctor getFunctor () const
 This member function returns a functor which makes it easier to transform arrays of points using algorithms such as std::transform().
Transform2D invert () const
 This member function returns the inverse of *this.
void setTransform (double a00, double a01, double a02, double a10, double a11, double a12, double a20, double a21, double a22)
 Change the Transform2D value by explicitly setting element values as if setting the elements of a 3x3 transformation matrix: [[a00, a01, a02], [a10, a11, a12], [a20, a21, a22]].
void setValue (size_t row, size_t column, double value)
 This member function sets one element of the matrix representation of the coordinate transform.
template<size_t row, size_t column>
void setValue (double value)
 This member function sets one element from the matrix representation of the coordinate transform.
template<size_t row, size_t column>
double value () const
 This member function returns one element from the matrix representation of the coordinate transform by value.
double operator() (size_t row, size_t column) const
 This operator returns one element from the matrix representation of the coordinate transform by value.
Vector2D operator* (const Vector2D &vector0) const
 This operator takes a point and applies the coordinate transform, returning the result.
Transform2Doperator= (const Transform2D &source)
 The assignment operator simply duplicates its argument.


Detailed Description

The Transform2D class represents a homogeneous coordinate transform from one 2D coordinate system to another 2D coordinate system.

Definition at line 34 of file transform2D.h.


Constructor & Destructor Documentation

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

Default constructor.

Initializes to identity.

Definition at line 40 of file transform2D.h.

Referenced by invert().

dlr::numeric::Transform2D::Transform2D ( double  a00,
double  a01,
double  a02,
double  a10,
double  a11,
double  a12,
double  a20,
double  a21,
double  a22 
) [inline]

Build a Transform2D instance by explicitly setting element values as if setting the elements of a 3x3 transformation matrix: [[a00, a01, a02], [a10, a11, a12], [a20, a21, a22]].

Parameters:
a00 The value of one element of the transformation matrix.
a01 The value of one element of the transformation matrix.
a02 The value of one element of the transformation matrix.
a10 The value of one element of the transformation matrix.
a11 The value of one element of the transformation matrix.
a12 The value of one element of the transformation matrix.
a20 The value of one element of the transformation matrix.
a21 The value of one element of the transformation matrix.
a22 The value of one element of the transformation matrix.

Definition at line 63 of file transform2D.h.

dlr::numeric::Transform2D::Transform2D ( const Array2D< double > &  source  ) 

Build a Transform2D from a homogeneous 3x3 matrix.

Parameters:
source A 2D array containing the elements of the desired homogeneous transformation.

Definition at line 23 of file transform2D.cpp.

References dlr::numeric::Array2D< Type >::columns(), and dlr::numeric::Array2D< Type >::rows().

dlr::numeric::Transform2D::Transform2D ( const Transform2D src  )  [inline]

The copy constructor simply duplicates its argument.

Parameters:
src This is the Transform2D instance to be copied.

Definition at line 86 of file transform2D.h.

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

Destructor.

Definition at line 94 of file transform2D.h.


Member Function Documentation

Transform2DFunctor dlr::numeric::Transform2D::getFunctor (  )  const

This member function returns a functor which makes it easier to transform arrays of points using algorithms such as std::transform().

For example:

 std::transform(myPoints.begin(), myPoints.end(), myNewPoints.begin(),
                myTransform.getFunctor());

Returns:
The return value is a functor instance which will transform points according to the current value of *this. The functor will contain a copy of *this, so that subsequent changes to *this will not affect the functor.

Definition at line 44 of file transform2D.cpp.

Transform2D dlr::numeric::Transform2D::invert (  )  const

This member function returns the inverse of *this.

It is an error if *this is not invertible.

Returns:
The return value is the inverse of *this.

Definition at line 52 of file transform2D.cpp.

References Transform2D().

double dlr::numeric::Transform2D::operator() ( size_t  row,
size_t  column 
) const

This operator returns one element from the matrix representation of the coordinate transform by value.

If blindingly fast execution is important, consider using value<size_t, size_t>() member function.

Parameters:
row The row of the requested element.
column The column of the requested element.
Returns:
The value of the requested element.

Definition at line 160 of file transform2D.cpp.

Vector2D dlr::numeric::Transform2D::operator* ( const Vector2D vector0  )  const

This operator takes a point and applies the coordinate transform, returning the result.

Parameters:
vector0 The point to be transformed.
Returns:
The result of the transformation.

Definition at line 203 of file transform2D.cpp.

References dlr::numeric::Vector2D::x(), and dlr::numeric::Vector2D::y().

Transform2D & dlr::numeric::Transform2D::operator= ( const Transform2D source  ) 

The assignment operator simply duplicates its argument.

Parameters:
source This is the Transform2D instance to be copied.
Returns:
A reference to *this.

Definition at line 214 of file transform2D.cpp.

References m_00, m_01, m_02, m_10, m_11, m_12, m_20, and m_21.

void dlr::numeric::Transform2D::setTransform ( double  a00,
double  a01,
double  a02,
double  a10,
double  a11,
double  a12,
double  a20,
double  a21,
double  a22 
)

Change the Transform2D value by explicitly setting element values as if setting the elements of a 3x3 transformation matrix: [[a00, a01, a02], [a10, a11, a12], [a20, a21, a22]].

Parameters:
a00 The value of one element of the transformation matrix.
a01 The value of one element of the transformation matrix.
a02 The value of one element of the transformation matrix.
a10 The value of one element of the transformation matrix.
a11 The value of one element of the transformation matrix.
a12 The value of one element of the transformation matrix.
a20 The value of one element of the transformation matrix.
a21 The value of one element of the transformation matrix.
a22 The value of one element of the transformation matrix.

Definition at line 104 of file transform2D.cpp.

Referenced by dlr::numeric::operator>>().

template<size_t ROW, size_t COLUMN>
void dlr::numeric::Transform2D::setValue ( double  value  )  [inline]

This member function sets one element from the matrix representation of the coordinate transform.

Note that indexing is zero-based. For example, calling myTransform2D.setValue<1, 2>(5.0) will set the element from the 2nd row, 3rd column of the matrix representation of the coordinate transformation to 5.0.

It is not permitted to set the value of the lower-right element of the matrix: setValue<2, 2>(double) will throw an IndexException.

Parameters:
value This argument specifies the value to be copied into the matrix element at the specified row & column.

Definition at line 367 of file transform2D.h.

void dlr::numeric::Transform2D::setValue ( size_t  row,
size_t  column,
double  value 
)

This member function sets one element of the matrix representation of the coordinate transform.

Note that indexing is zero-based. For example, calling myTransform2D.setValue(1, 2, 5.0) will set the element from the 2nd row, 3rd column of the matrix representation of the coordinate transformation to 5.0. If blindingly fast execution is important, consider using the setValue<size_t, size_t>(double) member function instead.

It is not permitted to set the value of the lower-right element of the matrix: setValue(2, 2, ...) will throw an IndexException.

Parameters:
row This argument specifies the row of the matrix element to be modified.
column This argument specifies the row of the matrix element to be modified.
value This argument specifies the value to be copied into the matrix element at the specified row & column.

Definition at line 120 of file transform2D.cpp.

template<size_t ROW, size_t COLUMN>
double dlr::numeric::Transform2D::value (  )  const [inline]

This member function returns one element from the matrix representation of the coordinate transform by value.

For example, calling myTransform2D.value<1, 2>() will return the element from the 2nd row, 3rd column of the matrix representation of the coordinate transformation.

Returns:
The value of the requested element.

Definition at line 410 of file transform2D.h.

Referenced by dlr::numeric::operator*(), and dlr::numeric::operator<<().


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

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