File indexing completed on 2026-05-27 07:23:59
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011
0012 #include "detray/definitions/algebra.hpp"
0013 #include "detray/definitions/containers.hpp"
0014 #include "detray/definitions/detail/qualifiers.hpp"
0015 #include "detray/definitions/indexing.hpp"
0016 #include "detray/geometry/coordinates/cartesian2D.hpp"
0017 #include "detray/geometry/detail/shape_utils.hpp"
0018
0019
0020 #include <limits>
0021 #include <ostream>
0022 #include <string_view>
0023
0024 namespace detray {
0025
0026
0027 template <std::size_t DIM = 2>
0028 class unmasked {
0029 public:
0030
0031 static constexpr std::string_view name = "unmasked";
0032
0033 enum boundaries : unsigned int { e_size = 1u };
0034
0035
0036 template <concepts::scalar scalar_t>
0037 using bounds_type = darray<scalar_t, boundaries::e_size>;
0038
0039
0040 template <concepts::algebra algebra_t>
0041 using local_frame_type = cartesian2D<algebra_t>;
0042
0043
0044 template <typename bool_t>
0045 using result_type = bool_t;
0046
0047
0048 static constexpr std::size_t dim{DIM};
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059 template <concepts::scalar scalar_t, concepts::point point_t>
0060 DETRAY_HOST_DEVICE inline scalar_t min_dist_to_boundary(
0061 const bounds_type<scalar_t>& , const point_t& ) const {
0062 return std::numeric_limits<scalar_t>::max();
0063 }
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073 template <concepts::algebra algebra_t>
0074 DETRAY_HOST_DEVICE constexpr dbool<algebra_t> check_boundaries(
0075 const bounds_type<dscalar<algebra_t>>& ,
0076 const dtransform3D<algebra_t>& ,
0077 const dpoint3D<algebra_t>& ,
0078 const dscalar<algebra_t> = 0.f,
0079 const dscalar<algebra_t> = 0.f) const {
0080 return true;
0081 }
0082
0083 template <concepts::scalar scalar_t, concepts::point point_t>
0084 DETRAY_HOST_DEVICE constexpr auto check_boundaries(
0085 const bounds_type<scalar_t>& , const point_t& ,
0086 const scalar_t tol = 0.f, const scalar_t edge_tol = 0.f) const
0087 -> decltype(tol < edge_tol) {
0088 return true;
0089 }
0090
0091
0092
0093
0094
0095
0096
0097 template <concepts::scalar scalar_t>
0098 DETRAY_HOST_DEVICE constexpr scalar_t measure(
0099 const bounds_type<scalar_t>& bounds) const {
0100 if constexpr (dim == 2) {
0101 return area(bounds);
0102 } else {
0103 return volume(bounds);
0104 }
0105 }
0106
0107
0108
0109
0110
0111
0112 template <concepts::scalar scalar_t>
0113 DETRAY_HOST_DEVICE constexpr scalar_t area(
0114 const bounds_type<scalar_t>& ) const {
0115 return std::numeric_limits<scalar_t>::max();
0116 }
0117
0118
0119
0120
0121
0122
0123 template <concepts::scalar scalar_t>
0124 DETRAY_HOST_DEVICE constexpr scalar_t volume(
0125 const bounds_type<scalar_t>& ) const {
0126 return std::numeric_limits<scalar_t>::max();
0127 }
0128
0129
0130
0131
0132
0133
0134
0135 template <concepts::scalar scalar_t>
0136 DETRAY_HOST_DEVICE constexpr bounds_type<scalar_t> merge(
0137 const bounds_type<scalar_t>& ,
0138 const bounds_type<scalar_t>& ) const {
0139 return {};
0140 }
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151 template <concepts::algebra algebra_t>
0152 DETRAY_HOST_DEVICE inline darray<dscalar<algebra_t>, 6> local_min_bounds(
0153 const bounds_type<dscalar<algebra_t>>& ,
0154 const dscalar<algebra_t> =
0155 std::numeric_limits<dscalar<algebra_t>>::epsilon()) const {
0156 using scalar_t = dscalar<algebra_t>;
0157 constexpr scalar_t inv{detail::invalid_value<scalar_t>()};
0158
0159 return {-inv, -inv, -inv, inv, inv, inv};
0160 }
0161
0162
0163 template <concepts::algebra algebra_t>
0164 DETRAY_HOST_DEVICE dpoint3D<algebra_t> centroid(
0165 const bounds_type<dscalar<algebra_t>>& ) const {
0166 return {0.f, 0.f, 0.f};
0167 }
0168
0169
0170
0171
0172
0173
0174
0175 template <concepts::algebra algebra_t>
0176 DETRAY_HOST dvector<dpoint3D<algebra_t>> vertices(
0177 const bounds_type<dscalar<algebra_t>>& bounds, dindex ) const {
0178 return local_min_bounds(bounds);
0179 }
0180
0181
0182
0183
0184
0185
0186
0187 template <concepts::scalar scalar_t>
0188 DETRAY_HOST constexpr bool check_consistency(
0189 const bounds_type<scalar_t>& ,
0190 const std::ostream& ) const {
0191 return true;
0192 }
0193 };
0194
0195 }