Do not miss global_bounds.upper updates by not pushing subdivide faces into PQ

This commit is contained in:
Mael Rouxel-Labbé 2022-04-08 13:28:04 +02:00
parent 898382be0f
commit 720c52f00a
1 changed files with 2 additions and 9 deletions

View File

@ -1697,10 +1697,6 @@ bounded_error_squared_Hausdorff_distance_impl(const TriangleMesh1& tm1,
CGAL_assertion(sub_triangle_bounds.tm2_lface != boost::graph_traits<TriangleMesh2>::null_face()); CGAL_assertion(sub_triangle_bounds.tm2_lface != boost::graph_traits<TriangleMesh2>::null_face());
CGAL_assertion(sub_triangle_bounds.tm2_uface != boost::graph_traits<TriangleMesh2>::null_face()); CGAL_assertion(sub_triangle_bounds.tm2_uface != boost::graph_traits<TriangleMesh2>::null_face());
// Add the subtriangle to the candidate list if it is meaningful
if(sub_triangle_bounds.upper < global_bounds.lower)
continue;
// The global lower bound is the max of the per-face lower bounds // The global lower bound is the max of the per-face lower bounds
if(sub_triangle_bounds.lower > global_bounds.lower) if(sub_triangle_bounds.lower > global_bounds.lower)
{ {
@ -1717,16 +1713,13 @@ bounded_error_squared_Hausdorff_distance_impl(const TriangleMesh1& tm1,
candidate_triangles.emplace(sub_triangles[i], sub_triangle_bounds, triangle_and_bounds.tm1_face); candidate_triangles.emplace(sub_triangles[i], sub_triangle_bounds, triangle_and_bounds.tm1_face);
} }
// In case all subdividing triangles of the last queue entry are useless
if(candidate_triangles.empty())
break;
// Update global upper Hausdorff bound after subdivision. // Update global upper Hausdorff bound after subdivision.
const Candidate& top_candidate = candidate_triangles.top(); const Candidate& top_candidate = candidate_triangles.top();
const FT current_upmost = top_candidate.bounds.upper; const FT current_upmost = top_candidate.bounds.upper;
#ifdef CGAL_HAUSDORFF_DEBUG_PP #ifdef CGAL_HAUSDORFF_DEBUG_PP
std::cout << "current upper bound = " << current_upmost << std::endl;
std::cout << "global_bounds.lower = " << global_bounds.lower << std::endl; std::cout << "global_bounds.lower = " << global_bounds.lower << std::endl;
std::cout << "global_bounds.upper = " << global_bounds.upper << std::endl;
std::cout << "current upper bound = " << current_upmost << std::endl;
#endif #endif
CGAL_assertion(is_positive(current_upmost)); CGAL_assertion(is_positive(current_upmost));