From 31d9dd1eedaf9af5c1325a5ca89505821f6d1384 Mon Sep 17 00:00:00 2001 From: Panagiotis Cheilaris Date: Sun, 28 Apr 2013 21:56:39 +0200 Subject: [PATCH] simplification and fix of drawing a bis seg This fixes a drawing bug in the demo with input 3segconstr.cin: s -268 65 238 71 s 206 -89 -241 -11 s -94 171 -155 -196 Signed-off-by: Panagiotis Cheilaris --- .../Constructions_C2.h | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Constructions_C2.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Constructions_C2.h index 1bbcc54cda0..90f48cdbd69 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Constructions_C2.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Constructions_C2.h @@ -1180,24 +1180,21 @@ public: } } + CGAL_SDG_DEBUG( std::cout << "debug first check npts=" + << npts << std::endl; ); + if ((npts == 3) and ((p.is_segment() and not l.has_on_positive_side(vqps)) or(p.is_point() and not l.has_on_negative_side(vqps)))) { npts = 2; } if (npts == 4) { - if ((p.is_segment() and not l.has_on_positive_side(vqps)) - or(p.is_point() and not l.has_on_negative_side(vqps))) { - if (l.perpendicular(pnt).has_on_positive_side(vqps)) { - npts = 2; - } - else { - if (compare_x_2(vqps,points[1]) == EQUAL - and compare_y_2(vqps,points[1]) == EQUAL) { - npts = 2; - } else { - npts = 3; - } + if (not l.perpendicular(pnt).has_on_negative_side(vqps)) { + npts = 2; + } else { + if ((p.is_segment() and not l.has_on_positive_side(vqps)) + or(p.is_point() and not l.has_on_negative_side(vqps))) { + npts = 3; } } }