From 5a3f51dbe42d199de1c6dd280a1650dd97d56265 Mon Sep 17 00:00:00 2001 From: Nico Kruithof Date: Tue, 15 Jan 2013 21:55:21 +0100 Subject: [PATCH] Fixed the p2t2_find_conflicts example. --- .../p2t2_find_conflicts.cpp | 1 - .../CGAL/Periodic_2_Delaunay_triangulation_2.h | 6 +++++- .../include/CGAL/Periodic_2_triangulation_2.h | 18 +++++------------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_find_conflicts.cpp b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_find_conflicts.cpp index ad1af80d563..7f65f772320 100644 --- a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_find_conflicts.cpp +++ b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/p2t2_find_conflicts.cpp @@ -39,7 +39,6 @@ int main() // and a facet on the boundary of this hole in f. std::vector V; - // NGHK: was find_conflicts T.get_conflicts(p, std::back_inserter(V), // Conflict cells in V f); diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h index bf6856bfdad..709dd0c7cbe 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_Delaunay_triangulation_2.h @@ -577,7 +577,7 @@ private: std::pair pit) const { Face_handle fn = fh->neighbor(i); - if (! this->test_conflict(p,fn)) { + if (! test_conflict(p,fn)) { *(pit.second)++ = Edge(fn, fn->index(fh)); } else { *(pit.first)++ = fn; @@ -588,6 +588,10 @@ private: return pit; } + bool test_conflict(const Point &p, Face_handle fh) const { + return side_of_oriented_circle(fh, p, true) == ON_POSITIVE_SIDE; + } + /// NGHK: Not yet implemented void restore_edges(Vertex_handle v) { diff --git a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h index 33e83cbc926..5659de3b8f8 100644 --- a/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h +++ b/Periodic_2_triangulation_2/include/CGAL/Periodic_2_triangulation_2.h @@ -568,8 +568,8 @@ public: /// the circle through the vertices of f ///\n NGHK: Not yet implemented Oriented_side - side_of_oriented_circle(Face_handle f, const Point & p, bool perturb = - false) const; + side_of_oriented_circle(Face_handle f, + const Point & p, bool perturb = false) const; // \} @@ -1101,14 +1101,6 @@ protected: } } - - /// Determines whether the point (p,o) lies on the (un-)bounded side of - /// the circle through the vertices of f - ///\n NGHK: Not yet implemented - Oriented_side - side_of_oriented_circle(Face_handle f, const Point & p, const Offset &o, - bool perturb = false) const; - protected: // Protected functions of Periodic_2_triangulation_2 @@ -4157,9 +4149,9 @@ Oriented_side Periodic_2_triangulation_2::side_of_oriented_circle( // TODO: optimize which copies to check depending on the offsets in // the cell. while (os == ON_NEGATIVE_SIDE && i < 4) { - os = side_of_oriented_circle(f->vertex(0)->point(), f->vertex(1)->point(), - f->vertex(2)->point(), p, get_offset(f, 0), get_offset(f, 1), - get_offset(f, 2), combine_offsets(Offset(), int_to_off(i)), perturb); + os = side_of_oriented_circle(f->vertex(0)->point(), f->vertex(1)->point(), f->vertex(2)->point(), p, + get_offset(f, 0), get_offset(f, 1), get_offset(f, 2), combine_offsets(Offset(), int_to_off(i)), + perturb); i++; }