32{
33 std::vector<Region> result;
34 std::ranges::copy_if(group.
regions, std::back_inserter(result),
35 [&key, &value](
const Region& region) {
36 auto attr_it = region.attributes.find(key);
37 if (attr_it != region.attributes.end()) {
38 if (value.type() == typeid(std::string)) {
39 auto region_value = get_region_attribute<std::string>(region, key);
40 auto search_value = std::any_cast<std::string>(value);
41 return region_value.has_value() && *region_value == search_value;
42 }
43 if (value.type() == typeid(double)) {
44 auto region_value = get_region_attribute<double>(region, key);
45 auto search_value = std::any_cast<double>(value);
46 return region_value.has_value() && *region_value == search_value;
47 }
48 if (value.type() == typeid(int)) {
49 auto region_value = get_region_attribute<int>(region, key);
50 auto search_value = std::any_cast<int>(value);
51 return region_value.has_value() && *region_value == search_value;
52 }
53
54 }
55 return false;
56 });
57 return result;
58}
std::vector< Region > regions
Collection of regions belonging to this group.
Represents a point or span in N-dimensional space.