12#include "detray/definitions/detail/qualifiers.hpp"
13#include "detray/definitions/geometry.hpp"
14#include "detray/definitions/indexing.hpp"
15#include "detray/geometry/identifier.hpp"
31template <
typename mask_link_t = dtyped_index<dindex, dindex>,
32 typename material_link_t = dtyped_index<dindex, dindex>,
33 typename transform_link_t = dindex,
34 typename navigation_link_t = std::u
int_least16_t>
44 using mask_id =
typename mask_link::id_type;
77 return (m_mask == rhs.m_mask && m_material == rhs.m_material &&
78 m_identifier == rhs.m_identifier);
85 m_identifier = geo_id;
107 m_identifier.set_volume(new_idx);
112 constexpr auto volume() const ->
dindex {
return m_identifier.volume(); }
118 m_identifier.set_index(new_idx);
123 constexpr auto index() const ->
dindex {
return m_identifier.index(); }
130 m_identifier.set_transform(
transform() + offset);
136 return m_identifier.transform();
169 return (m_material.id() != material_link::id_type::e_none) &&
170 !m_material.is_invalid();
176 return m_identifier.id() == surface_id::e_sensitive;
182 return m_identifier.id() == surface_id::e_portal;
188 return m_identifier.id() == surface_id::e_passive;
195 os << sf.m_identifier;
196 os <<
" | mask: " << sf.m_mask;
197 os <<
" | mat.: " << sf.m_material;
212template <
typename mask_link_t,
typename material_link_t,
213 typename transform_link_t,
typename navigation_link_t>
214struct hash<detray::surface_descriptor<mask_link_t, material_link_t,
215 transform_link_t, navigation_link_t>> {
217 detray::surface_descriptor<mask_link_t, material_link_t, transform_link_t,
220 auto operator()(
const descr_t sf_desc)
const noexcept {
221 return std::hash<detray::geometry::identifier::value_t>()(
222 sf_desc.identifier().value());
Unique identifier for geometry objects, based on the ACTS GeometryIdentifier.
Definition identifier.hpp:36
constexpr surface_descriptor()=default
Default constructor.
typename mask_link::id_type mask_id
Identifier type of the linked mask.
Definition surface_descriptor.hpp:44
auto set_identifier(const geometry::identifier geo_id) -> void
Sets a new surface identifier.
Definition surface_descriptor.hpp:84
auto update_transform(dindex offset) -> void
Update the transform index.
Definition surface_descriptor.hpp:129
auto update_mask(dindex offset) -> void
Update the mask link.
Definition surface_descriptor.hpp:143
navigation_link_t navigation_link
Link type of the mask to a volume.
Definition surface_descriptor.hpp:38
auto update_material(dindex offset) -> void
Update the material link.
Definition surface_descriptor.hpp:153
constexpr auto has_material() const -> bool
Definition surface_descriptor.hpp:168
constexpr auto volume() const -> dindex
Definition surface_descriptor.hpp:112
friend std::ostream & operator<<(std::ostream &os, const surface_descriptor &sf)
Definition surface_descriptor.hpp:193
constexpr auto is_sensitive() const -> bool
Definition surface_descriptor.hpp:175
constexpr surface_descriptor(const transform_link trf, const mask_link mask, const material_link material, const dindex volume, const surface_id sf_id)
Constructor with full arguments.
Definition surface_descriptor.hpp:61
constexpr auto material() const -> const material_link &
Definition surface_descriptor.hpp:162
transform_link_t transform_link
Broadcast the type of links.
Definition surface_descriptor.hpp:40
constexpr auto operator==(const surface_descriptor &rhs) const -> bool
Equality operator.
Definition surface_descriptor.hpp:76
constexpr auto material() -> material_link &
Definition surface_descriptor.hpp:158
auto set_id(const surface_id new_id) -> void
Definition surface_descriptor.hpp:97
constexpr auto is_portal() const -> bool
Definition surface_descriptor.hpp:181
typename material_link::id_type material_id
Identifier type of the linked material.
Definition surface_descriptor.hpp:48
auto set_volume(const dindex new_idx) -> void
Definition surface_descriptor.hpp:106
constexpr auto identifier() const -> geometry::identifier
Definition surface_descriptor.hpp:90
constexpr auto index() const -> dindex
Definition surface_descriptor.hpp:123
material_link_t material_link
Link type used to locate the surface material.
Definition surface_descriptor.hpp:46
constexpr auto id() const -> surface_id
Definition surface_descriptor.hpp:101
constexpr auto transform() const -> dindex
Definition surface_descriptor.hpp:135
mask_link_t mask_link
might be a single mask, a range of masks or a multiindex in the future
Definition surface_descriptor.hpp:42
constexpr auto is_passive() const -> bool
Definition surface_descriptor.hpp:187
auto set_index(const dindex new_idx) -> void
Sets a new surface index (index in surface collection of surface store).
Definition surface_descriptor.hpp:117
constexpr auto mask() const -> const mask_link &
Definition surface_descriptor.hpp:147
Detray include(s).
Definition array_operators.hpp:18
unsigned int dindex
Default index type.
Definition indexing.hpp:18
surface_id
surface type, resolved during navigation.
Definition geometry.hpp:41