diff --git a/Installation/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_fwd.h b/Installation/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_fwd.h index d6852a072f2..d0202553abc 100644 --- a/Installation/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_fwd.h +++ b/Installation/include/CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_fwd.h @@ -25,7 +25,7 @@ class Mesh_complex_3_in_triangulation_3; template bool build_triangulation_from_file(std::istream& is, Tr& tr, - bool prevent_domain_0); + bool replace_domain_0); template bool build_triangulation_from_file(std::istream& is, diff --git a/Mesh_3/include/CGAL/Mesh_3/tet_soup_to_c3t3.h b/Mesh_3/include/CGAL/Mesh_3/tet_soup_to_c3t3.h index 6cacd32ebe3..7ee67fe5c31 100644 --- a/Mesh_3/include/CGAL/Mesh_3/tet_soup_to_c3t3.h +++ b/Mesh_3/include/CGAL/Mesh_3/tet_soup_to_c3t3.h @@ -107,7 +107,7 @@ bool build_finite_cells(Tr& tr, std::vector > >& incident_cells_map, const std::map, typename Tr::Cell::Surface_patch_index>& border_facets, const bool verbose, - bool prevent_domain_0 = true) + bool replace_domain_0 = false) { typedef std::array Tet_with_ref; // 4 ids + 1 reference @@ -119,8 +119,8 @@ bool build_finite_cells(Tr& tr, typename Tr::Geom_traits::Construct_point_3 cp = tr.geom_traits().construct_point_3_object(); ) - int max_domain = -1; - if(!prevent_domain_0) + int max_domain = 0; + if(replace_domain_0) { for(std::size_t i=0; iset_subdomain_index(tet[4]); // the cell's info keeps the reference of the tetrahedron - //c->info() = tet[4]; // the cell's info keeps the reference of the tetrahedron - if(prevent_domain_0){ + if(!replace_domain_0){ CGAL_precondition(tet[4] > 0); } else { c->set_subdomain_index(max_domain+1); // the cell's info keeps the reference of the tetrahedron -// c->info() = max_domain+1; // the cell's info keeps the reference of the tetrahedron } // assign cells to vertices for(int j=0; j<4; ++j) @@ -347,7 +345,7 @@ bool build_triangulation(Tr& tr, const std::map, typename Tr::Cell::Surface_patch_index>& border_facets, std::vector& vertex_handle_vector, const bool verbose = false, - bool prevent_domain_0 = true) + bool replace_domain_0 = false) { typedef typename Tr::Vertex_handle Vertex_handle; typedef typename Tr::Cell_handle Cell_handle; @@ -379,7 +377,7 @@ bool build_triangulation(Tr& tr, if (!finite_cells.empty()) { if(!build_finite_cells(tr, finite_cells, vertex_handle_vector, incident_cells_map, - border_facets, verbose, prevent_domain_0)) + border_facets, verbose, replace_domain_0)) return false; if(!build_infinite_cells(tr, incident_cells_map, verbose)) return false; @@ -404,7 +402,7 @@ bool build_triangulation(Tr& tr, template bool build_triangulation_from_file(std::istream& is, Tr& tr, - bool prevent_domain_0) + bool replace_domain_0) { typedef typename Tr::Point Point_3; @@ -493,7 +491,7 @@ bool build_triangulation_from_file(std::istream& is, std::vector vertices(points.size() + 1); bool is_well_built = build_triangulation(tr, - points, finite_cells, border_facets, vertices, false, prevent_domain_0); + points, finite_cells, border_facets, vertices, false, replace_domain_0); return is_well_built; } @@ -501,7 +499,7 @@ template bool build_triangulation_from_file(std::istream& is, Tr& tr) { - return build_triangulation_from_file(is, tr, true); + return build_triangulation_from_file(is, tr, false); } } // namespace CGAL diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp index 1ea57c3958b..4dfab1afc69 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/C3t3_io_plugin.cpp @@ -127,7 +127,7 @@ Polyhedron_demo_c3t3_binary_io_plugin::load( item->setName(fileinfo.baseName()); item->set_valid(false); - if(CGAL::build_triangulation_from_file(in, item->c3t3().triangulation(), false)) + if(CGAL::build_triangulation_from_file(in, item->c3t3().triangulation(), true)) { item->c3t3().rescan_after_load_of_triangulation(); for( C3t3::Triangulation::Finite_cells_iterator