diff --git a/Installation/include/CGAL/MDS_3/Mesh_complex_3_in_triangulation_3_fwd.h b/Installation/include/CGAL/MDS_3/Mesh_complex_3_in_triangulation_3_fwd.h index 4d54cfdd8ae..62700e58f45 100644 --- a/Installation/include/CGAL/MDS_3/Mesh_complex_3_in_triangulation_3_fwd.h +++ b/Installation/include/CGAL/MDS_3/Mesh_complex_3_in_triangulation_3_fwd.h @@ -27,11 +27,8 @@ namespace MDS_3 { template bool build_triangulation_from_file(std::istream& is, Tr& tr, - bool replace_domain_0); - - template - bool build_triangulation_from_file(std::istream& is, - Tr& tr); + bool verbose = false, + bool replace_domain_0 = false); } // MDS_3 } // CGAL diff --git a/MDS_3/include/CGAL/MDS_3/tet_soup_to_c3t3.h b/MDS_3/include/CGAL/MDS_3/tet_soup_to_c3t3.h index b73fd37c37c..91007cf3170 100644 --- a/MDS_3/include/CGAL/MDS_3/tet_soup_to_c3t3.h +++ b/MDS_3/include/CGAL/MDS_3/tet_soup_to_c3t3.h @@ -346,9 +346,6 @@ bool build_triangulation(Tr& tr, const PointRange& points, const CellRange& finite_cells, const FacetPatchMap& border_facets, -// const std::vector& points, -// const std::vector >& finite_cells, -// const std::map, typename Tr::Cell::Surface_patch_index>& border_facets, std::vector& vertex_handle_vector, const bool verbose = false, bool replace_domain_0 = false) @@ -399,7 +396,8 @@ bool build_triangulation(Tr& tr, if(verbose) std::cout << tr.number_of_vertices() << " vertices" << std::endl; - return tr.tds().is_valid(); + return true;// tr.tds().is_valid(); + //TDS not valid when cells do not cover the convex hull of vertices } template& points, //PointRange -// const std::vector >& finite_cells, //CellRange -// const std::map, typename Tr::Cell::Surface_patch_index>& border_facets,//FacetsMap { BOOST_STATIC_ASSERT(boost::is_same::value); @@ -428,6 +423,7 @@ bool build_triangulation(Tr& tr, template bool build_triangulation_from_file(std::istream& is, Tr& tr, + const bool verbose, bool replace_domain_0) { typedef typename Tr::Point Point_3; @@ -449,7 +445,9 @@ bool build_triangulation_from_file(std::istream& is, CGAL_assertion(dim == 3); - std::cout << "Reading .mesh file..." << std::endl; + if(verbose) + std::cout << "Reading .mesh file..." << std::endl; + while(is >> word && word != "End") { if(word == "Vertices") @@ -508,24 +506,21 @@ bool build_triangulation_from_file(std::istream& is, } } - std::cout << points.size() << " points" << std::endl; - std::cout << border_facets.size() << " border facets" << std::endl; - std::cout << finite_cells.size() << " cells" << std::endl; + if (verbose) + { + std::cout << points.size() << " points" << std::endl; + std::cout << border_facets.size() << " border facets" << std::endl; + std::cout << finite_cells.size() << " cells" << std::endl; + } if(finite_cells.empty()) return false; - bool is_well_built = build_triangulation(tr, - points, finite_cells, border_facets, false, replace_domain_0); - return is_well_built; + return build_triangulation(tr, + points, finite_cells, border_facets, + verbose, replace_domain_0); } -template -bool build_triangulation_from_file(std::istream& is, - Tr& tr) -{ - return build_triangulation_from_file(is, tr, false); -} } // namespace MDS_3 } // namespace CGAL