MOAB
4.9.3pre
|
Represents a translation transformation. More...
#include <Translation.h>
Public Types | |
enum | { Dim = _Dim } |
typedef _Scalar | Scalar |
typedef Matrix< Scalar, Dim, 1 > | VectorType |
typedef Matrix< Scalar, Dim, Dim > | LinearMatrixType |
typedef Transform< Scalar, Dim, Affine > | AffineTransformType |
typedef Transform< Scalar, Dim, Isometry > | IsometryTransformType |
Public Member Functions | |
Translation () | |
Translation (const Scalar &sx, const Scalar &sy) | |
Translation (const Scalar &sx, const Scalar &sy, const Scalar &sz) | |
Translation (const VectorType &vector) | |
Scalar | x () const |
Retruns the x-translation by value. | |
Scalar | y () const |
Retruns the y-translation by value. | |
Scalar | z () const |
Retruns the z-translation by value. | |
Scalar & | x () |
Retruns the x-translation as a reference. | |
Scalar & | y () |
Retruns the y-translation as a reference. | |
Scalar & | z () |
Retruns the z-translation as a reference. | |
const VectorType & | vector () const |
VectorType & | vector () |
const VectorType & | translation () const |
VectorType & | translation () |
Translation | operator* (const Translation &other) const |
AffineTransformType | operator* (const UniformScaling< Scalar > &other) const |
template<typename OtherDerived > | |
AffineTransformType | operator* (const EigenBase< OtherDerived > &linear) const |
template<typename Derived > | |
IsometryTransformType | operator* (const RotationBase< Derived, Dim > &r) const |
template<int Mode, int Options> | |
Transform< Scalar, Dim, Mode > | operator* (const Transform< Scalar, Dim, Mode, Options > &t) const |
VectorType | operator* (const VectorType &other) const |
Translation | inverse () const |
Translation & | operator= (const Translation &other) |
template<typename NewScalarType > | |
internal::cast_return_type < Translation, Translation < NewScalarType, Dim > >::type | cast () const |
template<typename OtherScalarType > | |
Translation (const Translation< OtherScalarType, Dim > &other) | |
bool | isApprox (const Translation &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const |
Static Public Member Functions | |
static const Translation | Identity () |
Protected Attributes | |
VectorType | m_coeffs |
Friends | |
template<typename OtherDerived > | |
AffineTransformType | operator* (const EigenBase< OtherDerived > &linear, const Translation &t) |
Represents a translation transformation.
_Scalar | the scalar type, i.e., the type of the coefficients. |
_Dim | the dimension of the space, can be a compile time value or Dynamic |
Definition at line 30 of file Translation.h.
typedef Transform<Scalar,Dim,Affine> Eigen::Translation< _Scalar, _Dim >::AffineTransformType |
corresponding affine transformation type
Definition at line 43 of file Translation.h.
typedef Transform<Scalar,Dim,Isometry> Eigen::Translation< _Scalar, _Dim >::IsometryTransformType |
corresponding isometric transformation type
Definition at line 45 of file Translation.h.
typedef Matrix<Scalar,Dim,Dim> Eigen::Translation< _Scalar, _Dim >::LinearMatrixType |
corresponding linear transformation matrix type
Definition at line 41 of file Translation.h.
typedef _Scalar Eigen::Translation< _Scalar, _Dim >::Scalar |
the scalar type of the coefficients
Definition at line 37 of file Translation.h.
typedef Matrix<Scalar,Dim,1> Eigen::Translation< _Scalar, _Dim >::VectorType |
corresponding vector type
Definition at line 39 of file Translation.h.
anonymous enum |
Eigen::Translation< _Scalar, _Dim >::Translation | ( | ) | [inline] |
Eigen::Translation< _Scalar, _Dim >::Translation | ( | const Scalar & | sx, |
const Scalar & | sy | ||
) | [inline] |
Definition at line 56 of file Translation.h.
{ eigen_assert(Dim==2); m_coeffs.x() = sx; m_coeffs.y() = sy; }
Eigen::Translation< _Scalar, _Dim >::Translation | ( | const Scalar & | sx, |
const Scalar & | sy, | ||
const Scalar & | sz | ||
) | [inline] |
Definition at line 63 of file Translation.h.
{ eigen_assert(Dim==3); m_coeffs.x() = sx; m_coeffs.y() = sy; m_coeffs.z() = sz; }
Eigen::Translation< _Scalar, _Dim >::Translation | ( | const VectorType & | vector | ) | [inline, explicit] |
Constructs and initialize the translation transformation from a vector of translation coefficients
Definition at line 71 of file Translation.h.
Eigen::Translation< _Scalar, _Dim >::Translation | ( | const Translation< OtherScalarType, Dim > & | other | ) | [inline, explicit] |
Copy constructor with scalar type conversion
Definition at line 158 of file Translation.h.
{ m_coeffs = other.vector().template cast<Scalar>(); }
internal::cast_return_type<Translation,Translation<NewScalarType,Dim> >::type Eigen::Translation< _Scalar, _Dim >::cast | ( | ) | const [inline] |
*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 153 of file Translation.h.
{ return typename internal::cast_return_type<Translation,Translation<NewScalarType,Dim> >::type(*this); }
static const Translation Eigen::Translation< _Scalar, _Dim >::Identity | ( | ) | [inline, static] |
Definition at line 145 of file Translation.h.
{ return Translation(VectorType::Zero()); }
Translation Eigen::Translation< _Scalar, _Dim >::inverse | ( | ) | const [inline] |
Definition at line 137 of file Translation.h.
{ return Translation(-m_coeffs); }
bool Eigen::Translation< _Scalar, _Dim >::isApprox | ( | const Translation< _Scalar, _Dim > & | other, |
const typename NumTraits< Scalar >::Real & | prec = NumTraits<Scalar>::dummy_precision() |
||
) | const [inline] |
true
if *this
is approximately equal to other, within the precision determined by prec.Definition at line 165 of file Translation.h.
{ return m_coeffs.isApprox(other.m_coeffs, prec); }
Translation Eigen::Translation< _Scalar, _Dim >::operator* | ( | const Translation< _Scalar, _Dim > & | other | ) | const [inline] |
Concatenates two translation
Definition at line 94 of file Translation.h.
{ return Translation(m_coeffs + other.m_coeffs); }
Translation< Scalar, Dim >::AffineTransformType Eigen::Translation< Scalar, Dim >::operator* | ( | const UniformScaling< Scalar > & | other | ) | const [inline] |
Concatenates a translation and a uniform scaling
Definition at line 180 of file Translation.h.
{ AffineTransformType res; res.matrix().setZero(); res.linear().diagonal().fill(other.factor()); res.translation() = m_coeffs; res(Dim,Dim) = Scalar(1); return res; }
Translation< Scalar, Dim >::AffineTransformType Eigen::Translation< Scalar, Dim >::operator* | ( | const EigenBase< OtherDerived > & | linear | ) | const [inline] |
Concatenates a translation and a linear transformation
Definition at line 193 of file Translation.h.
IsometryTransformType Eigen::Translation< _Scalar, _Dim >::operator* | ( | const RotationBase< Derived, Dim > & | r | ) | const [inline] |
Concatenates a translation and a rotation
Definition at line 106 of file Translation.h.
{ return *this * IsometryTransformType(r); }
Transform<Scalar,Dim,Mode> Eigen::Translation< _Scalar, _Dim >::operator* | ( | const Transform< Scalar, Dim, Mode, Options > & | t | ) | const [inline] |
Concatenates a translation and a transformation
Definition at line 125 of file Translation.h.
VectorType Eigen::Translation< _Scalar, _Dim >::operator* | ( | const VectorType & | other | ) | const [inline] |
Applies translation to vector
Definition at line 133 of file Translation.h.
{ return m_coeffs + other; }
Translation& Eigen::Translation< _Scalar, _Dim >::operator= | ( | const Translation< _Scalar, _Dim > & | other | ) | [inline] |
Definition at line 139 of file Translation.h.
{ m_coeffs = other.m_coeffs; return *this; }
const VectorType& Eigen::Translation< _Scalar, _Dim >::translation | ( | ) | const [inline] |
Definition at line 90 of file Translation.h.
{ return m_coeffs; }
VectorType& Eigen::Translation< _Scalar, _Dim >::translation | ( | ) | [inline] |
Definition at line 91 of file Translation.h.
{ return m_coeffs; }
const VectorType& Eigen::Translation< _Scalar, _Dim >::vector | ( | ) | const [inline] |
Definition at line 87 of file Translation.h.
{ return m_coeffs; }
VectorType& Eigen::Translation< _Scalar, _Dim >::vector | ( | ) | [inline] |
Definition at line 88 of file Translation.h.
{ return m_coeffs; }
Scalar Eigen::Translation< _Scalar, _Dim >::x | ( | ) | const [inline] |
Retruns the x-translation by value.
Definition at line 74 of file Translation.h.
{ return m_coeffs.x(); }
Scalar& Eigen::Translation< _Scalar, _Dim >::x | ( | ) | [inline] |
Retruns the x-translation as a reference.
Definition at line 81 of file Translation.h.
{ return m_coeffs.x(); }
Scalar Eigen::Translation< _Scalar, _Dim >::y | ( | ) | const [inline] |
Retruns the y-translation by value.
Definition at line 76 of file Translation.h.
{ return m_coeffs.y(); }
Scalar& Eigen::Translation< _Scalar, _Dim >::y | ( | ) | [inline] |
Retruns the y-translation as a reference.
Definition at line 83 of file Translation.h.
{ return m_coeffs.y(); }
Scalar Eigen::Translation< _Scalar, _Dim >::z | ( | ) | const [inline] |
Retruns the z-translation by value.
Definition at line 78 of file Translation.h.
{ return m_coeffs.z(); }
Scalar& Eigen::Translation< _Scalar, _Dim >::z | ( | ) | [inline] |
Retruns the z-translation as a reference.
Definition at line 85 of file Translation.h.
{ return m_coeffs.z(); }
AffineTransformType operator* | ( | const EigenBase< OtherDerived > & | linear, |
const Translation< _Scalar, _Dim > & | t | ||
) | [friend] |
Definition at line 112 of file Translation.h.
VectorType Eigen::Translation< _Scalar, _Dim >::m_coeffs [protected] |
Definition at line 49 of file Translation.h.