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

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

#include <algebra/impl/vc_aos_transform3.hpp>

Inheritance diagram for detray::algebra::vc_aos::math::transform3< array_t, scalar_t >:
[legend]
Collaboration diagram for detray::algebra::vc_aos::math::transform3< array_t, 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 = array_t<scalar_type, N>
 Vector storage with N components in the selected array layout.
using vector2 = algebra::storage::vector<2u, scalar_type, array_t>
 Vector and point types.
using vector3 = algebra::storage::vector<3u, scalar_type, array_t>
 Three-component vector type used for spatial quantities.
using point2 = vector2
 Two-dimensional point representation.
using point3 = vector3
 Three-dimensional point representation.
using matrix44 = algebra::storage::matrix<array_t, scalar_type, 3u, 4u>
 4x4 matrix type (Last row is {0, 0, 0, 1} and can be omitted)
using column_t = typename matrix44::vector_type
 Column type used to construct the stored matrix.
using element_getter = algebra::storage::element_getter
 Function (object) used for accessing a matrix element.
template<concepts::scalar o_scalar_t>
using other_type = transform3<array_t, 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 std::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 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)
 Constructor with arguments: t, x, y, z.
 transform3 (const vector3 &t, const vector3 &z, const vector3 &x)
 Constructor with arguments: t, z, x.
constexpr scalar_type determinant (const matrix44 &m) const
 The determinant of a 4x4 matrix.
constexpr matrix44 invert (const matrix44 &m) const
 The inverse of a 4x4 matrix.
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 scalar_type & operator() (std::size_t row, std::size_t col)
 Return a writable matrix element.
constexpr const scalar_type & operator() (std::size_t row, std::size_t col) const
 Matrix access operator.
constexpr bool operator== (const transform3 &rhs) const
 Equality operator.
template<concepts::point2D point2_type>
constexpr auto point_to_global (const point2_type &p) const
 This method transform from a point from the local 2D cartesian frame to the global 3D cartesian frame.
template<concepts::point3D point3_type>
constexpr auto point_to_global (const point3_type &p) const
 This method transform from a point from the local 3D cartesian frame to the global 3D cartesian frame.
template<concepts::point3D point3_type>
constexpr auto point_to_local (const point3_type &p) const
 This method transform from a vector from the global 3D cartesian frame into the local 3D cartesian frame.
template<concepts::vector2D vector2_type>
constexpr auto rotate (const matrix44 &m, const vector2_type &v) const
 Rotate a vector into / from a frame.
template<concepts::vector3D vector3_type>
constexpr auto rotate (const matrix44 &m, const vector3_type &v) const
 Rotate a vector into / from a frame.
constexpr auto rotation () const
 This method retrieves the rotation of a transform.
constexpr const auto & translation () const
 This method retrieves the translation.
template<concepts::vector2D vector2_type>
constexpr auto vector_to_global (const vector2_type &v) const
 This method transform from a vector from the local 2D cartesian frame to the global 3D cartesian frame.
template<concepts::vector3D vector3_type>
constexpr auto vector_to_global (const vector3_type &v) const
 This method transform from a vector from the local 3D cartesian frame to the global 3D cartesian frame.
template<concepts::vector3D vector3_type>
constexpr auto vector_to_local (const vector3_type &v) const
 This method transform from a vector from the global 3D cartesian frame into the local 3D cartesian frame.
constexpr const auto & x () const
 This method retrieves the new x-axis.
constexpr const auto & y () const
 This method retrieves the new y-axis.
constexpr const auto & z () const
 This method retrieves the new z-axis.

Public Attributes

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

Detailed Description

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
struct detray::algebra::vc_aos::math::transform3< array_t, scalar_t >

Transform wrapper class to ensure standard API within different plugins.

Constructor & Destructor Documentation

◆ transform3() [1/7]

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::transform3 ( const vector3 & t,
const vector3 & x,
const vector3 & y,
const vector3 & z )

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

◆ transform3() [2/7]

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::transform3 ( const vector3 & t,
const vector3 & z,
const vector3 & x )

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
Note
y will be constructed by cross product

◆ transform3() [3/7]

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::transform3 ( const vector3 & t)
explicit

Constructor with arguments: translation.

Parameters
tis the transform

◆ transform3() [4/7]

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::transform3 ( const matrix44 & m)
explicit

Constructor with arguments: matrix.

Parameters
mis the full 4x4 matrix with simd-vector elements

◆ transform3() [5/7]

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
detray::algebra::vc_aos::math::transform3< array_t, 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<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::transform3 ( const array_type< 16 > & ma)
explicit

Constructor with arguments: matrix as std::array of scalar.

Parameters
mais the full 4x4 matrix 16 array

◆ transform3() [7/7]

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::transform3 ( const transform3< array_t, scalar_t > & rhs)
default

Copy an existing transform.

Parameters
rhsTransform whose matrices are copied.

Member Function Documentation

◆ determinant()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
scalar_type detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::determinant ( const matrix44 & m) const
constexpr

The determinant of a 4x4 matrix.

Parameters
mis the matrix
Returns
a scalar determinant - no checking done

◆ invert()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
matrix44 detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::invert ( const matrix44 & m) const
constexpr

The inverse of a 4x4 matrix.

Parameters
mis the matrix
Returns
an inverse matrix

◆ matrix()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
const matrix44 & detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::matrix ( ) const
constexpr

This method retrieves the 4x4 matrix of a transform.

Returns
forward transformation matrix

◆ matrix_inverse()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
const matrix44 & detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::matrix_inverse ( ) const
constexpr

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

Returns
inverse transformation matrix

◆ operator()() [1/2]

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
scalar_type & detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::operator() ( std::size_t row,
std::size_t col )
constexpr

Return a writable matrix element.

Parameters
rowzero-based row index
colzero-based column index
Returns
mutable reference to the requested matrix position

◆ operator()() [2/2]

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
const scalar_type & detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::operator() ( std::size_t row,
std::size_t col ) const
constexpr

Matrix access operator.

Parameters
rowzero-based row index
colzero-based column index
Returns
element at the requested matrix position

◆ operator==()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
bool detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::operator== ( const transform3< array_t, 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<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
template<concepts::point2D point2_type>
auto detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::point_to_global ( const point2_type & p) const
constexpr

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

Template Parameters
point2_typepoint in the local plane
Parameters
pis the point to be transformed
Returns
a global point

◆ point_to_global() [2/2]

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
template<concepts::point3D point3_type>
auto detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::point_to_global ( const point3_type & p) const
constexpr

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

Template Parameters
point3_typepoint in local coordinates
Parameters
pis the point to be transformed
Returns
a global point

◆ point_to_local()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
template<concepts::point3D point3_type>
auto detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::point_to_local ( const point3_type & p) const
constexpr

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

Template Parameters
point3_typepoint in global coordinates
Parameters
pis the point to be transformed
Returns
a local point

◆ rotate() [1/2]

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
template<concepts::vector2D vector2_type>
auto detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::rotate ( const matrix44 & m,
const vector2_type & v ) const
constexpr

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<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
template<concepts::vector3D vector3_type>
auto detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::rotate ( const matrix44 & m,
const vector3_type & v ) const
constexpr

Rotate a vector into / from a frame.

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

◆ rotation()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
auto detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::rotation ( ) const
constexpr

This method retrieves the rotation of a transform.

Returns
rotation matrix

◆ translation()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
const auto & detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::translation ( ) const
constexpr

This method retrieves the translation.

Returns
translation vector

◆ vector_to_global() [1/2]

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
template<concepts::vector2D vector2_type>
auto detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::vector_to_global ( const vector2_type & v) const
constexpr

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

Template Parameters
vector3_type3D vector
Parameters
vis the vector to be transformed
Returns
a vector in global coordinates

◆ vector_to_global() [2/2]

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
template<concepts::vector3D vector3_type>
auto detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::vector_to_global ( const vector3_type & v) const
constexpr

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

Template Parameters
vector3_type3D vector
Parameters
vis the vector to be transformed
Returns
a vector in global coordinates

◆ vector_to_local()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
template<concepts::vector3D vector3_type>
auto detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::vector_to_local ( const vector3_type & v) const
constexpr

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

Template Parameters
vector3_type3D vector
Parameters
vis the vector to be transformed
Returns
a vector in local coordinates

◆ x()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
const auto & detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::x ( ) const
constexpr

This method retrieves the new x-axis.

Returns
x-axis vector

◆ y()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
const auto & detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::y ( ) const
constexpr

This method retrieves the new y-axis.

Returns
y-axis vector

◆ z()

template<template< typename, std::size_t > class array_t, concepts::scalar scalar_t>
const auto & detray::algebra::vc_aos::math::transform3< array_t, scalar_t >::z ( ) const
constexpr

This method retrieves the new z-axis.

Returns
z-axis vector