Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends

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


Detailed Description

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

Represents an homogeneous transformation in a N dimensional space

Parameters:
_Scalar the scalar type, i.e., the type of the coefficients
_Dim the dimension of the space
_Mode the 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]. This is the default.
  • 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.

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.

See also:
class Matrix, class Quaternion

Definition at line 181 of file Geometry/Transform.h.

#include <src/Geometry/Transform.h>

List of all members.

Public Types

enum  { TransformTimeDiagonalMode = ((Mode==int(Isometry))?Affine:int(Mode)) }
typedef _Scalar Scalar
 the scalar type of the coefficients
typedef DenseIndex Index
typedef Matrix< Scalar, Rows,
HDim > 
MatrixType
 type of the matrix used to represent the transformation
typedef const MatrixType ConstMatrixType
 constified MatrixType
typedef Matrix< Scalar, Dim, Dim > LinearMatrixType
 type of the matrix used to represent the linear part of the transformation
typedef Block< MatrixType, Dim,
Dim > 
LinearPart
 type of read/write reference to the linear part of the transformation
typedef const Block
< ConstMatrixType, Dim, Dim > 
ConstLinearPart
 type of read reference to the linear part of the transformation
typedef internal::conditional
< int(Mode)==int(AffineCompact),
MatrixType &, Block
< MatrixType, Dim, HDim >
>::type 
AffinePart
 type of read/write reference to the affine part of the transformation
typedef internal::conditional
< int(Mode)==int(AffineCompact),
const MatrixType &, const
Block< const MatrixType, Dim,
HDim > >::type 
ConstAffinePart
 type of read reference to the affine part of the transformation
typedef Matrix< Scalar, Dim, 1 > VectorType
 type of a vector
typedef Block< MatrixType, Dim, 1 > TranslationPart
 type of a read/write reference to the translation part of the rotation
typedef const Block
< ConstMatrixType, Dim, 1 > 
ConstTranslationPart
 type of a read reference to the translation part of the rotation
typedef Translation< Scalar, Dim > TranslationType
 corresponding translation type
typedef Transform< Scalar, Dim,
TransformTimeDiagonalMode > 
TransformTimeDiagonalReturnType
 The return type of the product between a diagonal matrix and a transform.
typedef
internal::transform_take_affine_part
< Transform
take_affine_part

Public Member Functions

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE (_Scalar, _Dim==Dynamic?Dynamic:(_Dim+1)*(_Dim+1)) enum
 Transform ()
 Default constructor without initialization of the meaningful coefficients.
 Transform (const Transform &other)
 Transform (const TranslationType &t)
 Transform (const UniformScaling< Scalar > &s)
template<typename Derived >
 Transform (const RotationBase< Derived, Dim > &r)
Transformoperator= (const Transform &other)
template<typename OtherDerived >
 Transform (const EigenBase< OtherDerived > &other)
 Constructs and initializes a transformation from a Dim^2 or a (Dim+1)^2 matrix.
template<typename OtherDerived >
Transformoperator= (const EigenBase< OtherDerived > &other)
 Set *this from a Dim^2 or (Dim+1)^2 matrix.
template<int OtherMode>
 Transform (const Transform< Scalar, Dim, OtherMode > &other)
template<typename OtherDerived >
 Transform (const ReturnByValue< OtherDerived > &other)
template<typename OtherDerived >
Transformoperator= (const ReturnByValue< OtherDerived > &other)
Scalar operator() (Index row, Index col) const
 shortcut for m_matrix(row,col);
Scalaroperator() (Index row, Index col)
 shortcut for m_matrix(row,col);
const MatrixTypematrix () const
MatrixTypematrix ()
ConstLinearPart linear () const
LinearPart linear ()
ConstAffinePart affine () const
AffinePart affine ()
ConstTranslationPart translation () const
TranslationPart translation ()
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 OtherDerived >
Transformoperator*= (const EigenBase< OtherDerived > &other)
const Transform operator* (const Transform &other) const
 Concatenates two transformations.
template<int OtherMode>
const
internal::transform_transform_product_impl
< Transform, Transform< Scalar,
Dim, OtherMode > >::ResultType 
operator* (const Transform< Scalar, Dim, OtherMode > &other) const
 Concatenates two different transformations.
void setIdentity ()
template<typename OtherDerived >
Transformscale (const MatrixBase< OtherDerived > &other)
 Applies on the right the non uniform scale transformation represented by the vector other to *this and returns a reference to *this.
template<typename OtherDerived >
Transformprescale (const MatrixBase< OtherDerived > &other)
 Applies on the left the non uniform scale transformation represented by the vector other to *this and returns a reference to *this.
Transformscale (Scalar s)
 Applies on the right a uniform scale of a factor c to *this and returns a reference to *this.
Transformprescale (Scalar s)
 Applies on the left a uniform scale of a factor c to *this and returns a reference to *this.
template<typename OtherDerived >
Transformtranslate (const MatrixBase< OtherDerived > &other)
 Applies on the right the translation matrix represented by the vector other to *this and returns a reference to *this.
template<typename OtherDerived >
Transformpretranslate (const MatrixBase< OtherDerived > &other)
 Applies on the left the translation matrix represented by the vector other to *this and returns a reference to *this.
template<typename RotationType >
Transformrotate (const RotationType &rotation)
 Applies on the right the rotation represented by the rotation rotation to *this and returns a reference to *this.
template<typename RotationType >
Transformprerotate (const RotationType &rotation)
 Applies on the left the rotation represented by the rotation rotation to *this and returns a reference to *this.
Transformshear (Scalar sx, Scalar sy)
 Applies on the right the shear transformation represented by the vector other to *this and returns a reference to *this.
Transformpreshear (Scalar sx, Scalar sy)
 Applies on the left the shear transformation represented by the vector other to *this and returns a reference to *this.
Transformoperator= (const TranslationType &t)
Transformoperator*= (const TranslationType &t)
Transform operator* (const TranslationType &t) const
Transformoperator= (const UniformScaling< Scalar > &t)
Transformoperator*= (const UniformScaling< Scalar > &s)
Transform operator* (const UniformScaling< Scalar > &s) const
Transformoperator*= (const DiagonalMatrix< Scalar, Dim > &s)
template<typename Derived >
Transformoperator= (const RotationBase< Derived, Dim > &r)
template<typename Derived >
Transformoperator*= (const RotationBase< Derived, Dim > &r)
template<typename Derived >
Transform operator* (const RotationBase< Derived, Dim > &r) const
LinearMatrixType rotation () const
template<typename RotationMatrixType , typename ScalingMatrixType >
void computeRotationScaling (RotationMatrixType *rotation, ScalingMatrixType *scaling) const
 decomposes the linear part of the transformation as a product rotation x scaling, the scaling being not necessarily positive.
template<typename ScalingMatrixType , typename RotationMatrixType >
void computeScalingRotation (ScalingMatrixType *scaling, RotationMatrixType *rotation) const
 decomposes the linear part of the transformation as a product rotation x scaling, the scaling being not necessarily positive.
template<typename PositionDerived , typename OrientationType , typename ScaleDerived >
TransformfromPositionOrientationScale (const MatrixBase< PositionDerived > &position, const OrientationType &orientation, const MatrixBase< ScaleDerived > &scale)
 Convenient method to set *this from a position, orientation and scale of a 3D object.
Transform inverse (TransformTraits traits=(TransformTraits) Mode) const
const Scalardata () const
Scalardata ()
template<typename NewScalarType >
internal::cast_return_type
< Transform, Transform
< NewScalarType, Dim, Mode >
>::type 
cast () const
template<typename OtherScalarType >
 Transform (const Transform< OtherScalarType, Dim, Mode > &other)
 Copy constructor with scalar type conversion.
bool isApprox (const Transform &other, typename NumTraits< Scalar >::Real prec=NumTraits< Scalar >::dummy_precision()) const
void makeAffine ()
 Sets the last row to [0 ...
Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim,
Dim > 
linearExt ()
const Block< MatrixType, int(Mode)==int(Projective)?HDim:Dim,
Dim > 
linearExt () 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 Transform Identity ()
 Returns an identity transformation.

Protected Attributes

MatrixType m_matrix

Friends

template<typename OtherDerived >
const
internal::transform_left_product_impl
< OtherDerived, Mode, _Dim,
_Dim+1 >::ResultType 
operator* (const EigenBase< OtherDerived > &a, const Transform &b)
template<typename DiagonalDerived >
TransformTimeDiagonalReturnType operator* (const DiagonalBase< DiagonalDerived > &a, const Transform &b)

Member Typedef Documentation

template<typename _Scalar, int _Dim, int _Mode>
typedef internal::conditional<int(Mode)==int(AffineCompact), MatrixType&, Block<MatrixType,Dim,HDim> >::type Transform< _Scalar, _Dim, _Mode >::AffinePart

type of read/write reference to the affine part of the transformation

Definition at line 207 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
typedef internal::conditional<int(Mode)==int(AffineCompact), const MatrixType&, const Block<const MatrixType,Dim,HDim> >::type Transform< _Scalar, _Dim, _Mode >::ConstAffinePart

type of read reference to the affine part of the transformation

Definition at line 211 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
typedef const Block<ConstMatrixType,Dim,Dim> Transform< _Scalar, _Dim, _Mode >::ConstLinearPart

type of read reference to the linear part of the transformation

Definition at line 203 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
typedef const MatrixType Transform< _Scalar, _Dim, _Mode >::ConstMatrixType

constified MatrixType

Definition at line 197 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
typedef const Block<ConstMatrixType,Dim,1> Transform< _Scalar, _Dim, _Mode >::ConstTranslationPart

type of a read reference to the translation part of the rotation

Definition at line 217 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
typedef DenseIndex Transform< _Scalar, _Dim, _Mode >::Index

Definition at line 193 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
typedef Matrix<Scalar,Dim,Dim> Transform< _Scalar, _Dim, _Mode >::LinearMatrixType

type of the matrix used to represent the linear part of the transformation

Definition at line 199 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
typedef Block<MatrixType,Dim,Dim> Transform< _Scalar, _Dim, _Mode >::LinearPart

type of read/write reference to the linear part of the transformation

Definition at line 201 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
typedef Matrix<Scalar,Rows,HDim> Transform< _Scalar, _Dim, _Mode >::MatrixType

type of the matrix used to represent the transformation

Definition at line 195 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
typedef _Scalar Transform< _Scalar, _Dim, _Mode >::Scalar

the scalar type of the coefficients

Definition at line 190 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
typedef internal::transform_take_affine_part<Transform> Transform< _Scalar, _Dim, _Mode >::take_affine_part

Definition at line 253 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
typedef Transform<Scalar,Dim,TransformTimeDiagonalMode> Transform< _Scalar, _Dim, _Mode >::TransformTimeDiagonalReturnType

The return type of the product between a diagonal matrix and a transform.

Definition at line 224 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
typedef Block<MatrixType,Dim,1> Transform< _Scalar, _Dim, _Mode >::TranslationPart

type of a read/write reference to the translation part of the rotation

Definition at line 215 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
typedef Translation<Scalar,Dim> Transform< _Scalar, _Dim, _Mode >::TranslationType

corresponding translation type

Definition at line 219 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
typedef Matrix<Scalar,Dim,1> Transform< _Scalar, _Dim, _Mode >::VectorType

type of a vector

Definition at line 213 of file Geometry/Transform.h.


Member Enumeration Documentation

template<typename _Scalar, int _Dim, int _Mode>
anonymous enum
Enumerator:
TransformTimeDiagonalMode 

Definition at line 222 of file Geometry/Transform.h.


Constructor & Destructor Documentation

template<typename _Scalar, int _Dim, int _Mode>
Transform< _Scalar, _Dim, _Mode >::Transform (  )  [inline]

Default constructor without initialization of the meaningful coefficients.

If Mode==Affine, then the last row is set to [0 ... 0 1]

Definition at line 234 of file Geometry/Transform.h.

References Affine.

template<typename _Scalar, int _Dim, int _Mode>
Transform< _Scalar, _Dim, _Mode >::Transform ( const Transform< _Scalar, _Dim, _Mode > &  other  )  [inline]

Definition at line 240 of file Geometry/Transform.h.

References Transform< _Scalar, _Dim, _Mode >::m_matrix.

template<typename _Scalar, int _Dim, int _Mode>
Transform< _Scalar, _Dim, _Mode >::Transform ( const TranslationType t  )  [inline, explicit]

Definition at line 245 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
Transform< _Scalar, _Dim, _Mode >::Transform ( const UniformScaling< Scalar > &  s  )  [inline, explicit]

Definition at line 246 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
template<typename Derived >
Transform< _Scalar, _Dim, _Mode >::Transform ( const RotationBase< Derived, Dim > &  r  )  [inline, explicit]

Definition at line 248 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
template<typename OtherDerived >
Transform< _Scalar, _Dim, _Mode >::Transform ( const EigenBase< OtherDerived > &  other  )  [inline, explicit]

Constructs and initializes a transformation from a Dim^2 or a (Dim+1)^2 matrix.

Definition at line 257 of file Geometry/Transform.h.

References EigenBase< Derived >::derived().

template<typename _Scalar, int _Dim, int _Mode>
template<int OtherMode>
Transform< _Scalar, _Dim, _Mode >::Transform ( const Transform< Scalar, Dim, OtherMode > &  other  )  [inline]
template<typename _Scalar, int _Dim, int _Mode>
template<typename OtherDerived >
Transform< _Scalar, _Dim, _Mode >::Transform ( const ReturnByValue< OtherDerived > &  other  )  [inline]

Definition at line 311 of file Geometry/Transform.h.

References ReturnByValue< Derived >::evalTo().

template<typename _Scalar, int _Dim, int _Mode>
template<typename OtherScalarType >
Transform< _Scalar, _Dim, _Mode >::Transform ( const Transform< OtherScalarType, Dim, Mode > &  other  )  [inline, explicit]

Copy constructor with scalar type conversion.

Definition at line 520 of file Geometry/Transform.h.

References Transform< _Scalar, _Dim, _Mode >::matrix().


Member Function Documentation

template<typename _Scalar, int _Dim, int _Mode>
ConstAffinePart Transform< _Scalar, _Dim, _Mode >::affine (  )  const [inline]
template<typename _Scalar, int _Dim, int _Mode>
AffinePart Transform< _Scalar, _Dim, _Mode >::affine (  )  [inline]
Returns:
a writable expression of the Dim x HDim affine part of the transformation

Definition at line 352 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
template<typename NewScalarType >
internal::cast_return_type<Transform,Transform<NewScalarType,Dim,Mode> >::type Transform< _Scalar, _Dim, _Mode >::cast (  )  const [inline]
Returns:
*this with scalar type casted to NewScalarType

Note that if NewScalarType is equal to the current scalar type of *this then this function smartly returns a const reference to *this.

Definition at line 515 of file Geometry/Transform.h.

template<typename Scalar , int Dim, int Mode>
template<typename RotationMatrixType , typename ScalingMatrixType >
void Transform< Scalar, Dim, Mode >::computeRotationScaling ( RotationMatrixType *  rotation,
ScalingMatrixType *  scaling 
) const

decomposes the linear part of the transformation as a product rotation x scaling, the scaling being not necessarily positive.

If either pointer is zero, the corresponding computation is skipped.

See also:
computeScalingRotation(), rotation(), class SVD

Definition at line 950 of file Geometry/Transform.h.

References ComputeFullU, ComputeFullV, Transform< _Scalar, _Dim, _Mode >::linear(), JacobiSVD< _MatrixType, QRPreconditioner >::matrixU(), JacobiSVD< _MatrixType, QRPreconditioner >::matrixV(), and JacobiSVD< _MatrixType, QRPreconditioner >::singularValues().

Referenced by Transform< _Scalar, _Dim, _Mode >::rotation().

template<typename Scalar , int Dim, int Mode>
template<typename ScalingMatrixType , typename RotationMatrixType >
void Transform< Scalar, Dim, Mode >::computeScalingRotation ( ScalingMatrixType *  scaling,
RotationMatrixType *  rotation 
) const

decomposes the linear part of the transformation as a product rotation x scaling, the scaling being not necessarily positive.

If either pointer is zero, the corresponding computation is skipped.

See also:
computeRotationScaling(), rotation(), class SVD

Definition at line 979 of file Geometry/Transform.h.

References ComputeFullU, ComputeFullV, Transform< _Scalar, _Dim, _Mode >::linear(), JacobiSVD< _MatrixType, QRPreconditioner >::matrixU(), JacobiSVD< _MatrixType, QRPreconditioner >::matrixV(), and JacobiSVD< _MatrixType, QRPreconditioner >::singularValues().

template<typename _Scalar, int _Dim, int _Mode>
const Scalar* Transform< _Scalar, _Dim, _Mode >::data (  )  const [inline]
Returns:
a const pointer to the column major internal matrix

Definition at line 505 of file Geometry/Transform.h.

References PlainObjectBase< Derived >::data().

template<typename _Scalar, int _Dim, int _Mode>
Scalar* Transform< _Scalar, _Dim, _Mode >::data (  )  [inline]
Returns:
a non-const pointer to the column major internal matrix

Definition at line 507 of file Geometry/Transform.h.

References PlainObjectBase< Derived >::data().

template<typename _Scalar, int _Dim, int _Mode>
Transform< _Scalar, _Dim, _Mode >::EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE ( _Scalar  ,
_Dim  = =Dynamic ? Dynamic : (_Dim+1)*(_Dim+1) 
) [inline]

< space dimension in which the transformation holds

< size of a respective homogeneous vector

Definition at line 184 of file Geometry/Transform.h.

template<typename Scalar , int Dim, int Mode>
template<typename PositionDerived , typename OrientationType , typename ScaleDerived >
Transform< Scalar, Dim, Mode > & Transform< Scalar, Dim, Mode >::fromPositionOrientationScale ( const MatrixBase< PositionDerived > &  position,
const OrientationType &  orientation,
const MatrixBase< ScaleDerived > &  scale 
)

Convenient method to set *this from a position, orientation and scale of a 3D object.

Definition at line 1001 of file Geometry/Transform.h.

References MatrixBase< Derived >::asDiagonal(), Transform< _Scalar, _Dim, _Mode >::linear(), Transform< _Scalar, _Dim, _Mode >::makeAffine(), and Transform< _Scalar, _Dim, _Mode >::translation().

template<typename _Scalar, int _Dim, int _Mode>
static const Transform Transform< _Scalar, _Dim, _Mode >::Identity (  )  [inline, static]

Returns an identity transformation.

Todo:
In the future this function should be returning a Transform expression.

Definition at line 446 of file Geometry/Transform.h.

template<typename Scalar , int Dim, int Mode>
Transform< Scalar, Dim, Mode > Transform< Scalar, Dim, Mode >::inverse ( TransformTraits  hint = (TransformTraits)Mode  )  const [inline]
Returns:
the inverse transformation according to some given knowledge on *this.
Parameters:
hint allows to optimize the inversion process when the transformation is known to be not a general transformation. The possible values are:

  • Projective if the transformation is not necessarily affine, i.e., if the last row is not guaranteed to be [0 ... 0 1]
  • Affine is the default, the last row is assumed to be [0 ... 0 1]
  • Isometry if the transformation is only a concatenations of translations and rotations.
Warning:
unless traits is always set to NoShear or NoScaling, this function requires the generic inverse method of MatrixBase defined in the LU module. If you forget to include this module, then you will get hard to debug linking errors.
See also:
MatrixBase::inverse()

Definition at line 1054 of file Geometry/Transform.h.

References Affine, eigen_assert, Isometry, Transform< _Scalar, _Dim, _Mode >::linear(), Transform< _Scalar, _Dim, _Mode >::makeAffine(), Transform< _Scalar, _Dim, _Mode >::matrix(), Projective, and Transform< _Scalar, _Dim, _Mode >::translation().

template<typename _Scalar, int _Dim, int _Mode>
bool Transform< _Scalar, _Dim, _Mode >::isApprox ( const Transform< _Scalar, _Dim, _Mode > &  other,
typename NumTraits< Scalar >::Real  prec = NumTraits<Scalar>::dummy_precision() 
) const [inline]
Returns:
true if *this is approximately equal to other, within the precision determined by prec.
See also:
MatrixBase::isApprox()

Definition at line 527 of file Geometry/Transform.h.

References Transform< _Scalar, _Dim, _Mode >::m_matrix.

template<typename _Scalar, int _Dim, int _Mode>
ConstLinearPart Transform< _Scalar, _Dim, _Mode >::linear (  )  const [inline]
template<typename _Scalar, int _Dim, int _Mode>
LinearPart Transform< _Scalar, _Dim, _Mode >::linear (  )  [inline]
Returns:
a writable expression of the linear part of the transformation

Definition at line 347 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
Block<MatrixType,int(Mode)==int(Projective)?HDim:Dim,Dim> Transform< _Scalar, _Dim, _Mode >::linearExt (  )  [inline]
template<typename _Scalar, int _Dim, int _Mode>
const Block<MatrixType,int(Mode)==int(Projective)?HDim:Dim,Dim> Transform< _Scalar, _Dim, _Mode >::linearExt (  )  const [inline]

Definition at line 551 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
void Transform< _Scalar, _Dim, _Mode >::makeAffine (  )  [inline]
template<typename _Scalar, int _Dim, int _Mode>
MatrixType& Transform< _Scalar, _Dim, _Mode >::matrix (  )  [inline]
Returns:
a writable expression of the transformation matrix

Definition at line 342 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
const MatrixType& Transform< _Scalar, _Dim, _Mode >::matrix (  )  const [inline]
template<typename _Scalar, int _Dim, int _Mode>
Scalar Transform< _Scalar, _Dim, _Mode >::operator() ( Index  row,
Index  col 
) const [inline]

shortcut for m_matrix(row,col);

See also:
MatrixBase::operator(Index,Index) const

Definition at line 334 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
Scalar& Transform< _Scalar, _Dim, _Mode >::operator() ( Index  row,
Index  col 
) [inline]

shortcut for m_matrix(row,col);

See also:
MatrixBase::operator(Index,Index)

Definition at line 337 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
template<typename DiagonalDerived >
const TransformTimeDiagonalReturnType Transform< _Scalar, _Dim, _Mode >::operator* ( const DiagonalBase< DiagonalDerived > &  b  )  const [inline]
Returns:
The product expression of a transform a times a diagonal matrix b

The rhs diagonal matrix is interpreted as an affine scaling transformation. The product results in a Transform of the same type (mode) as the lhs only if the lhs mode is no isometry. In that case, the returned transform is an affinity.

Definition at line 396 of file Geometry/Transform.h.

References Transform< _Scalar, _Dim, _Mode >::linear().

template<typename Scalar , int Dim, int Mode>
Transform< Scalar, Dim, Mode > Transform< Scalar, Dim, Mode >::operator* ( const TranslationType t  )  const [inline]
template<typename _Scalar, int _Dim, int _Mode>
const Transform Transform< _Scalar, _Dim, _Mode >::operator* ( const Transform< _Scalar, _Dim, _Mode > &  other  )  const [inline]

Concatenates two transformations.

Definition at line 425 of file Geometry/Transform.h.

template<typename Scalar , int Dim, int Mode>
Transform< Scalar, Dim, Mode > Transform< Scalar, Dim, Mode >::operator* ( const UniformScaling< Scalar > &  s  )  const [inline]
template<typename _Scalar, int _Dim, int _Mode>
template<int OtherMode>
const internal::transform_transform_product_impl< Transform,Transform<Scalar,Dim,OtherMode> >::ResultType Transform< _Scalar, _Dim, _Mode >::operator* ( const Transform< Scalar, Dim, OtherMode > &  other  )  const [inline]

Concatenates two different transformations.

Definition at line 434 of file Geometry/Transform.h.

template<typename Scalar , int Dim, int Mode>
template<typename Derived>
Transform< Scalar, Dim, Mode > Transform< Scalar, Dim, Mode >::operator* ( const RotationBase< Derived, Dim > &  r  )  const [inline]
template<typename _Scalar, int _Dim, int _Mode>
template<typename OtherDerived >
EIGEN_STRONG_INLINE const internal::transform_right_product_impl<Transform, OtherDerived>::ResultType Transform< _Scalar, _Dim, _Mode >::operator* ( const EigenBase< OtherDerived > &  other  )  const [inline]
Returns:
an expression of the product between the transform *this and a matrix expression other

The right hand side other might be either:

  • a vector of size Dim,
  • an homogeneous vector of size Dim+1,
  • a set of vectors of size Dim x Dynamic,
  • a set of homogeneous vectors of size Dim+1 x Dynamic,
  • a linear transformation matrix of size Dim x Dim,
  • an affine transformation matrix of size Dim x Dim+1,
  • a transformation matrix of size Dim+1 x Dim+1.

Definition at line 373 of file Geometry/Transform.h.

References EigenBase< Derived >::derived().

template<typename _Scalar, int _Dim, int _Mode>
Transform& Transform< _Scalar, _Dim, _Mode >::operator*= ( const TranslationType t  )  [inline]

Definition at line 476 of file Geometry/Transform.h.

References Translation< _Scalar, _Dim >::vector().

template<typename _Scalar, int _Dim, int _Mode>
template<typename OtherDerived >
Transform& Transform< _Scalar, _Dim, _Mode >::operator*= ( const EigenBase< OtherDerived > &  other  )  [inline]

Definition at line 422 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
template<typename Derived >
Transform& Transform< _Scalar, _Dim, _Mode >::operator*= ( const RotationBase< Derived, Dim > &  r  )  [inline]
template<typename _Scalar, int _Dim, int _Mode>
Transform& Transform< _Scalar, _Dim, _Mode >::operator*= ( const UniformScaling< Scalar > &  s  )  [inline]

Definition at line 480 of file Geometry/Transform.h.

References UniformScaling< _Scalar >::factor().

template<typename _Scalar, int _Dim, int _Mode>
Transform& Transform< _Scalar, _Dim, _Mode >::operator*= ( const DiagonalMatrix< Scalar, Dim > &  s  )  [inline]

Definition at line 483 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
Transform& Transform< _Scalar, _Dim, _Mode >::operator= ( const Transform< _Scalar, _Dim, _Mode > &  other  )  [inline]

Definition at line 250 of file Geometry/Transform.h.

References Transform< _Scalar, _Dim, _Mode >::m_matrix.

template<typename Scalar , int Dim, int Mode>
Transform< Scalar, Dim, Mode > & Transform< Scalar, Dim, Mode >::operator= ( const TranslationType t  )  [inline]
template<typename _Scalar, int _Dim, int _Mode>
template<typename OtherDerived >
Transform& Transform< _Scalar, _Dim, _Mode >::operator= ( const ReturnByValue< OtherDerived > &  other  )  [inline]

Definition at line 317 of file Geometry/Transform.h.

References ReturnByValue< Derived >::evalTo().

template<typename Scalar , int Dim, int Mode>
Transform< Scalar, Dim, Mode > & Transform< Scalar, Dim, Mode >::operator= ( const UniformScaling< Scalar > &  t  )  [inline]
template<typename Scalar , int Dim, int Mode>
template<typename Derived >
Transform< Scalar, Dim, Mode > & Transform< Scalar, Dim, Mode >::operator= ( const RotationBase< Derived, Dim > &  r  )  [inline]
template<typename _Scalar, int _Dim, int _Mode>
template<typename OtherDerived >
Transform& Transform< _Scalar, _Dim, _Mode >::operator= ( const EigenBase< OtherDerived > &  other  )  [inline]

Set *this from a Dim^2 or (Dim+1)^2 matrix.

Definition at line 264 of file Geometry/Transform.h.

References EigenBase< Derived >::derived().

template<typename Scalar , int Dim, int Mode>
template<typename RotationType >
Transform< Scalar, Dim, Mode > & Transform< Scalar, Dim, Mode >::prerotate ( const RotationType &  rotation  )  [inline]

Applies on the left the rotation represented by the rotation rotation to *this and returns a reference to *this.

See rotate() for further details.

See also:
rotate()

Definition at line 821 of file Geometry/Transform.h.

template<typename Scalar , int Dim, int Mode>
template<typename OtherDerived >
Transform< Scalar, Dim, Mode > & Transform< Scalar, Dim, Mode >::prescale ( const MatrixBase< OtherDerived > &  other  )  [inline]

Applies on the left the non uniform scale transformation represented by the vector other to *this and returns a reference to *this.

See also:
scale()

Definition at line 734 of file Geometry/Transform.h.

References MatrixBase< Derived >::asDiagonal(), EIGEN_STATIC_ASSERT, EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, and Isometry.

Referenced by UniformScaling< _Scalar >::operator*().

template<typename Scalar , int Dim, int Mode>
Transform< Scalar, Dim, Mode > & Transform< Scalar, Dim, Mode >::prescale ( Scalar  s  )  [inline]

Applies on the left a uniform scale of a factor c to *this and returns a reference to *this.

See also:
scale(Scalar)

Definition at line 747 of file Geometry/Transform.h.

References EIGEN_STATIC_ASSERT, and Isometry.

template<typename Scalar , int Dim, int Mode>
Transform< Scalar, Dim, Mode > & Transform< Scalar, Dim, Mode >::preshear ( Scalar  sx,
Scalar  sy 
)

Applies on the left the shear transformation represented by the vector other to *this and returns a reference to *this.

Warning:
2D only.
See also:
shear()

Definition at line 851 of file Geometry/Transform.h.

References EIGEN_STATIC_ASSERT, and Isometry.

template<typename Scalar , int Dim, int Mode>
template<typename OtherDerived >
Transform< Scalar, Dim, Mode > & Transform< Scalar, Dim, Mode >::pretranslate ( const MatrixBase< OtherDerived > &  other  )  [inline]

Applies on the left the translation matrix represented by the vector other to *this and returns a reference to *this.

See also:
translate()

Definition at line 775 of file Geometry/Transform.h.

References Transform< _Scalar, _Dim, _Mode >::affine(), EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, Projective, and Transform< _Scalar, _Dim, _Mode >::translation().

Referenced by Translation< _Scalar, _Dim >::operator*().

template<typename Scalar , int Dim, int Mode>
template<typename RotationType >
Transform< Scalar, Dim, Mode > & Transform< Scalar, Dim, Mode >::rotate ( const RotationType &  rotation  )  [inline]

Applies on the right the rotation represented by the rotation rotation to *this and returns a reference to *this.

The template parameter RotationType is the type of the rotation which must be known by internal::toRotationMatrix<>.

Natively supported types includes:

This mechanism is easily extendable to support user types such as Euler angles, or a pair of Quaternion for 4D rotations.

See also:
rotate(Scalar), class Quaternion, class AngleAxis, prerotate(RotationType)

Definition at line 805 of file Geometry/Transform.h.

References Transform< _Scalar, _Dim, _Mode >::linearExt().

Referenced by Transform< _Scalar, _Dim, _Mode >::operator*().

template<typename Scalar , int Dim, int Mode>
Transform< Scalar, Dim, Mode >::LinearMatrixType Transform< Scalar, Dim, Mode >::rotation (  )  const
Returns:
the rotation part of the transformation
See also:
computeRotationScaling(), computeScalingRotation(), class SVD

Definition at line 929 of file Geometry/Transform.h.

References Transform< _Scalar, _Dim, _Mode >::computeRotationScaling().

template<typename Scalar , int Dim, int Mode>
Transform< Scalar, Dim, Mode > & Transform< Scalar, Dim, Mode >::scale ( Scalar  s  )  [inline]

Applies on the right a uniform scale of a factor c to *this and returns a reference to *this.

See also:
prescale(Scalar)

Definition at line 720 of file Geometry/Transform.h.

References EIGEN_STATIC_ASSERT, Isometry, and Transform< _Scalar, _Dim, _Mode >::linearExt().

template<typename Scalar , int Dim, int Mode>
template<typename OtherDerived >
Transform< Scalar, Dim, Mode > & Transform< Scalar, Dim, Mode >::scale ( const MatrixBase< OtherDerived > &  other  )  [inline]

Applies on the right the non uniform scale transformation represented by the vector other to *this and returns a reference to *this.

See also:
prescale()

Definition at line 707 of file Geometry/Transform.h.

References MatrixBase< Derived >::asDiagonal(), EIGEN_STATIC_ASSERT, EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, Isometry, and Transform< _Scalar, _Dim, _Mode >::linearExt().

Referenced by Transform< _Scalar, _Dim, _Mode >::operator*().

template<typename _Scalar, int _Dim, int _Mode>
void Transform< _Scalar, _Dim, _Mode >::setIdentity (  )  [inline]
See also:
MatrixBase::setIdentity()

Definition at line 440 of file Geometry/Transform.h.

template<typename Scalar , int Dim, int Mode>
Transform< Scalar, Dim, Mode > & Transform< Scalar, Dim, Mode >::shear ( Scalar  sx,
Scalar  sy 
)

Applies on the right the shear transformation represented by the vector other to *this and returns a reference to *this.

Warning:
2D only.
See also:
preshear()

Definition at line 835 of file Geometry/Transform.h.

References EIGEN_STATIC_ASSERT, Isometry, and Transform< _Scalar, _Dim, _Mode >::linear().

template<typename Scalar , int Dim, int Mode>
template<typename OtherDerived >
Transform< Scalar, Dim, Mode > & Transform< Scalar, Dim, Mode >::translate ( const MatrixBase< OtherDerived > &  other  )  [inline]

Applies on the right the translation matrix represented by the vector other to *this and returns a reference to *this.

See also:
pretranslate()

Definition at line 761 of file Geometry/Transform.h.

References EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE, Transform< _Scalar, _Dim, _Mode >::linearExt(), and Transform< _Scalar, _Dim, _Mode >::translationExt().

Referenced by Transform< _Scalar, _Dim, _Mode >::operator*().

template<typename _Scalar, int _Dim, int _Mode>
ConstTranslationPart Transform< _Scalar, _Dim, _Mode >::translation (  )  const [inline]
template<typename _Scalar, int _Dim, int _Mode>
TranslationPart Transform< _Scalar, _Dim, _Mode >::translation (  )  [inline]
Returns:
a writable expression of the translation vector of the transformation

Definition at line 357 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
const Block<MatrixType,int(Mode)==int(Projective)?HDim:Dim,1> Transform< _Scalar, _Dim, _Mode >::translationExt (  )  const [inline]

Definition at line 564 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
Block<MatrixType,int(Mode)==int(Projective)?HDim:Dim,1> Transform< _Scalar, _Dim, _Mode >::translationExt (  )  [inline]

Definition at line 558 of file Geometry/Transform.h.

Referenced by Transform< _Scalar, _Dim, _Mode >::translate().


Friends And Related Function Documentation

template<typename _Scalar, int _Dim, int _Mode>
template<typename OtherDerived >
const internal::transform_left_product_impl<OtherDerived,Mode,_Dim,_Dim+1>::ResultType operator* ( const EigenBase< OtherDerived > &  a,
const Transform< _Scalar, _Dim, _Mode > &  b 
) [friend]
Returns:
the product expression of a transformation matrix a times a transform b

The left hand side other might be either:

  • a linear transformation matrix of size Dim x Dim,
  • an affine transformation matrix of size Dim x Dim+1,
  • a general transformation matrix of size Dim+1 x Dim+1.

Definition at line 385 of file Geometry/Transform.h.

template<typename _Scalar, int _Dim, int _Mode>
template<typename DiagonalDerived >
TransformTimeDiagonalReturnType operator* ( const DiagonalBase< DiagonalDerived > &  a,
const Transform< _Scalar, _Dim, _Mode > &  b 
) [friend]
Returns:
The product expression of a diagonal matrix a times a transform b

The lhs diagonal matrix is interpreted as an affine scaling transformation. The product results in a Transform of the same type (mode) as the lhs only if the lhs mode is no isometry. In that case, the returned transform is an affinity.

Definition at line 411 of file Geometry/Transform.h.


Member Data Documentation

template<typename _Scalar, int _Dim, int _Mode>
MatrixType Transform< _Scalar, _Dim, _Mode >::m_matrix [protected]



Page generated by Doxygen 1.7.1 for MRPT 0.9.4 SVN: at Mon Jan 10 23:33:19 UTC 2011