From c7fcdc1d0809b69ebdbfa354d4e8b70766f9bcc9 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 2 Dec 2016 11:43:13 +0100 Subject: [PATCH] fix the edge - facet - vertex case --- .../CGAL/Triangulation_segment_traverser_3.h | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h b/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h index 388e7872334..99048d96cb2 100644 --- a/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h @@ -652,7 +652,12 @@ public: else if (ltnext == Locate_type::FACET) _curr_simplex = chnext->neighbor(linext);//chnext will be met after the facet else if (ltnext == Locate_type::VERTEX) - _curr_simplex = shared_cell(get_edge(), chnext->vertex(linext)); + { + if (edge_has_vertex(get_edge(), chnext->vertex(linext))) + _curr_simplex = chnext->vertex(linext); + else + _curr_simplex = shared_facet(get_edge(), chnext->vertex(linext)); + } else //CELL CGAL_assertion(false); break; @@ -916,6 +921,23 @@ private: return Facet(Cell_handle(), 0); } + Facet shared_facet(const Edge& e, const Vertex_handle v) const + { + typename Tr::Facet_circulator circ + = _cell_iterator.triangulation().incident_facets(e); + typename Tr::Facet_circulator end = circ; + do + { + Facet f = *circ; + if (facet_has_vertex(f, v)) + return f; + } while (++circ != end); + + std::cerr << "There is no facet shared by e and v" << std::endl; + CGAL_assertion(false); + return Facet(Cell_handle(), 0); + } + Cell_handle shared_cell(const Edge& e, const Vertex_handle v) const { typename Tr::Cell_circulator circ