From 5401fc9be625f8ad15fd2803d2f580f162dfa00c Mon Sep 17 00:00:00 2001 From: Samuel Hornus Date: Sun, 1 May 2011 21:40:46 +0000 Subject: [PATCH] fix the perturbation scheme to comply with the negative-inside convemtion of CGAL side_of_oriented_sphere tests --- Triangulation/include/CGAL/Delaunay_complex.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Triangulation/include/CGAL/Delaunay_complex.h b/Triangulation/include/CGAL/Delaunay_complex.h index 13e811cbf82..0c8dcc0f5bb 100644 --- a/Triangulation/include/CGAL/Delaunay_complex.h +++ b/Triangulation/include/CGAL/Delaunay_complex.h @@ -226,12 +226,12 @@ public: if( dc_.is_finite(s) ) { Oriented_side side = side_of_s_(s->points_begin(), s->points_begin() + cur_dim_ + 1, p_); - if( ON_NEGATIVE_SIDE == side ) + if( ON_POSITIVE_SIDE == side ) ok = true; - else if( ON_POSITIVE_SIDE == side ) + else if( ON_NEGATIVE_SIDE == side ) ok = false; else - ok = ON_NEGATIVE_SIDE == dc_.perturbed_side_of_positive_sphere(p_, s, ori_); + ok = ON_POSITIVE_SIDE == dc_.perturbed_side_of_positive_sphere(p_, s, ori_); } else { @@ -400,6 +400,7 @@ Delaunay_complex { // we must put the infinite vertex at index 0 (*it)->swap_vertices(0, v_idx); + // FIXME: are we sure this preseves the positive orientation of the simplex ? (*it)->swap_vertices(current_dimension() - 1, current_dimension()); } } @@ -702,7 +703,7 @@ Delaunay_complex { if( &p == *cut_pt ) // because the simplex "s" is assumed to be positively oriented - return ON_POSITIVE_SIDE; // we consider |p| to lie outside the sphere + return ON_NEGATIVE_SIDE; // we consider |p| to lie outside the sphere test_points.clear(); typename Simplex::Point_const_iterator spit = s->points_begin(); int adjust_sign = -1; @@ -727,12 +728,12 @@ Delaunay_complex Point_pointer_iterator(test_points.end())); if( COPLANAR != ori_value ) - return Oriented_side( adjust_sign * ori_value ); + return Oriented_side( - adjust_sign * ori_value ); ++cut_pt; } CGAL_assertion(false); - return ON_POSITIVE_SIDE; // outside circumsphere + return ON_NEGATIVE_SIDE; // outside circumsphere } template< typename DCTraits, typename PCDS >