From b1f3dfaeba52fcaaf58eb2a1c0b57a247157cf3c Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 18 Dec 2020 11:19:35 +0100 Subject: [PATCH] make is_selected(edge) a lot simpler than its naive version --- .../internal/tetrahedral_remeshing_helpers.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h index 73898e72d7e..8f99e95ce82 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/tetrahedral_remeshing_helpers.h @@ -602,6 +602,7 @@ bool is_outside(const typename C3t3::Edge & edge, return true; //all incident cells are outside or infinite } +// is `v` part of the selection of cells that should be remeshed? template bool is_selected(const typename C3t3::Vertex_handle v, const C3t3& c3t3, @@ -650,13 +651,22 @@ bool is_internal(const typename C3t3::Edge& edge, return true; } +// is `e` part of the selection of cells that should be remeshed? template bool is_selected(const typename C3T3::Triangulation::Edge& e, const C3T3& c3t3, CellSelector cell_selector) { - return is_boundary(c3t3, e, cell_selector) - || is_internal(e, c3t3, cell_selector); + typedef typename C3T3::Triangulation::Cell_circulator Cell_circulator; + Cell_circulator circ = c3t3.triangulation().incident_cells(e); + Cell_circulator done = circ; + do + { + if (cell_selector(circ)) + return true; + } while (++circ != done); + + return false; } template