diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher.h b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher.h index 6be5b9873d6..3802e04156e 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -198,7 +199,9 @@ namespace CGAL { // deletes the next element from the set of elements to refine // NB: it is useless here, since the update of the restricted // Delaunay triangulation automatically deletes the next element - void pop_next_element_impl() {} + void pop_next_element_impl() { + facets_to_refine.pop_front(); + } // From the element to refine, gets the point to insert Point refinement_point_impl(const Facet& f) const @@ -225,11 +228,18 @@ namespace CGAL { } // Useless here - Mesher_level_conflict_status private_test_point_conflict_impl(const Point&, - Zone&) + Mesher_level_conflict_status private_test_point_conflict_impl(const Point& p, + Zone& ) + { + Vertex_handle v; + if( tr.is_vertex(p, v) ) { - return NO_CONFLICT; + std::cerr << boost::format("Error: (%1%) is already inserted\n") % p; + return CONFLICT_AND_ELEMENT_SHOULD_BE_DROPPED; } + else + return NO_CONFLICT; + } // Useless here void after_no_insertion_impl(const Facet&, const Point&, const Zone&) diff --git a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_edges_level.h b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_edges_level.h index ad30882c1db..c5e3f8e44b6 100644 --- a/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_edges_level.h +++ b/Surface_mesher/include/CGAL/Surface_mesher/Surface_mesher_edges_level.h @@ -364,7 +364,6 @@ namespace Surface_mesher { typename details::Surface_mesher_edges_base_types::Default_container > class Surface_mesher_edges_level_base : - public No_private_test_point_conflict, public No_after_no_insertion, public No_before_conflicts, public Triangulation_mesher_level_traits_3, @@ -518,6 +517,19 @@ namespace Surface_mesher { return refinement_point_cache; } + Mesher_level_conflict_status private_test_point_conflict_impl(const Point_3& p, + Zone& ) + { + Vertex_handle v; + if( tr.is_vertex(p, v) ) + { + std::cerr << boost::format("Error: (%1%) is already inserted\n") % p; + return CONFLICT_AND_ELEMENT_SHOULD_BE_DROPPED; + } + else + return NO_CONFLICT; + } + Zone conflicts_zone_impl(const Point_3& p, const Edge& e) const {