Merge pull request #8586 from MaelRL/Kernel_23-Fix_dangling_ref_in_CC3-GF

Do not rely on result_type definitions in kernels
This commit is contained in:
Sébastien Loriot 2025-04-03 16:12:09 +02:00
commit a4170b1fb9
173 changed files with 3622 additions and 5065 deletions

View File

@ -77,7 +77,7 @@ private:
public: public:
typedef Voronoi_radius_2<K> Voronoi_radius; typedef Voronoi_radius_2<K> Voronoi_radius;
typedef typename K::Bounded_side Bounded_dide; typedef typename K::Bounded_side Bounded_side;
public: public:
template<class Tag> template<class Tag>

View File

@ -25,6 +25,7 @@ namespace CGAL {
template <class R_ > template <class R_ >
class CircleC2 class CircleC2
{ {
typedef typename R_::Boolean Boolean;
typedef typename R_::FT FT; typedef typename R_::FT FT;
typedef typename R_::RT RT; typedef typename R_::RT RT;
typedef typename R_::Circle_2 Circle_2; typedef typename R_::Circle_2 Circle_2;
@ -49,8 +50,8 @@ public:
base = Rep(center, squared_radius, orient); base = Rep(center, squared_radius, orient);
} }
bool operator==(const CircleC2 &s) const; Boolean operator==(const CircleC2& s) const;
bool operator!=(const CircleC2 &s) const; Boolean operator!=(const CircleC2& s) const;
const Point_2 & center() const const Point_2 & center() const
{ {
@ -69,6 +70,25 @@ public:
}; };
template < class R >
typename R::Boolean
CircleC2<R>::operator==(const CircleC2<R> &t) const
{
if (CGAL::identical(base, t.base))
return true;
return center() == t.center() &&
squared_radius() == t.squared_radius() &&
orientation() == t.orientation();
}
template < class R >
typename R::Boolean
CircleC2<R>::operator!=(const CircleC2<R> &t) const
{
return !(*this == t);
}
} //namespace CGAL } //namespace CGAL
#endif // CGAL_CARTESIAN_CIRCLE_2_H #endif // CGAL_CARTESIAN_CIRCLE_2_H

View File

@ -23,6 +23,8 @@ namespace CGAL {
template <class R_ > template <class R_ >
class CircleC3 { class CircleC3 {
typedef typename R_::Boolean Boolean;
typedef typename R_::Bounded_side Bounded_side;
typedef typename R_::Sphere_3 Sphere_3; typedef typename R_::Sphere_3 Sphere_3;
typedef typename R_::Plane_3 Plane_3; typedef typename R_::Plane_3 Plane_3;
typedef typename R_::Point_3 Point_3; typedef typename R_::Point_3 Point_3;
@ -130,12 +132,12 @@ public:
return diametral_sphere(); return diametral_sphere();
} }
Point_3 center() const decltype(auto) center() const
{ {
return diametral_sphere().center(); return diametral_sphere().center();
} }
FT squared_radius() const decltype(auto) squared_radius() const
{ {
return diametral_sphere().squared_radius(); return diametral_sphere().squared_radius();
} }
@ -155,7 +157,7 @@ public:
return CGAL_PI * CGAL_PI * 4.0 * to_double(squared_radius()); return CGAL_PI * CGAL_PI * 4.0 * to_double(squared_radius());
} }
FT area_divided_by_pi() const decltype(auto) area_divided_by_pi() const
{ {
return squared_radius(); return squared_radius();
} }
@ -200,15 +202,15 @@ public:
(x+mx).sup(),(y+my).sup(),(z+mz).sup()); (x+mx).sup(),(y+my).sup(),(z+mz).sup());
} }
bool operator==(const CircleC3 &) const; Boolean operator==(const CircleC3 &) const;
bool operator!=(const CircleC3 &) const; Boolean operator!=(const CircleC3 &) const;
bool has_on(const Point_3 &p) const; Boolean has_on(const Point_3 &p) const;
bool has_on_bounded_side(const Point_3 &p) const; Boolean has_on_bounded_side(const Point_3 &p) const;
bool has_on_unbounded_side(const Point_3 &p) const; Boolean has_on_unbounded_side(const Point_3 &p) const;
Bounded_side bounded_side(const Point_3 &p) const; Bounded_side bounded_side(const Point_3 &p) const;
bool is_degenerate() const Boolean is_degenerate() const
{ {
return diametral_sphere().is_degenerate(); return diametral_sphere().is_degenerate();
} }
@ -217,7 +219,7 @@ public:
template < class R > template < class R >
inline inline
bool typename R::Boolean
CircleC3<R>:: CircleC3<R>::
has_on(const typename CircleC3<R>::Point_3 &p) const has_on(const typename CircleC3<R>::Point_3 &p) const
{ {
@ -227,7 +229,7 @@ has_on(const typename CircleC3<R>::Point_3 &p) const
template < class R > template < class R >
inline inline
bool typename R::Boolean
CircleC3<R>:: CircleC3<R>::
has_on_bounded_side(const typename CircleC3<R>::Point_3 &p) const has_on_bounded_side(const typename CircleC3<R>::Point_3 &p) const
{ {
@ -237,7 +239,7 @@ has_on_bounded_side(const typename CircleC3<R>::Point_3 &p) const
template < class R > template < class R >
inline inline
bool typename R::Boolean
CircleC3<R>:: CircleC3<R>::
has_on_unbounded_side(const typename CircleC3<R>::Point_3 &p) const has_on_unbounded_side(const typename CircleC3<R>::Point_3 &p) const
{ {
@ -246,8 +248,7 @@ has_on_unbounded_side(const typename CircleC3<R>::Point_3 &p) const
} }
template < class R > template < class R >
CGAL_KERNEL_INLINE typename R::Bounded_side
Bounded_side
CircleC3<R>:: CircleC3<R>::
bounded_side(const typename CircleC3<R>::Point_3 &p) const bounded_side(const typename CircleC3<R>::Point_3 &p) const
{ {
@ -256,8 +257,7 @@ bounded_side(const typename CircleC3<R>::Point_3 &p) const
} }
template < class R > template < class R >
CGAL_KERNEL_INLINE typename R::Boolean
bool
CircleC3<R>::operator==(const CircleC3<R> &t) const CircleC3<R>::operator==(const CircleC3<R> &t) const
{ {
if (CGAL::identical(base, t.base)) if (CGAL::identical(base, t.base))
@ -283,8 +283,7 @@ CircleC3<R>::operator==(const CircleC3<R> &t) const
} }
template < class R > template < class R >
CGAL_KERNEL_INLINE typename R::Boolean
bool
CircleC3<R>::operator!=(const CircleC3<R> &t) const CircleC3<R>::operator!=(const CircleC3<R> &t) const
{ {
return !(*this == t); return !(*this == t);

View File

@ -26,6 +26,8 @@ template < class R_ >
class DirectionC2 class DirectionC2
{ {
typedef DirectionC2<R_> Self; typedef DirectionC2<R_> Self;
typedef typename R_::Boolean Boolean;
typedef typename R_::FT FT; typedef typename R_::FT FT;
typedef FT RT; typedef FT RT;
typedef typename R_::Point_2 Point_2; typedef typename R_::Point_2 Point_2;
@ -49,8 +51,8 @@ public:
DirectionC2(const FT &x, const FT &y) DirectionC2(const FT &x, const FT &y)
: base{x, y} {} : base{x, y} {}
bool operator==(const DirectionC2 &d) const; Boolean operator==(const DirectionC2 &d) const;
bool operator!=(const DirectionC2 &d) const; Boolean operator!=(const DirectionC2 &d) const;
Vector_2 to_vector() const; Vector_2 to_vector() const;
@ -66,7 +68,7 @@ public:
template < class R > template < class R >
inline inline
bool typename R::Boolean
DirectionC2<R>::operator==(const DirectionC2<R> &d) const DirectionC2<R>::operator==(const DirectionC2<R> &d) const
{ {
if (CGAL::identical(base, d.base)) if (CGAL::identical(base, d.base))
@ -76,7 +78,7 @@ DirectionC2<R>::operator==(const DirectionC2<R> &d) const
template < class R > template < class R >
inline inline
bool typename R::Boolean
DirectionC2<R>::operator!=(const DirectionC2<R> &d) const DirectionC2<R>::operator!=(const DirectionC2<R> &d) const
{ {
return !( *this == d ); return !( *this == d );

View File

@ -26,6 +26,8 @@ namespace CGAL {
template < class R_ > template < class R_ >
class Iso_cuboidC3 class Iso_cuboidC3
{ {
typedef typename R_::Boolean Boolean;
typedef typename R_::Bounded_side Bounded_side;
typedef typename R_::FT FT; typedef typename R_::FT FT;
typedef typename R_::Iso_cuboid_3 Iso_cuboid_3; typedef typename R_::Iso_cuboid_3 Iso_cuboid_3;
typedef typename R_::Point_3 Point_3; typedef typename R_::Point_3 Point_3;
@ -98,8 +100,8 @@ public:
Construct_point_3()(max_hx/hw, max_hy/hw, max_hz/hw))); Construct_point_3()(max_hx/hw, max_hy/hw, max_hz/hw)));
} }
typename R::Boolean operator==(const Iso_cuboidC3& s) const; Boolean operator==(const Iso_cuboidC3& s) const;
typename R::Boolean operator!=(const Iso_cuboidC3& s) const; Boolean operator!=(const Iso_cuboidC3& s) const;
const Point_3 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const const Point_3 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ {
@ -118,11 +120,11 @@ public:
} }
Bounded_side bounded_side(const Point_3& p) const; Bounded_side bounded_side(const Point_3& p) const;
typename R::Boolean has_on(const Point_3& p) const; Boolean has_on(const Point_3& p) const;
typename R::Boolean has_on_boundary(const Point_3& p) const; Boolean has_on_boundary(const Point_3& p) const;
typename R::Boolean has_on_bounded_side(const Point_3& p) const; Boolean has_on_bounded_side(const Point_3& p) const;
typename R::Boolean has_on_unbounded_side(const Point_3& p) const; Boolean has_on_unbounded_side(const Point_3& p) const;
typename R::Boolean is_degenerate() const; Boolean is_degenerate() const;
const FT & xmin() const; const FT & xmin() const;
const FT & ymin() const; const FT & ymin() const;
const FT & zmin() const; const FT & zmin() const;
@ -267,7 +269,7 @@ Iso_cuboidC3<R>::volume() const
template < class R > template < class R >
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
Bounded_side typename R::Bounded_side
Iso_cuboidC3<R>:: Iso_cuboidC3<R>::
bounded_side(const typename Iso_cuboidC3<R>::Point_3& p) const bounded_side(const typename Iso_cuboidC3<R>::Point_3& p) const
{ {

View File

@ -24,6 +24,7 @@ namespace CGAL {
template < class R_ > template < class R_ >
class LineC3 class LineC3
{ {
typedef typename R_::Boolean Boolean;
typedef typename R_::FT FT; typedef typename R_::FT FT;
typedef typename R_::Point_3 Point_3; typedef typename R_::Point_3 Point_3;
typedef typename R_::Vector_3 Vector_3; typedef typename R_::Vector_3 Vector_3;
@ -65,8 +66,8 @@ public:
LineC3(const Point_3 &p, const Direction_3 &d) LineC3(const Point_3 &p, const Direction_3 &d)
{ *this = R().construct_line_3_object()(p, d); } { *this = R().construct_line_3_object()(p, d); }
bool operator==(const LineC3 &l) const; typename R::Boolean operator==(const LineC3 &l) const;
bool operator!=(const LineC3 &l) const; typename R::Boolean operator!=(const LineC3 &l) const;
Plane_3 perpendicular_plane(const Point_3 &p) const; Plane_3 perpendicular_plane(const Point_3 &p) const;
Line_3 opposite() const; Line_3 opposite() const;
@ -88,13 +89,13 @@ public:
Point_3 point(const FT i) const; Point_3 point(const FT i) const;
bool has_on(const Point_3 &p) const; Boolean has_on(const Point_3 &p) const;
bool is_degenerate() const; Boolean is_degenerate() const;
}; };
template < class R > template < class R >
inline inline
bool typename R::Boolean
LineC3<R>::operator==(const LineC3<R> &l) const LineC3<R>::operator==(const LineC3<R> &l) const
{ {
if (CGAL::identical(base, l.base)) if (CGAL::identical(base, l.base))
@ -104,7 +105,7 @@ LineC3<R>::operator==(const LineC3<R> &l) const
template < class R > template < class R >
inline inline
bool typename R::Boolean
LineC3<R>::operator!=(const LineC3<R> &l) const LineC3<R>::operator!=(const LineC3<R> &l) const
{ {
return !(*this == l); return !(*this == l);
@ -135,7 +136,7 @@ LineC3<R>::opposite() const
template < class R > template < class R >
inline inline
bool typename R::Boolean
LineC3<R>:: LineC3<R>::
has_on(const typename LineC3<R>::Point_3 &p) const has_on(const typename LineC3<R>::Point_3 &p) const
{ {
@ -144,7 +145,7 @@ has_on(const typename LineC3<R>::Point_3 &p) const
template < class R > template < class R >
inline inline
bool typename R::Boolean
LineC3<R>::is_degenerate() const LineC3<R>::is_degenerate() const
{ {
return to_vector() == NULL_VECTOR; return to_vector() == NULL_VECTOR;

View File

@ -107,6 +107,15 @@ public:
return base.cartesian_end(); return base.cartesian_end();
} }
typename R_::Boolean operator==(const PointC3 &p) const
{
return base == p.base;
}
typename R_::Boolean operator!=(const PointC3 &p) const
{
return !(*this == p);
}
int dimension() const int dimension() const
{ {
return base.dimension(); return base.dimension();

View File

@ -25,6 +25,7 @@ namespace CGAL {
template < class R_ > template < class R_ >
class SegmentC3 class SegmentC3
{ {
typedef typename R_::Boolean Boolean;
typedef typename R_::Point_3 Point_3; typedef typename R_::Point_3 Point_3;
typedef typename R_::Direction_3 Direction_3; typedef typename R_::Direction_3 Direction_3;
typedef typename R_::Vector_3 Vector_3; typedef typename R_::Vector_3 Vector_3;
@ -44,11 +45,11 @@ public:
SegmentC3(const Point_3 &sp, const Point_3 &ep) SegmentC3(const Point_3 &sp, const Point_3 &ep)
: base{sp, ep} {} : base{sp, ep} {}
bool has_on(const Point_3 &p) const; Boolean has_on(const Point_3 &p) const;
bool collinear_has_on(const Point_3 &p) const; Boolean collinear_has_on(const Point_3 &p) const;
bool operator==(const SegmentC3 &s) const; Boolean operator==(const SegmentC3 &s) const;
bool operator!=(const SegmentC3 &s) const; Boolean operator!=(const SegmentC3 &s) const;
const Point_3 & source() const const Point_3 & source() const
{ {
@ -73,12 +74,12 @@ public:
Line_3 supporting_line() const; Line_3 supporting_line() const;
Segment_3 opposite() const; Segment_3 opposite() const;
bool is_degenerate() const; Boolean is_degenerate() const;
}; };
template < class R > template < class R >
inline inline
bool typename R::Boolean
SegmentC3<R>::operator==(const SegmentC3<R> &s) const SegmentC3<R>::operator==(const SegmentC3<R> &s) const
{ {
if (CGAL::identical(base, s.base)) if (CGAL::identical(base, s.base))
@ -88,7 +89,7 @@ SegmentC3<R>::operator==(const SegmentC3<R> &s) const
template < class R > template < class R >
inline inline
bool typename R::Boolean
SegmentC3<R>::operator!=(const SegmentC3<R> &s) const SegmentC3<R>::operator!=(const SegmentC3<R> &s) const
{ {
return !(*this == s); return !(*this == s);
@ -184,7 +185,7 @@ SegmentC3<R>::opposite() const
template < class R > template < class R >
inline inline
bool typename R::Boolean
SegmentC3<R>::is_degenerate() const SegmentC3<R>::is_degenerate() const
{ {
return source() == target(); return source() == target();
@ -192,7 +193,7 @@ SegmentC3<R>::is_degenerate() const
template < class R > template < class R >
inline inline
bool typename R::Boolean
SegmentC3<R>:: SegmentC3<R>::
has_on(const typename SegmentC3<R>::Point_3 &p) const has_on(const typename SegmentC3<R>::Point_3 &p) const
{ {
@ -201,7 +202,7 @@ has_on(const typename SegmentC3<R>::Point_3 &p) const
template < class R > template < class R >
inline inline
bool typename R::Boolean
SegmentC3<R>:: SegmentC3<R>::
collinear_has_on(const typename SegmentC3<R>::Point_3 &p) const collinear_has_on(const typename SegmentC3<R>::Point_3 &p) const
{ {

View File

@ -27,6 +27,8 @@ namespace CGAL {
template <class R_> template <class R_>
class SphereC3 class SphereC3
{ {
typedef typename R_::Boolean Boolean;
typedef typename R_::Bounded_side Bounded_side;
typedef typename R_::FT FT; typedef typename R_::FT FT;
// https://doc.cgal.org/latest/Manual/devman_code_format.html#secprogramming_conventions // https://doc.cgal.org/latest/Manual/devman_code_format.html#secprogramming_conventions
typedef typename R_::Point_3 Point_3_; typedef typename R_::Point_3 Point_3_;
@ -124,17 +126,17 @@ public:
//! precond: ! x.is_degenerate() (when available) //! precond: ! x.is_degenerate() (when available)
// Returns R::ON_POSITIVE_SIDE, R::ON_ORIENTED_BOUNDARY or // Returns R::ON_POSITIVE_SIDE, R::ON_ORIENTED_BOUNDARY or
// R::ON_NEGATIVE_SIDE // R::ON_NEGATIVE_SIDE
typename R::Boolean has_on(const Circle_3 &p) const; Boolean has_on(const Circle_3 &p) const;
typename R::Boolean has_on(const Point_3_ &p) const; Boolean has_on(const Point_3_ &p) const;
typename R::Boolean has_on_boundary(const Point_3_ &p) const; Boolean has_on_boundary(const Point_3_ &p) const;
typename R::Boolean has_on_positive_side(const Point_3_ &p) const; Boolean has_on_positive_side(const Point_3_ &p) const;
typename R::Boolean has_on_negative_side(const Point_3_ &p) const; Boolean has_on_negative_side(const Point_3_ &p) const;
typename R_::Bounded_side bounded_side(const Point_3_ &p) const; Bounded_side bounded_side(const Point_3_ &p) const;
//! precond: ! x.is_degenerate() (when available) //! precond: ! x.is_degenerate() (when available)
// Returns R::ON_BOUNDED_SIDE, R::ON_BOUNDARY or R::ON_UNBOUNDED_SIDE // Returns R::ON_BOUNDED_SIDE, R::ON_BOUNDARY or R::ON_UNBOUNDED_SIDE
typename R::Boolean has_on_bounded_side(const Point_3_ &p) const; Boolean has_on_bounded_side(const Point_3_ &p) const;
typename R::Boolean has_on_unbounded_side(const Point_3_ &p) const; Boolean has_on_unbounded_side(const Point_3_ &p) const;
}; };
template < class R > template < class R >
@ -163,6 +165,7 @@ typename R::Oriented_side
SphereC3<R>:: SphereC3<R>::
oriented_side(const typename SphereC3<R>::Point_3_ &p) const oriented_side(const typename SphereC3<R>::Point_3_ &p) const
{ {
typedef typename R::Oriented_side Oriented_side;
return enum_cast<Oriented_side>(bounded_side(p)) * orientation(); return enum_cast<Oriented_side>(bounded_side(p)) * orientation();
} }
@ -172,6 +175,7 @@ typename R::Bounded_side
SphereC3<R>:: SphereC3<R>::
bounded_side(const typename SphereC3<R>::Point_3_ &p) const bounded_side(const typename SphereC3<R>::Point_3_ &p) const
{ {
typedef typename R::Bounded_side Bounded_side;
return enum_cast<Bounded_side>(compare(squared_radius(), return enum_cast<Bounded_side>(compare(squared_radius(),
squared_distance(center(), p))); squared_distance(center(), p)));
} }

View File

@ -143,7 +143,7 @@ oriented_side(const typename TetrahedronC3<R>::Point_3 &p) const
{ {
typename R::Orientation o = orientation(); typename R::Orientation o = orientation();
if (o != ZERO) if (o != ZERO)
return enum_cast<Oriented_side>(bounded_side(p)) * o; return enum_cast<typename R::Oriented_side>(bounded_side(p)) * o;
CGAL_kernel_assertion (!is_degenerate()); CGAL_kernel_assertion (!is_degenerate());
return ON_ORIENTED_BOUNDARY; return ON_ORIENTED_BOUNDARY;

View File

@ -25,6 +25,7 @@ namespace CGAL {
template <class R_> template <class R_>
class TriangleC3 class TriangleC3
{ {
typedef typename R_::Boolean Boolean;
typedef typename R_::FT FT; typedef typename R_::FT FT;
typedef typename R_::Point_3 Point_3; typedef typename R_::Point_3 Point_3;
typedef typename R_::Vector_3 Vector_3; typedef typename R_::Vector_3 Vector_3;
@ -44,13 +45,13 @@ public:
TriangleC3(const Point_3 &p, const Point_3 &q, const Point_3 &r) TriangleC3(const Point_3 &p, const Point_3 &q, const Point_3 &r)
: base{p, q, r} {} : base{p, q, r} {}
bool operator==(const TriangleC3 &t) const; Boolean operator==(const TriangleC3 &t) const;
bool operator!=(const TriangleC3 &t) const; Boolean operator!=(const TriangleC3 &t) const;
Plane_3 supporting_plane() const; Plane_3 supporting_plane() const;
bool has_on(const Point_3 &p) const; Boolean has_on(const Point_3 &p) const;
bool is_degenerate() const; Boolean is_degenerate() const;
const Point_3 & vertex(int i) const; const Point_3 & vertex(int i) const;
const Point_3 & operator[](int i) const; const Point_3 & operator[](int i) const;
@ -59,7 +60,7 @@ public:
}; };
template < class R > template < class R >
bool typename R::Boolean
TriangleC3<R>::operator==(const TriangleC3<R> &t) const TriangleC3<R>::operator==(const TriangleC3<R> &t) const
{ {
if (CGAL::identical(base, t.base)) if (CGAL::identical(base, t.base))
@ -75,7 +76,7 @@ TriangleC3<R>::operator==(const TriangleC3<R> &t) const
template < class R > template < class R >
inline inline
bool typename R::Boolean
TriangleC3<R>::operator!=(const TriangleC3<R> &t) const TriangleC3<R>::operator!=(const TriangleC3<R> &t) const
{ {
return !(*this == t); return !(*this == t);
@ -118,7 +119,7 @@ TriangleC3<R>::supporting_plane() const
template < class R > template < class R >
inline inline
bool typename R::Boolean
TriangleC3<R>:: TriangleC3<R>::
has_on(const typename TriangleC3<R>::Point_3 &p) const has_on(const typename TriangleC3<R>::Point_3 &p) const
{ {
@ -127,7 +128,7 @@ has_on(const typename TriangleC3<R>::Point_3 &p) const
} }
template < class R > template < class R >
bool typename R::Boolean
TriangleC3<R>::is_degenerate() const TriangleC3<R>::is_degenerate() const
{ {
return collinear(vertex(0),vertex(1),vertex(2)); return collinear(vertex(0),vertex(1),vertex(2));

View File

@ -107,7 +107,7 @@ public:
template < class R > template < class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
operator==(const VectorC2<R> &v, const VectorC2<R> &w) operator==(const VectorC2<R> &v, const VectorC2<R> &w)
{ {
return w.x() == v.x() && w.y() == v.y(); return w.x() == v.x() && w.y() == v.y();
@ -115,7 +115,7 @@ operator==(const VectorC2<R> &v, const VectorC2<R> &w)
template < class R > template < class R >
inline inline
bool typename R::Boolean
operator!=(const VectorC2<R> &v, const VectorC2<R> &w) operator!=(const VectorC2<R> &v, const VectorC2<R> &w)
{ {
return !(v == w); return !(v == w);
@ -123,7 +123,7 @@ operator!=(const VectorC2<R> &v, const VectorC2<R> &w)
template < class R > template < class R >
inline inline
bool typename R::Boolean
operator==(const VectorC2<R> &v, const Null_vector &) operator==(const VectorC2<R> &v, const Null_vector &)
{ {
return CGAL_NTS is_zero(v.x()) && CGAL_NTS is_zero(v.y()); return CGAL_NTS is_zero(v.x()) && CGAL_NTS is_zero(v.y());
@ -131,7 +131,7 @@ operator==(const VectorC2<R> &v, const Null_vector &)
template < class R > template < class R >
inline inline
bool typename R::Boolean
operator==(const Null_vector &n, const VectorC2<R> &v) operator==(const Null_vector &n, const VectorC2<R> &v)
{ {
return v == n; return v == n;
@ -139,7 +139,7 @@ operator==(const Null_vector &n, const VectorC2<R> &v)
template < class R > template < class R >
inline inline
bool typename R::Boolean
operator!=(const VectorC2<R> &v, const Null_vector &n) operator!=(const VectorC2<R> &v, const Null_vector &n)
{ {
return !(v == n); return !(v == n);
@ -147,7 +147,7 @@ operator!=(const VectorC2<R> &v, const Null_vector &n)
template < class R > template < class R >
inline inline
bool typename R::Boolean
operator!=(const Null_vector &n, const VectorC2<R> &v) operator!=(const Null_vector &n, const VectorC2<R> &v)
{ {
return !(v == n); return !(v == n);

View File

@ -142,15 +142,15 @@ public:
template < class R > template < class R >
inline inline
bool typename R::Boolean
operator==(const VectorC3<R> &v, const VectorC3<R> &w) operator==(const VectorC3<R> &v, const VectorC3<R> &w)
{ {
return w.x() == v.x() && w.y() == v.y() && w.z() == v.z(); return CGAL_AND_3(w.x() == v.x(), w.y() == v.y(), w.z() == v.z());
} }
template < class R > template < class R >
inline inline
bool typename R::Boolean
operator!=(const VectorC3<R> &v, const VectorC3<R> &w) operator!=(const VectorC3<R> &v, const VectorC3<R> &w)
{ {
return !(v == w); return !(v == w);
@ -158,16 +158,15 @@ operator!=(const VectorC3<R> &v, const VectorC3<R> &w)
template < class R > template < class R >
inline inline
bool typename R::Boolean
operator==(const VectorC3<R> &v, const Null_vector &) operator==(const VectorC3<R> &v, const Null_vector &)
{ {
return CGAL_NTS is_zero(v.x()) && CGAL_NTS is_zero(v.y()) && return CGAL_AND_3(CGAL_NTS is_zero(v.x()), CGAL_NTS is_zero(v.y()), CGAL_NTS is_zero(v.z()));
CGAL_NTS is_zero(v.z());
} }
template < class R > template < class R >
inline inline
bool typename R::Boolean
operator==(const Null_vector &n, const VectorC3<R> &v) operator==(const Null_vector &n, const VectorC3<R> &v)
{ {
return v == n; return v == n;
@ -175,7 +174,7 @@ operator==(const Null_vector &n, const VectorC3<R> &v)
template < class R > template < class R >
inline inline
bool typename R::Boolean
operator!=(const VectorC3<R> &v, const Null_vector &n) operator!=(const VectorC3<R> &v, const Null_vector &n)
{ {
return !(v == n); return !(v == n);
@ -183,7 +182,7 @@ operator!=(const VectorC3<R> &v, const Null_vector &n)
template < class R > template < class R >
inline inline
bool typename R::Boolean
operator!=(const Null_vector &n, const VectorC3<R> &v) operator!=(const Null_vector &n, const VectorC3<R> &v)
{ {
return !(v == n); return !(v == n);

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@ namespace CGAL {
template < class K > template < class K >
inline inline
bool typename K::Boolean
equal_xy(const PointC2<K> &p, const PointC2<K> &q) equal_xy(const PointC2<K> &p, const PointC2<K> &q)
{ {
return CGAL_AND( p.x() == q.x() , p.y() == q.y() ); return CGAL_AND( p.x() == q.x() , p.y() == q.y() );
@ -34,7 +34,7 @@ equal_xy(const PointC2<K> &p, const PointC2<K> &q)
// Unused, undocumented, un-functorized. // Unused, undocumented, un-functorized.
template < class K > template < class K >
inline inline
Comparison_result typename K::Comparison_result
compare_deltax_deltay(const PointC2<K>& p, compare_deltax_deltay(const PointC2<K>& p,
const PointC2<K>& q, const PointC2<K>& q,
const PointC2<K>& r, const PointC2<K>& r,
@ -46,7 +46,7 @@ compare_deltax_deltay(const PointC2<K>& p,
template < class K > template < class K >
inline inline
Comparison_result typename K::Comparison_result
compare_lexicographically_yx(const PointC2<K> &p, compare_lexicographically_yx(const PointC2<K> &p,
const PointC2<K> &q) const PointC2<K> &q)
{ {

View File

@ -24,7 +24,7 @@ namespace CGAL {
template < class K > template < class K >
inline inline
bool typename K::Boolean
equal_xy(const PointC3<K> &p, const PointC3<K> &q) equal_xy(const PointC3<K> &p, const PointC3<K> &q)
{ {
return K().equal_xy_3_object()(p, q); return K().equal_xy_3_object()(p, q);
@ -32,7 +32,7 @@ equal_xy(const PointC3<K> &p, const PointC3<K> &q)
template < class K > template < class K >
inline inline
bool typename K::Boolean
equal_xyz(const PointC3<K> &p, const PointC3<K> &q) equal_xyz(const PointC3<K> &p, const PointC3<K> &q)
{ {
return p.x() == q.x() && p.y() == q.y() && p.z() == q.z(); return p.x() == q.x() && p.y() == q.y() && p.z() == q.z();
@ -40,7 +40,7 @@ equal_xyz(const PointC3<K> &p, const PointC3<K> &q)
template < class K > template < class K >
inline inline
Comparison_result typename K::Comparison_result
compare_xy(const PointC3<K> &p, const PointC3<K> &q) compare_xy(const PointC3<K> &p, const PointC3<K> &q)
{ {
return K().compare_xy_3_object()(p, q); return K().compare_xy_3_object()(p, q);
@ -48,7 +48,7 @@ compare_xy(const PointC3<K> &p, const PointC3<K> &q)
template < class K > template < class K >
inline inline
Comparison_result typename K::Comparison_result
compare_lexicographically_xy(const PointC3<K> &p, const PointC3<K> &q) compare_lexicographically_xy(const PointC3<K> &p, const PointC3<K> &q)
{ {
return K().compare_xy_3_object()(p, q); return K().compare_xy_3_object()(p, q);
@ -56,7 +56,7 @@ compare_lexicographically_xy(const PointC3<K> &p, const PointC3<K> &q)
template < class K > template < class K >
inline inline
bool typename K::Boolean
lexicographically_xy_smaller_or_equal(const PointC3<K> &p, lexicographically_xy_smaller_or_equal(const PointC3<K> &p,
const PointC3<K> &q) const PointC3<K> &q)
{ {
@ -65,7 +65,7 @@ lexicographically_xy_smaller_or_equal(const PointC3<K> &p,
template < class K > template < class K >
inline inline
bool typename K::Boolean
lexicographically_xy_smaller(const PointC3<K> &p, lexicographically_xy_smaller(const PointC3<K> &p,
const PointC3<K> &q) const PointC3<K> &q)
{ {
@ -74,7 +74,7 @@ lexicographically_xy_smaller(const PointC3<K> &p,
template < class K > template < class K >
inline inline
bool typename K::Boolean
strict_dominance(const PointC3<K> &p, strict_dominance(const PointC3<K> &p,
const PointC3<K> &q) const PointC3<K> &q)
{ {
@ -84,7 +84,7 @@ strict_dominance(const PointC3<K> &p,
template < class K > template < class K >
inline inline
bool typename K::Boolean
dominance(const PointC3<K> &p, dominance(const PointC3<K> &p,
const PointC3<K> &q) const PointC3<K> &q)
{ {

View File

@ -421,6 +421,7 @@ typename Same_uncertainty_nt<Angle, FT>::type
angleC2(const FT &ux, const FT &uy, angleC2(const FT &ux, const FT &uy,
const FT &vx, const FT &vy) const FT &vx, const FT &vy)
{ {
typedef typename Same_uncertainty_nt<Angle, FT>::type Angle;
return enum_cast<Angle>(CGAL_NTS sign(ux*vx + uy*vy)); return enum_cast<Angle>(CGAL_NTS sign(ux*vx + uy*vy));
} }
@ -431,6 +432,7 @@ angleC2(const FT &px, const FT &py,
const FT &qx, const FT &qy, const FT &qx, const FT &qy,
const FT &rx, const FT &ry) const FT &rx, const FT &ry)
{ {
typedef typename Same_uncertainty_nt<Angle, FT>::type Angle;
return enum_cast<Angle>(CGAL_NTS sign((px-qx)*(rx-qx)+(py-qy)*(ry-qy))); return enum_cast<Angle>(CGAL_NTS sign((px-qx)*(rx-qx)+(py-qy)*(ry-qy)));
} }
@ -442,6 +444,7 @@ angleC2(const FT &px, const FT &py,
const FT &rx, const FT &ry, const FT &rx, const FT &ry,
const FT &sx, const FT &sy) const FT &sx, const FT &sy)
{ {
typedef typename Same_uncertainty_nt<Angle, FT>::type Angle;
return enum_cast<Angle>(CGAL_NTS sign((px-qx)*(rx-sx)+(py-qy)*(ry-sy))); return enum_cast<Angle>(CGAL_NTS sign((px-qx)*(rx-sx)+(py-qy)*(ry-sy)));
} }
@ -508,6 +511,7 @@ side_of_bounded_circleC2(const FT &px, const FT &py,
const FT &rx, const FT &ry, const FT &rx, const FT &ry,
const FT &tx, const FT &ty) const FT &tx, const FT &ty)
{ {
typedef typename Same_uncertainty_nt<Bounded_side, FT>::type Bounded_side;
return enum_cast<Bounded_side>( side_of_oriented_circleC2(px,py,qx,qy,rx,ry,tx,ty) return enum_cast<Bounded_side>( side_of_oriented_circleC2(px,py,qx,qy,rx,ry,tx,ty)
* orientationC2(px,py,qx,qy,rx,ry) ); * orientationC2(px,py,qx,qy,rx,ry) );
} }
@ -520,8 +524,8 @@ side_of_bounded_circleC2(const FT &px, const FT &py,
const FT &tx, const FT &ty) const FT &tx, const FT &ty)
{ {
// Returns whether T lies inside or outside the circle which diameter is PQ. // Returns whether T lies inside or outside the circle which diameter is PQ.
return enum_cast<Bounded_side>( typedef typename Same_uncertainty_nt<Bounded_side, FT>::type Bounded_side;
CGAL_NTS compare((tx-px)*(qx-tx), (ty-py)*(ty-qy)) ); return enum_cast<Bounded_side>(CGAL_NTS compare((tx-px)*(qx-tx), (ty-py)*(ty-qy)) );
} }
template < class FT > template < class FT >
@ -630,7 +634,7 @@ side_of_oriented_lineC2(const FT &a, const FT &b, const FT &c,
} }
template <class FT> template <class FT>
Comparison_result typename Compare<FT>::result_type
compare_power_distanceC2(const FT& px, const FT& py, const FT& pwt, compare_power_distanceC2(const FT& px, const FT& py, const FT& pwt,
const FT& qx, const FT& qy, const FT& qwt, const FT& qx, const FT& qy, const FT& qwt,
const FT& rx, const FT& ry) const FT& rx, const FT& ry)
@ -643,24 +647,25 @@ compare_power_distanceC2(const FT& px, const FT& py, const FT& pwt,
template <class FT> template <class FT>
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
Bounded_side typename Same_uncertainty_nt<Bounded_side, FT>::type
power_side_of_bounded_power_circleC2(const FT &px, const FT &py, const FT &pw, power_side_of_bounded_power_circleC2(const FT &px, const FT &py, const FT &pw,
const FT &qx, const FT &qy, const FT &qw, const FT &qx, const FT &qy, const FT &qw,
const FT &tx, const FT &ty, const FT &tw) const FT &tx, const FT &ty, const FT &tw)
{ {
typedef typename Same_uncertainty_nt<Bounded_side, FT>::type Bounded_side;
FT dpx = px - qx; FT dpx = px - qx;
FT dpy = py - qy; FT dpy = py - qy;
FT dtx = tx - qx; FT dtx = tx - qx;
FT dty = ty - qy; FT dty = ty - qy;
FT dpz = CGAL_NTS square(dpx) + CGAL_NTS square(dpy); FT dpz = CGAL_NTS square(dpx) + CGAL_NTS square(dpy);
return enum_cast<Bounded_side> return enum_cast<Bounded_side>(CGAL_NTS sign(-(CGAL_NTS square(dtx) + CGAL_NTS square(dty)-tw+qw)*dpz
(CGAL_NTS sign(-(CGAL_NTS square(dtx) + CGAL_NTS square(dty)-tw+qw)*dpz
+(dpz-pw+qw)*(dpx*dtx+dpy*dty))); +(dpz-pw+qw)*(dpx*dtx+dpy*dty)));
} }
template <class FT> template <class FT>
Oriented_side typename Same_uncertainty_nt<Oriented_side, FT>::type
power_side_of_oriented_power_circleC2(const FT &px, const FT &py, const FT &pwt, power_side_of_oriented_power_circleC2(const FT &px, const FT &py, const FT &pwt,
const FT &qx, const FT &qy, const FT &qwt, const FT &qx, const FT &qy, const FT &qwt,
const FT &rx, const FT &ry, const FT &rwt, const FT &rx, const FT &ry, const FT &rwt,
@ -685,7 +690,7 @@ power_side_of_oriented_power_circleC2(const FT &px, const FT &py, const FT &pwt,
} }
template <class FT> template <class FT>
Oriented_side typename Same_uncertainty_nt<Oriented_side, FT>::type
power_side_of_oriented_power_circleC2(const FT &px, const FT &py, const FT &pwt, power_side_of_oriented_power_circleC2(const FT &px, const FT &py, const FT &pwt,
const FT &qx, const FT &qy, const FT &qwt, const FT &qx, const FT &qy, const FT &qwt,
const FT &tx, const FT &ty, const FT &twt) const FT &tx, const FT &ty, const FT &twt)
@ -709,7 +714,7 @@ power_side_of_oriented_power_circleC2(const FT &px, const FT &py, const FT &pwt,
} }
template <class FT> template <class FT>
Oriented_side typename Same_uncertainty_nt<Oriented_side, FT>::type
circumcenter_oriented_side_of_oriented_segmentC2(const FT& ax, const FT& ay, circumcenter_oriented_side_of_oriented_segmentC2(const FT& ax, const FT& ay,
const FT& bx, const FT& by, const FT& bx, const FT& by,
const FT& p0x, const FT& p0y, const FT& p0x, const FT& p0y,

View File

@ -143,6 +143,7 @@ typename Same_uncertainty_nt<Angle, FT>::type
angleC3(const FT &ux, const FT &uy, const FT &uz, angleC3(const FT &ux, const FT &uy, const FT &uz,
const FT &vx, const FT &vy, const FT &vz) const FT &vx, const FT &vy, const FT &vz)
{ {
typedef typename Same_uncertainty_nt<CGAL::Angle, FT>::type Angle;
return enum_cast<Angle>(CGAL_NTS sign(ux*vx + uy*vy + uz*vz)); return enum_cast<Angle>(CGAL_NTS sign(ux*vx + uy*vy + uz*vz));
} }
@ -153,6 +154,7 @@ angleC3(const FT &px, const FT &py, const FT &pz,
const FT &qx, const FT &qy, const FT &qz, const FT &qx, const FT &qy, const FT &qz,
const FT &rx, const FT &ry, const FT &rz) const FT &rx, const FT &ry, const FT &rz)
{ {
typedef typename Same_uncertainty_nt<CGAL::Angle, FT>::type Angle;
return enum_cast<Angle>(CGAL_NTS sign((px-qx)*(rx-qx)+ return enum_cast<Angle>(CGAL_NTS sign((px-qx)*(rx-qx)+
(py-qy)*(ry-qy)+ (py-qy)*(ry-qy)+
(pz-qz)*(rz-qz))); (pz-qz)*(rz-qz)));
@ -166,6 +168,7 @@ angleC3(const FT &px, const FT &py, const FT &pz,
const FT &rx, const FT &ry, const FT &rz, const FT &rx, const FT &ry, const FT &rz,
const FT &sx, const FT &sy, const FT &sz) const FT &sx, const FT &sy, const FT &sz)
{ {
typedef typename Same_uncertainty_nt<CGAL::Angle, FT>::type Angle;
return enum_cast<Angle>(CGAL_NTS sign((px-qx)*(rx-sx)+ return enum_cast<Angle>(CGAL_NTS sign((px-qx)*(rx-sx)+
(py-qy)*(ry-sy)+ (py-qy)*(ry-sy)+
(pz-qz)*(rz-sz))); (pz-qz)*(rz-sz)));
@ -220,6 +223,8 @@ coplanar_side_of_bounded_circleC3(const FT &px, const FT &py, const FT &pz,
const FT &rx, const FT &ry, const FT &rz, const FT &rx, const FT &ry, const FT &rz,
const FT &tx, const FT &ty, const FT &tz) const FT &tx, const FT &ty, const FT &tz)
{ {
typedef typename Same_uncertainty_nt<CGAL::Bounded_side, FT>::type Bounded_side;
// The approach is to compute side_of_bounded_sphere(p,q,r,t+v,t), // The approach is to compute side_of_bounded_sphere(p,q,r,t+v,t),
// with v = pq ^ pr. // with v = pq ^ pr.
// Note : since the circle defines the orientation of the plane, it can not // Note : since the circle defines the orientation of the plane, it can not
@ -373,6 +378,7 @@ side_of_bounded_sphereC3(const FT &px, const FT &py, const FT &pz,
const FT &sx, const FT &sy, const FT &sz, const FT &sx, const FT &sy, const FT &sz,
const FT &tx, const FT &ty, const FT &tz) const FT &tx, const FT &ty, const FT &tz)
{ {
typedef typename Same_uncertainty_nt<CGAL::Bounded_side, FT>::type Bounded_side;
return enum_cast<Bounded_side>( side_of_oriented_sphereC3(px, py, pz, return enum_cast<Bounded_side>( side_of_oriented_sphereC3(px, py, pz,
qx, qy, qz, qx, qy, qz,
rx, ry, rz, rx, ry, rz,
@ -392,6 +398,7 @@ side_of_bounded_sphereC3(const FT &px, const FT &py, const FT &pz,
const FT &tx, const FT &ty, const FT &tz) const FT &tx, const FT &ty, const FT &tz)
{ {
// Returns whether T lies inside or outside the sphere which diameter is PQ. // Returns whether T lies inside or outside the sphere which diameter is PQ.
typedef typename Same_uncertainty_nt<CGAL::Bounded_side, FT>::type Bounded_side;
return enum_cast<Bounded_side>( CGAL_NTS sign((tx-px)*(qx-tx) return enum_cast<Bounded_side>( CGAL_NTS sign((tx-px)*(qx-tx)
+ (ty-py)*(qy-ty) + (ty-py)*(qy-ty)
+ (tz-pz)*(qz-tz)) ); + (tz-pz)*(qz-tz)) );
@ -420,9 +427,9 @@ side_of_bounded_sphereC3(const FT &px, const FT &py, const FT &pz,
{ {
// Returns whether T lies inside or outside the sphere which equatorial // Returns whether T lies inside or outside the sphere which equatorial
// circle is PQR. // circle is PQR.
typedef typename Same_uncertainty_nt<CGAL::Bounded_side, FT>::type Bounded_side;
// This code is inspired by the one of circumcenterC3(3 points). // This code is inspired by the one of circumcenterC3(3 points).
FT psx = px-sx; FT psx = px-sx;
FT psy = py-sy; FT psy = py-sy;
FT psz = pz-sz; FT psz = pz-sz;
@ -688,7 +695,7 @@ power_side_of_oriented_power_sphereC3(const FT &pwt, const FT &qwt)
} }
template < class FT > template < class FT >
Comparison_result typename Compare<FT>::result_type
compare_power_distanceC3(const FT &px, const FT &py, const FT &pz, compare_power_distanceC3(const FT &px, const FT &py, const FT &pz,
const FT &qx, const FT &qy, const FT &qz, const FT &qw, const FT &qx, const FT &qy, const FT &qz, const FT &qw,
const FT &rx, const FT &ry, const FT &rz, const FT &rw) const FT &rx, const FT &ry, const FT &rz, const FT &rw)
@ -715,6 +722,8 @@ power_side_of_bounded_power_sphereC3(
const FT &rx, const FT &ry, const FT &rz, const FT &rw, const FT &rx, const FT &ry, const FT &rz, const FT &rw,
const FT &sx, const FT &sy, const FT &sz, const FT &sw) const FT &sx, const FT &sy, const FT &sz, const FT &sw)
{ {
typedef typename Same_uncertainty_nt<Bounded_side, FT>::type Bounded_side;
// Translate p to origin and compute determinants // Translate p to origin and compute determinants
FT qpx = qx-px; FT qpx = qx-px;
FT qpy = qy-py; FT qpy = qy-py;
@ -765,6 +774,8 @@ power_side_of_bounded_power_sphereC3(
const FT &qx, const FT &qy, const FT &qz, const FT &qw, const FT &qx, const FT &qy, const FT &qz, const FT &qw,
const FT &rx, const FT &ry, const FT &rz, const FT &rw) const FT &rx, const FT &ry, const FT &rz, const FT &rw)
{ {
typedef typename Same_uncertainty_nt<Bounded_side, FT>::type Bounded_side;
FT FT2(2); FT FT2(2);
FT dpx = px - qx; FT dpx = px - qx;
FT dpy = py - qy; FT dpy = py - qy;

View File

@ -5,6 +5,7 @@ typedef CGAL::Exact_circular_kernel_2 Circular_k;
typedef CGAL::Point_2<Circular_k> Point_2; typedef CGAL::Point_2<Circular_k> Point_2;
typedef CGAL::Circular_arc_2<Circular_k> Circular_arc_2; typedef CGAL::Circular_arc_2<Circular_k> Circular_arc_2;
typedef CGAL::Circular_arc_point_2<Circular_k> Circular_arc_point_2;
int main() int main()
{ {
@ -13,8 +14,8 @@ int main()
for(int i = 0; i <= 10; i++) { for(int i = 0; i <= 10; i++) {
for(int j = 0; j <= 10; j++) { for(int j = 0; j <= 10; j++) {
Point_2 p = Point_2(i, j); Circular_arc_point_2 cap(Point_2(i, j));
if(Circular_k().has_on_2_object()(c,p)) { if(Circular_k().has_on_2_object()(c,cap)) {
n++; n++;
std::cout << "(" << i << "," << j << ")" << std::endl; std::cout << "(" << i << "," << j << ")" << std::endl;
} }

View File

@ -31,25 +31,29 @@ namespace CGAL {
namespace CircularFunctors { namespace CircularFunctors {
template < class CK > template < class CK >
class Construct_circle_2 : public CK::Linear_kernel::Construct_circle_2 class Construct_circle_2
// : public CK::Linear_kernel::Construct_circle_2
{ {
typedef typename CK::Linear_kernel::Construct_circle_2 Base_functor;
typedef typename CK::FT FT; typedef typename CK::FT FT;
typedef typename CK::Linear_kernel::Point_2 Point_2; typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Linear_kernel::Construct_circle_2 Linear_Construct_circle_2;
public: public:
typedef typename Base_functor::result_type result_type; // using Linear_Construct_circle_2::operator();
using Base_functor::operator(); template <class... Args>
decltype(auto)
operator()(const Args&... args) const
{ return Linear_Construct_circle_2()(args...); }
typedef typename CK::Circular_arc_2 Circular_arc_2; Circle_2
result_type
operator() ( const typename CK::Polynomial_for_circles_2_2 &eq ) { operator() ( const typename CK::Polynomial_for_circles_2_2 &eq ) {
return construct_circle_2<CK>(eq); return construct_circle_2<CK>(eq);
} }
result_type decltype(auto)
operator() (const Circular_arc_2 & a) const { operator() (const Circular_arc_2 & a) const {
return (a.rep().supporting_circle()); return (a.rep().supporting_circle());
} }

View File

@ -30,26 +30,32 @@ namespace CGAL {
namespace LinearFunctors { namespace LinearFunctors {
template < class CK > template < class CK >
class Construct_line_2 : public CK::Linear_kernel::Construct_line_2 class Construct_line_2
// : public CK::Linear_kernel::Construct_line_2
{ {
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Line_2 Line_2; typedef typename CK::Line_2 Line_2;
public:
typedef typename CK::Linear_kernel::Construct_line_2::result_type typedef typename CK::Linear_kernel::Construct_line_2 Linear_Construct_circle_2;
result_type;
using CK::Linear_kernel::Construct_line_2::operator();
result_type operator() (const Line_arc_2 & a) const public:
// using CK::Linear_kernel::Construct_line_2::operator();
template <class... Args>
decltype(auto)
operator()(const Args&... args) const
{ return Linear_Construct_circle_2()(args...); }
decltype(auto) operator() (const Line_arc_2 & a) const
{ {
return (a.rep().supporting_line()); return (a.rep().supporting_line());
} }
result_type Line_2
operator() ( const typename CK::Polynomial_1_2 &eq ) operator() ( const typename CK::Polynomial_1_2 &eq )
{ {
return construct_line_2<CK>(eq); return construct_line_2<CK>(eq);
} }
}; };
} // namespace LinearFunctors } // namespace LinearFunctors

View File

@ -30,148 +30,115 @@
namespace CGAL { namespace CGAL {
namespace CircularFunctors { namespace CircularFunctors {
#define CGAL_CIRCULAR_KERNEL_MACRO_FUNCTOR_COMPARE_(V)\
template < class CK > \
class Compare_ ##V## _2 {\
/*: public CK::Linear_kernel::Compare_ ##V## _2{*/\
typedef typename CK::Comparison_result Comparison_result;\
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;\
typedef typename CK::Linear_kernel::Compare_ ##V## _2 Linear_Compare_ ##V## _2;\
public:\
template <class... Args>\
Comparison_result\
operator()(const Args&... args) const\
{ return Linear_Compare_ ##V## _2()(args...); }\
/*using CK::Linear_kernel::Compare_ ##V## _2::operator();*/\
Comparison_result\
operator() (const Circular_arc_point_2 &p0,\
const Circular_arc_point_2 &p1) const\
{ return CircularFunctors::compare_ ##V <CK>(p0, p1); }\
};\
template < class CK > CGAL_CIRCULAR_KERNEL_MACRO_FUNCTOR_COMPARE_(x)
class Compare_x_2 CGAL_CIRCULAR_KERNEL_MACRO_FUNCTOR_COMPARE_(y)
: public CK::Linear_kernel::Compare_x_2 CGAL_CIRCULAR_KERNEL_MACRO_FUNCTOR_COMPARE_(xy)
{
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Point_2 Point_2;
public: #undef CGAL_CIRCULAR_KERNEL_MACRO_FUNCTOR_COMPARE_
typedef typename CK::Linear_kernel::Compare_x_2::result_type result_type;
using CK::Linear_kernel::Compare_x_2::operator();
result_type
operator() (const Circular_arc_point_2 &p0,
const Circular_arc_point_2 &p1) const
{ return CircularFunctors::compare_x<CK>(p0, p1);}
};
template < class CK >
class Compare_y_2
: public CK::Linear_kernel::Compare_y_2
{
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Point_2 Point_2;
public:
typedef typename CK::Linear_kernel::Compare_y_2::result_type result_type;
using CK::Linear_kernel::Compare_y_2::operator();
result_type
operator() (const Circular_arc_point_2 &p0,
const Circular_arc_point_2 &p1) const
{return CircularFunctors::compare_y<CK>(p0, p1);}
};
template < class CK >
class Compare_xy_2
: public CK::Linear_kernel::Compare_xy_2
{
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Point_2 Point_2;
public:
typedef typename CK::Linear_kernel::Compare_xy_2::result_type result_type;
using CK::Linear_kernel::Compare_xy_2::operator();
result_type
operator() (const Circular_arc_point_2 &p0,
const Circular_arc_point_2 &p1) const
{ return CircularFunctors::compare_xy<CK>(p0, p1);}
};
template < class CK > template < class CK >
class In_x_range_2 class In_x_range_2
{ {
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
public: public:
typedef bool result_type; Boolean
result_type
operator()(const Circular_arc_2 &a, const Circular_arc_point_2 &p) const operator()(const Circular_arc_2 &a, const Circular_arc_point_2 &p) const
{ return CircularFunctors::point_in_x_range<CK>(a, p); } { return CircularFunctors::point_in_x_range<CK>(a, p); }
result_type Boolean
operator()(const Line_arc_2 &a, const Circular_arc_point_2 &p) const operator()(const Line_arc_2 &a, const Circular_arc_point_2 &p) const
{ return CircularFunctors::point_in_x_range<CK>(a, p); } { return CircularFunctors::point_in_x_range<CK>(a, p); }
}; };
template < class CK > template < class CK >
class Has_on_2 class Has_on_2
: public CK::Linear_kernel::Has_on_2 // : public CK::Linear_kernel::Has_on_2
{ {
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circle_2 Circle_2; typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Line_2 Line_2; typedef typename CK::Line_2 Line_2;
typedef typename CK::Linear_kernel::Has_on_2 Linear_Has_on_2;
public: public:
typedef typename CK::Linear_kernel::Has_on_2::result_type result_type; // using CK::Linear_kernel::Has_on_2::operator();
using CK::Linear_kernel::Has_on_2::operator(); template <typename A, typename B>
Boolean
operator()(const A& a, const B& b) const
{ return Linear_Has_on_2()(a, b); }
result_type Boolean
operator()(const Circle_2 &a, const Circular_arc_point_2 &p) const operator()(const Circle_2 &a, const Circular_arc_point_2 &p) const
{ return CircularFunctors::has_on<CK>(a, p); } { return CircularFunctors::has_on<CK>(a, p); }
result_type Boolean
operator()(const Line_2 &a, const Circular_arc_point_2 &p) const operator()(const Line_2 &a, const Circular_arc_point_2 &p) const
{ return LinearFunctors::has_on<CK>(a, p); } { return LinearFunctors::has_on<CK>(a, p); }
result_type Boolean
operator()(const Circular_arc_2 &a, const Circular_arc_point_2 &p) const operator()(const Circular_arc_2 &a, const Circular_arc_point_2 &p) const
{ return CircularFunctors::has_on<CK>(a, p); } { return CircularFunctors::has_on<CK>(a, p); }
result_type Boolean
operator()(const Line_arc_2 &a, const Circular_arc_point_2 &p) const operator()(const Line_arc_2 &a, const Circular_arc_point_2 &p) const
{ return CircularFunctors::has_on<CK>(a, p); } { return CircularFunctors::has_on<CK>(a, p); }
}; };
template < class CK > template < class CK >
class Compare_y_to_right_2 class Compare_y_to_right_2
{ {
typedef typename CK::Comparison_result Comparison_result;
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
public: public:
typedef CGAL::Comparison_result result_type; Comparison_result
result_type
operator()(const Circular_arc_2 &a1, operator()(const Circular_arc_2 &a1,
const Circular_arc_2 &a2, const Circular_arc_2 &a2,
const Circular_arc_point_2 &p) const const Circular_arc_point_2 &p) const
{ return CircularFunctors::compare_y_to_right<CK>(a1, a2, p); } { return CircularFunctors::compare_y_to_right<CK>(a1, a2, p); }
result_type Comparison_result
operator()(const Line_arc_2 &a1, operator()(const Line_arc_2 &a1,
const Line_arc_2 &a2, const Line_arc_2 &a2,
const Circular_arc_point_2 &p) const const Circular_arc_point_2 &p) const
{ return CircularFunctors::compare_y_to_right<CK>(a1, a2, p); } { return CircularFunctors::compare_y_to_right<CK>(a1, a2, p); }
result_type Comparison_result
operator()(const Line_arc_2 &a1, operator()(const Line_arc_2 &a1,
const Circular_arc_2 &a2, const Circular_arc_2 &a2,
const Circular_arc_point_2 &p) const const Circular_arc_point_2 &p) const
{ return CircularFunctors::compare_y_to_right<CK>(a1, a2, p); } { return CircularFunctors::compare_y_to_right<CK>(a1, a2, p); }
result_type Comparison_result
operator()(const Circular_arc_2 &a1, operator()(const Circular_arc_2 &a1,
const Line_arc_2 &a2, const Line_arc_2 &a2,
const Circular_arc_point_2 &p) const const Circular_arc_point_2 &p) const
@ -179,21 +146,16 @@ namespace CircularFunctors {
return CGAL::SMALLER; return CGAL::SMALLER;
return CGAL::LARGER; return CGAL::LARGER;
} }
}; };
template < class CK > template < class CK >
class Equal_2 class Equal_2
: public CK::Linear_kernel::Equal_2 // : public CK::Linear_kernel::Equal_2
{ {
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef typename CK::Linear_kernel LK;
typedef typename LK::Equal_2 LK_Equal_2;
typedef typename CK::Point_2 Point_2; typedef typename CK::Point_2 Point_2;
typedef typename CK::Vector_2 Vector_2; typedef typename CK::Vector_2 Vector_2;
typedef typename CK::Direction_2 Direction_2; typedef typename CK::Direction_2 Direction_2;
@ -204,69 +166,78 @@ namespace CircularFunctors {
typedef typename CK::Iso_rectangle_2 Iso_rectangle_2; typedef typename CK::Iso_rectangle_2 Iso_rectangle_2;
typedef typename CK::Circle_2 Circle_2; typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Linear_kernel::Equal_2 Linear_Equal_2;
typedef typename CK::Linear_kernel::Equal_2::result_type result_type; public:
using CK::Linear_kernel::Equal_2::operator(); // using CK::Linear_kernel::Equal_2::operator();
result_type template <typename A, typename B>
Boolean
operator()(const A& a, const B& b) const {
return Linear_Equal_2()(a, b);
}
Boolean
operator() (const Circular_arc_point_2 &p0, operator() (const Circular_arc_point_2 &p0,
const Circular_arc_point_2 &p1) const const Circular_arc_point_2 &p1) const
{ return CircularFunctors::equal<CK>(p0, p1); } { return CircularFunctors::equal<CK>(p0, p1); }
result_type Boolean
operator() (const Circular_arc_2 &a0, const Circular_arc_2 &a1) const operator() (const Circular_arc_2 &a0, const Circular_arc_2 &a1) const
{ return CircularFunctors::equal<CK>(a0, a1); } { return CircularFunctors::equal<CK>(a0, a1); }
result_type Boolean
operator() (const Line_arc_2 &a0, const Line_arc_2 &a1) const operator() (const Line_arc_2 &a0, const Line_arc_2 &a1) const
{ return CircularFunctors::equal<CK>(a0, a1); } { return CircularFunctors::equal<CK>(a0, a1); }
}; };
template < class CK > template < class CK >
class Compare_y_at_x_2 : public CK::Linear_kernel::Compare_y_at_x_2 class Compare_y_at_x_2
// : public CK::Linear_kernel::Compare_y_at_x_2
{ {
typedef typename CK::Comparison_result Comparison_result;
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Linear_kernel::Compare_y_at_x_2 Linear_Compare_y_at_x_2;
public: public:
typedef typename CK::Linear_kernel::Compare_y_at_x_2::result_type result_type; // using CK::Linear_kernel::Compare_y_at_x_2::operator();
using CK::Linear_kernel::Compare_y_at_x_2::operator(); template <class... Args>
Comparison_result
operator()(const Args&... args) const
{ return Linear_Compare_y_at_x_2()(args...); }
result_type Comparison_result
operator() (const Circular_arc_point_2 &p, operator() (const Circular_arc_point_2 &p,
const Circular_arc_2 &A1) const const Circular_arc_2 &A1) const
{ return CircularFunctors::compare_y_at_x<CK>(p, A1); } { return CircularFunctors::compare_y_at_x<CK>(p, A1); }
result_type Comparison_result
operator() (const Circular_arc_point_2 &p, operator() (const Circular_arc_point_2 &p,
const Line_arc_2 &A1) const const Line_arc_2 &A1) const
{ return CircularFunctors::compare_y_at_x<CK>(p, A1); } { return CircularFunctors::compare_y_at_x<CK>(p, A1); }
}; };
template < class CK > template < class CK >
class Do_overlap_2 class Do_overlap_2
{ {
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
public: public:
typedef bool result_type; Boolean
result_type
operator() (const Circular_arc_2 &A1, const Circular_arc_2 &A2) const operator() (const Circular_arc_2 &A1, const Circular_arc_2 &A2) const
{ return CircularFunctors::do_overlap<CK>(A1, A2); } { return CircularFunctors::do_overlap<CK>(A1, A2); }
result_type Boolean
operator() (const Line_arc_2 &A1, const Line_arc_2 &A2) const operator() (const Line_arc_2 &A1, const Line_arc_2 &A2) const
{ return CircularFunctors::do_overlap<CK>(A1, A2); } { return CircularFunctors::do_overlap<CK>(A1, A2); }
}; };
template < class CK > template < class CK >
class Make_x_monotone_2 class Make_x_monotone_2
{ {
@ -274,9 +245,6 @@ namespace CircularFunctors {
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
public: public:
typedef void result_type; //!!!
template < class OutputIterator > template < class OutputIterator >
OutputIterator OutputIterator
operator()(const Circular_arc_2 &A, OutputIterator res) const operator()(const Circular_arc_2 &A, OutputIterator res) const
@ -290,7 +258,6 @@ namespace CircularFunctors {
{ {
return CircularFunctors::make_x_monotone<CK>(A,res); return CircularFunctors::make_x_monotone<CK>(A,res);
} }
}; };
template < class CK > template < class CK >
@ -300,9 +267,6 @@ namespace CircularFunctors {
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
public: public:
typedef void result_type; //!!!
template < class OutputIterator > template < class OutputIterator >
OutputIterator OutputIterator
operator()(const Circular_arc_2 &A, OutputIterator res) const operator()(const Circular_arc_2 &A, OutputIterator res) const
@ -326,19 +290,21 @@ namespace CircularFunctors {
{ *res++ = make_object(A); { *res++ = make_object(A);
return res; return res;
} }
}; };
template < class CK > template < class CK >
class Do_intersect_2 class Do_intersect_2
: public CK::Linear_kernel::Do_intersect_2 // : public CK::Linear_kernel::Do_intersect_2
{ {
typedef typename CK::Boolean Boolean;
typedef typename CK::Linear_kernel::Do_intersect_2 Linear_Do_intersect_2;
public: public:
typedef typename CK::Linear_kernel::Do_intersect_2::result_type result_type; template <typename A, typename B>
template <class T1, class T2> Boolean
result_type operator()(const A& a, const B& b) const
operator()(const T1& t1, const T2& t2) const { return Intersections::internal::do_intersect(a, b, CK()); }
{ return Intersections::internal::do_intersect(t1, t2, CK()); }
}; };
template < class CK > template < class CK >
@ -347,14 +313,12 @@ namespace CircularFunctors {
//using the Lazy_kernel as linear kernel. //using the Lazy_kernel as linear kernel.
//: public CK::Linear_kernel::Intersect_2 //: public CK::Linear_kernel::Intersect_2
{ {
typedef typename CK::Circle_2 Circle; typedef typename CK::Circle_2 Circle;
typedef typename CK::Circular_arc_2 Circular_arc; typedef typename CK::Circular_arc_2 Circular_arc;
typedef typename CK::Line_arc_2 Line_arc; typedef typename CK::Line_arc_2 Line_arc;
typedef typename CK::Line_2 Line; typedef typename CK::Line_2 Line;
public: public:
//using CK::Linear_kernel::Intersect_2::operator(); //using CK::Linear_kernel::Intersect_2::operator();
template<class A, class B> template<class A, class B>
@ -460,7 +424,6 @@ namespace CircularFunctors {
*res++=typename CK::Linear_kernel::Intersect_2()(l1, l2); *res++=typename CK::Linear_kernel::Intersect_2()(l1, l2);
return res; return res;
} }
}; };
template < class CK > template < class CK >
@ -470,61 +433,61 @@ namespace CircularFunctors {
typename CK::Polynomial_1_2 typename CK::Polynomial_1_2
operator() ( const typename CK::Line_2 & l ) operator() ( const typename CK::Line_2 & l )
{ {
return LinearFunctors::get_equation<CK>(l); return LinearFunctors::get_equation<CK>(l);
} }
typename CK::Polynomial_for_circles_2_2 typename CK::Polynomial_for_circles_2_2
operator() ( const typename CK::Circle_2 & c ) operator() ( const typename CK::Circle_2 & c )
{ {
return CircularFunctors::get_equation<CK>(c); return CircularFunctors::get_equation<CK>(c);
} }
}; };
template < class CK > template < class CK >
class Split_2 class Split_2
{ {
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
public: public:
void
typedef void result_type;
result_type
operator()(const Circular_arc_2 &A, operator()(const Circular_arc_2 &A,
const Circular_arc_point_2 &p, const Circular_arc_point_2 &p,
Circular_arc_2 &ca1, Circular_arc_2 &ca2) const Circular_arc_2 &ca1, Circular_arc_2 &ca2) const
{ return CircularFunctors::split<CK>(A, p, ca1, ca2); } { return CircularFunctors::split<CK>(A, p, ca1, ca2); }
void
result_type
operator()(const Line_arc_2 &A, operator()(const Line_arc_2 &A,
const Circular_arc_point_2 &p, const Circular_arc_point_2 &p,
Line_arc_2 &ca1, Line_arc_2 &ca2) const Line_arc_2 &ca1, Line_arc_2 &ca2) const
{ return CircularFunctors::split<CK>(A, p, ca1, ca2); } { return CircularFunctors::split<CK>(A, p, ca1, ca2); }
}; };
template < class CK > template < class CK >
class Is_vertical_2 class Is_vertical_2
: public CK::Linear_kernel::Is_vertical_2 // : public CK::Linear_kernel::Is_vertical_2
{ {
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Linear_kernel::Is_vertical_2 Linear_Is_vertical_2;
public: public:
// using CK::Linear_kernel::Is_vertical_2::operator();
typedef typename CK::Linear_kernel::Is_vertical_2::result_type result_type; template <typename A>
Boolean
operator()(const A& a) const
{ return Linear_Is_vertical_2()(a); }
using CK::Linear_kernel::Is_vertical_2::operator(); Boolean
result_type
operator()(const Circular_arc_2 &A) const operator()(const Circular_arc_2 &A) const
{ return CircularFunctors::is_vertical<CK>(A); } { return CircularFunctors::is_vertical<CK>(A); }
result_type Boolean
operator()(const Line_arc_2 &A) const operator()(const Line_arc_2 &A) const
{ return CircularFunctors::is_vertical<CK>(A); } { return CircularFunctors::is_vertical<CK>(A); }
@ -533,56 +496,51 @@ namespace CircularFunctors {
template < class CK > template < class CK >
class Construct_circular_arc_2 class Construct_circular_arc_2
{ {
typedef typename CK::FT FT; typedef typename CK::FT FT;
typedef typename CK::RT RT;
typedef typename CK::Point_2 Point_2; typedef typename CK::Point_2 Point_2;
typedef typename CK::Line_2 Line_2; typedef typename CK::Line_2 Line_2;
typedef typename CK::Circle_2 Circle_2; typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Kernel_base::Circular_arc_2 RCircular_arc_2;
typedef typename Circular_arc_2::Rep Rep; typedef typename Circular_arc_2::Rep Rep;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
public: public:
typedef Circular_arc_2 result_type; Circular_arc_2
result_type
operator()(void) operator()(void)
{ return Rep(); } { return Rep(); }
result_type Circular_arc_2
operator()(const Circle_2 &c) const operator()(const Circle_2 &c) const
{ return Rep(c); } { return Rep(c); }
result_type Circular_arc_2
operator()(const Circle_2 &support, operator()(const Circle_2 &support,
const Circular_arc_point_2 &source, const Circular_arc_point_2 &source,
const Circular_arc_point_2 &target) const const Circular_arc_point_2 &target) const
{ return Rep(support,source,target); } { return Rep(support,source,target); }
// Not Documented // Not Documented
result_type Circular_arc_2
operator()(const Circle_2 &support, operator()(const Circle_2 &support,
const Line_2 &l1, bool b1, const Line_2 &l1, bool b1,
const Line_2 &l2, bool b2) const const Line_2 &l2, bool b2) const
{ return Rep(support,l1,b1,l2,b2); } { return Rep(support,l1,b1,l2,b2); }
// Not Documented // Not Documented
result_type Circular_arc_2
operator()(const Circle_2 &c, operator()(const Circle_2 &c,
const Circle_2 &c1, bool b_1, const Circle_2 &c1, bool b_1,
const Circle_2 &c2, bool b_2) const const Circle_2 &c2, bool b_2) const
{ return Rep(c,c1,b_1,c2,b_2); } { return Rep(c,c1,b_1,c2,b_2); }
result_type Circular_arc_2
operator()(const Point_2 &begin, operator()(const Point_2 &begin,
const Point_2 &middle, const Point_2 &middle,
const Point_2 &end) const const Point_2 &end) const
{ return Rep(begin,middle,end); } { return Rep(begin,middle,end); }
// Not Documented // Not Documented
result_type Circular_arc_2
operator()(const Point_2 &begin, operator()(const Point_2 &begin,
const Point_2 &end, const Point_2 &end,
const FT& bulge) const const FT& bulge) const
@ -600,47 +558,44 @@ namespace CircularFunctors {
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Segment_2 Segment_2; typedef typename CK::Segment_2 Segment_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Kernel_base::Line_arc_2 RLine_arc_2;
typedef typename Line_arc_2::Rep Rep; typedef typename Line_arc_2::Rep Rep;
public: public:
typedef Line_arc_2 result_type; Line_arc_2
result_type
operator()(void) operator()(void)
{ return Rep(); } { return Rep(); }
// Not Documented // Not Documented
result_type Line_arc_2
operator()(const Line_2 &support, operator()(const Line_2 &support,
const Circle_2 &c1,const bool b1, const Circle_2 &c1,const bool b1,
const Circle_2 &c2,const bool b2) const const Circle_2 &c2,const bool b2) const
{ return Rep(support,c1,b1,c2,b2); } { return Rep(support,c1,b1,c2,b2); }
// Not Documented // Not Documented
result_type Line_arc_2
operator()(const Line_2 &support, operator()(const Line_2 &support,
const Line_2 &l1, const Line_2 &l1,
const Line_2 &l2) const const Line_2 &l2) const
{ return Rep(support,l1,l2); } { return Rep(support,l1,l2); }
result_type Line_arc_2
operator()(const Line_2 &support, operator()(const Line_2 &support,
const Circular_arc_point_2 &p1, const Circular_arc_point_2 &p1,
const Circular_arc_point_2 &p2) const const Circular_arc_point_2 &p2) const
{ return Rep(support,p1,p2); } { return Rep(support,p1,p2); }
// result_type // Line_arc_2
// operator()(const Line_2 &support, // operator()(const Line_2 &support,
// const Point_2 &p1, // const Point_2 &p1,
// const Point_2 &p2) const // const Point_2 &p2) const
// { return Rep(support,p1,p2); } // { return Rep(support,p1,p2); }
result_type Line_arc_2
operator()(const Segment_2 &s) const operator()(const Segment_2 &s) const
{ return Rep(s); } { return Rep(s); }
result_type Line_arc_2
operator()(const Point_2 &p1, operator()(const Point_2 &p1,
const Point_2 &p2) const const Point_2 &p2) const
{ return Rep(p1,p2); } { return Rep(p1,p2); }
@ -652,40 +607,32 @@ namespace CircularFunctors {
{ {
typedef typename CK::Point_2 Point_2; typedef typename CK::Point_2 Point_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Kernel_base::Circular_arc_point_2
RCircular_arc_point_2;
typedef typename Circular_arc_point_2::Rep Rep; typedef typename Circular_arc_point_2::Rep Rep;
typedef typename Circular_arc_point_2::Root_for_circles_2_2 typedef typename Circular_arc_point_2::Root_for_circles_2_2
Root_for_circles_2_2; Root_for_circles_2_2;
public: public:
typedef Circular_arc_point_2 result_type; Circular_arc_point_2
result_type
operator()(void) operator()(void)
{ return Rep(); } { return Rep(); }
result_type Circular_arc_point_2
operator()(const Root_for_circles_2_2 & np) const operator()(const Root_for_circles_2_2 & np) const
{ return Rep(np); } { return Rep(np); }
result_type Circular_arc_point_2
operator()(const Point_2 & p) const operator()(const Point_2 & p) const
{ return Rep(p); } { return Rep(p); }
}; };
template <class CK> template <class CK>
class Compute_circular_x_2 class Compute_circular_x_2
{ {
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Root_of_2 Root_of_2;
public: public:
typedef const Root_of_2& result_type; decltype(auto) operator() (const Circular_arc_point_2 & a) const
result_type operator() (const Circular_arc_point_2 & a) const
{ {
return (a.rep().x()); return (a.rep().x());
} }
@ -696,13 +643,9 @@ namespace CircularFunctors {
class Compute_circular_y_2 class Compute_circular_y_2
{ {
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Root_of_2 Root_of_2;
public: public:
decltype(auto) operator() (const Circular_arc_point_2 & a) const
typedef const Root_of_2& result_type;
result_type operator() (const Circular_arc_point_2 & a) const
{ {
return (a.rep().y()); return (a.rep().y());
} }
@ -714,17 +657,14 @@ namespace CircularFunctors {
{ {
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
public: public:
typedef const Circular_arc_point_2 & result_type; decltype(auto) operator() (const Circular_arc_2& a) const
result_type operator() (const Circular_arc_2 & a) const
{ {
return (a.rep().left()); return (a.rep().left());
} }
result_type operator() (const Line_arc_2 & a) const decltype(auto) operator() (const Line_arc_2& a) const
{ {
return (a.rep().left()); return (a.rep().left());
} }
@ -736,18 +676,14 @@ namespace CircularFunctors {
{ {
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
public: public:
decltype(auto) operator() (const Circular_arc_2& a) const
typedef const Circular_arc_point_2& result_type;
result_type operator() (const Circular_arc_2 & a) const
{ {
return (a.rep().right()); return (a.rep().right());
} }
result_type operator() (const Line_arc_2 & a) const decltype(auto) operator() (const Line_arc_2& a) const
{ {
return (a.rep().right()); return (a.rep().right());
} }
@ -759,16 +695,12 @@ namespace CircularFunctors {
{ {
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
public: public:
decltype(auto) operator() (const Circular_arc_2& a) const
typedef const Circular_arc_point_2& result_type;
result_type operator() (const Circular_arc_2 & a) const
{ return a.rep().source(); } { return a.rep().source(); }
result_type operator() (const Line_arc_2 & a) const decltype(auto) operator() (const Line_arc_2& a) const
{ return a.rep().source();} { return a.rep().source();}
}; };
@ -779,16 +711,12 @@ namespace CircularFunctors {
{ {
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
public: public:
decltype(auto) operator() (const Circular_arc_2& a) const
typedef const Circular_arc_point_2& result_type;
result_type operator() (const Circular_arc_2 & a) const
{ return a.rep().target();} { return a.rep().target();}
result_type operator() (const Line_arc_2 & a) const decltype(auto) operator() (const Line_arc_2& a) const
{ return a.rep().target();} { return a.rep().target();}
}; };
@ -796,19 +724,17 @@ namespace CircularFunctors {
template <class CK> template <class CK>
class Is_x_monotone_2 class Is_x_monotone_2
{ {
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
public: public:
Boolean operator() (const Circular_arc_2 & a) const
typedef bool result_type;
result_type operator() (const Circular_arc_2 & a) const
{ {
return (a.rep().is_x_monotone()); return (a.rep().is_x_monotone());
} }
result_type operator() (const Line_arc_2 & a) const Boolean operator() (const Line_arc_2 & a) const
{ {
return (a.rep().is_x_monotone()); return (a.rep().is_x_monotone());
} }
@ -818,19 +744,17 @@ namespace CircularFunctors {
template <class CK> template <class CK>
class Is_y_monotone_2 class Is_y_monotone_2
{ {
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
public: public:
Boolean operator() (const Circular_arc_2& a) const
typedef bool result_type;
result_type operator() (const Circular_arc_2 & a) const
{ {
return (a.rep().is_y_monotone()); return (a.rep().is_y_monotone());
} }
result_type operator() (const Line_arc_2 & a) const Boolean operator() (const Line_arc_2& a) const
{ {
return (a.rep().is_y_monotone()); return (a.rep().is_y_monotone());
} }
@ -839,48 +763,58 @@ namespace CircularFunctors {
template <class CK> template <class CK>
class Construct_bbox_2 class Construct_bbox_2
: public CK::Linear_kernel::Construct_bbox_2 // : public CK::Linear_kernel::Construct_bbox_2
{ {
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circle_2 Circle_2; typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Linear_kernel::Construct_bbox_2 Linear_Construct_bbox_2;
public: public:
// using CK::Linear_kernel::Construct_bbox_2::operator();
typedef typename CK::Linear_kernel::Construct_bbox_2::result_type result_type; template <typename A>
using CK::Linear_kernel::Construct_bbox_2::operator(); decltype(auto)
operator()(const A& a) const
{ return Linear_Construct_bbox_2()(a); }
result_type operator() (const Circular_arc_point_2 & a) const decltype(auto) operator() (const Circular_arc_point_2& a) const
{ {
return a.rep().bbox(); return a.rep().bbox();
} }
result_type operator() (const Circular_arc_2 & a) const decltype(auto) operator() (const Circular_arc_2& a) const
{ {
return a.rep().bbox(); return a.rep().bbox();
} }
result_type operator() (const Line_arc_2 & a) const decltype(auto) operator() (const Line_arc_2& a) const
{ {
return a.rep().bbox(); return a.rep().bbox();
} }
}; };
template <class CK> template <class CK>
class Bounded_side_2 class Bounded_side_2
: public CK::Linear_kernel::Bounded_side_2 // : public CK::Linear_kernel::Bounded_side_2
{ {
typedef typename CK::Bounded_side Bounded_side;
typedef typename CK::Circle_2 Circle_2; typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Linear_kernel::Bounded_side_2 Linear_Bounded_side_2;
public: public:
typedef typename CK::Linear_kernel::Bounded_side_2::result_type result_type; // using CK::Linear_kernel::Bounded_side_2::operator();
using CK::Linear_kernel::Bounded_side_2::operator(); template <typename A, typename B>
Bounded_side
operator()(const A& a, const B& b) const
{ return Linear_Bounded_side_2()(a, b); }
result_type Bounded_side
operator()(const Circle_2& c, const Circular_arc_point_2& p) const operator()(const Circle_2& c, const Circular_arc_point_2& p) const
{ return CircularFunctors::bounded_side<CK>(c,p); } { return CircularFunctors::bounded_side<CK>(c,p); }
@ -888,17 +822,23 @@ namespace CircularFunctors {
template <class CK> template <class CK>
class Has_on_bounded_side_2 class Has_on_bounded_side_2
: public CK::Linear_kernel::Has_on_bounded_side_2 // : public CK::Linear_kernel::Has_on_bounded_side_2
{ {
typedef typename CK::Boolean Boolean;
typedef typename CK::Circle_2 Circle_2; typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Linear_kernel::Has_on_bounded_side_2 Linear_Has_on_bounded_side_2;
public: public:
typedef typename CK::Linear_kernel::Has_on_bounded_side_2::result_type result_type; // using CK::Linear_kernel::Has_on_bounded_side_2::operator();
using CK::Linear_kernel::Has_on_bounded_side_2::operator(); template <typename A, typename B>
Boolean
operator()(const A& a, const B& b) const
{ return Linear_Has_on_bounded_side_2()(a, b); }
result_type Boolean
operator()(const Circle_2& c, const Circular_arc_point_2& p) const operator()(const Circle_2& c, const Circular_arc_point_2& p) const
{ return CK().bounded_side_2_object()(c,p) == ON_BOUNDED_SIDE; } { return CK().bounded_side_2_object()(c,p) == ON_BOUNDED_SIDE; }
@ -906,20 +846,25 @@ namespace CircularFunctors {
template <class CK> template <class CK>
class Has_on_unbounded_side_2 class Has_on_unbounded_side_2
: public CK::Linear_kernel::Has_on_unbounded_side_2 // : public CK::Linear_kernel::Has_on_unbounded_side_2
{ {
typedef typename CK::Boolean Boolean;
typedef typename CK::Circle_2 Circle_2; typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2; typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Linear_kernel::Has_on_unbounded_side_2 Linear_Has_on_unbounded_side_2;
public: public:
typedef typename CK::Linear_kernel::Has_on_unbounded_side_2::result_type result_type; // using CK::Linear_kernel::Has_on_unbounded_side_2::operator();
using CK::Linear_kernel::Has_on_unbounded_side_2::operator(); template <typename A, typename B>
Boolean
operator()(const A& a, const B& b) const
{ return Linear_Has_on_unbounded_side_2()(a, b); }
result_type Boolean
operator()(const Circle_2& c, const Circular_arc_point_2& p) const operator()(const Circle_2& c, const Circular_arc_point_2& p) const
{ return CK().bounded_side_2_object()(c,p) == ON_UNBOUNDED_SIDE; } { return CK().bounded_side_2_object()(c,p) == ON_UNBOUNDED_SIDE; }
}; };
#ifndef CGAL_NO_DEPRECATED_CODE #ifndef CGAL_NO_DEPRECATED_CODE
@ -927,31 +872,21 @@ namespace CircularFunctors {
class Construct_supporting_circle_2 class Construct_supporting_circle_2
{ {
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circle_2 Circle_2;
public: public:
CGAL_DEPRECATED decltype(auto) operator() (const Circular_arc_2 & a) const
typedef Circle_2 result_type;
CGAL_DEPRECATED result_type operator() (const Circular_arc_2 & a) const
{ {
return a.rep().supporting_circle(); return a.rep().supporting_circle();
} }
}; };
template <class CK> template <class CK>
class Construct_supporting_line_2 class Construct_supporting_line_2
{ {
typedef typename CK::Line_arc_2 Line_arc_2; typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Line_2 Line_2;
typedef typename CK::Circle_2 Circle_2;
public: public:
CGAL_DEPRECATED decltype(auto) operator() (const Line_arc_2 & a) const
typedef Line_2 result_type;
CGAL_DEPRECATED result_type operator() (const Line_arc_2 & a) const
{ {
return a.rep().supporting_line(); return a.rep().supporting_line();
} }
@ -960,24 +895,28 @@ namespace CircularFunctors {
template <typename CK> template <typename CK>
class Construct_center_2 class Construct_center_2
: public CK::Linear_kernel::Construct_center_2 // : public CK::Linear_kernel::Construct_center_2
{ {
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
public:
typedef typename CK::Linear_kernel::Construct_center_2::result_type result_type;
using CK::Linear_kernel::Construct_center_2::operator();
result_type typedef typename CK::Linear_kernel::Construct_center_2 Linear_Construct_center_2;
public:
// using CK::Linear_kernel::Construct_center_2::operator();
template <typename A>
decltype(auto)
operator()(const A& a) const
{ return Linear_Construct_center_2()(a); }
decltype(auto)
operator()(const Circular_arc_2& c) const operator()(const Circular_arc_2& c) const
{ return c.rep().center(); } { return c.rep().center(); }
}; };
template <typename CK> template <typename CK>
class Compute_squared_radius_2 class Compute_squared_radius_2
{ {
private:
typedef typename CK::Circular_arc_2 Circular_arc_2; typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Linear_kernel LK; typedef typename CK::Linear_kernel LK;
typedef typename LK::Compute_squared_radius_2 LK_Compute_squared_radius_2; typedef typename LK::Compute_squared_radius_2 LK_Compute_squared_radius_2;

View File

@ -54,7 +54,7 @@ namespace Intersections { \
} \ } \
template <class K> \ template <class K> \
inline \ inline \
bool \ typename K::Boolean \
do_intersect(const A <K> &c1, const B <K> &c2) \ do_intersect(const A <K> &c1, const B <K> &c2) \
{ \ { \
return typename K::Do_intersect_2()(c1, c2); \ return typename K::Do_intersect_2()(c1, c2); \

View File

@ -33,6 +33,7 @@ namespace Bbox_functors {
template <class BK> template <class BK>
class Compare_x_2 : public BK::Circular_kernel:: template Base< BK >::Type::Compare_x_2 class Compare_x_2 : public BK::Circular_kernel:: template Base< BK >::Type::Compare_x_2
{ {
typedef typename BK::Comparison_result Comparison_result;
typedef typename BK::Circular_arc_point_2 Circular_arc_point_2; typedef typename BK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename BK::Point_2 Point_2; typedef typename BK::Point_2 Point_2;
typedef typename BK::Circular_kernel:: typedef typename BK::Circular_kernel::
@ -40,12 +41,9 @@ class Compare_x_2 : public BK::Circular_kernel:: template Base< BK >::Type::Comp
typedef CK_Compare_x_2 Base; typedef CK_Compare_x_2 Base;
public: public:
typedef typename CK_Compare_x_2::result_type result_type;
using Base::operator(); using Base::operator();
result_type Comparison_result
operator()( const Circular_arc_point_2 &a, const Circular_arc_point_2 &b) const operator()( const Circular_arc_point_2 &a, const Circular_arc_point_2 &b) const
{ {
Bbox_2 bb1=a.bbox(),bb2=b.bbox(); Bbox_2 bb1=a.bbox(),bb2=b.bbox();
@ -65,16 +63,15 @@ public:
template <class BK> template <class BK>
class Compare_y_2 : public BK::Circular_kernel:: template Base< BK >::Type::Compare_y_2 class Compare_y_2 : public BK::Circular_kernel:: template Base< BK >::Type::Compare_y_2
{ {
typedef typename BK::Comparison_result Comparison_result;
typedef typename BK::Circular_arc_point_2 Circular_arc_point_2; typedef typename BK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename BK::Point_2 Point_2; typedef typename BK::Point_2 Point_2;
typedef typename BK::Circular_kernel:: typedef typename BK::Circular_kernel::
template Base< BK >::Type::Compare_y_2 CK_Compare_y_2; template Base< BK >::Type::Compare_y_2 CK_Compare_y_2;
typedef CK_Compare_y_2 Base; typedef CK_Compare_y_2 Base;
public: public:
Comparison_result
typedef typename CK_Compare_y_2::result_type result_type;
result_type
operator() (const Point_2 &p0, operator() (const Point_2 &p0,
const Point_2 &p1) const const Point_2 &p1) const
{ {
@ -83,7 +80,7 @@ public:
using Base::operator(); using Base::operator();
result_type Comparison_result
operator()( const Circular_arc_point_2 &a, const Circular_arc_point_2 &b) const operator()( const Circular_arc_point_2 &a, const Circular_arc_point_2 &b) const
{ {
Bbox_2 bb1=a.bbox(),bb2=b.bbox(); Bbox_2 bb1=a.bbox(),bb2=b.bbox();
@ -105,17 +102,15 @@ class Compare_xy_2 : public BK::Circular_kernel:: template Base< BK >::Type::Com
typedef typename BK::Circular_kernel:: typedef typename BK::Circular_kernel::
template Base< BK >::Type::Compare_xy_2 CK_Compare_xy_2; template Base< BK >::Type::Compare_xy_2 CK_Compare_xy_2;
typedef CK_Compare_xy_2 Base; typedef CK_Compare_xy_2 Base;
typedef typename BK::Comparison_result Comparison_result;
typedef typename BK::Circular_arc_point_2 Circular_arc_point_2; typedef typename BK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename BK::Point_2 Point_2; typedef typename BK::Point_2 Point_2;
public: public:
typedef typename Base::result_type result_type;
using Base::operator(); using Base::operator();
public:
result_type Comparison_result
operator()( const Circular_arc_point_2 &a, const Circular_arc_point_2 &b) const operator()( const Circular_arc_point_2 &a, const Circular_arc_point_2 &b) const
{ {
typename BK::Compare_x_2 compx; typename BK::Compare_x_2 compx;
@ -137,20 +132,18 @@ class In_x_range_2 : public BK::Circular_kernel:: template Base< BK >::Type::In_
typedef typename BK::Circular_kernel:: typedef typename BK::Circular_kernel::
template Base< BK >::Type::In_x_range_2 CK_In_x_range_2; template Base< BK >::Type::In_x_range_2 CK_In_x_range_2;
typedef CK_In_x_range_2 Base; typedef CK_In_x_range_2 Base;
typedef typename BK::Boolean Boolean;
typedef typename BK::Circular_arc_point_2 Circular_arc_point_2; typedef typename BK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename BK::Circular_arc_2 Circular_arc_2; typedef typename BK::Circular_arc_2 Circular_arc_2;
typedef typename BK::Line_arc_2 Line_arc_2; typedef typename BK::Line_arc_2 Line_arc_2;
public: public:
typedef typename CK_In_x_range_2::result_type result_type;
using Base::operator(); using Base::operator();
private: private:
template <class Arc_2> template <class Arc_2>
result_type Boolean
_in_x_range_2(const Arc_2 &a, const Circular_arc_point_2 &p) const _in_x_range_2(const Arc_2 &a, const Circular_arc_point_2 &p) const
{ {
@ -179,42 +172,36 @@ private:
} }
public: public:
Boolean
result_type
operator()( const Circular_arc_2 &a, const Circular_arc_point_2 &p) const operator()( const Circular_arc_2 &a, const Circular_arc_point_2 &p) const
{ {
CGAL_precondition( a.is_x_monotone()); CGAL_precondition( a.is_x_monotone());
return _in_x_range_2(a,p); return _in_x_range_2(a,p);
} }
result_type Boolean
operator()( const Line_arc_2 &a, const Circular_arc_point_2 &p) const operator()( const Line_arc_2 &a, const Circular_arc_point_2 &p) const
{ return _in_x_range_2(a,p);} { return _in_x_range_2(a,p);}
}; };
template <class BK> template <class BK>
class Compare_y_at_x_2 : public BK::Circular_kernel:: template Base< BK >::Type::Compare_y_at_x_2 class Compare_y_at_x_2 : public BK::Circular_kernel:: template Base< BK >::Type::Compare_y_at_x_2
{ {
typedef typename BK::Circular_kernel:: typedef typename BK::Circular_kernel::
template Base< BK >::Type::Compare_y_at_x_2 CK_Compare_y_at_x_2; template Base< BK >::Type::Compare_y_at_x_2 CK_Compare_y_at_x_2;
typedef CK_Compare_y_at_x_2 Base; typedef CK_Compare_y_at_x_2 Base;
typedef typename BK::Comparison_result Comparison_result;
typedef typename BK::Circular_arc_2 Circular_arc_2; typedef typename BK::Circular_arc_2 Circular_arc_2;
typedef typename BK::Circular_arc_point_2 Circular_arc_point_2; typedef typename BK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename BK::Line_arc_2 Line_arc_2; typedef typename BK::Line_arc_2 Line_arc_2;
public: public:
typedef typename CK_Compare_y_at_x_2::result_type result_type;
using Base::operator(); using Base::operator();
private: private:
template <class Arc_2> template <class Arc_2>
result_type Comparison_result
_compare_y_at_x_2(const Circular_arc_point_2 &p,const Arc_2 &a) const _compare_y_at_x_2(const Circular_arc_point_2 &p,const Arc_2 &a) const
{ {
CGAL_precondition_code(bool tmp=In_x_range_2<BK>()(a,p)); CGAL_precondition_code(bool tmp=In_x_range_2<BK>()(a,p));
@ -232,41 +219,36 @@ private:
} }
public: public:
Comparison_result
result_type
operator()( const Circular_arc_point_2 &p,const Circular_arc_2 &a ) const operator()( const Circular_arc_point_2 &p,const Circular_arc_2 &a ) const
{ {
CGAL_precondition( a.is_x_monotone()); CGAL_precondition( a.is_x_monotone());
return _compare_y_at_x_2(p,a); return _compare_y_at_x_2(p,a);
} }
result_type Comparison_result
operator()( const Circular_arc_point_2 &p,const Line_arc_2 &a ) const operator()( const Circular_arc_point_2 &p,const Line_arc_2 &a ) const
{return _compare_y_at_x_2(p,a);} {return _compare_y_at_x_2(p,a);}
}; };
template <class BK> template <class BK>
class Has_on_2 : public BK::Circular_kernel:: template Base< BK >::Type::Has_on_2 class Has_on_2 : public BK::Circular_kernel:: template Base< BK >::Type::Has_on_2
{ {
typedef typename BK::Circular_kernel:: typedef typename BK::Circular_kernel::
template Base< BK >::Type::Has_on_2 CK_Has_on_2; template Base< BK >::Type::Has_on_2 CK_Has_on_2;
typedef CK_Has_on_2 Base; typedef CK_Has_on_2 Base;
typedef typename BK::Boolean Boolean;
typedef typename BK::Circular_arc_2 Circular_arc_2; typedef typename BK::Circular_arc_2 Circular_arc_2;
typedef typename BK::Circular_arc_point_2 Circular_arc_point_2; typedef typename BK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename BK::Line_arc_2 Line_arc_2; typedef typename BK::Line_arc_2 Line_arc_2;
public: public:
typedef typename CK_Has_on_2::result_type result_type;
using Base::operator(); using Base::operator();
private: private:
template <class Arc_2> template <class Arc_2>
result_type Boolean
_has_on_2(const Arc_2 &a, const Circular_arc_point_2 &p) const _has_on_2(const Arc_2 &a, const Circular_arc_point_2 &p) const
{ {
Bbox_2 bb1=a.bbox(),bb2=p.bbox(); Bbox_2 bb1=a.bbox(),bb2=p.bbox();
@ -278,27 +260,26 @@ private:
} }
public: public:
Boolean
result_type
operator()( const Circular_arc_2 &a,const Circular_arc_point_2 &p ) const operator()( const Circular_arc_2 &a,const Circular_arc_point_2 &p ) const
{ {
CGAL_precondition( a.is_x_monotone()); CGAL_precondition( a.is_x_monotone());
return _has_on_2(a,p); return _has_on_2(a,p);
} }
result_type Boolean
operator()( const Line_arc_2 &a, const Circular_arc_point_2 &p ) const operator()( const Line_arc_2 &a, const Circular_arc_point_2 &p ) const
{return _has_on_2(a,p);} {return _has_on_2(a,p);}
}; };
template <class BK> template <class BK>
class Equal_2 class Equal_2
: public BK::Circular_kernel:: template Base< BK >::Type::Equal_2 : public BK::Circular_kernel:: template Base< BK >::Type::Equal_2
{ {
typedef typename BK::Circular_kernel:: typedef typename BK::Circular_kernel::
template Base< BK >::Type::Equal_2 CK_Equal_2; template Base< BK >::Type::Equal_2 CK_Equal_2;
typedef typename BK::Boolean Boolean;
typedef typename BK::Circular_arc_2 Circular_arc_2; typedef typename BK::Circular_arc_2 Circular_arc_2;
typedef typename BK::Point_2 Point_2; typedef typename BK::Point_2 Point_2;
typedef typename BK::Direction_2 Direction_2; typedef typename BK::Direction_2 Direction_2;
@ -315,15 +296,11 @@ class Equal_2
typedef CK_Equal_2 Base; typedef CK_Equal_2 Base;
public: public:
typedef typename CK_Equal_2::result_type result_type;
using Base::operator(); using Base::operator();
private: private:
template <class Arc_2> template <class Arc_2>
result_type Boolean
_equal_2(const Arc_2 &a,const Arc_2 &b) const _equal_2(const Arc_2 &a,const Arc_2 &b) const
{ {
Bbox_2 bb11=a.source().bbox(), Bbox_2 bb11=a.source().bbox(),
@ -346,8 +323,7 @@ private:
} }
public: public:
Boolean
result_type
operator()( const Circular_arc_point_2 &a , operator()( const Circular_arc_point_2 &a ,
const Circular_arc_point_2 &b) const const Circular_arc_point_2 &b) const
{ {
@ -361,14 +337,15 @@ public:
/* WAS THAT HERE FOR OTHER COMPILERS THAN VC* ??? /* WAS THAT HERE FOR OTHER COMPILERS THAN VC* ???
// redefine to solve ambiguous call error // redefine to solve ambiguous call error
result_type Boolean
operator()( const Point_2 &a , operator()( const Point_2 &a ,
const Point_2 &b) const const Point_2 &b) const
{ {
return CK_Equal_2()( a, b); return CK_Equal_2()( a, b);
} }
*/ */
result_type
Boolean
operator()( const Circular_arc_2 &a , const Circular_arc_2 &b ) const operator()( const Circular_arc_2 &a , const Circular_arc_2 &b ) const
{ {
CGAL_precondition( a.is_x_monotone()); CGAL_precondition( a.is_x_monotone());
@ -377,17 +354,17 @@ public:
return _equal_2(a,b); return _equal_2(a,b);
} }
result_type Boolean
operator()( const Line_arc_2 &a , operator()( const Line_arc_2 &a ,
const Line_arc_2 &b ) const const Line_arc_2 &b ) const
{ return _equal_2(a,b);} { return _equal_2(a,b);}
result_type Boolean
operator()( const Circular_arc_2 & , operator()( const Circular_arc_2 & ,
const Line_arc_2 & ) const const Line_arc_2 & ) const
{ return false;} { return false;}
result_type Boolean
operator()( const Line_arc_2 & , operator()( const Line_arc_2 & ,
const Circular_arc_2 & ) const const Circular_arc_2 & ) const
{ return false;} { return false;}
@ -401,19 +378,17 @@ class Do_overlap_2 : public BK::Circular_kernel:: template Base< BK >::Type::Do_
typedef typename BK::Circular_kernel:: typedef typename BK::Circular_kernel::
template Base< BK >::Type::Do_overlap_2 CK_Do_overlap_2; template Base< BK >::Type::Do_overlap_2 CK_Do_overlap_2;
typedef CK_Do_overlap_2 Base; typedef CK_Do_overlap_2 Base;
typedef typename BK::Boolean Boolean;
typedef typename BK::Circular_arc_2 Circular_arc_2; typedef typename BK::Circular_arc_2 Circular_arc_2;
typedef typename BK::Line_arc_2 Line_arc_2; typedef typename BK::Line_arc_2 Line_arc_2;
public: public:
typedef typename CK_Do_overlap_2::result_type result_type;
using Base::operator(); using Base::operator();
private: private:
template <class Arc_2> template <class Arc_2>
result_type Boolean
_do_overlap_2(const Arc_2 &a, const Arc_2 &b) const _do_overlap_2(const Arc_2 &a, const Arc_2 &b) const
{ {
Bbox_2 bb1=a.bbox(),bb2=b.bbox(); Bbox_2 bb1=a.bbox(),bb2=b.bbox();
@ -424,10 +399,8 @@ private:
return false; return false;
} }
public: public:
Boolean
result_type
operator()( const Circular_arc_2 &a , const Circular_arc_2 &b ) const operator()( const Circular_arc_2 &a , const Circular_arc_2 &b ) const
{ {
CGAL_precondition( a.is_x_monotone()); CGAL_precondition( a.is_x_monotone());
@ -435,28 +408,26 @@ public:
return _do_overlap_2(a,b); return _do_overlap_2(a,b);
} }
result_type Boolean
operator()( const Line_arc_2 &a , operator()( const Line_arc_2 &a ,
const Line_arc_2 &b ) const const Line_arc_2 &b ) const
{ return _do_overlap_2(a,b);} { return _do_overlap_2(a,b);}
result_type Boolean
operator()( const Circular_arc_2 & , operator()( const Circular_arc_2 & ,
const Line_arc_2 & ) const const Line_arc_2 & ) const
{ return false;} { return false;}
result_type Boolean
operator()( const Line_arc_2 & , operator()( const Line_arc_2 & ,
const Circular_arc_2 & ) const const Circular_arc_2 & ) const
{ return false;} { return false;}
}; };
template < class BK > template < class BK >
class Intersect_2 : public BK::Circular_kernel:: template Base< BK >::Type::Intersect_2 class Intersect_2 : public BK::Circular_kernel:: template Base< BK >::Type::Intersect_2
{ {
public:
typedef typename BK::Circular_kernel:: typedef typename BK::Circular_kernel::
template Base< BK >::Type::Intersect_2 CK_Intersect_2; template Base< BK >::Type::Intersect_2 CK_Intersect_2;
@ -466,6 +437,7 @@ public:
typedef typename BK::Circle_2 Circle; typedef typename BK::Circle_2 Circle;
typedef typename BK::Line_2 Line_2; typedef typename BK::Line_2 Line_2;
public:
using CK_Intersect_2::operator(); using CK_Intersect_2::operator();
template < class OutputIterator > template < class OutputIterator >

View File

@ -24,7 +24,7 @@ for which we refer the user to the \ref chapterkernel23 "2D and 3D Linear Kernel
\section sectionSKobjects Spherical Kernel Objects \section sectionSKobjects Spherical Kernel Objects
New main geometric objects are introduced by `Spherical_kernel_3`: New main geometric objects are introduced by `Spherical_kernel_3`:
circular arcs ((model of `SphericalKernel::CircularArc_3`), points circular arcs (model of `SphericalKernel::CircularArc_3`), points
of circular arcs (model of `SphericalKernel::CircularArcPoint_3`), of circular arcs (model of `SphericalKernel::CircularArcPoint_3`),
and line segments (model of `SphericalKernel::LineArc_3`) whose and line segments (model of `SphericalKernel::LineArc_3`) whose
endpoints are points of this new type. endpoints are points of this new type.

View File

@ -1,3 +1,4 @@
Algebraic_foundations
Circular_kernel_2 Circular_kernel_2
Kernel_23 Kernel_23
Number_types Number_types

View File

@ -211,7 +211,7 @@ public:
const Root_for_spheres_2_3 & coordinates() const { return get_pointee_or_identity(base); } const Root_for_spheres_2_3 & coordinates() const { return get_pointee_or_identity(base); }
const CGAL::Bbox_3 bbox() const { CGAL::Bbox_3 bbox() const {
return get_pointee_or_identity(base).bbox(); return get_pointee_or_identity(base).bbox();
} }

View File

@ -168,7 +168,7 @@ namespace CGAL {
return begin_less_xyz_than_end() ? target() : source(); return begin_less_xyz_than_end() ? target() : source();
} }
const CGAL::Bbox_3 bbox() const { CGAL::Bbox_3 bbox() const {
return source().bbox() + target().bbox(); return source().bbox() + target().bbox();
} }

View File

@ -85,7 +85,7 @@ namespace CGAL {
template < class SK > template < class SK >
inline inline
typename SK::Linear_kernel::Bounded_side_3::result_type typename SK::Bounded_side
bounded_side(const typename SK::Sphere_3 &s, bounded_side(const typename SK::Sphere_3 &s,
const typename SK::Circular_arc_point_3 &p) { const typename SK::Circular_arc_point_3 &p) {
typedef typename SK::Algebraic_kernel Algebraic_kernel; typedef typename SK::Algebraic_kernel Algebraic_kernel;
@ -99,7 +99,7 @@ namespace CGAL {
template < class SK > template < class SK >
inline inline
typename SK::Linear_kernel::Bounded_side typename SK::Bounded_side
bounded_side(const typename SK::Circle_3 &c, bounded_side(const typename SK::Circle_3 &c,
const typename SK::Circular_arc_point_3 &p) { const typename SK::Circular_arc_point_3 &p) {
typedef typename SK::Algebraic_kernel Algebraic_kernel; typedef typename SK::Algebraic_kernel Algebraic_kernel;

View File

@ -46,7 +46,7 @@ intersection(const A <K> &c1, const B <K> &c2, OutputIterator res) \
} \ } \
template <class K> \ template <class K> \
inline \ inline \
bool \ typename K::Boolean \
do_intersect(const A <K> &c1, const B <K> &c2) \ do_intersect(const A <K> &c1, const B <K> &c2) \
{ \ { \
return typename K::Do_intersect_3()(c1, c2); \ return typename K::Do_intersect_3()(c1, c2); \
@ -61,7 +61,7 @@ intersection(const A <K> &c1, const B <K> &c2, const C <K> &c3, OutputIterator r
} \ } \
template <class K> \ template <class K> \
inline \ inline \
bool \ typename K::Boolean \
do_intersect(const A <K> &c1, const B <K> &c2, const C <K> &c3) \ do_intersect(const A <K> &c1, const B <K> &c2, const C <K> &c3) \
{ \ { \
return typename K::Do_intersect_3()(c1, c2, c3); \ return typename K::Do_intersect_3()(c1, c2, c3); \

View File

@ -20,7 +20,7 @@ typedef K::Segment_3 Segment_3;
typedef CGAL::Creator_uniform_3<NT,Point_3> Creator; typedef CGAL::Creator_uniform_3<NT,Point_3> Creator;
typedef CGAL::Random_points_in_sphere_3<Point_3,Creator> Generator; typedef CGAL::Random_points_in_sphere_3<Point_3,Creator> Generator;
const unsigned int num = 40; const unsigned int num = 400000;
template <class Facet_handle> template <class Facet_handle>
void compute_plane_equation(Facet_handle f) void compute_plane_equation(Facet_handle f)
@ -135,9 +135,9 @@ int main()
std::cerr << "Testing coplanar hull" << std::endl; std::cerr << "Testing coplanar hull" << std::endl;
test_coplanar_hull(); test_coplanar_hull();
std::cerr << "Testing 500 random points" << std::endl; std::cerr << "Testing " << num << " random points" << std::endl;
std::vector<Point_3> points; std::vector<Point_3> points;
Generator g(500); Generator g(1);
std::copy_n( g, num, std::back_inserter(points)); std::copy_n( g, num, std::back_inserter(points));
assert(points.size() == num); assert(points.size() == num);

View File

@ -16,9 +16,9 @@ struct My_orientation_2
typedef typename K::RT RT; typedef typename K::RT RT;
typedef typename K::Point_2 Point_2; typedef typename K::Point_2 Point_2;
typedef typename K::Orientation result_type; typedef typename K::Orientation Orientation;
result_type Orientation
operator()(const Point_2 &p, const Point_2 &q, const Point_2 &r) const operator()(const Point_2 &p, const Point_2 &q, const Point_2 &r) const
{ {
RT prx = p.x() - r.x(); RT prx = p.x() - r.x();

View File

@ -0,0 +1,69 @@
// Copyright (c) 2017 GeometryFactory
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : Andreas Fabri, Laurent Rineau
#ifndef CGAL_EPIC_PREDICATE_IF_CONVERTIBLE_H
#define CGAL_EPIC_PREDICATE_IF_CONVERTIBLE_H
#include <CGAL/Epic_converter.h>
namespace CGAL {
template <typename AK, typename FP, typename EpicP>
class EPIC_predicate_if_convertible {
public:
FP fp;
EpicP epicp;
template <typename... Args>
auto
operator()(const Args&... args) const
-> decltype(fp(args...))
{
const CGAL::Epic_converter<AK> converter;
std::tuple<decltype(converter(approx(args)))...> converted_args;
// When C++20 is available, check the blame and clean this all up with lambdas
bool success = convert_all_impl(std::index_sequence_for<Args...>{}, converter, converted_args, args...);
if(!success) // failed to convert all arguments, call the base predicate
return fp(args...);
return call_epicp_impl(std::index_sequence_for<Args...>{}, converted_args);
}
private:
template <std::size_t... I, typename Converter, typename Tuple, typename... Args>
bool convert_all_impl(std::index_sequence<I...>,
const Converter& converter,
Tuple& converted_args,
const Args&... args) const
{
auto convert = [&](auto index, const auto& arg) {
auto converted = converter(approx(arg));
if(converted.second)
std::get<index>(converted_args) = converted;
return converted.second;
};
return (... && convert(std::integral_constant<std::size_t, I>{}, args));
}
template <std::size_t... I, typename Tuple>
auto call_epicp_impl(std::index_sequence<I...>, const Tuple& converted_args) const
-> decltype(epicp(std::get<I>(converted_args).first...))
{
return epicp(std::get<I>(converted_args).first...);
}
};
} // CGAL
#endif // CGAL_EPIC_PREDICATE_IF_CONVERTIBLE_H

View File

@ -16,6 +16,8 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Interval_arithmetic.h> #include <CGAL/Interval_arithmetic.h>
#include <type_traits>
namespace CGAL { namespace CGAL {
template <class AC, class EC, class FC, class C2E, class C2F, template <class AC, class EC, class FC, class C2E, class C2F,
@ -30,81 +32,70 @@ private:
E2C From_Exact; E2C From_Exact;
F2C From_Filtered; F2C From_Filtered;
typedef typename AC::result_type AC_result_type;
typedef typename FC::result_type FC_result_type;
typedef typename EC::result_type EC_result_type;
public:
typedef AC_result_type result_type;
public: public:
Filtered_construction() {} Filtered_construction() {}
template <class A1> template <class A1>
result_type auto operator()(const A1 &a1) const
operator()(const A1 &a1) const -> typename std::invoke_result<AC, A1>::type
{ {
{ {
// Protection is outside the try block as VC8 has the CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG
Protect_FPU_rounding<Protection> P1; Protect_FPU_rounding<Protection> P1;
try try
{ {
return From_Filtered( Filter_construction(To_Filtered(a1)) ); return From_Filtered(Filter_construction(To_Filtered(a1)));
} }
catch (Uncertain_conversion_exception&) catch (Uncertain_conversion_exception&)
{} {}
} }
Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST); Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST);
CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST); CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST);
return From_Exact( Exact_construction(To_Exact(a1)) ); return From_Exact(Exact_construction(To_Exact(a1)));
} }
template <class A1, class A2> template <class A1, class A2>
result_type auto operator()(const A1 &a1, const A2 &a2) const
operator()(const A1 &a1, const A2 &a2) const -> typename std::invoke_result<AC, A1, A2>::type
{ {
{ {
Protect_FPU_rounding<Protection> P1; Protect_FPU_rounding<Protection> P1;
try try
{ {
return From_Filtered( Filter_construction(To_Filtered(a1), return From_Filtered(Filter_construction(To_Filtered(a1),
To_Filtered(a2)) ); To_Filtered(a2)));
} }
catch (Uncertain_conversion_exception&) catch (Uncertain_conversion_exception&)
{} {}
} }
Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST); Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST);
CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST); CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST);
return From_Exact( Exact_construction(To_Exact(a1), return From_Exact(Exact_construction(To_Exact(a1),
To_Exact(a2)) ); To_Exact(a2)));
} }
template <class A1, class A2, class A3> template <class A1, class A2, class A3>
result_type auto operator()(const A1 &a1, const A2 &a2, const A3 &a3) const
operator()(const A1 &a1, const A2 &a2, const A3 &a3) const -> typename std::invoke_result<AC, A1, A2, A3>::type
{ {
{ {
Protect_FPU_rounding<Protection> P1; Protect_FPU_rounding<Protection> P1;
try try
{ {
return From_Filtered( Filter_construction(To_Filtered(a1), return From_Filtered(Filter_construction(To_Filtered(a1),
To_Filtered(a2), To_Filtered(a2),
To_Filtered(a3)) ); To_Filtered(a3)));
} }
catch (Uncertain_conversion_exception&) catch (Uncertain_conversion_exception&)
{} {}
} }
Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST); Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST);
CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST); CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST);
return From_Exact( Exact_construction(To_Exact(a1), return From_Exact(Exact_construction(To_Exact(a1),
To_Exact(a2), To_Exact(a2),
To_Exact(a3)) ); To_Exact(a3)));
} }
}; };
} // namespace CGAL
} //namespace CGAL
#endif // CGAL_FILTERED_CONSTRUCTION_H #endif // CGAL_FILTERED_CONSTRUCTION_H

View File

@ -34,13 +34,12 @@ template < typename K_base >
class Angle_3 class Angle_3
: public K_base::Angle_3 : public K_base::Angle_3
{ {
typedef typename K_base::Point_3 Point_3; typedef typename K_base::Angle Angle;
typedef typename K_base::Point_3 Point_3;
typedef typename K_base::Angle_3 Base; typedef typename K_base::Angle_3 Base;
public: public:
typedef typename Base::result_type result_type;
using Base::operator(); using Base::operator();
Sign sign_with_error(const double x, const double error) const { Sign sign_with_error(const double x, const double error) const {
@ -49,7 +48,7 @@ public:
else return ZERO; else return ZERO;
} }
result_type operator()(const Point_3 &p, const Point_3& q, const Point_3& r) const Angle operator()(const Point_3& p, const Point_3& q, const Point_3& r) const
{ {
CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Angle_3", tmp); CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Angle_3", tmp);

View File

@ -24,16 +24,16 @@ template < typename K_base >
class Collinear_3 class Collinear_3
: public K_base::Collinear_3 : public K_base::Collinear_3
{ {
typedef typename K_base::Boolean Boolean;
typedef typename K_base::Point_3 Point_3; typedef typename K_base::Point_3 Point_3;
typedef typename K_base::Vector_3 Vector_3; typedef typename K_base::Vector_3 Vector_3;
typedef typename K_base::Sphere_3 Sphere_3; typedef typename K_base::Sphere_3 Sphere_3;
typedef typename K_base::Tetrahedron_3 Tetrahedron_3; typedef typename K_base::Tetrahedron_3 Tetrahedron_3;
typedef typename K_base::Collinear_3 Base;
typedef typename K_base::Collinear_3 Base;
public: public:
Boolean
typedef typename Base::result_type result_type;
result_type
operator()(const Point_3 &p, const Point_3 &q, const Point_3 &r) const operator()(const Point_3 &p, const Point_3 &q, const Point_3 &r) const
{ {
CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Collinear_3", tmp); CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Collinear_3", tmp);

View File

@ -30,17 +30,16 @@ template < typename K_base >
class Compare_distance_3 class Compare_distance_3
: public K_base::Compare_distance_3 : public K_base::Compare_distance_3
{ {
typedef typename K_base::Point_3 Point_3; typedef typename K_base::Comparison_result Comparison_result;
typedef typename K_base::Vector_3 Vector_3; typedef typename K_base::Point_3 Point_3;
typedef typename K_base::Vector_3 Vector_3;
typedef typename K_base::Compare_distance_3 Base; typedef typename K_base::Compare_distance_3 Base;
public: public:
typedef typename Base::result_type result_type;
using Base::operator(); using Base::operator();
result_type operator()(const Point_3 &p, const Point_3& q, const Point_3& r) const Comparison_result operator()(const Point_3& p, const Point_3& q, const Point_3& r) const
{ {
CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") + CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") +
std::string(CGAL_PRETTY_FUNCTION), tmp); std::string(CGAL_PRETTY_FUNCTION), tmp);

View File

@ -24,15 +24,16 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
class Compare_squared_radius_3 class Compare_squared_radius_3
: public K_base::Compare_squared_radius_3 : public K_base::Compare_squared_radius_3
{ {
typedef typename K_base::Point_3 Point_3; typedef typename K_base::Comparison_result Comparison_result;
typedef typename K_base::FT FT; typedef typename K_base::Point_3 Point_3;
typedef typename K_base::Compare_squared_radius_3 Base; typedef typename K_base::FT FT;
public:
typedef typename Base::result_type result_type;
typedef typename K_base::Compare_squared_radius_3 Base;
public:
using Base::operator(); using Base::operator();
result_type operator() ( Comparison_result operator() (
const Point_3& p, const Point_3& p,
const Point_3& q, const Point_3& q,
const Point_3& r, const Point_3& r,
@ -185,7 +186,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
return Base::operator()(p,q,r,s,w); return Base::operator()(p,q,r,s,w);
} }
result_type operator() ( Comparison_result operator() (
const Point_3& p, const Point_3& p,
const Point_3& q, const Point_3& q,
const Point_3& s, const Point_3& s,
@ -312,14 +313,14 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
} }
} }
} }
return static_cast<result_type>(int_tmp_result); return static_cast<Comparison_result>(int_tmp_result);
} }
else else
return Base::operator()(p,q,s,w); return Base::operator()(p,q,s,w);
} }
result_type operator() ( Comparison_result operator() (
const Point_3& p, const Point_3& p,
const Point_3& q, const Point_3& q,
const FT& w const FT& w

View File

@ -27,15 +27,16 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
class Compare_weighted_squared_radius_3: class Compare_weighted_squared_radius_3:
public K_base::Compare_weighted_squared_radius_3 public K_base::Compare_weighted_squared_radius_3
{ {
typedef typename K_base::Weighted_point_3 Weighted_point_3; typedef typename K_base::Comparison_result Comparison_result;
typedef typename K_base::FT FT; typedef typename K_base::Weighted_point_3 Weighted_point_3;
typedef typename K_base::Compare_weighted_squared_radius_3 Base; typedef typename K_base::FT FT;
public:
typedef typename Base::result_type result_type;
typedef typename K_base::Compare_weighted_squared_radius_3 Base;
public:
using Base::operator(); using Base::operator();
result_type operator() ( Comparison_result operator() (
const Weighted_point_3& p, const Weighted_point_3& p,
const Weighted_point_3& q, const Weighted_point_3& q,
const Weighted_point_3& r, const Weighted_point_3& r,
@ -175,7 +176,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
return Base::operator()(p,q,r,s,w); return Base::operator()(p,q,r,s,w);
} }
result_type Comparison_result
operator() ( operator() (
const Weighted_point_3& p, const Weighted_point_3& p,
const Weighted_point_3& q , const Weighted_point_3& q ,
@ -292,7 +293,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
return Base::operator()(p,q,r,w); return Base::operator()(p,q,r,w);
} }
result_type Comparison_result
operator() ( operator() (
const Weighted_point_3& p, const Weighted_point_3& p,
const Weighted_point_3& q, const Weighted_point_3& q,

View File

@ -31,17 +31,16 @@ template < typename K_base >
class Compare_x_2 class Compare_x_2
: public K_base::Compare_x_2 : public K_base::Compare_x_2
{ {
typedef typename K_base::Point_2 Point_2; typedef typename K_base::Comparison_result Comparison_result;
typedef typename K_base::Line_2 Line_2; typedef typename K_base::Point_2 Point_2;
typedef typename K_base::Compare_x_2 Base; typedef typename K_base::Line_2 Line_2;
typedef typename K_base::Compare_x_2 Base;
public: public:
typedef typename Base::result_type result_type;
using Base::operator(); using Base::operator();
result_type operator()(const Point_2 &p, const Point_2& q) const Comparison_result operator()(const Point_2& p, const Point_2& q) const
{ {
CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") + CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") +
std::string(CGAL_PRETTY_FUNCTION), tmp); std::string(CGAL_PRETTY_FUNCTION), tmp);

View File

@ -31,17 +31,16 @@ template < typename K_base >
class Compare_y_2 class Compare_y_2
: public K_base::Compare_y_2 : public K_base::Compare_y_2
{ {
typedef typename K_base::Point_2 Point_2; typedef typename K_base::Comparison_result Comparison_result;
typedef typename K_base::Line_2 Line_2; typedef typename K_base::Point_2 Point_2;
typedef typename K_base::Compare_y_2 Base; typedef typename K_base::Line_2 Line_2;
typedef typename K_base::Compare_y_2 Base;
public: public:
typedef typename Base::result_type result_type;
using Base::operator(); using Base::operator();
result_type operator()(const Point_2 &p, const Point_2& q) const Comparison_result operator()(const Point_2 &p, const Point_2& q) const
{ {
CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") + CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") +
std::string(CGAL_PRETTY_FUNCTION), tmp); std::string(CGAL_PRETTY_FUNCTION), tmp);

View File

@ -22,13 +22,14 @@ template < typename K_base, typename Kernel >
class Compare_y_at_x_2 class Compare_y_at_x_2
: public K_base::Compare_y_at_x_2 : public K_base::Compare_y_at_x_2
{ {
typedef typename K_base::Point_2 Point_2; typedef typename K_base::Comparison_result Comparison_result;
typedef typename K_base::Segment_2 Segment_2; typedef typename K_base::Point_2 Point_2;
typedef typename K_base::FT FT; typedef typename K_base::Segment_2 Segment_2;
typedef typename K_base::Compare_y_at_x_2 Base; typedef typename K_base::FT FT;
typedef typename K_base::Compare_y_at_x_2 Base;
public: public:
using Base::operator(); using Base::operator();
Comparison_result Comparison_result

View File

@ -25,17 +25,14 @@ template < typename K_base, typename SFK >
class Coplanar_3 class Coplanar_3
: public K_base::Coplanar_3 : public K_base::Coplanar_3
{ {
typedef typename K_base::Point_3 Point_3; typedef typename K_base::Boolean Boolean;
typedef typename K_base::Point_3 Point_3;
typedef typename K_base::Coplanar_3 Base; typedef typename K_base::Coplanar_3 Base;
typedef typename SFK::Orientation_3 Orientation_3; typedef typename SFK::Orientation_3 Orientation_3;
public: public:
Boolean
typedef typename Base::result_type result_type;
result_type
operator()(const Point_3& p,const Point_3& q, const Point_3& r, const Point_3& s) const operator()(const Point_3& p,const Point_3& q, const Point_3& r, const Point_3& s) const
{ {
return Orientation_3()(p,q,r,s) == COPLANAR; return Orientation_3()(p,q,r,s) == COPLANAR;

View File

@ -40,12 +40,12 @@ template < typename Kernel >
class Coplanar_orientation_3 class Coplanar_orientation_3
: public Kernel::Coplanar_orientation_3 : public Kernel::Coplanar_orientation_3
{ {
typedef typename Kernel::Orientation Orientation;
typedef typename Kernel::Point_3 Point_3; typedef typename Kernel::Point_3 Point_3;
typedef typename Kernel::Coplanar_orientation_3 Base; typedef typename Kernel::Coplanar_orientation_3 Base;
public: public:
typedef Orientation result_type;
Orientation operator()(const Point_3 &p, const Point_3 &q, const Point_3 &r) const Orientation operator()(const Point_3 &p, const Point_3 &q, const Point_3 &r) const
{ {
return opti_coplanar_orientationC3( return opti_coplanar_orientationC3(

View File

@ -44,8 +44,6 @@ class Side_of_bounded_circle_3
} }
public: public:
typedef Bounded_side result_type;
Bounded_side operator()(const Point &p, const Point &q, Bounded_side operator()(const Point &p, const Point &q,
const Point &r, const Point &t) const const Point &r, const Point &t) const
{ {

View File

@ -28,16 +28,13 @@ template < typename K_base, typename SFK >
class Do_intersect_2 class Do_intersect_2
: public K_base::Do_intersect_2 : public K_base::Do_intersect_2
{ {
typedef typename K_base::Boolean Boolean;
typedef typename K_base::Point_2 Point_2; typedef typename K_base::Point_2 Point_2;
typedef typename K_base::Segment_2 Segment_2; typedef typename K_base::Segment_2 Segment_2;
typedef typename K_base::Do_intersect_2 Base; typedef typename K_base::Do_intersect_2 Base;
typedef K_base TA1;
typedef SFK TA2;
public: public:
typedef typename Base::result_type result_type;
using Base::operator(); using Base::operator();
// The internal::do_intersect(..) function // The internal::do_intersect(..) function
@ -47,19 +44,19 @@ public:
// the statically filtered kernel we avoid // the statically filtered kernel we avoid
// that doubles are put into Interval_nt // that doubles are put into Interval_nt
// to get taken out again with fit_in_double // to get taken out again with fit_in_double
result_type Boolean
operator()(const Segment_2 &s, const Segment_2& t) const operator()(const Segment_2 &s, const Segment_2& t) const
{ {
return Intersections::internal::do_intersect(s,t, SFK()); return Intersections::internal::do_intersect(s,t, SFK());
} }
result_type Boolean
operator()(const Point_2 &p, const Segment_2& t) const operator()(const Point_2 &p, const Segment_2& t) const
{ {
return Intersections::internal::do_intersect(p,t, SFK()); return Intersections::internal::do_intersect(p,t, SFK());
} }
result_type Boolean
operator()(const Segment_2& t, const Point_2 &p) const operator()(const Segment_2& t, const Point_2 &p) const
{ {
return Intersections::internal::do_intersect(p,t, SFK()); return Intersections::internal::do_intersect(p,t, SFK());

View File

@ -39,18 +39,17 @@ template < typename K_base, typename SFK >
class Do_intersect_3 class Do_intersect_3
: public K_base::Do_intersect_3 : public K_base::Do_intersect_3
{ {
typedef typename K_base::Boolean Boolean;
typedef typename K_base::Point_3 Point_3; typedef typename K_base::Point_3 Point_3;
typedef typename K_base::Ray_3 Ray_3; typedef typename K_base::Ray_3 Ray_3;
typedef typename K_base::Segment_3 Segment_3; typedef typename K_base::Segment_3 Segment_3;
typedef typename K_base::Triangle_3 Triangle_3; typedef typename K_base::Triangle_3 Triangle_3;
typedef typename K_base::Tetrahedron_3 Tetrahedron_3; typedef typename K_base::Tetrahedron_3 Tetrahedron_3;
typedef typename K_base::Sphere_3 Sphere_3; typedef typename K_base::Sphere_3 Sphere_3;
typedef typename K_base::Do_intersect_3 Base; typedef typename K_base::Do_intersect_3 Base;
public: public:
typedef typename Base::result_type result_type;
using Base::operator(); using Base::operator();
Sign sign_with_error(const double x, const double error) const { Sign sign_with_error(const double x, const double error) const {
@ -67,32 +66,31 @@ public:
// the statically filtered kernel we avoid // the statically filtered kernel we avoid
// that doubles are put into Interval_nt // that doubles are put into Interval_nt
// to get taken out again with fit_in_double // to get taken out again with fit_in_double
result_type Boolean
operator()(const Segment_3 &s, const Triangle_3& t) const operator()(const Segment_3 &s, const Triangle_3& t) const
{ {
return Intersections::internal::do_intersect(t,s, SFK()); return Intersections::internal::do_intersect(t,s, SFK());
} }
result_type Boolean
operator()(const Triangle_3& t, const Segment_3 &s) const operator()(const Triangle_3& t, const Segment_3 &s) const
{ {
return Intersections::internal::do_intersect(t,s, SFK()); return Intersections::internal::do_intersect(t,s, SFK());
} }
result_type Boolean
operator()(const Triangle_3 &t0, const Triangle_3& t1) const operator()(const Triangle_3 &t0, const Triangle_3& t1) const
{ {
return Intersections::internal::do_intersect(t0,t1, SFK()); return Intersections::internal::do_intersect(t0,t1, SFK());
} }
Boolean
result_type
operator()(const Bbox_3& b, const Segment_3 &s) const operator()(const Bbox_3& b, const Segment_3 &s) const
{ {
return this->operator()(s, b); return this->operator()(s, b);
} }
result_type Boolean
operator()(const Segment_3 &s, const Bbox_3& b) const operator()(const Segment_3 &s, const Bbox_3& b) const
{ {
CGAL_BRANCH_PROFILER_3(std::string("semi-static failures/attempts/calls to : ") + CGAL_BRANCH_PROFILER_3(std::string("semi-static failures/attempts/calls to : ") +
@ -111,7 +109,7 @@ public:
{ {
CGAL_BRANCH_PROFILER_BRANCH_1(tmp); CGAL_BRANCH_PROFILER_BRANCH_1(tmp);
const Uncertain<result_type> ub = const Uncertain<Boolean> ub =
Intersections::internal::do_intersect_bbox_segment_aux Intersections::internal::do_intersect_bbox_segment_aux
<double, <double,
true, // bounded at t=0 true, // bounded at t=0
@ -127,13 +125,13 @@ public:
return Base::operator()(s,b); return Base::operator()(s,b);
} }
result_type Boolean
operator()(const Bbox_3& b, const Tetrahedron_3 &t) const operator()(const Bbox_3& b, const Tetrahedron_3 &t) const
{ {
return this->operator()(t, b); return this->operator()(t, b);
} }
result_type Boolean
operator()(const Tetrahedron_3 &t, const Bbox_3& b) const operator()(const Tetrahedron_3 &t, const Bbox_3& b) const
{ {
CGAL_BRANCH_PROFILER_3(std::string("semi-static failures/attempts/calls to : ") + CGAL_BRANCH_PROFILER_3(std::string("semi-static failures/attempts/calls to : ") +
@ -168,13 +166,13 @@ public:
return Base::operator()(t,b); return Base::operator()(t,b);
} }
result_type Boolean
operator()(const Bbox_3& b, const Ray_3 &r) const operator()(const Bbox_3& b, const Ray_3 &r) const
{ {
return this->operator()(r, b); return this->operator()(r, b);
} }
result_type Boolean
operator()(const Ray_3 &r, const Bbox_3& b) const operator()(const Ray_3 &r, const Bbox_3& b) const
{ {
CGAL_BRANCH_PROFILER_3(std::string("semi-static failures/attempts/calls to : ") + CGAL_BRANCH_PROFILER_3(std::string("semi-static failures/attempts/calls to : ") +
@ -193,7 +191,7 @@ public:
{ {
CGAL_BRANCH_PROFILER_BRANCH_1(tmp); CGAL_BRANCH_PROFILER_BRANCH_1(tmp);
const Uncertain<result_type> ub = const Uncertain<Boolean> ub =
Intersections::internal::do_intersect_bbox_segment_aux Intersections::internal::do_intersect_bbox_segment_aux
<double, <double,
true, // bounded at t=0 true, // bounded at t=0
@ -209,8 +207,7 @@ public:
return Base::operator()(r,b); return Base::operator()(r,b);
} }
Boolean
result_type
operator()(const Bbox_3& b, const Triangle_3 &t) const operator()(const Bbox_3& b, const Triangle_3 &t) const
{ {
return this->operator()(t, b); return this->operator()(t, b);
@ -487,7 +484,7 @@ public:
return false; return false;
}; };
result_type Boolean
operator()(const Triangle_3 &t, const Bbox_3& b) const operator()(const Triangle_3 &t, const Bbox_3& b) const
{ {
CGAL_BRANCH_PROFILER_3(std::string("semi-static failures/attempts/calls to : ") + CGAL_BRANCH_PROFILER_3(std::string("semi-static failures/attempts/calls to : ") +
@ -616,14 +613,14 @@ public:
return Base::operator()(t,b); return Base::operator()(t,b);
} }
result_type Boolean
operator()(const Bbox_3& b, const Sphere_3 &s) const operator()(const Bbox_3& b, const Sphere_3 &s) const
{ {
return this->operator()(s, b); return this->operator()(s, b);
} }
// The parameter overestimate is used to avoid a filter failure in AABB_tree::closest_point() // The parameter overestimate is used to avoid a filter failure in AABB_tree::closest_point()
result_type Boolean
operator()(const Sphere_3 &s, const Bbox_3& b, bool overestimate = false) const operator()(const Sphere_3 &s, const Bbox_3& b, bool overestimate = false) const
{ {
CGAL_BRANCH_PROFILER_3(std::string("semi-static failures/attempts/calls to : ") + CGAL_BRANCH_PROFILER_3(std::string("semi-static failures/attempts/calls to : ") +

View File

@ -31,18 +31,16 @@ template < typename K_base >
class Equal_2 class Equal_2
: public K_base::Equal_2 : public K_base::Equal_2
{ {
typedef typename K_base::Boolean Boolean;
typedef typename K_base::FT FT; typedef typename K_base::FT FT;
typedef typename K_base::Point_2 Point_2; typedef typename K_base::Point_2 Point_2;
typedef typename K_base::Vector_2 Vector_2; typedef typename K_base::Vector_2 Vector_2;
typedef typename K_base::Equal_2 Base; typedef typename K_base::Equal_2 Base;
public: public:
typedef typename Base::result_type result_type;
using Base::operator(); using Base::operator();
result_type operator()(const Point_2 &p, const Point_2& q) const Boolean operator()(const Point_2& p, const Point_2& q) const
{ {
CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") + CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") +
std::string(CGAL_PRETTY_FUNCTION), tmp); std::string(CGAL_PRETTY_FUNCTION), tmp);
@ -61,8 +59,7 @@ public:
return Base::operator()(p, q); return Base::operator()(p, q);
} }
Boolean operator()(const Vector_2& p, const Vector_2& q) const
result_type operator()(const Vector_2 &p, const Vector_2& q) const
{ {
CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") + CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") +
std::string(CGAL_PRETTY_FUNCTION), tmp); std::string(CGAL_PRETTY_FUNCTION), tmp);

View File

@ -31,17 +31,16 @@ template < typename K_base >
class Equal_3 class Equal_3
: public K_base::Equal_3 : public K_base::Equal_3
{ {
typedef typename K_base::Boolean Boolean;
typedef typename K_base::Point_3 Point_3; typedef typename K_base::Point_3 Point_3;
typedef typename K_base::Vector_3 Vector_3; typedef typename K_base::Vector_3 Vector_3;
typedef typename K_base::Equal_3 Base; typedef typename K_base::Equal_3 Base;
public: public:
typedef typename Base::result_type result_type;
using Base::operator(); using Base::operator();
result_type operator()(const Point_3 &p, const Point_3& q) const Boolean operator()(const Point_3& p, const Point_3& q) const
{ {
CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") + CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") +
std::string(CGAL_PRETTY_FUNCTION), tmp); std::string(CGAL_PRETTY_FUNCTION), tmp);
@ -62,7 +61,7 @@ public:
} }
result_type operator()(const Vector_3 &p, const Vector_3& q) const Boolean operator()(const Vector_3& p, const Vector_3& q) const
{ {
CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") + CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") +
std::string(CGAL_PRETTY_FUNCTION), tmp); std::string(CGAL_PRETTY_FUNCTION), tmp);
@ -83,7 +82,7 @@ public:
} }
result_type operator()(const Vector_3 &p, const Null_vector &q) const Boolean operator()(const Vector_3& p, const Null_vector& q) const
{ {
CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") + CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") +
std::string(CGAL_PRETTY_FUNCTION), tmp); std::string(CGAL_PRETTY_FUNCTION), tmp);

View File

@ -25,6 +25,7 @@ template < typename K_base, typename SFK >
class Is_degenerate_3 class Is_degenerate_3
: public K_base::Is_degenerate_3 : public K_base::Is_degenerate_3
{ {
typedef typename K_base::Boolean Boolean;
typedef typename K_base::Ray_3 Ray_3; typedef typename K_base::Ray_3 Ray_3;
typedef typename K_base::Segment_3 Segment_3; typedef typename K_base::Segment_3 Segment_3;
typedef typename K_base::Plane_3 Plane_3; typedef typename K_base::Plane_3 Plane_3;
@ -35,25 +36,21 @@ class Is_degenerate_3
typedef typename SFK::Equal_3 Equal_3; typedef typename SFK::Equal_3 Equal_3;
public: public:
typedef typename Base::result_type result_type;
using Base::operator(); using Base::operator();
result_type Boolean
operator()(const Segment_3& s) const operator()(const Segment_3& s) const
{ {
return Equal_3()(Construct_source_3()(s), Construct_target_3()(s)); return Equal_3()(Construct_source_3()(s), Construct_target_3()(s));
} }
Boolean
result_type
operator()(const Ray_3& r) const operator()(const Ray_3& r) const
{ {
return Equal_3()(Construct_source_3()(r), Construct_second_point_3()(r)); return Equal_3()(Construct_source_3()(r), Construct_second_point_3()(r));
} }
result_type Boolean
operator()(const Plane_3& p) const operator()(const Plane_3& p) const
{ {
CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") + CGAL_BRANCH_PROFILER(std::string("semi-static attempts/calls to : ") +

View File

@ -25,16 +25,14 @@ template < typename K_base >
class Orientation_2 class Orientation_2
: public K_base::Orientation_2 : public K_base::Orientation_2
{ {
typedef typename K_base::Orientation Orientation;
typedef typename K_base::Point_2 Point_2; typedef typename K_base::Point_2 Point_2;
typedef typename K_base::Vector_2 Vector_2; typedef typename K_base::Vector_2 Vector_2;
typedef typename K_base::Circle_2 Circle_2; typedef typename K_base::Circle_2 Circle_2;
typedef typename K_base::Orientation_2 Base; typedef typename K_base::Orientation_2 Base;
public: public:
typedef typename Base::result_type result_type;
using Base::operator(); using Base::operator();
Orientation Orientation

View File

@ -27,18 +27,18 @@ template < typename K_base >
class Orientation_3 class Orientation_3
: public K_base::Orientation_3 : public K_base::Orientation_3
{ {
typedef typename K_base::Orientation Orientation;
typedef typename K_base::Point_3 Point_3; typedef typename K_base::Point_3 Point_3;
typedef typename K_base::Vector_3 Vector_3; typedef typename K_base::Vector_3 Vector_3;
typedef typename K_base::Sphere_3 Sphere_3; typedef typename K_base::Sphere_3 Sphere_3;
typedef typename K_base::Tetrahedron_3 Tetrahedron_3; typedef typename K_base::Tetrahedron_3 Tetrahedron_3;
typedef typename K_base::Orientation_3 Base; typedef typename K_base::Orientation_3 Base;
public: public:
typedef typename Base::result_type result_type;
using Base::operator(); using Base::operator();
result_type Orientation
operator()(const Point_3 &p, const Point_3 &q, operator()(const Point_3 &p, const Point_3 &q,
const Point_3 &r, const Point_3 &s) const const Point_3 &r, const Point_3 &s) const
{ {

View File

@ -26,15 +26,15 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
class Power_side_of_oriented_power_circle_2: class Power_side_of_oriented_power_circle_2:
public K_base::Power_side_of_oriented_power_circle_2 public K_base::Power_side_of_oriented_power_circle_2
{ {
typedef typename K_base::Oriented_side Oriented_side;
typedef typename K_base::Weighted_point_2 Weighted_point_2; typedef typename K_base::Weighted_point_2 Weighted_point_2;
typedef typename K_base::FT FT; typedef typename K_base::FT FT;
typedef typename K_base::Power_side_of_oriented_power_circle_2 Base; typedef typename K_base::Power_side_of_oriented_power_circle_2 Base;
public:
typedef typename Base::result_type result_type;
public:
using Base::operator(); using Base::operator();
result_type operator() ( const Weighted_point_2 & p, Oriented_side operator()(const Weighted_point_2 & p,
const Weighted_point_2 & q, const Weighted_point_2 & q,
const Weighted_point_2 & r, const Weighted_point_2 & r,
const Weighted_point_2 & t) const const Weighted_point_2 & t) const
@ -64,7 +64,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
double drx = (rx - tx); double drx = (rx - tx);
double dry = (ry - ty); double dry = (ry - ty);
double drz = (((square( drx ) + square( dry )) - rwt) + twt); double drz = (((square( drx ) + square( dry )) - rwt) + twt);
result_type int_tmp_result; Oriented_side int_tmp_result;
double RT_tmp_result; double RT_tmp_result;
double eps; double eps;
RT_tmp_result = CGAL::determinant( dpx, dpy, dpz, dqx, dqy, dqz, drx, dry, drz ); RT_tmp_result = CGAL::determinant( dpx, dpy, dpz, dqx, dqy, dqz, drx, dry, drz );
@ -162,7 +162,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
} }
result_type operator() ( const Weighted_point_2 & p, Oriented_side operator()(const Weighted_point_2 & p,
const Weighted_point_2 & q, const Weighted_point_2 & q,
const Weighted_point_2 & t) const const Weighted_point_2 & t) const
{ {
@ -219,7 +219,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
double upper_bound_1; double upper_bound_1;
if( (cmpx != 0) ) if( (cmpx != 0) )
{ {
result_type int_tmp_result; Oriented_side int_tmp_result;
double RT_tmp_result; double RT_tmp_result;
RT_tmp_result = CGAL::determinant( dpx, dpz, dqx, dqz ); RT_tmp_result = CGAL::determinant( dpx, dpz, dqx, dqz );
lower_bound_1 = max2; lower_bound_1 = max2;
@ -265,11 +265,11 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
} }
} }
} }
return static_cast<result_type>(cmpx * int_tmp_result); return static_cast<Oriented_side>(cmpx * int_tmp_result);
} }
int cmpy; int cmpy;
cmpy = ((py > qy) ? 1 : ((py < qy) ? -1 : 0)); cmpy = ((py > qy) ? 1 : ((py < qy) ? -1 : 0));
result_type int_tmp_result_FFWKCAA; Oriented_side int_tmp_result_FFWKCAA;
double RT_tmp_result_k60Ocge = CGAL::determinant( dpy, dpz, dqy, dqz ); double RT_tmp_result_k60Ocge = CGAL::determinant( dpy, dpz, dqy, dqz );
lower_bound_1 = max4; lower_bound_1 = max4;
upper_bound_1 = max4; upper_bound_1 = max4;
@ -314,7 +314,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
} }
} }
} }
return static_cast<result_type>(cmpy * int_tmp_result_FFWKCAA); return static_cast<Oriented_side>(cmpy * int_tmp_result_FFWKCAA);
} }
else else

View File

@ -26,12 +26,12 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
class Power_side_of_oriented_power_sphere_3: class Power_side_of_oriented_power_sphere_3:
public K_base::Power_side_of_oriented_power_sphere_3 public K_base::Power_side_of_oriented_power_sphere_3
{ {
typedef typename K_base::Oriented_side Oriented_side;
typedef typename K_base::Weighted_point_3 Weighted_point_3; typedef typename K_base::Weighted_point_3 Weighted_point_3;
typedef typename K_base::FT FT; typedef typename K_base::FT FT;
typedef typename K_base::Power_side_of_oriented_power_sphere_3 Base; typedef typename K_base::Power_side_of_oriented_power_sphere_3 Base;
public:
typedef typename Base::result_type result_type;
public:
using Base::operator(); using Base::operator();
void void
@ -107,11 +107,11 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
} }
result_type operator() ( const Weighted_point_3 & p, Oriented_side operator() (const Weighted_point_3& p,
const Weighted_point_3 & q, const Weighted_point_3& q,
const Weighted_point_3 & r, const Weighted_point_3& r,
const Weighted_point_3 & s, const Weighted_point_3& s,
const Weighted_point_3 & t) const const Weighted_point_3& t) const
{ {
CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Power_side_of_power_sphere_3 with 4+1 wpoints", tmp); CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Power_side_of_power_sphere_3 with 4+1 wpoints", tmp);
@ -225,7 +225,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
return Base::operator()(p,q,r,s,t); return Base::operator()(p,q,r,s,t);
} }
result_type int_tmp_result; Oriented_side int_tmp_result;
double eps = (1.67106803095990471147e-13 * (((max2 * max3) * max4) * (CGAL::max) ( max5, (max1 * max1) ))); double eps = (1.67106803095990471147e-13 * (((max2 * max3) * max4) * (CGAL::max) ( max5, (max1 * max1) )));
@ -253,10 +253,10 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
return Base::operator()(p,q,r,s,t); return Base::operator()(p,q,r,s,t);
} }
result_type operator() ( const Weighted_point_3 & p, Oriented_side operator() (const Weighted_point_3& p,
const Weighted_point_3 & q, const Weighted_point_3& q,
const Weighted_point_3 & r, const Weighted_point_3& r,
const Weighted_point_3 & t) const const Weighted_point_3& t) const
{ {
CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Power_side_of_oriented_power_sphere_3 with 3+1 wpoints", tmp); CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Power_side_of_oriented_power_sphere_3 with 3+1 wpoints", tmp);
@ -408,15 +408,15 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
} }
} }
} }
return static_cast<result_type>(cmp * int_tmp_result_FFWKCAA); return static_cast<Oriented_side>(cmp * int_tmp_result_FFWKCAA);
} }
else else
return Base::operator()(p,q,r,t); return Base::operator()(p,q,r,t);
} }
result_type operator() ( const Weighted_point_3 & p, Oriented_side operator() (const Weighted_point_3& p,
const Weighted_point_3 & q, const Weighted_point_3& q,
const Weighted_point_3 & t) const const Weighted_point_3& t) const
{ {
CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Power_side_of_oriented_power_sphere_3 with 2+1 wpoints", tmp); CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Power_side_of_oriented_power_sphere_3 with 2+1 wpoints", tmp);
@ -506,7 +506,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
} }
} }
} }
return static_cast<result_type>(cmp * int_tmp_result); return static_cast<Oriented_side>(cmp * int_tmp_result);
} }
cmp = ((py > qy) ? 1 : ((py < qy) ? -1 : 0)); cmp = ((py > qy) ? 1 : ((py < qy) ? -1 : 0));
if( (cmp != 0) ) if( (cmp != 0) )
@ -549,7 +549,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
} }
} }
} }
return static_cast<result_type>(cmp * int_tmp_result_FFWKCAA); return static_cast<Oriented_side>(cmp * int_tmp_result_FFWKCAA);
} }
cmp = ((pz > qz) ? 1 : ((pz < qz) ? -1 : 0)); cmp = ((pz > qz) ? 1 : ((pz < qz) ? -1 : 0));
int int_tmp_result_3SPBwDj; int int_tmp_result_3SPBwDj;
@ -592,7 +592,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
} }
} }
} }
return static_cast<result_type>(cmp * int_tmp_result_3SPBwDj); return static_cast<Oriented_side>(cmp * int_tmp_result_3SPBwDj);
} }
else else
return Base::operator()(p,q,t); return Base::operator()(p,q,t);

View File

@ -23,11 +23,11 @@ template < typename K_base >
class Side_of_oriented_circle_2 class Side_of_oriented_circle_2
: public K_base::Side_of_oriented_circle_2 : public K_base::Side_of_oriented_circle_2
{ {
typedef typename K_base::Oriented_side Oriented_side;
typedef typename K_base::Point_2 Point_2; typedef typename K_base::Point_2 Point_2;
typedef typename K_base::Side_of_oriented_circle_2 Base; typedef typename K_base::Side_of_oriented_circle_2 Base;
public: public:
Oriented_side operator()(const Point_2 &p, const Point_2 &q, Oriented_side operator()(const Point_2 &p, const Point_2 &q,
const Point_2 &r, const Point_2 &t) const const Point_2 &r, const Point_2 &t) const
{ {

View File

@ -22,11 +22,11 @@ template < typename K_base >
class Side_of_oriented_sphere_3 class Side_of_oriented_sphere_3
: public K_base::Side_of_oriented_sphere_3 : public K_base::Side_of_oriented_sphere_3
{ {
typedef typename K_base::Oriented_side Oriented_side;
typedef typename K_base::Point_3 Point_3; typedef typename K_base::Point_3 Point_3;
typedef typename K_base::Side_of_oriented_sphere_3 Base; typedef typename K_base::Side_of_oriented_sphere_3 Base;
public: public:
Oriented_side Oriented_side
operator()(const Point_3 &p, const Point_3 &q, const Point_3 &r, operator()(const Point_3 &p, const Point_3 &q, const Point_3 &r,
const Point_3 &s, const Point_3 &t) const const Point_3 &s, const Point_3 &t) const

View File

@ -28,7 +28,7 @@ namespace CGAL {
// TODO : // TODO :
// - each predicate in the default kernel should define a tag that says if it // - each predicate in the default kernel should define a tag that says if it
// wants to be filtered or not (=> all homogeneous predicate define this // wants to be filtered or not (=> all homogeneous predicates define this
// tag). We could even test-suite that automatically. It makes a strong // tag). We could even test-suite that automatically. It makes a strong
// new requirement on the kernel though... // new requirement on the kernel though...
// Could be done with a traits mechanism ? // Could be done with a traits mechanism ?
@ -52,18 +52,13 @@ class Filtered_predicate
EP ep; EP ep;
AP ap; AP ap;
typedef typename AP::result_type Ares;
public: public:
// AP's result type must be convertible to EP's result type.
typedef AP Approximate_predicate; typedef AP Approximate_predicate;
typedef EP Exact_predicate; typedef EP Exact_predicate;
typedef C2E To_exact_converter; typedef C2E To_exact_converter;
typedef C2A To_approximate_converter; typedef C2A To_approximate_converter;
typedef typename EP::result_type result_type;
// AP::result_type must be convertible to EP::result_type.
Filtered_predicate() Filtered_predicate()
{} {}
@ -85,11 +80,14 @@ public:
{} {}
template <typename... Args> template <typename... Args>
result_type auto
operator()(const Args&... args) const operator()(const Args&... args) const
{ {
typedef typename Remove_needs_FT<CGAL::cpp20::remove_cvref_t<decltype(ep(c2e(args)...))> >::Type result_type;
#ifndef CGAL_EPICK_NO_INTERVALS #ifndef CGAL_EPICK_NO_INTERVALS
typedef typename Remove_needs_FT<CGAL::cpp20::remove_cvref_t<decltype(ap(c2a(args)...))> >::Type Ares;
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
// Protection is outside the try block as VC8 has the CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG // Protection is outside the try block as VC8 has the CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG
{ {
@ -98,7 +96,7 @@ public:
{ {
Ares res = ap(c2a(args)...); Ares res = ap(c2a(args)...);
if (is_certain(res)) if (is_certain(res))
return get_certain(res); return result_type(get_certain(res));
} }
catch (Uncertain_conversion_exception&) {} catch (Uncertain_conversion_exception&) {}
} }
@ -106,7 +104,7 @@ public:
Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST); Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST);
CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST); CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST);
#endif // CGAL_EPICK_NO_INTERVALS #endif // CGAL_EPICK_NO_INTERVALS
return ep(c2e(args)...); return result_type(ep(c2e(args)...));
} }
}; };
@ -120,27 +118,28 @@ class Filtered_predicate_RT_FT
EP_FT ep_ft; EP_FT ep_ft;
AP ap; AP ap;
using Ares = typename Remove_needs_FT<typename AP::result_type>::Type;
public:
using result_type = typename Remove_needs_FT<typename EP_FT::result_type>::Type;
private: private:
// Detect if the predicate's result type has been wrapped with the `Needs_FT` class
template <typename... Args> template <typename... Args>
struct Call_operator_needs_FT struct Call_operator_needs_FT
{ {
using Actual_approx_res = decltype(ap(c2a(std::declval<const Args&>())...)); template <typename T>
using Approx_res = std::remove_cv_t<std::remove_reference_t<Actual_approx_res> >; struct is_Needs_FT : std::false_type { };
enum { value = std::is_same<Approx_res, Needs_FT<Ares> >::value }; template <typename ...T>
struct is_Needs_FT<Needs_FT<T...> > : std::true_type { };
typedef CGAL::cpp20::remove_cvref_t<decltype(ap(c2a(std::declval<const Args&>())...))> Actual_approx_res;
enum { value = is_Needs_FT<Actual_approx_res>::value };
}; };
// If there is no `Needs_FT` in the result, then we can use an RT-based exact predicate
template <typename... Args, template <typename... Args,
std::enable_if_t<Call_operator_needs_FT<Args...>::value>* = nullptr> std::enable_if_t<Call_operator_needs_FT<Args...>::value>* = nullptr>
result_type call(const Args&... args) const { return ep_ft(c2e_ft(args)...); } decltype(auto) exact_call(const Args&... args) const { return ep_ft(c2e_ft(args)...); }
template <typename... Args, template <typename... Args,
std::enable_if_t<! Call_operator_needs_FT<Args...>::value>* = nullptr> std::enable_if_t<! Call_operator_needs_FT<Args...>::value>* = nullptr>
result_type call(const Args&... args) const { return ep_rt(c2e_rt(args)...); } decltype(auto) exact_call(const Args&... args) const { return ep_rt(c2e_rt(args)...); }
public: public:
// ## Important note // ## Important note
@ -154,10 +153,14 @@ public:
bool needs_FT(const Args&...) const { return Call_operator_needs_FT<Args...>::value; } bool needs_FT(const Args&...) const { return Call_operator_needs_FT<Args...>::value; }
template <typename... Args> template <typename... Args>
result_type auto
operator()(const Args&... args) const operator()(const Args&... args) const
{ {
typedef typename Remove_needs_FT<CGAL::cpp20::remove_cvref_t<decltype(exact_call(args...))> >::Type result_type;
#ifndef CGAL_EPICK_NO_INTERVALS #ifndef CGAL_EPICK_NO_INTERVALS
typedef typename Remove_needs_FT<CGAL::cpp20::remove_cvref_t<decltype(ap(c2a(args)...))> >::Type Ares;
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
// Protection is outside the try block as VC8 has the CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG // Protection is outside the try block as VC8 has the CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG
{ {
@ -166,7 +169,7 @@ public:
{ {
Ares res = ap(c2a(args)...); Ares res = ap(c2a(args)...);
if (is_certain(res)) if (is_certain(res))
return get_certain(res); return result_type(get_certain(res));
} }
catch (Uncertain_conversion_exception&) {} catch (Uncertain_conversion_exception&) {}
} }
@ -174,7 +177,7 @@ public:
Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST); Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST);
CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST); CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST);
#endif // CGAL_EPICK_NO_INTERVALS #endif // CGAL_EPICK_NO_INTERVALS
return call(args...); return result_type(exact_call(args...));
} }
}; };

View File

@ -33,33 +33,27 @@ class Filtered_predicate_with_state
O1 o1; O1 o1;
mutable std::optional<EP> oep; mutable std::optional<EP> oep;
AP ap; AP ap;
typedef typename AP::result_type Ares;
public: public:
// AP::result_type must be convertible to EP::result_type.
typedef AP Approximate_predicate; typedef AP Approximate_predicate;
typedef EP Exact_predicate; typedef EP Exact_predicate;
typedef C2E To_exact_converter; typedef C2E To_exact_converter;
typedef C2A To_approximate_converter; typedef C2A To_approximate_converter;
typedef typename EP::result_type result_type;
// AP::result_type must be convertible to EP::result_type.
Filtered_predicate_with_state(const O1 &o1) Filtered_predicate_with_state(const O1 &o1)
: c2e(), c2a(), o1(o1), oep(), ap(c2a(o1)) : c2e(), c2a(), o1(o1), oep(), ap(c2a(o1))
{} {}
template <typename... Args> template <typename... Args>
result_type auto
operator()(const Args&... args) const;
};
template <class EP, class AP, class C2E, class C2A, class O1, bool Protection>
template <typename... Args>
typename Filtered_predicate_with_state<EP,AP,C2E,C2A,O1,Protection>::result_type
Filtered_predicate_with_state<EP,AP,C2E,C2A,O1,Protection>::
operator()(const Args&... args) const operator()(const Args&... args) const
{ {
typedef typename Remove_needs_FT<CGAL::cpp20::remove_cvref_t<decltype((*oep)(c2e(args)...))> >::Type result_type;
#ifndef CGAL_EPICK_NO_INTERVALS
typedef typename Remove_needs_FT<CGAL::cpp20::remove_cvref_t<decltype(ap(c2a(args)...))> >::Type Ares;
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
// Protection is outside the try block as VC8 has the CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG // Protection is outside the try block as VC8 has the CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG
{ {
@ -68,18 +62,22 @@ Filtered_predicate_with_state<EP,AP,C2E,C2A,O1,Protection>::
{ {
Ares res = ap(c2a(args)...); Ares res = ap(c2a(args)...);
if (is_certain(res)) if (is_certain(res))
return get_certain(res); return result_type(get_certain(res));
} }
catch (Uncertain_conversion_exception&) {} catch (Uncertain_conversion_exception&) {}
} }
CGAL_BRANCH_PROFILER_BRANCH(tmp); CGAL_BRANCH_PROFILER_BRANCH(tmp);
Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST); Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST);
CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST); CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST);
#endif
if(! oep){ if(! oep){
oep.emplace(c2e(o1)); oep.emplace(c2e(o1));
} }
return (*oep)(c2e(args)...); return result_type((*oep)(c2e(args)...));
} }
};
} //namespace CGAL } //namespace CGAL

View File

@ -25,8 +25,6 @@ template < typename P >
struct Primitive_profiler struct Primitive_profiler
: public P : public P
{ {
typedef typename P::result_type result_type;
// #define CGAL_KERNEL_PROFILER CGAL_PROFILER(CGAL_PRETTY_FUNCTION); // #define CGAL_KERNEL_PROFILER CGAL_PROFILER(CGAL_PRETTY_FUNCTION);
#define CGAL_KERNEL_PROFILER \ #define CGAL_KERNEL_PROFILER \
CGAL_PROFILER(typeid(static_cast<const P&>(*this)).name()) CGAL_PROFILER(typeid(static_cast<const P&>(*this)).name())
@ -35,7 +33,7 @@ struct Primitive_profiler
: P(p) {} : P(p) {}
template <class ... A> template <class ... A>
result_type decltype(auto)
operator()(A&& ... a) const operator()(A&& ... a) const
{ {
CGAL_KERNEL_PROFILER; CGAL_KERNEL_PROFILER;

File diff suppressed because it is too large Load Diff

View File

@ -15,7 +15,7 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
//#include <CGAL/Filtered_predicate.h> //#include <CGAL/Filtered_predicate.h>
#include <CGAL/Static_filtered_predicate.h> #include <CGAL/EPIC_predicate_if_convertible.h>
#include <CGAL/Filtered_kernel.h> #include <CGAL/Filtered_kernel.h>
#include <CGAL/Cartesian_converter.h> #include <CGAL/Cartesian_converter.h>
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
@ -37,62 +37,14 @@
namespace CGAL { namespace CGAL {
namespace internal {
// SFINAE way to detect result_type typedefs.
template<typename T>
class Has_result_type_helper
{
typedef char one;
typedef struct { char arr[2]; } two;
template<typename _Up>
struct Wrapper {};
template<typename U>
static one test(Wrapper<typename U::result_type>*);
template<typename U>
static two test(...);
public:
static const bool value = sizeof(test<T>(0)) == 1;
};
template<typename T>
struct Has_result_type
: std::integral_constant< bool,
Has_result_type_helper< std::remove_cv_t<T>>::value>
{};
template <typename T>
struct Get_result_type {
typedef typename T::result_type type;
};
template <typename T>
struct Lazy_result_type
: boost::mpl::eval_if< Has_result_type<T>,
Get_result_type<T>,
boost::mpl::identity<void> >
{};
class Enum_holder {
protected:
enum { NONE, NT, VARIANT, OBJECT, BBOX, OPTIONAL_ };
};
} // internal
// Exact_kernel = exact kernel that will be made lazy // Exact_kernel = exact kernel that will be made lazy
// Kernel = lazy kernel // Kernel = lazy kernel
// the Generic base simply applies the generic magic functor stupidly. // `Lazy_kernel_generic_base` applies the generic magic functor stupidly.
// then the real base fixes up a few special cases. // `Lazy_kernel_base` fixes up a few special cases.
template < typename EK_, typename AK_, typename E2A_, typename Kernel_ > template < typename EK_, typename AK_, typename E2A_, typename Kernel_ >
class Lazy_kernel_generic_base : protected internal::Enum_holder class Lazy_kernel_generic_base
// : public Filtered_kernel_base<EK_> // : public Filtered_kernel_base<EK_>
// TODO : Static_filters_base too ? Check performance
{ {
public: public:
@ -127,9 +79,18 @@ public:
typedef typename Exact_kernel::Rep_tag Rep_tag; typedef typename Exact_kernel::Rep_tag Rep_tag;
enum { Has_filtered_predicates = true }; enum { Has_filtered_predicates = true };
enum { Has_static_filters = false };
typedef Boolean_tag<Has_filtered_predicates> Has_filtered_predicates_tag; typedef Boolean_tag<Has_filtered_predicates> Has_filtered_predicates_tag;
#ifdef CGAL_NO_STATIC_FILTERS_FOR_LAZY_KERNEL
enum { Has_static_filters = false };
#else
// @fixme, this should be 'true' but it's broken because EPIC_predicate_if_convertible
// assumes the static filtered predicate and the (non-static) filtered predicate
// have the same signature, which is not always the case, for example in
// Do_intersect_3(Sphere_3, Bbox_3, *bool*)
enum { Has_static_filters = false };
#endif
// Types // Types
typedef CGAL::Lazy_exact_nt<typename Exact_kernel::FT> FT; typedef CGAL::Lazy_exact_nt<typename Exact_kernel::FT> FT;
typedef FT RT; typedef FT RT;
@ -168,115 +129,26 @@ public:
typedef CGAL::Aff_transformationC2<Kernel> Aff_transformation_2; typedef CGAL::Aff_transformationC2<Kernel> Aff_transformation_2;
typedef CGAL::Aff_transformationC3<Kernel> Aff_transformation_3; typedef CGAL::Aff_transformationC3<Kernel> Aff_transformation_3;
private:
// We use a combination of partial and logic to extract the right
// construction. Constructions without a result_type always have to
// be done through specializations.
//
// The case distinction goes as follows:
// result_type == FT => NT
// result_type == Object => Object
// result_type == std::optional => OPTIONAL_ Only for Intersect_point_3_for_polyhedral_envelope which returns a handle for a singleton
// result_type == Bbox_2 || result_type == Bbox_3 => BBOX
// default => NONE
// no result_type => NONE
//
//
// we require a Dummy because we cannot have complete
// specializations inside a non-namespace scope.
// The default implementation does some default handling,
// the special cases are filtered by partial specializations.
template <typename Construction, typename Dummy = std::nullopt_t>
struct Lazy_wrapper_traits :
boost::mpl::eval_if< internal::Has_result_type<Construction>,
boost::mpl::eval_if< std::is_same< std::remove_cv_t<
std::remove_reference_t<
typename internal::Lazy_result_type<Construction>::type
> >,
typename Approximate_kernel::FT>,
boost::mpl::int_<NT>,
boost::mpl::eval_if< std::is_same< typename internal::Lazy_result_type<Construction>::type,
CGAL::Object >,
boost::mpl::int_<OBJECT>,
boost::mpl::eval_if< std::bool_constant<
std::is_same_v< typename internal::Lazy_result_type<Construction>::type, CGAL::Bbox_2 > ||
std::is_same_v< typename internal::Lazy_result_type<Construction>::type, CGAL::Bbox_3 > >,
boost::mpl::int_<BBOX>,
boost::mpl::int_<NONE> > > >,
boost::mpl::int_<NONE> >::type {};
#define CGAL_WRAPPER_TRAIT(NAME, WRAPPER) \
template<typename Dummy> \
struct Lazy_wrapper_traits<typename Approximate_kernel::NAME, Dummy> \
: boost::mpl::int_<WRAPPER> {};
CGAL_WRAPPER_TRAIT(Intersect_2, VARIANT)
CGAL_WRAPPER_TRAIT(Intersect_3, VARIANT)
CGAL_WRAPPER_TRAIT(Intersect_point_3_for_polyhedral_envelope, OPTIONAL_)
CGAL_WRAPPER_TRAIT(Compute_squared_radius_2, NT)
CGAL_WRAPPER_TRAIT(Compute_x_3, NT)
CGAL_WRAPPER_TRAIT(Compute_y_3, NT)
CGAL_WRAPPER_TRAIT(Compute_z_3, NT)
#undef CGAL_WRAPPER_TRAIT
template <typename Construction, int Type = Lazy_wrapper_traits<Construction>::value>
struct Select_wrapper_impl;
template <typename Construction>
struct Select_wrapper_impl<Construction, NONE> {
template<typename Kernel, typename AKC, typename EKC>
struct apply { typedef Lazy_construction<Kernel, AKC, EKC> type; };
};
template <typename Construction>
struct Select_wrapper_impl<Construction, NT> {
template<typename Kernel, typename AKC, typename EKC>
struct apply { typedef Lazy_construction_nt<Kernel, AKC, EKC> type; };
};
template <typename Construction>
struct Select_wrapper_impl<Construction, VARIANT> {
template<typename Kernel, typename AKC, typename EKC>
struct apply { typedef Lazy_construction_variant<Kernel, AKC, EKC> type; };
};
template <typename Construction>
struct Select_wrapper_impl<Construction, OBJECT> {
template<typename Kernel, typename AKC, typename EKC>
struct apply { typedef Lazy_construction_object<Kernel, AKC, EKC> type; };
};
template <typename Construction>
struct Select_wrapper_impl<Construction, BBOX> {
template<typename Kernel, typename AKC, typename EKC>
struct apply { typedef Lazy_construction_bbox<Kernel, AKC, EKC> type; };
};
template <typename Construction>
struct Select_wrapper_impl<Construction, OPTIONAL_> {
template<typename Kernel, typename AKC, typename EKC>
struct apply { typedef Lazy_construction_optional_for_polygonal_envelope<Kernel, AKC, EKC> type; };
};
template <typename Construction>
struct Select_wrapper : Select_wrapper_impl<Construction> {};
public: public:
#ifdef CGAL_NO_STATIC_FILTERS_FOR_LAZY_KERNEL #ifdef CGAL_NO_STATIC_FILTERS_FOR_LAZY_KERNEL
#define CGAL_Kernel_pred(P, Pf) \ #define CGAL_Kernel_pred(P, Pf) \
typedef Filtered_predicate<typename Exact_kernel::P, typename Approximate_kernel::P, C2E, C2F> P; \ typedef Filtered_predicate<typename Exact_kernel::P, typename Approximate_kernel::P, C2E, C2F> P; \
P Pf() const { return P(); } P Pf() const { return P(); }
#else #else
#define CGAL_Kernel_pred(P, Pf) \ // - the first template parameter is because either it fits in a double, or not, so
typedef Static_filtered_predicate<Approximate_kernel, Filtered_predicate<typename Exact_kernel::P, typename Approximate_kernel::P, C2E, C2F>, Exact_predicates_inexact_constructions_kernel::P> P; \ // we might as well use the approximate kernel directly rather than the complete lazy kernel
// - the second is the predicate to be called if EPICK is not usable
// - the third is the equivalent predicate in EPICK
#define CGAL_Kernel_pred(P, Pf) \
typedef EPIC_predicate_if_convertible<Approximate_kernel, \
Filtered_predicate<typename Exact_kernel::P, \
typename Approximate_kernel::P, C2E, C2F>, \
Exact_predicates_inexact_constructions_kernel::P> P; \
P Pf() const { return P(); } P Pf() const { return P(); }
#endif #endif
#define CGAL_Kernel_cons(C, Cf) \ #define CGAL_Kernel_cons(C, Cf) \
typedef typename Select_wrapper<typename Approximate_kernel::C>::template apply<Kernel, typename Approximate_kernel::C, typename Exact_kernel::C>::type C; \ typedef Lazy_construction<Kernel, typename Approximate_kernel::C, typename Exact_kernel::C> C; \
C Cf() const { return C(); } C Cf() const { return C(); }
#include <CGAL/Kernel/interface_macros.h> #include <CGAL/Kernel/interface_macros.h>
@ -287,11 +159,6 @@ public:
struct Handle { typedef T type; }; struct Handle { typedef T type; };
}; };
template < typename EK_, typename AK_, typename E2A_, typename Kernel_ > template < typename EK_, typename AK_, typename E2A_, typename Kernel_ >
class Lazy_kernel_base class Lazy_kernel_base
: public Lazy_kernel_generic_base<EK_, AK_, E2A_, Kernel_> : public Lazy_kernel_generic_base<EK_, AK_, E2A_, Kernel_>
@ -308,18 +175,16 @@ public:
typedef CommonKernelFunctors::Assign_2<Kernel> Assign_2; typedef CommonKernelFunctors::Assign_2<Kernel> Assign_2;
typedef CommonKernelFunctors::Assign_3<Kernel> Assign_3; typedef CommonKernelFunctors::Assign_3<Kernel> Assign_3;
typedef Lazy_construction_bbox<Kernel, typename Approximate_kernel::Construct_bbox_2, typename Exact_kernel::Construct_bbox_2> Construct_bbox_2;
typedef Lazy_construction_bbox<Kernel, typename Approximate_kernel::Construct_bbox_3, typename Exact_kernel::Construct_bbox_3> Construct_bbox_3;
typedef Lazy_cartesian_const_iterator_2<Kernel, typename Approximate_kernel::Construct_cartesian_const_iterator_2, typename Exact_kernel::Construct_cartesian_const_iterator_2> Construct_cartesian_const_iterator_2; typedef Lazy_cartesian_const_iterator_2<Kernel, typename Approximate_kernel::Construct_cartesian_const_iterator_2, typename Exact_kernel::Construct_cartesian_const_iterator_2> Construct_cartesian_const_iterator_2;
typedef Lazy_cartesian_const_iterator_3<Kernel, typename Approximate_kernel::Construct_cartesian_const_iterator_3, typename Exact_kernel::Construct_cartesian_const_iterator_3> Construct_cartesian_const_iterator_3; typedef Lazy_cartesian_const_iterator_3<Kernel, typename Approximate_kernel::Construct_cartesian_const_iterator_3, typename Exact_kernel::Construct_cartesian_const_iterator_3> Construct_cartesian_const_iterator_3;
typedef CGAL::CartesianKernelFunctors::Compute_approximate_squared_length_3<Kernel> Compute_approximate_squared_length_3; typedef CGAL::CartesianKernelFunctors::Compute_approximate_squared_length_3<Kernel> Compute_approximate_squared_length_3;
typedef CGAL::CartesianKernelFunctors::Compute_approximate_area_3<Kernel> Compute_approximate_area_3; typedef CGAL::CartesianKernelFunctors::Compute_approximate_area_3<Kernel> Compute_approximate_area_3;
// typedef void Compute_z_3; // to detect where .z() is called typedef CGAL::Lazy_construction_optional_for_polyhedral_envelope<
// typedef void Construct_point_3; // to detect where the ctor is called Kernel,
typename Approximate_kernel::Intersect_point_3_for_polyhedral_envelope,
typename Exact_kernel::Intersect_point_3_for_polyhedral_envelope> Intersect_point_3_for_polyhedral_envelope;
struct Compute_weight_2 : public BaseClass::Compute_weight_2 struct Compute_weight_2 : public BaseClass::Compute_weight_2
{ {
@ -552,7 +417,6 @@ public:
}; };
struct Less_xyz_3 : public BaseClass::Less_xyz_3 struct Less_xyz_3 : public BaseClass::Less_xyz_3
{ {
typedef typename Kernel_::Point_3 Point_3; typedef typename Kernel_::Point_3 Point_3;
@ -593,14 +457,6 @@ public:
assign_3_object() const assign_3_object() const
{ return Assign_3(); } { return Assign_3(); }
Construct_bbox_2
construct_bbox_2_object() const
{ return Construct_bbox_2(); }
Construct_bbox_3
construct_bbox_3_object() const
{ return Construct_bbox_3(); }
Construct_cartesian_const_iterator_2 Construct_cartesian_const_iterator_2
construct_cartesian_const_iterator_2_object() const construct_cartesian_const_iterator_2_object() const
{ return Construct_cartesian_const_iterator_2(); } { return Construct_cartesian_const_iterator_2(); }
@ -617,6 +473,10 @@ public:
compute_approximate_area_3_object() const compute_approximate_area_3_object() const
{ return Compute_approximate_area_3(); } { return Compute_approximate_area_3(); }
Intersect_point_3_for_polyhedral_envelope
intersect_point_3_for_polyhedral_envelope_object() const
{ return Intersect_point_3_for_polyhedral_envelope(); }
Less_xyz_3 Less_xyz_3
less_xyz_3_object() const less_xyz_3_object() const
{ return Less_xyz_3(); } { return Less_xyz_3(); }

View File

@ -1,238 +0,0 @@
// Copyright (c) 2017 GeometryFactory
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : Andreas Fabri, Laurent Rineau
#ifndef CGAL_STATIC_FILTERED_PREDICATE_H
#define CGAL_STATIC_FILTERED_PREDICATE_H
#include <CGAL/Epic_converter.h>
namespace CGAL {
template <typename AK, typename FP, typename EpicP>
class Static_filtered_predicate {
public:
FP fp;
EpicP epicp;
typedef typename AK::FT IA;
typedef typename FP::result_type result_type;
template <typename A1>
result_type operator()(const A1& a1) const
{
CGAL::Epic_converter<AK> convert;
auto aa1 = convert(approx(a1));
if(! aa1.second){
return fp(a1);
}
return epicp(aa1.first);
}
template <typename A1, typename A2>
result_type operator()(const A1& a1, const A2& a2) const
{
CGAL::Epic_converter<AK> convert;
auto aa1 = convert(approx(a1));
if(! aa1.second){
return fp(a1, a2);
}
auto aa2 = convert(approx(a2));
if(! aa2.second){
return fp(a1, a2);
}
return epicp(aa1.first, aa2.first);
}
template <typename A1, typename A2, typename A3>
result_type operator()(const A1& a1, const A2& a2, const A3& a3) const
{
CGAL::Epic_converter<AK> convert;
auto aa1 = convert(approx(a1));
if(! aa1.second){
return fp(a1, a2, a3);
}
auto aa2 = convert(approx(a2));
if(! aa2.second){
return fp(a1, a2, a3);
}
auto aa3 = convert(approx(a3));
if(! aa3.second){
return fp(a1, a2, a3);
}
return epicp(aa1.first, aa2.first, aa3.first);
}
template <typename A1, typename A2, typename A3, typename A4>
result_type operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4) const
{
CGAL::Epic_converter<AK> convert;
auto aa1 = convert(approx(a1));
if(! aa1.second){
return fp(a1, a2, a3, a4);
}
auto aa2 = convert(approx(a2));
if(! aa2.second){
return fp(a1, a2, a3, a4);
}
auto aa3 = convert(approx(a3));
if(! aa3.second){
return fp(a1, a2, a3, a4);
}
auto aa4 = convert(approx(a4));
if(! aa4.second){
return fp(a1, a2, a3, a4);
}
return epicp(aa1.first, aa2.first, aa3.first, aa4.first);
}
template <typename A1, typename A2, typename A3, typename A4, typename A5>
result_type operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) const
{
CGAL::Epic_converter<AK> convert;
auto aa1 = convert(approx(a1));
if(! aa1.second){
return fp(a1, a2, a3, a4, a5);
}
auto aa2 = convert(approx(a2));
if(! aa2.second){
return fp(a1, a2, a3, a4, a5);
}
auto aa3 = convert(approx(a3));
if(! aa3.second){
return fp(a1, a2, a3, a4, a5);
}
auto aa4 = convert(approx(a4));
if(! aa4.second){
return fp(a1, a2, a3, a4, a5);
}
auto aa5 = convert(approx(a5));
if(! aa5.second){
return fp(a1, a2, a3, a4, a5);
}
return epicp(aa1.first, aa2.first, aa3.first, aa4.first, aa5.first);
}
template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
result_type operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) const
{
CGAL::Epic_converter<AK> convert;
auto aa1 = convert(approx(a1));
if(! aa1.second){
return fp(a1, a2, a3, a4, a5, a6);
}
auto aa2 = convert(approx(a2));
if(! aa2.second){
return fp(a1, a2, a3, a4, a5, a6);
}
auto aa3 = convert(approx(a3));
if(! aa3.second){
return fp(a1, a2, a3, a4, a5, a6);
}
auto aa4 = convert(approx(a4));
if(! aa4.second){
return fp(a1, a2, a3, a4, a5, a6);
}
auto aa5 = convert(approx(a5));
if(! aa5.second){
return fp(a1, a2, a3, a4, a5, a6);
}
auto aa6 = convert(approx(a6));
if(! aa6.second){
return fp(a1, a2, a3, a4, a5, a6);
}
return epicp(aa1.first, aa2.first, aa3.first, aa4.first, aa5.first, aa6.first);
}
template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
result_type operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A6& a7) const
{
CGAL::Epic_converter<AK> convert;
auto aa1 = convert(approx(a1));
if(! aa1.second){
return fp(a1, a2, a3, a4, a5, a6, a7);
}
auto aa2 = convert(approx(a2));
if(! aa2.second){
return fp(a1, a2, a3, a4, a5, a6, a7);
}
auto aa3 = convert(approx(a3));
if(! aa3.second){
return fp(a1, a2, a3, a4, a5, a6, a7);
}
auto aa4 = convert(approx(a4));
if(! aa4.second){
return fp(a1, a2, a3, a4, a5, a6, a7);
}
auto aa5 = convert(approx(a5));
if(! aa5.second){
return fp(a1, a2, a3, a4, a5, a6, a7);
}
auto aa6 = convert(approx(a6));
if(! aa6.second){
return fp(a1, a2, a3, a4, a5, a6, a7);
}
auto aa7 = convert(approx(a7));
if(! aa7.second){
return fp(a1, a2, a3, a4, a5, a6, a7);
}
return epicp(aa1.first, aa2.first, aa3.first, aa4.first, aa5.first, aa6.first, aa7.first);
}
template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
result_type operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) const
{
CGAL::Epic_converter<AK> convert;
auto aa1 = convert(approx(a1));
if(! aa1.second){
return fp(a1, a2, a3, a4, a5, a6, a7, a8);
}
auto aa2 = convert(approx(a2));
if(! aa2.second){
return fp(a1, a2, a3, a4, a5, a6, a7, a8);
}
auto aa3 = convert(approx(a3));
if(! aa3.second){
return fp(a1, a2, a3, a4, a5, a6, a7, a8);
}
auto aa4 = convert(approx(a4));
if(! aa4.second){
return fp(a1, a2, a3, a4, a5, a6, a7, a8);
}
auto aa5 = convert(approx(a5));
if(! aa5.second){
return fp(a1, a2, a3, a4, a5, a6, a7, a8);
}
auto aa6 = convert(approx(a6));
if(! aa6.second){
return fp(a1, a2, a3, a5, a5, a6, a7, a8);
}
auto aa7 = convert(approx(a7));
if(! aa7.second){
return fp(a1, a2, a3, a5, a5, a6, a7, a8);
}
auto aa8 = convert(approx(a8));
if(! aa8.second){
return fp(a1, a2, a3, a4, a5, a6, a7, a8);
}
return epicp(aa1.first, aa2.first, aa3.first, aa4.first, aa5.first, aa6.first, aa7.first, aa8.first);
}
};
} // CGAL
#endif // CGAL_STATIC_FILTERED_PREDICATE_H

View File

@ -84,20 +84,20 @@ public:
CircleH2<R> CircleH2<R>
opposite() const; opposite() const;
Oriented_side typename R_::Oriented_side
oriented_side(const Point_2& ) const; oriented_side(const Point_2& ) const;
Bounded_side typename R_::Bounded_side
bounded_side(const Point_2& ) const; bounded_side(const Point_2& ) const;
bool operator==( const CircleH2<R>& ) const; bool operator==( const CircleH2<R>& ) const;
bool operator!=( const CircleH2<R>& ) const; bool operator!=( const CircleH2<R>& ) const;
bool has_on_positive_side(const Point_2& ) const; typename R_::Boolean has_on_positive_side(const Point_2& ) const;
bool has_on_negative_side(const Point_2& ) const; typename R_::Boolean has_on_negative_side(const Point_2& ) const;
bool has_on_boundary( const Point_2& ) const; typename R_::Boolean has_on_boundary( const Point_2& ) const;
bool has_on_bounded_side( const Point_2& ) const; typename R_::Boolean has_on_bounded_side( const Point_2& ) const;
bool has_on_unbounded_side(const Point_2&) const; typename R_::Boolean has_on_unbounded_side(const Point_2&) const;
bool is_degenerate() const; typename R_::Boolean is_degenerate() const;
// bool oriented_equal( const CircleH2<R>& ) const; // bool oriented_equal( const CircleH2<R>& ) const;
// bool unoriented_equal( const CircleH2<R>& ) const; // bool unoriented_equal( const CircleH2<R>& ) const;
@ -133,17 +133,15 @@ CircleH2<R>::orientation() const
template <class R> template <class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
Oriented_side typename R::Oriented_side
CircleH2<R>::oriented_side( const typename CircleH2<R>::Point_2& p) const CircleH2<R>::oriented_side( const typename CircleH2<R>::Point_2& p) const
{ {
FT sq_dist = squared_distance( p, center() ); FT sq_dist = squared_distance( p, center() );
FT sq_rad = squared_radius(); const FT& sq_rad = squared_radius();
Comparison_result vgl = CGAL_NTS compare( sq_dist, sq_rad ); typename R::Comparison_result vgl = CGAL_NTS compare( sq_dist, sq_rad );
Oriented_side rel_pos = (vgl == LARGER ) ? typename R::Oriented_side rel_pos = (vgl == LARGER ) ? ON_NEGATIVE_SIDE
ON_NEGATIVE_SIDE : : ((vgl == SMALLER) ? ON_POSITIVE_SIDE
( (vgl == SMALLER ) ? : ON_ORIENTED_BOUNDARY);
ON_POSITIVE_SIDE :
ON_ORIENTED_BOUNDARY);
if (orientation() == POSITIVE) if (orientation() == POSITIVE)
{ return rel_pos; } { return rel_pos; }
else // NEGATIVE else // NEGATIVE
@ -152,7 +150,7 @@ CircleH2<R>::oriented_side( const typename CircleH2<R>::Point_2& p) const
template <class R> template <class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
CircleH2<R>::has_on_positive_side(const typename CircleH2<R>::Point_2& p) const CircleH2<R>::has_on_positive_side(const typename CircleH2<R>::Point_2& p) const
{ {
if ( orientation() == POSITIVE ) if ( orientation() == POSITIVE )
@ -163,7 +161,7 @@ CircleH2<R>::has_on_positive_side(const typename CircleH2<R>::Point_2& p) const
template <class R> template <class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
CircleH2<R>::has_on_boundary(const typename CircleH2<R>::Point_2& p) const CircleH2<R>::has_on_boundary(const typename CircleH2<R>::Point_2& p) const
{ {
FT sq_dist = squared_distance( p, center() ); FT sq_dist = squared_distance( p, center() );
@ -173,7 +171,7 @@ CircleH2<R>::has_on_boundary(const typename CircleH2<R>::Point_2& p) const
template <class R> template <class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
CircleH2<R>::has_on_negative_side( const typename CircleH2<R>::Point_2&p) const CircleH2<R>::has_on_negative_side( const typename CircleH2<R>::Point_2&p) const
{ {
if ( orientation() == NEGATIVE ) if ( orientation() == NEGATIVE )
@ -188,12 +186,12 @@ CircleH2<R>::has_on_negative_side( const typename CircleH2<R>::Point_2&p) const
template <class R> template <class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
Bounded_side typename R::Bounded_side
CircleH2<R>::bounded_side(const typename CircleH2<R>::Point_2& p) const CircleH2<R>::bounded_side(const typename CircleH2<R>::Point_2& p) const
{ {
FT sq_dist = squared_distance( p, center() ); FT sq_dist = squared_distance( p, center() );
FT sq_rad = squared_radius(); const FT& sq_rad = squared_radius();
Comparison_result vgl = CGAL_NTS compare( sq_dist, sq_rad ); typename R::Comparison_result vgl = CGAL_NTS compare( sq_dist, sq_rad );
return (vgl == LARGER ) ? ON_UNBOUNDED_SIDE : return (vgl == LARGER ) ? ON_UNBOUNDED_SIDE :
( (vgl == SMALLER ) ? ( (vgl == SMALLER ) ?
ON_BOUNDED_SIDE : ON_BOUNDED_SIDE :
@ -202,33 +200,33 @@ CircleH2<R>::bounded_side(const typename CircleH2<R>::Point_2& p) const
template <class R> template <class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
CircleH2<R>::has_on_bounded_side(const typename CircleH2<R>::Point_2& p) const CircleH2<R>::has_on_bounded_side(const typename CircleH2<R>::Point_2& p) const
{ {
FT sq_dist = squared_distance( p, center() ); FT sq_dist = squared_distance( p, center() );
FT sq_rad = squared_radius(); const FT& sq_rad = squared_radius();
return ( sq_dist < sq_rad ); return ( sq_dist < sq_rad );
} }
template <class R> template <class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
CircleH2<R>::has_on_unbounded_side(const typename CircleH2<R>::Point_2&p) const CircleH2<R>::has_on_unbounded_side(const typename CircleH2<R>::Point_2&p) const
{ {
FT sq_dist = squared_distance( p, center() ); FT sq_dist = squared_distance( p, center() );
FT sq_rad = squared_radius(); const FT& sq_rad = squared_radius();
return ( sq_rad < sq_dist ); return ( sq_rad < sq_dist );
} }
template <class R> template <class R>
inline inline
bool typename R::Boolean
CircleH2<R>::is_degenerate() const CircleH2<R>::is_degenerate() const
{ return ( squared_radius() == FT(0) ); } { return ( squared_radius() == FT(0) ); }
template <class R> template <class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
CircleH2<R>::operator==(const CircleH2<R>& c) const CircleH2<R>::operator==(const CircleH2<R>& c) const
{ {
return ( center() == c.center() ) return ( center() == c.center() )
@ -238,7 +236,7 @@ CircleH2<R>::operator==(const CircleH2<R>& c) const
template <class R> template <class R>
inline inline
bool typename R::Boolean
CircleH2<R>::operator!=(const CircleH2<R>& c) const CircleH2<R>::operator!=(const CircleH2<R>& c) const
{ return !(*this == c); } { return !(*this == c); }

View File

@ -64,9 +64,8 @@ public:
: base( w > RT(0) ? CGAL::make_array(x, y, w) : base( w > RT(0) ? CGAL::make_array(x, y, w)
: CGAL::make_array<RT>(-x, -y, -w) ) {} : CGAL::make_array<RT>(-x, -y, -w) ) {}
bool operator==( const DirectionH2<R>& d) const; typename R_::Boolean operator==( const DirectionH2<R>& d) const;
bool operator!=( const DirectionH2<R>& d) const; typename R_::Boolean operator!=( const DirectionH2<R>& d) const;
Vector_2 to_vector() const; Vector_2 to_vector() const;
@ -81,7 +80,7 @@ public:
template <class R > template <class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
DirectionH2<R>::operator==( const DirectionH2<R>& d) const DirectionH2<R>::operator==( const DirectionH2<R>& d) const
{ {
return ( ( x() * d.y() == y() * d.x() ) return ( ( x() * d.y() == y() * d.x() )
@ -91,7 +90,7 @@ DirectionH2<R>::operator==( const DirectionH2<R>& d) const
template <class R > template <class R >
inline inline
bool typename R::Boolean
DirectionH2<R>::operator!=( const DirectionH2<R>& d) const DirectionH2<R>::operator!=( const DirectionH2<R>& d) const
{ return !(*this == d); } { return !(*this == d); }

View File

@ -66,10 +66,10 @@ public:
: base( w >= RT(0) ? CGAL::make_array(x, y, z, w) : base( w >= RT(0) ? CGAL::make_array(x, y, z, w)
: CGAL::make_array<RT>(-x, -y, -z, -w) ) {} : CGAL::make_array<RT>(-x, -y, -z, -w) ) {}
bool is_degenerate() const; typename R::Boolean is_degenerate() const;
bool operator==( const DirectionH3<R>& d) const; typename R::Boolean operator==( const DirectionH3<R>& d) const;
bool operator!=( const DirectionH3<R>& d) const; typename R::Boolean operator!=( const DirectionH3<R>& d) const;
Vector_3 to_vector() const; Vector_3 to_vector() const;
Vector_3 vector() const { return to_vector(); } Vector_3 vector() const { return to_vector(); }
@ -87,7 +87,7 @@ public:
template <class R > template <class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
DirectionH3<R>::operator==( const DirectionH3<R>& d) const DirectionH3<R>::operator==( const DirectionH3<R>& d) const
{ {
return ( ( hx()*d.hy() == hy()*d.hx() ) return ( ( hx()*d.hy() == hy()*d.hx() )
@ -100,13 +100,13 @@ DirectionH3<R>::operator==( const DirectionH3<R>& d) const
template <class R > template <class R >
inline inline
bool typename R::Boolean
DirectionH3<R>::operator!=( const DirectionH3<R>& d) const DirectionH3<R>::operator!=( const DirectionH3<R>& d) const
{ return !operator==(d); } { return !operator==(d); }
template <class R > template <class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
DirectionH3<R>::is_degenerate() const DirectionH3<R>::is_degenerate() const
{ return ((hx() == RT(0)) && (hy() == RT(0)) && (hz() == RT(0))); } { return ((hx() == RT(0)) && (hy() == RT(0)) && (hz() == RT(0))); }

View File

@ -63,23 +63,21 @@ public:
Iso_cuboidH3(const RT& min_hx, const RT& min_hy, const RT& min_hz, Iso_cuboidH3(const RT& min_hx, const RT& min_hy, const RT& min_hz,
const RT& max_hx, const RT& max_hy, const RT& max_hz); const RT& max_hx, const RT& max_hy, const RT& max_hz);
bool operator==(const Iso_cuboidH3<R>& s) const; typename R::Boolean operator==(const Iso_cuboidH3<R>& s) const;
bool operator!=(const Iso_cuboidH3<R>& s) const; typename R::Boolean operator!=(const Iso_cuboidH3<R>& s) const;
const Point_3 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const; const Point_3 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const;
const Point_3 & max BOOST_PREVENT_MACRO_SUBSTITUTION () const; const Point_3 & max BOOST_PREVENT_MACRO_SUBSTITUTION () const;
Point_3 vertex(int i) const; Point_3 vertex(int i) const;
Point_3 operator[](int i) const; Point_3 operator[](int i) const;
Iso_cuboidH3<R> Iso_cuboidH3<R> transform(const Aff_transformation_3& t) const;
transform(const Aff_transformation_3& t) const; typename R::Bounded_side bounded_side(const Point_3& p) const;
Bounded_side typename R::Boolean has_on(const Point_3& p) const;
bounded_side(const Point_3& p) const; typename R::Boolean has_on_boundary(const Point_3& p) const;
bool has_on(const Point_3& p) const; typename R::Boolean has_on_bounded_side(const Point_3& p) const;
bool has_on_boundary(const Point_3& p) const; typename R::Boolean has_on_unbounded_side(const Point_3& p) const;
bool has_on_bounded_side(const Point_3& p) const; typename R::Boolean is_degenerate() const;
bool has_on_unbounded_side(const Point_3& p) const;
bool is_degenerate() const;
FT xmin() const; FT xmin() const;
FT ymin() const; FT ymin() const;
FT zmin() const; FT zmin() const;
@ -189,14 +187,14 @@ Iso_cuboidH3(const RT& min_hx, const RT& min_hy, const RT& min_hz,
template < class R > template < class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
Iso_cuboidH3<R>:: Iso_cuboidH3<R>::
operator==(const Iso_cuboidH3<R>& r) const operator==(const Iso_cuboidH3<R>& r) const
{ return ((this->min)() == (r.min)()) && ((this->max)() == (r.max)()); } { return ((this->min)() == (r.min)()) && ((this->max)() == (r.max)()); }
template < class R > template < class R >
inline inline
bool typename R::Boolean
Iso_cuboidH3<R>:: Iso_cuboidH3<R>::
operator!=(const Iso_cuboidH3<R>& r) const operator!=(const Iso_cuboidH3<R>& r) const
{ return !(*this == r); } { return !(*this == r); }
@ -313,7 +311,7 @@ Iso_cuboidH3<R>::operator[](int i) const
template < class R > template < class R >
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
Bounded_side typename R::Bounded_side
Iso_cuboidH3<R>:: Iso_cuboidH3<R>::
bounded_side(const typename Iso_cuboidH3<R>::Point_3& p) const bounded_side(const typename Iso_cuboidH3<R>::Point_3& p) const
{ {
@ -337,34 +335,34 @@ bounded_side(const typename Iso_cuboidH3<R>::Point_3& p) const
template < class R > template < class R >
inline inline
bool typename R::Boolean
Iso_cuboidH3<R>:: Iso_cuboidH3<R>::
has_on_boundary(const typename Iso_cuboidH3<R>::Point_3& p) const has_on_boundary(const typename Iso_cuboidH3<R>::Point_3& p) const
{ return ( bounded_side(p) == ON_BOUNDARY ); } { return ( bounded_side(p) == ON_BOUNDARY ); }
template < class R > template < class R >
inline inline
bool typename R::Boolean
Iso_cuboidH3<R>::has_on(const typename Iso_cuboidH3<R>::Point_3& p) const Iso_cuboidH3<R>::has_on(const typename Iso_cuboidH3<R>::Point_3& p) const
{ return ( bounded_side(p) == ON_BOUNDARY ); } { return ( bounded_side(p) == ON_BOUNDARY ); }
template < class R > template < class R >
inline inline
bool typename R::Boolean
Iso_cuboidH3<R>:: Iso_cuboidH3<R>::
has_on_bounded_side(const typename Iso_cuboidH3<R>::Point_3& p) const has_on_bounded_side(const typename Iso_cuboidH3<R>::Point_3& p) const
{ return ( bounded_side(p) == ON_BOUNDED_SIDE ); } { return ( bounded_side(p) == ON_BOUNDED_SIDE ); }
template < class R > template < class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
Iso_cuboidH3<R>:: Iso_cuboidH3<R>::
has_on_unbounded_side(const typename Iso_cuboidH3<R>::Point_3& p) const has_on_unbounded_side(const typename Iso_cuboidH3<R>::Point_3& p) const
{ return ( bounded_side(p) == ON_UNBOUNDED_SIDE ); } { return ( bounded_side(p) == ON_UNBOUNDED_SIDE ); }
template < class R > template < class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
Iso_cuboidH3<R>::is_degenerate() const Iso_cuboidH3<R>::is_degenerate() const
{ {
return ( ( (this->min)().hx() == (this->max)().hx() ) return ( ( (this->min)().hx() == (this->max)().hx() )

View File

@ -52,7 +52,7 @@ public:
const Point_2 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const; const Point_2 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const;
const Point_2 & max BOOST_PREVENT_MACRO_SUBSTITUTION () const; const Point_2 & max BOOST_PREVENT_MACRO_SUBSTITUTION () const;
Bounded_side bounded_side(const Point_2& p) const; typename R_::Bounded_side bounded_side(const Point_2& p) const;
}; };
@ -71,7 +71,7 @@ Iso_rectangleH2<R>::max BOOST_PREVENT_MACRO_SUBSTITUTION () const
template < class R > template < class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
Bounded_side typename R::Bounded_side
Iso_rectangleH2<R>:: Iso_rectangleH2<R>::
bounded_side(const typename Iso_rectangleH2<R>::Point_2& p) const bounded_side(const typename Iso_rectangleH2<R>::Point_2& p) const
{ {

View File

@ -47,8 +47,8 @@ public:
LineH2(const RT& a, const RT& b, const RT& c) LineH2(const RT& a, const RT& b, const RT& c)
: base{a, b, c} {} : base{a, b, c} {}
bool operator==(const LineH2<R>& l) const; typename R_::Boolean operator==(const LineH2<R>& l) const;
bool operator!=(const LineH2<R>& l) const; typename R_::Boolean operator!=(const LineH2<R>& l) const;
const RT & a() const { return get_pointee_or_identity(base)[0]; } const RT & a() const { return get_pointee_or_identity(base)[0]; }
const RT & b() const { return get_pointee_or_identity(base)[1]; } const RT & b() const { return get_pointee_or_identity(base)[1]; }
@ -58,7 +58,7 @@ public:
template < class R > template < class R >
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
bool typename R::Boolean
LineH2<R>::operator==(const LineH2<R>& l) const LineH2<R>::operator==(const LineH2<R>& l) const
{ {
if ( (a() * l.c() != l.a() * c() ) if ( (a() * l.c() != l.a() * c() )
@ -83,7 +83,7 @@ LineH2<R>::operator==(const LineH2<R>& l) const
template < class R > template < class R >
inline inline
bool typename R::Boolean
LineH2<R>::operator!=(const LineH2<R>& l) const LineH2<R>::operator!=(const LineH2<R>& l) const
{ return !(*this == l); } { return !(*this == l); }

View File

@ -67,8 +67,8 @@ public:
const RT & c() const; const RT & c() const;
const RT & d() const; const RT & d() const;
bool operator==( const PlaneH3<R>& ) const; typename R::Boolean operator==( const PlaneH3<R>& ) const;
bool operator!=( const PlaneH3<R>& ) const; typename R::Boolean operator!=( const PlaneH3<R>& ) const;
Line_3 perpendicular_line(const Point_3& ) const; Line_3 perpendicular_line(const Point_3& ) const;
Plane_3 opposite() const; // plane with opposite orientation Plane_3 opposite() const; // plane with opposite orientation
@ -78,13 +78,13 @@ public:
Direction_3 orthogonal_direction() const; Direction_3 orthogonal_direction() const;
Vector_3 orthogonal_vector() const; Vector_3 orthogonal_vector() const;
Oriented_side oriented_side(const Point_3 &p) const; typename R::Oriented_side oriented_side(const Point_3& p) const;
bool has_on(const Point_3 &p) const; typename R::Boolean has_on(const Point_3& p) const;
bool has_on(const Line_3 &p) const; typename R::Boolean has_on(const Line_3& p) const;
bool has_on_positive_side(const Point_3&l) const; typename R::Boolean has_on_positive_side(const Point_3& l) const;
bool has_on_negative_side(const Point_3&l) const; typename R::Boolean has_on_negative_side(const Point_3& l) const;
bool is_degenerate() const; typename R::Boolean is_degenerate() const;
Aff_transformation_3 transform_to_2d() const; Aff_transformation_3 transform_to_2d() const;
Point_2 to_2d(const Point_3& ) const; Point_2 to_2d(const Point_3& ) const;
@ -163,7 +163,7 @@ PlaneH3<R>::new_rep(const RT &a, const RT &b, const RT &c, const RT &d)
template < class R > template < class R >
inline inline
bool typename R::Boolean
PlaneH3<R>::operator!=(const PlaneH3<R>& l) const PlaneH3<R>::operator!=(const PlaneH3<R>& l) const
{ {
return !(*this == l); return !(*this == l);
@ -397,7 +397,7 @@ PlaneH3<R>::orthogonal_vector() const
{ return Vector_3(a(), b(), c() ); } { return Vector_3(a(), b(), c() ); }
template < class R > template < class R >
bool typename R::Boolean
PlaneH3<R>::is_degenerate() const PlaneH3<R>::is_degenerate() const
{ {
const RT RT0(0); const RT RT0(0);
@ -405,14 +405,14 @@ PlaneH3<R>::is_degenerate() const
} }
template < class R > template < class R >
bool typename R::Boolean
PlaneH3<R>::has_on_positive_side( const typename PlaneH3<R>::Point_3& p) const PlaneH3<R>::has_on_positive_side( const typename PlaneH3<R>::Point_3& p) const
{ {
return (a()*p.hx() + b()*p.hy() + c()*p.hz() + d()*p.hw() > RT(0) ); return (a()*p.hx() + b()*p.hy() + c()*p.hz() + d()*p.hw() > RT(0) );
} }
template < class R > template < class R >
bool typename R::Boolean
PlaneH3<R>::has_on_negative_side( const typename PlaneH3<R>::Point_3& p) const PlaneH3<R>::has_on_negative_side( const typename PlaneH3<R>::Point_3& p) const
{ {
return (a()*p.hx() + b()*p.hy() + c()*p.hz() + d()*p.hw() < RT(0) ); return (a()*p.hx() + b()*p.hy() + c()*p.hz() + d()*p.hw() < RT(0) );
@ -420,14 +420,14 @@ PlaneH3<R>::has_on_negative_side( const typename PlaneH3<R>::Point_3& p) const
template < class R > template < class R >
bool typename R::Boolean
PlaneH3<R>::has_on( const typename PlaneH3<R>::Point_3& p) const PlaneH3<R>::has_on( const typename PlaneH3<R>::Point_3& p) const
{ {
return (a()*p.hx() + b()*p.hy() + c()*p.hz() + d()*p.hw() == RT(0) ); return (a()*p.hx() + b()*p.hy() + c()*p.hz() + d()*p.hw() == RT(0) );
} }
template < class R > template < class R >
bool typename R::Boolean
PlaneH3<R>::has_on( const typename PlaneH3<R>::Line_3& l) const PlaneH3<R>::has_on( const typename PlaneH3<R>::Line_3& l) const
{ {
Point_3 p = l.point(); Point_3 p = l.point();
@ -439,7 +439,7 @@ PlaneH3<R>::has_on( const typename PlaneH3<R>::Line_3& l) const
} }
template < class R > template < class R >
Oriented_side typename R::Oriented_side
PlaneH3<R>::oriented_side( const typename PlaneH3<R>::Point_3& p) const PlaneH3<R>::oriented_side( const typename PlaneH3<R>::Point_3& p) const
{ {
return CGAL_NTS sign( a()*p.hx() + b()*p.hy() + c()*p.hz() + d()*p.hw() ); return CGAL_NTS sign( a()*p.hx() + b()*p.hy() + c()*p.hz() + d()*p.hw() );
@ -447,7 +447,7 @@ PlaneH3<R>::oriented_side( const typename PlaneH3<R>::Point_3& p) const
template < class R > template < class R >
bool typename R::Boolean
PlaneH3<R>::operator==(const PlaneH3<R>& l) const PlaneH3<R>::operator==(const PlaneH3<R>& l) const
{ {
if ( (a() * l.d() != l.a() * d() ) if ( (a() * l.d() != l.a() * d() )

View File

@ -63,8 +63,8 @@ public:
PointH2(const RT& hx, const RT& hy, const RT& hw) PointH2(const RT& hx, const RT& hy, const RT& hw)
: base(hx, hy, hw) {} : base(hx, hy, hw) {}
bool operator==( const PointH2<R>& p) const; typename R::Boolean operator==( const PointH2<R>& p) const;
bool operator!=( const PointH2<R>& p) const; typename R::Boolean operator!=( const PointH2<R>& p) const;
const RT & hx() const { return base.hx(); } const RT & hx() const { return base.hx(); }
const RT & hy() const { return base.hy(); } const RT & hy() const { return base.hy(); }
@ -94,7 +94,7 @@ public:
template < class R > template < class R >
inline inline
bool typename R::Boolean
PointH2<R>::operator==( const PointH2<R>& p) const PointH2<R>::operator==( const PointH2<R>& p) const
{ {
return base == p.base; return base == p.base;
@ -102,7 +102,7 @@ PointH2<R>::operator==( const PointH2<R>& p) const
template < class R > template < class R >
inline inline
bool typename R::Boolean
PointH2<R>::operator!=( const PointH2<R>& p) const PointH2<R>::operator!=( const PointH2<R>& p) const
{ return !(*this == p); } { return !(*this == p); }

View File

@ -90,8 +90,8 @@ public:
Direction_3 direction() const; Direction_3 direction() const;
Point_3 transform( const Aff_transformation_3 & t) const; Point_3 transform( const Aff_transformation_3 & t) const;
bool operator==( const PointH3<R>& p) const; typename R::Boolean operator==( const PointH3<R>& p) const;
bool operator!=( const PointH3<R>& p) const; typename R::Boolean operator!=( const PointH3<R>& p) const;
}; };
@ -175,7 +175,7 @@ PointH3<R>::direction() const
template < class R > template < class R >
inline inline
bool typename R::Boolean
PointH3<R>::operator==( const PointH3<R> & p) const PointH3<R>::operator==( const PointH3<R> & p) const
{ {
return base == p.base; return base == p.base;
@ -183,7 +183,7 @@ PointH3<R>::operator==( const PointH3<R> & p) const
template < class R > template < class R >
inline inline
bool typename R::Boolean
PointH3<R>::operator!=( const PointH3<R> & p) const PointH3<R>::operator!=( const PointH3<R> & p) const
{ return !(*this == p); } { return !(*this == p); }

View File

@ -63,12 +63,12 @@ public:
const Vector_3 & to_vector() const; const Vector_3 & to_vector() const;
Line_3 supporting_line() const; Line_3 supporting_line() const;
RayH3<R> opposite() const; RayH3<R> opposite() const;
bool has_on(const Point_3& p) const; typename R::Boolean has_on(const Point_3& p) const;
bool collinear_has_on(const Point_3 &p) const; typename R::Boolean collinear_has_on(const Point_3 &p) const;
bool is_degenerate() const; typename R::Boolean is_degenerate() const;
bool operator==(const RayH3<R>& r) const; typename R::Boolean operator==(const RayH3<R>& r) const;
bool operator!=(const RayH3<R>& r) const; typename R::Boolean operator!=(const RayH3<R>& r) const;
}; };
template < class R > template < class R >
@ -133,7 +133,7 @@ RayH3<R>::opposite() const
template < class R > template < class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
RayH3<R>::has_on(const typename RayH3<R>::Point_3 &p) const RayH3<R>::has_on(const typename RayH3<R>::Point_3 &p) const
{ {
return ( ( p == start() ) return ( ( p == start() )
@ -142,25 +142,25 @@ RayH3<R>::has_on(const typename RayH3<R>::Point_3 &p) const
template < class R > template < class R >
inline /* XXX */ inline /* XXX */
bool typename R::Boolean
RayH3<R>::collinear_has_on(const typename RayH3<R>::Point_3 &p) const RayH3<R>::collinear_has_on(const typename RayH3<R>::Point_3 &p) const
{ return has_on(p); } { return has_on(p); }
template < class R > template < class R >
inline inline
bool typename R::Boolean
RayH3<R>::is_degenerate() const RayH3<R>::is_degenerate() const
{ return to_vector() == NULL_VECTOR; } { return to_vector() == NULL_VECTOR; }
template < class R > template < class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
RayH3<R>::operator==(const RayH3<R>& r) const RayH3<R>::operator==(const RayH3<R>& r) const
{ return ( (start() == r.start() )&&( direction() == r.direction() ) ); } { return ( (start() == r.start() )&&( direction() == r.direction() ) ); }
template < class R > template < class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
RayH3<R>::operator!=( const RayH3<R>& r) const RayH3<R>::operator!=( const RayH3<R>& r) const
{ return !operator==(r); } { return !operator==(r); }

View File

@ -57,10 +57,10 @@ public:
SphereH3(const Point_3& p, SphereH3(const Point_3& p,
const Orientation& o = COUNTERCLOCKWISE); const Orientation& o = COUNTERCLOCKWISE);
bool typename R::Boolean
operator==(const SphereH3<R>&) const; operator==(const SphereH3<R>&) const;
bool typename R::Boolean
operator!=(const SphereH3<R>& s) const operator!=(const SphereH3<R>& s) const
{ return !(*this == s); } { return !(*this == s); }
@ -70,32 +70,32 @@ public:
Orientation orientation() const; Orientation orientation() const;
bool is_degenerate() const; typename R::Boolean is_degenerate() const;
SphereH3<R> opposite() const; SphereH3<R> opposite() const;
Oriented_side oriented_side(const Point_3& p) const; typename R::Oriented_side oriented_side(const Point_3& p) const;
bool typename R::Boolean
has_on_boundary(const Point_3& p) const has_on_boundary(const Point_3& p) const
{ return oriented_side(p)==ON_ORIENTED_BOUNDARY; } { return oriented_side(p)==ON_ORIENTED_BOUNDARY; }
bool typename R::Boolean
has_on_positive_side(const Point_3& p) const has_on_positive_side(const Point_3& p) const
{ return oriented_side(p)==ON_POSITIVE_SIDE; } { return oriented_side(p)==ON_POSITIVE_SIDE; }
bool typename R::Boolean
has_on_negative_side(const Point_3& p) const has_on_negative_side(const Point_3& p) const
{ return oriented_side(p)==ON_NEGATIVE_SIDE; } { return oriented_side(p)==ON_NEGATIVE_SIDE; }
Bounded_side typename R::Bounded_side
bounded_side(const Point_3& p) const; bounded_side(const Point_3& p) const;
bool typename R::Boolean
has_on_bounded_side(const Point_3& p) const has_on_bounded_side(const Point_3& p) const
{ return bounded_side(p)==ON_BOUNDED_SIDE; } { return bounded_side(p)==ON_BOUNDED_SIDE; }
bool typename R::Boolean
has_on_unbounded_side(const Point_3& p) const has_on_unbounded_side(const Point_3& p) const
{ return bounded_side(p)==ON_UNBOUNDED_SIDE; } { return bounded_side(p)==ON_UNBOUNDED_SIDE; }
}; };
@ -162,7 +162,7 @@ SphereH3<R>::SphereH3(const typename SphereH3<R>::Point_3& p,
template <class R> template <class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
SphereH3<R>::operator==(const SphereH3<R>& s) const SphereH3<R>::operator==(const SphereH3<R>& s) const
{ {
return ( orientation() == s.orientation()) return ( orientation() == s.orientation())
@ -190,23 +190,23 @@ SphereH3<R>::orientation() const
template <class R> template <class R>
inline inline
bool typename R::Boolean
SphereH3<R>::is_degenerate() const SphereH3<R>::is_degenerate() const
{ return squared_radius() <= FT(0) ; } { return squared_radius() <= FT(0) ; }
template <class R> template <class R>
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
Oriented_side typename R::Oriented_side
SphereH3<R>::oriented_side(const typename SphereH3<R>::Point_3& p) const SphereH3<R>::oriented_side(const typename SphereH3<R>::Point_3& p) const
{ return Oriented_side(static_cast<int>(bounded_side(p)) * static_cast<int>(orientation())); } { return Oriented_side(static_cast<int>(bounded_side(p)) * static_cast<int>(orientation())); }
template <class R> template <class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
Bounded_side typename R::Bounded_side
SphereH3<R>::bounded_side(const typename SphereH3<R>::Point_3& p) const SphereH3<R>::bounded_side(const typename SphereH3<R>::Point_3& p) const
{ {
return Bounded_side(CGAL_NTS compare(squared_radius(), return enum_cast<Bounded_side>(CGAL_NTS compare(squared_radius(),
squared_distance(center(),p))); squared_distance(center(),p)));
} }
template <class R> template <class R>

View File

@ -80,10 +80,10 @@ public:
return static_cast<const Self& >(*this); return static_cast<const Self& >(*this);
} }
bool operator==( const VectorH2<R>& v) const; typename R::Boolean operator==( const VectorH2<R>& v) const;
bool operator!=( const VectorH2<R>& v) const; typename R::Boolean operator!=( const VectorH2<R>& v) const;
bool operator==( const Null_vector&) const; typename R::Boolean operator==( const Null_vector&) const;
bool operator!=( const Null_vector& v) const; typename R::Boolean operator!=( const Null_vector& v) const;
const RT & hx() const { return CGAL::get_pointee_or_identity(base)[0]; }; const RT & hx() const { return CGAL::get_pointee_or_identity(base)[0]; };
const RT & hy() const { return CGAL::get_pointee_or_identity(base)[1]; }; const RT & hy() const { return CGAL::get_pointee_or_identity(base)[1]; };
@ -129,19 +129,19 @@ public:
template < class R > template < class R >
inline inline
bool typename R::Boolean
VectorH2<R>::operator==( const Null_vector&) const VectorH2<R>::operator==( const Null_vector&) const
{ return (hx() == RT(0)) && (hy() == RT(0)); } { return (hx() == RT(0)) && (hy() == RT(0)); }
template < class R > template < class R >
inline inline
bool typename R::Boolean
VectorH2<R>::operator!=( const Null_vector& v) const VectorH2<R>::operator!=( const Null_vector& v) const
{ return !(*this == v); } { return !(*this == v); }
template < class R > template < class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
VectorH2<R>::operator==( const VectorH2<R>& v) const VectorH2<R>::operator==( const VectorH2<R>& v) const
{ {
return ( (hx() * v.hw() == v.hx() * hw() ) return ( (hx() * v.hw() == v.hx() * hw() )
@ -150,7 +150,7 @@ VectorH2<R>::operator==( const VectorH2<R>& v) const
template < class R > template < class R >
inline inline
bool typename R::Boolean
VectorH2<R>::operator!=( const VectorH2<R>& v) const VectorH2<R>::operator!=( const VectorH2<R>& v) const
{ return !(*this == v); } /* XXX */ { return !(*this == v); } /* XXX */

View File

@ -129,8 +129,8 @@ public:
Vector_3 operator-() const; Vector_3 operator-() const;
bool operator==( const VectorH3<R>& v) const; typename R::Boolean operator==( const VectorH3<R>& v) const;
bool operator!=( const VectorH3<R>& v) const; typename R::Boolean operator!=( const VectorH3<R>& v) const;
Vector_3 operator+( const VectorH3 &v) const; Vector_3 operator+( const VectorH3 &v) const;
Vector_3 operator-( const VectorH3 &v) const; Vector_3 operator-( const VectorH3 &v) const;
@ -171,7 +171,7 @@ VectorH3<R>::direction() const
template < class R > template < class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
VectorH3<R>::operator==( const VectorH3<R>& v) const VectorH3<R>::operator==( const VectorH3<R>& v) const
{ {
return ( (hx() * v.hw() == v.hx() * hw() ) return ( (hx() * v.hw() == v.hx() * hw() )
@ -181,7 +181,7 @@ VectorH3<R>::operator==( const VectorH3<R>& v) const
template < class R > template < class R >
inline inline
bool typename R::Boolean
VectorH3<R>::operator!=( const VectorH3<R>& v) const VectorH3<R>::operator!=( const VectorH3<R>& v) const
{ return !(*this == v); } { return !(*this == v); }

View File

@ -24,7 +24,7 @@ namespace CGAL {
template < class R> template < class R>
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
bool typename R::Boolean
has_larger_distance_to_point(const PointH2<R>& p, has_larger_distance_to_point(const PointH2<R>& p,
const PointH2<R>& q, const PointH2<R>& q,
const PointH2<R>& r) const PointH2<R>& r)
@ -74,7 +74,7 @@ has_larger_distance_to_point(const PointH2<R>& p,
template < class R> template < class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
Comparison_result typename R::Comparison_result
compare_signed_distance_to_line(const LineH2<R>& l, compare_signed_distance_to_line(const LineH2<R>& l,
const PointH2<R>& p, const PointH2<R>& p,
const PointH2<R>& q) const PointH2<R>& q)
@ -111,7 +111,7 @@ compare_signed_distance_to_line(const LineH2<R>& l,
template < class R> template < class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
has_larger_signed_distance_to_line(const LineH2<R>& l, has_larger_signed_distance_to_line(const LineH2<R>& l,
const PointH2<R>& p, const PointH2<R>& p,
const PointH2<R>& q) const PointH2<R>& q)
@ -140,7 +140,7 @@ has_larger_signed_distance_to_line(const LineH2<R>& l,
template < class R> template < class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
has_smaller_signed_distance_to_line(const LineH2<R>& l, has_smaller_signed_distance_to_line(const LineH2<R>& l,
const PointH2<R>& p, const PointH2<R>& p,
const PointH2<R>& q) const PointH2<R>& q)
@ -167,7 +167,7 @@ has_smaller_signed_distance_to_line(const LineH2<R>& l,
template < class R> template < class R>
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
Comparison_result typename R::Comparison_result
compare_signed_distance_to_line(const PointH2<R>& p, compare_signed_distance_to_line(const PointH2<R>& p,
const PointH2<R>& q, const PointH2<R>& q,
const PointH2<R>& r, const PointH2<R>& r,
@ -208,7 +208,7 @@ compare_signed_distance_to_line(const PointH2<R>& p,
template < class R> template < class R>
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
bool typename R::Boolean
has_smaller_signed_distance_to_line(const PointH2<R>& p, has_smaller_signed_distance_to_line(const PointH2<R>& p,
const PointH2<R>& q, const PointH2<R>& q,
const PointH2<R>& r, const PointH2<R>& r,
@ -241,7 +241,7 @@ has_smaller_signed_distance_to_line(const PointH2<R>& p,
template < class R> template < class R>
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
bool typename R::Boolean
has_larger_signed_distance_to_line(const PointH2<R>& p, has_larger_signed_distance_to_line(const PointH2<R>& p,
const PointH2<R>& q, const PointH2<R>& q,
const PointH2<R>& r, const PointH2<R>& r,

View File

@ -21,43 +21,43 @@
namespace CGAL { namespace CGAL {
template <class R> template <class R>
Comparison_result typename R::Comparison_result
compare_distance_to_point(const PointH3<R>& , compare_distance_to_point(const PointH3<R>& ,
const PointH3<R>& , const PointH3<R>& ,
const PointH3<R>& ); const PointH3<R>& );
template <class R> template <class R>
bool typename R::Boolean
has_larger_distance_to_point(const PointH3<R>& , has_larger_distance_to_point(const PointH3<R>& ,
const PointH3<R>& , const PointH3<R>& ,
const PointH3<R>& ); const PointH3<R>& );
template <class R> template <class R>
bool typename R::Boolean
has_smaller_distance_to_point(const PointH3<R>& , has_smaller_distance_to_point(const PointH3<R>& ,
const PointH3<R>& , const PointH3<R>& ,
const PointH3<R>& ); const PointH3<R>& );
template <class R> template <class R>
Comparison_result typename R::Comparison_result
compare_signed_distance_to_plane(const PlaneH3<R>& , compare_signed_distance_to_plane(const PlaneH3<R>& ,
const PointH3<R>& , const PointH3<R>& ,
const PointH3<R>& ); const PointH3<R>& );
template <class R> template <class R>
bool typename R::Boolean
has_larger_signed_distance_to_plane(const PlaneH3<R>& , has_larger_signed_distance_to_plane(const PlaneH3<R>& ,
const PointH3<R>& , const PointH3<R>& ,
const PointH3<R>& ); const PointH3<R>& );
template <class R> template <class R>
bool typename R::Boolean
has_smaller_signed_distance_to_plane(const PlaneH3<R>&, has_smaller_signed_distance_to_plane(const PlaneH3<R>&,
const PointH3<R>& , const PointH3<R>& ,
const PointH3<R>& ); const PointH3<R>& );
template <class R> template <class R>
Comparison_result typename R::Comparison_result
compare_signed_distance_to_plane(const PointH3<R>& , compare_signed_distance_to_plane(const PointH3<R>& ,
const PointH3<R>& , const PointH3<R>& ,
const PointH3<R>& , const PointH3<R>& ,
@ -65,7 +65,7 @@ compare_signed_distance_to_plane(const PointH3<R>& ,
const PointH3<R>& ); const PointH3<R>& );
template <class R> template <class R>
bool typename R::Boolean
has_larger_signed_distance_to_plane(const PointH3<R>& , has_larger_signed_distance_to_plane(const PointH3<R>& ,
const PointH3<R>& , const PointH3<R>& ,
const PointH3<R>& , const PointH3<R>& ,
@ -73,7 +73,7 @@ has_larger_signed_distance_to_plane(const PointH3<R>& ,
const PointH3<R>& ); const PointH3<R>& );
template <class R> template <class R>
bool typename R::Boolean
has_smaller_signed_distance_to_plane(const PointH3<R>& , has_smaller_signed_distance_to_plane(const PointH3<R>& ,
const PointH3<R>& , const PointH3<R>& ,
const PointH3<R>& , const PointH3<R>& ,
@ -82,7 +82,7 @@ has_smaller_signed_distance_to_plane(const PointH3<R>& ,
template <class R> template <class R>
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
Comparison_result typename R::Comparison_result
compare_distance_to_point(const PointH3<R>& p, compare_distance_to_point(const PointH3<R>& p,
const PointH3<R>& q, const PointH3<R>& q,
const PointH3<R>& r) const PointH3<R>& r)
@ -121,7 +121,7 @@ compare_distance_to_point(const PointH3<R>& p,
template < class R> template < class R>
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
bool typename R::Boolean
has_larger_distance_to_point(const PointH3<R>& p, has_larger_distance_to_point(const PointH3<R>& p,
const PointH3<R>& q, const PointH3<R>& q,
const PointH3<R>& r) const PointH3<R>& r)
@ -157,7 +157,7 @@ has_larger_distance_to_point(const PointH3<R>& p,
template < class R> template < class R>
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
bool typename R::Boolean
has_smaller_distance_to_point(const PointH3<R>& p, has_smaller_distance_to_point(const PointH3<R>& p,
const PointH3<R>& q, const PointH3<R>& q,
const PointH3<R>& r) const PointH3<R>& r)
@ -193,7 +193,7 @@ has_smaller_distance_to_point(const PointH3<R>& p,
template < class R> template < class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
Comparison_result typename R::Comparison_result
compare_signed_distance_to_plane(const PlaneH3<R>& pl, compare_signed_distance_to_plane(const PlaneH3<R>& pl,
const PointH3<R>& p, const PointH3<R>& p,
const PointH3<R>& q) const PointH3<R>& q)
@ -227,7 +227,7 @@ compare_signed_distance_to_plane(const PlaneH3<R>& pl,
} }
template <class R> template <class R>
bool typename R::Boolean
has_larger_signed_distance_to_plane(const PlaneH3<R>& pl, has_larger_signed_distance_to_plane(const PlaneH3<R>& pl,
const PointH3<R>& p, const PointH3<R>& p,
const PointH3<R>& q ) const PointH3<R>& q )
@ -257,7 +257,7 @@ has_larger_signed_distance_to_plane(const PlaneH3<R>& pl,
} }
template <class R> template <class R>
bool typename R::Boolean
has_smaller_signed_distance_to_plane(const PlaneH3<R>& pl, has_smaller_signed_distance_to_plane(const PlaneH3<R>& pl,
const PointH3<R>& p, const PointH3<R>& p,
const PointH3<R>& q ) const PointH3<R>& q )
@ -288,7 +288,7 @@ has_smaller_signed_distance_to_plane(const PlaneH3<R>& pl,
template <class R> template <class R>
inline inline
Comparison_result typename R::Comparison_result
compare_signed_distance_to_plane(const PointH3<R>& p, compare_signed_distance_to_plane(const PointH3<R>& p,
const PointH3<R>& q, const PointH3<R>& q,
const PointH3<R>& r, const PointH3<R>& r,
@ -302,7 +302,7 @@ compare_signed_distance_to_plane(const PointH3<R>& p,
template <class R> template <class R>
inline inline
bool typename R::Boolean
has_larger_signed_distance_to_plane(const PointH3<R>& p, has_larger_signed_distance_to_plane(const PointH3<R>& p,
const PointH3<R>& q, const PointH3<R>& q,
const PointH3<R>& r, const PointH3<R>& r,
@ -313,7 +313,7 @@ has_larger_signed_distance_to_plane(const PointH3<R>& p,
template <class R> template <class R>
inline inline
bool typename R::Boolean
has_smaller_signed_distance_to_plane(const PointH3<R>& p, has_smaller_signed_distance_to_plane(const PointH3<R>& p,
const PointH3<R>& q, const PointH3<R>& q,
const PointH3<R>& r, const PointH3<R>& r,

View File

@ -24,7 +24,7 @@ namespace CGAL {
template < class R> template < class R>
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
equal_xy(const PointH2<R>& p, equal_xy(const PointH2<R>& p,
const PointH2<R>& q) const PointH2<R>& q)
{ {
@ -39,7 +39,7 @@ equal_xy(const PointH2<R>& p,
template <class R> template <class R>
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
Oriented_side typename R::Oriented_side
_where_wrt_L_wedge( const PointH2<R>& p, const PointH2<R>& q ) _where_wrt_L_wedge( const PointH2<R>& p, const PointH2<R>& q )
{ {
Sign xs = CGAL_NTS sign( q.hx()*p.hw() - p.hx()*q.hw() ); // sign( qx - px ) Sign xs = CGAL_NTS sign( q.hx()*p.hw() - p.hx()*q.hw() ); // sign( qx - px )
@ -53,7 +53,7 @@ _where_wrt_L_wedge( const PointH2<R>& p, const PointH2<R>& q )
} }
template <class RT> template <class RT>
Comparison_result typename Compare<RT>::result_type
compare_power_distanceH2(const RT& phx, const RT& phy, const RT& phw, compare_power_distanceH2(const RT& phx, const RT& phy, const RT& phw,
const Quotient<RT>& pwt, const Quotient<RT>& pwt,
const RT& qhx, const RT& qhy, const RT& qhw, const RT& qhx, const RT& qhy, const RT& qhw,
@ -82,7 +82,7 @@ compare_power_distanceH2(const RT& phx, const RT& phy, const RT& phw,
template <class RT> template <class RT>
Oriented_side typename Same_uncertainty_nt<Oriented_side, RT>::type
power_testH2( const RT &phx, const RT &phy, const RT &phw, const Quotient<RT> &pwt, power_testH2( const RT &phx, const RT &phy, const RT &phw, const Quotient<RT> &pwt,
const RT &qhx, const RT &qhy, const RT &qhw, const Quotient<RT> &qwt, const RT &qhx, const RT &qhy, const RT &qhw, const Quotient<RT> &qwt,
const RT &rhx, const RT &rhy, const RT &rhw, const Quotient<RT> &rwt, const RT &rhx, const RT &rhy, const RT &rhw, const Quotient<RT> &rwt,
@ -129,7 +129,7 @@ power_testH2( const RT &phx, const RT &phy, const RT &phw, const Quotient<RT> &p
template <class RT> template <class RT>
Oriented_side typename Same_uncertainty_nt<Oriented_side, RT>::type
power_testH2( const RT &phx, const RT &phy, const RT &phw, const Quotient<RT> &pwt, power_testH2( const RT &phx, const RT &phy, const RT &phw, const Quotient<RT> &pwt,
const RT &qhx, const RT &qhy, const RT &qhw, const Quotient<RT> &qwt, const RT &qhx, const RT &qhy, const RT &qhw, const Quotient<RT> &qwt,
const RT &thx, const RT &thy, const RT &thw, const Quotient<RT> &twt) const RT &thx, const RT &thy, const RT &thw, const Quotient<RT> &twt)
@ -180,7 +180,7 @@ power_testH2( const RT &phx, const RT &phy, const RT &phw, const Quotient<RT> &p
// Unused, undocumented, un-functorized. // Unused, undocumented, un-functorized.
template < class R > template < class R >
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
Comparison_result typename R::Comparison_result
compare_deltax_deltay(const PointH2<R>& p, compare_deltax_deltay(const PointH2<R>& p,
const PointH2<R>& q, const PointH2<R>& q,
const PointH2<R>& r, const PointH2<R>& r,

View File

@ -25,8 +25,9 @@ namespace CGAL {
template < class R > template < class R >
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
bool lexicographically_xy_smaller(const PointH3<R> &p, typename R::Boolean
const PointH3<R> &q) lexicographically_xy_smaller(const PointH3<R> &p,
const PointH3<R> &q)
{ {
typedef typename R::RT RT; typedef typename R::RT RT;
RT pV = p.hx()*q.hw(); RT pV = p.hx()*q.hw();
@ -51,7 +52,7 @@ bool lexicographically_xy_smaller(const PointH3<R> &p,
template < class R> template < class R>
CGAL_KERNEL_MEDIUM_INLINE CGAL_KERNEL_MEDIUM_INLINE
Comparison_result typename R::Comparison_result
compare_xy(const PointH3<R>& p, const PointH3<R>& q) compare_xy(const PointH3<R>& p, const PointH3<R>& q)
{ {
typedef typename R::RT RT; typedef typename R::RT RT;
@ -82,7 +83,7 @@ compare_xy(const PointH3<R>& p, const PointH3<R>& q)
template < class R > template < class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
equal_xy(const PointH3<R> &p, const PointH3<R> &q) equal_xy(const PointH3<R> &p, const PointH3<R> &q)
{ {
return (p.hx() * q.hw() == q.hx() * p.hw() ) return (p.hx() * q.hw() == q.hx() * p.hw() )
@ -91,7 +92,7 @@ equal_xy(const PointH3<R> &p, const PointH3<R> &q)
template < class R > // ??? -> == template < class R > // ??? -> ==
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
equal_xyz(const PointH3<R> &p, const PointH3<R> &q) equal_xyz(const PointH3<R> &p, const PointH3<R> &q)
{ {
return (p.hx() * q.hw() == q.hx() * p.hw() ) return (p.hx() * q.hw() == q.hx() * p.hw() )
@ -101,27 +102,27 @@ equal_xyz(const PointH3<R> &p, const PointH3<R> &q)
template < class R > template < class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
less_x(const PointH3<R> &p, const PointH3<R> &q) less_x(const PointH3<R> &p, const PointH3<R> &q)
{ return (p.hx() * q.hw() < q.hx() * p.hw() ); } { return (p.hx() * q.hw() < q.hx() * p.hw() ); }
template < class R > template < class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
less_y(const PointH3<R> &p, const PointH3<R> &q) less_y(const PointH3<R> &p, const PointH3<R> &q)
{ return (p.hy() * q.hw() < q.hy() * p.hw() ); } { return (p.hy() * q.hw() < q.hy() * p.hw() ); }
template < class R > template < class R >
CGAL_KERNEL_INLINE CGAL_KERNEL_INLINE
bool typename R::Boolean
less_z(const PointH3<R> &p, const PointH3<R> &q) less_z(const PointH3<R> &p, const PointH3<R> &q)
{ return (p.hz() * q.hw() < q.hz() * p.hw() ); } { return (p.hz() * q.hw() < q.hz() * p.hw() ); }
template <class RT> template <class RT>
Oriented_side typename Same_uncertainty_nt<Oriented_side, RT>::type
power_side_of_oriented_power_sphereH3( power_side_of_oriented_power_sphereH3(
const RT &phx, const RT &phy, const RT &phz, const RT &phw, const Quotient<RT> &pwt, const RT &phx, const RT &phy, const RT &phz, const RT &phw, const Quotient<RT> &pwt,
const RT &qhx, const RT &qhy, const RT &qhz, const RT &qhw, const Quotient<RT> &qwt, const RT &qhx, const RT &qhy, const RT &qhz, const RT &qhw, const Quotient<RT> &qwt,

View File

@ -225,13 +225,11 @@ class Side_of_oriented_hyperbolic_segment_2
typedef typename Traits::Construct_weighted_circumcenter_2 Construct_weighted_circumcenter_2; typedef typename Traits::Construct_weighted_circumcenter_2 Construct_weighted_circumcenter_2;
public: public:
typedef Oriented_side result_type;
Side_of_oriented_hyperbolic_segment_2(const Traits& gt = Traits()) : _gt(gt) {} Side_of_oriented_hyperbolic_segment_2(const Traits& gt = Traits()) : _gt(gt) {}
result_type operator()(const Hyperbolic_point_2& p, Oriented_side operator()(const Hyperbolic_point_2& p,
const Hyperbolic_point_2& q, const Hyperbolic_point_2& q,
const Hyperbolic_point_2& query) const const Hyperbolic_point_2& query) const
{ {
// Check first if the points are collinear with the origin // Check first if the points are collinear with the origin
Circle_2 poincare(Hyperbolic_point_2(FT(0),FT(0)), FT(1)); Circle_2 poincare(Hyperbolic_point_2(FT(0),FT(0)), FT(1));

View File

@ -26,7 +26,6 @@ struct Tetrahedron_Line_intersection_3
: public Tetrahedron_lines_intersection_3_base<K, typename K::Line_3, Tetrahedron_Line_intersection_3<K> > : public Tetrahedron_lines_intersection_3_base<K, typename K::Line_3, Tetrahedron_Line_intersection_3<K> >
{ {
typedef Tetrahedron_lines_intersection_3_base<K, typename K::Line_3, Tetrahedron_Line_intersection_3<K> > Base; typedef Tetrahedron_lines_intersection_3_base<K, typename K::Line_3, Tetrahedron_Line_intersection_3<K> > Base;
typedef typename Base::Result_type Result_type;
Tetrahedron_Line_intersection_3(const typename K::Tetrahedron_3& tet, Tetrahedron_Line_intersection_3(const typename K::Tetrahedron_3& tet,
const typename K::Line_3& l) const typename K::Line_3& l)

View File

@ -4338,7 +4338,7 @@ public:
Kernel::Vector_3 const& n); Kernel::Vector_3 const& n);
/*! /*!
introduces a variable of type `Kernel::Point_3`. introduces a variable of type `Kernel::Circle_3`.
It is initialized to the circle passing through the three points. It is initialized to the circle passing through the three points.
\pre The three points are not collinear. \pre The three points are not collinear.
*/ */
@ -7600,7 +7600,7 @@ public:
and also for `Type1` and `Type2` of respective types and also for `Type1` and `Type2` of respective types
- `Kernel::Triangle_3` and `Kernel::Tetrahedron_3` - `Kernel::Triangle_3` and `Kernel::Tetrahedron_3`
- `Kernel::Plane_3` and `Kernel::Sphere_3` (or the contrary) - `Kernel::Plane_3` and `Kernel::Sphere_3`
- `Kernel::Sphere_3` and `Kernel::Sphere_3`. - `Kernel::Sphere_3` and `Kernel::Sphere_3`.
*/ */

View File

@ -8,9 +8,8 @@ class MyConstruct_point_2
typedef typename K::Point_2 Point_2; typedef typename K::Point_2 Point_2;
typedef typename K::Line_2 Line_2; typedef typename K::Line_2 Line_2;
typedef typename Point_2::Rep Rep; typedef typename Point_2::Rep Rep;
public:
typedef Point_2 result_type;
public:
// Note : the CGAL::Return_base_tag is really internal CGAL stuff. // Note : the CGAL::Return_base_tag is really internal CGAL stuff.
// Unfortunately it is needed for optimizing away copy-constructions, // Unfortunately it is needed for optimizing away copy-constructions,
// due to current lack of delegating constructors in the C++ standard. // due to current lack of delegating constructors in the C++ standard.

View File

@ -8,8 +8,6 @@ typedef K::Line_2 Line_2;
typedef K::Intersect_2 Intersect_2; typedef K::Intersect_2 Intersect_2;
struct Intersection_visitor { struct Intersection_visitor {
typedef void result_type;
void operator()(const Point_2& p) const void operator()(const Point_2& p) const
{ {
std::cout << p << std::endl; std::cout << p << std::endl;

View File

@ -102,7 +102,8 @@ public:
return R().compute_squared_radius_2_object()(*this); return R().compute_squared_radius_2_object()(*this);
} }
Orientation orientation() const typename R::Orientation
orientation() const
{ {
// This make_certain(), the uncertain orientation of circles, the orientation // This make_certain(), the uncertain orientation of circles, the orientation
// of circles, are all yucky. // of circles, are all yucky.
@ -177,18 +178,6 @@ public:
return R().construct_bbox_2_object()(*this); return R().construct_bbox_2_object()(*this);
} }
typename R::Boolean
operator==(const Circle_2 &c) const
{
return R().equal_2_object()(*this, c);
}
typename R::Boolean
operator!=(const Circle_2 &c) const
{
return !(*this == c);
}
Circle_2 transform(const Aff_transformation_2 &t) const Circle_2 transform(const Aff_transformation_2 &t) const
{ {
return t.transform(*this); return t.transform(*this);

View File

@ -101,14 +101,14 @@ public:
return typename R::Construct_sphere_3()(*this); return typename R::Construct_sphere_3()(*this);
} }
Point_3 center() const decltype(auto) center() const
{ {
return typename R::Construct_sphere_3()(*this).center(); return diametral_sphere().center();
} }
FT squared_radius() const decltype(auto) squared_radius() const
{ {
return typename R::Construct_sphere_3()(*this).squared_radius(); return diametral_sphere().squared_radius();
} }
decltype(auto) decltype(auto)
@ -122,7 +122,7 @@ public:
return typename R::Construct_bbox_3()(*this); return typename R::Construct_bbox_3()(*this);
} }
FT area_divided_by_pi() const decltype(auto) area_divided_by_pi() const
{ {
return typename R::Compute_area_divided_by_pi_3()(*this); return typename R::Compute_area_divided_by_pi_3()(*this);
} }
@ -152,16 +152,7 @@ public:
template < typename R > template < typename R >
inline inline
bool typename R::Boolean
operator==(const Circle_3<R> &p,
const Circle_3<R> &q)
{
return R().equal_3_object()(p, q);
}
template < typename R >
inline
bool
operator!=(const Circle_3<R> &p, operator!=(const Circle_3<R> &p,
const Circle_3<R> &q) const Circle_3<R> &q)
{ {

View File

@ -156,18 +156,6 @@ public:
return this->vector(); return this->vector();
} }
typename R::Boolean
operator==(const Direction_2& d) const
{
return R().equal_2_object()(*this, d);
}
typename R::Boolean
operator!=(const Direction_2& d) const
{
return !(*this == d);
}
Direction_2 transform(const Aff_transformation_2 &t) const Direction_2 transform(const Aff_transformation_2 &t) const
{ {
return t.transform(*this); return t.transform(*this);

View File

@ -1,66 +0,0 @@
// Copyright (c) 2002
// Utrecht University (The Netherlands),
// ETH Zurich (Switzerland),
// INRIA Sophia-Antipolis (France),
// Max-Planck-Institute Saarbruecken (Germany),
// and Tel-Aviv University (Israel). All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Sylvain Pion
#ifndef CGAL_IS_A_PREDICATE_H
#define CGAL_IS_A_PREDICATE_H
// How to determine if a kernel functor is a predicate or a construction.
#include <CGAL/basic.h>
#include <CGAL/enum.h>
namespace CGAL {
namespace internal {
// By default it's a construction
template <typename Return_type>
struct Return_type_of_predicate {
typedef CGAL::Tag_false type;
};
// Specializations for predicates
template <>
struct Return_type_of_predicate<bool> {
typedef CGAL::Tag_true type;
};
template <>
struct Return_type_of_predicate<CGAL::Sign> {
typedef CGAL::Tag_true type;
};
template <>
struct Return_type_of_predicate<CGAL::Bounded_side> {
typedef CGAL::Tag_true type;
};
template <>
struct Return_type_of_predicate<CGAL::Angle> {
typedef CGAL::Tag_true type;
};
} // namespace internal
template <typename Functor>
struct Is_a_predicate {
typedef typename internal::Return_type_of_predicate<
typename Functor::result_type>::type type;
};
} //namespace CGAL
#endif // CGAL_IS_A_PREDICATE_H

View File

@ -29,6 +29,8 @@ namespace CGAL {
template <class R_> template <class R_>
class Iso_cuboid_3 : public R_::Kernel_base::Iso_cuboid_3 class Iso_cuboid_3 : public R_::Kernel_base::Iso_cuboid_3
{ {
typedef typename R_::Boolean Boolean;
typedef typename R_::Bounded_side Bounded_side;
typedef typename R_::RT RT; typedef typename R_::RT RT;
typedef typename R_::FT FT; typedef typename R_::FT FT;
typedef typename R_::Point_3 Point_3; typedef typename R_::Point_3 Point_3;
@ -173,25 +175,25 @@ public:
return zmax(); return zmax();
} }
bool typename R::Boolean
has_on_bounded_side(const Point_3 &p) const has_on_bounded_side(const Point_3 &p) const
{ {
return R().has_on_bounded_side_3_object()(*this,p); return R().has_on_bounded_side_3_object()(*this,p);
} }
bool Boolean
has_on_unbounded_side(const Point_3 &p) const has_on_unbounded_side(const Point_3 &p) const
{ {
return R().has_on_unbounded_side_3_object()(*this,p); return R().has_on_unbounded_side_3_object()(*this,p);
} }
bool Boolean
has_on_boundary(const Point_3 &p) const has_on_boundary(const Point_3 &p) const
{ {
return R().has_on_boundary_3_object()(*this,p); return R().has_on_boundary_3_object()(*this,p);
} }
bool Boolean
has_on(const Point_3 &p) const has_on(const Point_3 &p) const
{ {
return has_on_boundary(p); return has_on_boundary(p);
@ -203,7 +205,7 @@ public:
return R().bounded_side_3_object()(*this,p); return R().bounded_side_3_object()(*this,p);
} }
bool Boolean
is_degenerate() const is_degenerate() const
{ {
return R().is_degenerate_3_object()(*this); return R().is_degenerate_3_object()(*this);

View File

@ -27,6 +27,8 @@ namespace CGAL {
template <class R_> template <class R_>
class Iso_rectangle_2 : public R_::Kernel_base::Iso_rectangle_2 class Iso_rectangle_2 : public R_::Kernel_base::Iso_rectangle_2
{ {
typedef typename R_::Boolean Boolean;
typedef typename R_::Bounded_side Bounded_side;
typedef typename R_::RT RT; typedef typename R_::RT RT;
typedef typename R_::FT FT; typedef typename R_::FT FT;
typedef typename R_::Point_2 Point_2; typedef typename R_::Point_2 Point_2;
@ -94,19 +96,6 @@ public:
return R().construct_max_vertex_2_object()(*this); return R().construct_max_vertex_2_object()(*this);
} }
bool
operator==(const Iso_rectangle_2 &i) const
{
return R().equal_2_object()(*this, i);
}
bool
operator!=(const Iso_rectangle_2 &i) const
{
return ! (*this == i);
}
decltype(auto) decltype(auto)
vertex(int i) const vertex(int i) const
{ {
@ -169,22 +158,19 @@ public:
return R().compute_area_2_object()(*this); return R().compute_area_2_object()(*this);
} }
Boolean
bool
has_on_boundary(const Point_2 &p) const has_on_boundary(const Point_2 &p) const
{ {
return R().has_on_boundary_2_object()(*this,p); return R().has_on_boundary_2_object()(*this,p);
} }
Boolean
bool
has_on_bounded_side(const Point_2 &p) const has_on_bounded_side(const Point_2 &p) const
{ {
return R().has_on_bounded_side_2_object()(*this,p); return R().has_on_bounded_side_2_object()(*this,p);
} }
Boolean
bool
has_on_unbounded_side(const Point_2 &p) const has_on_unbounded_side(const Point_2 &p) const
{ {
return R().has_on_unbounded_side_2_object()(*this,p); return R().has_on_unbounded_side_2_object()(*this,p);
@ -196,8 +182,7 @@ public:
return R().bounded_side_2_object()(*this,p); return R().bounded_side_2_object()(*this,p);
} }
Boolean
bool
is_degenerate() const is_degenerate() const
{ {
return R().is_degenerate_2_object()(*this); return R().is_degenerate_2_object()(*this);

View File

@ -19,62 +19,25 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <vector>
#include <boost/mpl/transform.hpp>
#include <boost/mpl/remove.hpp>
#include <optional>
#include <variant>
#include <boost/preprocessor/facilities/expand.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
namespace CGAL { namespace CGAL {
template < typename T, typename K1, typename K2 >
struct Type_mapper;
namespace internal { namespace internal {
// the default implementation is required to catch the odd one-out template < typename T, typename K1, typename K2, typename = void > // last tparam is for SFINAE
// object like Bbox
template<typename T, typename K1, typename K2 >
struct Type_mapper_impl { struct Type_mapper_impl {
typedef T type; typedef T type;
}; };
template < typename T, typename K1, typename K2 > template < typename K1, typename K2>
struct Type_mapper_impl<std::vector< T >, K1, K2 > { struct Type_mapper_impl<K1, K1, K2> {
typedef std::vector< typename Type_mapper_impl<T, K1, K2>::type > type; typedef K2 type;
}; };
template < typename T, typename K1, typename K2 > // 'Rep' gets a weird partial specialization because of Return_base_tag shenanigans.
struct Type_mapper_impl<std::optional<T>, K1, K2 > { // See https://github.com/CGAL/cgal/issues/3035#issuecomment-428721414
typedef std::optional< typename Type_mapper_impl<T, K1, K2>::type > type;
};
/// The following code is equivalent to the one commented in CODE_TAG
/// except that with this one, the variant is really variant<A,B,C> and not
/// a internal obfuscated type
#define CGAL_TYPEMAP_TYPEDEFS(z, n, t) typedef typename Type_mapper_impl< t##n, K1, K2 >::type A##n;
#define CGAL_VARIANT_TYPEMAP(z, n, d) \
template< typename K1, typename K2, BOOST_PP_ENUM_PARAMS(n, class T) > \
struct Type_mapper_impl<std::variant<BOOST_PP_ENUM_PARAMS(n, T)>, K1, K2> { \
BOOST_PP_REPEAT(n, CGAL_TYPEMAP_TYPEDEFS, T) \
typedef std::variant<BOOST_PP_ENUM_PARAMS(n, A)> type; \
};
BOOST_PP_REPEAT_FROM_TO(1, 10, CGAL_VARIANT_TYPEMAP, _)
#undef CGAL_TYPEMAP_TYPEDEFS
#undef CGAL_VARIANT_TYPEMAP
// Then we specialize for all kernel objects.
// More details on why it is like that are here: https://github.com/CGAL/cgal/pull/4878#discussion_r459986501
#define CGAL_Kernel_obj(X) \ #define CGAL_Kernel_obj(X) \
template < typename K1, typename K2 > \ template < typename K1, typename K2 > \
struct Type_mapper_impl < typename K1::X, K1, K2 > \ struct Type_mapper_impl < typename K1::X, K1, K2 > \
@ -89,20 +52,28 @@ template < typename K1, typename K2 >
struct Type_mapper_impl < typename K1::FT, K1, K2 > struct Type_mapper_impl < typename K1::FT, K1, K2 >
{ typedef typename K2::FT type; }; { typedef typename K2::FT type; };
// This matches about anything and recursively calls Type_mapper on the template parameters
// until reaching the other cases (kernel objects, K1, FT)
template <template <typename...> class T, typename... Params, typename K1, typename K2>
struct Type_mapper_impl<T<Params...>, K1, K2,
std::enable_if_t<
#define CGAL_Kernel_obj(X) !std::is_same<T<Params...>, typename K1::X::Rep>::value && \
!std::is_same<T<Params...>, typename K1::X>::value &&
#include <CGAL/Kernel/interface_macros.h>
!std::is_same<T<Params...>, K1>::value && // Matches K1 directly
!std::is_same<T<Params...>, typename K1::FT>::value // Matches K1::FT
>> {
typedef T<typename Type_mapper<Params, K1, K2>::type...> type;
};
} // internal } // internal
// This is a tool to obtain the K2::Point_2 from K1 and K1::Point_2. // This is a tool to obtain e.g. K2::Point_2 from K1 and K1::Point_2.
// Similarly for other kernel types.
// TODO : add more specializations ? Use a different mechanism ?
template < typename T, typename K1, typename K2 > template < typename T, typename K1, typename K2 >
struct Type_mapper : struct Type_mapper
internal::Type_mapper_impl< std::remove_cv_t< : internal::Type_mapper_impl<CGAL::cpp20::remove_cvref_t<T>, K1, K2 >
std::remove_reference_t< T >
>, K1, K2 >
{ }; { };
} //namespace CGAL } // namespace CGAL
#endif // CGAL_KERNEL_TYPE_MAPPER_H #endif // CGAL_KERNEL_TYPE_MAPPER_H

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,7 @@ namespace CGAL {
template <class T1, class T2, class T3> template <class T1, class T2, class T3>
inline inline
Comparison_result typename Kernel_traits<T1>::Kernel::Comparison_result
compare_distance(const T1 &o1, compare_distance(const T1 &o1,
const T2 &o2, const T2 &o2,
const T3 &o3) const T3 &o3)
@ -39,7 +39,7 @@ compare_distance(const T1 &o1,
template <class T1, class T2, class T3, class T4> template <class T1, class T2, class T3, class T4>
inline inline
Comparison_result typename Kernel_traits<T1>::Kernel::Comparison_result
compare_distance(const T1 &o1, compare_distance(const T1 &o1,
const T2 &o2, const T2 &o2,
const T3 &o3, const T3 &o3,
@ -51,7 +51,7 @@ compare_distance(const T1 &o1,
template <typename O> template <typename O>
inline inline
bool typename Kernel_traits<O>::Kernel::Boolean
parallel(const O &o1, const O &o2) parallel(const O &o1, const O &o2)
{ {
typedef typename Kernel_traits<O>::Kernel K; typedef typename Kernel_traits<O>::Kernel K;

View File

@ -28,23 +28,9 @@
namespace CGAL { namespace CGAL {
template < class K >
typename K::Boolean
operator==(const Point_2<K> &p, const Origin& o)
{
return p == Point_2<K>(o);
}
template < class K >
typename K::Boolean
operator!=(const Point_2<K> &p, const Origin& o)
{
return p != Point_2<K>(o);
}
template < class K > template < class K >
inline inline
Angle typename K::Angle
angle(const Vector_2<K> &u, angle(const Vector_2<K> &u,
const Vector_2<K> &v) const Vector_2<K> &v)
{ {
@ -53,7 +39,7 @@ angle(const Vector_2<K> &u,
template < class K > template < class K >
inline inline
Angle typename K::Angle
angle(const Point_2<K> &p, angle(const Point_2<K> &p,
const Point_2<K> &q, const Point_2<K> &q,
const Point_2<K> &r) const Point_2<K> &r)
@ -63,7 +49,7 @@ angle(const Point_2<K> &p,
template < class K > template < class K >
inline inline
Angle typename K::Angle
angle(const Point_2<K> &p, angle(const Point_2<K> &p,
const Point_2<K> &q, const Point_2<K> &q,
const Point_2<K> &r, const Point_2<K> &r,
@ -764,7 +750,9 @@ midpoint(const Point_2<K> &p, const Point_2<K> &q)
} }
template < class K > template < class K >
inline typename K::Point_2 midpoint(const Segment_2<K> &s) inline
typename K::Point_2
midpoint(const Segment_2<K> &s)
{ {
return internal::midpoint(s, K()); return internal::midpoint(s, K());
} }
@ -787,6 +775,264 @@ min_vertex(const Iso_rectangle_2<K> &ir)
// FIXME TODO : What do we do with the operators ? // FIXME TODO : What do we do with the operators ?
// They have no counter part with the kernel argument... // They have no counter part with the kernel argument...
template < class K >
inline
typename K::Boolean
operator==(const Point_2<K>& p, const Point_2<K>& q)
{ return K().equal_2_object()(p, q); }
template < class K >
inline
typename K::Boolean
operator!=(const Point_2<K>& p, const Point_2<K>& q)
{ return ! (p == q); }
template < class K >
typename K::Boolean
operator==(const Point_2<K> &p, const Origin& o)
{
return p == Point_2<K>(o);
}
template < class K >
typename K::Boolean
operator==(const Origin& o, const Point_2<K> &p)
{
return (p == o);
}
template < class K >
typename K::Boolean
operator!=(const Point_2<K> &p, const Origin& o)
{
return ! (p == o);
}
template < class K >
typename K::Boolean
operator!=(const Origin& o, const Point_2<K> &p)
{
return ! (p == o);
}
template < class K >
inline
typename K::Boolean
operator==(const Origin& o, const Weighted_point_2<K>& p)
{ return p == o; }
template < class K >
inline
typename K::Boolean
operator!=(const Origin& o, const Weighted_point_2<K>& p)
{ return p != o; }
template < class K >
inline
typename K::Boolean
operator==(const Point_2<K>& bp, const Weighted_point_2<K>& p)
{ return bp == p.point(); }
template < class K >
inline
typename K::Boolean
operator!=(const Point_2<K>& bp, const Weighted_point_2<K>& p)
{ return bp != p.point(); }
template < class K >
inline
typename K::Boolean
operator==(const Weighted_point_2<K>& p, const Point_2<K>& bp)
{ return bp == p.point(); }
template < class K >
inline
typename K::Boolean
operator!=(const Weighted_point_2<K>& p, const Point_2<K>& bp)
{ return bp != p.point(); }
template < class K >
inline
typename K::Boolean
operator==(const Weighted_point_2<K>& p, const Weighted_point_2<K>& p2)
{ return p.point() == p2.point(); }
template < class K >
inline
typename K::Boolean
operator!=(const Weighted_point_2<K>& p, const Weighted_point_2<K>& p2)
{ return p.point() != p2.point(); }
template < class K >
inline
typename K::Boolean
operator==(const Vector_2<K>& v, const Vector_2<K>& w)
{ return K().equal_2_object()(v, w); }
template < class K >
inline
typename K::Boolean
operator!=(const Vector_2<K>& v, const Vector_2<K>& w)
{ return ! (v == w); }
template < class K >
inline
typename K::Boolean
operator==(const Vector_2<K>& v, const Null_vector& n)
{
return K().equal_2_object()(v, n);
}
template < class K >
inline
typename K::Boolean
operator==(const Null_vector& n, const Vector_2<K>& v)
{
return v == n;
}
template < class K >
inline
typename K::Boolean
operator!=(const Vector_2<K>& v, const Null_vector& n)
{
return ! (v == n);
}
template < class K >
inline
typename K::Boolean
operator!=(const Null_vector& n, const Vector_2<K>& v)
{
return ! (v == n);
}
template < class K >
inline
typename K::Boolean
operator==(const Circle_2<K>& p, const Circle_2<K>& q)
{
return K().equal_2_object()(p, q);
}
template < class K >
inline
typename K::Boolean
operator!=(const Circle_2<K>& p, const Circle_2<K>& q)
{
return ! (p == q);
}
template < class K >
inline
typename K::Boolean
operator==(const Direction_2<K>& p, const Direction_2<K>& q)
{
return K().equal_2_object()(p, q);
}
template < class K >
inline
typename K::Boolean
operator!=(const Direction_2<K>& p, const Direction_2<K>& q)
{
return ! (p == q);
}
template < class K >
inline
typename K::Boolean
operator==(const Iso_rectangle_2<K>& p, const Iso_rectangle_2<K>& q)
{
return K().equal_2_object()(p, q);
}
template < class K >
inline
typename K::Boolean
operator!=(const Iso_rectangle_2<K>& p, const Iso_rectangle_2<K>& q)
{
return ! (p == q);
}
template < class K >
inline
typename K::Boolean
operator==(const Line_2<K>& p, const Line_2<K>& q)
{
return K().equal_2_object()(p, q);
}
template < class K >
inline
typename K::Boolean
operator!=(const Line_2<K>& p, const Line_2<K>& q)
{
return ! (p == q);
}
template < class K >
inline
typename K::Boolean
operator==(const Ray_2<K>& p, const Ray_2<K>& q)
{
return K().equal_2_object()(p, q);
}
template < class K >
inline
typename K::Boolean
operator!=(const Ray_2<K>& p, const Ray_2<K>& q)
{
return ! (p == q);
}
template < class K >
inline
typename K::Boolean
operator==(const Segment_2<K>& p, const Segment_2<K>& q)
{
return K().equal_2_object()(p, q);
}
template < class K >
inline
typename K::Boolean
operator!=(const Segment_2<K>& p, const Segment_2<K>& q)
{
return ! (p == q);
}
template < class K >
inline
typename K::Boolean
operator==(const Triangle_2<K>& p, const Triangle_2<K>& q)
{
return K().equal_2_object()(p, q);
}
template < class K >
inline
typename K::Boolean
operator!=(const Triangle_2<K>& p, const Triangle_2<K>& q)
{
return ! (p == q);
}
template < class K >
inline
typename K::Boolean
operator<(const Point_2<K>& p, const Point_2<K>& q)
{ return K().less_xy_2_object()(p, q); }
template < class K >
inline
typename K::Boolean
operator<(const Weighted_point_2<K>& p, const Weighted_point_2<K>& q)
{ return p.point() < q.point(); }
template < class K > template < class K >
inline inline
typename K::Boolean typename K::Boolean
@ -811,24 +1057,6 @@ typename K::Boolean
operator<=(const Direction_2<K>& d1, const Direction_2<K>& d2) operator<=(const Direction_2<K>& d1, const Direction_2<K>& d2)
{ return compare_angle_with_x_axis(d1, d2) != LARGER; } { return compare_angle_with_x_axis(d1, d2) != LARGER; }
template < class K >
inline
typename K::Boolean
operator==(const Point_2<K>& p, const Point_2<K>& q)
{ return K().equal_2_object()(p, q); }
template < class K >
inline
typename K::Boolean
operator!=(const Point_2<K>& p, const Point_2<K>& q)
{ return ! (p == q); }
template < class K >
inline
typename K::Boolean
operator<(const Point_2<K>& p, const Point_2<K>& q)
{ return K().less_xy_2_object()(p, q); }
template < class K > template < class K >
inline inline
typename K::Boolean typename K::Boolean
@ -847,18 +1075,6 @@ typename K::Boolean
operator>=(const Point_2<K>& p, const Point_2<K>& q) operator>=(const Point_2<K>& p, const Point_2<K>& q)
{ return ! K().less_xy_2_object()(p, q); } { return ! K().less_xy_2_object()(p, q); }
template < class K >
inline
typename K::Boolean
operator==(const Vector_2<K>& v, const Vector_2<K>& w)
{ return K().equal_2_object()(v, w); }
template < class K >
inline
typename K::Boolean
operator!=(const Vector_2<K>& v, const Vector_2<K>& w)
{ return ! (v == w); }
template < class K > template < class K >
inline inline
typename K::Vector_2 typename K::Vector_2

View File

@ -28,7 +28,7 @@ namespace CGAL {
template <typename K> template <typename K>
inline inline
Angle typename K::Angle
angle(const Vector_3<K> &u, const Vector_3<K> &v) angle(const Vector_3<K> &u, const Vector_3<K> &v)
{ {
return internal::angle(u, v, K()); return internal::angle(u, v, K());
@ -36,7 +36,7 @@ angle(const Vector_3<K> &u, const Vector_3<K> &v)
template <typename K> template <typename K>
inline inline
Angle typename K::Angle
angle(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r) angle(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r)
{ {
return internal::angle(p, q, r, K()); return internal::angle(p, q, r, K());
@ -44,7 +44,7 @@ angle(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r)
template <typename K> template <typename K>
inline inline
Angle typename K::Angle
angle(const Point_3<K> &p, const Point_3<K> &q, angle(const Point_3<K> &p, const Point_3<K> &q,
const Point_3<K> &r, const Point_3<K> &s) const Point_3<K> &r, const Point_3<K> &s)
{ {
@ -53,7 +53,7 @@ angle(const Point_3<K> &p, const Point_3<K> &q,
template <typename K> template <typename K>
inline inline
Angle typename K::Angle
angle(const Point_3<K> &p, const Point_3<K> &q, angle(const Point_3<K> &p, const Point_3<K> &q,
const Point_3<K> &r, const Vector_3<K> &v) const Point_3<K> &r, const Vector_3<K> &v)
{ {
@ -206,7 +206,7 @@ bisector(const Plane_3<K> &h1, const Plane_3<K> &h2)
template < class K > template < class K >
inline inline
Point_3<K> typename K::Point_3
centroid(const Point_3<K> &p, const Point_3<K> &q, centroid(const Point_3<K> &p, const Point_3<K> &q,
const Point_3<K> &r, const Point_3<K> &s) const Point_3<K> &r, const Point_3<K> &s)
{ {
@ -215,7 +215,7 @@ centroid(const Point_3<K> &p, const Point_3<K> &q,
template < class K > template < class K >
inline inline
Point_3<K> typename K::Point_3
centroid(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r) centroid(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r)
{ {
return internal::centroid(p, q, r, K()); return internal::centroid(p, q, r, K());
@ -223,7 +223,7 @@ centroid(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r)
template < class K > template < class K >
inline inline
Point_3<K> typename K::Point_3
centroid(const Tetrahedron_3<K> &t) centroid(const Tetrahedron_3<K> &t)
{ {
return internal::centroid(t, K()); return internal::centroid(t, K());
@ -231,7 +231,7 @@ centroid(const Tetrahedron_3<K> &t)
template < class K > template < class K >
inline inline
Point_3<K> typename K::Point_3
centroid(const Triangle_3<K> &t) centroid(const Triangle_3<K> &t)
{ {
return internal::centroid(t, K()); return internal::centroid(t, K());
@ -804,12 +804,80 @@ typename K::Boolean
operator==(const Point_3<K>& p, const Origin& o) operator==(const Point_3<K>& p, const Origin& o)
{ return K().equal_3_object()(p, Point_3<K>(o)); } { return K().equal_3_object()(p, Point_3<K>(o)); }
template < class K >
inline
typename K::Boolean
operator==(const Origin& o, const Point_3<K>& p)
{ return p == o; }
template < class K > template < class K >
inline inline
typename K::Boolean typename K::Boolean
operator!=(const Point_3<K>& p, const Origin& o) operator!=(const Point_3<K>& p, const Origin& o)
{ return ! (p == o); } { return ! (p == o); }
template < class K >
inline
typename K::Boolean
operator!=(const Origin& o, const Point_3<K>& p)
{ return ! (p == o); }
template < class K >
inline
typename K::Boolean
operator==(const Origin& o, const Weighted_point_3<K>& p)
{ return p == o; }
template < class K >
inline
typename K::Boolean
operator!=(const Origin& o, const Weighted_point_3<K>& p)
{ return p != o; }
template < class K >
inline
typename K::Boolean
operator==(const Point_3<K>& bp, const Weighted_point_3<K>& p)
{ return bp == p.point(); }
template < class K >
inline
typename K::Boolean
operator!=(const Point_3<K>& bp, const Weighted_point_3<K>& p)
{ return bp != p.point(); }
template < class K >
inline
typename K::Boolean
operator==(const Weighted_point_3<K>& p, const Point_3<K>& bp)
{ return bp == p.point(); }
template < class K >
inline
typename K::Boolean
operator!=(const Weighted_point_3<K>& p, const Point_3<K>& bp)
{ return bp != p.point(); }
template < class K >
inline
typename K::Boolean
operator==(const Weighted_point_3<K>& p, const Weighted_point_3<K>& p2)
{ return p.point() == p2.point(); }
template < class K >
inline
typename K::Boolean
operator!=(const Weighted_point_3<K>& p, const Weighted_point_3<K>& p2)
{ return p.point() != p2.point(); }
template < class K >
inline
typename K::Boolean
operator==(const Circle_3<K>& p, const Circle_3<K>& q)
{
return K().equal_3_object()(p, q);
}
template < class K > template < class K >
inline inline
typename K::Boolean typename K::Boolean
@ -939,8 +1007,20 @@ operator==(const Vector_3<K>& p, const Null_vector& o)
template < class K > template < class K >
inline inline
typename K::Boolean typename K::Boolean
operator!=(const Vector_3<K>& p, const Null_vector& o) operator==(const Null_vector& o, const Vector_3<K>& v)
{ return ! (p == o); } { return (v == o); }
template < class K >
inline
typename K::Boolean
operator!=(const Vector_3<K>& v, const Null_vector& o)
{ return ! (v == o); }
template < class K >
inline
typename K::Boolean
operator!=(const Null_vector& o, const Vector_3<K>& v)
{ return ! (v == o); }
template < class K > template < class K >
@ -967,6 +1047,12 @@ typename K::Boolean
operator>=(const Point_3<K>& p, const Point_3<K>& q) operator>=(const Point_3<K>& p, const Point_3<K>& q)
{ return ! K().less_xyz_3_object()(p, q); } { return ! K().less_xyz_3_object()(p, q); }
template < class K >
inline
typename K::Boolean
operator<(const Weighted_point_3<K>& p, const Weighted_point_3<K>& q)
{ return p.point() < q.point(); }
template < class K > template < class K >
inline inline
typename K::Vector_3 typename K::Vector_3

View File

@ -91,9 +91,11 @@ template <class R,int dim>
class Construct_bbox_projected_2 { class Construct_bbox_projected_2 {
public: public:
typedef typename R::Point_3 Point; typedef typename R::Point_3 Point;
typedef Bbox_2 result_type;
Bbox_2 operator()(const Point& p) const { typename R::Construct_bbox_3 bb; return Projector<R, dim>::bbox(bb(p)); } Bbox_2 operator()(const Point& p) const {
typename R::Construct_bbox_3 bb;
return Projector<R, dim>::bbox(bb(p));
}
}; };
template <class R,int dim> template <class R,int dim>
@ -177,39 +179,43 @@ public:
template <class R,int dim> template <class R,int dim>
class Side_of_bounded_circle_projected_3 class Side_of_bounded_circle_projected_3
{ {
typedef typename R::Bounded_side Bounded_side;
typedef typename R::Point_3 Point;
public: public:
typedef typename R::Point_3 Point;
typename R::FT x(const Point &p) const { return Projector<R,dim>::x(p); } typename R::FT x(const Point &p) const { return Projector<R,dim>::x(p); }
typename R::FT y(const Point &p) const { return Projector<R,dim>::y(p); } typename R::FT y(const Point &p) const { return Projector<R,dim>::y(p); }
typename R::Point_2 project(const Point& p) const typename R::Point_2 project(const Point& p) const
{ {
return typename R::Point_2(x(p),y(p)); return typename R::Point_2(x(p),y(p));
} }
CGAL::Bounded_side operator() (const Point &p,
const Point &q,
const Point &r,
const Point &s) const
{
return CGAL::side_of_bounded_circle(project(p),project(q),project(r),project(s) );
}
CGAL::Bounded_side operator() (const Point &p, Bounded_side operator()(const Point &p,
const Point &q, const Point &q,
const Point &r) const const Point &r,
{ const Point &s) const
return CGAL::side_of_bounded_circle(project(p),project(q),project(r)); {
} return CGAL::side_of_bounded_circle(project(p),project(q),project(r),project(s) );
}
Bounded_side operator()(const Point &p,
const Point &q,
const Point &r) const
{
return CGAL::side_of_bounded_circle(project(p),project(q),project(r));
}
}; };
template <class R,int dim> template <class R,int dim>
class Compare_distance_projected_3 class Compare_distance_projected_3
{ {
public: public:
typedef typename R::Comparison_result Comparison_result;
typedef typename R::Point_3 Point_3; typedef typename R::Point_3 Point_3;
typedef typename R::Point_2 Point_2; typedef typename R::Point_2 Point_2;
typedef typename R::FT RT; typedef typename R::FT RT;
typename R::FT x(const Point_3 &p) const { return Projector<R,dim>::x(p); } typename R::FT x(const Point_3 &p) const { return Projector<R,dim>::x(p); }
typename R::FT y(const Point_3 &p) const { return Projector<R,dim>::y(p); } typename R::FT y(const Point_3 &p) const { return Projector<R,dim>::y(p); }
@ -255,22 +261,23 @@ template <class R, int dim>
class Compare_signed_distance_to_line_projected_3 class Compare_signed_distance_to_line_projected_3
{ {
public: public:
typedef typename R::Comparison_result Comparison_result;
typedef typename R::Point_3 Point_3; typedef typename R::Point_3 Point_3;
typedef typename R::Point_2 Point_2; typedef typename R::Point_2 Point_2;
typedef typename R::FT RT; typedef typename R::FT RT;
typename R::FT x(const Point_3 &p) const { return Projector<R,dim>::x(p); } typename R::FT x(const Point_3 &p) const { return Projector<R,dim>::x(p); }
typename R::FT y(const Point_3 &p) const { return Projector<R,dim>::y(p); } typename R::FT y(const Point_3 &p) const { return Projector<R,dim>::y(p); }
typedef typename R::Comparison_result result_type;
Point_2 project(const Point_3& p) const Point_2 project(const Point_3& p) const
{ {
return Point_2(x(p),y(p)); return Point_2(x(p),y(p));
} }
result_type operator()(const Point_3& p, Comparison_result operator()(const Point_3& p,
const Point_3& q, const Point_3& q,
const Point_3& r, const Point_3& r,
const Point_3& s) const const Point_3& s) const
{ {
return typename R::Compare_signed_distance_to_line_2() return typename R::Compare_signed_distance_to_line_2()
( project(p), project(q), project(r), project(s) ); ( project(p), project(q), project(r), project(s) );
@ -281,22 +288,23 @@ template <class R, int dim>
class Less_signed_distance_to_line_projected_3 class Less_signed_distance_to_line_projected_3
{ {
public: public:
typedef typename R::Boolean Boolean;
typedef typename R::Point_3 Point_3; typedef typename R::Point_3 Point_3;
typedef typename R::Point_2 Point_2; typedef typename R::Point_2 Point_2;
typedef typename R::FT RT; typedef typename R::FT RT;
typename R::FT x(const Point_3 &p) const { return Projector<R,dim>::x(p); } typename R::FT x(const Point_3 &p) const { return Projector<R,dim>::x(p); }
typename R::FT y(const Point_3 &p) const { return Projector<R,dim>::y(p); } typename R::FT y(const Point_3 &p) const { return Projector<R,dim>::y(p); }
typedef typename R::Boolean result_type;
Point_2 project(const Point_3& p) const Point_2 project(const Point_3& p) const
{ {
return Point_2(x(p),y(p)); return Point_2(x(p),y(p));
} }
result_type operator()(const Point_3& p, Boolean operator()(const Point_3& p,
const Point_3& q, const Point_3& q,
const Point_3& r, const Point_3& r,
const Point_3& s) const const Point_3& s) const
{ {
return typename R::Less_signed_distance_to_line_2() return typename R::Less_signed_distance_to_line_2()
( project(p), project(q), project(r), project(s) ); ( project(p), project(q), project(r), project(s) );
@ -314,6 +322,7 @@ public:
typedef typename R::Segment_3 Segment_3; typedef typename R::Segment_3 Segment_3;
typedef typename R::Segment_2 Segment_2; typedef typename R::Segment_2 Segment_2;
typedef typename R::FT RT; typedef typename R::FT RT;
typename R::FT x(const Point_3 &p) const { return Projector<R,dim>::x(p); } typename R::FT x(const Point_3 &p) const { return Projector<R,dim>::x(p); }
typename R::FT y(const Point_3 &p) const { return Projector<R,dim>::y(p); } typename R::FT y(const Point_3 &p) const { return Projector<R,dim>::y(p); }
@ -598,8 +607,6 @@ class Compute_squared_length_projected_3
typedef typename R::Vector_3 Vector_3; typedef typename R::Vector_3 Vector_3;
typedef typename R::FT FT; typedef typename R::FT FT;
typedef FT result_type;
FT x(const Vector_3 &v) const { return Projector<R,dim>::x(v); } FT x(const Vector_3 &v) const { return Projector<R,dim>::x(v); }
FT y(const Vector_3 &v) const { return Projector<R,dim>::y(v); } FT y(const Vector_3 &v) const { return Projector<R,dim>::y(v); }
@ -634,6 +641,7 @@ template <class R, int dim>
class Compare_power_distance_projected_3 class Compare_power_distance_projected_3
{ {
public: public:
typedef typename R::Comparison_result Comparison_result;
typedef typename R::Point_2 Point_2; typedef typename R::Point_2 Point_2;
typedef typename R::Weighted_point_2 Weighted_point_2; typedef typename R::Weighted_point_2 Weighted_point_2;
typedef typename R::Point_3 Point_3; typedef typename R::Point_3 Point_3;
@ -815,6 +823,7 @@ template <class R, int dim>
class Power_side_of_bounded_power_circle_projected_3 class Power_side_of_bounded_power_circle_projected_3
{ {
public: public:
typedef typename R::Bounded_side Bounded_side;
typedef typename R::Point_2 Point_2; typedef typename R::Point_2 Point_2;
typedef typename R::Weighted_point_2 Weighted_point_2; typedef typename R::Weighted_point_2 Weighted_point_2;
typedef typename R::Point_3 Point_3; typedef typename R::Point_3 Point_3;
@ -830,24 +839,24 @@ public:
return Weighted_point_2(Point_2(x(p), y(p)), wp.weight()); return Weighted_point_2(Point_2(x(p), y(p)), wp.weight());
} }
CGAL::Bounded_side operator()(const Weighted_point_3 &wp, Bounded_side operator()(const Weighted_point_3 &wp,
const Weighted_point_3 &wq, const Weighted_point_3 &wq,
const Weighted_point_3 &wr, const Weighted_point_3 &wr,
const Weighted_point_3 &ws) const const Weighted_point_3 &ws) const
{ {
return CGAL::power_side_of_bounded_power_circle(project(wp), project(wq), return CGAL::power_side_of_bounded_power_circle(project(wp), project(wq),
project(wr), project(ws)); project(wr), project(ws));
} }
CGAL::Bounded_side operator()(const Weighted_point_3 &wp, Bounded_side operator()(const Weighted_point_3 &wp,
const Weighted_point_3 &wq, const Weighted_point_3 &wq,
const Weighted_point_3 &wr) const const Weighted_point_3 &wr) const
{ {
return CGAL::power_side_of_bounded_power_circle(project(wp), project(wq), project(wr)); return CGAL::power_side_of_bounded_power_circle(project(wp), project(wq), project(wr));
} }
CGAL::Bounded_side operator()(const Weighted_point_3 &wp, Bounded_side operator()(const Weighted_point_3 &wp,
const Weighted_point_3 &wq) const const Weighted_point_3 &wq) const
{ {
return CGAL::power_side_of_bounded_power_circle(project(wp), project(wq)); return CGAL::power_side_of_bounded_power_circle(project(wp), project(wq));
} }
@ -974,8 +983,10 @@ public:
typedef typename Rp::Compare_xyz_3 Compare_xy_2; typedef typename Rp::Compare_xyz_3 Compare_xy_2;
struct Less_xy_2 { struct Less_xy_2 {
typedef typename R::Boolean result_type; typedef typename R::Comparison_result Comparison_result;
bool operator()(const Point_2& p, const Point_2& q) const typedef typename R::Boolean Boolean;
Boolean operator()(const Point_2& p, const Point_2& q) const
{ {
Compare_x_2 cx; Compare_x_2 cx;
Comparison_result crx = cx(p,q); Comparison_result crx = cx(p,q);
@ -988,8 +999,8 @@ public:
struct Less_yx_2 { struct Less_yx_2 {
typedef typename R::Boolean result_type; typedef typename R::Boolean Boolean;
bool operator()(const Point_2& p, const Point_2& q) const Boolean operator()(const Point_2& p, const Point_2& q) const
{ {
Compare_y_2 cy; Compare_y_2 cy;
Comparison_result cry = cy(p,q); Comparison_result cry = cy(p,q);
@ -1001,8 +1012,8 @@ public:
}; };
struct Equal_2 { struct Equal_2 {
typedef typename R::Boolean result_type; typedef typename R::Boolean Boolean;
bool operator()(const Point_2& p, const Point_2& q) const Boolean operator()(const Point_2& p, const Point_2& q) const
{ {
Equal_x_2 eqx; Equal_x_2 eqx;
@ -1012,8 +1023,8 @@ public:
}; };
struct Left_turn_2 { struct Left_turn_2 {
typedef typename R::Boolean result_type; typedef typename R::Boolean Boolean;
bool operator()(const Point_2& p, const Point_2& q, const Point_2& r) const Boolean operator()(const Point_2& p, const Point_2& q, const Point_2& r) const
{ {
Orientation_2 ori; Orientation_2 ori;
@ -1022,7 +1033,7 @@ public:
}; };
struct Collinear_2 { struct Collinear_2 {
typedef typename R::Boolean result_type; typedef typename R::Boolean Boolean;
bool operator()(const Point_2& p, const Point_2& q, const Point_2& r) const bool operator()(const Point_2& p, const Point_2& q, const Point_2& r) const
{ {
Orientation_2 ori; Orientation_2 ori;

View File

@ -34,7 +34,6 @@ class Projected_orientation_with_normal_3
typedef typename Traits::Vector_3 Vector_3; typedef typename Traits::Vector_3 Vector_3;
public: public:
typedef typename K::Orientation Orientation; typedef typename K::Orientation Orientation;
typedef Orientation result_type;
Projected_orientation_with_normal_3(const Vector_3& normal_) Projected_orientation_with_normal_3(const Vector_3& normal_)
: normal(normal_) : normal(normal_)
@ -69,7 +68,6 @@ class Projected_side_of_oriented_circle_with_normal_3
public: public:
typedef typename K::Oriented_side Oriented_side; typedef typename K::Oriented_side Oriented_side;
typedef Oriented_side result_type;
Projected_side_of_oriented_circle_with_normal_3(const Vector_3& normal_) Projected_side_of_oriented_circle_with_normal_3(const Vector_3& normal_)
: normal(normal_) : normal(normal_)
@ -307,6 +305,7 @@ template <class Traits>
class Less_along_axis class Less_along_axis
{ {
// private members // private members
typedef typename Traits::Boolean Boolean;
typedef typename Traits::Vector_3 Vector_3; typedef typename Traits::Vector_3 Vector_3;
typedef typename Traits::Point_2 Point; typedef typename Traits::Point_2 Point;
Vector_3 base; Vector_3 base;
@ -317,9 +316,7 @@ public:
CGAL_TIME_PROFILER("Construct Less_along_axis") CGAL_TIME_PROFILER("Construct Less_along_axis")
} }
typedef bool result_type; Boolean operator() (const Point &p, const Point &q) const {
bool operator() (const Point &p, const Point &q) const {
return base * (p - q) < 0; return base * (p - q) < 0;
} }
}; // end class Less_along_axis }; // end class Less_along_axis
@ -328,6 +325,7 @@ template <class Traits>
class Compare_along_axis class Compare_along_axis
{ {
// private members // private members
typedef typename Traits::Comparison_result Comparison_result;
typedef typename Traits::Vector_3 Vector_3; typedef typename Traits::Vector_3 Vector_3;
typedef typename Traits::Point_2 Point; typedef typename Traits::Point_2 Point;
Vector_3 base; Vector_3 base;
@ -338,8 +336,6 @@ public:
CGAL_TIME_PROFILER("Construct Compare_along_axis") CGAL_TIME_PROFILER("Construct Compare_along_axis")
} }
typedef Comparison_result result_type;
Comparison_result operator() (const Point &p, const Point &q) const { Comparison_result operator() (const Point &p, const Point &q) const {
return compare(base * (p - q), 0); return compare(base * (p - q), 0);
} }
@ -349,9 +345,13 @@ template <class Traits>
class Less_xy_along_axis class Less_xy_along_axis
{ {
// private members // private members
typedef typename Traits::Comparison_result Comparison_result;
typedef typename Traits::Boolean Boolean;
typedef typename Traits::Vector_3 Vector_3; typedef typename Traits::Vector_3 Vector_3;
typedef typename Traits::Point_2 Point; typedef typename Traits::Point_2 Point;
Vector_3 base1, base2; Vector_3 base1, base2;
public: public:
Less_xy_along_axis(const Vector_3& base1, const Vector_3& base2) : base1(base1), base2(base2) Less_xy_along_axis(const Vector_3& base1, const Vector_3& base2) : base1(base1), base2(base2)
{ {
@ -359,9 +359,7 @@ public:
CGAL_TIME_PROFILER("Construct Less_xy_along_axis") CGAL_TIME_PROFILER("Construct Less_xy_along_axis")
} }
typedef bool result_type; Boolean operator() (const Point &p, const Point &q) const {
bool operator() (const Point &p, const Point &q) const {
Compare_along_axis<Traits> cx(base1); Compare_along_axis<Traits> cx(base1);
Comparison_result crx = cx(p, q); Comparison_result crx = cx(p, q);
@ -447,6 +445,15 @@ public:
} }
typedef Kernel K; typedef Kernel K;
typedef typename K::Boolean Boolean;
typedef typename K::Sign Sign;
typedef typename K::Comparison_result Comparison_result;
typedef typename K::Orientation Orientation;
typedef typename K::Oriented_side Oriented_side;
typedef typename K::Bounded_side Bounded_side;
typedef typename K::Angle Angle;
typedef typename K::FT FT; typedef typename K::FT FT;
typedef typename K::Point_3 Point_2; typedef typename K::Point_3 Point_2;
typedef typename K::Segment_3 Segment_2; typedef typename K::Segment_3 Segment_2;

View File

@ -223,19 +223,6 @@ public:
{ {
return R().construct_point_2_object()(*this,i); return R().construct_point_2_object()(*this,i);
} }
typename R::Boolean
operator==(const Line_2 &l) const
{
return R().equal_2_object()(*this, l);
}
typename R::Boolean
operator!=(const Line_2 &l) const
{
return !(*this == l);
}
}; };

Some files were not shown because too many files have changed in this diff Show More