ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Acts::ConvexPolygonBounds< N > Class Template Reference

#include <acts/blob/master/Core/include/Acts/Surfaces/ConvexPolygonBounds.hpp>

+ Inheritance diagram for Acts::ConvexPolygonBounds< N >:
+ Collaboration diagram for Acts::ConvexPolygonBounds< N >:

Public Types

using vertex_array = std::array< Vector2D, num_vertices >
 
using value_array = std::array< double, eSize >
 

Public Member Functions

 ConvexPolygonBounds ()=delete
 
 ConvexPolygonBounds (const std::vector< Vector2D > &vertices) noexcept(false)
 
 ConvexPolygonBounds (const vertex_array &vertices) noexcept(false)
 
 ConvexPolygonBounds (const value_array &values) noexcept(false)
 
 ~ConvexPolygonBounds () override=default
 
BoundsType type () const final
 
bool inside (const Vector2D &lposition, const BoundaryCheck &bcheck) const final
 
double distanceToBoundary (const Vector2D &lposition) const final
 
std::vector< Vector2Dvertices (unsigned int lseg=1) const final
 
const RectangleBoundsboundingBox () const final
 
- Public Member Functions inherited from Acts::ConvexPolygonBoundsBase
std::ostream & toStream (std::ostream &sl) const final
 
std::vector< double > values () const final
 

Static Public Attributes

static constexpr size_t num_vertices = N
 
static constexpr size_t eSize = 2 * N
 

Private Member Functions

void checkConsistency () const noexcept(false)
 

Private Attributes

vertex_array m_vertices
 
RectangleBounds m_boundingBox
 

Additional Inherited Members

- Static Protected Member Functions inherited from Acts::ConvexPolygonBoundsBase
template<typename coll_t >
static RectangleBounds makeBoundingBox (const coll_t &vertices)
 
template<typename coll_t >
static void convex_impl (const coll_t &vertices) noexcept(false)
 

Detailed Description

template<int N>
class Acts::ConvexPolygonBounds< N >

This is the actual implementation of the bounds. It is templated on the number of vertices, but there is a specialization for dynamic number of vertices, where the underlying storage is then a vector.

Template Parameters
NNumber of vertices

Definition at line 59 of file ConvexPolygonBounds.hpp.

View newest version in sPHENIX GitHub at line 59 of file ConvexPolygonBounds.hpp

Member Typedef Documentation

template<int N>
using Acts::ConvexPolygonBounds< N >::value_array = std::array<double, eSize>

Type that's used to store the vertices, in this case a fixed size array.

Definition at line 72 of file ConvexPolygonBounds.hpp.

View newest version in sPHENIX GitHub at line 72 of file ConvexPolygonBounds.hpp

template<int N>
using Acts::ConvexPolygonBounds< N >::vertex_array = std::array<Vector2D, num_vertices>

Type that's used to store the vertices, in this case a fixed size array.

Definition at line 66 of file ConvexPolygonBounds.hpp.

View newest version in sPHENIX GitHub at line 66 of file ConvexPolygonBounds.hpp

Constructor & Destructor Documentation

template<int N>
Acts::ConvexPolygonBounds< N >::ConvexPolygonBounds ( )
delete
template<int N>
Acts::ConvexPolygonBounds< N >::ConvexPolygonBounds ( const std::vector< Vector2D > &  vertices)
noexcept

Constructor from a vector of vertices, to facilitate construction. This will throw if the vector size does not match num_vertices. This will throw if the vertices do not form a convex polygon.

Parameters
verticesThe list of vertices.

Definition at line 90 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 90 of file ConvexPolygonBounds.ipp

References N, and throw_assert.

template<int N>
Acts::ConvexPolygonBounds< N >::ConvexPolygonBounds ( const vertex_array vertices)
noexcept

Constructor from a fixed size array of vertices. This will throw if the vertices do not form a convex polygon.

Parameters
verticesThe vertices

Definition at line 102 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 102 of file ConvexPolygonBounds.ipp

template<int N>
Acts::ConvexPolygonBounds< N >::ConvexPolygonBounds ( const value_array values)
noexcept

Constructor from a fixed size array of parameters This will throw if the vertices do not form a convex polygon.

Parameters
valuesThe values to build up the vertices

Definition at line 109 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 109 of file ConvexPolygonBounds.ipp

References N, and Acts::Test::values.

template<int N>
Acts::ConvexPolygonBounds< N >::~ConvexPolygonBounds ( )
overridedefault

Member Function Documentation

template<int N>
const Acts::RectangleBounds & Acts::ConvexPolygonBounds< N >::boundingBox ( ) const
finalvirtual

Return a rectangle bounds object that encloses this polygon.

Returns
The rectangular bounds

Implements Acts::PlanarBounds.

Definition at line 143 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 143 of file ConvexPolygonBounds.ipp

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

+ Here is the caller graph for this function:

template<int N>
void Acts::ConvexPolygonBounds< N >::checkConsistency ( ) const
privatenoexcept

Return whether this bounds class is in fact convex throws a log error if not

Definition at line 148 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 148 of file ConvexPolygonBounds.ipp

template<int N>
double Acts::ConvexPolygonBounds< N >::distanceToBoundary ( const Vector2D lposition) const
finalvirtual

Return the smallest distance to any point on the boundary of this bounds object.

Parameters
lpositionThe local position to get the distance to
Returns
The smallest distance to the boundary.

Implements Acts::SurfaceBounds.

Definition at line 131 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 131 of file ConvexPolygonBounds.ipp

References Acts::BoundaryCheck::distance().

+ Here is the call graph for this function:

template<int N>
bool Acts::ConvexPolygonBounds< N >::inside ( const Vector2D lposition,
const BoundaryCheck bcheck 
) const
finalvirtual

Return whether a local 2D point lies inside of the bounds defined by this object.

Parameters
lpositionThe local position to check
bcheckThe BoundaryCheck object handling tolerances.
Returns
Whether the points is inside

Implements Acts::SurfaceBounds.

Definition at line 125 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 125 of file ConvexPolygonBounds.ipp

References Acts::BoundaryCheck::isInside().

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<int N>
Acts::SurfaceBounds::BoundsType Acts::ConvexPolygonBounds< N >::type ( ) const
finalvirtual

Return the bounds type - for persistency optimization

Returns
is a BoundsType enum

Implements Acts::SurfaceBounds.

Definition at line 120 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 120 of file ConvexPolygonBounds.ipp

References Acts::SurfaceBounds::eConvexPolygon.

template<int N>
std::vector< Acts::Vector2D > Acts::ConvexPolygonBounds< N >::vertices ( unsigned int  lseg = 1) const
finalvirtual

Return the vertices

Parameters
lsegthe number of segments used to approximate and eventually curved line
Note
the number of segements is ignored in this representation
Returns
vector for vertices in 2D

Implements Acts::PlanarBounds.

Definition at line 137 of file ConvexPolygonBounds.ipp.

View newest version in sPHENIX GitHub at line 137 of file ConvexPolygonBounds.ipp

Member Data Documentation

template<int N>
constexpr size_t Acts::ConvexPolygonBounds< N >::eSize = 2 * N
static

Expose number of parameters as a template parameter

Definition at line 69 of file ConvexPolygonBounds.hpp.

View newest version in sPHENIX GitHub at line 69 of file ConvexPolygonBounds.hpp

template<int N>
RectangleBounds Acts::ConvexPolygonBounds< N >::m_boundingBox
private

Definition at line 128 of file ConvexPolygonBounds.hpp.

View newest version in sPHENIX GitHub at line 128 of file ConvexPolygonBounds.hpp

template<int N>
vertex_array Acts::ConvexPolygonBounds< N >::m_vertices
private

Definition at line 127 of file ConvexPolygonBounds.hpp.

View newest version in sPHENIX GitHub at line 127 of file ConvexPolygonBounds.hpp

template<int N>
constexpr size_t Acts::ConvexPolygonBounds< N >::num_vertices = N
static

Expose number of vertices given as template parameter.

Definition at line 63 of file ConvexPolygonBounds.hpp.

View newest version in sPHENIX GitHub at line 63 of file ConvexPolygonBounds.hpp


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