ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::Frustum< value_t, DIM, SIDES > Class Template Reference

#include <acts/blob/master/Core/include/Acts/Utilities/Frustum.hpp>

+ Collaboration diagram for Acts::Frustum< value_t, DIM, SIDES >:

Public Types

using value_type = value_t
 Re expose the value type.
 
using VertexType = ActsVector< value_t, DIM >
 Vertex type based on the value type and dimension.
 
using vertex_array_type = Eigen::Array< value_t, DIM, 1 >
 Vertex array type corresponding to the vertex type.
 
using transform_type = Eigen::Transform< value_t, DIM, Eigen::Affine >
 Associated transform type.
 

Public Member Functions

template<size_t D = DIM, std::enable_if_t< D==2, int > = 0>
 Frustum (const VertexType &origin, const VertexType &dir, value_type opening_angle)
 
template<size_t D = DIM, std::enable_if_t< D==3, int > = 0>
 Frustum (const VertexType &origin, const VertexType &dir, value_type opening_angle)
 
template<size_t D = DIM, std::enable_if_t< D==3, int > = 0>
void draw (IVisualization &helper, value_type far_distance=10) const
 
template<size_t D = DIM, std::enable_if_t< D==2, int > = 0>
std::ostream & svg (std::ostream &os, value_type w, value_type h, value_type far_distance=1, value_type unit=20.) const
 
const VertexTypeorigin () const
 
const VertexTypedir () const
 
const std::array< VertexType,
SIDES+1 > & 
normals () const
 
Frustum< value_t, DIM, SIDES > transformed (const transform_type &trf) const
 

Static Public Attributes

static constexpr size_t dim = DIM
 Re expose the number of dimensions.
 
static constexpr size_t sides = SIDES
 Re expose the number of sides.
 

Private Types

using translation_t = Eigen::Translation< value_t, DIM >
 

Private Member Functions

 Frustum (const VertexType &origin, std::array< VertexType, SIDES+1 > normals)
 

Private Attributes

VertexType m_origin
 
std::array< VertexType, SIDES+1 > m_normals
 

Static Private Attributes

static constexpr size_t n_normals = SIDES + 1
 

Detailed Description

template<typename value_t, size_t DIM, size_t SIDES>
class Acts::Frustum< value_t, DIM, SIDES >

Class representing a frustum shape. The frustum is defined using an origin, a direction and an opening angle. These parameters are then used to calculate a number of side planes, each having a position and a normal vector. The "near plane" is assumed to coincide with the origin point, and the normal with the "direction" of the frustum. No far plane is defined.

Template Parameters
value_tThe floating point value to use
DIMThe number of dimensions of ambient space
SIDESThe number of sides (= side planes) the frustum has (exactly 2 in 2D, minimum 3 in 3D)

Definition at line 28 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 28 of file Frustum.hpp

Member Typedef Documentation

template<typename value_t, size_t DIM, size_t SIDES>
using Acts::Frustum< value_t, DIM, SIDES >::transform_type = Eigen::Transform<value_t, DIM, Eigen::Affine>

Associated transform type.

Definition at line 41 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 41 of file Frustum.hpp

template<typename value_t, size_t DIM, size_t SIDES>
using Acts::Frustum< value_t, DIM, SIDES >::translation_t = Eigen::Translation<value_t, DIM>
private

Definition at line 29 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 29 of file Frustum.hpp

template<typename value_t, size_t DIM, size_t SIDES>
using Acts::Frustum< value_t, DIM, SIDES >::value_type = value_t

Re expose the value type.

Definition at line 35 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 35 of file Frustum.hpp

template<typename value_t, size_t DIM, size_t SIDES>
using Acts::Frustum< value_t, DIM, SIDES >::vertex_array_type = Eigen::Array<value_t, DIM, 1>

Vertex array type corresponding to the vertex type.

Definition at line 39 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 39 of file Frustum.hpp

template<typename value_t, size_t DIM, size_t SIDES>
using Acts::Frustum< value_t, DIM, SIDES >::VertexType = ActsVector<value_t, DIM>

Vertex type based on the value type and dimension.

Definition at line 37 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 37 of file Frustum.hpp

Constructor & Destructor Documentation

template<typename value_t , size_t DIM, size_t SIDES>
template<size_t D, std::enable_if_t< D==3, int > >
Acts::Frustum< value_t, DIM, SIDES >::Frustum ( const VertexType origin,
const VertexType dir,
value_type  opening_angle 
)

Constructor for the 2D case.

Parameters
originThe origin of the frustum
dirThe direction of the frustum
opening_angleThe opening angle
Note
The opening_angle is defined as the angle between opposing side planes. The opening angle needs to be < pi.

Definition at line 13 of file Frustum.ipp.

View newest version in sPHENIX GitHub at line 13 of file Frustum.ipp

References angle, Acts::Frustum< value_t, DIM, SIDES >::m_normals, M_PI, and Acts::VectorHelpers::phi().

+ Here is the call graph for this function:

template<typename value_t, size_t DIM, size_t SIDES>
template<size_t D = DIM, std::enable_if_t< D==3, int > = 0>
Acts::Frustum< value_t, DIM, SIDES >::Frustum ( const VertexType origin,
const VertexType dir,
value_type  opening_angle 
)

Constructor for the 3D case.

Parameters
originThe origin of the frustum
dirThe direction of the frustum
opening_angleThe opening angle
Note
The opening_angle is defined as the angle between opposing side planes. The opening angle needs to be < pi.
template<typename value_t, size_t DIM, size_t SIDES>
Acts::Frustum< value_t, DIM, SIDES >::Frustum ( const VertexType origin,
std::array< VertexType, SIDES+1 >  normals 
)
inlineprivate

Definition at line 109 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 109 of file Frustum.hpp

Member Function Documentation

template<typename value_t, size_t DIM, size_t SIDES>
const VertexType& Acts::Frustum< value_t, DIM, SIDES >::dir ( ) const
inline

Getter for the direction of the frustum

Returns
The direction of the frustum

Definition at line 94 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 94 of file Frustum.hpp

References Acts::Frustum< value_t, DIM, SIDES >::m_normals.

template<typename value_t , size_t DIM, size_t SIDES>
template<size_t D, std::enable_if_t< D==3, int > >
void Acts::Frustum< value_t, DIM, SIDES >::draw ( IVisualization helper,
value_type  far_distance = 10 
) const

Draw a representation of this frustum using a visualization helper

Note
This is only available for the 3D case.
Parameters
helperThe visualization helper
far_distanceThe distance to the virtual "far plane" at which point the side planes terminate visually.

Definition at line 78 of file Frustum.ipp.

View newest version in sPHENIX GitHub at line 78 of file Frustum.ipp

References Acts::VectorHelpers::cross(), d1, d2, Acts::IVisualization::face(), m, n1, and norm.

Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename value_t, size_t DIM, size_t SIDES>
const std::array<VertexType, SIDES + 1>& Acts::Frustum< value_t, DIM, SIDES >::normals ( ) const
inline

Getter for the normal vectors of the planes defining this frustum.

Returns
Array containing the normal vectors for all planes.
Note
The size of the array that is returned is fixed to number of sides
  • 1

Definition at line 100 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 100 of file Frustum.hpp

References Acts::Frustum< value_t, DIM, SIDES >::m_normals.

Referenced by Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::intersect().

+ Here is the caller graph for this function:

template<typename value_t, size_t DIM, size_t SIDES>
const VertexType& Acts::Frustum< value_t, DIM, SIDES >::origin ( ) const
inline

Getter for the oriogin of the frustum

Returns
The origin of the frustum

Definition at line 90 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 90 of file Frustum.hpp

References Acts::Frustum< value_t, DIM, SIDES >::m_origin.

Referenced by Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::intersect().

+ Here is the caller graph for this function:

template<typename value_t , size_t DIM, size_t SIDES>
template<size_t D, std::enable_if_t< D==2, int > >
std::ostream & Acts::Frustum< value_t, DIM, SIDES >::svg ( std::ostream &  os,
value_type  w,
value_type  h,
value_type  far_distance = 1,
value_type  unit = 20. 
) const

Draw a representation of this frustum as an SVG string to an outstream

Note
This is only available for the 2D case.
Parameters
osThe out stream to write to
wThe width of the output SVG
hThe height of the output SVG
far_distanceThe distance to the virtual "far line" at which point the side lines terminate visually.
unitMultiplicative factor to apply to internal distances

Definition at line 130 of file Frustum.ipp.

View newest version in sPHENIX GitHub at line 130 of file Frustum.ipp

References kdfinder::abs(), color(), Acts::VectorHelpers::cross(), d1, d2, den, e, f, left, num, r, right, width, x, and y.

+ Here is the call graph for this function:

template<typename value_t , size_t DIM, size_t SIDES>
Acts::Frustum< value_t, DIM, SIDES > Acts::Frustum< value_t, DIM, SIDES >::transformed ( const transform_type trf) const

Transforms this frustum using a given transform and returns a new instance

Parameters
trfThe transform to apply
Returns
A copy of this frustum with the transform trf applied.

Definition at line 219 of file Frustum.ipp.

View newest version in sPHENIX GitHub at line 219 of file Frustum.ipp

Member Data Documentation

template<typename value_t, size_t DIM, size_t SIDES>
constexpr size_t Acts::Frustum< value_t, DIM, SIDES >::dim = DIM
static

Re expose the number of dimensions.

Definition at line 44 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 44 of file Frustum.hpp

template<typename value_t, size_t DIM, size_t SIDES>
std::array<VertexType, SIDES + 1> Acts::Frustum< value_t, DIM, SIDES >::m_normals
private

Definition at line 114 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 114 of file Frustum.hpp

Referenced by Acts::Frustum< value_t, DIM, SIDES >::dir(), Acts::Frustum< value_t, DIM, SIDES >::Frustum(), and Acts::Frustum< value_t, DIM, SIDES >::normals().

template<typename value_t, size_t DIM, size_t SIDES>
VertexType Acts::Frustum< value_t, DIM, SIDES >::m_origin
private

Definition at line 112 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 112 of file Frustum.hpp

Referenced by Acts::Frustum< value_t, DIM, SIDES >::origin().

template<typename value_t, size_t DIM, size_t SIDES>
constexpr size_t Acts::Frustum< value_t, DIM, SIDES >::n_normals = SIDES + 1
staticprivate

Definition at line 31 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 31 of file Frustum.hpp

template<typename value_t, size_t DIM, size_t SIDES>
constexpr size_t Acts::Frustum< value_t, DIM, SIDES >::sides = SIDES
static

Re expose the number of sides.

Definition at line 46 of file Frustum.hpp.

View newest version in sPHENIX GitHub at line 46 of file Frustum.hpp


The documentation for this class was generated from the following files: