From 1a9b0dc0798bff557a3bcd0659370dd0b64d1a74 Mon Sep 17 00:00:00 2001 From: Panagiotis Cheilaris Date: Tue, 19 Feb 2013 15:16:56 +0100 Subject: [PATCH] vertex conflict for insert_third Use vertex conflict instead of orientation in insert_third for the case of three points. This change is to make SDG more L2 agnostic. Given are three point sites s1, s2, s3. The orientation of (s1,s2,s3) is not collinear if and only if the two vertex conflict quadruples (s1,s2,inf,s3) and (s2,s1,inf,s3) are of opposite signs. The orientation of (s1,s2,s3) is right turn if and only if the vertex conflict quadruple (s2,s1,inf,s3) is NEGATIVE. --- .../Segment_Delaunay_graph_2_impl.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h index 30e16d318ce..7fe4326fb44 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Segment_Delaunay_graph_2_impl.h @@ -139,11 +139,14 @@ insert_third(const Site_2& t, const Storage_site_2& ss) Site_2 s2 = f->vertex(1)->site(); Site_2 s3 = f->vertex(2)->site(); - Orientation o = - geom_traits().orientation_2_object()(s1, s2, s3); + Sign s12i3 = geom_traits().vertex_conflict_2_object()(s1, s2, s3); + Sign s21i3 = geom_traits().vertex_conflict_2_object()(s2, s1, s3); - if ( o != COLLINEAR ) { - if ( o == RIGHT_TURN ) { + CGAL_assertion(s12i3 != ZERO); + CGAL_assertion(s21i3 != ZERO); + + if ( s12i3 != s21i3 ) { + if ( s21i3 == NEGATIVE ) { f->reorient(); for (int i = 0; i < 3; i++) { f->neighbor(i)->reorient();