ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
|
#include <acts/blob/master/Core/include/Acts/Utilities/BoundingBox.hpp>
Classes | |
class | NamedType |
struct | SizeParameter |
Public Types | |
using | value_type = value_t |
using | VertexType = ActsVector< value_t, DIM > |
using | vertex_array_type = Eigen::Array< value_t, DIM, 1 > |
using | entity_type = entity_t |
using | transform_type = Eigen::Transform< value_type, DIM, Eigen::Affine > |
using | Size = NamedType< VertexType, struct SizeParameter > |
Public Member Functions | |
AxisAlignedBoundingBox (const self_t &other)=default | |
AxisAlignedBoundingBox (const entity_t *entity, const VertexType &vmin, const VertexType &vmax) | |
AxisAlignedBoundingBox (const entity_t *entity, const VertexType ¢er, const Size &size) | |
AxisAlignedBoundingBox (const std::vector< self_t * > &boxes, vertex_array_type envelope=vertex_array_type::Zero()) | |
bool | intersect (const VertexType &point) const |
bool | intersect (const Ray< value_type, DIM > &ray) const |
Implements the slab method for Ray/AABB intersections. | |
template<size_t sides> | |
bool | intersect (const Frustum< value_type, DIM, sides > &fr) const |
void | setSkip (self_t *skip) |
const self_t * | getSkip () const |
const self_t * | getLeftChild () const |
bool | hasEntity () const |
const entity_t * | entity () const |
void | setEntity (const entity_t *entity) |
const VertexType & | center () const |
const VertexType & | min () const |
const VertexType & | max () const |
std::ostream & | toStream (std::ostream &os) const |
void | transform (const transform_type &trf) |
self_t | transformed (const transform_type &trf) const |
template<size_t D = DIM, std::enable_if_t< D==3, int > = 0> | |
void | draw (IVisualization &helper, std::array< int, 3 > color={120, 120, 120}, const transform_type &trf=transform_type::Identity()) 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 unit=10, std::string label="", std::string fillcolor="grey") const |
Static Public Member Functions | |
static std::pair< VertexType, VertexType > | wrap (const std::vector< const self_t * > &boxes, vertex_array_type envelope=vertex_array_type::Zero()) |
static std::pair< VertexType, VertexType > | wrap (const std::vector< self_t * > &boxes, vertex_array_type envelope=vertex_array_type::Zero()) |
static std::pair< VertexType, VertexType > | wrap (const std::vector< self_t > &boxes, vertex_array_type envelope=vertex_array_type::Zero()) |
Static Public Attributes | |
static const size_t | dim = DIM |
Private Types | |
using | self_t = AxisAlignedBoundingBox< entity_t, value_t, DIM > |
Private Member Functions | |
template<size_t D = DIM, std::enable_if_t< D==2, int > = 0> | |
std::pair< VertexType, VertexType > | transformVertices (const transform_type &trf) const |
template<size_t D = DIM, std::enable_if_t< D==3, int > = 0> | |
std::pair< VertexType, VertexType > | transformVertices (const transform_type &trf) const |
Private Attributes | |
const entity_t * | m_entity |
VertexType | m_vmin |
VertexType | m_vmax |
VertexType | m_center |
vertex_array_type | m_width |
vertex_array_type | m_iwidth |
self_t * | m_left_child {nullptr} |
self_t * | m_right_child {nullptr} |
self_t * | m_skip {nullptr} |
Implementation of an Axis Aligned Bounding Box. This type is compatible with 2D and 3D boxes
Definition at line 31 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 31 of file BoundingBox.hpp
using Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::entity_type = entity_t |
Type of stored entity
Definition at line 79 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 79 of file BoundingBox.hpp
|
private |
Private self type to capture template parameters
Definition at line 36 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 36 of file BoundingBox.hpp
using Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::Size = NamedType<VertexType, struct SizeParameter> |
Strong type to select the correct constructor
Definition at line 89 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 89 of file BoundingBox.hpp
using Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::transform_type = Eigen::Transform<value_type, DIM, Eigen::Affine> |
The transform type based on the value_type
Definition at line 84 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 84 of file BoundingBox.hpp
using Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::value_type = value_t |
The value type used by this class
Definition at line 64 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 64 of file BoundingBox.hpp
using Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::vertex_array_type = Eigen::Array<value_t, DIM, 1> |
Associated array value to VertexType
Definition at line 74 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 74 of file BoundingBox.hpp
using Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::VertexType = ActsVector<value_t, DIM> |
Re-export vertex type based on value type given
Definition at line 69 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 69 of file BoundingBox.hpp
|
default |
Copy constructor from other bounding box.
other | The other AABB |
Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::AxisAlignedBoundingBox | ( | const entity_t * | entity, |
const VertexType & | vmin, | ||
const VertexType & | vmax | ||
) |
Constructor from an entity pointer, and the min and max vertices.
entity | The entity to store |
vmin | The minimum vertex. |
vmax | The maximum vertex. |
Definition at line 10 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 10 of file BoundingBox.ipp
Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::AxisAlignedBoundingBox | ( | const entity_t * | entity, |
const VertexType & | center, | ||
const Size & | size | ||
) |
Constructor from a center position, and a width and height.
entity | The entity to store |
center | The center position |
size | The size (width and height) of the box. |
size
is required to disambiguate this constructor from the other one above. It is a wrapper around a simple Vector3D
. Definition at line 20 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 20 of file BoundingBox.ipp
Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::AxisAlignedBoundingBox | ( | const std::vector< self_t * > & | boxes, |
vertex_array_type | envelope = vertex_array_type::Zero() |
||
) |
Constructor from a list of child boxes. This box will wrap around all boxes contained in boxes
, and additional envelope can be given.
boxes | Vector of child boxes to store in this bounding box. |
envelope | Envelope that will be added/subtracted to the dimension. |
Definition at line 30 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 30 of file BoundingBox.ipp
References Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::m_center, Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::m_iwidth, Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::m_left_child, Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::m_right_child, Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::m_skip, Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::m_vmax, Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::m_vmin, Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::m_width, and Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::wrap().
const Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::VertexType & Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::center | ( | ) | const |
Get the center position of this bounding box.
Definition at line 227 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 227 of file BoundingBox.ipp
void Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::draw | ( | IVisualization & | helper, |
std::array< int, 3 > | color = {120, 120, 120} , |
||
const transform_type & | trf = transform_type::Identity() |
||
) | const |
Draw this bounding box using the given visualization helper. This method is only available for the 3D case.
D | (used for SFINAE) |
helper | The visualization helper to write to |
color | The color to use for drawing |
trf | An optional transform to apply first. |
Definition at line 354 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 354 of file BoundingBox.ipp
References a, b, c, d, and Acts::IVisualization::face().
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::Test::ObjTestWriter::writeObj().
const entity_t * Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::entity | ( | ) | const |
Return the entity associated with this box. This might be nullptr if there is no entity attached.
Definition at line 214 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 214 of file BoundingBox.ipp
Referenced by Acts::TrackingVolume::intersectSearchHierarchy().
const Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM > * Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::getLeftChild | ( | ) | const |
Get the left child (i.e. the first of the children that are inside this bounding box).
Definition at line 198 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 198 of file BoundingBox.ipp
Referenced by Acts::TrackingVolume::intersectSearchHierarchy().
const Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM > * Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::getSkip | ( | ) | const |
Get the skip node for this box
Definition at line 204 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 204 of file BoundingBox.ipp
Referenced by Acts::TrackingVolume::intersectSearchHierarchy().
bool Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::hasEntity | ( | ) | const |
Check whether this node as an associated entity. If it does not have one, this is a purely abstract container box.
Definition at line 209 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 209 of file BoundingBox.ipp
Referenced by Acts::TrackingVolume::intersectSearchHierarchy().
bool Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::intersect | ( | const VertexType & | point | ) | const |
Calculate whether a point is inside this box.
point | The point to test. |
Definition at line 111 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 111 of file BoundingBox.ipp
References t.
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE(), and Acts::TrackingVolume::intersectSearchHierarchy().
bool Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::intersect | ( | const Ray< value_type, DIM > & | ray | ) | const |
Implements the slab method for Ray/AABB intersections.
See https://tavianator.com/fast-branchless-raybounding-box-intersections/, https://tavianator.com/fast-branchless-raybounding-box-intersections-part-2-nans/, https://medium.com/@bromanz/another-view-on-the-classic-ray-aabb-intersection-algorithm-for-bvh-traversal-41125138b525 The original algorithms is described in "Graphics Gems (1990)" 1
NaNs
are handled by Eigen. See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=564 ray | The ray to intersect with |
Definition at line 118 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 118 of file BoundingBox.ipp
References Acts::Ray< value_t, DIM >::idir(), Acts::Ray< value_t, DIM >::origin(), and Acts::Test::origin().
bool Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::intersect | ( | const Frustum< value_type, DIM, sides > & | fr | ) | const |
Check if a frustum intersects with this bounding box.
This method implements an algorithm similar to the one described in "Optimized View Frustum Culling Algorithms for Bounding Boxes (2012)" 2, but drops some of the more sophisticated optimization.
fr | The frustum |
Definition at line 148 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 148 of file BoundingBox.ipp
References CLHEP::normal(), Acts::Frustum< value_t, DIM, SIDES >::normals(), and Acts::Frustum< value_t, DIM, SIDES >::origin().
const Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::VertexType & Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::max | ( | ) | const |
Get the maximum vertex
Definition at line 239 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 239 of file BoundingBox.ipp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().
const Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::VertexType & Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::min | ( | ) | const |
Get the minimum vertex
Definition at line 233 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 233 of file BoundingBox.ipp
Referenced by Acts::Test::BOOST_AUTO_TEST_CASE().
void Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::setEntity | ( | const entity_t * | entity | ) |
Set the entity associated with with this box.
entity | The entity |
Definition at line 220 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 220 of file BoundingBox.ipp
void Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::setSkip | ( | self_t * | skip | ) |
Set the skip node (bounding box)
skip | The target skip node pointer |
Definition at line 186 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 186 of file BoundingBox.ipp
References Acts::IntegrationTest::skip.
std::ostream & Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::svg | ( | std::ostream & | os, |
value_type | w, | ||
value_type | h, | ||
value_type | unit = 10 , |
||
std::string | label = "" , |
||
std::string | fillcolor = "grey" |
||
) | const |
Draw this bounding box as SVG. This method is only available for the 2D case.
D | (used for SFINAE) |
os | The output stream to write to |
w | The width of the output SVG. |
h | The height of the output SVG. |
unit | A scale factor to apply before drawing |
label | A label to put next to the box. |
fillcolor | Color to fill the box with. |
os
. Definition at line 389 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 389 of file BoundingBox.ipp
std::ostream & Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::toStream | ( | std::ostream & | os | ) | const |
Write information about this bounding box to a stream.
os | The output stream. |
Definition at line 244 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 244 of file BoundingBox.ipp
void Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::transform | ( | const transform_type & | trf | ) |
Transforms this bounding box using the given transform. This method modifies the box it is called on.
trf | The transform |
Definition at line 338 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 338 of file BoundingBox.ipp
Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM > Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::transformed | ( | const transform_type & | trf | ) | const |
Transforms this bounding box using the given transfom. This method returns a copy of this box, with the transformation applied, and leaves this instance unchanged.
trf | The transform |
Definition at line 345 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 345 of file BoundingBox.ipp
Referenced by Acts::CutoutCylinderVolumeBounds::boundingBox(), and Acts::CuboidVolumeBounds::boundingBox().
|
private |
Definition at line 282 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 282 of file BoundingBox.ipp
|
private |
|
static |
Helper function to calculate the size of a bounding box enclosing boxes
.
boxes | The boxes to wrap (const pointers) |
envelope | Optional envelop to add/subtract to dimension. |
Definition at line 61 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 61 of file BoundingBox.ipp
Referenced by Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::AxisAlignedBoundingBox().
|
static |
Helper function to calculate the size of a bounding box enclosing boxes
. Overload which accepts non-const boxes in boxes
.
boxes | The boxes to wrap (non-const pointers) |
envelope | Optional envelop to add/subtract to dimension. |
Definition at line 86 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 86 of file BoundingBox.ipp
References Acts::Test::transform.
|
static |
Helper function to calculate the size of a bounding box enclosing boxes
. Overload which accepts a vector in boxes
which owns the instances
boxes | The boxes to wrap (by-value vector) |
envelope | Optional envelop to add/subtract to dimension. |
Definition at line 100 of file BoundingBox.ipp.
View newest version in sPHENIX GitHub at line 100 of file BoundingBox.ipp
References Acts::Test::transform.
|
static |
Re-export dimension from template parameter
Definition at line 94 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 94 of file BoundingBox.hpp
|
private |
Definition at line 323 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 323 of file BoundingBox.hpp
Referenced by Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::AxisAlignedBoundingBox().
|
private |
Definition at line 320 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 320 of file BoundingBox.hpp
|
private |
Definition at line 325 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 325 of file BoundingBox.hpp
Referenced by Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::AxisAlignedBoundingBox().
|
private |
Definition at line 327 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 327 of file BoundingBox.hpp
Referenced by Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::AxisAlignedBoundingBox().
|
private |
Definition at line 328 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 328 of file BoundingBox.hpp
Referenced by Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::AxisAlignedBoundingBox().
|
private |
Definition at line 329 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 329 of file BoundingBox.hpp
Referenced by Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::AxisAlignedBoundingBox().
|
private |
Definition at line 322 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 322 of file BoundingBox.hpp
Referenced by Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::AxisAlignedBoundingBox().
|
private |
Definition at line 321 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 321 of file BoundingBox.hpp
Referenced by Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::AxisAlignedBoundingBox().
|
private |
Definition at line 324 of file BoundingBox.hpp.
View newest version in sPHENIX GitHub at line 324 of file BoundingBox.hpp
Referenced by Acts::AxisAlignedBoundingBox< entity_t, value_t, DIM >::AxisAlignedBoundingBox().