Logo Search packages:      
Sourcecode: eigen3 version File versions  Download package

Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | Friends

Transform< _Scalar, _Dim > Class Template Reference
[Geometry_Module]

Represents an homogeneous transformation in a N dimensional space. More...

#include <Transform.h>

Inheritance diagram for Transform< _Scalar, _Dim >:
Inheritance graph
[legend]
Collaboration diagram for Transform< _Scalar, _Dim >:
Collaboration graph
[legend]

List of all members.

Classes

struct  construct_from_matrix
struct  construct_from_matrix< OtherDerived, true >

Public Types

enum  { TransformTimeDiagonalMode = ((Mode==int(Isometry))?Affine:int(Mode)) }
typedef internal::conditional
< int(Mode)==int(AffineCompact),
MatrixType &, Block
< MatrixType, Dim, HDim >
>::type 
AffinePart
typedef internal::conditional
< int(Mode)==int(AffineCompact),
const MatrixType &, const
Block< const MatrixType, Dim,
HDim > >::type 
ConstAffinePart
typedef const Block
< ConstMatrixType, Dim, Dim > 
ConstLinearPart
typedef const Block< const
MatrixType, Dim, Dim > 
ConstLinearPart
typedef const MatrixType ConstMatrixType
typedef const Block< const
MatrixType, Dim, 1 > 
ConstTranslationPart
typedef const Block
< ConstMatrixType, Dim, 1 > 
ConstTranslationPart
typedef DenseIndex Index
typedef Matrix< Scalar, Dim,
Dim, Options > 
LinearMatrixType
typedef Matrix< Scalar, Dim, Dim > LinearMatrixType
typedef Block< MatrixType, Dim,
Dim > 
LinearPart
typedef Block< MatrixType, Dim,
Dim > 
LinearPart
typedef Matrix< Scalar, HDim,
HDim > 
MatrixType
typedef
internal::make_proper_matrix_type
< Scalar, Rows, HDim, Options >
::type 
MatrixType
typedef _Scalar Scalar
typedef _Scalar Scalar
typedef Scaling< Scalar, Dim > ScalingType
typedef
internal::transform_take_affine_part
< Transform
take_affine_part
typedef Transform< Scalar, Dim,
TransformTimeDiagonalMode > 
TransformTimeDiagonalReturnType
typedef Block< MatrixType, Dim, 1 > TranslationPart
typedef Block< MatrixType, Dim, 1 > TranslationPart
typedef Translation< Scalar, Dim > TranslationType
typedef Translation< Scalar, Dim > TranslationType
typedef Matrix< Scalar, Dim, 1 > VectorType
typedef Matrix< Scalar, Dim, 1 > VectorType

Public Member Functions

ConstAffinePart affine () const
AffinePart affine ()
template<typename NewScalarType >
internal::cast_return_type
< Transform, Transform
< NewScalarType, Dim > >::type 
cast () const
template<typename NewScalarType >
internal::cast_return_type
< Transform, Transform
< NewScalarType, Dim, Mode,
Options > >::type 
cast () const
template<typename RotationMatrixType , typename ScalingMatrixType >
void computeRotationScaling (RotationMatrixType *rotation, ScalingMatrixType *scaling) const
template<typename RotationMatrixType , typename ScalingMatrixType >
void computeRotationScaling (RotationMatrixType *rotation, ScalingMatrixType *scaling) const
template<typename ScalingMatrixType , typename RotationMatrixType >
void computeScalingRotation (ScalingMatrixType *scaling, RotationMatrixType *rotation) const
template<typename ScalingMatrixType , typename RotationMatrixType >
void computeScalingRotation (ScalingMatrixType *scaling, RotationMatrixType *rotation) const
const Scalardata () const
Scalardata ()
const Scalardata () const
Scalardata ()
 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE (_Scalar, _Dim==Dynamic?Dynamic:(_Dim+1)*(_Dim+1)) enum
 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE (_Scalar, _Dim==Dynamic?Dynamic:(_Dim+1)*(_Dim+1)) enum
template<typename PositionDerived , typename OrientationType , typename ScaleDerived >
TransformfromPositionOrientationScale (const MatrixBase< PositionDerived > &position, const OrientationType &orientation, const MatrixBase< ScaleDerived > &scale)
template<typename PositionDerived , typename OrientationType , typename ScaleDerived >
TransformfromPositionOrientationScale (const MatrixBase< PositionDerived > &position, const OrientationType &orientation, const MatrixBase< ScaleDerived > &scale)
const MatrixType inverse (TransformTraits traits=Affine) const
Transform inverse (TransformTraits traits=(TransformTraits) Mode) const
bool isApprox (const Transform &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const
bool isApprox (const Transform &other, typename NumTraits< Scalar >::Real prec=NumTraits< Scalar >::dummy_precision()) const
ConstLinearPart linear () const
LinearPart linear ()
ConstLinearPart linear () const
LinearPart linear ()
const Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim,
Dim > 
linearExt () const
Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim,
Dim > 
linearExt ()
void makeAffine ()
MatrixTypematrix ()
const MatrixTypematrix () const
MatrixTypematrix ()
const MatrixTypematrix () const
Scalaroperator() (Index row, Index col)
Scalar operator() (int row, int col) const
Scalaroperator() (int row, int col)
Scalar operator() (Index row, Index col) const
Transform operator* (const TranslationType &t) const
template<typename OtherDerived >
const
ei_transform_product_impl
< OtherDerived, _Dim, _Dim+1 >
::ResultType 
operator* (const MatrixBase< OtherDerived > &other) const
template<int OtherMode, int OtherOptions>
const
internal::transform_transform_product_impl
< Transform, Transform< Scalar,
Dim, OtherMode, OtherOptions >
>::ResultType 
operator* (const Transform< Scalar, Dim, OtherMode, OtherOptions > &other) const
const Transform operator* (const Transform &other) const
Transform operator* (const ScalingType &s) const
template<typename OtherDerived >
EIGEN_STRONG_INLINE const
internal::transform_right_product_impl
< Transform, OtherDerived >
::ResultType 
operator* (const EigenBase< OtherDerived > &other) const
template<typename DiagonalDerived >
const
TransformTimeDiagonalReturnType 
operator* (const DiagonalBase< DiagonalDerived > &b) const
template<typename Derived >
Transform operator* (const RotationBase< Derived, Dim > &r) const
const Transform operator* (const Transform &other) const
Transform operator* (const TranslationType &t) const
Transform operator* (const UniformScaling< Scalar > &s) const
template<typename Derived >
Transform operator* (const RotationBase< Derived, Dim > &r) const
Transformoperator*= (const TranslationType &t)
Transformoperator*= (const ScalingType &s)
template<typename OtherDerived >
Transformoperator*= (const EigenBase< OtherDerived > &other)
template<typename Derived >
Transformoperator*= (const RotationBase< Derived, Dim > &r)
Transformoperator*= (const TranslationType &t)
Transformoperator*= (const UniformScaling< Scalar > &s)
Transformoperator*= (const DiagonalMatrix< Scalar, Dim > &s)
template<typename Derived >
Transformoperator*= (const RotationBase< Derived, Dim > &r)
Transformoperator= (const UniformScaling< Scalar > &t)
Transformoperator= (const ScalingType &t)
template<typename Derived >
Transformoperator= (const RotationBase< Derived, Dim > &r)
Transformoperator= (const TranslationType &t)
template<typename OtherDerived >
Transformoperator= (const MatrixBase< OtherDerived > &other)
template<typename Derived >
Transformoperator= (const RotationBase< Derived, Dim > &r)
Transformoperator= (const Transform &other)
Transformoperator= (const Transform &other)
template<typename OtherDerived >
Transformoperator= (const EigenBase< OtherDerived > &other)
template<typename OtherDerived >
Transformoperator= (const ReturnByValue< OtherDerived > &other)
Transformoperator= (const TranslationType &t)
template<typename RotationType >
Transformprerotate (const RotationType &rotation)
template<typename RotationType >
Transformprerotate (const RotationType &rotation)
template<typename OtherDerived >
Transformprescale (const MatrixBase< OtherDerived > &other)
Transformprescale (Scalar s)
template<typename OtherDerived >
Transformprescale (const MatrixBase< OtherDerived > &other)
Transformprescale (Scalar s)
Transformpreshear (Scalar sx, Scalar sy)
Transformpreshear (Scalar sx, Scalar sy)
template<typename OtherDerived >
Transformpretranslate (const MatrixBase< OtherDerived > &other)
template<typename OtherDerived >
Transformpretranslate (const MatrixBase< OtherDerived > &other)
template<typename RotationType >
Transformrotate (const RotationType &rotation)
template<typename RotationType >
Transformrotate (const RotationType &rotation)
LinearMatrixType rotation () const
const LinearMatrixType rotation () const
Transformscale (Scalar s)
template<typename OtherDerived >
Transformscale (const MatrixBase< OtherDerived > &other)
Transformscale (Scalar s)
template<typename OtherDerived >
Transformscale (const MatrixBase< OtherDerived > &other)
void setIdentity ()
void setIdentity ()
Transformshear (Scalar sx, Scalar sy)
Transformshear (Scalar sx, Scalar sy)
 Transform (const Transform &other)
 Transform ()
template<typename Derived >
 Transform (const RotationBase< Derived, Dim > &r)
template<typename Derived >
 Transform (const RotationBase< Derived, Dim > &r)
template<typename OtherScalarType >
 Transform (const Transform< OtherScalarType, Dim, Mode, Options > &other)
template<int OtherOptions>
 Transform (const Transform< Scalar, Dim, Mode, OtherOptions > &other)
template<typename OtherDerived >
 Transform (const MatrixBase< OtherDerived > &other)
 Transform ()
template<typename OtherDerived >
 Transform (const EigenBase< OtherDerived > &other)
template<typename OtherDerived >
 Transform (const ReturnByValue< OtherDerived > &other)
 Transform (const TranslationType &t)
 Transform (const ScalingType &s)
template<typename OtherScalarType >
 Transform (const Transform< OtherScalarType, Dim > &other)
 Transform (const TranslationType &t)
 Transform (const Transform &other)
 Transform (const UniformScaling< Scalar > &s)
template<int OtherMode, int OtherOptions>
 Transform (const Transform< Scalar, Dim, OtherMode, OtherOptions > &other)
template<typename OtherDerived >
Transformtranslate (const MatrixBase< OtherDerived > &other)
template<typename OtherDerived >
Transformtranslate (const MatrixBase< OtherDerived > &other)
ConstTranslationPart translation () const
TranslationPart translation ()
TranslationPart translation ()
ConstTranslationPart translation () const
Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, 1 > translationExt ()
const Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim, 1 > translationExt () const

Static Public Member Functions

static const
MatrixType::IdentityReturnType 
Identity ()
static const Transform Identity ()
 Returns an identity transformation.

Static Protected Member Functions

static EIGEN_STRONG_INLINE void check_template_params ()

Protected Attributes

MatrixType m_matrix

Friends

template<typename OtherDerived >
const ProductReturnType
< OtherDerived, MatrixType >
::Type 
operator* (const MatrixBase< OtherDerived > &a, const Transform &b)
template<typename DiagonalDerived >
TransformTimeDiagonalReturnType operator* (const DiagonalBase< DiagonalDerived > &a, const Transform &b)
template<typename OtherDerived >
const
internal::transform_left_product_impl
< OtherDerived, Mode, Options,
_Dim, _Dim+1 >::ResultType 
operator* (const EigenBase< OtherDerived > &a, const Transform &b)
Transform operator* (const LinearMatrixType &mat, const Transform &t)

Detailed Description

template<typename _Scalar, int _Dim>
class Transform< _Scalar, _Dim >

Represents an homogeneous transformation in a N dimensional space.

Parameters:
_Scalarthe scalar type, i.e., the type of the coefficients
_Dimthe dimension of the space

The homography is internally represented and stored as a (Dim+1)^2 matrix which is available through the matrix() method.

Conversion methods from/to Qt's QMatrix and QTransform are available if the preprocessor token EIGEN_QT_SUPPORT is defined.

See also:
class Matrix, class Quaternion
Template Parameters:
_Scalarthe scalar type, i.e., the type of the coefficients
_Dimthe dimension of the space
_Modethe type of the transformation. Can be:

  • Affine: the transformation is stored as a (Dim+1)^2 matrix, where the last row is assumed to be [0 ... 0 1].
  • AffineCompact: the transformation is stored as a (Dim)x(Dim+1) matrix.
  • Projective: the transformation is stored as a (Dim+1)^2 matrix without any assumption.
_Optionshas the same meaning as in class Matrix. It allows to specify DontAlign and/or RowMajor. These Options are passed directly to the underlying matrix type.

The homography is internally represented and stored by a matrix which is available through the matrix() method. To understand the behavior of this class you have to think a Transform object as its internal matrix representation. The chosen convention is right multiply:

 v' = T * v 

Therefore, an affine transformation matrix M is shaped like this:

$ \left( \begin{array}{cc} linear & translation\\ 0 ... 0 & 1 \end{array} \right) $

Note that for a projective transformation the last row can be anything, and then the interpretation of different parts might be sightly different.

However, unlike a plain matrix, the Transform class provides many features simplifying both its assembly and usage. In particular, it can be composed with any other transformations (Transform,Translation,RotationBase,Matrix) and can be directly used to transform implicit homogeneous vectors. All these operations are handled via the operator*. For the composition of transformations, its principle consists to first convert the right/left hand sides of the product to a compatible (Dim+1)^2 matrix and then perform a pure matrix product. Of course, internally, operator* tries to perform the minimal number of operations according to the nature of each terms. Likewise, when applying the transform to non homogeneous vectors, the latters are automatically promoted to homogeneous one before doing the matrix product. The convertions to homogeneous representations are performed as follow:

Translation t (Dim)x(1): $ \left( \begin{array}{cc} I & t \\ 0\,...\,0 & 1 \end{array} \right) $

Rotation R (Dim)x(Dim): $ \left( \begin{array}{cc} R & 0\\ 0\,...\,0 & 1 \end{array} \right) $

Linear Matrix L (Dim)x(Dim): $ \left( \begin{array}{cc} L & 0\\ 0\,...\,0 & 1 \end{array} \right) $

Affine Matrix A (Dim)x(Dim+1): $ \left( \begin{array}{c} A\\ 0\,...\,0\,1 \end{array} \right) $

Column vector v (Dim)x(1): $ \left( \begin{array}{c} v\\ 1 \end{array} \right) $

Set of column vectors V1...Vn (Dim)x(n): $ \left( \begin{array}{ccc} v_1 & ... & v_n\\ 1 & ... & 1 \end{array} \right) $

The concatenation of a Transform object with any kind of other transformation always returns a Transform object.

A little exception to the "as pure matrix product" rule is the case of the transformation of non homogeneous vectors by an affine transformation. In that case the last matrix row can be ignored, and the product returns non homogeneous vectors.

Since, for instance, a Dim x Dim matrix is interpreted as a linear transformation, it is not possible to directly transform Dim vectors stored in a Dim x Dim matrix. The solution is either to use a Dim x Dynamic matrix or explicitly request a vector transformation by making the vector homogeneous:

 m' = T * m.colwise().homogeneous();

Note that there is zero overhead.

Conversion methods from/to Qt's QMatrix and QTransform are available if the preprocessor token EIGEN_QT_SUPPORT is defined.

This class can be extended with the help of the plugin mechanism described on the page Customizing/Extending Eigen by defining the preprocessor symbol EIGEN_TRANSFORM_PLUGIN.

See also:
class Matrix, class Quaternion

Definition at line 57 of file Transform.h.


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

Generated by  Doxygen 1.6.0   Back to index