ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::algebra::fastor::math::transform3< scalar_t > Struct Template Reference

Transform wrapper class to ensure standard API towards the Fastor library. More...

#include <algebra/impl/fastor_transform3.hpp>

Inheritance diagram for detray::algebra::fastor::math::transform3< scalar_t >:
[legend]

Public Types

Type definitions for the struct
using scalar_type = scalar_t
 Scalar type used by the transform.
template<std::size_t N>
using array_type = fastor::Vector<scalar_t, N>
 Array type used by the transform.
using vector2 = array_type<2>
 Vector and point types.
using vector3 = array_type<3>
 Three-component vector type used for spatial quantities.
using point2 = vector2
 Two-dimensional point representation.
using point3 = vector3
 Three-dimensional point representation.
using matrix44 = fastor::Matrix<scalar_type, 4UL, 4UL>
 4x4 matrix type
template<concepts::scalar o_scalar_t>
using other_type = transform3<o_scalar_t>
 Helper type to cast this to another floating point precision.

Public Member Functions

constexpr transform3 ()
 Default constructor: identity.
 transform3 (const array_type< 16 > &ma)
 Constructor with arguments: matrix as Fastor::Tensor<scalar_t, 16> of scalars.
 transform3 (const matrix44 &m)
 Constructor with arguments: matrix.
 transform3 (const matrix44 &m, const matrix44 &m_inv)
 Constructor with arguments: matrix and its inverse.
 transform3 (const transform3 &rhs)=default
 Copy an existing transform.
 transform3 (const vector3 &t)
 Constructor with arguments: translation.
 transform3 (const vector3 &t, const vector3 &x, const vector3 &y, const vector3 &z, bool get_inverse=true)
 Constructor with arguments: t, x, y, z.
 transform3 (const vector3 &t, const vector3 &z, const vector3 &x, bool get_inverse=true)
 Constructor with arguments: t, z, x.
constexpr matrix44 matrix () const
 This method retrieves the 4x4 matrix of a transform.
constexpr matrix44 matrix_inverse () const
 This method retrieves the 4x4 matrix of an inverse transform.
constexpr bool operator== (const transform3 &rhs) const
 Equality operator.
constexpr point3 point_to_global (const point2 &v) const
 This method transform from a point from the local 3D cartesian frame to the global 3D cartesian frame.
constexpr point3 point_to_global (const point3 &v) const
 This method transform from a point from the local 3D cartesian frame to the global 3D cartesian frame.
constexpr point3 point_to_local (const point3 &v) const
 Transform a global point to local coordinates.
constexpr auto rotation () const
 This method retrieves the rotation of a transform.
constexpr vector3 translation () const
 This method retrieves the translation of a transform.
constexpr point3 vector_to_global (const vector2 &v) const
 This method transform from a vector from the local 2D cartesian frame to the global 3D cartesian frame.
constexpr point3 vector_to_global (const vector3 &v) const
 This method transform from a vector from the local 3D cartesian frame to the global 3D cartesian frame.
constexpr point3 vector_to_local (const vector3 &v) const
 This method transform from a vector from the global 3D cartesian frame into the local 3D cartesian frame.
constexpr point3 x () const
 This method retrieves x axis.
constexpr point3 y () const
 This method retrieves y axis.
constexpr point3 z () const
 This method retrieves z axis.

Public Attributes

Data objects
matrix44 _data
 Local-to-global transformation matrix.
matrix44 _data_inv
 Global-to-local transformation matrix.

Detailed Description

template<concepts::scalar scalar_t>
struct detray::algebra::fastor::math::transform3< scalar_t >

Transform wrapper class to ensure standard API towards the Fastor library.

Constructor & Destructor Documentation

◆ transform3() [1/7]

template<concepts::scalar scalar_t>
detray::algebra::fastor::math::transform3< scalar_t >::transform3 ( const vector3 & t,
const vector3 & x,
const vector3 & y,
const vector3 & z,
bool get_inverse = true )

Constructor with arguments: t, x, y, z.

Parameters
tthe translation (or origin of the new frame)
xthe x axis of the new frame
ythe y axis of the new frame
zthe z axis of the new frame, normal vector for planes
get_inversewhether to compute and store the inverse

◆ transform3() [2/7]

template<concepts::scalar scalar_t>
detray::algebra::fastor::math::transform3< scalar_t >::transform3 ( const vector3 & t,
const vector3 & z,
const vector3 & x,
bool get_inverse = true )

Constructor with arguments: t, z, x.

Parameters
tthe translation (or origin of the new frame)
zthe z axis of the new frame, normal vector for planes
xthe x axis of the new frame
get_inversewhether to compute and store the inverse

◆ transform3() [3/7]

template<concepts::scalar scalar_t>
detray::algebra::fastor::math::transform3< scalar_t >::transform3 ( const vector3 & t)
explicit

Constructor with arguments: translation.

Parameters
tis the translation

◆ transform3() [4/7]

template<concepts::scalar scalar_t>
detray::algebra::fastor::math::transform3< scalar_t >::transform3 ( const matrix44 & m)
explicit

Constructor with arguments: matrix.

Parameters
mis the full 4x4 matrix

◆ transform3() [5/7]

template<concepts::scalar scalar_t>
detray::algebra::fastor::math::transform3< scalar_t >::transform3 ( const matrix44 & m,
const matrix44 & m_inv )

Constructor with arguments: matrix and its inverse.

Parameters
mis the full 4x4 matrix
m_invis the inverse to m

◆ transform3() [6/7]

template<concepts::scalar scalar_t>
detray::algebra::fastor::math::transform3< scalar_t >::transform3 ( const array_type< 16 > & ma)
explicit

Constructor with arguments: matrix as Fastor::Tensor<scalar_t, 16> of scalars.

Parameters
mais the full 4x4 matrix as a 16-element array

◆ transform3() [7/7]

template<concepts::scalar scalar_t>
detray::algebra::fastor::math::transform3< scalar_t >::transform3 ( const transform3< scalar_t > & rhs)
default

Copy an existing transform.

Parameters
rhsTransform whose matrices are copied.

Member Function Documentation

◆ matrix()

template<concepts::scalar scalar_t>
matrix44 detray::algebra::fastor::math::transform3< scalar_t >::matrix ( ) const
constexpr

This method retrieves the 4x4 matrix of a transform.

Returns
forward transformation matrix

◆ matrix_inverse()

template<concepts::scalar scalar_t>
matrix44 detray::algebra::fastor::math::transform3< scalar_t >::matrix_inverse ( ) const
constexpr

This method retrieves the 4x4 matrix of an inverse transform.

Returns
inverse transformation matrix

◆ operator==()

template<concepts::scalar scalar_t>
bool detray::algebra::fastor::math::transform3< scalar_t >::operator== ( const transform3< scalar_t > & rhs) const
constexpr

Equality operator.

Parameters
rhstransform to compare with
Returns
whether the transforms have equal spatial mappings

◆ point_to_global() [1/2]

template<concepts::scalar scalar_t>
point3 detray::algebra::fastor::math::transform3< scalar_t >::point_to_global ( const point2 & v) const
constexpr

This method transform from a point from the local 3D cartesian frame to the global 3D cartesian frame.

Parameters
vpoint in local coordinates
Returns
point in global coordinates

◆ point_to_global() [2/2]

template<concepts::scalar scalar_t>
point3 detray::algebra::fastor::math::transform3< scalar_t >::point_to_global ( const point3 & v) const
constexpr

This method transform from a point from the local 3D cartesian frame to the global 3D cartesian frame.

Parameters
vpoint in local coordinates
Returns
point in global coordinates

◆ point_to_local()

template<concepts::scalar scalar_t>
point3 detray::algebra::fastor::math::transform3< scalar_t >::point_to_local ( const point3 & v) const
constexpr

Transform a global point to local coordinates.

Parameters
vpoint in global coordinates
Returns
point in local coordinates

◆ rotation()

template<concepts::scalar scalar_t>
auto detray::algebra::fastor::math::transform3< scalar_t >::rotation ( ) const
constexpr

This method retrieves the rotation of a transform.

Returns
rotation matrix

◆ translation()

template<concepts::scalar scalar_t>
vector3 detray::algebra::fastor::math::transform3< scalar_t >::translation ( ) const
constexpr

This method retrieves the translation of a transform.

Returns
translation vector

◆ vector_to_global() [1/2]

template<concepts::scalar scalar_t>
point3 detray::algebra::fastor::math::transform3< scalar_t >::vector_to_global ( const vector2 & v) const
constexpr

This method transform from a vector from the local 2D cartesian frame to the global 3D cartesian frame.

Parameters
vvector in local plane coordinates
Returns
vector in global coordinates

◆ vector_to_global() [2/2]

template<concepts::scalar scalar_t>
point3 detray::algebra::fastor::math::transform3< scalar_t >::vector_to_global ( const vector3 & v) const
constexpr

This method transform from a vector from the local 3D cartesian frame to the global 3D cartesian frame.

Parameters
vvector in local coordinates
Returns
vector in global coordinates

◆ vector_to_local()

template<concepts::scalar scalar_t>
point3 detray::algebra::fastor::math::transform3< scalar_t >::vector_to_local ( const vector3 & v) const
constexpr

This method transform from a vector from the global 3D cartesian frame into the local 3D cartesian frame.

Parameters
vvector in global coordinates
Returns
vector in local coordinates

◆ x()

template<concepts::scalar scalar_t>
point3 detray::algebra::fastor::math::transform3< scalar_t >::x ( ) const
constexpr

This method retrieves x axis.

Returns
x-axis vector

◆ y()

template<concepts::scalar scalar_t>
point3 detray::algebra::fastor::math::transform3< scalar_t >::y ( ) const
constexpr

This method retrieves y axis.

Returns
y-axis vector

◆ z()

template<concepts::scalar scalar_t>
point3 detray::algebra::fastor::math::transform3< scalar_t >::z ( ) const
constexpr

This method retrieves z axis.

Returns
z-axis vector