Merge pull request #7439 from MaelRL/PMP-Remove_degen_faces-no-clear-GF

Introduce remove_all_elements(Graph)
This commit is contained in:
Laurent Rineau
2024-04-22 14:54:18 +02:00
19 changed files with 133 additions and 51 deletions
@@ -738,7 +738,7 @@ bool clip(TriangleMesh& tm,
case ON_NEGATIVE_SIDE:
return true; // nothing to clip, the full mesh is on the negative side
case ON_POSITIVE_SIDE:
clear(tm); // clear the mesh that is fully on the positive side
remove_all_elements(tm); // clear the mesh that is fully on the positive side
return true;
default:
break;
@@ -423,7 +423,7 @@ std::size_t keep_largest_connected_components(PolygonMesh& pmesh,
if(nb_components_to_keep == 0)
{
CGAL::clear(pmesh);
remove_all_elements(pmesh);
return num;
}
@@ -266,11 +266,11 @@ corefine_and_compute_boolean_operations(
if (output[Corefinement::TM1_MINUS_TM2] != std::nullopt)
if (&tm1 == *output[Corefinement::TM1_MINUS_TM2])
clear(tm1);
remove_all_elements(tm1);
if (output[Corefinement::TM2_MINUS_TM1] != std::nullopt)
if (&tm1 == *output[Corefinement::TM2_MINUS_TM1])
clear(tm1);
remove_all_elements(tm1);
return CGAL::make_array(true, true, true, true);
}
@@ -282,7 +282,7 @@ corefine_and_compute_boolean_operations(
{
for (int i=0; i<4; ++i)
if (output[i] != std::nullopt)
clear(*(*output[i]));
remove_all_elements(*(*output[i]));
return CGAL::make_array(true, true, true, true);
}
// tm2 is not empty
@@ -293,9 +293,9 @@ corefine_and_compute_boolean_operations(
parameters::vertex_point_map(vpm2),
parameters::vertex_point_map(*std::get<Corefinement::UNION>(vpm_out_tuple)));
if (output[Corefinement::INTERSECTION] != std::nullopt)
clear(*(*output[Corefinement::INTERSECTION]));
remove_all_elements(*(*output[Corefinement::INTERSECTION]));
if (output[Corefinement::TM1_MINUS_TM2] != std::nullopt)
clear(*(*output[Corefinement::TM1_MINUS_TM2]));
remove_all_elements(*(*output[Corefinement::TM1_MINUS_TM2]));
if (output[Corefinement::TM2_MINUS_TM1] != std::nullopt)
if (&tm2 != *output[Corefinement::TM2_MINUS_TM1])
copy_face_graph(tm2,
@@ -315,9 +315,9 @@ corefine_and_compute_boolean_operations(
parameters::vertex_point_map(vpm1),
parameters::vertex_point_map(*std::get<Corefinement::UNION>(vpm_out_tuple)));
if (output[Corefinement::INTERSECTION] != std::nullopt)
clear(*(*output[Corefinement::INTERSECTION]));
remove_all_elements(*(*output[Corefinement::INTERSECTION]));
if (output[Corefinement::TM2_MINUS_TM1] != std::nullopt)
clear(*(*output[Corefinement::TM2_MINUS_TM1]));
remove_all_elements(*(*output[Corefinement::TM2_MINUS_TM1]));
if (output[Corefinement::TM1_MINUS_TM2] != std::nullopt)
if (&tm1 != *output[Corefinement::TM1_MINUS_TM2])
copy_face_graph(tm1,
@@ -1263,8 +1263,7 @@ bool decimate_meshes_with_common_interfaces_impl(TriangleMeshRange& meshes,
}
CGAL_assertion(is_polygon_soup_a_polygon_mesh(all_faces[mesh_id]));
//clear(tm);
tm.clear_without_removing_property_maps();
remove_all_elements(tm);
polygon_soup_to_polygon_mesh(all_corners[mesh_id], all_faces[mesh_id],
tm, parameters::default_values(), parameters::vertex_point_map(vpms[mesh_id]));
}
@@ -1934,7 +1934,7 @@ bool remove_degenerate_faces(const FaceRange& face_range,
if(degenerate_face_set.size() == faces_size)
{
clear(tmesh);
remove_all_elements(tmesh);
return true;
}