File indexing completed on 2026-05-27 07:24:00
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011
0012 #include "detray/core/detail/container_buffers.hpp"
0013 #include "detray/core/detail/container_views.hpp"
0014 #include "detray/definitions/indexing.hpp"
0015 #include "detray/geometry/surface_descriptor.hpp"
0016 #include "detray/navigation/accelerators/search_window.hpp"
0017 #include "detray/utils/concepts.hpp"
0018 #include "detray/utils/grid/concepts.hpp"
0019 #include "detray/utils/ranges/ranges.hpp"
0020
0021
0022 #include <concepts>
0023
0024 namespace detray::concepts {
0025
0026
0027 template <class A>
0028 concept accelerator = requires(const A acc) {
0029 typename A::value_type;
0030 typename A::query_type;
0031
0032
0033 { acc.all() } -> ranges::range_of<typename A::value_type>;
0034
0035
0036 {
0037 acc.search(typename A::query_type())
0038 } -> ranges::range_of<typename A::value_type>;
0039
0040 {
0041 acc.search(typename A::query_type(), detray::search_window<dindex, 2>())
0042 } -> ranges::range_of<typename A::value_type>;
0043
0044
0045
0046 };
0047
0048
0049
0050 template <class AC>
0051 concept accelerator_collection =
0052 viewable<AC> && bufferable<AC> &&
0053 requires(const AC accel_coll, unsigned int idx) {
0054 typename AC::size_type;
0055 requires concepts::accelerator<typename AC::value_type>;
0056
0057 { accel_coll[idx] } -> concepts::accelerator;
0058 };
0059
0060
0061
0062 template <class A>
0063 concept surface_accelerator =
0064 concepts::accelerator<A> &&
0065 std::same_as<typename A::value_type,
0066 surface_descriptor<typename A::value_type::mask_link,
0067 typename A::value_type::material_link,
0068 typename A::value_type::transform_link,
0069 typename A::value_type::navigation_link>>;
0070
0071
0072 template <class A>
0073 concept volume_accelerator =
0074 concepts::accelerator<A> && std::same_as<typename A::value_type, dindex>;
0075
0076 }