From 173ef7c5900b36beb5ae9bc29b61dac209e50147 Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Wed, 16 Jul 2008 13:45:13 +0000 Subject: [PATCH] Allow propagation of Uncertain-ty in more places, to reduce the number of exceptions. - Use K::Bool_type, K::Orientation... instead of bool, CGAL::Orientation... - More functions around Uncertain<> : make_certain(), extract_singleton(), possible conversions tightenning. Many conversions still remain, e.g. for switch and if statements, &&, ||... --- .../include/CGAL/Cartesian/Circle_2.h | 1 + .../include/CGAL/Cartesian/Direction_3.h | 8 +- .../include/CGAL/Cartesian/Iso_cuboid_3.h | 28 ++-- .../include/CGAL/Cartesian/Line_2.h | 8 +- .../include/CGAL/Cartesian/Plane_3.h | 30 ++-- .../include/CGAL/Cartesian/Point_2.h | 4 +- .../include/CGAL/Cartesian/Ray_2.h | 2 +- .../include/CGAL/Cartesian/Ray_3.h | 26 ++-- .../include/CGAL/Cartesian/Sphere_3.h | 54 ++++--- .../include/CGAL/Cartesian/Tetrahedron_3.h | 48 +++--- .../include/CGAL/Cartesian/function_objects.h | 6 +- .../Cartesian/predicates_on_directions_2.h | 4 +- .../CGAL/Cartesian/predicates_on_planes_3.h | 4 +- .../include/CGAL/predicates/kernel_ftC2.h | 4 +- .../include/CGAL/Filtered_predicate.h | 44 +++--- Filtered_kernel/include/CGAL/Lazy_kernel.h | 16 ++ Filtered_kernel/include/CGAL/Uncertain.h | 138 +++++++++++++---- .../CGAL/Segment_2_Segment_2_intersection.h | 45 +++--- .../Triangle_3_Tetrahedron_3_do_intersect.h | 14 +- .../CGAL/Triangle_3_Triangle_3_do_intersect.h | 27 ++-- Kernel_23/include/CGAL/Circle_2.h | 26 ++-- Kernel_23/include/CGAL/Direction_2.h | 14 +- .../include/CGAL/Kernel/function_objects.h | 4 +- .../include/CGAL/Kernel/global_functions_2.h | 146 +++++++++--------- .../include/CGAL/Kernel/global_functions_3.h | 146 +++++++++--------- .../CGAL/Kernel/global_functions_internal_2.h | 112 +++++++------- .../CGAL/Kernel/global_functions_internal_3.h | 94 +++++------ Kernel_23/include/CGAL/Line_2.h | 20 +-- Kernel_23/include/CGAL/Sphere_3.h | 18 +-- Kernel_23/include/CGAL/Triangle_2.h | 22 +-- Number_types/include/CGAL/Lazy_exact_nt.h | 12 +- 31 files changed, 610 insertions(+), 515 deletions(-) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Circle_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Circle_2.h index 4c7fcc06547..22ca7a1cf29 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Circle_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Circle_2.h @@ -36,6 +36,7 @@ class CircleC2 typedef typename R_::RT RT; typedef typename R_::Circle_2 Circle_2; typedef typename R_::Point_2 Point_2; + typedef typename R_::Orientation Orientation; typedef Triple Rep; typedef typename R_::template Handle::type Base; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h index db73cb81475..a4c5c2ca4a4 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Direction_3.h @@ -66,8 +66,8 @@ public: DirectionC3(const FT &x, const FT &y, const FT &z) : base(CGALi::make_array(x, y, z)) {} - bool operator==(const DirectionC3 &d) const; - bool operator!=(const DirectionC3 &d) const; + typename R::Bool_type operator==(const DirectionC3 &d) const; + typename R::Bool_type operator!=(const DirectionC3 &d) const; Vector_3 to_vector() const; Vector_3 vector() const { return to_vector(); } @@ -105,7 +105,7 @@ public: template < class R > inline -bool +typename R::Bool_type DirectionC3::operator==(const DirectionC3 &d) const { if (CGAL::identical(base, d.base)) @@ -115,7 +115,7 @@ DirectionC3::operator==(const DirectionC3 &d) const template < class R > inline -bool +typename R::Bool_type DirectionC3::operator!=(const DirectionC3 &d) const { return !(*this == d); diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h index 57e2320e455..dfeb86965c9 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h @@ -105,8 +105,8 @@ public: Construct_point_3()(max_hx/hw, max_hy/hw, max_hz/hw)); } - bool operator==(const Iso_cuboidC3& s) const; - bool operator!=(const Iso_cuboidC3& s) const; + typename R::Bool_type operator==(const Iso_cuboidC3& s) const; + typename R::Bool_type operator!=(const Iso_cuboidC3& s) const; const Point_3 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const { @@ -125,11 +125,11 @@ public: } Bounded_side bounded_side(const Point_3& p) const; - bool has_on(const Point_3& p) const; - bool has_on_boundary(const Point_3& p) const; - bool has_on_bounded_side(const Point_3& p) const; - bool has_on_unbounded_side(const Point_3& p) const; - bool is_degenerate() const; + typename R::Bool_type has_on(const Point_3& p) const; + typename R::Bool_type has_on_boundary(const Point_3& p) const; + typename R::Bool_type has_on_bounded_side(const Point_3& p) const; + typename R::Bool_type has_on_unbounded_side(const Point_3& p) const; + typename R::Bool_type is_degenerate() const; const FT & xmin() const; const FT & ymin() const; const FT & zmin() const; @@ -144,7 +144,7 @@ public: template < class R > CGAL_KERNEL_INLINE -bool +typename R::Bool_type Iso_cuboidC3::operator==(const Iso_cuboidC3& r) const { // FIXME : predicate if (CGAL::identical(base, r.base)) @@ -154,7 +154,7 @@ Iso_cuboidC3::operator==(const Iso_cuboidC3& r) const template < class R > inline -bool +typename R::Bool_type Iso_cuboidC3::operator!=(const Iso_cuboidC3& r) const { return !(*this == r); @@ -287,7 +287,7 @@ bounded_side(const typename Iso_cuboidC3::Point_3& p) const template < class R > inline -bool +typename R::Bool_type Iso_cuboidC3:: has_on_boundary(const typename Iso_cuboidC3::Point_3& p) const { @@ -296,7 +296,7 @@ has_on_boundary(const typename Iso_cuboidC3::Point_3& p) const template < class R > inline -bool +typename R::Bool_type Iso_cuboidC3:: has_on(const typename Iso_cuboidC3::Point_3& p) const { @@ -305,7 +305,7 @@ has_on(const typename Iso_cuboidC3::Point_3& p) const template < class R > inline -bool +typename R::Bool_type Iso_cuboidC3:: has_on_bounded_side(const typename Iso_cuboidC3::Point_3& p) const { @@ -314,7 +314,7 @@ has_on_bounded_side(const typename Iso_cuboidC3::Point_3& p) const template < class R > CGAL_KERNEL_INLINE -bool +typename R::Bool_type Iso_cuboidC3:: has_on_unbounded_side(const typename Iso_cuboidC3::Point_3& p) const @@ -324,7 +324,7 @@ has_on_unbounded_side(const typename Iso_cuboidC3::Point_3& p) template < class R > CGAL_KERNEL_INLINE -bool +typename R::Bool_type Iso_cuboidC3::is_degenerate() const { // FIXME : predicate return (this->min)().hx() == (this->max)().hx() diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h index 22eecbb3a47..9afa5aba9ac 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Line_2.h @@ -55,8 +55,8 @@ public: LineC2(const FT &a, const FT &b, const FT &c) : base(CGALi::make_array(a, b, c)) {} - bool operator==(const LineC2 &l) const; - bool operator!=(const LineC2 &l) const; + typename R_::Bool_type operator==(const LineC2 &l) const; + typename R_::Bool_type operator!=(const LineC2 &l) const; const FT & a() const { @@ -75,7 +75,7 @@ public: template < class R > CGAL_KERNEL_INLINE -bool +typename R::Bool_type LineC2::operator==(const LineC2 &l) const { if (CGAL::identical(base, l.base)) @@ -85,7 +85,7 @@ LineC2::operator==(const LineC2 &l) const template < class R > inline -bool +typename R::Bool_type LineC2::operator!=(const LineC2 &l) const { return ! (*this == l); diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h index 6fcd73e1ff8..292b049ac85 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Plane_3.h @@ -79,8 +79,8 @@ public: PlaneC3(const Ray_3 &r, const Point_3 &p) { *this = plane_from_points(r.start(), r.second_point(), p); } - bool operator==(const PlaneC3 &p) const; - bool operator!=(const PlaneC3 &p) const; + typename R::Bool_type operator==(const PlaneC3 &p) const; + typename R::Bool_type operator!=(const PlaneC3 &p) const; const FT & a() const { @@ -114,19 +114,19 @@ public: Point_2 to_2d(const Point_3 &p) const; Point_3 to_3d(const Point_2 &p) const; - Oriented_side oriented_side(const Point_3 &p) const; - bool has_on_positive_side(const Point_3 &l) const; - bool has_on_negative_side(const Point_3 &l) const; - bool has_on(const Point_3 &p) const + typename R::Oriented_side oriented_side(const Point_3 &p) const; + typename R::Bool_type has_on_positive_side(const Point_3 &l) const; + typename R::Bool_type has_on_negative_side(const Point_3 &l) const; + typename R::Bool_type has_on(const Point_3 &p) const { return oriented_side(p) == ON_ORIENTED_BOUNDARY; } - bool has_on(const Line_3 &l) const + typename R::Bool_type has_on(const Line_3 &l) const { return has_on(l.point()) && has_on(l.point() + l.direction().to_vector()); } - bool has_on(const Circle_3 &circle) const + typename R::Bool_type has_on(const Circle_3 &circle) const { if(circle.squared_radius() != FT(0)) { const Plane_3& p = circle.supporting_plane(); @@ -145,12 +145,12 @@ public: } else return has_on(circle.center()); } - bool is_degenerate() const; + typename R::Bool_type is_degenerate() const; }; template < class R > CGAL_KERNEL_INLINE -bool +typename R::Bool_type PlaneC3::operator==(const PlaneC3 &p) const { if (CGAL::identical(base, p.base)) @@ -160,7 +160,7 @@ PlaneC3::operator==(const PlaneC3 &p) const template < class R > inline -bool +typename R::Bool_type PlaneC3::operator!=(const PlaneC3 &p) const { return !(*this == p); @@ -268,7 +268,7 @@ PlaneC3::opposite() const template < class R > inline -Oriented_side +typename R::Oriented_side PlaneC3:: oriented_side(const typename PlaneC3::Point_3 &p) const { @@ -277,7 +277,7 @@ oriented_side(const typename PlaneC3::Point_3 &p) const template < class R > inline -bool +typename R::Bool_type PlaneC3:: has_on_positive_side(const typename PlaneC3::Point_3 &p) const { @@ -286,7 +286,7 @@ has_on_positive_side(const typename PlaneC3::Point_3 &p) const template < class R > inline -bool +typename R::Bool_type PlaneC3:: has_on_negative_side(const typename PlaneC3::Point_3 &p) const { @@ -295,7 +295,7 @@ has_on_negative_side(const typename PlaneC3::Point_3 &p) const template < class R > inline -bool +typename R::Bool_type PlaneC3:: is_degenerate() const { // FIXME : predicate diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Point_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Point_2.h index ef050900371..db6ffa87c04 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Point_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Point_2.h @@ -89,11 +89,11 @@ public: return base.cartesian_end(); } - bool operator==(const PointC2 &p) const + typename R_::Bool_type operator==(const PointC2 &p) const { return base == p.base; } - bool operator!=(const PointC2 &p) const + typename R_::Bool_type operator!=(const PointC2 &p) const { return !(*this == p); } diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h b/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h index c4c5eb51296..9b3626ba301 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Ray_2.h @@ -63,7 +63,7 @@ public: return get(base).e1; } - bool is_degenerate() const + typename R_::Bool_type is_degenerate() const { return source() == second_point(); } diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h index f5a68c291a5..9d41000278b 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Ray_3.h @@ -61,8 +61,8 @@ public: RayC3(const Point_3 &sp, const Line_3 &l) : base(sp, sp + l.to_vector()) {} - bool operator==(const RayC3 &r) const; - bool operator!=(const RayC3 &r) const; + typename R::Bool_type operator==(const RayC3 &r) const; + typename R::Bool_type operator!=(const RayC3 &r) const; const Point_3 & source() const { @@ -79,14 +79,14 @@ public: Line_3 supporting_line() const; Ray_3 opposite() const; - bool is_degenerate() const; - bool has_on(const Point_3 &p) const; - bool collinear_has_on(const Point_3 &p) const; + typename R::Bool_type is_degenerate() const; + typename R::Bool_type has_on(const Point_3 &p) const; + typename R::Bool_type collinear_has_on(const Point_3 &p) const; }; template < class R > inline -bool +typename R::Bool_type RayC3::operator==(const RayC3 &r) const { if (CGAL::identical(base, r.base)) @@ -96,7 +96,7 @@ RayC3::operator==(const RayC3 &r) const template < class R > inline -bool +typename R::Bool_type RayC3::operator!=(const RayC3 &r) const { return !(*this == r); @@ -146,7 +146,7 @@ RayC3::opposite() const } template < class R > -bool +typename R::Bool_type RayC3:: has_on(const typename RayC3::Point_3 &p) const { @@ -157,7 +157,7 @@ has_on(const typename RayC3::Point_3 &p) const template < class R > inline -bool +typename R::Bool_type RayC3::is_degenerate() const { return source() == second_point(); @@ -165,21 +165,21 @@ RayC3::is_degenerate() const template < class R > inline -bool +typename R::Bool_type RayC3:: collinear_has_on(const typename RayC3::Point_3 &p) const { CGAL_kernel_exactness_precondition( collinear(source(), p, second_point()) ); - Comparison_result cx = compare_x(source(), second_point()); + typename R::Comparison_result cx = compare_x(source(), second_point()); if (cx != EQUAL) return cx != compare_x(p, source()); - Comparison_result cy = compare_y(source(), second_point()); + typename R::Comparison_result cy = compare_y(source(), second_point()); if (cy != EQUAL) return cy != compare_y(p, source()); - Comparison_result cz = compare_z(source(), second_point()); + typename R::Comparison_result cz = compare_z(source(), second_point()); if (cz != EQUAL) return cz != compare_z(p, source()); diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h index e064617fe03..c079b14a033 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Sphere_3.h @@ -62,7 +62,7 @@ public: SphereC3(const Point_3 &p, const Point_3 &q, const Point_3 &r, const Point_3 &s) { - Orientation orient = CGAL::orientation(p, q, r, s); + Orientation orient = make_certain(CGAL::orientation(p, q, r, s)); Point_3 center = circumcenter(p, q, r, s); FT squared_radius = squared_distance(p, center); @@ -101,8 +101,8 @@ public: base = Rep(center, FT(0), o); } - bool operator==(const SphereC3 &) const; - bool operator!=(const SphereC3 &) const; + typename R::Bool_type operator==(const SphereC3 &) const; + typename R::Bool_type operator!=(const SphereC3 &) const; const Point_3 & center() const { @@ -120,30 +120,30 @@ public: } // A circle is degenerate if its (squared) radius is null or negative - bool is_degenerate() const; + typename R::Bool_type is_degenerate() const; // Returns a circle with opposite orientation Sphere_3 opposite() const; - Oriented_side oriented_side(const Point_3 &p) const; + typename R_::Oriented_side oriented_side(const Point_3 &p) const; //! precond: ! x.is_degenerate() (when available) // Returns R::ON_POSITIVE_SIDE, R::ON_ORIENTED_BOUNDARY or // R::ON_NEGATIVE_SIDE - bool has_on(const Circle_3 &p) const; - bool has_on_boundary(const Point_3 &p) const; - bool has_on_positive_side(const Point_3 &p) const; - bool has_on_negative_side(const Point_3 &p) const; + typename R::Bool_type has_on(const Circle_3 &p) const; + typename R::Bool_type has_on_boundary(const Point_3 &p) const; + typename R::Bool_type has_on_positive_side(const Point_3 &p) const; + typename R::Bool_type has_on_negative_side(const Point_3 &p) const; - Bounded_side bounded_side(const Point_3 &p) const; + typename R_::Bounded_side bounded_side(const Point_3 &p) const; //! precond: ! x.is_degenerate() (when available) // Returns R::ON_BOUNDED_SIDE, R::ON_BOUNDARY or R::ON_UNBOUNDED_SIDE - bool has_on_bounded_side(const Point_3 &p) const; - bool has_on_unbounded_side(const Point_3 &p) const; + typename R::Bool_type has_on_bounded_side(const Point_3 &p) const; + typename R::Bool_type has_on_unbounded_side(const Point_3 &p) const; }; template < class R > CGAL_KERNEL_INLINE -bool +typename R::Bool_type SphereC3::operator==(const SphereC3 &t) const { if (CGAL::identical(base, t.base)) @@ -155,7 +155,7 @@ SphereC3::operator==(const SphereC3 &t) const template < class R > inline -bool +typename R::Bool_type SphereC3::operator!=(const SphereC3 &t) const { return !(*this == t); @@ -163,28 +163,26 @@ SphereC3::operator!=(const SphereC3 &t) const template < class R > CGAL_KERNEL_MEDIUM_INLINE -Oriented_side +typename R::Oriented_side SphereC3:: oriented_side(const typename SphereC3::Point_3 &p) const { - return Oriented_side(bounded_side(p) * orientation()); + return enum_cast(bounded_side(p)) * orientation(); } template < class R > CGAL_KERNEL_INLINE -Bounded_side +typename R::Bounded_side SphereC3:: bounded_side(const typename SphereC3::Point_3 &p) const { - // FIXME: it's a predicate... - return Bounded_side((Comparison_result) - CGAL_NTS compare(squared_radius(), - squared_distance(center(),p))); + return enum_cast(compare(squared_radius(), + squared_distance(center(), p))); } template < class R > inline -bool +typename R::Bool_type SphereC3:: has_on(const typename SphereC3::Circle_3 &c) const { @@ -200,7 +198,7 @@ has_on(const typename SphereC3::Circle_3 &c) const template < class R > inline -bool +typename R::Bool_type SphereC3:: has_on_boundary(const typename SphereC3::Point_3 &p) const { @@ -213,7 +211,7 @@ has_on_boundary(const typename SphereC3::Point_3 &p) const template < class R > CGAL_KERNEL_INLINE -bool +typename R::Bool_type SphereC3:: has_on_negative_side(const typename SphereC3::Point_3 &p) const { @@ -226,7 +224,7 @@ has_on_negative_side(const typename SphereC3::Point_3 &p) const template < class R > CGAL_KERNEL_INLINE -bool +typename R::Bool_type SphereC3:: has_on_positive_side(const typename SphereC3::Point_3 &p) const { @@ -239,7 +237,7 @@ has_on_positive_side(const typename SphereC3::Point_3 &p) const template < class R > inline -bool +typename R::Bool_type SphereC3:: has_on_bounded_side(const typename SphereC3::Point_3 &p) const { @@ -251,7 +249,7 @@ has_on_bounded_side(const typename SphereC3::Point_3 &p) const template < class R > inline -bool +typename R::Bool_type SphereC3:: has_on_unbounded_side(const typename SphereC3::Point_3 &p) const { @@ -263,7 +261,7 @@ has_on_unbounded_side(const typename SphereC3::Point_3 &p) const template < class R > inline -bool +typename R::Bool_type SphereC3:: is_degenerate() const { diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h b/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h index 594a03dbce4..6321b89c5ce 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Tetrahedron_3.h @@ -56,24 +56,24 @@ public: const Point_3 & vertex(int i) const; const Point_3 & operator[](int i) const; - bool operator==(const TetrahedronC3 &t) const; - bool operator!=(const TetrahedronC3 &t) const; + typename R::Bool_type operator==(const TetrahedronC3 &t) const; + typename R::Bool_type operator!=(const TetrahedronC3 &t) const; - Orientation orientation() const; - Oriented_side oriented_side(const Point_3 &p) const; - Bounded_side bounded_side(const Point_3 &p) const; + typename R::Orientation orientation() const; + typename R::Oriented_side oriented_side(const Point_3 &p) const; + typename R::Bounded_side bounded_side(const Point_3 &p) const; - bool has_on_boundary(const Point_3 &p) const; - bool has_on_positive_side(const Point_3 &p) const; - bool has_on_negative_side(const Point_3 &p) const; - bool has_on_bounded_side(const Point_3 &p) const; - bool has_on_unbounded_side(const Point_3 &p) const; + typename R::Bool_type has_on_boundary(const Point_3 &p) const; + typename R::Bool_type has_on_positive_side(const Point_3 &p) const; + typename R::Bool_type has_on_negative_side(const Point_3 &p) const; + typename R::Bool_type has_on_bounded_side(const Point_3 &p) const; + typename R::Bool_type has_on_unbounded_side(const Point_3 &p) const; - bool is_degenerate() const; + typename R::Bool_type is_degenerate() const; }; template < class R > -bool +typename R::Bool_type TetrahedronC3:: operator==(const TetrahedronC3 &t) const { @@ -101,7 +101,7 @@ operator==(const TetrahedronC3 &t) const template < class R > inline -bool +typename R::Bool_type TetrahedronC3:: operator!=(const TetrahedronC3 &t) const { @@ -134,7 +134,7 @@ operator[](int i) const } template < class R > -Orientation +typename R::Orientation TetrahedronC3:: orientation() const { @@ -143,20 +143,20 @@ orientation() const } template < class R > -Oriented_side +typename R::Oriented_side TetrahedronC3:: oriented_side(const typename TetrahedronC3::Point_3 &p) const { - Orientation o = orientation(); + typename R::Orientation o = orientation(); if (o != ZERO) - return Oriented_side(o * bounded_side(p)); + return enum_cast(bounded_side(p)) * o; CGAL_kernel_assertion (!is_degenerate()); return ON_ORIENTED_BOUNDARY; } template < class R > -Bounded_side +typename R::Bounded_side TetrahedronC3:: bounded_side(const typename TetrahedronC3::Point_3 &p) const { @@ -166,7 +166,7 @@ bounded_side(const typename TetrahedronC3::Point_3 &p) const template < class R > inline -bool +typename R::Bool_type TetrahedronC3::has_on_boundary (const typename TetrahedronC3::Point_3 &p) const { @@ -175,7 +175,7 @@ TetrahedronC3::has_on_boundary template < class R > inline -bool +typename R::Bool_type TetrahedronC3::has_on_positive_side (const typename TetrahedronC3::Point_3 &p) const { @@ -184,7 +184,7 @@ TetrahedronC3::has_on_positive_side template < class R > inline -bool +typename R::Bool_type TetrahedronC3::has_on_negative_side (const typename TetrahedronC3::Point_3 &p) const { @@ -193,7 +193,7 @@ TetrahedronC3::has_on_negative_side template < class R > inline -bool +typename R::Bool_type TetrahedronC3::has_on_bounded_side (const typename TetrahedronC3::Point_3 &p) const { @@ -202,7 +202,7 @@ TetrahedronC3::has_on_bounded_side template < class R > inline -bool +typename R::Bool_type TetrahedronC3::has_on_unbounded_side (const typename TetrahedronC3::Point_3 &p) const { @@ -211,7 +211,7 @@ TetrahedronC3::has_on_unbounded_side template < class R > inline -bool +typename R::Bool_type TetrahedronC3::is_degenerate() const { return orientation() == COPLANAR; diff --git a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h index 5a8f7e8729c..cdf882c03ad 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h @@ -337,13 +337,13 @@ namespace CartesianKernelFunctors { { const Point_2 & source = r.source(); const Point_2 & second = r.second_point(); - switch(compare_x(source, second)) { + switch(make_certain(compare_x(source, second))) { case SMALLER: return compare_x(source, p) != LARGER; case LARGER: return compare_x(p, source) != LARGER; default: - switch(compare_y(source, second)){ + switch(make_certain(compare_y(source, second))){ case SMALLER: return compare_y(source, p) != LARGER; case LARGER: @@ -3996,7 +3996,7 @@ namespace CartesianKernelFunctors { result_type operator()( const Circle_2& c, const Point_2& p) const - { return Oriented_side(c.bounded_side(p) * c.orientation()); } + { return enum_cast(c.bounded_side(p)) * c.orientation(); } result_type operator()( const Line_2& l, const Point_2& p) const diff --git a/Cartesian_kernel/include/CGAL/Cartesian/predicates_on_directions_2.h b/Cartesian_kernel/include/CGAL/Cartesian/predicates_on_directions_2.h index fe3c5e7f0b2..98e40e3ed75 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/predicates_on_directions_2.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/predicates_on_directions_2.h @@ -28,7 +28,7 @@ CGAL_BEGIN_NAMESPACE template < class K > inline -bool +typename K::Bool_type equal_direction(const DirectionC2 &d1, const DirectionC2 &d2) { @@ -37,7 +37,7 @@ equal_direction(const DirectionC2 &d1, template < class K > inline -Comparison_result +typename K::Comparison_result compare_angle_with_x_axis(const DirectionC2 &d1, const DirectionC2 &d2) { diff --git a/Cartesian_kernel/include/CGAL/Cartesian/predicates_on_planes_3.h b/Cartesian_kernel/include/CGAL/Cartesian/predicates_on_planes_3.h index bd177b8baac..fc0c8683e42 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/predicates_on_planes_3.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/predicates_on_planes_3.h @@ -30,7 +30,7 @@ CGAL_BEGIN_NAMESPACE template < class K > inline -Oriented_side +typename K::Oriented_side side_of_oriented_plane(const PlaneC3 &h, const PointC3 &p) { @@ -40,7 +40,7 @@ side_of_oriented_plane(const PlaneC3 &h, template < class K > inline -bool +typename K::Bool_type equal_plane(const PlaneC3 &h, const PlaneC3 &p) { return equal_planeC3(h.a(), h.b(), h.c(), h.d(), diff --git a/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h b/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h index de7e013f173..f17c69f3af0 100644 --- a/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h +++ b/Cartesian_kernel/include/CGAL/predicates/kernel_ftC2.h @@ -310,7 +310,7 @@ compare_slopesC2(const FT &l1a, const FT &l1b, const FT &l2a, const FT &l2b) if (l1_sign < l2_sign) return SMALLER; if (l1_sign > l2_sign) return LARGER; - if (l1_sign > 0) + if (l1_sign > ZERO) return CGAL_NTS compare ( CGAL_NTS abs(l1a * l2b), CGAL_NTS abs(l2a * l1b) ); @@ -362,7 +362,7 @@ compare_slopesC2(const FT &s1_src_x, const FT &s1_src_y, const FT &s1_tgt_x, if (s1_sign < s2_sign) return SMALLER; if (s1_sign > s2_sign) return LARGER; - if (s1_sign > 0) + if (s1_sign > ZERO) return CGAL_NTS compare( CGAL_NTS abs(s1_ydiff * s2_xdiff), CGAL_NTS abs(s2_ydiff * s1_xdiff)); diff --git a/Filtered_kernel/include/CGAL/Filtered_predicate.h b/Filtered_kernel/include/CGAL/Filtered_predicate.h index a797fb7c925..6e41d5bef9d 100644 --- a/Filtered_kernel/include/CGAL/Filtered_predicate.h +++ b/Filtered_kernel/include/CGAL/Filtered_predicate.h @@ -157,8 +157,8 @@ Filtered_predicate:: CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Ares res = ap(c2a(args)...); - if (! is_indeterminate(res)) - return res; + if (is_singleton(res)) + return extract_singleton(res); } catch (Interval_nt_advanced::unsafe_comparison) {} CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); @@ -179,8 +179,8 @@ Filtered_predicate:: CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Ares res = ap(c2a(a1)); - if (! is_indeterminate(res)) - return res; + if (is_singleton(res)) + return extract_singleton(res); } catch (Interval_nt_advanced::unsafe_comparison) {} CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); @@ -199,8 +199,8 @@ Filtered_predicate:: CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Ares res = ap(c2a(a1), c2a(a2)); - if (! is_indeterminate(res)) - return res; + if (is_singleton(res)) + return extract_singleton(res); } catch (Interval_nt_advanced::unsafe_comparison) {} CGAL_PROFILER(std::string("failures of : ")+ std::string(CGAL_PRETTY_FUNCTION)); @@ -219,8 +219,8 @@ Filtered_predicate:: CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Ares res = ap(c2a(a1), c2a(a2), c2a(a3)); - if (! is_indeterminate(res)) - return res; + if (is_singleton(res)) + return extract_singleton(res); } catch (Interval_nt_advanced::unsafe_comparison) {} CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); @@ -239,8 +239,8 @@ Filtered_predicate:: CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4)); - if (! is_indeterminate(res)) - return res; + if (is_singleton(res)) + return extract_singleton(res); } catch (Interval_nt_advanced::unsafe_comparison) {} CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); @@ -260,8 +260,8 @@ Filtered_predicate:: CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5)); - if (! is_indeterminate(res)) - return res; + if (is_singleton(res)) + return extract_singleton(res); } catch (Interval_nt_advanced::unsafe_comparison) {} CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); @@ -281,8 +281,8 @@ Filtered_predicate:: CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Protect_FPU_rounding P; Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5), c2a(a6)); - if (! is_indeterminate(res)) - return res; + if (is_singleton(res)) + return extract_singleton(res); } catch (Interval_nt_advanced::unsafe_comparison) {} CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); @@ -304,8 +304,8 @@ Filtered_predicate:: Protect_FPU_rounding P; Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5), c2a(a6), c2a(a7)); - if (! is_indeterminate(res)) - return res; + if (is_singleton(res)) + return extract_singleton(res); } catch (Interval_nt_advanced::unsafe_comparison) {} CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); @@ -327,8 +327,8 @@ Filtered_predicate:: Protect_FPU_rounding P; Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5), c2a(a6), c2a(a7), c2a(a8)); - if (! is_indeterminate(res)) - return res; + if (is_singleton(res)) + return extract_singleton(res); } catch (Interval_nt_advanced::unsafe_comparison) {} CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); @@ -352,8 +352,8 @@ Filtered_predicate:: Protect_FPU_rounding P; Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5), c2a(a6), c2a(a7), c2a(a8), c2a(a9)); - if (! is_indeterminate(res)) - return res; + if (is_singleton(res)) + return extract_singleton(res); } catch (Interval_nt_advanced::unsafe_comparison) {} CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); @@ -377,8 +377,8 @@ Filtered_predicate:: Protect_FPU_rounding P; Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5), c2a(a6), c2a(a7), c2a(a8), c2a(a9), c2a(a10)); - if (! is_indeterminate(res)) - return res; + if (is_singleton(res)) + return extract_singleton(res); } catch (Interval_nt_advanced::unsafe_comparison) {} CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); diff --git a/Filtered_kernel/include/CGAL/Lazy_kernel.h b/Filtered_kernel/include/CGAL/Lazy_kernel.h index cf8e1c734b1..5719b9a4440 100644 --- a/Filtered_kernel/include/CGAL/Lazy_kernel.h +++ b/Filtered_kernel/include/CGAL/Lazy_kernel.h @@ -80,6 +80,22 @@ public: typedef CGAL::Lazy_exact_nt FT; typedef FT RT; + // FIXME : Document these typedefs ! + typedef typename Same_uncertainty_nt::type + Bool_type; + typedef typename Same_uncertainty_nt::type + Sign; + typedef typename Same_uncertainty_nt::type + Comparison_result; + typedef typename Same_uncertainty_nt::type + Orientation; + typedef typename Same_uncertainty_nt::type + Oriented_side; + typedef typename Same_uncertainty_nt::type + Bounded_side; + typedef typename Same_uncertainty_nt::type + Angle; + typedef CGAL::Object Object_2; typedef CGAL::Object Object_3; diff --git a/Filtered_kernel/include/CGAL/Uncertain.h b/Filtered_kernel/include/CGAL/Uncertain.h index 3316f4b0cf1..29fd4fb03dc 100644 --- a/Filtered_kernel/include/CGAL/Uncertain.h +++ b/Filtered_kernel/include/CGAL/Uncertain.h @@ -107,18 +107,39 @@ public: T inf() const { return _i; } T sup() const { return _s; } - // NB : conversion to bool might be too risky - // (boost::tribool uses something else). - operator T() const + bool is_singleton() const { return _i == _s; } + + T make_certain() const { - if (_i == _s) + if (is_singleton()) return _i; - //++failures; - ++Uncertain::number_of_failures(); // reasonnable ? + ++Uncertain::number_of_failures(); throw Uncertain_conversion_exception( "undecidable conversion of CGAL::Uncertain"); } +#if 1 // Comment out in order to spot some unwanted conversions. + // NB : the general conversion to bool might be too risky. + // boost::tribool uses a more restricted conversion (see below). + operator T() const + { + return make_certain(); + } +#else +private: + struct dummy { + void nonnull() {}; + }; + + typedef void (dummy::*safe_bool)(); + +public: + operator safe_bool() const + { + return make_certain() ? &dummy::nonnull : 0; + } +#endif + static unsigned & number_of_failures() { return failures; } static Uncertain indeterminate(); @@ -148,9 +169,33 @@ T sup(Uncertain i) } +// possibly() declarations (needed as used in the assertions) +// ---------------------------------------------------------- + +inline bool possibly(bool b); + +inline +bool possibly(Uncertain c); + + // Basic functions // --------------- +template < typename T > +inline +bool is_singleton(Uncertain a) +{ + return a.is_singleton(); +} + +template < typename T > +inline +T extract_singleton(Uncertain a) +{ + CGAL_assertion(is_singleton(a)); + return a.inf(); +} + template < typename T > inline Uncertain @@ -170,14 +215,30 @@ template < typename T > inline bool is_indeterminate(Uncertain a) { - return a.inf() != a.sup(); + return ! a.is_singleton(); } -template < typename T > + +// certainly/possibly +// ------------------ + +inline bool certainly(bool b) { return b; } +inline bool possibly(bool b) { return b; } + inline -bool is_singleton(Uncertain a) +bool certainly(Uncertain c) { - return a.inf() == a.sup(); + if (is_singleton(c)) + return extract_singleton(c); + return false; +} + +inline +bool possibly(Uncertain c) +{ + if (is_singleton(c)) + return extract_singleton(c); + return true; } @@ -394,6 +455,26 @@ Uncertain make_uncertain(Uncertain t) } +// make_certain() : Forcing a cast to certain (possibly throwing). +// This is meant to be used only in cases where we cannot easily propagate the +// uncertainty, such as when used in a switch statement (code may later be +// revisited to do things in a better way). + +template < typename T > +inline +T make_certain(T t) +{ + return t; +} + +template < typename T > +inline +T make_certain(Uncertain t) +{ + return t.make_certain(); +} + + // opposite template < typename T > // should be constrained only for enums. inline @@ -404,7 +485,6 @@ Uncertain operator-(Uncertain u) // "sign" multiplication. // Should be constrained only for "sign" enums, useless for bool. -// Well, Uncertain<> should probably be split into Uncertain_bool (std::bool_set) and Uncertain_enum<>. template < typename T > Uncertain operator*(Uncertain a, Uncertain b) { @@ -451,6 +531,20 @@ Uncertain operator*(Uncertain a, Uncertain b) } } +template < typename T > +inline +Uncertain operator*(T a, Uncertain b) +{ + return Uncertain(a) * b; +} + +template < typename T > +inline +Uncertain operator*(Uncertain a, T b) +{ + return a * Uncertain(b); +} + // enum_cast overload #ifdef CGAL_CFG_MATCHING_BUG_5 @@ -474,28 +568,6 @@ Uncertain enum_cast(Uncertain u) #endif - -// Additional goodies - -inline bool certainly(bool b) { return b; } -inline bool possibly(bool b) { return b; } - -inline -bool certainly(Uncertain c) -{ - if (is_indeterminate(c)) - return false; - else return static_cast(c); -} - -inline -bool possibly(Uncertain c) -{ - if (is_indeterminate(c)) - return true; - else return static_cast(c); -} - CGAL_END_NAMESPACE #endif // CGAL_UNCERTAIN_H diff --git a/Intersections_2/include/CGAL/Segment_2_Segment_2_intersection.h b/Intersections_2/include/CGAL/Segment_2_Segment_2_intersection.h index 751d0af452b..727bec60d72 100644 --- a/Intersections_2/include/CGAL/Segment_2_Segment_2_intersection.h +++ b/Intersections_2/include/CGAL/Segment_2_Segment_2_intersection.h @@ -33,6 +33,7 @@ #include #include #include +#include CGAL_BEGIN_NAMESPACE @@ -75,7 +76,7 @@ bool seg_seg_do_intersect_crossing( const typename K::Point_2 &p3, const typename K::Point_2 &p4, const K& k) { - switch (k.orientation_2_object()(p1,p2,p3)) { + switch (make_certain(k.orientation_2_object()(p1,p2,p3))) { case LEFT_TURN: return ! (k.orientation_2_object()(p3,p4,p2) == RIGHT_TURN); // right_turn(p3,p4,p2); case RIGHT_TURN: @@ -94,7 +95,7 @@ bool seg_seg_do_intersect_contained( const typename K::Point_2 &p3, const typename K::Point_2 &p4, const K& k) { - switch (k.orientation_2_object()(p1,p2,p3)) { + switch (make_certain(k.orientation_2_object()(p1,p2,p3))) { case LEFT_TURN: return ! (k.orientation_2_object()(p1,p2,p4) == LEFT_TURN); // left_turn(p1,p2,p4); case RIGHT_TURN: @@ -143,15 +144,15 @@ do_intersect(const typename K::Segment_2 &seg1, } if (less_xy(A1,A2)) { if (less_xy(B1,B2)) { - switch(compare_xy(A1,B1)) { + switch(make_certain(compare_xy(A1,B1))) { case SMALLER: - switch(compare_xy(A2,B1)) { + switch(make_certain(compare_xy(A2,B1))) { case SMALLER: return false; case EQUAL: return true; case LARGER: - switch(compare_xy(A2,B2)) { + switch(make_certain(compare_xy(A2,B2))) { case SMALLER: return seg_seg_do_intersect_crossing(A1,A2,B1,B2, k); case EQUAL: @@ -163,13 +164,13 @@ do_intersect(const typename K::Segment_2 &seg1, case EQUAL: return true; case LARGER: - switch(compare_xy(B2,A1)) { + switch(make_certain(compare_xy(B2,A1))) { case SMALLER: return false; case EQUAL: return true; case LARGER: - switch(compare_xy(B2,A2)) { + switch(make_certain(compare_xy(B2,A2))) { case SMALLER: return seg_seg_do_intersect_crossing(B1,B2,A1,A2, k); case EQUAL: @@ -180,15 +181,15 @@ do_intersect(const typename K::Segment_2 &seg1, } } } else { - switch(compare_xy(A1,B2)) { + switch(make_certain(compare_xy(A1,B2))) { case SMALLER: - switch(compare_xy(A2,B2)) { + switch(make_certain(compare_xy(A2,B2))) { case SMALLER: return false; case EQUAL: return true; case LARGER: - switch(compare_xy(A2,B1)) { + switch(make_certain(compare_xy(A2,B1))) { case SMALLER: return seg_seg_do_intersect_crossing(A1,A2,B2,B1, k); case EQUAL: @@ -200,13 +201,13 @@ do_intersect(const typename K::Segment_2 &seg1, case EQUAL: return true; case LARGER: - switch(compare_xy(B1,A1)) { + switch(make_certain(compare_xy(B1,A1))) { case SMALLER: return false; case EQUAL: return true; case LARGER: - switch(compare_xy(B1,A2)) { + switch(make_certain(compare_xy(B1,A2))) { case SMALLER: return seg_seg_do_intersect_crossing(B2,B1,A1,A2, k); case EQUAL: @@ -219,15 +220,15 @@ do_intersect(const typename K::Segment_2 &seg1, } } else { if (less_xy(B1,B2)) { - switch(compare_xy(A2,B1)) { + switch(make_certain(compare_xy(A2,B1))) { case SMALLER: - switch(compare_xy(A1,B1)) { + switch(make_certain(compare_xy(A1,B1))) { case SMALLER: return false; case EQUAL: return true; case LARGER: - switch(compare_xy(A1,B2)) { + switch(make_certain(compare_xy(A1,B2))) { case SMALLER: return seg_seg_do_intersect_crossing(A2,A1,B1,B2, k); case EQUAL: @@ -239,13 +240,13 @@ do_intersect(const typename K::Segment_2 &seg1, case EQUAL: return true; case LARGER: - switch(compare_xy(B2,A2)) { + switch(make_certain(compare_xy(B2,A2))) { case SMALLER: return false; case EQUAL: return true; case LARGER: - switch(compare_xy(B2,A1)) { + switch(make_certain(compare_xy(B2,A1))) { case SMALLER: return seg_seg_do_intersect_crossing(B1,B2,A2,A1, k); case EQUAL: @@ -256,15 +257,15 @@ do_intersect(const typename K::Segment_2 &seg1, } } } else { - switch(compare_xy(A2,B2)) { + switch(make_certain(compare_xy(A2,B2))) { case SMALLER: - switch(compare_xy(A1,B2)) { + switch(make_certain(compare_xy(A1,B2))) { case SMALLER: return false; case EQUAL: return true; case LARGER: - switch(compare_xy(A1,B1)) { + switch(make_certain(compare_xy(A1,B1))) { case SMALLER: return seg_seg_do_intersect_crossing(A2,A1,B2,B1, k); case EQUAL: @@ -276,13 +277,13 @@ do_intersect(const typename K::Segment_2 &seg1, case EQUAL: return true; case LARGER: - switch(compare_xy(B1,A2)) { + switch(make_certain(compare_xy(B1,A2))) { case SMALLER: return false; case EQUAL: return true; case LARGER: - switch(compare_xy(B1,A1)) { + switch(make_certain(compare_xy(B1,A1))) { case SMALLER: return seg_seg_do_intersect_crossing(B2,B1,A2,A1, k); case EQUAL: diff --git a/Intersections_3/include/CGAL/Triangle_3_Tetrahedron_3_do_intersect.h b/Intersections_3/include/CGAL/Triangle_3_Tetrahedron_3_do_intersect.h index b186a0572d4..f77a9677af9 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Tetrahedron_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Triangle_3_Tetrahedron_3_do_intersect.h @@ -32,9 +32,10 @@ namespace CGALi { // This code is not optimized: template -bool do_intersect(const typename K::Triangle_3 &tr, - const typename K::Tetrahedron_3 &tet, - const K & k) +typename K::Bool_type +do_intersect(const typename K::Triangle_3 &tr, + const typename K::Tetrahedron_3 &tet, + const K & k) { typedef typename K::Triangle_3 Triangle; typedef typename K::Point_3 Point; @@ -58,9 +59,10 @@ bool do_intersect(const typename K::Triangle_3 &tr, template inline -bool do_intersect(const typename K::Tetrahedron_3 &tet, - const typename K::Triangle_3 &tr, - const K & k) +typename K::Bool_type +do_intersect(const typename K::Tetrahedron_3 &tet, + const typename K::Triangle_3 &tr, + const K & k) { return do_intersect(tr, tet, k); } diff --git a/Intersections_3/include/CGAL/Triangle_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/Triangle_3_Triangle_3_do_intersect.h index 31229495514..56bda724722 100644 --- a/Intersections_3/include/CGAL/Triangle_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/Triangle_3_Triangle_3_do_intersect.h @@ -21,6 +21,8 @@ #ifndef CGAL_TRIANGLE_3_TRIANGLE_3_DO_INTERSECT_H #define CGAL_TRIANGLE_3_TRIANGLE_3_DO_INTERSECT_H +#include + CGAL_BEGIN_NAMESPACE namespace CGALi { @@ -192,11 +194,11 @@ bool do_intersect_coplanar(const typename K::Triangle_3 &t1, template -bool do_intersect(const typename K::Triangle_3 &t1, - const typename K::Triangle_3 &t2, - const K & k) +typename K::Bool_type +do_intersect(const typename K::Triangle_3 &t1, + const typename K::Triangle_3 &t2, + const K & k) { - CGAL_kernel_precondition( ! k.is_degenerate_3_object() (t1) ); CGAL_kernel_precondition( ! k.is_degenerate_3_object() (t2) ); @@ -223,9 +225,9 @@ bool do_intersect(const typename K::Triangle_3 &t1, const Point_3 * t_max1; // Compute distance signs of p, q and r to the plane of triangle(a,b,c) - const Orientation dp = orientation(a,b,c,p); - const Orientation dq = orientation(a,b,c,q); - const Orientation dr = orientation(a,b,c,r); + const Orientation dp = make_certain(orientation(a,b,c,p)); + const Orientation dq = make_certain(orientation(a,b,c,q)); + const Orientation dr = make_certain(orientation(a,b,c,r)); switch ( dp ) { @@ -332,9 +334,9 @@ bool do_intersect(const typename K::Triangle_3 &t1, const Point_3 * t_max2; // Compute distance signs of a, b and c to the plane of triangle(p,q,r) - const Orientation da = orientation(p,q,r,a); - const Orientation db = orientation(p,q,r,b); - const Orientation dc = orientation(p,q,r,c); + const Orientation da = make_certain(orientation(p,q,r,a)); + const Orientation db = make_certain(orientation(p,q,r,b)); + const Orientation dc = make_certain(orientation(p,q,r,c)); switch ( da ) { @@ -444,8 +446,9 @@ bool do_intersect(const typename K::Triangle_3 &t1, template -inline bool do_intersect(const Triangle_3 &t1, - const Triangle_3 &t2) +inline typename K::Bool_type +do_intersect(const Triangle_3 &t1, + const Triangle_3 &t2) { return typename K::Do_intersect_3()(t1,t2); } diff --git a/Kernel_23/include/CGAL/Circle_2.h b/Kernel_23/include/CGAL/Circle_2.h index ca86117544b..88c31c1a9ee 100644 --- a/Kernel_23/include/CGAL/Circle_2.h +++ b/Kernel_23/include/CGAL/Circle_2.h @@ -38,7 +38,7 @@ class Circle_2 : public R_::Kernel_base::Circle_2 { typedef typename R_::FT FT; typedef typename R_::Point_2 Point_2; - typedef typename R_::Kernel_base::Circle_2 RCircle_2; + typedef typename R_::Kernel_base::Circle_2 RCircle_2; typedef typename R_::Aff_transformation_2 Aff_transformation_2; typedef Circle_2 Self; @@ -108,41 +108,43 @@ public: Orientation orientation() const { - return R().orientation_2_object()(*this); + // This make_certain(), the uncertain orientation of circles, the orientation + // of circles, are all yucky. + return make_certain(R().orientation_2_object()(*this)); } - Bounded_side + typename R::Bounded_side bounded_side(const Point_2 &p) const { return R().bounded_side_2_object()(*this, p); } - Oriented_side + typename R::Oriented_side oriented_side(const Point_2 &p) const { return R().oriented_side_2_object()(*this, p); } - bool + typename R::Bool_type has_on_boundary(const Point_2 &p) const { return bounded_side(p) == ON_BOUNDARY; } - bool + typename R::Bool_type has_on_bounded_side(const Point_2 &p) const { return bounded_side(p) == ON_BOUNDED_SIDE; } - bool + typename R::Bool_type has_on_unbounded_side(const Point_2 &p) const { return bounded_side(p) == ON_UNBOUNDED_SIDE; } - bool + typename R::Bool_type has_on_negative_side(const Point_2 &p) const { if (orientation() == COUNTERCLOCKWISE) @@ -150,7 +152,7 @@ public: return has_on_bounded_side(p); } - bool + typename R::Bool_type has_on_positive_side(const Point_2 &p) const { if (orientation() == COUNTERCLOCKWISE) @@ -158,7 +160,7 @@ public: return has_on_unbounded_side(p); } - bool + typename R::Bool_type is_degenerate() const { return CGAL_NTS is_zero(squared_radius()); @@ -179,13 +181,13 @@ public: return R().construct_bbox_2_object()(*this); } - bool + typename R::Bool_type operator==(const Circle_2 &c) const { return R().equal_2_object()(*this, c); } - bool + typename R::Bool_type operator!=(const Circle_2 &c) const { return !(*this == c); diff --git a/Kernel_23/include/CGAL/Direction_2.h b/Kernel_23/include/CGAL/Direction_2.h index a864d445ab3..c41a45eaa75 100644 --- a/Kernel_23/include/CGAL/Direction_2.h +++ b/Kernel_23/include/CGAL/Direction_2.h @@ -85,7 +85,7 @@ public: Direction_2(const RT &x, const RT &y) : RDirection_2(typename R::Construct_direction_2()(Return_base_tag(), x,y)) {} - bool + typename R::Bool_type counterclockwise_in_between(const Direction_2 &d1, const Direction_2 &d2) const { @@ -116,28 +116,28 @@ public: return (i==0) ? dx() : dy(); } - bool + typename R::Bool_type operator<(const Direction_2 &d) const { return R().compare_angle_with_x_axis_2_object()(*this, d) == SMALLER; } - bool + typename R::Bool_type operator>(const Direction_2 &d) const { return d < *this; } - bool + typename R::Bool_type operator>=(const Direction_2 &d) const { return R().compare_angle_with_x_axis_2_object()(*this, d) != SMALLER; } - bool + typename R::Bool_type operator<=(const Direction_2 &d) const { return R().compare_angle_with_x_axis_2_object()(*this, d) != LARGER; @@ -159,13 +159,13 @@ public: return this->vector(); } - bool + typename R::Bool_type operator==(const Direction_2& d) const { return R().equal_2_object()(*this, d); } - bool + typename R::Bool_type operator!=(const Direction_2& d) const { return !(*this == d); diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index e669d50c9ca..4774e6a9b34 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -673,7 +673,7 @@ namespace CommonKernelFunctors { typename K::Orientation_2 orientation; typename K::Compute_squared_distance_2 squared_distance; typename K::Construct_circumcenter_2 circumcenter; - Orientation orient = orientation(p, q, r); + typename K::Orientation orient = orientation(p, q, r); CGAL_kernel_precondition( orient != COLLINEAR); Point_2 center = circumcenter(p, q, r); @@ -2667,7 +2667,7 @@ namespace CommonKernelFunctors { result_type operator()(const Point_2& r, const Point_2& p, const Point_2& q) const { - Orientation ori = o(r, p, q); + typename K::Orientation ori = o(r, p, q); if ( ori == LEFT_TURN ) return true; else if ( ori == RIGHT_TURN ) diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_2.h b/Kernel_23/include/CGAL/Kernel/global_functions_2.h index b036d269300..6751fd58052 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_2.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_2.h @@ -36,14 +36,14 @@ CGAL_BEGIN_NAMESPACE template < class K > -bool +typename K::Bool_type operator==(const Point_2 &p, const Origin& o) { return p == Point_2(o); } template < class K > -bool +typename K::Bool_type operator!=(const Point_2 &p, const Origin& o) { return p != Point_2(o); @@ -61,7 +61,7 @@ angle(const Point_2 &p, template < class K > inline -bool +typename K::Bool_type are_ordered_along_line(const Point_2 &p, const Point_2 &q, const Point_2 &r) @@ -71,7 +71,7 @@ are_ordered_along_line(const Point_2 &p, template < class K > inline -bool +typename K::Bool_type are_strictly_ordered_along_line(const Point_2 &p, const Point_2 &q, const Point_2 &r) @@ -221,7 +221,7 @@ circumcenter(const Triangle_2 &t) template < class K > inline -bool +typename K::Bool_type collinear(const Point_2 &p, const Point_2 &q, const Point_2 &r) { return CGALi::collinear(p, q, r, K()); @@ -229,7 +229,7 @@ collinear(const Point_2 &p, const Point_2 &q, const Point_2 &r) template < class K > inline -bool +typename K::Bool_type collinear_are_ordered_along_line(const Point_2 &p, const Point_2 &q, const Point_2 &r) @@ -239,7 +239,7 @@ collinear_are_ordered_along_line(const Point_2 &p, template < class K > inline -bool +typename K::Bool_type collinear_are_strictly_ordered_along_line(const Point_2 &p, const Point_2 &q, const Point_2 &r) @@ -249,7 +249,7 @@ collinear_are_strictly_ordered_along_line(const Point_2 &p, template < typename K > inline -Comparison_result +typename K::Comparison_result compare_angle_with_x_axis(const Direction_2& d1, const Direction_2& d2) { @@ -258,7 +258,7 @@ compare_angle_with_x_axis(const Direction_2& d1, template inline -Comparison_result +typename K::Comparison_result compare_distance_to_point(const Point_2& p, const Point_2& q, const Point_2& r) @@ -268,7 +268,7 @@ compare_distance_to_point(const Point_2& p, template inline -Comparison_result +typename K::Comparison_result compare_squared_distance(const Point_2& p, const Point_2& q, const typename K::FT& d2) @@ -278,7 +278,7 @@ compare_squared_distance(const Point_2& p, template inline -Comparison_result +typename K::Comparison_result compare_signed_distance_to_line(const Point_2& p, const Point_2& q, const Point_2& r, @@ -289,7 +289,7 @@ compare_signed_distance_to_line(const Point_2& p, template inline -Comparison_result +typename K::Comparison_result compare_signed_distance_to_line(const Line_2& l, const Point_2& p, const Point_2& q) @@ -300,7 +300,7 @@ compare_signed_distance_to_line(const Line_2& l, /* FIXME : Undocumented, obsolete... template < class K > inline -Comparison_result +typename K::Comparison_result compare_lexicographically_xy(const Point_2 &p, const Point_2 &q) { @@ -310,7 +310,7 @@ compare_lexicographically_xy(const Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_slopes(const Line_2 &l1, const Line_2 &l2) { return CGALi::compare_slopes(l1, l2, K()); @@ -318,7 +318,7 @@ compare_slopes(const Line_2 &l1, const Line_2 &l2) template < class K > inline -Comparison_result +typename K::Comparison_result compare_slopes(const Segment_2 &s1, const Segment_2 &s2) { return CGALi::compare_slopes(s1, s2, K()); @@ -326,7 +326,7 @@ compare_slopes(const Segment_2 &s1, const Segment_2 &s2) template < class K > inline -Comparison_result +typename K::Comparison_result compare_x(const Point_2 &p, const Point_2 &q) { return CGALi::compare_x(p, q, K()); @@ -334,7 +334,7 @@ compare_x(const Point_2 &p, const Point_2 &q) template < class K > inline -Comparison_result +typename K::Comparison_result compare_x(const Point_2& p, const Line_2& l1, const Line_2& l2) @@ -344,7 +344,7 @@ compare_x(const Point_2& p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x(const Line_2 &l, const Line_2 &h1, const Line_2 &h2) @@ -354,7 +354,7 @@ compare_x(const Line_2 &l, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x(const Line_2 &l1, const Line_2 &h1, const Line_2 &l2, @@ -365,7 +365,7 @@ compare_x(const Line_2 &l1, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x_at_y(const Point_2& p, const Line_2& h) { return CGALi::compare_x_at_y(p, h, K()); @@ -374,7 +374,7 @@ compare_x_at_y(const Point_2& p, const Line_2& h) /* Undocumented template < class K > inline -Comparison_result +typename K::Comparison_result compare_x_at_y(const Point_2& p, const Segment_2& s) { return CGALi::compare_x_at_y(p, s, K()); @@ -383,7 +383,7 @@ compare_x_at_y(const Point_2& p, const Segment_2& s) template < class K > inline -Comparison_result +typename K::Comparison_result compare_x_at_y(const Point_2 &p, const Line_2 &h1, const Line_2 &h2) @@ -393,7 +393,7 @@ compare_x_at_y(const Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x_at_y(const Line_2 &l1, const Line_2 &l2, const Line_2 &h) @@ -403,7 +403,7 @@ compare_x_at_y(const Line_2 &l1, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x_at_y(const Line_2 &l1, const Line_2 &l2, const Line_2 &h1, @@ -414,7 +414,7 @@ compare_x_at_y(const Line_2 &l1, template < class K > inline -Comparison_result +typename K::Comparison_result compare_xy(const Point_2 &p, const Point_2 &q) { return CGALi::compare_xy(p, q, K()); @@ -422,7 +422,7 @@ compare_xy(const Point_2 &p, const Point_2 &q) template < class K > inline -Comparison_result +typename K::Comparison_result compare_y(const Point_2 &p, const Point_2 &q) { return CGALi::compare_y(p, q, K()); @@ -430,7 +430,7 @@ compare_y(const Point_2 &p, const Point_2 &q) template < class K > inline -Comparison_result +typename K::Comparison_result compare_y(const Point_2 &p, const Line_2 &l1, const Line_2 &l2) @@ -440,7 +440,7 @@ compare_y(const Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y(const Line_2 &l1, const Line_2 &l2, const Line_2 &h1, @@ -451,7 +451,7 @@ compare_y(const Line_2 &l1, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y(const Line_2 &l, const Line_2 &h1, const Line_2 &h2) @@ -461,7 +461,7 @@ compare_y(const Line_2 &l, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y_at_x(const Point_2 &p, const Segment_2 &s) { return CGALi::compare_y_at_x(p, s, K()); @@ -469,7 +469,7 @@ compare_y_at_x(const Point_2 &p, const Segment_2 &s) template < class K > inline -Comparison_result +typename K::Comparison_result compare_y_at_x(const Point_2 &p, const Segment_2 &s1, const Segment_2 &s2) @@ -479,7 +479,7 @@ compare_y_at_x(const Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y_at_x(const Point_2 &p, const Line_2 &h) { return CGALi::compare_y_at_x(p, h, K()); @@ -487,7 +487,7 @@ compare_y_at_x(const Point_2 &p, const Line_2 &h) template < class K > inline -Comparison_result +typename K::Comparison_result compare_y_at_x(const Point_2 &p, const Line_2 &h1, const Line_2 &h2) @@ -497,7 +497,7 @@ compare_y_at_x(const Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y_at_x(const Line_2 &l1, const Line_2 &l2, const Line_2 &h) @@ -507,7 +507,7 @@ compare_y_at_x(const Line_2 &l1, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y_at_x(const Line_2 &l1, const Line_2 &l2, const Line_2 &h1, @@ -518,7 +518,7 @@ compare_y_at_x(const Line_2 &l1, template < class K > inline -Comparison_result +typename K::Comparison_result compare_yx(const Point_2 &p, const Point_2 &q) { return CGALi::compare_yx(p, q, K()); @@ -534,7 +534,7 @@ determinant(const Vector_2 &v0, const Vector_2 &v1) template inline -bool +typename K::Bool_type has_larger_distance_to_point(const Point_2& p, const Point_2& q, const Point_2& r) @@ -544,7 +544,7 @@ has_larger_distance_to_point(const Point_2& p, template inline -bool +typename K::Bool_type has_smaller_distance_to_point(const Point_2& p, const Point_2& q, const Point_2& r) @@ -554,7 +554,7 @@ has_smaller_distance_to_point(const Point_2& p, template inline -bool +typename K::Bool_type has_smaller_signed_distance_to_line(const Line_2& l, const Point_2& p, const Point_2& q) @@ -564,7 +564,7 @@ has_smaller_signed_distance_to_line(const Line_2& l, template inline -bool +typename K::Bool_type has_larger_signed_distance_to_line(const Line_2& l, const Point_2& p, const Point_2& q) @@ -574,7 +574,7 @@ has_larger_signed_distance_to_line(const Line_2& l, template inline -bool +typename K::Bool_type has_larger_signed_distance_to_line(const Point_2& p, const Point_2& q, const Point_2& r, @@ -585,7 +585,7 @@ has_larger_signed_distance_to_line(const Point_2& p, template inline -bool +typename K::Bool_type has_smaller_signed_distance_to_line(const Point_2& p, const Point_2& q, const Point_2& r, @@ -596,7 +596,7 @@ has_smaller_signed_distance_to_line(const Point_2& p, template < class K > inline -bool +typename K::Bool_type left_turn(const Point_2 &p, const Point_2 &q, const Point_2 &r) { return CGALi::left_turn(p, q, r, K()); @@ -604,7 +604,7 @@ left_turn(const Point_2 &p, const Point_2 &q, const Point_2 &r) template < class K > inline -bool +typename K::Bool_type less_x(const Point_2 &p, const Point_2 &q) { return CGALi::less_x(p, q, K()); @@ -612,7 +612,7 @@ less_x(const Point_2 &p, const Point_2 &q) template < class K > inline -bool +typename K::Bool_type less_y(const Point_2 &p, const Point_2 &q) { return CGALi::less_y(p, q, K()); @@ -620,7 +620,7 @@ less_y(const Point_2 &p, const Point_2 &q) template < class K > inline -bool +typename K::Bool_type lexicographically_xy_larger(const Point_2 &p, const Point_2 &q) { return CGALi::lexicographically_xy_larger(p, q, K()); @@ -628,7 +628,7 @@ lexicographically_xy_larger(const Point_2 &p, const Point_2 &q) template < class K > inline -bool +typename K::Bool_type lexicographically_xy_larger_or_equal(const Point_2 &p, const Point_2 &q) { return CGALi::lexicographically_xy_larger_or_equal(p, q, K()); @@ -636,7 +636,7 @@ lexicographically_xy_larger_or_equal(const Point_2 &p, const Point_2 &q) template < class K > inline -bool +typename K::Bool_type lexicographically_xy_smaller(const Point_2 &p, const Point_2 &q) { return CGALi::lexicographically_xy_smaller(p, q, K()); @@ -644,7 +644,7 @@ lexicographically_xy_smaller(const Point_2 &p, const Point_2 &q) template < class K > inline -bool +typename K::Bool_type lexicographically_xy_smaller_or_equal(const Point_2 &p, const Point_2 &q) { @@ -653,7 +653,7 @@ lexicographically_xy_smaller_or_equal(const Point_2 &p, template < class K > inline -bool +typename K::Bool_type lexicographically_yx_smaller(const Point_2 &p, const Point_2 &q) { return CGALi::lexicographically_yx_smaller(p, q, K()); @@ -661,7 +661,7 @@ lexicographically_yx_smaller(const Point_2 &p, const Point_2 &q) template < class K > inline -bool +typename K::Bool_type lexicographically_yx_smaller_or_equal(const Point_2 &p, const Point_2 &q) { return CGALi::lexicographically_yx_smaller_or_equal(p, q, K()); @@ -670,7 +670,7 @@ lexicographically_yx_smaller_or_equal(const Point_2 &p, const Point_2 &q) // FIXME : Undocumented template < class K > inline -bool +typename K::Bool_type lexicographically_yx_larger(const Point_2 &p, const Point_2 &q) { return CGALi::lexicographically_yx_larger(p, q, K()); @@ -679,7 +679,7 @@ lexicographically_yx_larger(const Point_2 &p, const Point_2 &q) // FIXME : Undocumented template < class K > inline -bool +typename K::Bool_type lexicographically_yx_larger_or_equal(const Point_2 &p, const Point_2 &q) { return CGALi::lexicographically_yx_larger_or_equal(p, q, K()); @@ -713,73 +713,73 @@ min_vertex(const Iso_rectangle_2 &ir) // They have no counter part with the kernel argument... template < class K > inline -bool +typename K::Bool_type operator<(const Direction_2& d1, const Direction_2& d2) { return compare_angle_with_x_axis(d1, d2) == SMALLER; } template < class K > inline -bool +typename K::Bool_type operator>(const Direction_2& d1, const Direction_2& d2) { return compare_angle_with_x_axis(d1, d2) == LARGER; } template < class K > inline -bool +typename K::Bool_type operator>=(const Direction_2& d1, const Direction_2& d2) { return compare_angle_with_x_axis(d1, d2) != SMALLER; } template < class K > inline -bool +typename K::Bool_type operator<=(const Direction_2& d1, const Direction_2& d2) { return compare_angle_with_x_axis(d1, d2) != LARGER; } template < class K > inline -bool +typename K::Bool_type operator==(const Point_2& p, const Point_2& q) { return K().equal_2_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator!=(const Point_2& p, const Point_2& q) { return ! (p == q); } template < class K > inline -bool +typename K::Bool_type operator<(const Point_2& p, const Point_2& q) { return K().less_xy_2_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator>(const Point_2& p, const Point_2& q) { return K().less_xy_2_object()(q, p); } template < class K > inline -bool +typename K::Bool_type operator<=(const Point_2& p, const Point_2& q) { return ! K().less_xy_2_object()(q, p); } template < class K > inline -bool +typename K::Bool_type operator>=(const Point_2& p, const Point_2& q) { return ! K().less_xy_2_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator==(const Vector_2& v, const Vector_2& w) { return K().equal_2_object()(v, w); } template < class K > inline -bool +typename K::Bool_type operator!=(const Vector_2& v, const Vector_2& w) { return ! (v == w); } @@ -887,7 +887,7 @@ operator-(const Origin &o, const Point_2 &q) template inline -Orientation +typename K::Orientation orientation(const Point_2 &p, const Point_2 &q, const Point_2 &r) { return CGALi::orientation(p, q, r, K()); @@ -895,7 +895,7 @@ orientation(const Point_2 &p, const Point_2 &q, const Point_2 &r) template inline -Orientation +typename K::Orientation orientation(const Vector_2 &u, const Vector_2 &v) { return CGALi::orientation(u, v, K()); @@ -905,7 +905,7 @@ orientation(const Vector_2 &u, const Vector_2 &v) template inline -bool +typename K::Bool_type right_turn(const Point_2 &p, const Point_2 &q, const Point_2 &r) { return CGALi::right_turn(p, q, r, K()); @@ -913,7 +913,7 @@ right_turn(const Point_2 &p, const Point_2 &q, const Point_2 &r) template inline -Bounded_side +typename K::Bounded_side side_of_bounded_circle(const Point_2 &p, const Point_2 &q, const Point_2 &r, @@ -924,7 +924,7 @@ side_of_bounded_circle(const Point_2 &p, template inline -Bounded_side +typename K::Bounded_side side_of_bounded_circle(const Point_2 &p, const Point_2 &q, const Point_2 &r) @@ -934,7 +934,7 @@ side_of_bounded_circle(const Point_2 &p, template inline -Oriented_side +typename K::Oriented_side side_of_oriented_circle(const Point_2 &p, const Point_2 &q, const Point_2 &r, @@ -961,7 +961,7 @@ squared_radius(const Point_2& p, const Point_2& q, const Point_2& r) template < class K > inline -bool +typename K::Bool_type x_equal(const Point_2 &p, const Point_2 &q) { return CGALi::x_equal(p, q, K()); @@ -969,7 +969,7 @@ x_equal(const Point_2 &p, const Point_2 &q) template < class K > inline -bool +typename K::Bool_type y_equal(const Point_2 &p, const Point_2 &q) { return CGALi::y_equal(p, q, K()); diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_3.h b/Kernel_23/include/CGAL/Kernel/global_functions_3.h index c3caefb3652..4d1b8c51481 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_3.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_3.h @@ -43,7 +43,7 @@ angle(const Point_3 &p, const Point_3 &q, const Point_3 &r) template < typename K > inline -bool +typename K::Bool_type are_negative_oriented(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) { @@ -52,7 +52,7 @@ are_negative_oriented(const Point_3& p, const Point_3& q, template < class K > inline -bool +typename K::Bool_type are_ordered_along_line(const Point_3 &p, const Point_3 &q, const Point_3 &r) @@ -62,7 +62,7 @@ are_ordered_along_line(const Point_3 &p, template < typename K > inline -bool +typename K::Bool_type are_positive_oriented(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) { @@ -71,7 +71,7 @@ are_positive_oriented(const Point_3& p, const Point_3& q, template < class K > inline -bool +typename K::Bool_type are_strictly_ordered_along_line(const Point_3 &p, const Point_3 &q, const Point_3 &r) @@ -234,7 +234,7 @@ circumcenter(const Triangle_3 &t) template < class K > inline -bool +typename K::Bool_type collinear(const Point_3 &p, const Point_3 &q, const Point_3 &r) { return CGALi::collinear(p, q, r, K()); @@ -242,7 +242,7 @@ collinear(const Point_3 &p, const Point_3 &q, const Point_3 &r) template < class K > inline -bool +typename K::Bool_type collinear_are_ordered_along_line(const Point_3 &p, const Point_3 &q, const Point_3 &r) @@ -252,7 +252,7 @@ collinear_are_ordered_along_line(const Point_3 &p, template < class K > inline -bool +typename K::Bool_type collinear_are_strictly_ordered_along_line(const Point_3 &p, const Point_3 &q, const Point_3 &r) @@ -262,7 +262,7 @@ collinear_are_strictly_ordered_along_line(const Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_distance_to_point(const Point_3 &p, const Point_3 &q, const Point_3 &r) @@ -272,7 +272,7 @@ compare_distance_to_point(const Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_squared_distance(const Point_3 &p, const Point_3 &q, const typename K::FT &d2) @@ -282,7 +282,7 @@ compare_squared_distance(const Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_squared_radius(const Point_3 &p, const Point_3 &q, const typename K::FT &sr) @@ -292,7 +292,7 @@ compare_squared_radius(const Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_squared_radius(const Point_3 &p, const Point_3 &q, const Point_3 &r, @@ -303,7 +303,7 @@ compare_squared_radius(const Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_squared_radius(const Point_3 &p, const Point_3 &q, const Point_3 &r, @@ -315,7 +315,7 @@ compare_squared_radius(const Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_lexicographically_xyz(const Point_3 &p, const Point_3 &q) { @@ -324,7 +324,7 @@ compare_lexicographically_xyz(const Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_signed_distance_to_plane(const Plane_3 &h, const Point_3 &p, const Point_3 &q) @@ -334,7 +334,7 @@ compare_signed_distance_to_plane(const Plane_3 &h, template < class K > inline -Comparison_result +typename K::Comparison_result compare_signed_distance_to_plane(const Point_3 &hp, const Point_3 &hq, const Point_3 &hr, @@ -346,7 +346,7 @@ compare_signed_distance_to_plane(const Point_3 &hp, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x(const Point_3 &p, const Point_3 &q) { return CGALi::compare_x(p, q, K()); @@ -354,7 +354,7 @@ compare_x(const Point_3 &p, const Point_3 &q) template < class K > inline -Comparison_result +typename K::Comparison_result compare_y(const Point_3 &p, const Point_3 &q) { return CGALi::compare_y(p, q, K()); @@ -362,7 +362,7 @@ compare_y(const Point_3 &p, const Point_3 &q) template < class K > inline -Comparison_result +typename K::Comparison_result compare_z(const Point_3 &p, const Point_3 &q) { return CGALi::compare_z(p, q, K()); @@ -370,7 +370,7 @@ compare_z(const Point_3 &p, const Point_3 &q) template < class K > inline -Comparison_result +typename K::Comparison_result compare_xyz(const Point_3 &p, const Point_3 &q) { return CGALi::compare_xyz(p, q, K()); @@ -378,7 +378,7 @@ compare_xyz(const Point_3 &p, const Point_3 &q) template < class K > inline -bool +typename K::Bool_type coplanar(const Point_3 &p, const Point_3 &q, const Point_3 &r, const Point_3 &s) { @@ -388,7 +388,7 @@ coplanar(const Point_3 &p, const Point_3 &q, template < class K > inline -Orientation +typename K::Orientation coplanar_orientation(const Point_3 &p, const Point_3 &q, const Point_3 &r, @@ -399,7 +399,7 @@ coplanar_orientation(const Point_3 &p, template < class K > inline -Orientation +typename K::Orientation coplanar_orientation(const Point_3 &p, const Point_3 &q, const Point_3 &r) @@ -409,7 +409,7 @@ coplanar_orientation(const Point_3 &p, template < class K > inline -Bounded_side +typename K::Bounded_side coplanar_side_of_bounded_circle(const Point_3 &p, const Point_3 &q, const Point_3 &r, @@ -445,7 +445,7 @@ equidistant_line(const Point_3 &p, const Point_3 &q, const Point_3 &r) template < class K > inline -bool +typename K::Bool_type has_larger_distance_to_point(const Point_3 &p, const Point_3 &q, const Point_3 &r) @@ -455,7 +455,7 @@ has_larger_distance_to_point(const Point_3 &p, template < class K > inline -bool +typename K::Bool_type has_larger_signed_distance_to_plane(const Point_3 &hp, const Point_3 &hq, const Point_3 &hr, @@ -467,7 +467,7 @@ has_larger_signed_distance_to_plane(const Point_3 &hp, template < class K > inline -bool +typename K::Bool_type has_larger_signed_distance_to_plane(const Plane_3 &h, const Point_3 &p, const Point_3 &q) @@ -477,7 +477,7 @@ has_larger_signed_distance_to_plane(const Plane_3 &h, template < class K > inline -bool +typename K::Bool_type has_smaller_distance_to_point(const Point_3 &p, const Point_3 &q, const Point_3 &r) @@ -487,7 +487,7 @@ has_smaller_distance_to_point(const Point_3 &p, template < class K > inline -bool +typename K::Bool_type has_smaller_signed_distance_to_plane(const Point_3 &hp, const Point_3 &hq, const Point_3 &hr, @@ -499,7 +499,7 @@ has_smaller_signed_distance_to_plane(const Point_3 &hp, template < class K > inline -bool +typename K::Bool_type has_smaller_signed_distance_to_plane(const Plane_3 &h, const Point_3 &p, const Point_3 &q) @@ -509,7 +509,7 @@ has_smaller_signed_distance_to_plane(const Plane_3 &h, template < class K > inline -bool +typename K::Bool_type less_x(const Point_3 &p, const Point_3 &q) { return CGALi::less_x(p, q, K()); @@ -517,7 +517,7 @@ less_x(const Point_3 &p, const Point_3 &q) template < class K > inline -bool +typename K::Bool_type less_y(const Point_3 &p, const Point_3 &q) { return CGALi::less_y(p, q, K()); @@ -525,7 +525,7 @@ less_y(const Point_3 &p, const Point_3 &q) template < class K > inline -bool +typename K::Bool_type less_z(const Point_3 &p, const Point_3 &q) { return CGALi::less_z(p, q, K()); @@ -533,7 +533,7 @@ less_z(const Point_3 &p, const Point_3 &q) template < class K > inline -bool +typename K::Bool_type lexicographically_xyz_smaller(const Point_3 &p, const Point_3 &q) { return CGALi::lexicographically_xyz_smaller(p, q, K()); @@ -541,7 +541,7 @@ lexicographically_xyz_smaller(const Point_3 &p, const Point_3 &q) template < class K > inline -bool +typename K::Bool_type lexicographically_xyz_smaller_or_equal(const Point_3 &p, const Point_3 &q) { @@ -583,182 +583,182 @@ normal(const Point_3 &p, const Point_3 &q, const Point_3 &r) // FIXME TODO : what to do with the operators ? template < class K > inline -bool +typename K::Bool_type operator==(const Point_3& p, const Point_3& q) { return K().equal_3_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator!=(const Point_3& p, const Point_3& q) { return ! (p == q); } template < class K > inline -bool +typename K::Bool_type operator==(const Point_3& p, const Origin& o) { return K().equal_3_object()(p, Point_3(o)); } template < class K > inline -bool +typename K::Bool_type operator!=(const Point_3& p, const Origin& o) { return ! (p == o); } template < class K > inline -bool +typename K::Bool_type operator==(const Iso_cuboid_3& p, const Iso_cuboid_3& q) { return K().equal_3_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator!=(const Iso_cuboid_3& p, const Iso_cuboid_3& q) { return ! (p == q); } template < class K > inline -bool +typename K::Bool_type operator==(const Plane_3& p, const Plane_3& q) { return K().equal_3_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator!=(const Plane_3& p, const Plane_3& q) { return ! (p == q); } template < class K > inline -bool +typename K::Bool_type operator==(const Segment_3& p, const Segment_3& q) { return K().equal_3_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator!=(const Segment_3& p, const Segment_3& q) { return ! (p == q); } template < class K > inline -bool +typename K::Bool_type operator==(const Line_3& p, const Line_3& q) { return K().equal_3_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator!=(const Line_3& p, const Line_3& q) { return ! (p == q); } template < class K > inline -bool +typename K::Bool_type operator==(const Ray_3& p, const Ray_3& q) { return K().equal_3_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator!=(const Ray_3& p, const Ray_3& q) { return ! (p == q); } template < class K > inline -bool +typename K::Bool_type operator==(const Triangle_3& p, const Triangle_3& q) { return K().equal_3_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator!=(const Triangle_3& p, const Triangle_3& q) { return ! (p == q); } template < class K > inline -bool +typename K::Bool_type operator==(const Tetrahedron_3& p, const Tetrahedron_3& q) { return K().equal_3_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator!=(const Tetrahedron_3& p, const Tetrahedron_3& q) { return ! (p == q); } template < class K > inline -bool +typename K::Bool_type operator==(const Direction_3& p, const Direction_3& q) { return K().equal_3_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator!=(const Direction_3& p, const Direction_3& q) { return ! (p == q); } template < class K > inline -bool +typename K::Bool_type operator==(const Sphere_3& p, const Sphere_3& q) { return K().equal_3_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator!=(const Sphere_3& p, const Sphere_3& q) { return ! (p == q); } template < class K > inline -bool +typename K::Bool_type operator==(const Vector_3& p, const Vector_3& q) { return K().equal_3_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator!=(const Vector_3& p, const Vector_3& q) { return ! (p == q); } template < class K > inline -bool +typename K::Bool_type operator==(const Vector_3& p, const Null_vector& o) { return K().equal_3_object()(p, Vector_3(o)); } template < class K > inline -bool +typename K::Bool_type operator!=(const Vector_3& p, const Null_vector& o) { return ! (p == o); } template < class K > inline -bool +typename K::Bool_type operator<(const Point_3& p, const Point_3& q) { return K().less_xyz_3_object()(p, q); } template < class K > inline -bool +typename K::Bool_type operator>(const Point_3& p, const Point_3& q) { return K().less_xyz_3_object()(q, p); } template < class K > inline -bool +typename K::Bool_type operator<=(const Point_3& p, const Point_3& q) { return ! K().less_xyz_3_object()(q, p); } template < class K > inline -bool +typename K::Bool_type operator>=(const Point_3& p, const Point_3& q) { return ! K().less_xyz_3_object()(p, q); } @@ -867,7 +867,7 @@ operator-(const Origin &o, const Point_3 &q) template inline -Orientation +typename K::Orientation orientation(const Point_3 &p, const Point_3 &q, const Point_3 &r, @@ -878,7 +878,7 @@ orientation(const Point_3 &p, template inline -Orientation +typename K::Orientation orientation(const Vector_3 &u, const Vector_3 &v, const Vector_3 &w) { return CGALi::orientation(u, v, w, K()); @@ -915,7 +915,7 @@ radical_plane(const Sphere_3 &s1, template inline -Bounded_side +typename K::Bounded_side side_of_bounded_sphere(const Point_3 &p, const Point_3 &q, const Point_3 &test) @@ -925,7 +925,7 @@ side_of_bounded_sphere(const Point_3 &p, template inline -Bounded_side +typename K::Bounded_side side_of_bounded_sphere(const Point_3 &p, const Point_3 &q, const Point_3 &r, @@ -936,7 +936,7 @@ side_of_bounded_sphere(const Point_3 &p, template inline -Bounded_side +typename K::Bounded_side side_of_bounded_sphere(const Point_3 &p, const Point_3 &q, const Point_3 &r, @@ -948,7 +948,7 @@ side_of_bounded_sphere(const Point_3 &p, template inline -Oriented_side +typename K::Oriented_side side_of_oriented_sphere(const Point_3 &p, const Point_3 &q, const Point_3 &r, @@ -1010,7 +1010,7 @@ volume(const Point_3 &p, const Point_3 &q, template < class K > inline -bool +typename K::Bool_type x_equal(const Point_3 &p, const Point_3 &q) { return CGALi::x_equal(p, q, K()); @@ -1018,7 +1018,7 @@ x_equal(const Point_3 &p, const Point_3 &q) template < class K > inline -bool +typename K::Bool_type y_equal(const Point_3 &p, const Point_3 &q) { return CGALi::y_equal(p, q, K()); @@ -1026,7 +1026,7 @@ y_equal(const Point_3 &p, const Point_3 &q) template < class K > inline -bool +typename K::Bool_type z_equal(const Point_3 &p, const Point_3 &q) { return CGALi::z_equal(p, q, K()); diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h b/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h index d1a33b8c81f..2ee6eef782a 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_internal_2.h @@ -47,7 +47,7 @@ angle(const typename K::Point_2 &p, template < class K > inline -bool +typename K::Bool_type are_ordered_along_line(const typename K::Point_2 &p, const typename K::Point_2 &q, const typename K::Point_2 &r, const K& k) @@ -57,7 +57,7 @@ are_ordered_along_line(const typename K::Point_2 &p, template < class K > inline -bool +typename K::Bool_type are_strictly_ordered_along_line(const typename K::Point_2 &p, const typename K::Point_2 &q, const typename K::Point_2 &r, @@ -213,7 +213,7 @@ circumcenter(const typename K::Triangle_2 &t, const K& k) template < class K > inline -bool +typename K::Bool_type collinear(const typename K::Point_2 &p, const typename K::Point_2 &q, const typename K::Point_2 &r, const K& k) @@ -223,7 +223,7 @@ collinear(const typename K::Point_2 &p, template < class K > inline -bool +typename K::Bool_type collinear_are_ordered_along_line(const typename K::Point_2 &p, const typename K::Point_2 &q, const typename K::Point_2 &r, @@ -234,7 +234,7 @@ collinear_are_ordered_along_line(const typename K::Point_2 &p, template < class K > inline -bool +typename K::Bool_type collinear_are_strictly_ordered_along_line( const typename K::Point_2 &p, const typename K::Point_2 &q, @@ -245,7 +245,7 @@ collinear_are_strictly_ordered_along_line( template < typename K > inline -Comparison_result +typename K::Comparison_result compare_angle_with_x_axis(const typename K::Direction_2& d1, const typename K::Direction_2& d2, const K& k) @@ -255,7 +255,7 @@ compare_angle_with_x_axis(const typename K::Direction_2& d1, template inline -Comparison_result +typename K::Comparison_result compare_distance_to_point(const typename K::Point_2 &p, const typename K::Point_2 &q, const typename K::Point_2 &r, const K& k) @@ -265,7 +265,7 @@ compare_distance_to_point(const typename K::Point_2 &p, template inline -Comparison_result +typename K::Comparison_result compare_squared_distance(const typename K::Point_2 &p, const typename K::Point_2 &q, const typename K::FT &d2, const K& k) @@ -275,7 +275,7 @@ compare_squared_distance(const typename K::Point_2 &p, template inline -Comparison_result +typename K::Comparison_result compare_signed_distance_to_line(const typename K::Point_2& p, const typename K::Point_2& q, const typename K::Point_2& r, @@ -289,7 +289,7 @@ compare_signed_distance_to_line(const typename K::Point_2& p, template inline -Comparison_result +typename K::Comparison_result compare_signed_distance_to_line(const typename K::Line_2& l, const typename K::Point_2& p, const typename K::Point_2& q, @@ -302,7 +302,7 @@ compare_signed_distance_to_line(const typename K::Line_2& l, template < class K > inline -Comparison_result +typename K::Comparison_result compare_slopes(const typename K::Line_2 &l1, const typename K::Line_2 &l2, const K& k) { @@ -311,7 +311,7 @@ compare_slopes(const typename K::Line_2 &l1, template < class K > inline -Comparison_result +typename K::Comparison_result compare_slopes(const typename K::Segment_2 &s1, const typename K::Segment_2 &s2, const K& k) { @@ -320,7 +320,7 @@ compare_slopes(const typename K::Segment_2 &s1, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x(const typename K::Point_2 &p, const typename K::Point_2 &q, const K& k) { @@ -329,7 +329,7 @@ compare_x(const typename K::Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x(const typename K::Point_2 &p, const typename K::Line_2 &l1, const typename K::Line_2 &l2, const K& k) @@ -339,7 +339,7 @@ compare_x(const typename K::Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x(const typename K::Line_2 &l, const typename K::Line_2 &h1, const typename K::Line_2 &h2, const K& k) @@ -349,7 +349,7 @@ compare_x(const typename K::Line_2 &l, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x(const typename K::Line_2 &l1, const typename K::Line_2 &h1, const typename K::Line_2 &l2, @@ -360,7 +360,7 @@ compare_x(const typename K::Line_2 &l1, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x_at_y(const typename K::Point_2& p, const typename K::Line_2& h, const K& k) { @@ -370,7 +370,7 @@ compare_x_at_y(const typename K::Point_2& p, /* Undocumented template < class K > inline -Comparison_result +typename K::Comparison_result compare_y_at_x(const typename K::Point_2 &p, const typename K::Segment_2 &s, const K& k) { @@ -380,7 +380,7 @@ compare_y_at_x(const typename K::Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x_at_y(const typename K::Point_2 &p, const typename K::Line_2 &h1, const typename K::Line_2 &h2, const K& k) @@ -390,7 +390,7 @@ compare_x_at_y(const typename K::Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x_at_y(const typename K::Line_2 &l1, const typename K::Line_2 &l2, const typename K::Line_2 &h, const K& k) @@ -400,7 +400,7 @@ compare_x_at_y(const typename K::Line_2 &l1, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x_at_y(const typename K::Line_2 &l1, const typename K::Line_2 &l2, const typename K::Line_2 &h1, @@ -411,7 +411,7 @@ compare_x_at_y(const typename K::Line_2 &l1, template < class K > inline -Comparison_result +typename K::Comparison_result compare_xy(const typename K::Point_2 &p, const typename K::Point_2 &q, const K& k) { @@ -420,7 +420,7 @@ compare_xy(const typename K::Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_yx(const typename K::Point_2 &p, const typename K::Point_2 &q, const K& k) { @@ -429,7 +429,7 @@ compare_yx(const typename K::Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y(const typename K::Point_2 &p, const typename K::Point_2 &q, const K& k) { @@ -438,7 +438,7 @@ compare_y(const typename K::Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y(const typename K::Point_2 &p, const typename K::Line_2 &l1, const typename K::Line_2 &l2, const K& k) @@ -448,7 +448,7 @@ compare_y(const typename K::Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y(const typename K::Line_2 &l1, const typename K::Line_2 &l2, const typename K::Line_2 &h1, @@ -459,7 +459,7 @@ compare_y(const typename K::Line_2 &l1, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y(const typename K::Line_2 &l, const typename K::Line_2 &h1, const typename K::Line_2 &h2, const K& k) @@ -469,7 +469,7 @@ compare_y(const typename K::Line_2 &l, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y_at_x(const typename K::Point_2 &p, const typename K::Segment_2 &s, const K& k) { @@ -478,7 +478,7 @@ compare_y_at_x(const typename K::Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y_at_x(const typename K::Point_2 &p, const typename K::Segment_2 &s1, const typename K::Segment_2 &s2, const K& k) @@ -488,7 +488,7 @@ compare_y_at_x(const typename K::Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y_at_x(const typename K::Point_2 &p, const typename K::Line_2 &l, const K& k) { @@ -497,7 +497,7 @@ compare_y_at_x(const typename K::Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y_at_x(const typename K::Point_2 &p, const typename K::Line_2 &h1, const typename K::Line_2 &h2, const K& k) @@ -507,7 +507,7 @@ compare_y_at_x(const typename K::Point_2 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y_at_x(const typename K::Line_2 &l1, const typename K::Line_2 &l2, const typename K::Line_2 &h, const K& k) @@ -517,7 +517,7 @@ compare_y_at_x(const typename K::Line_2 &l1, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y_at_x(const typename K::Line_2 &l1, const typename K::Line_2 &l2, const typename K::Line_2 &h1, @@ -537,7 +537,7 @@ determinant(const typename K::Vector_2 &v0, template inline -bool +typename K::Bool_type has_larger_distance_to_point(const typename K::Point_2 &p, const typename K::Point_2 &q, const typename K::Point_2 &r, @@ -548,7 +548,7 @@ has_larger_distance_to_point(const typename K::Point_2 &p, template inline -bool +typename K::Bool_type has_smaller_distance_to_point(const typename K::Point_2 &p, const typename K::Point_2 &q, const typename K::Point_2 &r, @@ -559,7 +559,7 @@ has_smaller_distance_to_point(const typename K::Point_2 &p, template inline -bool +typename K::Bool_type has_smaller_signed_distance_to_line(const typename K::Line_2& l, const typename K::Point_2& p, const typename K::Point_2& q, @@ -570,7 +570,7 @@ has_smaller_signed_distance_to_line(const typename K::Line_2& l, template inline -bool +typename K::Bool_type has_larger_signed_distance_to_line(const typename K::Line_2& l, const typename K::Point_2& p, const typename K::Point_2& q, @@ -581,7 +581,7 @@ has_larger_signed_distance_to_line(const typename K::Line_2& l, template inline -bool +typename K::Bool_type has_larger_signed_distance_to_line(const typename K::Point_2& p, const typename K::Point_2& q, const typename K::Point_2& r, @@ -593,7 +593,7 @@ has_larger_signed_distance_to_line(const typename K::Point_2& p, template inline -bool +typename K::Bool_type has_smaller_signed_distance_to_line(const typename K::Point_2& p, const typename K::Point_2& q, const typename K::Point_2& r, @@ -605,7 +605,7 @@ has_smaller_signed_distance_to_line(const typename K::Point_2& p, template < class K > inline -bool +typename K::Bool_type left_turn(const typename K::Point_2 &p, const typename K::Point_2 &q, const typename K::Point_2 &r, const K& k) @@ -615,7 +615,7 @@ left_turn(const typename K::Point_2 &p, template < class K > inline -bool +typename K::Bool_type less_x(const typename K::Point_2 &p, const typename K::Point_2 &q, const K& k) { @@ -624,7 +624,7 @@ less_x(const typename K::Point_2 &p, template < class K > inline -bool +typename K::Bool_type less_y(const typename K::Point_2 &p, const typename K::Point_2 &q, const K& k) { @@ -633,7 +633,7 @@ less_y(const typename K::Point_2 &p, template < class K > inline -bool +typename K::Bool_type lexicographically_xy_larger(const typename K::Point_2 &p, const typename K::Point_2 &q, const K& k) @@ -643,7 +643,7 @@ lexicographically_xy_larger(const typename K::Point_2 &p, template < class K > inline -bool +typename K::Bool_type lexicographically_xy_larger_or_equal(const typename K::Point_2 &p, const typename K::Point_2 &q, const K& k) @@ -653,7 +653,7 @@ lexicographically_xy_larger_or_equal(const typename K::Point_2 &p, template < class K > inline -bool +typename K::Bool_type lexicographically_xy_smaller(const typename K::Point_2 &p, const typename K::Point_2 &q, const K& k) @@ -663,7 +663,7 @@ lexicographically_xy_smaller(const typename K::Point_2 &p, template < class K > inline -bool +typename K::Bool_type lexicographically_xy_smaller_or_equal(const typename K::Point_2 &p, const typename K::Point_2 &q, const K& k) @@ -673,7 +673,7 @@ lexicographically_xy_smaller_or_equal(const typename K::Point_2 &p, template < class K > inline -bool +typename K::Bool_type lexicographically_yx_smaller(const typename K::Point_2 &p, const typename K::Point_2 &q, const K& k) @@ -683,7 +683,7 @@ lexicographically_yx_smaller(const typename K::Point_2 &p, template < class K > inline -bool +typename K::Bool_type lexicographically_yx_smaller_or_equal(const typename K::Point_2 &p, const typename K::Point_2 &q, const K& k) @@ -694,7 +694,7 @@ lexicographically_yx_smaller_or_equal(const typename K::Point_2 &p, // FIXME : Undocumented template < class K > inline -bool +typename K::Bool_type lexicographically_yx_larger(const typename K::Point_2 &p, const typename K::Point_2 &q, const K& k) @@ -705,7 +705,7 @@ lexicographically_yx_larger(const typename K::Point_2 &p, // FIXME : Undocumented template < class K > inline -bool +typename K::Bool_type lexicographically_yx_larger_or_equal(const typename K::Point_2 &p, const typename K::Point_2 &q, const K& k) @@ -759,7 +759,7 @@ orientation(const typename K::Vector_2 &u, template inline -bool +typename K::Bool_type parallel(const typename K::Line_2 &l1, const typename K::Line_2 &l2, const K &k) { @@ -768,7 +768,7 @@ parallel(const typename K::Line_2 &l1, template inline -bool +typename K::Bool_type parallel(const typename K::Ray_2 &r1, const typename K::Ray_2 &r2, const K &k) { @@ -777,7 +777,7 @@ parallel(const typename K::Ray_2 &r1, template inline -bool +typename K::Bool_type parallel(const typename K::Segment_2 &s1, const typename K::Segment_2 &s2, const K &k) { @@ -786,7 +786,7 @@ parallel(const typename K::Segment_2 &s1, template inline -bool +typename K::Bool_type right_turn(const typename K::Point_2 &p, const typename K::Point_2 &q, const typename K::Point_2 &r, const K &k) @@ -847,7 +847,7 @@ squared_radius(const typename K::Point_2 &p, template < class K > inline -bool +typename K::Bool_type x_equal(const typename K::Point_2 &p, const typename K::Point_2 &q, const K &k) { @@ -856,7 +856,7 @@ x_equal(const typename K::Point_2 &p, template < class K > inline -bool +typename K::Bool_type y_equal(const typename K::Point_2 &p, const typename K::Point_2 &q, const K &k) { diff --git a/Kernel_23/include/CGAL/Kernel/global_functions_internal_3.h b/Kernel_23/include/CGAL/Kernel/global_functions_internal_3.h index a3ddd9c3ba4..fe721e47be8 100644 --- a/Kernel_23/include/CGAL/Kernel/global_functions_internal_3.h +++ b/Kernel_23/include/CGAL/Kernel/global_functions_internal_3.h @@ -43,7 +43,7 @@ angle(const typename K::Point_3 &p, template < class K > inline -bool +typename K::Bool_type are_ordered_along_line(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, const K& k) @@ -53,7 +53,7 @@ are_ordered_along_line(const typename K::Point_3 &p, template < class K > inline -bool +typename K::Bool_type are_strictly_ordered_along_line(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -225,7 +225,7 @@ circumcenter(const typename K::Triangle_3 &t, const K& k) template < class K > inline -bool +typename K::Bool_type collinear(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -236,7 +236,7 @@ collinear(const typename K::Point_3 &p, template < class K > inline -bool +typename K::Bool_type collinear_are_ordered_along_line( const typename K::Point_3 &p, const typename K::Point_3 &q, @@ -248,7 +248,7 @@ collinear_are_ordered_along_line( template < class K > inline -bool +typename K::Bool_type collinear_are_strictly_ordered_along_line( const typename K::Point_3 &p, const typename K::Point_3 &q, @@ -260,7 +260,7 @@ collinear_are_strictly_ordered_along_line( template < class K > inline -Comparison_result +typename K::Comparison_result compare_distance_to_point(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -271,7 +271,7 @@ compare_distance_to_point(const typename K::Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_squared_distance(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::FT &d2, @@ -282,7 +282,7 @@ compare_squared_distance(const typename K::Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_squared_radius(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::FT &sr, @@ -293,7 +293,7 @@ compare_squared_radius(const typename K::Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_squared_radius(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -305,7 +305,7 @@ compare_squared_radius(const typename K::Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_squared_radius(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -318,7 +318,7 @@ compare_squared_radius(const typename K::Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_lexicographically_xyz(const typename K::Point_3 &p, const typename K::Point_3 &q, const K& k) @@ -328,7 +328,7 @@ compare_lexicographically_xyz(const typename K::Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_signed_distance_to_plane(const typename K::Plane_3 &h, const typename K::Point_3 &p, const typename K::Point_3 &q, @@ -341,7 +341,7 @@ compare_signed_distance_to_plane(const typename K::Plane_3 &h, template < class K > inline -Comparison_result +typename K::Comparison_result compare_signed_distance_to_plane(const typename K::Point_3 &hp, const typename K::Point_3 &hq, const typename K::Point_3 &hr, @@ -358,7 +358,7 @@ compare_signed_distance_to_plane(const typename K::Point_3 &hp, template < class K > inline -Comparison_result +typename K::Comparison_result compare_x(const typename K::Point_3 &p, const typename K::Point_3 &q, const K &k) @@ -368,7 +368,7 @@ compare_x(const typename K::Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_y(const typename K::Point_3 &p, const typename K::Point_3 &q, const K &k) @@ -378,7 +378,7 @@ compare_y(const typename K::Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_z(const typename K::Point_3 &p, const typename K::Point_3 &q, const K &k) @@ -388,7 +388,7 @@ compare_z(const typename K::Point_3 &p, template < class K > inline -Comparison_result +typename K::Comparison_result compare_xyz(const typename K::Point_3 &p, const typename K::Point_3 &q, const K &k) @@ -398,7 +398,7 @@ compare_xyz(const typename K::Point_3 &p, template < class K > inline -bool +typename K::Bool_type coplanar(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -409,7 +409,7 @@ coplanar(const typename K::Point_3 &p, template < class K > inline -Orientation +typename K::Orientation coplanar_orientation(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -420,7 +420,7 @@ coplanar_orientation(const typename K::Point_3 &p, template < class K > inline -Orientation +typename K::Orientation coplanar_orientation(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, const K& k) @@ -430,7 +430,7 @@ coplanar_orientation(const typename K::Point_3 &p, template < class K > inline -Bounded_side +typename K::Bounded_side coplanar_side_of_bounded_circle(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -471,7 +471,7 @@ equidistant_line(const typename K::Point_3 &p, template < class K > inline -bool +typename K::Bool_type has_smaller_distance_to_point(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -482,7 +482,7 @@ has_smaller_distance_to_point(const typename K::Point_3 &p, template < class K > inline -bool +typename K::Bool_type has_larger_distance_to_point(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -493,7 +493,7 @@ has_larger_distance_to_point(const typename K::Point_3 &p, template < class K > inline -bool +typename K::Bool_type has_larger_signed_distance_to_plane(const typename K::Plane_3 &h, const typename K::Point_3 &p, const typename K::Point_3 &q, @@ -504,7 +504,7 @@ has_larger_signed_distance_to_plane(const typename K::Plane_3 &h, template < class K > inline -bool +typename K::Bool_type has_larger_signed_distance_to_plane(const typename K::Point_3 &hp, const typename K::Point_3 &hq, const typename K::Point_3 &hr, @@ -517,7 +517,7 @@ has_larger_signed_distance_to_plane(const typename K::Point_3 &hp, template < class K > inline -bool +typename K::Bool_type has_smaller_signed_distance_to_plane(const typename K::Plane_3 &h, const typename K::Point_3 &p, const typename K::Point_3 &q, @@ -528,7 +528,7 @@ has_smaller_signed_distance_to_plane(const typename K::Plane_3 &h, template < class K > inline -bool +typename K::Bool_type has_smaller_signed_distance_to_plane(const typename K::Point_3 &hp, const typename K::Point_3 &hq, const typename K::Point_3 &hr, @@ -541,7 +541,7 @@ has_smaller_signed_distance_to_plane(const typename K::Point_3 &hp, template < class K > inline -bool +typename K::Bool_type less_x(const typename K::Point_3 &p, const typename K::Point_3 &q, const K &k) @@ -551,7 +551,7 @@ less_x(const typename K::Point_3 &p, template < class K > inline -bool +typename K::Bool_type less_y(const typename K::Point_3 &p, const typename K::Point_3 &q, const K &k) @@ -561,7 +561,7 @@ less_y(const typename K::Point_3 &p, template < class K > inline -bool +typename K::Bool_type less_z(const typename K::Point_3 &p, const typename K::Point_3 &q, const K &k) @@ -571,7 +571,7 @@ less_z(const typename K::Point_3 &p, template < class K > inline -bool +typename K::Bool_type lexicographically_xyz_smaller(const typename K::Point_3 &p, const typename K::Point_3 &q, const K &k) @@ -621,7 +621,7 @@ unit_normal(const typename K::Point_3 &p, const typename K::Point_3 &q, const ty template inline -Orientation +typename K::Orientation orientation(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -632,7 +632,7 @@ orientation(const typename K::Point_3 &p, template inline -Orientation +typename K::Orientation orientation(const typename K::Vector_3 &u, const typename K::Vector_3 &v, const typename K::Vector_3 &w, const K &k) @@ -660,7 +660,7 @@ orthogonal_vector(const typename K::Plane_3 &p, const K &k) template inline -bool +typename K::Bool_type parallel(const typename K::Line_3 &l1, const typename K::Line_3 &l2, const K &k) { @@ -669,7 +669,7 @@ parallel(const typename K::Line_3 &l1, template inline -bool +typename K::Bool_type parallel(const typename K::Plane_3 &h1, const typename K::Plane_3 &h2, const K &k) { @@ -678,7 +678,7 @@ parallel(const typename K::Plane_3 &h1, template inline -bool +typename K::Bool_type parallel(const typename K::Ray_3 &r1, const typename K::Ray_3 &r2, const K &k) { @@ -687,7 +687,7 @@ parallel(const typename K::Ray_3 &r1, template inline -bool +typename K::Bool_type parallel(const typename K::Segment_3 &s1, const typename K::Segment_3 &s2, const K &k) { @@ -696,7 +696,7 @@ parallel(const typename K::Segment_3 &s1, template inline -Bounded_side +typename K::Bounded_side side_of_bounded_sphere(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &test, const K &k) @@ -706,7 +706,7 @@ side_of_bounded_sphere(const typename K::Point_3 &p, template inline -Bounded_side +typename K::Bounded_side side_of_bounded_sphere(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -717,7 +717,7 @@ side_of_bounded_sphere(const typename K::Point_3 &p, template inline -Bounded_side +typename K::Bounded_side side_of_bounded_sphere(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -729,7 +729,7 @@ side_of_bounded_sphere(const typename K::Point_3 &p, template inline -Oriented_side +typename K::Oriented_side side_of_oriented_sphere(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -792,7 +792,7 @@ volume(const typename K::Point_3 &p, template < class K > inline -bool +typename K::Bool_type x_equal(const typename K::Point_3 &p, const typename K::Point_3 &q, const K &k) { @@ -801,7 +801,7 @@ x_equal(const typename K::Point_3 &p, template < class K > inline -bool +typename K::Bool_type y_equal(const typename K::Point_3 &p, const typename K::Point_3 &q, const K &k) { @@ -810,7 +810,7 @@ y_equal(const typename K::Point_3 &p, template < class K > inline -bool +typename K::Bool_type z_equal(const typename K::Point_3 &p, const typename K::Point_3 &q, const K &k) { @@ -822,7 +822,7 @@ z_equal(const typename K::Point_3 &p, template inline -bool +typename K::Bool_type are_negative_oriented(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -833,7 +833,7 @@ are_negative_oriented(const typename K::Point_3 &p, template inline -bool +typename K::Bool_type are_positive_oriented(const typename K::Point_3 &p, const typename K::Point_3 &q, const typename K::Point_3 &r, @@ -844,7 +844,7 @@ are_positive_oriented(const typename K::Point_3 &p, template < class K > inline -bool +typename K::Bool_type lexicographically_xyz_smaller_or_equal(const typename K::Point_3 &p, const typename K::Point_3 &q, const K&k) diff --git a/Kernel_23/include/CGAL/Line_2.h b/Kernel_23/include/CGAL/Line_2.h index e97823e224d..78c2029aee2 100644 --- a/Kernel_23/include/CGAL/Line_2.h +++ b/Kernel_23/include/CGAL/Line_2.h @@ -143,47 +143,47 @@ public: return R().construct_projected_point_2_object()(*this,p); } - bool + typename R::Bool_type is_horizontal() const { return R().is_horizontal_2_object()(*this); } - bool + typename R::Bool_type is_vertical() const { return R().is_vertical_2_object()(*this); } - bool + typename R::Bool_type is_degenerate() const { return R().is_degenerate_2_object()(*this); } - Oriented_side + typename R::Oriented_side oriented_side(const Point_2 &p) const { return R().oriented_side_2_object()(*this,p); } - bool + typename R::Bool_type has_on_boundary(const Point_2 &p) const { return oriented_side(p) == ON_ORIENTED_BOUNDARY; } - bool + typename R::Bool_type has_on_positive_side(const Point_2 &p) const { return oriented_side(p) == ON_POSITIVE_SIDE; } - bool + typename R::Bool_type has_on_negative_side(const Point_2 &p) const { return oriented_side(p) == ON_NEGATIVE_SIDE; } - bool + typename R::Bool_type has_on(const Point_2 &p) const { return has_on_boundary(p); @@ -213,13 +213,13 @@ public: return R().construct_point_2_object()(*this,i); } - bool + typename R::Bool_type operator==(const Line_2 &l) const { return R().equal_2_object()(*this, l); } - bool + typename R::Bool_type operator!=(const Line_2 &l) const { return !(*this == l); diff --git a/Kernel_23/include/CGAL/Sphere_3.h b/Kernel_23/include/CGAL/Sphere_3.h index 7c875759704..98433b4637d 100644 --- a/Kernel_23/include/CGAL/Sphere_3.h +++ b/Kernel_23/include/CGAL/Sphere_3.h @@ -108,43 +108,43 @@ public: return R().construct_opposite_sphere_3_object()(*this); } - Orientation orientation() const + typename R::Orientation orientation() const { return R().orientation_3_object()(*this); } - Bounded_side + typename R::Bounded_side bounded_side(const Point_3 &p) const { return R().bounded_side_3_object()(*this, p); } - Oriented_side + typename R::Oriented_side oriented_side(const Point_3 &p) const { return R().oriented_side_3_object()(*this, p); } - bool + typename R::Bool_type has_on_boundary(const Point_3 &p) const { return R().has_on_boundary_3_object()(*this, p); //return bounded_side(p) == ON_BOUNDARY; } - bool + typename R::Bool_type has_on_bounded_side(const Point_3 &p) const { return bounded_side(p) == ON_BOUNDED_SIDE; } - bool + typename R::Bool_type has_on_unbounded_side(const Point_3 &p) const { return bounded_side(p) == ON_UNBOUNDED_SIDE; } - bool + typename R::Bool_type has_on_negative_side(const Point_3 &p) const { if (orientation() == COUNTERCLOCKWISE) @@ -152,7 +152,7 @@ public: return has_on_bounded_side(p); } - bool + typename R::Bool_type has_on_positive_side(const Point_3 &p) const { if (orientation() == COUNTERCLOCKWISE) @@ -160,7 +160,7 @@ public: return has_on_unbounded_side(p); } - bool + typename R::Bool_type is_degenerate() const { return R().is_degenerate_3_object()(*this); diff --git a/Kernel_23/include/CGAL/Triangle_2.h b/Kernel_23/include/CGAL/Triangle_2.h index d2d5463b84d..83dc3b3f70e 100644 --- a/Kernel_23/include/CGAL/Triangle_2.h +++ b/Kernel_23/include/CGAL/Triangle_2.h @@ -76,31 +76,31 @@ public: return R().compute_area_2_object()(vertex(0), vertex(1), vertex(2)); } - Orientation + typename R::Orientation orientation() const { return R().orientation_2_object()(vertex(0), vertex(1), vertex(2)); } - Bounded_side + typename R::Bounded_side bounded_side(const Point_2 &p) const { return R().bounded_side_2_object()(*this,p); } - Oriented_side + typename R::Oriented_side oriented_side(const Point_2 &p) const { return R().oriented_side_2_object()(*this,p); } - bool + typename R::Bool_type operator==(const Triangle_2 &t) const { return R().equal_2_object()(*this,t); } - bool + typename R::Bool_type operator!=(const Triangle_2 &t) const { return !(*this == t); @@ -118,37 +118,37 @@ public: return vertex(i); } - bool + typename R::Bool_type has_on_bounded_side(const Point_2 &p) const { return bounded_side(p) == ON_BOUNDED_SIDE; } - bool + typename R::Bool_type has_on_unbounded_side(const Point_2 &p) const { return bounded_side(p) == ON_UNBOUNDED_SIDE; } - bool + typename R::Bool_type has_on_boundary(const Point_2 &p) const { return bounded_side(p) == ON_BOUNDARY; } - bool + typename R::Bool_type has_on_negative_side(const Point_2 &p) const { return oriented_side(p) == ON_NEGATIVE_SIDE; } - bool + typename R::Bool_type has_on_positive_side(const Point_2 &p) const { return oriented_side(p) == ON_POSITIVE_SIDE; } - bool + typename R::Bool_type is_degenerate() const { return R().collinear_2_object()(vertex(0), vertex(1), vertex(2)); diff --git a/Number_types/include/CGAL/Lazy_exact_nt.h b/Number_types/include/CGAL/Lazy_exact_nt.h index cbb1b08ca81..734e3431b4a 100644 --- a/Number_types/include/CGAL/Lazy_exact_nt.h +++ b/Number_types/include/CGAL/Lazy_exact_nt.h @@ -515,7 +515,7 @@ operator<(const Lazy_exact_nt& a, const Lazy_exact_nt& b) return false; Uncertain res = a.approx() < b.approx(); if (is_singleton(res)) - return res; + return extract_singleton(res); CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); return a.exact() < b.exact(); } @@ -529,7 +529,7 @@ operator==(const Lazy_exact_nt& a, const Lazy_exact_nt& b) return true; Uncertain res = a.approx() == b.approx(); if (is_singleton(res)) - return res; + return extract_singleton(res); CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); return a.exact() == b.exact(); } @@ -591,7 +591,7 @@ operator>(const Lazy_exact_nt& a, int b) CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Uncertain res = b < a.approx(); if (is_singleton(res)) - return res; + return extract_singleton(res); CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); return b < a.exact(); } @@ -603,7 +603,7 @@ operator==(const Lazy_exact_nt& a, int b) CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Uncertain res = b == a.approx(); if (is_singleton(res)) - return res; + return extract_singleton(res); CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); return b == a.exact(); } @@ -1039,7 +1039,7 @@ template < typename ET > class Real_embeddable_traits< Lazy_exact_nt > CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION)); Uncertain< ::CGAL::Sign> res = CGAL_NTS sign(a.approx()); if (is_singleton(res)) - return res; + return extract_singleton(res); CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); return CGAL_NTS sign(a.exact()); } @@ -1056,7 +1056,7 @@ template < typename ET > class Real_embeddable_traits< Lazy_exact_nt > return EQUAL; Uncertain res = CGAL_NTS compare(a.approx(), b.approx()); if (is_singleton(res)) - return res; + return extract_singleton(res); CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION)); return CGAL_NTS compare(a.exact(), b.exact()); }