Get the bounding region that contains all regions in the group.
182 {
184 return Region {};
185
187 std::vector<uint64_t> min_coords = first.start_coordinates;
188 std::vector<uint64_t> max_coords = first.end_coordinates;
189
190 for (
const auto& region :
regions) {
191 for (size_t i = 0; i < min_coords.size(); i++) {
192 if (i < region.start_coordinates.size()) {
193 min_coords[i] = std::min<size_t>(min_coords[i], region.start_coordinates[i]);
194 max_coords[i] = std::max<size_t>(max_coords[i], region.end_coordinates[i]);
195 }
196 }
197 }
198
199 Region bounds(min_coords, max_coords);
200 bounds.set_attribute("type", "bounding_box");
201 bounds.set_attribute(
"source_group",
name);
202 return bounds;
203 }
std::vector< Region > regions
Collection of regions belonging to this group.
std::string name
Descriptive name of the group.