From 3e2c8e08064e623ab3e517036274d10a2f6a7530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Wed, 26 Oct 2022 21:50:42 +0200 Subject: [PATCH] Fix debug messages not living behind a verbosity check --- SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h | 44 +++++++++++++------ 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h b/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h index 262343be0fd..23e318c77e9 100644 --- a/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h +++ b/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h @@ -440,47 +440,58 @@ bool build_triangulation_impl(Tr& tr, for(Vertex_handle vh : vertex_handle_vector) vh->set_dimension(-1); + if(verbose) + std::cout << "build vertices done (" << tr.tds().number_of_vertices() << " vertices)" << std::endl; + if (!finite_cells.empty()) { if (!CGAL::SMDS_3::build_finite_cells(tr, finite_cells, subdomains, vertex_handle_vector, incident_cells_map, border_facets, verbose, replace_domain_0)) { if (verbose) - std::cout << "build_finite_cells went wrong" << std::endl; + std::cerr << "Error: build_finite_cells went wrong!" << std::endl; success = false; } - else - std::cout << "build finite cells done" << std::endl; + else if(verbose) + { + std::cout << "build finite cells done (" << tr.tds().cells().size() << " cells)" << std::endl; + } + if (!CGAL::SMDS_3::build_infinite_cells(tr, incident_cells_map, verbose, allow_non_manifold)) { if(verbose) - std::cout << "build_infinite_cells went wrong" << std::endl; + std::cerr << "Error: build_infinite_cells went wrong!" << std::endl; success = false; } - else - std::cout << "build infinite cells done" << std::endl; + else if(verbose) + { + std::cout << "build infinite cells done (" << tr.tds().cells().size() << " cells)" << std::endl; + } + tr.tds().set_dimension(3); if (!CGAL::SMDS_3::assign_neighbors(tr, incident_cells_map, allow_non_manifold)) { if(verbose) - std::cout << "assign_neighbors went wrong" << std::endl; + std::cerr << "Error: assign_neighbors went wrong!" << std::endl; success = false; } - else + else if(verbose) + { std::cout << "assign neighbors done" << std::endl; + } + if (verbose) { - std::cout << "built triangulation : " << std::endl; - std::cout << tr.number_of_cells() << " cells" << std::endl; + std::cout << "built triangulation!" << std::endl; } } - if(verbose) - std::cout << tr.number_of_vertices() << " vertices" << std::endl; + // disabled because the TDS is not valid when cells do not cover the convex hull of vertices + // return tr.tds().is_valid(); + + return success; - return success;// tr.tds().is_valid(); - //TDS not valid when cells do not cover the convex hull of vertices } template