From f58e8ffb1ce06ebd9a32fdc378f6dbb35765458d Mon Sep 17 00:00:00 2001 From: Mariette Yvinec Date: Tue, 21 Jul 1998 12:30:47 +0000 Subject: [PATCH] intorduce the functiom bool compare(const Point &p, const Point &q) const --- .../CGAL/Triangulation_euclidean_traits_2.h | 39 +++++++++++-------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/Packages/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_2.h b/Packages/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_2.h index 5d769d9c877..7adf4410dc4 100644 --- a/Packages/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_2.h +++ b/Packages/Triangulation_2/include/CGAL/Triangulation_euclidean_traits_2.h @@ -39,6 +39,10 @@ public: return CGAL_compare_y(p, q); } + bool compare(const Point &p, const Point &q) const + { + return (x(p)==x(q)) && (y(p)==y(q)); + } CGAL_Orientation orientation(const Point &p, const Point &q, @@ -48,28 +52,31 @@ public: } - CGAL_Orientation extremal(const Point &p, + CGAL_Orientation extremal(const Point &p, const Point &q, const Point &r) const - { - if (p==q) return CGAL_COLLINEAR; - if (p==r) return CGAL_COLLINEAR; - if (r==q) return CGAL_COLLINEAR; - - return CGAL_orientation(p, q, r); - } - + { + if (compare(p,q)) return CGAL_COLLINEAR; + if (compare(p,r)) return CGAL_COLLINEAR; + if (compare(r,q)) return CGAL_COLLINEAR; + + return CGAL_orientationC2(x(p), y(p), x(q), y(q), x(r), y(r)); + } + CGAL_Oriented_side side_of_oriented_circle(const Point &p, const Point &q, const Point &r, const Point &s) const - { - if (p==s) return CGAL_ON_ORIENTED_BOUNDARY; - if (q==s) return CGAL_ON_ORIENTED_BOUNDARY; - if (r==s) return CGAL_ON_ORIENTED_BOUNDARY; - - return CGAL_side_of_oriented_circle(p, q, r, s); - } + { + if (compare(p,s)) return CGAL_ON_ORIENTED_BOUNDARY; + if (compare(q,s)) return CGAL_ON_ORIENTED_BOUNDARY; + if (compare(r,s)) return CGAL_ON_ORIENTED_BOUNDARY; + + return CGAL_side_of_oriented_circleC2(x(p), y(p), + x(q), y(q), + x(r), y(r), + x(s), y(s)); + } };