diff --git a/Surface_mesher/TODO b/Surface_mesher/TODO index 8b7bb1027a1..4505ea4d33d 100644 --- a/Surface_mesher/TODO +++ b/Surface_mesher/TODO @@ -1,3 +1,8 @@ +Rendre paresseux la gestion de la liste des bad edges +dans Surface_mesher_manifold_edges +comme le traitement des bad vertices dans Surface_mesher_manifold + + Laurent Rineau 2006/0227: (BEFORE THE CGAL-3.2 code freeze) - Remove Complex_2_in_triangulation_3_surface_meshe.h (not finished) diff --git a/Surface_mesher/include/CGAL/Complex_2_in_triangulation_3.h b/Surface_mesher/include/CGAL/Complex_2_in_triangulation_3.h index 07caca0fb75..b9ff70126c7 100644 --- a/Surface_mesher/include/CGAL/Complex_2_in_triangulation_3.h +++ b/Surface_mesher/include/CGAL/Complex_2_in_triangulation_3.h @@ -222,7 +222,7 @@ protected: // This function should be called only when incident edges // are known to be REGULAR OR BOUNDARY - bool is_regular_or_boundary_for_vertices(Vertex_handle v) const { + bool is_regular_or_boundary_for_vertices(Vertex_handle v) { int i,j; union_find_of_incident_facets(v,i,j); return (j == 1); diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_manifold.h b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_manifold.h index f911dbb2c91..8ced4802251 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_manifold.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_manifold.h @@ -77,10 +77,10 @@ namespace CGAL { Vertex_handle v = c->vertex(j); if(bad_vertices_initialized){ - if ( SMREB::c2t3.is_in_complex(v) ) { // no need to test here + //if ( SMREB::c2t3.is_in_complex(v) ) { // no need to test here bad_vertices.erase(v); // il faut tester les // facets, avant - } + //} } } } @@ -192,42 +192,40 @@ namespace CGAL { for (typename Zone::Facets_iterator fit = zone.boundary_facets.begin(); fit != zone.boundary_facets.end(); ++fit) - handle_facet_on_boundary_of_conflict_zone (*fit); // @TODO: test - // if *fit is - // in complex, - // before - // calling the - // handle function - + if (SMREB::c2t3.is_in_complex(*fit)) { + handle_facet_on_boundary_of_conflict_zone (*fit); + } SMREB::before_insertion_impl(Facet(), s, zone); } - void after_insertion_impl(const Vertex_handle v) { - SMREB::after_insertion_impl(v); + void after_insertion_impl(const Vertex_handle v) { + SMREB::after_insertion_impl(v); - if(bad_vertices_initialized){ - // foreach v' in star of v - Vertices vertices; - SMREB::tr.incident_vertices(v, std::back_inserter(vertices)); + if(bad_vertices_initialized){ + // foreach v' in star of v + Vertices vertices; + SMREB::tr.incident_vertices(v, std::back_inserter(vertices)); - for (Vertices_iterator vit = vertices.begin(); - vit != vertices.end(); - ++vit) - if ( SMREB::c2t3.is_in_complex(*vit) ) - // utiliser is_regular_of_boundary_for_vertices - if ( SMREB::c2t3.face_status(*vit) == - SMREB::C2t3::SINGULAR ) { - bad_vertices.insert(*vit); - } - - if ( SMREB::c2t3.is_in_complex(v) ) { - if ( SMREB::c2t3.face_status(v) == // idem - SMREB::C2t3::SINGULAR ) { - bad_vertices.insert(v); - } + // is_regular_or_boundary_for_vertices + // is used here also incident edges are not known to be + // REGULAR which may cause some singular vertices to be forgotten + // This causes no problem because + // those SINGULAR incident SINGULAR edges are going to be handled + for (Vertices_iterator vit = vertices.begin(); + vit != vertices.end(); + ++vit) + if ( SMREB::c2t3.is_in_complex(*vit) && + !SMREB::c2t3.is_regular_or_boundary_for_vertices(*vit)) { + bad_vertices.insert(*vit); } + + if ( SMREB::c2t3.is_in_complex(v) && + !SMREB::c2t3.is_regular_or_boundary_for_vertices(v)) { + bad_vertices.insert(v); } } + } + std::string debug_info() const {