From b0f2c77fdc286aa8a3dee97e49da4770fed8fd1e Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Wed, 9 Apr 2008 12:35:10 +0000 Subject: [PATCH] Remove casts to Oriented_side. They are useless since we merged the various enum types. --- .../CGAL/Arrangement_of_spheres_traits_3.h | 2 +- .../include/CGAL/predicates/kernel_ftC2.h | 5 ++-- .../CGAL/Homogeneous/function_objects.h | 4 +-- ...s_for_voronoi_intersection_cartesian_2_3.h | 4 +-- .../doc_tex/Kernel_d_ref/Hyperplane_d.tex | 2 +- Kernel_d/include/CGAL/Kernel_d/HyperplaneCd.h | 4 +-- Kernel_d/include/CGAL/Kernel_d/HyperplaneHd.h | 4 +-- Kernel_d/include/CGAL/Kernel_d/Hyperplane_d.h | 9 ++++-- .../CGAL/Kernel_d/function_objectsCd.h | 2 +- .../CGAL/Kernel_d/function_objectsHd.h | 2 +- Kernel_d/noweb/function_objectsCd.lw | 2 +- Kernel_d/noweb/function_objectsHd.lw | 2 +- .../CGAL/Triangulation_from_slices_3.h | 8 ++--- .../include/CGAL/Regular_triangulation_2.h | 2 +- .../predicates/Regular_triangulation_rtH2.h | 15 +++++----- .../include/CGAL/Delaunay_triangulation_3.h | 8 ++--- .../include/CGAL/Regular_triangulation_3.h | 14 ++++----- .../predicates/Regular_triangulation_ftC3.h | 29 +++++++++---------- .../predicates/Regular_triangulation_rtH3.h | 10 +++---- 19 files changed, 64 insertions(+), 64 deletions(-) diff --git a/Arrangement_of_spheres_3/include/CGAL/Arrangement_of_spheres_traits_3.h b/Arrangement_of_spheres_3/include/CGAL/Arrangement_of_spheres_traits_3.h index 1e614fa6a8e..433001438bf 100644 --- a/Arrangement_of_spheres_3/include/CGAL/Arrangement_of_spheres_traits_3.h +++ b/Arrangement_of_spheres_3/include/CGAL/Arrangement_of_spheres_traits_3.h @@ -615,7 +615,7 @@ protected: if (csp== EQUAL) continue; Comparison_result csl= compare_c(s, pt[i], Coordinate_index(i)); if (csl== CGAL::EQUAL) return ON_ORIENTED_BOUNDARY; - else if (csl != csp) return Oriented_side(-os); + else if (csl != csp) return -os; else return os; } CGAL_error(); diff --git a/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h b/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h index 3cd812a102a..33a1f1c2eab 100644 --- a/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h +++ b/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h @@ -458,11 +458,10 @@ side_of_oriented_circleC2(const FT &px, const FT &py, const FT &rx, const FT &ry, const FT &tx, const FT &ty) { - // Oriented_side( // sign_of_determinant(px, py, px*px + py*py, 1, // qx, qy, qx*qx + qy*qy, 1, // rx, ry, rx*rx + ry*ry, 1, - // tx, ty, tx*tx + ty*ty, 1)); + // tx, ty, tx*tx + ty*ty, 1); // We first translate so that p is the new origin. FT qpx = qx-px; FT qpy = qy-py; @@ -475,7 +474,7 @@ side_of_oriented_circleC2(const FT &px, const FT &py, // rpx, rpy, square(rpx) + square(rpy), // tpx, tpy, square(tpx) + square(tpy))); return sign_of_determinant( qpx*tpy - qpy*tpx, tpx*(tx-qx) + tpy*(ty-qy), - qpx*rpy - qpy*rpx, rpx*(rx-qx) + rpy*(ry-qy)); + qpx*rpy - qpy*rpx, rpx*(rx-qx) + rpy*(ry-qy)); } template < class FT > diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h index 1f97bd3dfe9..0f72b4482bb 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h @@ -4377,7 +4377,7 @@ namespace HomogeneousKernelFunctors { ot = orientation(t.vertex(0), t.vertex(1), t.vertex(2)); if (o1 == ot && o2 == ot && o3 == ot) // ot cannot be COLLINEAR - return Oriented_side(ot); + return ot; return (o1 == COLLINEAR && collinear_are_ordered_along_line(t.vertex(0), p, t.vertex(1))) || @@ -4386,7 +4386,7 @@ namespace HomogeneousKernelFunctors { (o3 == COLLINEAR && collinear_are_ordered_along_line(t.vertex(2), p, t.vertex(3))) ? ON_ORIENTED_BOUNDARY - : Oriented_side(-ot); + : -ot; } }; diff --git a/Interpolation/include/CGAL/predicates/predicates_for_voronoi_intersection_cartesian_2_3.h b/Interpolation/include/CGAL/predicates/predicates_for_voronoi_intersection_cartesian_2_3.h index 8b04be1668c..b9f87c470b5 100644 --- a/Interpolation/include/CGAL/predicates/predicates_for_voronoi_intersection_cartesian_2_3.h +++ b/Interpolation/include/CGAL/predicates/predicates_for_voronoi_intersection_cartesian_2_3.h @@ -48,7 +48,7 @@ side_of_plane_centered_sphere_translateC3( rx,ry,rz); CGAL_assertion(den != ZERO); - return Oriented_side(den * num); + return den * num; } template < class RT> @@ -114,7 +114,7 @@ side_of_plane_centered_sphere_translateC3( qx,qy,qz); } CGAL_assertion(den != ZERO); - return Oriented_side(den * num); + return den * num; } template < class RT> diff --git a/Kernel_d/doc_tex/Kernel_d_ref/Hyperplane_d.tex b/Kernel_d/doc_tex/Kernel_d_ref/Hyperplane_d.tex index d920637626c..3e8a0298a6e 100644 --- a/Kernel_d/doc_tex/Kernel_d_ref/Hyperplane_d.tex +++ b/Kernel_d/doc_tex/Kernel_d_ref/Hyperplane_d.tex @@ -60,7 +60,7 @@ other. \ccConstructor{template Hyperplane_d(ForwardIterator first, ForwardIterator last, - Point_d o, Oriented_side side = Oriented_side(0))}{constructs + Point_d o, Oriented_side side = ON_ORIENTED_BOUNDARY)}{constructs some hyperplane that passes through the points in \ccc{set [first,last)}. If \ccc{side} is \ccc{ON_POSITIVE_SIDE} or \ccc{ON_NEGATIVE_SIDE} then \ccc{o} is on that side of the diff --git a/Kernel_d/include/CGAL/Kernel_d/HyperplaneCd.h b/Kernel_d/include/CGAL/Kernel_d/HyperplaneCd.h index c42426d7eaa..9d8ad696dfc 100644 --- a/Kernel_d/include/CGAL/Kernel_d/HyperplaneCd.h +++ b/Kernel_d/include/CGAL/Kernel_d/HyperplaneCd.h @@ -113,7 +113,7 @@ construct_from_points(ForwardIterator first, ForwardIterator last, template HyperplaneCd(ForwardIterator first, ForwardIterator last, const PointCd& o, - Oriented_side side = Oriented_side(0)) + Oriented_side side = ON_ORIENTED_BOUNDARY) : Base( Tuple(o.dimension()+1) ) { construct_from_points(first,last,o,side); } @@ -183,7 +183,7 @@ Oriented_side oriented_side(const PointCd& p) const { CGAL_assertion_msg(dimension()==p.dimension(), "HyperplaneCd::oriented_side: dimensions do not agree."); - return Oriented_side(CGAL_NTS sign(value_at(p))); + return CGAL_NTS sign(value_at(p)); } bool has_on(const PointCd& p) const diff --git a/Kernel_d/include/CGAL/Kernel_d/HyperplaneHd.h b/Kernel_d/include/CGAL/Kernel_d/HyperplaneHd.h index 0775d1643cc..1c680351506 100644 --- a/Kernel_d/include/CGAL/Kernel_d/HyperplaneHd.h +++ b/Kernel_d/include/CGAL/Kernel_d/HyperplaneHd.h @@ -180,7 +180,7 @@ construct_from_points(ForwardIterator first, ForwardIterator last, template HyperplaneHd(ForwardIterator first, ForwardIterator last, const PointHd& o, - Oriented_side side = Oriented_side(0)) + Oriented_side side = ON_ORIENTED_BOUNDARY) /*{\Mcreate constructs some hyperplane that passes through the points in |set [first,last)|. If |side| is |ON_POSITIVE_SIDE| or |ON_NEGATIVE_SIDE| then |o| is on that side of the constructed @@ -279,7 +279,7 @@ Oriented_side oriented_side(const PointHd& p) const { CGAL_assertion_msg((dimension()==p.dimension()), "HyperplaneHd::oriented_side: dimensions do not agree."); - return Oriented_side(CGAL_NTS sign(value_at(p))); + return CGAL_NTS sign(value_at(p)); } bool has_on(const PointHd& p) const diff --git a/Kernel_d/include/CGAL/Kernel_d/Hyperplane_d.h b/Kernel_d/include/CGAL/Kernel_d/Hyperplane_d.h index 58a6fda628a..0143696951c 100644 --- a/Kernel_d/include/CGAL/Kernel_d/Hyperplane_d.h +++ b/Kernel_d/include/CGAL/Kernel_d/Hyperplane_d.h @@ -20,6 +20,7 @@ // // // Author(s) : Michael Seel + #ifndef CGAL_HYPERPLANE_D_H #define CGAL_HYPERPLANE_D_H @@ -27,7 +28,8 @@ CGAL_BEGIN_NAMESPACE template class Hyperplane_d : public pR::Hyperplane_d_base -{ public: +{ +public: typedef typename pR::Hyperplane_d_base Base; typedef Hyperplane_d Self; typedef pR R; @@ -60,8 +62,8 @@ class Hyperplane_d : public pR::Hyperplane_d_base template Hyperplane_d(ForwardIterator first, ForwardIterator last, - const Point_d& o, Oriented_side side = Oriented_side(0)) : - Base(first,last,o,side) {} + const Point_d& o, Oriented_side side = ON_ORIENTED_BOUNDARY) + : Base(first,last,o,side) {} Vector_d orthogonal_vector() const { return Base::orthogonal_vector(); } @@ -75,4 +77,5 @@ class Hyperplane_d : public pR::Hyperplane_d_base }; CGAL_END_NAMESPACE + #endif //CGAL_HYPERPLANE_D_H diff --git a/Kernel_d/include/CGAL/Kernel_d/function_objectsCd.h b/Kernel_d/include/CGAL/Kernel_d/function_objectsCd.h index 51531b3cccd..ac4adb96c2a 100644 --- a/Kernel_d/include/CGAL/Kernel_d/function_objectsCd.h +++ b/Kernel_d/include/CGAL/Kernel_d/function_objectsCd.h @@ -232,7 +232,7 @@ Oriented_side operator()(ForwardIterator first, ForwardIterator last, M(d,j + 1) = hj; Sum += hj*hj; } M(d,d) = Sum; - return Oriented_side( - LA::sign_of_determinant(M) ); + return - LA::sign_of_determinant(M); } }; diff --git a/Kernel_d/include/CGAL/Kernel_d/function_objectsHd.h b/Kernel_d/include/CGAL/Kernel_d/function_objectsHd.h index 68dbf31621f..2ebec7a12e4 100644 --- a/Kernel_d/include/CGAL/Kernel_d/function_objectsHd.h +++ b/Kernel_d/include/CGAL/Kernel_d/function_objectsHd.h @@ -239,7 +239,7 @@ Oriented_side operator()(ForwardIterator first, ForwardIterator last, Sum += hj*hj; } M(d,d) = Sum; - return Oriented_side( - LA::sign_of_determinant(M) ); + return - LA::sign_of_determinant(M); } }; diff --git a/Kernel_d/noweb/function_objectsCd.lw b/Kernel_d/noweb/function_objectsCd.lw index a380dd97370..011caf50cc2 100644 --- a/Kernel_d/noweb/function_objectsCd.lw +++ b/Kernel_d/noweb/function_objectsCd.lw @@ -307,7 +307,7 @@ Oriented_side operator()(ForwardIterator first, ForwardIterator last, M(d,j + 1) = hj; Sum += hj*hj; } M(d,d) = Sum; - return Oriented_side( - LA::sign_of_determinant(M) ); + return - LA::sign_of_determinant(M); } }; diff --git a/Kernel_d/noweb/function_objectsHd.lw b/Kernel_d/noweb/function_objectsHd.lw index 5c357c27337..75b515c9574 100644 --- a/Kernel_d/noweb/function_objectsHd.lw +++ b/Kernel_d/noweb/function_objectsHd.lw @@ -311,7 +311,7 @@ Oriented_side operator()(ForwardIterator first, ForwardIterator last, Sum += hj*hj; } M(d,d) = Sum; - return Oriented_side( - LA::sign_of_determinant(M) ); + return - LA::sign_of_determinant(M); } }; diff --git a/Reconstruction_from_slices_3/include/CGAL/Triangulation_from_slices_3.h b/Reconstruction_from_slices_3/include/CGAL/Triangulation_from_slices_3.h index e08c09c6e0c..c947e4ef607 100644 --- a/Reconstruction_from_slices_3/include/CGAL/Triangulation_from_slices_3.h +++ b/Reconstruction_from_slices_3/include/CGAL/Triangulation_from_slices_3.h @@ -1377,13 +1377,13 @@ side_of_oriented_sphere(const Point &p0, const Point &p1, const Point &p2, // and positively oriented Orientation o; if (points[i] == &p3 && (o = orientation(p0,p1,p2,p)) != COPLANAR ) - return Oriented_side(o); + return o; if (points[i] == &p2 && (o = orientation(p0,p1,p,p3)) != COPLANAR ) - return Oriented_side(o); + return o; if (points[i] == &p1 && (o = orientation(p0,p,p2,p3)) != COPLANAR ) - return Oriented_side(o); + return o; if (points[i] == &p0 && (o = orientation(p,p1,p2,p3)) != COPLANAR ) - return Oriented_side(o); + return o; } CGAL_triangulation_assertion(false); diff --git a/Triangulation_2/include/CGAL/Regular_triangulation_2.h b/Triangulation_2/include/CGAL/Regular_triangulation_2.h index 7fd78d87c83..52d93dc4fe5 100644 --- a/Triangulation_2/include/CGAL/Regular_triangulation_2.h +++ b/Triangulation_2/include/CGAL/Regular_triangulation_2.h @@ -636,7 +636,7 @@ power_test(const Face_handle &f, const Weighted_point &p) const return power_test(f->vertex(ccw(i))->point(), f->vertex( cw(i))->point(),p); - return Oriented_side(o); + return o; } template < class Gt, class Tds > diff --git a/Triangulation_2/include/CGAL/predicates/Regular_triangulation_rtH2.h b/Triangulation_2/include/CGAL/predicates/Regular_triangulation_rtH2.h index 6b7c5a1703d..7bd152ab7c5 100644 --- a/Triangulation_2/include/CGAL/predicates/Regular_triangulation_rtH2.h +++ b/Triangulation_2/include/CGAL/predicates/Regular_triangulation_rtH2.h @@ -76,10 +76,10 @@ power_testH2( const RT &phx, const RT &phy, const RT &phw, const RT &pwt, RT dthw = CGAL_NTS square(thw); RT dtz = CGAL_NTS square(thx) + CGAL_NTS square(thy) - twt*dthw; - return Oriented_side(sign_of_determinant(dphx, dphy, dpz, dphw, - dqhx, dqhy, dqz, dqhw, - drhx, drhy, drz, drhw, - dthx, dthy, dtz, dthw)); + return sign_of_determinant(dphx, dphy, dpz, dphw, + dqhx, dqhy, dqz, dqhw, + drhx, drhy, drz, drhw, + dthx, dthy, dtz, dthw); } @@ -115,10 +115,9 @@ power_testH2( const RT &phx, const RT &phy, const RT &phw, const RT &pwt, RT dthw = CGAL_NTS square(thw); RT dtz = CGAL_NTS square(thx) + CGAL_NTS square(thy) - twt*dthw; - return Oriented_side(CGAL_NTS compare(pa, qa) * - sign_of_determinant(pa, dpz, dphw, - qa, dqz, dqhw, - ta, dtz, dthw)); + return CGAL_NTS compare(pa, qa) * sign_of_determinant(pa, dpz, dphw, + qa, dqz, dqhw, + ta, dtz, dthw); } CGAL_END_NAMESPACE diff --git a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h index 0383604905f..23297deaf5b 100644 --- a/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Delaunay_triangulation_3.h @@ -1056,13 +1056,13 @@ side_of_oriented_sphere(const Point &p0, const Point &p1, const Point &p2, // and positively oriented Orientation o; if (points[i] == &p3 && (o = orientation(p0,p1,p2,p)) != COPLANAR ) - return Oriented_side(o); + return o; if (points[i] == &p2 && (o = orientation(p0,p1,p,p3)) != COPLANAR ) - return Oriented_side(o); + return o; if (points[i] == &p1 && (o = orientation(p0,p,p2,p3)) != COPLANAR ) - return Oriented_side(o); + return o; if (points[i] == &p0 && (o = orientation(p,p1,p2,p3)) != COPLANAR ) - return Oriented_side(o); + return o; } CGAL_triangulation_assertion(false); diff --git a/Triangulation_3/include/CGAL/Regular_triangulation_3.h b/Triangulation_3/include/CGAL/Regular_triangulation_3.h index 62cbccfbd99..3e4a817afc2 100644 --- a/Triangulation_3/include/CGAL/Regular_triangulation_3.h +++ b/Triangulation_3/include/CGAL/Regular_triangulation_3.h @@ -910,13 +910,13 @@ side_of_oriented_power_sphere(const Weighted_point &p0, // and positively oriented Orientation o; if (points[i] == &p3 && (o = orientation(p0,p1,p2,p)) != COPLANAR ) - return Oriented_side(o); + return o; if (points[i] == &p2 && (o = orientation(p0,p1,p,p3)) != COPLANAR ) - return Oriented_side(o); + return o; if (points[i] == &p1 && (o = orientation(p0,p,p2,p3)) != COPLANAR ) - return Oriented_side(o); + return o; if (points[i] == &p0 && (o = orientation(p,p1,p2,p3)) != COPLANAR ) - return Oriented_side(o); + return o; } CGAL_triangulation_assertion(false); @@ -1021,11 +1021,11 @@ side_of_oriented_power_circle(const Weighted_point &p0, // and positively oriented Orientation o; if (points[i] == &p2 && (o = coplanar_orientation(p0,p1,p)) != COPLANAR ) - return Oriented_side(o); + return o; if (points[i] == &p1 && (o = coplanar_orientation(p0,p,p2)) != COPLANAR ) - return Oriented_side(o); + return o; if (points[i] == &p0 && (o = coplanar_orientation(p,p1,p2)) != COPLANAR ) - return Oriented_side(o); + return o; } CGAL_triangulation_assertion(false); diff --git a/Triangulation_3/include/CGAL/predicates/Regular_triangulation_ftC3.h b/Triangulation_3/include/CGAL/predicates/Regular_triangulation_ftC3.h index ebc210d3261..357929e818e 100644 --- a/Triangulation_3/include/CGAL/predicates/Regular_triangulation_ftC3.h +++ b/Triangulation_3/include/CGAL/predicates/Regular_triangulation_ftC3.h @@ -57,10 +57,10 @@ power_testC3( const FT &px, const FT &py, const FT &pz, const FT &pwt, FT dst = CGAL_NTS square(dsx) + CGAL_NTS square(dsy) + CGAL_NTS square(dsz) - swt + twt; - return Oriented_side( - sign_of_determinant(dpx, dpy, dpz, dpt, - dqx, dqy, dqz, dqt, - drx, dry, drz, drt, - dsx, dsy, dsz, dst)); + return - sign_of_determinant(dpx, dpy, dpz, dpt, + dqx, dqy, dqz, dqt, + drx, dry, drz, drt, + dsx, dsy, dsz, dst); } @@ -94,23 +94,23 @@ power_testC3( const FT &px, const FT &py, const FT &pz, const FT &pwt, dqx, dqy, dqt, drx, dry, drt); if (cmp != ZERO) - return Oriented_side(cmp * sign_of_determinant(px-rx, py-ry, - qx-rx, qy-ry)); + return cmp * sign_of_determinant(px-rx, py-ry, + qx-rx, qy-ry); // Projection on the (xz) plane. cmp = sign_of_determinant(dpx, dpz, dpt, dqx, dqz, dqt, drx, drz, drt); if (cmp != ZERO) - return Oriented_side(cmp * sign_of_determinant(px-rx, pz-rz, - qx-rx, qz-rz)); + return cmp * sign_of_determinant(px-rx, pz-rz, + qx-rx, qz-rz); // Projection on the (yz) plane. cmp = sign_of_determinant(dpy, dpz, dpt, dqy, dqz, dqt, dry, drz, drt); - return Oriented_side(cmp * sign_of_determinant(py-ry, pz-rz, - qy-ry, qz-rz)); + return cmp * sign_of_determinant(py-ry, pz-rz, + qy-ry, qz-rz); } @@ -136,26 +136,25 @@ power_testC3( const FT &px, const FT &py, const FT &pz, const FT &pwt, // We do an orthogonal projection on the (x) axis, if possible. cmp = CGAL_NTS compare(px, qx); if (cmp != EQUAL) - return Oriented_side(cmp * sign_of_determinant(dpx, dpt, dqx, dqt)); + return cmp * sign_of_determinant(dpx, dpt, dqx, dqt); // We do an orthogonal projection on the (y) axis, if possible. cmp = CGAL_NTS compare(py, qy); if (cmp != EQUAL) - return Oriented_side(cmp * sign_of_determinant(dpy, dpt, dqy, dqt)); + return cmp * sign_of_determinant(dpy, dpt, dqy, dqt); // We do an orthogonal projection on the (z) axis. cmp = CGAL_NTS compare(pz, qz); - return Oriented_side(cmp * sign_of_determinant(dpz, dpt, dqz, dqt)); + return cmp * sign_of_determinant(dpz, dpt, dqz, dqt); } template Oriented_side power_testC3(const FT &pwt, const FT &qwt) { - return Oriented_side((Comparison_result) CGAL_NTS compare(qwt, pwt)); + return CGAL_NTS compare(qwt, pwt); } - CGAL_END_NAMESPACE #endif // CGAL_REGULAR_TRIANGULATION_FTC3_H diff --git a/Triangulation_3/include/CGAL/predicates/Regular_triangulation_rtH3.h b/Triangulation_3/include/CGAL/predicates/Regular_triangulation_rtH3.h index 8863e6a5f81..e64dc79fa64 100644 --- a/Triangulation_3/include/CGAL/predicates/Regular_triangulation_rtH3.h +++ b/Triangulation_3/include/CGAL/predicates/Regular_triangulation_rtH3.h @@ -71,11 +71,11 @@ power_testH3( RT dtz = CGAL_NTS square(thx) + CGAL_NTS square(thy) + CGAL_NTS square(thz) - twt*dthw; - return Oriented_side(- sign_of_determinant(dphx, dphy, dphz, dpz, dphw, - dqhx, dqhy, dqhz, dqz, dqhw, - drhx, drhy, drhz, drz, drhw, - dshx, dshy, dshz, dsz, dshw, - dthx, dthy, dthz, dtz, dthw)); + return - sign_of_determinant(dphx, dphy, dphz, dpz, dphw, + dqhx, dqhy, dqhz, dqz, dqhw, + drhx, drhy, drhz, drz, drhw, + dshx, dshy, dshz, dsz, dshw, + dthx, dthy, dthz, dtz, dthw); } // The 2 degenerate are not speed critical, and they are quite boring and error