ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t > Struct Template Reference

Transform wrapper class to ensure standard API within different plugins. More...

#include <detray/algebra/generic/impl/generic_transform3.hpp>

Inheritance diagram for detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >:
[legend]

Public Types

Type definitions for the struct
using scalar_type = scalar_t
 Scalar type.
template<index_t N>
using array_type = array_t<scalar_t, N>
 Array type used by the transform.
using matrix44 = matrix_t<scalar_t, 4, 4>
 Homogeneous matrix type used to store the transform.
using vector2 = detray::traits::get_vector_t<matrix44, 2, scalar_t>
 Two-component vector type used for local plane coordinates.
using vector3 = detray::traits::get_vector_t<matrix44, 3, scalar_t>
 Three-component vector type used for spatial quantities.
using point2 = vector2
 Two-dimensional point representation (same storage as a vector).
using point3 = vector3
 Three-dimensional point representation (same storage as a vector).
using element_getter = detray::traits::element_getter_t<matrix44>
 Function (object) used for accessing a matrix element/block.
using block_getter = detray::traits::block_getter_t<matrix44>
 Accessor for the 3x3 rotation block of the homogeneous matrix.
using matrix_inversion = generic::matrix::inverse::hard_coded<matrix44>
 Matrix inversion algorithm.
template<concepts::scalar o_scalar_t>
using other_type = transform3<index_t, o_scalar_t, matrix_t, array_t>
 Helper type to cast this to another floating point precision.

Public Member Functions

constexpr transform3 ()=default
 Default constructor: identity.
 transform3 (const array_type< 16 > &ma)
 Constructor with arguments: matrix as array of scalar.
 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 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 const matrix44 & matrix () const
 This method retrieves the 4x4 matrix of a transform.
constexpr const 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 2D 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.
auto constexpr rotation () const
 This method retrieves the rotation of a transform.
constexpr point3 translation () const
 This method retrieves the translation of a transform.
constexpr vector3 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 vector3 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 vector3 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.

Static Public Member Functions

static constexpr vector3 rotate (const matrix44 &m, const vector2 &v)
 Rotate a vector into / from a frame.
static constexpr vector3 rotate (const matrix44 &m, const vector3 &v)
 Rotate a vector into / from a frame.

Public Attributes

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

Detailed Description

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
struct detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >

Transform wrapper class to ensure standard API within different plugins.

Member Typedef Documentation

◆ point2

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
using detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::point2 = vector2

Two-dimensional point representation (same storage as a vector).

Two-dimensional point representation.

◆ point3

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
using detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::point3 = vector3

Three-dimensional point representation (same storage as a vector).

Three-dimensional point representation.

Constructor & Destructor Documentation

◆ transform3() [1/6]

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_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 matrix

◆ transform3() [2/6]

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_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 matrix
Note
y will be constructed by cross product

◆ transform3() [3/6]

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::transform3 ( const vector3 & t)
explicit

Constructor with arguments: translation.

Parameters
ttranslation of the frame origin in global coordinates

◆ transform3() [4/6]

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::transform3 ( const matrix44 & m)
explicit

Constructor with arguments: matrix.

Parameters
mis the full 4x4 matrix

◆ transform3() [5/6]

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_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/6]

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::transform3 ( const array_type< 16 > & ma)
explicit

Constructor with arguments: matrix as array of scalar.

Parameters
mais the full 4x4 matrix 16 array

Member Function Documentation

◆ matrix()

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
const matrix44 & detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::matrix ( ) const
constexpr

This method retrieves the 4x4 matrix of a transform.

Returns
the local-to-global homogeneous matrix

◆ matrix_inverse()

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
const matrix44 & detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::matrix_inverse ( ) const
constexpr

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

Returns
the global-to-local homogeneous matrix

◆ operator==()

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
bool detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::operator== ( const transform3< index_t, scalar_t, matrix_t, array_t > & rhs) const
constexpr

Equality operator.

Parameters
rhstransform to compare with
Returns
whether the forward matrices have equal spatial entries

◆ point_to_global() [1/2]

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
point3 detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::point_to_global ( const point2 & v) const
constexpr

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

Parameters
vpoint in local plane coordinates
Returns
the point in global coordinates

◆ point_to_global() [2/2]

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
point3 detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_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
the point in global coordinates

◆ point_to_local()

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
point3 detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::point_to_local ( const point3 & v) const
constexpr

Transform a global point to local coordinates.

Parameters
vpoint in global coordinates
Returns
the point in local coordinates

◆ rotate() [1/2]

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
constexpr vector3 detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::rotate ( const matrix44 & m,
const vector2 & v )
staticconstexpr

Rotate a vector into / from a frame.

Parameters
mis the rotation matrix
vis the vector to be rotated
Returns
the rotated vector

◆ rotate() [2/2]

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
constexpr vector3 detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::rotate ( const matrix44 & m,
const vector3 & v )
staticconstexpr

Rotate a vector into / from a frame.

Parameters
mis the rotation matrix
vis the vector to be rotated
Returns
the rotated vector

◆ rotation()

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
auto constexpr detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::rotation ( ) const
constexpr

This method retrieves the rotation of a transform.

Returns
rotation matrix

◆ translation()

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
point3 detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::translation ( ) const
constexpr

This method retrieves the translation of a transform.

Returns
translation vector

◆ vector_to_global() [1/2]

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
vector3 detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_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
the vector in global coordinates

◆ vector_to_global() [2/2]

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
vector3 detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_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
the vector in global coordinates

◆ vector_to_local()

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
vector3 detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_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
the vector in local coordinates

◆ x()

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
point3 detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::x ( ) const
constexpr

This method retrieves x axis.

Returns
x-axis vector

◆ y()

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
point3 detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::y ( ) const
constexpr

This method retrieves y axis.

Returns
y-axis vector

◆ z()

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
point3 detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::z ( ) const
constexpr

This method retrieves z axis.

Returns
z-axis vector

Member Data Documentation

◆ _data

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
matrix44 detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::_data
Initial value:
{
generic::math::identity<matrix44>()}

Local-to-global homogeneous transformation matrix.

◆ _data_inv

template<concepts::index index_t, concepts::scalar scalar_t, template< typename, index_t, index_t > class matrix_t, template< typename, index_t > class array_t>
matrix44 detray::algebra::generic::math::transform3< index_t, scalar_t, matrix_t, array_t >::_data_inv
Initial value:
{
generic::math::identity<matrix44>()}

Global-to-local homogeneous transformation matrix.