19 #include <type_traits>
85 virtual size_t size()
const = 0;
95 virtual std::vector<const IAxis*>
getAxes()
const = 0;
106 virtual bool isValidBin(
size_t bin)
const = 0;
118 template <
class... Axes>
120 static constexpr
size_t DIM =
sizeof...(Axes);
141 std::tuple<Axes...> axes,
142 std::vector<BinningValue> bValues = {})
161 for (
const auto& srf : surfaces) {
163 lookup(pos).push_back(srf);
178 size_t binCompleted = 0;
179 size_t nBins =
size();
180 double minPath, curPath;
183 for (
size_t b = 0; b < nBins; ++b) {
187 std::vector<const Surface*>& binContent =
lookup(b);
189 if (!binContent.empty()) {
195 for (
const auto& srf : surfaces) {
196 curPath = (binCtr - srf->binningPosition(gctx,
binR)).norm();
198 if (curPath < minPath) {
204 binContent.push_back(minSrf);
272 std::vector<const IAxis*>
getAxes()
const override {
274 return std::vector<const IAxis*>(arr.begin(), arr.end());
289 for (
size_t i = 0; i < indices.size(); ++i) {
290 size_t idx = indices.at(i);
291 if (idx <= 0 || idx >= nBins.at(i) + 1) {
311 for (
const auto& idx : neighborIdxs) {
312 const std::vector<const Surface*>& binContent =
m_grid.
at(idx);
313 std::copy(binContent.begin(), binContent.end(),
314 std::back_inserter(neighbors));
329 template <
size_t D = DIM, std::enable_if_t<D != 1,
int> = 0>
337 template <
size_t D = DIM, std::enable_if_t<D == 1,
int> = 0>
356 : m_element({element}) {}
394 size_t size()
const override {
return 1; }
405 std::vector<const IAxis*>
getAxes()
const override {
return {}; }
409 size_t dimensions()
const override {
return 0; }
426 bool isValidBin(
size_t )
const override {
return true; }
439 SurfaceArray(std::unique_ptr<ISurfaceGridLookup> gridLookup,