488 bool compare_vec(std::vector<VectorType> v1, std::vector<VectorType> v2) {
489 if (v1.empty() || v2.empty())
return true;
490 std::sort(v1.begin(), v1.end());
491 std::sort(v2.begin(), v2.end());
492 if (v1.size() == v2.size()) {
493 return std::equal(v1.begin(), v1.end(), v2.begin(),
494 [](
const VectorType& x1,
const VectorType& x2) { return isnan(x1) || isnan(x2) || x1.equals(x2, 1.1e-4); });
496 auto v2_last_match_it = v2.begin();
497 for (VectorType point: v1) {
499 if (point.equals(*v2_last_match_it, 1.1e-4))
return true;
500 if (point < *v2_last_match_it)
break;
502 if (v2_last_match_it == v2.end())
return false;
515 auto c1 = geom1->getChildUnsafe();
516 auto c2 = geom2->getChildUnsafe();
517 if (!c1 || !c2)
return {};
518 if (geom1->hasInSubtree(*c2) || geom2->hasInSubtree(*c1))
return {};
521 Set og1 = get(geom1);
522 Set og2 = get(geom2);
523 std::set_union(og1.begin(), og1.end(), og2.begin(), og2.end(), std::back_inserter(obj_to_check));
526 for (
auto o: obj_to_check)
527 if (!compare_vec(geom1->getObjectPositions(*o), geom2->getObjectPositions(*o))) {