Class Acts::ConvexPolygonBounds

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

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

N – Number of vertices

Public Types

using value_array = std::array<double, eSize>

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

using vertex_array = std::array<Vector2, num_vertices>

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

Public Functions

ConvexPolygonBounds() = delete
ConvexPolygonBounds(const std::vector<Vector2> &vertices) noexcept(false)

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

vertices – The list of vertices.

ConvexPolygonBounds(const vertex_array &vertices) noexcept(false)

Constructor from a fixed size array of vertices.

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

Parameters

vertices – The vertices

ConvexPolygonBounds(const value_array &values) noexcept(false)

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

Parameters

values – The values to build up the vertices

~ConvexPolygonBounds() override = default
virtual const RectangleBounds &boundingBox() const final

Return a rectangle bounds object that encloses this polygon.

Returns

The rectangular bounds

virtual bool inside(const Vector2 &lposition, const BoundaryCheck &bcheck) const final

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

Parameters
  • lposition – The local position to check

  • bcheck – The BoundaryCheck object handling tolerances.

Returns

Whether the points is inside

virtual BoundsType type() const final

Return the bounds type - for persistency optimization.

Returns

is a BoundsType enum

virtual std::vector<Vector2> vertices(unsigned int lseg = 1) const final

Return the vertices.

Note

the number of segements is ignored in this representation

Parameters

lseg – the number of segments used to approximate and eventually curved line

Returns

vector for vertices in 2D

Public Static Attributes

static constexpr size_t eSize = 2 * N

Expose number of parameters as a template parameter.

static constexpr size_t num_vertices = N

Expose number of vertices given as template parameter.