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