mirror of https://github.com/CGAL/cgal
test the dry_run
This commit is contained in:
parent
1a429d03e4
commit
c42d1b3cfd
|
|
@ -240,13 +240,14 @@ std::size_t remove_connected_components_of_negligible_size(TriangleMesh& tmesh,
|
|||
for(face_descriptor f : faces(tmesh))
|
||||
{
|
||||
const std::size_t i = face_cc[f];
|
||||
if(!cc_closeness[i])
|
||||
if(!cc_closeness[i]){
|
||||
continue;
|
||||
}
|
||||
|
||||
const FT fv = cv3(origin,
|
||||
get(vpm, target(halfedge(f, tmesh), tmesh)),
|
||||
get(vpm, target(next(halfedge(f, tmesh), tmesh), tmesh)),
|
||||
get(vpm, target(prev(halfedge(f, tmesh), tmesh), tmesh)));
|
||||
const FT fv = cv3(origin,
|
||||
get(vpm, target(halfedge(f, tmesh), tmesh)),
|
||||
get(vpm, target(next(halfedge(f, tmesh), tmesh), tmesh)),
|
||||
get(vpm, target(prev(halfedge(f, tmesh), tmesh), tmesh)));
|
||||
|
||||
component_volumes[i] += fv;
|
||||
}
|
||||
|
|
@ -284,7 +285,7 @@ std::size_t remove_connected_components_of_negligible_size(TriangleMesh& tmesh,
|
|||
#ifdef CGAL_PMP_DEBUG_SMALL_CC_REMOVAL
|
||||
std::cout << "Removing " << ccs_to_remove.size() << " CCs" << std::endl;
|
||||
#endif
|
||||
if(dry_run){
|
||||
if(!dry_run){
|
||||
remove_connected_components(tmesh, ccs_to_remove, face_cc, np);
|
||||
CGAL_postcondition(is_valid_polygon_mesh(tmesh));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -248,7 +248,11 @@ void remove_negligible_connected_components(const char* filename)
|
|||
|
||||
// Could also have used default paramaters, which does the job by itself
|
||||
std::cout << "---------\ndefault values..." << std::endl;
|
||||
PMP::remove_connected_components_of_negligible_size(mesh_cpy);
|
||||
|
||||
std::size_t nb_to_be_rm = PMP::remove_connected_components_of_negligible_size(mesh_cpy, CGAL::parameters::dry_run(true));
|
||||
assert(nb_to_be_rm ==
|
||||
PMP::remove_connected_components_of_negligible_size(mesh_cpy));
|
||||
|
||||
assert(PMP::internal::number_of_connected_components(mesh_cpy) == 1);
|
||||
}
|
||||
|
||||
|
|
@ -308,6 +312,7 @@ void test()
|
|||
6, 7, 2, 4, 3, 3);
|
||||
|
||||
remove_negligible_connected_components<K, Mesh>("data_degeneracies/small_ccs.off");
|
||||
|
||||
}
|
||||
|
||||
template <typename Kernel>
|
||||
|
|
|
|||
Loading…
Reference in New Issue