From cc3c33d5698fc4c2ef13d93f348e0f98508cf5f8 Mon Sep 17 00:00:00 2001 From: Panagiotis Cheilaris Date: Tue, 18 Mar 2014 12:07:41 +0100 Subject: [PATCH] use the line optimization for parallel segments Use the line optimization when computing the bisector of two parallel segments. This also fixes a bug for inputs of the following form: s 100 20 0 20 s 0 80 100 80 s 30 40 30 60 Signed-off-by: Panagiotis Cheilaris --- .../CGAL/Segment_Delaunay_graph_Linf_2/Bisector_Linf.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Bisector_Linf.h b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Bisector_Linf.h index ae1377bd47c..46e95125310 100644 --- a/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Bisector_Linf.h +++ b/Segment_Delaunay_graph_Linf_2/include/CGAL/Segment_Delaunay_graph_Linf_2/Bisector_Linf.h @@ -384,6 +384,8 @@ private: bool have_common_endp = is_mid_psrc or is_mid_ptrg; + bool optimize_for_line(false); + Are_parallel_2 are_parallel; // compute supporting lines of segments @@ -450,6 +452,8 @@ private: dinc = -d; dout = d; + optimize_for_line = true; + } else { // here p and q are not parallel @@ -629,6 +633,10 @@ private: Polychainline pcl (dinc, points, points + 1, dout); + if (optimize_for_line) { + pcl.set_line_optimization(); + } + return pcl; }