From 129f5dda739ad766db2c7ba981d7fe7416c8e018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 14 Aug 2009 15:10:36 +0000 Subject: [PATCH] avoid using temporary point in side_of_sphere predicate of Delaunay_triangulation_3 (thus avoiding accessing the point of the infinite vertex) --- .../include/CGAL/Delaunay_triangulation_3.h | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index 20dabc8527b..5c3b7a0a247 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -741,43 +741,35 @@ side_of_sphere(const Vertex_handle& v0, const Vertex_handle& v1, { CGAL_triangulation_precondition( dimension() == 3 ); - // TODO : - // - avoid accessing points of infinite vertex - // - share the 4 codes below (see old version) - const Point &p0 = v0->point(); - const Point &p1 = v1->point(); - const Point &p2 = v2->point(); - const Point &p3 = v3->point(); - if (is_infinite(v0)) { - Orientation o = orientation(p2, p1, p3, p); + Orientation o = orientation(v2->point(), v1->point(), v3->point(), p); if (o != COPLANAR) return Bounded_side(o); - return coplanar_side_of_bounded_circle(p2, p1, p3, p, perturb); + return coplanar_side_of_bounded_circle(v2->point(), v1->point(), v3->point(), p, perturb); } if (is_infinite(v1)) { - Orientation o = orientation(p2, p3, p0, p); + Orientation o = orientation(v2->point(), v3->point(), v0->point(), p); if (o != COPLANAR) return Bounded_side(o); - return coplanar_side_of_bounded_circle(p2, p3, p0, p, perturb); + return coplanar_side_of_bounded_circle(v2->point(), v3->point(), v0->point(), p, perturb); } if (is_infinite(v2)) { - Orientation o = orientation(p1, p0, p3, p); + Orientation o = orientation(v1->point(), v0->point(), v3->point(), p); if (o != COPLANAR) return Bounded_side(o); - return coplanar_side_of_bounded_circle(p1, p0, p3, p, perturb); + return coplanar_side_of_bounded_circle(v1->point(), v0->point(), v3->point(), p, perturb); } if (is_infinite(v3)) { - Orientation o = orientation(p0, p1, p2, p); + Orientation o = orientation(v0->point(), v1->point(), v2->point(), p); if (o != COPLANAR) return Bounded_side(o); - return coplanar_side_of_bounded_circle(p0, p1, p2, p, perturb); + return coplanar_side_of_bounded_circle(v0->point(), v1->point(), v2->point(), p, perturb); } - return (Bounded_side) side_of_oriented_sphere(p0, p1, p2, p3, p, perturb); + return (Bounded_side) side_of_oriented_sphere(v0->point(), v1->point(), v2->point(), v3->point(), p, perturb); } template < class Gt, class Tds >