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

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

#include <Transform.h>

List of all members.

Classes

struct  construct_from_matrix
struct  construct_from_matrix< OtherDerived, true >

Public Types

typedef Matrix< Scalar, Dim, Dim > LinearMatrixType
typedef Block< MatrixType, Dim,
Dim > 
LinearPart
typedef Matrix< Scalar, HDim,
HDim > 
MatrixType
typedef _Scalar Scalar
typedef Scaling< Scalar, Dim > ScalingType
typedef Block< MatrixType, Dim, 1 > TranslationPart
typedef Translation< Scalar, Dim > TranslationType
typedef Matrix< Scalar, Dim, 1 > VectorType

Public Member Functions

template<typename NewScalarType >
ei_cast_return_type< Transform,
Transform< NewScalarType, Dim >
>::type 
cast () 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
Scalardata ()
const Scalardata () const
 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)
const MatrixType inverse (TransformTraits traits=Affine) const
bool isApprox (const Transform &other, typename NumTraits< Scalar >::Real prec=precision< Scalar >()) const
LinearPart linear ()
const LinearPart linear () const
MatrixTypematrix ()
const MatrixTypematrix () const
Scalaroperator() (int row, int col)
Scalar operator() (int row, int col) const
template<typename Derived >
Transform operator* (const RotationBase< Derived, Dim > &r) const
Transform operator* (const ScalingType &s) const
Transform operator* (const TranslationType &t) const
const Transform operator* (const Transform &other) const
template<typename OtherDerived >
const
ei_transform_product_impl
< OtherDerived, _Dim, _Dim+1 >
::ResultType 
operator* (const MatrixBase< OtherDerived > &other) const
template<typename Derived >
Transformoperator*= (const RotationBase< Derived, Dim > &r)
Transformoperator*= (const ScalingType &s)
Transformoperator*= (const TranslationType &t)
template<typename Derived >
Transformoperator= (const RotationBase< Derived, Dim > &r)
Transformoperator= (const ScalingType &t)
Transformoperator= (const TranslationType &t)
template<typename OtherDerived >
Transformoperator= (const MatrixBase< OtherDerived > &other)
Transformoperator= (const Transform &other)
template<typename RotationType >
Transformprerotate (const RotationType &rotation)
Transformprescale (Scalar s)
template<typename OtherDerived >
Transformprescale (const MatrixBase< OtherDerived > &other)
Transformpreshear (Scalar sx, Scalar sy)
template<typename OtherDerived >
Transformpretranslate (const MatrixBase< OtherDerived > &other)
template<typename RotationType >
Transformrotate (const RotationType &rotation)
LinearMatrixType rotation () const
Transformscale (Scalar s)
template<typename OtherDerived >
Transformscale (const MatrixBase< OtherDerived > &other)
void setIdentity ()
Transformshear (Scalar sx, Scalar sy)
template<typename OtherScalarType >
 Transform (const Transform< OtherScalarType, Dim > &other)
template<typename OtherDerived >
 Transform (const MatrixBase< OtherDerived > &other)
template<typename Derived >
 Transform (const RotationBase< Derived, Dim > &r)
 Transform (const ScalingType &s)
 Transform (const TranslationType &t)
 Transform (const Transform &other)
 Transform ()
template<typename OtherDerived >
Transformtranslate (const MatrixBase< OtherDerived > &other)
TranslationPart translation ()
const TranslationPart translation () const

Static Public Member Functions

static const
MatrixType::IdentityReturnType 
Identity ()

Protected Attributes

MatrixType m_matrix

Friends

Transform operator* (const LinearMatrixType &mat, const Transform &t)
template<typename OtherDerived >
const ProductReturnType
< OtherDerived, MatrixType >
::Type 
operator* (const MatrixBase< OtherDerived > &a, const Transform &b)

Detailed Description

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

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

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

Definition at line 64 of file Transform.h.


Member Typedef Documentation

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

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

Definition at line 77 of file Transform.h.

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

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

Definition at line 79 of file Transform.h.

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

type of the matrix used to represent the transformation

Definition at line 75 of file Transform.h.

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

the scalar type of the coefficients

Definition at line 71 of file Transform.h.

template<typename _Scalar, int _Dim>
typedef Scaling<Scalar,Dim> Transform< _Scalar, _Dim >::ScalingType

corresponding scaling transformation type

Definition at line 87 of file Transform.h.

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

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

Definition at line 83 of file Transform.h.

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

corresponding translation type

Definition at line 85 of file Transform.h.

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

type of a vector

Definition at line 81 of file Transform.h.


Constructor & Destructor Documentation

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

Default constructor without initialization of the coefficients.

Definition at line 96 of file Transform.h.

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

Definition at line 98 of file Transform.h.

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

Definition at line 103 of file Transform.h.

template<typename _Scalar, int _Dim>
Transform< _Scalar, _Dim >::Transform ( const ScalingType s  )  [inline, explicit]

Definition at line 104 of file Transform.h.

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

Definition at line 106 of file Transform.h.

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

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

Definition at line 133 of file Transform.h.

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

Copy constructor with scalar type conversion

Definition at line 280 of file Transform.h.


Member Function Documentation

template<typename _Scalar, int _Dim>
template<typename NewScalarType >
ei_cast_return_type<Transform,Transform<NewScalarType,Dim> >::type Transform< _Scalar, _Dim >::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 275 of file Transform.h.

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

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 636 of file Transform.h.

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

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 654 of file Transform.h.

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

Definition at line 267 of file Transform.h.

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

Definition at line 265 of file Transform.h.

template<typename _Scalar, int _Dim>
Transform< _Scalar, _Dim >::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 67 of file Transform.h.

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

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

Definition at line 665 of file Transform.h.

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

Definition at line 201 of file Transform.h.

template<typename Scalar , int Dim>
const Transform< Scalar, Dim >::MatrixType Transform< Scalar, Dim >::inverse ( TransformTraits  traits = Affine  )  const [inline]
Returns:
the inverse transformation matrix according to some given knowledge on *this.
Parameters:
traits allows to optimize the inversion process when the transformion 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 697 of file Transform.h.

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

Definition at line 287 of file Transform.h.

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

Definition at line 167 of file Transform.h.

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

Definition at line 165 of file Transform.h.

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

Definition at line 162 of file Transform.h.

template<typename _Scalar, int _Dim>
const MatrixType& Transform< _Scalar, _Dim >::matrix (  )  const [inline]
Returns:
a read-only expression of the transformation matrix

Definition at line 160 of file Transform.h.

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

shortcut for m_matrix(row,col);

See also:
MatrixBase::operaror(int,int)

Definition at line 157 of file Transform.h.

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

shortcut for m_matrix(row,col);

See also:
MatrixBase::operaror(int,int) const

Definition at line 154 of file Transform.h.

template<typename Scalar , int Dim>
template<typename Derived >
Transform< Scalar, Dim > Transform< Scalar, Dim >::operator* ( const RotationBase< Derived, Dim > &  r  )  const [inline]

Definition at line 595 of file Transform.h.

template<typename Scalar , int Dim>
Transform< Scalar, Dim > Transform< Scalar, Dim >::operator* ( const ScalingType s  )  const [inline]

Definition at line 575 of file Transform.h.

template<typename Scalar , int Dim>
Transform< Scalar, Dim > Transform< Scalar, Dim >::operator* ( const TranslationType t  )  const [inline]

Definition at line 558 of file Transform.h.

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

Contatenates two transformations

Definition at line 196 of file Transform.h.

template<typename _Scalar, int _Dim>
template<typename OtherDerived >
const ei_transform_product_impl<OtherDerived,_Dim,_Dim+1>::ResultType Transform< _Scalar, _Dim >::operator* ( const MatrixBase< 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 transformation matrix of size Dim+1 x Dim+1.

Definition at line 184 of file Transform.h.

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

Definition at line 248 of file Transform.h.

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

Definition at line 235 of file Transform.h.

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

Definition at line 231 of file Transform.h.

template<typename Scalar , int Dim>
template<typename Derived >
Transform< Scalar, Dim > & Transform< Scalar, Dim >::operator= ( const RotationBase< Derived, Dim > &  r  )  [inline]

Definition at line 584 of file Transform.h.

template<typename Scalar , int Dim>
Transform< Scalar, Dim > & Transform< Scalar, Dim >::operator= ( const ScalingType t  )  [inline]

Definition at line 566 of file Transform.h.

template<typename Scalar , int Dim>
Transform< Scalar, Dim > & Transform< Scalar, Dim >::operator= ( const TranslationType t  )  [inline]

Definition at line 548 of file Transform.h.

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

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

Definition at line 140 of file Transform.h.

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

Definition at line 108 of file Transform.h.

template<typename Scalar , int Dim>
template<typename RotationType >
Transform< Scalar, Dim > & Transform< Scalar, Dim >::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 507 of file Transform.h.

template<typename Scalar , int Dim>
Transform< Scalar, Dim > & Transform< Scalar, Dim >::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 437 of file Transform.h.

template<typename Scalar , int Dim>
template<typename OtherDerived >
Transform< Scalar, Dim > & Transform< Scalar, Dim >::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 425 of file Transform.h.

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

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 536 of file Transform.h.

template<typename Scalar , int Dim>
template<typename OtherDerived >
Transform< Scalar, Dim > & Transform< Scalar, Dim >::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 464 of file Transform.h.

template<typename Scalar , int Dim>
template<typename RotationType >
Transform< Scalar, Dim > & Transform< Scalar, Dim >::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 ei_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 491 of file Transform.h.

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

Definition at line 615 of file Transform.h.

template<typename Scalar , int Dim>
Transform< Scalar, Dim > & Transform< Scalar, Dim >::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 412 of file Transform.h.

template<typename Scalar , int Dim>
template<typename OtherDerived >
Transform< Scalar, Dim > & Transform< Scalar, Dim >::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 400 of file Transform.h.

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

Definition at line 200 of file Transform.h.

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

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 521 of file Transform.h.

template<typename Scalar , int Dim>
template<typename OtherDerived >
Transform< Scalar, Dim > & Transform< Scalar, Dim >::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 450 of file Transform.h.

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

Definition at line 172 of file Transform.h.

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

Definition at line 170 of file Transform.h.


Friends And Related Function Documentation

template<typename _Scalar, int _Dim>
Transform operator* ( const LinearMatrixType mat,
const Transform< _Scalar, _Dim > &  t 
) [friend]

Definition at line 237 of file Transform.h.

template<typename _Scalar, int _Dim>
template<typename OtherDerived >
const ProductReturnType<OtherDerived,MatrixType>::Type operator* ( const MatrixBase< OtherDerived > &  a,
const Transform< _Scalar, _Dim > &  b 
) [friend]
Returns:
the product expression of a transformation matrix a times a transform b The transformation matrix a must have a Dim+1 x Dim+1 sizes.

Definition at line 191 of file Transform.h.


Member Data Documentation

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

Definition at line 91 of file Transform.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


vcglib
Author(s): Christian Bersch
autogenerated on Fri Jan 11 09:22:35 2013