Basic 3D Transformation class describing a rotation and then a translation The internal data are a 3D rotation data (represented as a 3x3 matrix) and a 3D vector data.
They are represented and held in this class like a 3x4 matrix (a simple array of 12 numbers).
The class can be constructed from any 3D rotation object (ROOT::Math::Rotation3D, ROOT::Math::AxisAngle, ROOT::Math::Quaternion, etc...) and/or a 3D Vector (ROOT::Math::DislacementVector3D or via ROOT::Math::Translation ) representing a Translation. The Transformation is defined by applying first the rotation and then the translation. A transformation defined by applying first a translation and then a rotation is equivalent to the transformation obtained applying first the rotation and then a translation equivalent to the rotated vector. The operator * can be used to obtain directly such transformations, in addition to combine various transformations. Keep in mind that the operator * (like in the case of rotations ) is not commutative. The operator * is used (in addition to operator() ) to apply a transformations on the vector (DisplacementVector3D and LorentzVector classes) and point (PositionVector3D) classes. In the case of Vector objects the transformation only rotates them and does not translate them. Only Point objects are able to be both rotated and translated.
Definition at line 80 of file Transform3D.h.
Public Types | |
enum | ETransform3DMatrixIndex { kXX = 0 , kXY = 1 , kXZ = 2 , kDX = 3 , kYX = 4 , kYY = 5 , kYZ = 6 , kDY = 7 , kZX = 8 , kZY = 9 , kZZ =10 , kDZ = 11 } |
typedef PositionVector3D< Cartesian3D< T >, DefaultCoordinateSystemTag > | Point |
typedef T | Scalar |
typedef DisplacementVector3D< Cartesian3D< T >, DefaultCoordinateSystemTag > | Vector |
Public Member Functions | |
Transform3D () | |
Default constructor (identy rotation) + zero translation. | |
template<class ARotation , class CoordSystem , class Tag > | |
Transform3D (const ARotation &r, const DisplacementVector3D< CoordSystem, Tag > &v) | |
Construct from a rotation (any rotation object) and then a translation (represented by any DisplacementVector) The requirements on the rotation and vector objects are that they can be transformed in a Rotation3D class and in a Cartesian3D Vector. | |
template<class ARotation > | |
Transform3D (const ARotation &r, const Translation3D< T > &t) | |
Construct from a rotation (any rotation object) and then a translation represented by a Translation3D class The requirements on the rotation is that it can be transformed in a Rotation3D class. | |
Transform3D (const AxisAngle &r) | |
template<class CoordSystem , class Tag > | |
Transform3D (const DisplacementVector3D< CoordSystem, Tag > &v) | |
Construct from a translation only, represented by any DisplacementVector3D and with an identity rotation. | |
Transform3D (const EulerAngles &r) | |
template<class ForeignMatrix > | |
Transform3D (const ForeignMatrix &m) | |
Construct from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3). | |
template<typename SCALAR = T, typename std::enable_if< std::is_arithmetic< SCALAR >::value >::type * = nullptr> | |
Transform3D (const Point &fr0, const Point &fr1, const Point &fr2, const Point &to0, const Point &to1, const Point &to2) | |
Construct transformation from one coordinate system defined by three points (origin + two axis) to a new coordinate system defined by other three points (origin + axis) Scalar version. | |
template<typename SCALAR = T, typename std::enable_if<!std::is_arithmetic< SCALAR >::value >::type * = nullptr> | |
Transform3D (const Point &fr0, const Point &fr1, const Point &fr2, const Point &to0, const Point &to1, const Point &to2) | |
Construct transformation from one coordinate system defined by three points (origin + two axis) to a new coordinate system defined by other three points (origin + axis) Vectorised version. | |
Transform3D (const Quaternion &r) | |
Transform3D (const Rotation3D &r) | |
Construct from a 3D Rotation only with zero translation. | |
Transform3D (const Rotation3D &r, const Translation3D< T > &t) | |
Construct from a rotation and then a translation described by a Translation3D class. | |
Transform3D (const Rotation3D &r, const Vector &v) | |
Construct from a rotation and then a translation described by a Vector. | |
Transform3D (const RotationX &r) | |
Transform3D (const RotationY &r) | |
Transform3D (const RotationZ &r) | |
Transform3D (const RotationZYX &r) | |
Transform3D (const Translation3D< T > &t) | |
Construct from a translation only, represented by a Translation3D class and with an identity rotation. | |
Transform3D (const Vector &v) | |
Construct from a translation only, represented by a Cartesian 3D Vector, and with an identity rotation. | |
template<class IT > | |
Transform3D (IT begin, IT end) | |
Construct given a pair of pointers or iterators defining the beginning and end of an array of 12 Scalars. | |
Transform3D (T xx, T xy, T xz, T dx, T yx, T yy, T yz, T dy, T zx, T zy, T zz, T dz) | |
Raw constructor from 12 Scalar components. | |
template<class CoordSystem > | |
DisplacementVector3D< CoordSystem > | ApplyInverse (const DisplacementVector3D< CoordSystem > &p) const |
Directly apply the inverse affine transformation on an arbitrary coordinate-system vector. | |
Point | ApplyInverse (const Point &p) const |
Directly apply the inverse affine transformation on points (first inverse translation then inverse rotation). | |
template<class CoordSystem > | |
PositionVector3D< CoordSystem > | ApplyInverse (const PositionVector3D< CoordSystem > &p) const |
Directly apply the inverse affine transformation on an arbitrary coordinate-system point. | |
Vector | ApplyInverse (const Vector &v) const |
Directly apply the inverse affine transformation on vectors. | |
template<class IT > | |
void | GetComponents (IT begin) const |
Get the 12 matrix components into data specified by an iterator begin. | |
template<class IT > | |
void | GetComponents (IT begin, IT end) const |
Get the 12 matrix components into data specified by an iterator begin and another to the end of the desired data (12 past start). | |
void | GetComponents (T &xx, T &xy, T &xz, T &dx, T &yx, T &yy, T &yz, T &dy, T &zx, T &zy, T &zz, T &dz) const |
Get the components into 12 scalars. | |
template<class AnyRotation , class V > | |
void | GetDecomposition (AnyRotation &r, V &v) const |
Get the rotation and translation vector representing the 3D transformation in any rotation and any vector (the Translation class could also be used) | |
void | GetDecomposition (Rotation3D &r, Vector &v) const |
Get the rotation and translation vector representing the 3D transformation. | |
template<class AnyRotation > | |
void | GetRotation (AnyRotation &r) const |
Get the rotation (any type) representing the 3D transformation. | |
template<class ForeignMatrix > | |
void | GetTransformMatrix (ForeignMatrix &m) const |
Get components into a linear algebra matrix of size at least 3x4, which must support operator()(i,j) for write access to elements (0,0) thru (2,3). | |
template<class AnyVector > | |
void | GetTranslation (AnyVector &v) const |
Get the translation representing the 3D transformation in any vector which implements the SetXYZ method. | |
Transform3D< T > | Inverse () const |
Return the inverse of the transformation. | |
template<typename SCALAR = T, typename std::enable_if< std::is_arithmetic< SCALAR >::value >::type * = nullptr> | |
void | Invert () |
Invert the transformation in place (scalar) | |
template<typename SCALAR = T, typename std::enable_if<!std::is_arithmetic< SCALAR >::value >::type * = nullptr> | |
void | Invert () |
Invert the transformation in place (vectorised) | |
bool | operator!= (const Transform3D< T > &rhs) const |
Inequality operator. | |
template<class CoordSystem > | |
DisplacementVector3D< CoordSystem > | operator() (const DisplacementVector3D< CoordSystem > &v) const |
Transformation operation for Displacement Vector in any coordinate system. | |
template<class CoordSystem > | |
LorentzVector< CoordSystem > | operator() (const LorentzVector< CoordSystem > &q) const |
Transformation operation for a Lorentz Vector in any coordinate system. | |
template<typename TYPE > | |
Plane3D< TYPE > | operator() (const Plane3D< TYPE > &plane) const |
Transformation on a 3D plane. | |
Point | operator() (const Point &p) const |
Transformation operation for Position Vector in Cartesian coordinate For a Position Vector first a rotation and then a translation is applied. | |
template<class CoordSystem > | |
PositionVector3D< CoordSystem > | operator() (const PositionVector3D< CoordSystem > &p) const |
Transformation operation for Position Vector in any coordinate system. | |
Vector | operator() (const Vector &v) const |
Transformation operation for Displacement Vectors in Cartesian coordinate For the Displacement Vectors only the rotation applies - no translations. | |
template<class CoordSystem > | |
DisplacementVector3D< CoordSystem > | operator* (const DisplacementVector3D< CoordSystem > &v) const |
Transformation operation for Displacement Vector in any coordinate system. | |
template<class CoordSystem > | |
LorentzVector< CoordSystem > | operator* (const LorentzVector< CoordSystem > &q) const |
Transformation operation for a Lorentz Vector in any coordinate system. | |
template<typename TYPE > | |
Plane3D< TYPE > | operator* (const Plane3D< TYPE > &plane) const |
Multiplication operator for 3D plane. | |
template<class CoordSystem > | |
PositionVector3D< CoordSystem > | operator* (const PositionVector3D< CoordSystem > &v) const |
Transformation operation for Position Vector in any coordinate system. | |
Transform3D< T > | operator* (const Transform3D< T > &t) const |
multiply (combine) two transformations | |
Transform3D< T > & | operator*= (const Transform3D< T > &t) |
multiply (combine) with another transformation in place | |
template<class ForeignMatrix > | |
Transform3D< T > & | operator= (const ForeignMatrix &m) |
Construct from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3). | |
bool | operator== (const Transform3D< T > &rhs) const |
Equality operator. | |
Rotation3D | Rotation () const |
Get the 3D rotation representing the 3D transformation. | |
template<class AnyRotation > | |
AnyRotation | Rotation () const |
Get the rotation representing the 3D transformation. | |
template<class IT > | |
void | SetComponents (IT begin, IT end) |
Set the 12 matrix components given an iterator to the start of the desired data, and another to the end (12 past start). | |
void | SetComponents (T xx, T xy, T xz, T dx, T yx, T yy, T yz, T dy, T zx, T zy, T zz, T dz) |
Set the components from 12 scalars. | |
template<class ForeignMatrix > | |
void | SetTransformMatrix (const ForeignMatrix &m) |
Set components from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3). | |
template<class CoordSystem , class Tag1 , class Tag2 > | |
void | Transform (const DisplacementVector3D< CoordSystem, Tag1 > &v1, DisplacementVector3D< CoordSystem, Tag2 > &v2) const |
Transformation operation for Displacement Vector of different coordinate systems. | |
template<class CoordSystem , class Tag1 , class Tag2 > | |
void | Transform (const PositionVector3D< CoordSystem, Tag1 > &p1, PositionVector3D< CoordSystem, Tag2 > &p2) const |
Transformation operation for points between different coordinate system tags. | |
Translation3D< T > | Translation () const |
Get the translation representing the 3D transformation in a Cartesian vector. | |
Protected Member Functions | |
void | AssignFrom (const Rotation3D &r) |
make transformation from only rotations (zero translation) | |
void | AssignFrom (const Rotation3D &r, const Vector &v) |
make transformation from first a rotation then a translation | |
void | AssignFrom (const Vector &v) |
make transformation from only translation (identity rotations) | |
void | SetIdentity () |
Set identity transformation (identity rotation , zero translation) | |
template<typename SCALAR = T, typename std::enable_if<!std::is_arithmetic< SCALAR >::value >::type * = nullptr> | |
void | SetIdentity (const typename SCALAR::mask_type m) |
Set identity transformation (identity rotation , zero translation) vectorised version that sets using a mask. | |
Private Attributes | |
T | fM [12] |
#include <Math/GenVector/Transform3D.h>
typedef PositionVector3D<Cartesian3D<T>, DefaultCoordinateSystemTag> ROOT::Math::Impl::Transform3D< T >::Point |
Definition at line 86 of file Transform3D.h.
typedef T ROOT::Math::Impl::Transform3D< T >::Scalar |
Definition at line 83 of file Transform3D.h.
typedef DisplacementVector3D<Cartesian3D<T>, DefaultCoordinateSystemTag> ROOT::Math::Impl::Transform3D< T >::Vector |
Definition at line 85 of file Transform3D.h.
enum ROOT::Math::Impl::Transform3D::ETransform3DMatrixIndex |
Enumerator | |
---|---|
kXX | |
kXY | |
kXZ | |
kDX | |
kYX | |
kYY | |
kYZ | |
kDY | |
kZX | |
kZY | |
kZZ | |
kDZ |
Definition at line 88 of file Transform3D.h.
|
inline |
Default constructor (identy rotation) + zero translation.
Definition at line 99 of file Transform3D.h.
|
inline |
Construct given a pair of pointers or iterators defining the beginning and end of an array of 12 Scalars.
Definition at line 109 of file Transform3D.h.
|
inline |
Construct from a rotation and then a translation described by a Vector.
Definition at line 117 of file Transform3D.h.
|
inline |
Construct from a rotation and then a translation described by a Translation3D class.
Definition at line 124 of file Transform3D.h.
|
inline |
Construct from a rotation (any rotation object) and then a translation (represented by any DisplacementVector) The requirements on the rotation and vector objects are that they can be transformed in a Rotation3D class and in a Cartesian3D Vector.
Definition at line 133 of file Transform3D.h.
|
inline |
Construct from a rotation (any rotation object) and then a translation represented by a Translation3D class The requirements on the rotation is that it can be transformed in a Rotation3D class.
Definition at line 145 of file Transform3D.h.
|
inlineexplicit |
Construct from a 3D Rotation only with zero translation.
Definition at line 165 of file Transform3D.h.
|
inlineexplicit |
Definition at line 172 of file Transform3D.h.
|
inlineexplicit |
Definition at line 175 of file Transform3D.h.
|
inlineexplicit |
Definition at line 178 of file Transform3D.h.
|
inlineexplicit |
Definition at line 181 of file Transform3D.h.
|
inlineexplicit |
Definition at line 187 of file Transform3D.h.
|
inlineexplicit |
Definition at line 190 of file Transform3D.h.
|
inlineexplicit |
Definition at line 193 of file Transform3D.h.
|
inlineexplicit |
Construct from a translation only, represented by any DisplacementVector3D and with an identity rotation.
Definition at line 202 of file Transform3D.h.
|
inlineexplicit |
Construct from a translation only, represented by a Cartesian 3D Vector, and with an identity rotation.
Definition at line 209 of file Transform3D.h.
|
inlineexplicit |
Construct from a translation only, represented by a Translation3D class and with an identity rotation.
Definition at line 216 of file Transform3D.h.
|
inline |
Construct transformation from one coordinate system defined by three points (origin + two axis) to a new coordinate system defined by other three points (origin + axis) Scalar version.
fr0 | point defining origin of original reference system |
fr1 | point defining first axis of original reference system |
fr2 | point defining second axis of original reference system |
to0 | point defining origin of transformed reference system |
to1 | point defining first axis transformed reference system |
to2 | point defining second axis transformed reference system |
Definition at line 251 of file Transform3D.h.
|
inline |
Construct transformation from one coordinate system defined by three points (origin + two axis) to a new coordinate system defined by other three points (origin + axis) Vectorised version.
fr0 | point defining origin of original reference system |
fr1 | point defining first axis of original reference system |
fr2 | point defining second axis of original reference system |
to0 | point defining origin of transformed reference system |
to1 | point defining first axis transformed reference system |
to2 | point defining second axis transformed reference system |
Definition at line 345 of file Transform3D.h.
|
inlineexplicit |
Construct from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3).
The 3x3 sub-block is assumed to be the rotation part and the translations vector are described by the 4-th column
Definition at line 438 of file Transform3D.h.
|
inline |
Raw constructor from 12 Scalar components.
Definition at line 445 of file Transform3D.h.
|
inline |
Directly apply the inverse affine transformation on an arbitrary coordinate-system vector.
Involves casting to Vector(p) type.
Definition at line 713 of file Transform3D.h.
|
inline |
Directly apply the inverse affine transformation on points (first inverse translation then inverse rotation).
Avoids having to calculate the inverse as an intermediate result. This is possible since the inverse of a rotation is its transpose.
Definition at line 688 of file Transform3D.h.
|
inline |
Directly apply the inverse affine transformation on an arbitrary coordinate-system point.
Involves casting to Point(p) type.
Definition at line 702 of file Transform3D.h.
|
inline |
Directly apply the inverse affine transformation on vectors.
Avoids having to calculate the inverse as an intermediate result. This is possible since the inverse of a rotation is its transpose.
Definition at line 675 of file Transform3D.h.
|
inlineprotected |
make transformation from only rotations (zero translation)
Definition at line 930 of file Transform3D.h.
|
inlineprotected |
make transformation from first a rotation then a translation
Definition at line 906 of file Transform3D.h.
|
inlineprotected |
make transformation from only translation (identity rotations)
Definition at line 945 of file Transform3D.h.
|
inline |
Get the 12 matrix components into data specified by an iterator begin.
Definition at line 500 of file Transform3D.h.
|
inline |
Get the 12 matrix components into data specified by an iterator begin and another to the end of the desired data (12 past start).
Definition at line 487 of file Transform3D.h.
|
inline |
Get the components into 12 scalars.
Definition at line 545 of file Transform3D.h.
|
inline |
Get the rotation and translation vector representing the 3D transformation in any rotation and any vector (the Translation class could also be used)
Definition at line 558 of file Transform3D.h.
|
inline |
Get the rotation and translation vector representing the 3D transformation.
Definition at line 567 of file Transform3D.h.
|
inline |
Get the rotation (any type) representing the 3D transformation.
Definition at line 593 of file Transform3D.h.
|
inline |
Get components into a linear algebra matrix of size at least 3x4, which must support operator()(i,j) for write access to elements (0,0) thru (2,3).
Definition at line 525 of file Transform3D.h.
|
inline |
Get the translation representing the 3D transformation in any vector which implements the SetXYZ method.
Definition at line 607 of file Transform3D.h.
|
inline |
Return the inverse of the transformation.
Definition at line 877 of file Transform3D.h.
|
inline |
Invert the transformation in place (scalar)
Definition at line 794 of file Transform3D.h.
|
inline |
Invert the transformation in place (vectorised)
Definition at line 829 of file Transform3D.h.
|
inline |
Inequality operator.
Check equality for each element To do: use T tolerance
Definition at line 899 of file Transform3D.h.
|
inline |
Transformation operation for Displacement Vector in any coordinate system.
Definition at line 658 of file Transform3D.h.
|
inline |
Transformation operation for a Lorentz Vector in any coordinate system.
Definition at line 743 of file Transform3D.h.
|
inline |
Transformation on a 3D plane.
Definition at line 760 of file Transform3D.h.
|
inline |
Transformation operation for Position Vector in Cartesian coordinate For a Position Vector first a rotation and then a translation is applied.
Definition at line 619 of file Transform3D.h.
|
inline |
Transformation operation for Position Vector in any coordinate system.
Definition at line 641 of file Transform3D.h.
|
inline |
Transformation operation for Displacement Vectors in Cartesian coordinate For the Displacement Vectors only the rotation applies - no translations.
Definition at line 630 of file Transform3D.h.
|
inline |
Transformation operation for Displacement Vector in any coordinate system.
Definition at line 665 of file Transform3D.h.
|
inline |
Transformation operation for a Lorentz Vector in any coordinate system.
Definition at line 751 of file Transform3D.h.
|
inline |
Multiplication operator for 3D plane.
Definition at line 773 of file Transform3D.h.
|
inline |
Transformation operation for Position Vector in any coordinate system.
Definition at line 649 of file Transform3D.h.
|
inline |
multiply (combine) two transformations
Definition at line 1037 of file Transform3D.h.
|
inline |
multiply (combine) with another transformation in place
Definition at line 1014 of file Transform3D.h.
|
inline |
Construct from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3).
The 3x3 sub-block is assumed to be the rotation part and the translations vector are described by the 4-th column
Definition at line 458 of file Transform3D.h.
|
inline |
Equality operator.
Check equality for each element To do: use T tolerance
Definition at line 888 of file Transform3D.h.
|
inline |
Get the 3D rotation representing the 3D transformation.
Definition at line 575 of file Transform3D.h.
|
inline |
Get the rotation representing the 3D transformation.
Definition at line 585 of file Transform3D.h.
|
inline |
Set the 12 matrix components given an iterator to the start of the desired data, and another to the end (12 past start).
Definition at line 473 of file Transform3D.h.
|
inline |
Set the components from 12 scalars.
Definition at line 535 of file Transform3D.h.
|
inlineprotected |
Set identity transformation (identity rotation , zero translation)
Definition at line 965 of file Transform3D.h.
|
inlineprotected |
Set identity transformation (identity rotation , zero translation) vectorised version that sets using a mask.
Definition at line 987 of file Transform3D.h.
|
inline |
Set components from a linear algebra matrix of size at least 3x4, which must support operator()(i,j) to obtain elements (0,0) thru (2,3).
The 3x3 sub-block is assumed to be the rotation part and the translations vector are described by the 4-th column
Definition at line 512 of file Transform3D.h.
|
inline |
Transformation operation for Displacement Vector of different coordinate systems.
Definition at line 733 of file Transform3D.h.
|
inline |
Transformation operation for points between different coordinate system tags.
Definition at line 722 of file Transform3D.h.
|
inline |
Get the translation representing the 3D transformation in a Cartesian vector.
Definition at line 600 of file Transform3D.h.
|
private |
Definition at line 1005 of file Transform3D.h.