From cbda5a6224f8a4ba84970db1c2ae71e4e511ac74 Mon Sep 17 00:00:00 2001 From: Olivier Devillers Date: Tue, 19 Oct 1999 14:23:02 +0000 Subject: [PATCH] M$ VC++ (cerr) and adding cmp_dist_to_pointC[23] --- .../examples/Fixed_precision_nt/delaunay.C | 2 +- .../include/CGAL/Fixed_precision_nt.h | 17 ++++++ .../Fixed_precision_nt/long_description.txt | 3 + .../src/Fixed_precision_nt.C | 57 +++++++++++++++++++ Packages/Fixed_precision_nt/version | 2 +- 5 files changed, 79 insertions(+), 2 deletions(-) diff --git a/Packages/Fixed_precision_nt/examples/Fixed_precision_nt/delaunay.C b/Packages/Fixed_precision_nt/examples/Fixed_precision_nt/delaunay.C index ae3ce492b56..f20d31dc3c4 100644 --- a/Packages/Fixed_precision_nt/examples/Fixed_precision_nt/delaunay.C +++ b/Packages/Fixed_precision_nt/examples/Fixed_precision_nt/delaunay.C @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) Creator_uniform_2 > Input ( 1.0 ); int N; if (argc==2) sscanf(argv[1], "%d", &N); - else {N=100; cerr<<"usage : "< +Comparison_result +cmp_dist_to_pointC2( + const Fixed_precision_nt x0, const Fixed_precision_nt y0, + const Fixed_precision_nt x1, const Fixed_precision_nt y1, + const Fixed_precision_nt x2, const Fixed_precision_nt y2); + +//template <> +Comparison_result +cmp_dist_to_pointC3( + const Fixed_precision_nt x0, const Fixed_precision_nt y0, + const Fixed_precision_nt z0, + const Fixed_precision_nt x1, const Fixed_precision_nt y1, + const Fixed_precision_nt z1, + const Fixed_precision_nt x2, const Fixed_precision_nt y2, + const Fixed_precision_nt z2); + //template <> Orientation orientationC2( const Fixed_precision_nt x0, const Fixed_precision_nt y0, diff --git a/Packages/Fixed_precision_nt/long_description.txt b/Packages/Fixed_precision_nt/long_description.txt index 2693dd0e778..49869dde3e6 100644 --- a/Packages/Fixed_precision_nt/long_description.txt +++ b/Packages/Fixed_precision_nt/long_description.txt @@ -10,6 +10,9 @@ predicates. Versions +2.7 (19 Oct 1999) + M$ VC++ (cerr) and adding cmp_dist_to_pointC[23] + 2.6 (18 Oct 1999) M$ VC++ diff --git a/Packages/Fixed_precision_nt/src/Fixed_precision_nt.C b/Packages/Fixed_precision_nt/src/Fixed_precision_nt.C index caf86262bbf..12de35abc03 100644 --- a/Packages/Fixed_precision_nt/src/Fixed_precision_nt.C +++ b/Packages/Fixed_precision_nt/src/Fixed_precision_nt.C @@ -255,6 +255,34 @@ inline void Fixed_split // ====================================================================== +CGAL_Fixed_public +int Fixed_cmp_dist(float x0, float y0, + float x1, float y1, + float x2, float y2) +{ + double X1 = x1-x0; + double Y1 = y1-y0; + double X2 = x2-x0; + double Y2 = y2-y0; + X1 = (X2*X2+Y2*Y2)-(X1*X1+Y1*Y1); // exact + return (X1>0) ? 1 : (X1==0) ? 0 : -1; +} + +CGAL_Fixed_public +int Fixed_cmp_dist(float x0, float y0, float z0, + float x1, float y1, float z1, + float x2, float y2, float z2) +{ + double X1 = x1-x0; + double Y1 = y1-y0; + double Z1 = z1-z0; + double X2 = x2-x0; + double Y2 = y2-y0; + double Z2 = z2-z0; + X1 = (X2*X2+Y2*Y2+Z2*Z2)-(X1*X1+Y1*Y1+Z1*Z1); // exact + return (X1>0) ? 1 : (X1==0) ? 0 : -1; +} + CGAL_Fixed_public int Fixed_orientation(float x0, float y0, float x1, float y1, @@ -811,6 +839,35 @@ bool Fixed_precision_nt::init(float b) //--------- geometric predicates // ====================================================================== +//template <> +Comparison_result +cmp_dist_to_pointC2( + const Fixed_precision_nt x0, const Fixed_precision_nt y0, + const Fixed_precision_nt x1, const Fixed_precision_nt y1, + const Fixed_precision_nt x2, const Fixed_precision_nt y2) +{ + return (Comparison_result) sign(Fixed_cmp_dist( + x0.to_float(), y0.to_float(), + x1.to_float(), y1.to_float(), + x2.to_float(), y2.to_float())); +} + +//template <> +Comparison_result +cmp_dist_to_pointC3( + const Fixed_precision_nt x0, const Fixed_precision_nt y0, + const Fixed_precision_nt z0, + const Fixed_precision_nt x1, const Fixed_precision_nt y1, + const Fixed_precision_nt z1, + const Fixed_precision_nt x2, const Fixed_precision_nt y2, + const Fixed_precision_nt z2) +{ + return (Comparison_result) sign(Fixed_cmp_dist( + x0.to_float(), y0.to_float(), z0.to_float(), + x1.to_float(), y1.to_float(), z1.to_float(), + x2.to_float(), y2.to_float(), z2.to_float())); +} + //template <> Orientation orientationC2 (const Fixed_precision_nt x0, const Fixed_precision_nt y0, diff --git a/Packages/Fixed_precision_nt/version b/Packages/Fixed_precision_nt/version index 74f45d9dc9d..d6857b09fc0 100644 --- a/Packages/Fixed_precision_nt/version +++ b/Packages/Fixed_precision_nt/version @@ -1 +1 @@ -2.6 (18 Oct 1999) +2.7 (19 Oct 1999)