From d672394d1ab40e76f3c238d18e2f5e2c619d1a14 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Mon, 8 Mar 2010 19:24:42 +0000 Subject: [PATCH] within a macro block called CGAL_SDG_CHECK_INCIRCLE_CONSISTENCY, we check if the results of the old and new incircle tests are the same --- .../Vertex_conflict_C2.h | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Vertex_conflict_C2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Vertex_conflict_C2.h index 7469754a791..2bf58f34087 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Vertex_conflict_C2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Vertex_conflict_C2.h @@ -26,6 +26,11 @@ #include #include +#ifdef CGAL_SDG_CHECK_INCIRCLE_CONSISTENCY +#include +#include +#endif + CGAL_BEGIN_NAMESPACE CGAL_SEGMENT_DELAUNAY_GRAPH_2_BEGIN_NAMESPACE @@ -479,9 +484,32 @@ public: } #endif +#ifdef CGAL_SDG_CHECK_INCIRCLE_CONSISTENCY + typedef Incircle_sqrt_field_C2 Alternative1_Voronoi_vertex_2; + typedef Incircle_operator_sqrt_field_C2 Alternative2_Voronoi_vertex_2; + + Voronoi_vertex_2 v(p, q, r); + Alternative1_Voronoi_vertex_2 valt1(p, q, r); + Alternative2_Voronoi_vertex_2 valt2(p, q, r); + + Sign s = v.incircle(t); + Sign salt1 = valt1.incircle(t); + Sign salt2 = valt2.incircle(t); + + if ( s != salt1 || s != salt2 ) { + std::cerr << "different results" << std::endl; + std::cerr << p << std::endl; + std::cerr << q << std::endl; + std::cerr << r << std::endl; + std::cerr << t << std::endl; + } + + return s; +#else Voronoi_vertex_2 v(p, q, r); return v.incircle(t); +#endif }