ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::unbounded< shape_t > Class Template Reference

Wraps any shape, but does not enforce boundaries. More...

#include <detray/geometry/shapes/unbounded.hpp>

Collaboration diagram for detray::unbounded< shape_t >:
[legend]

Public Types

using boundaries = typename shape::boundaries
 Boundary index enum inherited from the wrapped shape.
template<concepts::scalar scalar_t>
using bounds_type = darray<scalar_t, boundaries::e_size>
 Container definition for the shape boundary values.
template<concepts::algebra algebra_t>
using local_frame_type = typename shape::template local_frame_type<algebra_t>
 Local coordinate frame for boundary checks.
template<typename bool_t>
using result_type = detail::boundary_check_result<bool_t>
 Result type of a boundary check.
using shape = shape_t
 Wrapped shape whose boundary checks always accept a point.

Public Member Functions

template<concepts::scalar scalar_t>
constexpr scalar_t area (const bounds_type< scalar_t > &) const
 The area of a the shape.
template<concepts::algebra algebra_t>
auto centroid (const bounds_type< dscalar< algebra_t > > &bounds) const
template<concepts::scalar scalar_t>
constexpr bool check_consistency (const bounds_type< scalar_t > &, const std::ostream &) const
 Check consistency of boundary values.
template<concepts::algebra algebra_t>
darray< dscalar< algebra_t >, 6 > local_min_bounds (const bounds_type< dscalar< algebra_t > > &bounds, const dscalar< algebra_t > env=std::numeric_limits< dscalar< algebra_t > >::epsilon()) const
 Lower and upper point for minimal axis aligned bounding box.
template<concepts::scalar scalar_t>
constexpr scalar_t measure (const bounds_type< scalar_t > &bounds) const
 Measure of the shape: Inf.
template<concepts::scalar scalar_t>
constexpr bounds_type< scalar_t > merge (const bounds_type< scalar_t > &, const bounds_type< scalar_t > &) const
 Merge two unbounded shapes.
template<concepts::scalar scalar_t, concepts::point point_t>
constexpr scalar_t min_dist_to_boundary (const bounds_type< scalar_t > &, const point_t &) const
 Find the minimum distance to any boundary.
template<concepts::algebra algebra_t>
dvector< dpoint3D< algebra_t > > vertices (const bounds_type< dscalar< algebra_t > > &bounds, dindex n_seg) const
 Generate vertices in local cartesian frame.
template<concepts::scalar scalar_t>
constexpr scalar_t volume (const bounds_type< scalar_t > &) const
 The volume of a the shape.
template<concepts::algebra algebra_t>
constexpr result_type< dbool< algebra_t > > check_boundaries (const bounds_type< dscalar< algebra_t > > &, const dtransform3D< algebra_t > &, const dpoint3D< algebra_t > &, const dscalar< algebra_t >=0.f, const dscalar< algebra_t >=0.f) const
 Check boundary values for a local point.
template<typename bounds_t, concepts::point point_t, concepts::scalar scalar_t>
constexpr auto check_boundaries (const bounds_t &, const point_t &, const scalar_t tol=0.f, const scalar_t edge_tol=0.f) const
 Return an inside result for a point supplied in local coordinates.

Static Public Attributes

static constexpr std::size_t dim {shape_t::dim}
 Dimension of the local coordinate system.
static constexpr utils::string_view_concat2 name {name_prefix, shape::name}
 The name for this shape.
static constexpr std::string_view name_prefix = "unbounded "
 Convenience member to construct the name.

Detailed Description

template<typename shape_t>
class detray::unbounded< shape_t >

Wraps any shape, but does not enforce boundaries.

Member Function Documentation

◆ area()

template<typename shape_t>
template<concepts::scalar scalar_t>
scalar_t detray::unbounded< shape_t >::area ( const bounds_type< scalar_t > & ) const
constexpr

The area of a the shape.

Returns
Inf.

◆ centroid()

template<typename shape_t>
template<concepts::algebra algebra_t>
auto detray::unbounded< shape_t >::centroid ( const bounds_type< dscalar< algebra_t > > & bounds) const
Parameters
boundsBoundary values forwarded to the wrapped shape.
Returns
the shapes centroid in local cartesian coordinates

◆ check_boundaries() [1/2]

template<typename shape_t>
template<typename bounds_t, concepts::point point_t, concepts::scalar scalar_t>
auto detray::unbounded< shape_t >::check_boundaries ( const bounds_t & ,
const point_t & ,
const scalar_t tol = 0.f,
const scalar_t edge_tol = 0.f ) const
constexpr

Return an inside result for a point supplied in local coordinates.

Parameters
tolTolerance argument retained for shape interface compatibility.
edge_tolEdge tolerance argument retained for interface compatibility.
Returns
An inside result, including the edge flag when the result type has one.

◆ check_boundaries() [2/2]

template<typename shape_t>
template<concepts::algebra algebra_t>
result_type< dbool< algebra_t > > detray::unbounded< shape_t >::check_boundaries ( const bounds_type< dscalar< algebra_t > > & ,
const dtransform3D< algebra_t > & ,
const dpoint3D< algebra_t > & ,
const dscalar< algebra_t > = 0.f,
const dscalar< algebra_t > = 0.f ) const
constexpr

Check boundary values for a local point.

Template Parameters
bounds_tany type of boundary values
Note
the parameters are ignored
Returns
always true

◆ check_consistency()

template<typename shape_t>
template<concepts::scalar scalar_t>
bool detray::unbounded< shape_t >::check_consistency ( const bounds_type< scalar_t > & ,
const std::ostream &  ) const
constexpr

Check consistency of boundary values.

Returns
true if the bounds are consistent.

◆ local_min_bounds()

template<typename shape_t>
template<concepts::algebra algebra_t>
darray< dscalar< algebra_t >, 6 > detray::unbounded< shape_t >::local_min_bounds ( const bounds_type< dscalar< algebra_t > > & bounds,
const dscalar< algebra_t > env = std::numeric_limits<dscalar<algebra_t>>::epsilon() ) const

Lower and upper point for minimal axis aligned bounding box.

Computes the min and max vertices in a local cartesian frame of the shape it wraps.

Note
The check_boundaries method will return 'inside' for points that are outside the local min bounds! This results in the bounding box to behave reasonably in a BVH, but still be always intersected successfully when queried directly.
Returns
and array of coordinates that contains the lower point (first three values) and the upper point (latter three values).
Parameters
boundsBoundary values forwarded to the wrapped shape.
envEnvelope forwarded to the wrapped shape.

◆ measure()

template<typename shape_t>
template<concepts::scalar scalar_t>
scalar_t detray::unbounded< shape_t >::measure ( const bounds_type< scalar_t > & bounds) const
constexpr

Measure of the shape: Inf.

Parameters
boundsthe boundary values for this shape
Returns
Inf.

◆ merge()

template<typename shape_t>
template<concepts::scalar scalar_t>
bounds_type< scalar_t > detray::unbounded< shape_t >::merge ( const bounds_type< scalar_t > & ,
const bounds_type< scalar_t > &  ) const
constexpr

Merge two unbounded shapes.

Returns
merged bound values

◆ min_dist_to_boundary()

template<typename shape_t>
template<concepts::scalar scalar_t, concepts::point point_t>
scalar_t detray::unbounded< shape_t >::min_dist_to_boundary ( const bounds_type< scalar_t > & ,
const point_t &  ) const
constexpr

Find the minimum distance to any boundary.

Note
the point is expected to be given in local coordinates by the caller.
Returns
the minimum distance.

◆ vertices()

template<typename shape_t>
template<concepts::algebra algebra_t>
dvector< dpoint3D< algebra_t > > detray::unbounded< shape_t >::vertices ( const bounds_type< dscalar< algebra_t > > & bounds,
dindex n_seg ) const

Generate vertices in local cartesian frame.

Parameters
boundsthe boundary values for the underlying shape
n_segNumber of segments used for curved boundary tessellation.
Returns
a generated list of vertices

◆ volume()

template<typename shape_t>
template<concepts::scalar scalar_t>
scalar_t detray::unbounded< shape_t >::volume ( const bounds_type< scalar_t > & ) const
constexpr

The volume of a the shape.

Returns
Inf.