ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::ConvexPolygonBounds< PolygonDynamic > Class Reference

This is the specialization handling a polygon with a dynamic number of points. More...

#include <Acts/Surfaces/ConvexPolygonBounds.hpp>

Inheritance diagram for Acts::ConvexPolygonBounds< PolygonDynamic >:
[legend]
Collaboration diagram for Acts::ConvexPolygonBounds< PolygonDynamic >:
[legend]

Public Member Functions

 ConvexPolygonBounds (const std::vector< Vector2 > &vertices)
 Constructor from a vector of vertices, to facilitate construction.
 ConvexPolygonBounds (std::span< const Vector2 > vertices)
 Constructor from a vector of vertices, to facilitate construction.
Vector2 closestPoint (const Vector2 &lposition, const SquareMatrix2 &metric) const final
 Calculates the closest point on the bounds to a given local position.
bool inside (const Vector2 &lposition) const final
 Inside check for the bounds object.
virtual bool inside (const Vector2 &lposition, const BoundaryTolerance &boundaryTolerance) const
 Inside check for the bounds object given a boundary tolerance.
std::vector< Vector2vertices (unsigned int lseg=1) const final
 Return the vertices.
Public Member Functions inherited from Acts::ConvexPolygonBoundsBase
const RectangleBoundsboundingBox () const final
 Return a rectangle bounds object that encloses this polygon.
Vector2 center () const final
 Calculate the center of the surface bounds in local coordinates.
std::ostream & toStream (std::ostream &sl) const final
 Output Method for std::ostream.
BoundsType type () const final
 Return the bounds type of this bounds object.
std::vector< double > values () const final
 Return the bound values as dynamically sized vector.
Public Member Functions inherited from Acts::PlanarBounds
SquareMatrix2 boundToCartesianJacobian (const Vector2 &lposition) const final
 Computes the bound to cartesian jacobian at a given local position.
SquareMatrix2 boundToCartesianMetric (const Vector2 &lposition) const final
 Computes the bound to cartesian metric at a given local position.
bool isCartesian () const final
 Check if the bound coordinates are cartesian.
Public Member Functions inherited from Acts::SurfaceBounds
virtual ~SurfaceBounds ()=default
virtual double distance (const Vector2 &lposition) const
 Calculates the distance to the bounds from a given local position.

Static Public Attributes

static constexpr int eSize = -1
 Expose number of parameters as a template parameter.
static constexpr int nVertices = PolygonDynamic
 Expose number of vertices given as template parameter.

Additional Inherited Members

Public Types inherited from Acts::SurfaceBounds
enum  BoundsType : int {
  eCone = 0 , eCylinder = 1 , eDiamond = 2 , eDisc = 3 ,
  eEllipse = 4 , eLine = 5 , eRectangle = 6 , eTrapezoid = 7 ,
  eTriangle = 8 , eDiscTrapezoid = 9 , eConvexPolygon = 10 , eAnnulus = 11 ,
  eBoundless = 12 , eOther = 13
}
 This is nested to the SurfaceBounds, as also VolumeBounds will have Bounds Type. More...
Protected Member Functions inherited from Acts::ConvexPolygonBoundsBase
void calculateCenter (std::span< const Vector2 > vertices)
 Calculate and cache the center point from vertices.
void makeBoundingBox (std::span< const Vector2 > vertices)
 Creates a rectangle bounds instance that encloses a set of vertices.
Static Protected Member Functions inherited from Acts::ConvexPolygonBoundsBase
static void checkConsistency (std::span< const Vector2 > vertices) noexcept(false)
 Return whether this bounds class is in fact convex thorws a logic error if not.
template<typename coll_t>
requires std::same_as<typename coll_t::value_type, Acts::Vector2>
static void convex_impl (const coll_t &vertices) noexcept(false)
 Calculates whether a set of vertices forms a convex polygon.

Detailed Description

This is the specialization handling a polygon with a dynamic number of points.

It can accept any number of points.

Constructor & Destructor Documentation

◆ ConvexPolygonBounds() [1/2]

Acts::ConvexPolygonBounds< PolygonDynamic >::ConvexPolygonBounds ( std::span< const Vector2 > vertices)
explicit

Constructor from a vector of vertices, to facilitate construction.

This will throw if the vertices do not form a convex polygon.

Parameters
verticesThe list of vertices.

◆ ConvexPolygonBounds() [2/2]

Acts::ConvexPolygonBounds< PolygonDynamic >::ConvexPolygonBounds ( const std::vector< Vector2 > & vertices)
explicit

Constructor from a vector of vertices, to facilitate construction.

This will throw if the vertices do not form a convex polygon.

Parameters
verticesThe list of vertices.

Member Function Documentation

◆ closestPoint()

Vector2 Acts::ConvexPolygonBounds< PolygonDynamic >::closestPoint ( const Vector2 & lposition,
const SquareMatrix2 & metric ) const
finalvirtual

Calculates the closest point on the bounds to a given local position.

Parameters
lpositionis the local position
metricto be used for the distance calculation
Returns
the closest point on the bounds

Implements Acts::SurfaceBounds.

◆ inside() [1/2]

bool Acts::ConvexPolygonBounds< PolygonDynamic >::inside ( const Vector2 & lposition) const
finalvirtual

Inside check for the bounds object.

Parameters
lpositionis the local position
Returns
true if the local position is inside the bounds

Implements Acts::SurfaceBounds.

◆ inside() [2/2]

( const Vector2 & lposition,
const BoundaryTolerance & boundaryTolerance ) const
virtual

Inside check for the bounds object given a boundary tolerance.

Parameters
lpositionis the local position
boundaryToleranceis the boundary tolerance object
Returns
true if the local position is inside the bounds and tolerance

Reimplemented from Acts::SurfaceBounds.

◆ vertices()

std::vector< Vector2 > Acts::ConvexPolygonBounds< PolygonDynamic >::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 segments is ignored in this representation
Returns
vector for vertices in 2D

Implements Acts::PlanarBounds.

Member Data Documentation

◆ eSize

int Acts::ConvexPolygonBounds< PolygonDynamic >::eSize = -1
staticconstexpr

Expose number of parameters as a template parameter.

Note
The eSize name here emulates the size of the bound values in other bounds classes.

◆ nVertices

int Acts::ConvexPolygonBounds< PolygonDynamic >::nVertices = PolygonDynamic
staticconstexpr

Expose number of vertices given as template parameter.