From dfd1fd025d09d2cd04800b9c67d596946c809e55 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 28 Nov 2016 16:42:47 +0100 Subject: [PATCH] vertex case --- .../CGAL/Triangulation_segment_traverser_3.h | 73 ++++++++----------- 1 file changed, 29 insertions(+), 44 deletions(-) diff --git a/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h b/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h index 1d632e75d54..b054f12f80b 100644 --- a/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h +++ b/Triangulation_3/include/CGAL/Triangulation_segment_traverser_3.h @@ -661,40 +661,41 @@ public: } case 0 :/*Vertex_handle*/ { - if (degeneracy()) - { - set_curr_simplex(); - break; - } Cell_handle ch = Cell_handle(_cell_iterator); if (cell_iterator_is_ahead()) { _curr_simplex = ch; - break; - } - - ++_cell_iterator; - Cell_handle chnext = Cell_handle(_cell_iterator); - //_cell_iterator is one step forward _curr_simplex - - Locate_type lt; - int li, lj; - _cell_iterator.entry(lt, li, lj); - - int index_v = ch->index(get_vertex()); - int index_vnext = ch->index(chnext->vertex(li)); - - if (lt == Locate_type::VERTEX) - { - _curr_simplex = Edge(ch, index_v, index_vnext); - } - else if (lt == Locate_type::EDGE) - { - int index_f = 6 - (index_v + index_vnext + ch->index(chnext->vertex(lj))); - _curr_simplex = Facet(ch, index_f); + std::cerr << "cell_iterator is ahead in vertex case (check to be done)" + << std::endl; } else - _curr_simplex = Cell_handle(_cell_iterator); + { + ++_cell_iterator; + Cell_handle chnext = Cell_handle(_cell_iterator); + //_cell_iterator is one step forward _curr_simplex + + Locate_type lt; + int li, lj; + _cell_iterator.entry(lt, li, lj); + + int index_v = ch->index(get_vertex()); + int index_vnext = ch->index(chnext->vertex(li)); + switch (lt) + { + case Locate_type::VERTEX: + _curr_simplex = Edge(ch, index_v, index_vnext); + break; + case Locate_type::EDGE: + { + int index_f = 6 - (index_v + index_vnext + ch->index(chnext->vertex(lj))); + _curr_simplex = Facet(ch, index_f); + break; + } + default ://FACET + CGAL_assertion(lt == Locate_type::FACET); + _curr_simplex = ch; + }; + } break; } default: @@ -753,22 +754,6 @@ public: } private: - /** returns true when _current_simplex does not have the same - * type as the "entry" of _cell_iterator - * it is for example the case after vertex - edge. - * the following value should be vertex, and the corresponding vertex - * is the entry of _cell_iterator - */ - bool degeneracy() const - { - Locate_type lt; - int li, lj; - _cell_iterator.entry(lt, li, lj); - return (is_vertex() && lt != Locate_type::VERTEX) - || (is_edge() && lt != Locate_type::EDGE) - || (is_facet() && lt != Locate_type::FACET); - } - bool cell_iterator_is_ahead() const { Cell_handle ch = Cell_handle(_cell_iterator);