From 2e1eba889e1ed53bc18adeeefce084c43169d3ca Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 29 Mar 2006 07:51:47 +0000 Subject: [PATCH] Removed rounding for Gmpq as it may change orientation of points --- Qt_widget/changes.txt | 3 +++ Qt_widget/include/CGAL/IO/Qt_widget.h | 21 ++------------------- Qt_widget/src/CGALQt/Qt_widget.C | 16 ---------------- 3 files changed, 5 insertions(+), 35 deletions(-) diff --git a/Qt_widget/changes.txt b/Qt_widget/changes.txt index d417d263ce1..6c5a25725c3 100644 --- a/Qt_widget/changes.txt +++ b/Qt_widget/changes.txt @@ -1,3 +1,6 @@ +29 March 2006 Andreas Fabri +- Removed rounding for Gmpq as it may change orientation of points + 09 March 2006 Joachim Reichel - LGPL copyright notice added to src/CGALQt/makefile diff --git a/Qt_widget/include/CGAL/IO/Qt_widget.h b/Qt_widget/include/CGAL/IO/Qt_widget.h index 180c343a288..2c4d05dc135 100644 --- a/Qt_widget/include/CGAL/IO/Qt_widget.h +++ b/Qt_widget/include/CGAL/IO/Qt_widget.h @@ -142,10 +142,7 @@ public: void x_real(int, FT&) const; template void y_real(int y, FT&) const; -#ifdef CGAL_USE_GMP - void x_real(int, Gmpq&) const; - void y_real(int, Gmpq&) const; -#endif + double x_real_dist(double d) const; double y_real_dist(double d) const; @@ -764,14 +761,7 @@ void Qt_widget::x_real(int x, FT& return_t) const if(xscal<1) return_t = static_cast(xmin+(int)(x/xscal)); else{ -#ifdef CGAL_USE_GMP - CGAL_Rational r = simplest_rational_in_interval( - xmin+x/xscal-(x/xscal-(x-1)/xscal)/2, - xmin+x/xscal+((x+1)/xscal-x/xscal)/2); - return_t = static_cast(CGAL::to_double(r)); -#else return_t = static_cast(xmin+x/xscal); -#endif } } @@ -781,14 +771,7 @@ void Qt_widget::y_real(int y, FT& return_t) const if(yscal<1) return_t = static_cast(ymax-(int)(y/yscal)); else{ -#ifdef CGAL_USE_GMP - CGAL_Rational r = simplest_rational_in_interval( - ymax - y/yscal-(y/yscal-(y-1)/yscal)/2, - ymax - y/yscal+((y+1)/yscal-y/yscal)/2); - return_t = static_cast(CGAL::to_double(r)); -#else - return_t = static_cast(ymax-y/yscal); -#endif + return_t = static_cast(ymax-y/yscal); } } diff --git a/Qt_widget/src/CGALQt/Qt_widget.C b/Qt_widget/src/CGALQt/Qt_widget.C index d96c1170fdd..b4be49b2605 100644 --- a/Qt_widget/src/CGALQt/Qt_widget.C +++ b/Qt_widget/src/CGALQt/Qt_widget.C @@ -404,22 +404,6 @@ void Qt_widget::zoom(double ratio) ymin + (ymax - ymin) / 2 ); } -#ifdef CGAL_USE_GMP -void Qt_widget::x_real(int x, Gmpq& return_t) const -{ - return_t = simplest_rational_in_interval( - xmin+x/xscal-(1/xscal)/2, - xmin+x/xscal+(1/xscal)/2); -} - -void Qt_widget::y_real(int y, Gmpq& return_t) const -{ - return_t = simplest_rational_in_interval( - ymax - y/yscal-(1/yscal)/2, - ymax - y/yscal+(1/yscal)/2); -} -#endif - double Qt_widget::x_real(int x) const { if(xscal<1)