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:
typedef Voronoi_radius_2<K> Voronoi_radius;
typedef typename K::Bounded_side Bounded_dide;
typedef typename K::Bounded_side Bounded_side;
public:
template<class Tag>

View File

@ -25,6 +25,7 @@ namespace CGAL {
template <class R_ >
class CircleC2
{
typedef typename R_::Boolean Boolean;
typedef typename R_::FT FT;
typedef typename R_::RT RT;
typedef typename R_::Circle_2 Circle_2;
@ -49,8 +50,8 @@ public:
base = Rep(center, squared_radius, orient);
}
bool operator==(const CircleC2 &s) const;
bool operator!=(const CircleC2 &s) const;
Boolean operator==(const CircleC2& s) const;
Boolean operator!=(const CircleC2& s) 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
#endif // CGAL_CARTESIAN_CIRCLE_2_H

View File

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

View File

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

View File

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

View File

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

View File

@ -107,6 +107,15 @@ public:
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
{
return base.dimension();

View File

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

View File

@ -27,6 +27,8 @@ namespace CGAL {
template <class R_>
class SphereC3
{
typedef typename R_::Boolean Boolean;
typedef typename R_::Bounded_side Bounded_side;
typedef typename R_::FT FT;
// https://doc.cgal.org/latest/Manual/devman_code_format.html#secprogramming_conventions
typedef typename R_::Point_3 Point_3_;
@ -124,17 +126,17 @@ public:
//! precond: ! x.is_degenerate() (when available)
// Returns R::ON_POSITIVE_SIDE, R::ON_ORIENTED_BOUNDARY or
// R::ON_NEGATIVE_SIDE
typename R::Boolean has_on(const Circle_3 &p) const;
typename R::Boolean has_on(const Point_3_ &p) const;
typename R::Boolean has_on_boundary(const Point_3_ &p) const;
typename R::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(const Circle_3 &p) const;
Boolean has_on(const Point_3_ &p) const;
Boolean has_on_boundary(const Point_3_ &p) const;
Boolean has_on_positive_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)
// 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;
typename R::Boolean has_on_unbounded_side(const Point_3_ &p) const;
Boolean has_on_bounded_side(const Point_3_ &p) const;
Boolean has_on_unbounded_side(const Point_3_ &p) const;
};
template < class R >
@ -163,6 +165,7 @@ typename R::Oriented_side
SphereC3<R>::
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();
}
@ -172,6 +175,7 @@ typename R::Bounded_side
SphereC3<R>::
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(),
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();
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());
return ON_ORIENTED_BOUNDARY;

View File

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

View File

@ -107,7 +107,7 @@ public:
template < class R >
CGAL_KERNEL_INLINE
bool
typename R::Boolean
operator==(const VectorC2<R> &v, const VectorC2<R> &w)
{
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 >
inline
bool
typename R::Boolean
operator!=(const VectorC2<R> &v, const VectorC2<R> &w)
{
return !(v == w);
@ -123,7 +123,7 @@ operator!=(const VectorC2<R> &v, const VectorC2<R> &w)
template < class R >
inline
bool
typename R::Boolean
operator==(const VectorC2<R> &v, const Null_vector &)
{
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 >
inline
bool
typename R::Boolean
operator==(const Null_vector &n, const VectorC2<R> &v)
{
return v == n;
@ -139,7 +139,7 @@ operator==(const Null_vector &n, const VectorC2<R> &v)
template < class R >
inline
bool
typename R::Boolean
operator!=(const VectorC2<R> &v, const Null_vector &n)
{
return !(v == n);
@ -147,7 +147,7 @@ operator!=(const VectorC2<R> &v, const Null_vector &n)
template < class R >
inline
bool
typename R::Boolean
operator!=(const Null_vector &n, const VectorC2<R> &v)
{
return !(v == n);

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@ namespace CGAL {
template < class K >
inline
bool
typename K::Boolean
equal_xy(const PointC2<K> &p, const PointC2<K> &q)
{
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.
template < class K >
inline
Comparison_result
typename K::Comparison_result
compare_deltax_deltay(const PointC2<K>& p,
const PointC2<K>& q,
const PointC2<K>& r,
@ -46,7 +46,7 @@ compare_deltax_deltay(const PointC2<K>& p,
template < class K >
inline
Comparison_result
typename K::Comparison_result
compare_lexicographically_yx(const PointC2<K> &p,
const PointC2<K> &q)
{

View File

@ -24,7 +24,7 @@ namespace CGAL {
template < class K >
inline
bool
typename K::Boolean
equal_xy(const PointC3<K> &p, const PointC3<K> &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 >
inline
bool
typename K::Boolean
equal_xyz(const PointC3<K> &p, const PointC3<K> &q)
{
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 >
inline
Comparison_result
typename K::Comparison_result
compare_xy(const PointC3<K> &p, const PointC3<K> &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 >
inline
Comparison_result
typename K::Comparison_result
compare_lexicographically_xy(const PointC3<K> &p, const PointC3<K> &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 >
inline
bool
typename K::Boolean
lexicographically_xy_smaller_or_equal(const PointC3<K> &p,
const PointC3<K> &q)
{
@ -65,7 +65,7 @@ lexicographically_xy_smaller_or_equal(const PointC3<K> &p,
template < class K >
inline
bool
typename K::Boolean
lexicographically_xy_smaller(const PointC3<K> &p,
const PointC3<K> &q)
{
@ -74,7 +74,7 @@ lexicographically_xy_smaller(const PointC3<K> &p,
template < class K >
inline
bool
typename K::Boolean
strict_dominance(const PointC3<K> &p,
const PointC3<K> &q)
{
@ -84,7 +84,7 @@ strict_dominance(const PointC3<K> &p,
template < class K >
inline
bool
typename K::Boolean
dominance(const PointC3<K> &p,
const PointC3<K> &q)
{

View File

@ -421,6 +421,7 @@ typename Same_uncertainty_nt<Angle, FT>::type
angleC2(const FT &ux, const FT &uy,
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));
}
@ -431,6 +432,7 @@ angleC2(const FT &px, const FT &py,
const FT &qx, const FT &qy,
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)));
}
@ -442,6 +444,7 @@ angleC2(const FT &px, const FT &py,
const FT &rx, const FT &ry,
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)));
}
@ -508,6 +511,7 @@ side_of_bounded_circleC2(const FT &px, const FT &py,
const FT &rx, const FT &ry,
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)
* 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)
{
// Returns whether T lies inside or outside the circle which diameter is PQ.
return enum_cast<Bounded_side>(
CGAL_NTS compare((tx-px)*(qx-tx), (ty-py)*(ty-qy)) );
typedef typename Same_uncertainty_nt<Bounded_side, FT>::type Bounded_side;
return enum_cast<Bounded_side>(CGAL_NTS compare((tx-px)*(qx-tx), (ty-py)*(ty-qy)) );
}
template < class FT >
@ -630,7 +634,7 @@ side_of_oriented_lineC2(const FT &a, const FT &b, const FT &c,
}
template <class FT>
Comparison_result
typename Compare<FT>::result_type
compare_power_distanceC2(const FT& px, const FT& py, const FT& pwt,
const FT& qx, const FT& qy, const FT& qwt,
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>
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,
const FT &qx, const FT &qy, const FT &qw,
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 dpy = py - qy;
FT dtx = tx - qx;
FT dty = ty - qy;
FT dpz = CGAL_NTS square(dpx) + CGAL_NTS square(dpy);
return enum_cast<Bounded_side>
(CGAL_NTS sign(-(CGAL_NTS square(dtx) + CGAL_NTS square(dty)-tw+qw)*dpz
return enum_cast<Bounded_side>(CGAL_NTS sign(-(CGAL_NTS square(dtx) + CGAL_NTS square(dty)-tw+qw)*dpz
+(dpz-pw+qw)*(dpx*dtx+dpy*dty)));
}
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,
const FT &qx, const FT &qy, const FT &qwt,
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>
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,
const FT &qx, const FT &qy, const FT &qwt,
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>
Oriented_side
typename Same_uncertainty_nt<Oriented_side, FT>::type
circumcenter_oriented_side_of_oriented_segmentC2(const FT& ax, const FT& ay,
const FT& bx, const FT& by,
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,
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));
}
@ -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 &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)+
(py-qy)*(ry-qy)+
(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 &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)+
(py-qy)*(ry-sy)+
(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 &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),
// with v = pq ^ pr.
// 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 &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,
qx, qy, qz,
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)
{
// 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)
+ (ty-py)*(qy-ty)
+ (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
// 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).
FT psx = px-sx;
FT psy = py-sy;
FT psz = pz-sz;
@ -688,7 +695,7 @@ power_side_of_oriented_power_sphereC3(const FT &pwt, const FT &qwt)
}
template < class FT >
Comparison_result
typename Compare<FT>::result_type
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 &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 &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
FT qpx = qx-px;
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 &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 dpx = px - qx;
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::Circular_arc_2<Circular_k> Circular_arc_2;
typedef CGAL::Circular_arc_point_2<Circular_k> Circular_arc_point_2;
int main()
{
@ -13,8 +14,8 @@ int main()
for(int i = 0; i <= 10; i++) {
for(int j = 0; j <= 10; j++) {
Point_2 p = Point_2(i, j);
if(Circular_k().has_on_2_object()(c,p)) {
Circular_arc_point_2 cap(Point_2(i, j));
if(Circular_k().has_on_2_object()(c,cap)) {
n++;
std::cout << "(" << i << "," << j << ")" << std::endl;
}

View File

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

View File

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

View File

@ -30,148 +30,115 @@
namespace CGAL {
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 >
class Compare_x_2
: public CK::Linear_kernel::Compare_x_2
{
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Point_2 Point_2;
CGAL_CIRCULAR_KERNEL_MACRO_FUNCTOR_COMPARE_(x)
CGAL_CIRCULAR_KERNEL_MACRO_FUNCTOR_COMPARE_(y)
CGAL_CIRCULAR_KERNEL_MACRO_FUNCTOR_COMPARE_(xy)
public:
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);}
};
#undef CGAL_CIRCULAR_KERNEL_MACRO_FUNCTOR_COMPARE_
template < class CK >
class In_x_range_2
{
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef bool result_type;
result_type
Boolean
operator()(const Circular_arc_2 &a, const Circular_arc_point_2 &p) const
{ 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
{ return CircularFunctors::point_in_x_range<CK>(a, p); }
};
template < class CK >
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_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Line_2 Line_2;
typedef typename CK::Linear_kernel::Has_on_2 Linear_Has_on_2;
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
{ return CircularFunctors::has_on<CK>(a, p); }
result_type
Boolean
operator()(const Line_2 &a, const Circular_arc_point_2 &p) const
{ return LinearFunctors::has_on<CK>(a, p); }
result_type
Boolean
operator()(const Circular_arc_2 &a, const Circular_arc_point_2 &p) const
{ return CircularFunctors::has_on<CK>(a, p); }
result_type
Boolean
operator()(const Line_arc_2 &a, const Circular_arc_point_2 &p) const
{ return CircularFunctors::has_on<CK>(a, p); }
};
template < class CK >
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_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef CGAL::Comparison_result result_type;
result_type
Comparison_result
operator()(const Circular_arc_2 &a1,
const Circular_arc_2 &a2,
const Circular_arc_point_2 &p) const
{ return CircularFunctors::compare_y_to_right<CK>(a1, a2, p); }
result_type
Comparison_result
operator()(const Line_arc_2 &a1,
const Line_arc_2 &a2,
const Circular_arc_point_2 &p) const
{ return CircularFunctors::compare_y_to_right<CK>(a1, a2, p); }
result_type
Comparison_result
operator()(const Line_arc_2 &a1,
const Circular_arc_2 &a2,
const Circular_arc_point_2 &p) const
{ return CircularFunctors::compare_y_to_right<CK>(a1, a2, p); }
result_type
Comparison_result
operator()(const Circular_arc_2 &a1,
const Line_arc_2 &a2,
const Circular_arc_point_2 &p) const
@ -179,21 +146,16 @@ namespace CircularFunctors {
return CGAL::SMALLER;
return CGAL::LARGER;
}
};
template < class CK >
class Equal_2
: public CK::Linear_kernel::Equal_2
// : public CK::Linear_kernel::Equal_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::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::Vector_2 Vector_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::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;
using CK::Linear_kernel::Equal_2::operator();
public:
// 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,
const Circular_arc_point_2 &p1) const
{ return CircularFunctors::equal<CK>(p0, p1); }
result_type
Boolean
operator() (const Circular_arc_2 &a0, const Circular_arc_2 &a1) const
{ return CircularFunctors::equal<CK>(a0, a1); }
result_type
Boolean
operator() (const Line_arc_2 &a0, const Line_arc_2 &a1) const
{ return CircularFunctors::equal<CK>(a0, a1); }
};
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_point_2 Circular_arc_point_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:
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,
const Circular_arc_2 &A1) const
{ return CircularFunctors::compare_y_at_x<CK>(p, A1); }
result_type
Comparison_result
operator() (const Circular_arc_point_2 &p,
const Line_arc_2 &A1) const
{ return CircularFunctors::compare_y_at_x<CK>(p, A1); }
};
template < class CK >
class Do_overlap_2
{
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef bool result_type;
result_type
Boolean
operator() (const Circular_arc_2 &A1, const Circular_arc_2 &A2) const
{ return CircularFunctors::do_overlap<CK>(A1, A2); }
result_type
Boolean
operator() (const Line_arc_2 &A1, const Line_arc_2 &A2) const
{ return CircularFunctors::do_overlap<CK>(A1, A2); }
};
template < class CK >
class Make_x_monotone_2
{
@ -274,9 +245,6 @@ namespace CircularFunctors {
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef void result_type; //!!!
template < class OutputIterator >
OutputIterator
operator()(const Circular_arc_2 &A, OutputIterator res) const
@ -290,7 +258,6 @@ namespace CircularFunctors {
{
return CircularFunctors::make_x_monotone<CK>(A,res);
}
};
template < class CK >
@ -300,9 +267,6 @@ namespace CircularFunctors {
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef void result_type; //!!!
template < class OutputIterator >
OutputIterator
operator()(const Circular_arc_2 &A, OutputIterator res) const
@ -326,19 +290,21 @@ namespace CircularFunctors {
{ *res++ = make_object(A);
return res;
}
};
template < class CK >
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:
typedef typename CK::Linear_kernel::Do_intersect_2::result_type result_type;
template <class T1, class T2>
result_type
operator()(const T1& t1, const T2& t2) const
{ return Intersections::internal::do_intersect(t1, t2, CK()); }
template <typename A, typename B>
Boolean
operator()(const A& a, const B& b) const
{ return Intersections::internal::do_intersect(a, b, CK()); }
};
template < class CK >
@ -347,14 +313,12 @@ namespace CircularFunctors {
//using the Lazy_kernel as linear kernel.
//: public CK::Linear_kernel::Intersect_2
{
typedef typename CK::Circle_2 Circle;
typedef typename CK::Circular_arc_2 Circular_arc;
typedef typename CK::Line_arc_2 Line_arc;
typedef typename CK::Line_2 Line;
public:
//using CK::Linear_kernel::Intersect_2::operator();
template<class A, class B>
@ -460,7 +424,6 @@ namespace CircularFunctors {
*res++=typename CK::Linear_kernel::Intersect_2()(l1, l2);
return res;
}
};
template < class CK >
@ -489,42 +452,42 @@ namespace CircularFunctors {
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef void result_type;
result_type
void
operator()(const Circular_arc_2 &A,
const Circular_arc_point_2 &p,
Circular_arc_2 &ca1, Circular_arc_2 &ca2) const
{ return CircularFunctors::split<CK>(A, p, ca1, ca2); }
result_type
void
operator()(const Line_arc_2 &A,
const Circular_arc_point_2 &p,
Line_arc_2 &ca1, Line_arc_2 &ca2) const
{ return CircularFunctors::split<CK>(A, p, ca1, ca2); }
};
template < class CK >
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::Line_arc_2 Line_arc_2;
typedef typename CK::Linear_kernel::Is_vertical_2 Linear_Is_vertical_2;
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();
result_type
Boolean
operator()(const Circular_arc_2 &A) const
{ return CircularFunctors::is_vertical<CK>(A); }
result_type
Boolean
operator()(const Line_arc_2 &A) const
{ return CircularFunctors::is_vertical<CK>(A); }
@ -533,56 +496,51 @@ namespace CircularFunctors {
template < class CK >
class Construct_circular_arc_2
{
typedef typename CK::FT FT;
typedef typename CK::RT RT;
typedef typename CK::Point_2 Point_2;
typedef typename CK::Line_2 Line_2;
typedef typename CK::Circle_2 Circle_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 CK::Circular_arc_point_2 Circular_arc_point_2;
public:
typedef Circular_arc_2 result_type;
result_type
Circular_arc_2
operator()(void)
{ return Rep(); }
result_type
Circular_arc_2
operator()(const Circle_2 &c) const
{ return Rep(c); }
result_type
Circular_arc_2
operator()(const Circle_2 &support,
const Circular_arc_point_2 &source,
const Circular_arc_point_2 &target) const
{ return Rep(support,source,target); }
// Not Documented
result_type
Circular_arc_2
operator()(const Circle_2 &support,
const Line_2 &l1, bool b1,
const Line_2 &l2, bool b2) const
{ return Rep(support,l1,b1,l2,b2); }
// Not Documented
result_type
Circular_arc_2
operator()(const Circle_2 &c,
const Circle_2 &c1, bool b_1,
const Circle_2 &c2, bool b_2) const
{ return Rep(c,c1,b_1,c2,b_2); }
result_type
Circular_arc_2
operator()(const Point_2 &begin,
const Point_2 &middle,
const Point_2 &end) const
{ return Rep(begin,middle,end); }
// Not Documented
result_type
Circular_arc_2
operator()(const Point_2 &begin,
const Point_2 &end,
const FT& bulge) const
@ -600,47 +558,44 @@ namespace CircularFunctors {
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Segment_2 Segment_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;
public:
typedef Line_arc_2 result_type;
result_type
Line_arc_2
operator()(void)
{ return Rep(); }
// Not Documented
result_type
Line_arc_2
operator()(const Line_2 &support,
const Circle_2 &c1,const bool b1,
const Circle_2 &c2,const bool b2) const
{ return Rep(support,c1,b1,c2,b2); }
// Not Documented
result_type
Line_arc_2
operator()(const Line_2 &support,
const Line_2 &l1,
const Line_2 &l2) const
{ return Rep(support,l1,l2); }
result_type
Line_arc_2
operator()(const Line_2 &support,
const Circular_arc_point_2 &p1,
const Circular_arc_point_2 &p2) const
{ return Rep(support,p1,p2); }
// result_type
// Line_arc_2
// operator()(const Line_2 &support,
// const Point_2 &p1,
// const Point_2 &p2) const
// { return Rep(support,p1,p2); }
result_type
Line_arc_2
operator()(const Segment_2 &s) const
{ return Rep(s); }
result_type
Line_arc_2
operator()(const Point_2 &p1,
const Point_2 &p2) const
{ return Rep(p1,p2); }
@ -652,40 +607,32 @@ namespace CircularFunctors {
{
typedef typename CK::Point_2 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::Root_for_circles_2_2
Root_for_circles_2_2;
public:
typedef Circular_arc_point_2 result_type;
result_type
Circular_arc_point_2
operator()(void)
{ return Rep(); }
result_type
Circular_arc_point_2
operator()(const Root_for_circles_2_2 & np) const
{ return Rep(np); }
result_type
Circular_arc_point_2
operator()(const Point_2 & p) const
{ return Rep(p); }
};
template <class CK>
class Compute_circular_x_2
{
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Root_of_2 Root_of_2;
public:
typedef const Root_of_2& result_type;
result_type operator() (const Circular_arc_point_2 & a) const
decltype(auto) operator() (const Circular_arc_point_2 & a) const
{
return (a.rep().x());
}
@ -696,13 +643,9 @@ namespace CircularFunctors {
class Compute_circular_y_2
{
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Root_of_2 Root_of_2;
public:
typedef const Root_of_2& result_type;
result_type operator() (const Circular_arc_point_2 & a) const
decltype(auto) operator() (const Circular_arc_point_2 & a) const
{
return (a.rep().y());
}
@ -714,17 +657,14 @@ namespace CircularFunctors {
{
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
public:
typedef const Circular_arc_point_2 & result_type;
result_type operator() (const Circular_arc_2 & a) const
decltype(auto) operator() (const Circular_arc_2& a) const
{
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());
}
@ -736,18 +676,14 @@ namespace CircularFunctors {
{
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
public:
typedef const Circular_arc_point_2& result_type;
result_type operator() (const Circular_arc_2 & a) const
decltype(auto) operator() (const Circular_arc_2& a) const
{
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());
}
@ -759,16 +695,12 @@ namespace CircularFunctors {
{
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
public:
typedef const Circular_arc_point_2& result_type;
result_type operator() (const Circular_arc_2 & a) const
decltype(auto) operator() (const Circular_arc_2& a) const
{ 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();}
};
@ -779,16 +711,12 @@ namespace CircularFunctors {
{
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circular_arc_point_2 Circular_arc_point_2;
public:
typedef const Circular_arc_point_2& result_type;
result_type operator() (const Circular_arc_2 & a) const
decltype(auto) operator() (const Circular_arc_2& a) const
{ 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();}
};
@ -796,19 +724,17 @@ namespace CircularFunctors {
template <class CK>
class Is_x_monotone_2
{
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef bool result_type;
result_type operator() (const Circular_arc_2 & a) const
Boolean operator() (const Circular_arc_2 & a) const
{
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());
}
@ -818,19 +744,17 @@ namespace CircularFunctors {
template <class CK>
class Is_y_monotone_2
{
typedef typename CK::Boolean Boolean;
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Line_arc_2 Line_arc_2;
public:
typedef bool result_type;
result_type operator() (const Circular_arc_2 & a) const
Boolean operator() (const Circular_arc_2& a) const
{
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());
}
@ -839,48 +763,58 @@ namespace CircularFunctors {
template <class CK>
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_point_2 Circular_arc_point_2;
typedef typename CK::Line_arc_2 Line_arc_2;
typedef typename CK::Circle_2 Circle_2;
typedef typename CK::Linear_kernel::Construct_bbox_2 Linear_Construct_bbox_2;
public:
// using CK::Linear_kernel::Construct_bbox_2::operator();
typedef typename CK::Linear_kernel::Construct_bbox_2::result_type result_type;
using CK::Linear_kernel::Construct_bbox_2::operator();
template <typename A>
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();
}
result_type operator() (const Circular_arc_2 & a) const
decltype(auto) operator() (const Circular_arc_2& a) const
{
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();
}
};
template <class CK>
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::Circular_arc_point_2 Circular_arc_point_2;
typedef typename CK::Linear_kernel::Bounded_side_2 Linear_Bounded_side_2;
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
{ return CircularFunctors::bounded_side<CK>(c,p); }
@ -888,17 +822,23 @@ namespace CircularFunctors {
template <class CK>
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::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:
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
{ return CK().bounded_side_2_object()(c,p) == ON_BOUNDED_SIDE; }
@ -906,20 +846,25 @@ namespace CircularFunctors {
template <class CK>
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::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:
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
{ return CK().bounded_side_2_object()(c,p) == ON_UNBOUNDED_SIDE; }
};
#ifndef CGAL_NO_DEPRECATED_CODE
@ -927,31 +872,21 @@ namespace CircularFunctors {
class Construct_supporting_circle_2
{
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Circle_2 Circle_2;
public:
typedef Circle_2 result_type;
CGAL_DEPRECATED result_type operator() (const Circular_arc_2 & a) const
CGAL_DEPRECATED decltype(auto) operator() (const Circular_arc_2 & a) const
{
return a.rep().supporting_circle();
}
};
template <class CK>
class Construct_supporting_line_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:
typedef Line_2 result_type;
CGAL_DEPRECATED result_type operator() (const Line_arc_2 & a) const
CGAL_DEPRECATED decltype(auto) operator() (const Line_arc_2 & a) const
{
return a.rep().supporting_line();
}
@ -960,24 +895,28 @@ namespace CircularFunctors {
template <typename CK>
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;
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
{ return c.rep().center(); }
};
template <typename CK>
class Compute_squared_radius_2
{
private:
typedef typename CK::Circular_arc_2 Circular_arc_2;
typedef typename CK::Linear_kernel LK;
typedef typename LK::Compute_squared_radius_2 LK_Compute_squared_radius_2;

View File

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

View File

@ -33,6 +33,7 @@ namespace Bbox_functors {
template <class BK>
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::Point_2 Point_2;
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;
public:
typedef typename CK_Compare_x_2::result_type result_type;
using Base::operator();
result_type
Comparison_result
operator()( const Circular_arc_point_2 &a, const Circular_arc_point_2 &b) const
{
Bbox_2 bb1=a.bbox(),bb2=b.bbox();
@ -65,16 +63,15 @@ public:
template <class BK>
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::Point_2 Point_2;
typedef typename BK::Circular_kernel::
template Base< BK >::Type::Compare_y_2 CK_Compare_y_2;
typedef CK_Compare_y_2 Base;
public:
typedef typename CK_Compare_y_2::result_type result_type;
result_type
Comparison_result
operator() (const Point_2 &p0,
const Point_2 &p1) const
{
@ -83,7 +80,7 @@ public:
using Base::operator();
result_type
Comparison_result
operator()( const Circular_arc_point_2 &a, const Circular_arc_point_2 &b) const
{
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::
template Base< BK >::Type::Compare_xy_2 CK_Compare_xy_2;
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::Point_2 Point_2;
public:
typedef typename Base::result_type result_type;
using Base::operator();
public:
result_type
Comparison_result
operator()( const Circular_arc_point_2 &a, const Circular_arc_point_2 &b) const
{
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::
template Base< BK >::Type::In_x_range_2 CK_In_x_range_2;
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_2 Circular_arc_2;
typedef typename BK::Line_arc_2 Line_arc_2;
public:
typedef typename CK_In_x_range_2::result_type result_type;
using Base::operator();
private:
template <class Arc_2>
result_type
Boolean
_in_x_range_2(const Arc_2 &a, const Circular_arc_point_2 &p) const
{
@ -179,42 +172,36 @@ private:
}
public:
result_type
Boolean
operator()( const Circular_arc_2 &a, const Circular_arc_point_2 &p) const
{
CGAL_precondition( a.is_x_monotone());
return _in_x_range_2(a,p);
}
result_type
Boolean
operator()( const Line_arc_2 &a, const Circular_arc_point_2 &p) const
{ return _in_x_range_2(a,p);}
};
template <class BK>
class Compare_y_at_x_2 : public BK::Circular_kernel:: template Base< BK >::Type::Compare_y_at_x_2
{
typedef typename BK::Circular_kernel::
template Base< BK >::Type::Compare_y_at_x_2 CK_Compare_y_at_x_2;
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_point_2 Circular_arc_point_2;
typedef typename BK::Line_arc_2 Line_arc_2;
public:
typedef typename CK_Compare_y_at_x_2::result_type result_type;
using Base::operator();
private:
template <class Arc_2>
result_type
Comparison_result
_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));
@ -232,41 +219,36 @@ private:
}
public:
result_type
Comparison_result
operator()( const Circular_arc_point_2 &p,const Circular_arc_2 &a ) const
{
CGAL_precondition( a.is_x_monotone());
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
{return _compare_y_at_x_2(p,a);}
};
template <class BK>
class Has_on_2 : public BK::Circular_kernel:: template Base< BK >::Type::Has_on_2
{
typedef typename BK::Circular_kernel::
template Base< BK >::Type::Has_on_2 CK_Has_on_2;
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_point_2 Circular_arc_point_2;
typedef typename BK::Line_arc_2 Line_arc_2;
public:
typedef typename CK_Has_on_2::result_type result_type;
using Base::operator();
private:
template <class Arc_2>
result_type
Boolean
_has_on_2(const Arc_2 &a, const Circular_arc_point_2 &p) const
{
Bbox_2 bb1=a.bbox(),bb2=p.bbox();
@ -278,27 +260,26 @@ private:
}
public:
result_type
Boolean
operator()( const Circular_arc_2 &a,const Circular_arc_point_2 &p ) const
{
CGAL_precondition( a.is_x_monotone());
return _has_on_2(a,p);
}
result_type
Boolean
operator()( const Line_arc_2 &a, const Circular_arc_point_2 &p ) const
{return _has_on_2(a,p);}
};
template <class BK>
class Equal_2
: public BK::Circular_kernel:: template Base< BK >::Type::Equal_2
{
typedef typename BK::Circular_kernel::
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::Point_2 Point_2;
typedef typename BK::Direction_2 Direction_2;
@ -315,15 +296,11 @@ class Equal_2
typedef CK_Equal_2 Base;
public:
typedef typename CK_Equal_2::result_type result_type;
using Base::operator();
private:
template <class Arc_2>
result_type
Boolean
_equal_2(const Arc_2 &a,const Arc_2 &b) const
{
Bbox_2 bb11=a.source().bbox(),
@ -346,8 +323,7 @@ private:
}
public:
result_type
Boolean
operator()( const Circular_arc_point_2 &a ,
const Circular_arc_point_2 &b) const
{
@ -361,14 +337,15 @@ public:
/* WAS THAT HERE FOR OTHER COMPILERS THAN VC* ???
// redefine to solve ambiguous call error
result_type
Boolean
operator()( const Point_2 &a ,
const Point_2 &b) const
{
return CK_Equal_2()( a, b);
}
*/
result_type
Boolean
operator()( const Circular_arc_2 &a , const Circular_arc_2 &b ) const
{
CGAL_precondition( a.is_x_monotone());
@ -377,17 +354,17 @@ public:
return _equal_2(a,b);
}
result_type
Boolean
operator()( const Line_arc_2 &a ,
const Line_arc_2 &b ) const
{ return _equal_2(a,b);}
result_type
Boolean
operator()( const Circular_arc_2 & ,
const Line_arc_2 & ) const
{ return false;}
result_type
Boolean
operator()( const Line_arc_2 & ,
const Circular_arc_2 & ) const
{ return false;}
@ -401,19 +378,17 @@ class Do_overlap_2 : public BK::Circular_kernel:: template Base< BK >::Type::Do_
typedef typename BK::Circular_kernel::
template Base< BK >::Type::Do_overlap_2 CK_Do_overlap_2;
typedef CK_Do_overlap_2 Base;
typedef typename BK::Boolean Boolean;
typedef typename BK::Circular_arc_2 Circular_arc_2;
typedef typename BK::Line_arc_2 Line_arc_2;
public:
typedef typename CK_Do_overlap_2::result_type result_type;
using Base::operator();
private:
template <class Arc_2>
result_type
Boolean
_do_overlap_2(const Arc_2 &a, const Arc_2 &b) const
{
Bbox_2 bb1=a.bbox(),bb2=b.bbox();
@ -424,10 +399,8 @@ private:
return false;
}
public:
result_type
Boolean
operator()( const Circular_arc_2 &a , const Circular_arc_2 &b ) const
{
CGAL_precondition( a.is_x_monotone());
@ -435,28 +408,26 @@ public:
return _do_overlap_2(a,b);
}
result_type
Boolean
operator()( const Line_arc_2 &a ,
const Line_arc_2 &b ) const
{ return _do_overlap_2(a,b);}
result_type
Boolean
operator()( const Circular_arc_2 & ,
const Line_arc_2 & ) const
{ return false;}
result_type
Boolean
operator()( const Line_arc_2 & ,
const Circular_arc_2 & ) const
{ return false;}
};
template < class BK >
class Intersect_2 : public BK::Circular_kernel:: template Base< BK >::Type::Intersect_2
{
public:
typedef typename BK::Circular_kernel::
template Base< BK >::Type::Intersect_2 CK_Intersect_2;
@ -466,6 +437,7 @@ public:
typedef typename BK::Circle_2 Circle;
typedef typename BK::Line_2 Line_2;
public:
using CK_Intersect_2::operator();
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
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`),
and line segments (model of `SphericalKernel::LineArc_3`) whose
endpoints are points of this new type.

View File

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

View File

@ -211,7 +211,7 @@ public:
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();
}

View File

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

View File

@ -85,7 +85,7 @@ namespace CGAL {
template < class SK >
inline
typename SK::Linear_kernel::Bounded_side_3::result_type
typename SK::Bounded_side
bounded_side(const typename SK::Sphere_3 &s,
const typename SK::Circular_arc_point_3 &p) {
typedef typename SK::Algebraic_kernel Algebraic_kernel;
@ -99,7 +99,7 @@ namespace CGAL {
template < class SK >
inline
typename SK::Linear_kernel::Bounded_side
typename SK::Bounded_side
bounded_side(const typename SK::Circle_3 &c,
const typename SK::Circular_arc_point_3 &p) {
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> \
inline \
bool \
typename K::Boolean \
do_intersect(const A <K> &c1, const B <K> &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> \
inline \
bool \
typename K::Boolean \
do_intersect(const A <K> &c1, const B <K> &c2, const C <K> &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::Random_points_in_sphere_3<Point_3,Creator> Generator;
const unsigned int num = 40;
const unsigned int num = 400000;
template <class Facet_handle>
void compute_plane_equation(Facet_handle f)
@ -135,9 +135,9 @@ int main()
std::cerr << "Testing coplanar hull" << std::endl;
test_coplanar_hull();
std::cerr << "Testing 500 random points" << std::endl;
std::cerr << "Testing " << num << " random points" << std::endl;
std::vector<Point_3> points;
Generator g(500);
Generator g(1);
std::copy_n( g, num, std::back_inserter(points));
assert(points.size() == num);

View File

@ -16,9 +16,9 @@ struct My_orientation_2
typedef typename K::RT RT;
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
{
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/Interval_arithmetic.h>
#include <type_traits>
namespace CGAL {
template <class AC, class EC, class FC, class C2E, class C2F,
@ -30,81 +32,70 @@ private:
E2C From_Exact;
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:
Filtered_construction() {}
template <class A1>
result_type
operator()(const A1 &a1) const
auto 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;
try
{
return From_Filtered( Filter_construction(To_Filtered(a1)) );
return From_Filtered(Filter_construction(To_Filtered(a1)));
}
catch (Uncertain_conversion_exception&)
{}
}
Protect_FPU_rounding<!Protection> P(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>
result_type
operator()(const A1 &a1, const A2 &a2) const
auto operator()(const A1 &a1, const A2 &a2) const
-> typename std::invoke_result<AC, A1, A2>::type
{
{
Protect_FPU_rounding<Protection> P1;
try
{
return From_Filtered( Filter_construction(To_Filtered(a1),
To_Filtered(a2)) );
return From_Filtered(Filter_construction(To_Filtered(a1),
To_Filtered(a2)));
}
catch (Uncertain_conversion_exception&)
{}
}
Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST);
CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST);
return From_Exact( Exact_construction(To_Exact(a1),
To_Exact(a2)) );
return From_Exact(Exact_construction(To_Exact(a1),
To_Exact(a2)));
}
template <class A1, class A2, class A3>
result_type
operator()(const A1 &a1, const A2 &a2, const A3 &a3) const
auto 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;
try
{
return From_Filtered( Filter_construction(To_Filtered(a1),
return From_Filtered(Filter_construction(To_Filtered(a1),
To_Filtered(a2),
To_Filtered(a3)) );
To_Filtered(a3)));
}
catch (Uncertain_conversion_exception&)
{}
}
Protect_FPU_rounding<!Protection> P(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(a3)) );
To_Exact(a3)));
}
};
} //namespace CGAL
} // namespace CGAL
#endif // CGAL_FILTERED_CONSTRUCTION_H

View File

@ -34,13 +34,12 @@ template < typename K_base >
class Angle_3
: public K_base::Angle_3
{
typedef typename K_base::Angle Angle;
typedef typename K_base::Point_3 Point_3;
typedef typename K_base::Angle_3 Base;
public:
typedef typename Base::result_type result_type;
using Base::operator();
Sign sign_with_error(const double x, const double error) const {
@ -49,7 +48,7 @@ public:
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);

View File

@ -24,16 +24,16 @@ template < typename K_base >
class 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::Vector_3 Vector_3;
typedef typename K_base::Sphere_3 Sphere_3;
typedef typename K_base::Tetrahedron_3 Tetrahedron_3;
typedef typename K_base::Collinear_3 Base;
public:
typedef typename Base::result_type result_type;
result_type
Boolean
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);

View File

@ -30,17 +30,16 @@ template < typename K_base >
class Compare_distance_3
: public K_base::Compare_distance_3
{
typedef typename K_base::Comparison_result Comparison_result;
typedef typename K_base::Point_3 Point_3;
typedef typename K_base::Vector_3 Vector_3;
typedef typename K_base::Compare_distance_3 Base;
public:
typedef typename Base::result_type result_type;
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 : ") +
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
: public K_base::Compare_squared_radius_3
{
typedef typename K_base::Comparison_result Comparison_result;
typedef typename K_base::Point_3 Point_3;
typedef typename K_base::FT FT;
typedef typename K_base::Compare_squared_radius_3 Base;
public:
typedef typename Base::result_type result_type;
typedef typename K_base::Compare_squared_radius_3 Base;
public:
using Base::operator();
result_type operator() (
Comparison_result operator() (
const Point_3& p,
const Point_3& q,
const Point_3& r,
@ -185,7 +186,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
return Base::operator()(p,q,r,s,w);
}
result_type operator() (
Comparison_result operator() (
const Point_3& p,
const Point_3& q,
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
return Base::operator()(p,q,s,w);
}
result_type operator() (
Comparison_result operator() (
const Point_3& p,
const Point_3& q,
const FT& w

View File

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

View File

@ -31,17 +31,16 @@ template < typename K_base >
class Compare_x_2
: public K_base::Compare_x_2
{
typedef typename K_base::Comparison_result Comparison_result;
typedef typename K_base::Point_2 Point_2;
typedef typename K_base::Line_2 Line_2;
typedef typename K_base::Compare_x_2 Base;
public:
typedef typename Base::result_type result_type;
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 : ") +
std::string(CGAL_PRETTY_FUNCTION), tmp);

View File

@ -31,17 +31,16 @@ template < typename K_base >
class Compare_y_2
: public K_base::Compare_y_2
{
typedef typename K_base::Comparison_result Comparison_result;
typedef typename K_base::Point_2 Point_2;
typedef typename K_base::Line_2 Line_2;
typedef typename K_base::Compare_y_2 Base;
public:
typedef typename Base::result_type result_type;
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 : ") +
std::string(CGAL_PRETTY_FUNCTION), tmp);

View File

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

View File

@ -25,17 +25,14 @@ template < typename K_base, typename SFK >
class Coplanar_3
: public K_base::Coplanar_3
{
typedef typename K_base::Boolean Boolean;
typedef typename K_base::Point_3 Point_3;
typedef typename K_base::Coplanar_3 Base;
typedef typename SFK::Orientation_3 Orientation_3;
public:
typedef typename Base::result_type result_type;
result_type
Boolean
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;

View File

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

View File

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

View File

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

View File

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

View File

@ -31,17 +31,16 @@ template < typename K_base >
class 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::Vector_3 Vector_3;
typedef typename K_base::Equal_3 Base;
public:
typedef typename Base::result_type result_type;
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 : ") +
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 : ") +
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 : ") +
std::string(CGAL_PRETTY_FUNCTION), tmp);

View File

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

View File

@ -25,6 +25,7 @@ template < typename K_base >
class 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::Vector_2 Vector_2;
typedef typename K_base::Circle_2 Circle_2;
@ -32,9 +33,6 @@ class Orientation_2
typedef typename K_base::Orientation_2 Base;
public:
typedef typename Base::result_type result_type;
using Base::operator();
Orientation

View File

@ -27,18 +27,18 @@ template < typename K_base >
class 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::Vector_3 Vector_3;
typedef typename K_base::Sphere_3 Sphere_3;
typedef typename K_base::Tetrahedron_3 Tetrahedron_3;
typedef typename K_base::Orientation_3 Base;
public:
typedef typename Base::result_type result_type;
using Base::operator();
result_type
Orientation
operator()(const Point_3 &p, const Point_3 &q,
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:
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::FT FT;
typedef typename K_base::Power_side_of_oriented_power_circle_2 Base;
public:
typedef typename Base::result_type result_type;
public:
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 & r,
const Weighted_point_2 & t) const
@ -64,7 +64,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
double drx = (rx - tx);
double dry = (ry - ty);
double drz = (((square( drx ) + square( dry )) - rwt) + twt);
result_type int_tmp_result;
Oriented_side int_tmp_result;
double RT_tmp_result;
double eps;
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 & t) const
{
@ -219,7 +219,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
double upper_bound_1;
if( (cmpx != 0) )
{
result_type int_tmp_result;
Oriented_side int_tmp_result;
double RT_tmp_result;
RT_tmp_result = CGAL::determinant( dpx, dpz, dqx, dqz );
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;
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 );
lower_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

View File

@ -26,12 +26,12 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
class 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::FT FT;
typedef typename K_base::Power_side_of_oriented_power_sphere_3 Base;
public:
typedef typename Base::result_type result_type;
public:
using Base::operator();
void
@ -107,11 +107,11 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
}
result_type operator() ( const Weighted_point_3 & p,
const Weighted_point_3 & q,
const Weighted_point_3 & r,
const Weighted_point_3 & s,
const Weighted_point_3 & t) const
Oriented_side operator() (const Weighted_point_3& p,
const Weighted_point_3& q,
const Weighted_point_3& r,
const Weighted_point_3& s,
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);
@ -225,7 +225,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
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) )));
@ -253,10 +253,10 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates {
return Base::operator()(p,q,r,s,t);
}
result_type operator() ( const Weighted_point_3 & p,
const Weighted_point_3 & q,
const Weighted_point_3 & r,
const Weighted_point_3 & t) const
Oriented_side operator() (const Weighted_point_3& p,
const Weighted_point_3& q,
const Weighted_point_3& r,
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);
@ -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
return Base::operator()(p,q,r,t);
}
result_type operator() ( const Weighted_point_3 & p,
const Weighted_point_3 & q,
const Weighted_point_3 & t) const
Oriented_side operator() (const Weighted_point_3& p,
const Weighted_point_3& q,
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);
@ -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));
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));
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
return Base::operator()(p,q,t);

View File

@ -23,11 +23,11 @@ template < typename K_base >
class 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::Side_of_oriented_circle_2 Base;
public:
Oriented_side operator()(const Point_2 &p, const Point_2 &q,
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
: 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::Side_of_oriented_sphere_3 Base;
public:
Oriented_side
operator()(const Point_3 &p, const Point_3 &q, const Point_3 &r,
const Point_3 &s, const Point_3 &t) const

View File

@ -28,7 +28,7 @@ namespace CGAL {
// TODO :
// - 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
// new requirement on the kernel though...
// Could be done with a traits mechanism ?
@ -52,18 +52,13 @@ class Filtered_predicate
EP ep;
AP ap;
typedef typename AP::result_type Ares;
public:
// AP's result type must be convertible to EP's result type.
typedef AP Approximate_predicate;
typedef EP Exact_predicate;
typedef C2E To_exact_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()
{}
@ -85,11 +80,14 @@ public:
{}
template <typename... Args>
result_type
auto
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
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);
// 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)...);
if (is_certain(res))
return get_certain(res);
return result_type(get_certain(res));
}
catch (Uncertain_conversion_exception&) {}
}
@ -106,7 +104,7 @@ public:
Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST);
CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST);
#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;
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:
// Detect if the predicate's result type has been wrapped with the `Needs_FT` class
template <typename... Args>
struct Call_operator_needs_FT
{
using Actual_approx_res = decltype(ap(c2a(std::declval<const Args&>())...));
using Approx_res = std::remove_cv_t<std::remove_reference_t<Actual_approx_res> >;
enum { value = std::is_same<Approx_res, Needs_FT<Ares> >::value };
template <typename T>
struct is_Needs_FT : std::false_type { };
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,
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,
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:
// ## Important note
@ -154,10 +153,14 @@ public:
bool needs_FT(const Args&...) const { return Call_operator_needs_FT<Args...>::value; }
template <typename... Args>
result_type
auto
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
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);
// 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)...);
if (is_certain(res))
return get_certain(res);
return result_type(get_certain(res));
}
catch (Uncertain_conversion_exception&) {}
}
@ -174,7 +177,7 @@ public:
Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST);
CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST);
#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;
mutable std::optional<EP> oep;
AP ap;
typedef typename AP::result_type Ares;
public:
// AP::result_type must be convertible to EP::result_type.
typedef AP Approximate_predicate;
typedef EP Exact_predicate;
typedef C2E To_exact_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)
: c2e(), c2a(), o1(o1), oep(), ap(c2a(o1))
{}
template <typename... Args>
result_type
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>::
auto
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);
// 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)...);
if (is_certain(res))
return get_certain(res);
return result_type(get_certain(res));
}
catch (Uncertain_conversion_exception&) {}
}
CGAL_BRANCH_PROFILER_BRANCH(tmp);
Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST);
CGAL_expensive_assertion(FPU_get_cw() == CGAL_FE_TONEAREST);
#endif
if(! oep){
oep.emplace(c2e(o1));
}
return (*oep)(c2e(args)...);
}
return result_type((*oep)(c2e(args)...));
}
};
} //namespace CGAL

View File

@ -25,8 +25,6 @@ template < typename P >
struct Primitive_profiler
: public P
{
typedef typename P::result_type result_type;
// #define CGAL_KERNEL_PROFILER CGAL_PROFILER(CGAL_PRETTY_FUNCTION);
#define CGAL_KERNEL_PROFILER \
CGAL_PROFILER(typeid(static_cast<const P&>(*this)).name())
@ -35,7 +33,7 @@ struct Primitive_profiler
: P(p) {}
template <class ... A>
result_type
decltype(auto)
operator()(A&& ... a) const
{
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/Filtered_predicate.h>
#include <CGAL/Static_filtered_predicate.h>
#include <CGAL/EPIC_predicate_if_convertible.h>
#include <CGAL/Filtered_kernel.h>
#include <CGAL/Cartesian_converter.h>
#include <CGAL/Simple_cartesian.h>
@ -37,62 +37,14 @@
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
// Kernel = lazy kernel
// the Generic base simply applies the generic magic functor stupidly.
// then the real base fixes up a few special cases.
// `Lazy_kernel_generic_base` applies the generic magic functor stupidly.
// `Lazy_kernel_base` fixes up a few special cases.
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_>
// TODO : Static_filters_base too ? Check performance
{
public:
@ -127,9 +79,18 @@ public:
typedef typename Exact_kernel::Rep_tag Rep_tag;
enum { Has_filtered_predicates = true };
enum { Has_static_filters = false };
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
typedef CGAL::Lazy_exact_nt<typename Exact_kernel::FT> FT;
typedef FT RT;
@ -168,115 +129,26 @@ public:
typedef CGAL::Aff_transformationC2<Kernel> Aff_transformation_2;
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:
#ifdef CGAL_NO_STATIC_FILTERS_FOR_LAZY_KERNEL
#define CGAL_Kernel_pred(P, Pf) \
typedef Filtered_predicate<typename Exact_kernel::P, typename Approximate_kernel::P, C2E, C2F> P; \
P Pf() const { return P(); }
#else
// - the first template parameter is because either it fits in a double, or not, so
// 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 Static_filtered_predicate<Approximate_kernel, Filtered_predicate<typename Exact_kernel::P, typename Approximate_kernel::P, C2E, C2F>, Exact_predicates_inexact_constructions_kernel::P> P; \
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(); }
#endif
#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(); }
#include <CGAL/Kernel/interface_macros.h>
@ -287,11 +159,6 @@ public:
struct Handle { typedef T type; };
};
template < typename EK_, typename AK_, typename E2A_, typename Kernel_ >
class Lazy_kernel_base
: public Lazy_kernel_generic_base<EK_, AK_, E2A_, Kernel_>
@ -308,18 +175,16 @@ public:
typedef CommonKernelFunctors::Assign_2<Kernel> Assign_2;
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_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_area_3<Kernel> Compute_approximate_area_3;
// typedef void Compute_z_3; // to detect where .z() is called
// typedef void Construct_point_3; // to detect where the ctor is called
typedef CGAL::Lazy_construction_optional_for_polyhedral_envelope<
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
{
@ -552,7 +417,6 @@ public:
};
struct Less_xyz_3 : public BaseClass::Less_xyz_3
{
typedef typename Kernel_::Point_3 Point_3;
@ -593,14 +457,6 @@ public:
assign_3_object() const
{ 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_object() const
{ return Construct_cartesian_const_iterator_2(); }
@ -617,6 +473,10 @@ public:
compute_approximate_area_3_object() const
{ 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_object() const
{ 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>
opposite() const;
Oriented_side
typename R_::Oriented_side
oriented_side(const Point_2& ) const;
Bounded_side
typename R_::Bounded_side
bounded_side(const Point_2& ) const;
bool operator==( const CircleH2<R>& ) const;
bool operator!=( const CircleH2<R>& ) const;
bool has_on_positive_side(const Point_2& ) const;
bool has_on_negative_side(const Point_2& ) const;
bool has_on_boundary( const Point_2& ) const;
bool has_on_bounded_side( const Point_2& ) const;
bool has_on_unbounded_side(const Point_2&) const;
bool is_degenerate() const;
typename R_::Boolean has_on_positive_side(const Point_2& ) const;
typename R_::Boolean has_on_negative_side(const Point_2& ) const;
typename R_::Boolean has_on_boundary( const Point_2& ) const;
typename R_::Boolean has_on_bounded_side( const Point_2& ) const;
typename R_::Boolean has_on_unbounded_side(const Point_2&) const;
typename R_::Boolean is_degenerate() const;
// bool oriented_equal( const CircleH2<R>& ) const;
// bool unoriented_equal( const CircleH2<R>& ) const;
@ -133,17 +133,15 @@ CircleH2<R>::orientation() const
template <class R>
CGAL_KERNEL_INLINE
Oriented_side
typename R::Oriented_side
CircleH2<R>::oriented_side( const typename CircleH2<R>::Point_2& p) const
{
FT sq_dist = squared_distance( p, center() );
FT sq_rad = squared_radius();
Comparison_result vgl = CGAL_NTS compare( sq_dist, sq_rad );
Oriented_side rel_pos = (vgl == LARGER ) ?
ON_NEGATIVE_SIDE :
( (vgl == SMALLER ) ?
ON_POSITIVE_SIDE :
ON_ORIENTED_BOUNDARY);
const FT& sq_rad = squared_radius();
typename R::Comparison_result vgl = CGAL_NTS compare( sq_dist, sq_rad );
typename R::Oriented_side rel_pos = (vgl == LARGER ) ? ON_NEGATIVE_SIDE
: ((vgl == SMALLER) ? ON_POSITIVE_SIDE
: ON_ORIENTED_BOUNDARY);
if (orientation() == POSITIVE)
{ return rel_pos; }
else // NEGATIVE
@ -152,7 +150,7 @@ CircleH2<R>::oriented_side( const typename CircleH2<R>::Point_2& p) const
template <class R>
CGAL_KERNEL_INLINE
bool
typename R::Boolean
CircleH2<R>::has_on_positive_side(const typename CircleH2<R>::Point_2& p) const
{
if ( orientation() == POSITIVE )
@ -163,7 +161,7 @@ CircleH2<R>::has_on_positive_side(const typename CircleH2<R>::Point_2& p) const
template <class R>
CGAL_KERNEL_INLINE
bool
typename R::Boolean
CircleH2<R>::has_on_boundary(const typename CircleH2<R>::Point_2& p) const
{
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>
CGAL_KERNEL_INLINE
bool
typename R::Boolean
CircleH2<R>::has_on_negative_side( const typename CircleH2<R>::Point_2&p) const
{
if ( orientation() == NEGATIVE )
@ -188,12 +186,12 @@ CircleH2<R>::has_on_negative_side( const typename CircleH2<R>::Point_2&p) const
template <class R>
CGAL_KERNEL_INLINE
Bounded_side
typename R::Bounded_side
CircleH2<R>::bounded_side(const typename CircleH2<R>::Point_2& p) const
{
FT sq_dist = squared_distance( p, center() );
FT sq_rad = squared_radius();
Comparison_result vgl = CGAL_NTS compare( sq_dist, sq_rad );
const FT& sq_rad = squared_radius();
typename R::Comparison_result vgl = CGAL_NTS compare( sq_dist, sq_rad );
return (vgl == LARGER ) ? ON_UNBOUNDED_SIDE :
( (vgl == SMALLER ) ?
ON_BOUNDED_SIDE :
@ -202,33 +200,33 @@ CircleH2<R>::bounded_side(const typename CircleH2<R>::Point_2& p) const
template <class R>
CGAL_KERNEL_INLINE
bool
typename R::Boolean
CircleH2<R>::has_on_bounded_side(const typename CircleH2<R>::Point_2& p) const
{
FT sq_dist = squared_distance( p, center() );
FT sq_rad = squared_radius();
const FT& sq_rad = squared_radius();
return ( sq_dist < sq_rad );
}
template <class R>
CGAL_KERNEL_INLINE
bool
typename R::Boolean
CircleH2<R>::has_on_unbounded_side(const typename CircleH2<R>::Point_2&p) const
{
FT sq_dist = squared_distance( p, center() );
FT sq_rad = squared_radius();
const FT& sq_rad = squared_radius();
return ( sq_rad < sq_dist );
}
template <class R>
inline
bool
typename R::Boolean
CircleH2<R>::is_degenerate() const
{ return ( squared_radius() == FT(0) ); }
template <class R>
CGAL_KERNEL_INLINE
bool
typename R::Boolean
CircleH2<R>::operator==(const CircleH2<R>& c) const
{
return ( center() == c.center() )
@ -238,7 +236,7 @@ CircleH2<R>::operator==(const CircleH2<R>& c) const
template <class R>
inline
bool
typename R::Boolean
CircleH2<R>::operator!=(const CircleH2<R>& c) const
{ return !(*this == c); }

View File

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

View File

@ -66,10 +66,10 @@ public:
: base( w >= RT(0) ? CGAL::make_array(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;
bool operator!=( const DirectionH3<R>& d) const;
typename R::Boolean operator==( const DirectionH3<R>& d) const;
typename R::Boolean operator!=( const DirectionH3<R>& d) const;
Vector_3 to_vector() const;
Vector_3 vector() const { return to_vector(); }
@ -87,7 +87,7 @@ public:
template <class R >
CGAL_KERNEL_INLINE
bool
typename R::Boolean
DirectionH3<R>::operator==( const DirectionH3<R>& d) const
{
return ( ( hx()*d.hy() == hy()*d.hx() )
@ -100,13 +100,13 @@ DirectionH3<R>::operator==( const DirectionH3<R>& d) const
template <class R >
inline
bool
typename R::Boolean
DirectionH3<R>::operator!=( const DirectionH3<R>& d) const
{ return !operator==(d); }
template <class R >
CGAL_KERNEL_INLINE
bool
typename R::Boolean
DirectionH3<R>::is_degenerate() const
{ 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,
const RT& max_hx, const RT& max_hy, const RT& max_hz);
bool 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;
typename R::Boolean operator!=(const Iso_cuboidH3<R>& s) const;
const Point_3 & min BOOST_PREVENT_MACRO_SUBSTITUTION () const;
const Point_3 & max BOOST_PREVENT_MACRO_SUBSTITUTION () const;
Point_3 vertex(int i) const;
Point_3 operator[](int i) const;
Iso_cuboidH3<R>
transform(const Aff_transformation_3& t) const;
Bounded_side
bounded_side(const Point_3& p) const;
bool has_on(const Point_3& p) const;
bool has_on_boundary(const Point_3& p) const;
bool has_on_bounded_side(const Point_3& p) const;
bool has_on_unbounded_side(const Point_3& p) const;
bool is_degenerate() const;
Iso_cuboidH3<R> transform(const Aff_transformation_3& t) const;
typename R::Bounded_side bounded_side(const Point_3& p) const;
typename R::Boolean has_on(const Point_3& p) const;
typename R::Boolean has_on_boundary(const Point_3& p) const;
typename R::Boolean has_on_bounded_side(const Point_3& p) const;
typename R::Boolean has_on_unbounded_side(const Point_3& p) const;
typename R::Boolean is_degenerate() const;
FT xmin() const;
FT ymin() 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 >
CGAL_KERNEL_INLINE
bool
typename R::Boolean
Iso_cuboidH3<R>::
operator==(const Iso_cuboidH3<R>& r) const
{ return ((this->min)() == (r.min)()) && ((this->max)() == (r.max)()); }
template < class R >
inline
bool
typename R::Boolean
Iso_cuboidH3<R>::
operator!=(const Iso_cuboidH3<R>& r) const
{ return !(*this == r); }
@ -313,7 +311,7 @@ Iso_cuboidH3<R>::operator[](int i) const
template < class R >
CGAL_KERNEL_MEDIUM_INLINE
Bounded_side
typename R::Bounded_side
Iso_cuboidH3<R>::
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 >
inline
bool
typename R::Boolean
Iso_cuboidH3<R>::
has_on_boundary(const typename Iso_cuboidH3<R>::Point_3& p) const
{ return ( bounded_side(p) == ON_BOUNDARY ); }
template < class R >
inline
bool
typename R::Boolean
Iso_cuboidH3<R>::has_on(const typename Iso_cuboidH3<R>::Point_3& p) const
{ return ( bounded_side(p) == ON_BOUNDARY ); }
template < class R >
inline
bool
typename R::Boolean
Iso_cuboidH3<R>::
has_on_bounded_side(const typename Iso_cuboidH3<R>::Point_3& p) const
{ return ( bounded_side(p) == ON_BOUNDED_SIDE ); }
template < class R >
CGAL_KERNEL_INLINE
bool
typename R::Boolean
Iso_cuboidH3<R>::
has_on_unbounded_side(const typename Iso_cuboidH3<R>::Point_3& p) const
{ return ( bounded_side(p) == ON_UNBOUNDED_SIDE ); }
template < class R >
CGAL_KERNEL_INLINE
bool
typename R::Boolean
Iso_cuboidH3<R>::is_degenerate() const
{
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 & 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 >
CGAL_KERNEL_INLINE
Bounded_side
typename R::Bounded_side
Iso_rectangleH2<R>::
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)
: base{a, b, c} {}
bool operator==(const LineH2<R>& l) const;
bool operator!=(const LineH2<R>& l) const;
typename R_::Boolean 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 & b() const { return get_pointee_or_identity(base)[1]; }
@ -58,7 +58,7 @@ public:
template < class R >
CGAL_KERNEL_MEDIUM_INLINE
bool
typename R::Boolean
LineH2<R>::operator==(const LineH2<R>& l) const
{
if ( (a() * l.c() != l.a() * c() )
@ -83,7 +83,7 @@ LineH2<R>::operator==(const LineH2<R>& l) const
template < class R >
inline
bool
typename R::Boolean
LineH2<R>::operator!=(const LineH2<R>& l) const
{ return !(*this == l); }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -24,7 +24,7 @@ namespace CGAL {
template < class R>
CGAL_KERNEL_INLINE
bool
typename R::Boolean
equal_xy(const PointH2<R>& p,
const PointH2<R>& q)
{
@ -39,7 +39,7 @@ equal_xy(const PointH2<R>& p,
template <class R>
CGAL_KERNEL_MEDIUM_INLINE
Oriented_side
typename R::Oriented_side
_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 )
@ -53,7 +53,7 @@ _where_wrt_L_wedge( const PointH2<R>& p, const PointH2<R>& q )
}
template <class RT>
Comparison_result
typename Compare<RT>::result_type
compare_power_distanceH2(const RT& phx, const RT& phy, const RT& phw,
const Quotient<RT>& pwt,
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>
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,
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,
@ -129,7 +129,7 @@ power_testH2( const RT &phx, const RT &phy, const RT &phw, const Quotient<RT> &p
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,
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)
@ -180,7 +180,7 @@ power_testH2( const RT &phx, const RT &phy, const RT &phw, const Quotient<RT> &p
// Unused, undocumented, un-functorized.
template < class R >
CGAL_KERNEL_MEDIUM_INLINE
Comparison_result
typename R::Comparison_result
compare_deltax_deltay(const PointH2<R>& p,
const PointH2<R>& q,
const PointH2<R>& r,

View File

@ -25,7 +25,8 @@ namespace CGAL {
template < class R >
CGAL_KERNEL_MEDIUM_INLINE
bool lexicographically_xy_smaller(const PointH3<R> &p,
typename R::Boolean
lexicographically_xy_smaller(const PointH3<R> &p,
const PointH3<R> &q)
{
typedef typename R::RT RT;
@ -51,7 +52,7 @@ bool lexicographically_xy_smaller(const PointH3<R> &p,
template < class R>
CGAL_KERNEL_MEDIUM_INLINE
Comparison_result
typename R::Comparison_result
compare_xy(const PointH3<R>& p, const PointH3<R>& q)
{
typedef typename R::RT RT;
@ -82,7 +83,7 @@ compare_xy(const PointH3<R>& p, const PointH3<R>& q)
template < class R >
CGAL_KERNEL_INLINE
bool
typename R::Boolean
equal_xy(const PointH3<R> &p, const PointH3<R> &q)
{
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 > // ??? -> ==
CGAL_KERNEL_INLINE
bool
typename R::Boolean
equal_xyz(const PointH3<R> &p, const PointH3<R> &q)
{
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 >
CGAL_KERNEL_INLINE
bool
typename R::Boolean
less_x(const PointH3<R> &p, const PointH3<R> &q)
{ return (p.hx() * q.hw() < q.hx() * p.hw() ); }
template < class R >
CGAL_KERNEL_INLINE
bool
typename R::Boolean
less_y(const PointH3<R> &p, const PointH3<R> &q)
{ return (p.hy() * q.hw() < q.hy() * p.hw() ); }
template < class R >
CGAL_KERNEL_INLINE
bool
typename R::Boolean
less_z(const PointH3<R> &p, const PointH3<R> &q)
{ return (p.hz() * q.hw() < q.hz() * p.hw() ); }
template <class RT>
Oriented_side
typename Same_uncertainty_nt<Oriented_side, RT>::type
power_side_of_oriented_power_sphereH3(
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,

View File

@ -225,11 +225,9 @@ class Side_of_oriented_hyperbolic_segment_2
typedef typename Traits::Construct_weighted_circumcenter_2 Construct_weighted_circumcenter_2;
public:
typedef Oriented_side result_type;
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& query) const
{

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> >
{
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,
const typename K::Line_3& l)

View File

@ -4338,7 +4338,7 @@ public:
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.
\pre The three points are not collinear.
*/
@ -7600,7 +7600,7 @@ public:
and also for `Type1` and `Type2` of respective types
- `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`.
*/

View File

@ -8,9 +8,8 @@ class MyConstruct_point_2
typedef typename K::Point_2 Point_2;
typedef typename K::Line_2 Line_2;
typedef typename Point_2::Rep Rep;
public:
typedef Point_2 result_type;
public:
// Note : the CGAL::Return_base_tag is really internal CGAL stuff.
// Unfortunately it is needed for optimizing away copy-constructions,
// 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;
struct Intersection_visitor {
typedef void result_type;
void operator()(const Point_2& p) const
{
std::cout << p << std::endl;

View File

@ -102,7 +102,8 @@ public:
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
// of circles, are all yucky.
@ -177,18 +178,6 @@ public:
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
{
return t.transform(*this);

View File

@ -101,14 +101,14 @@ public:
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)
@ -122,7 +122,7 @@ public:
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);
}
@ -152,16 +152,7 @@ public:
template < typename R >
inline
bool
operator==(const Circle_3<R> &p,
const Circle_3<R> &q)
{
return R().equal_3_object()(p, q);
}
template < typename R >
inline
bool
typename R::Boolean
operator!=(const Circle_3<R> &p,
const Circle_3<R> &q)
{

View File

@ -156,18 +156,6 @@ public:
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
{
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_>
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_::FT FT;
typedef typename R_::Point_3 Point_3;
@ -173,25 +175,25 @@ public:
return zmax();
}
bool
typename R::Boolean
has_on_bounded_side(const Point_3 &p) const
{
return R().has_on_bounded_side_3_object()(*this,p);
}
bool
Boolean
has_on_unbounded_side(const Point_3 &p) const
{
return R().has_on_unbounded_side_3_object()(*this,p);
}
bool
Boolean
has_on_boundary(const Point_3 &p) const
{
return R().has_on_boundary_3_object()(*this,p);
}
bool
Boolean
has_on(const Point_3 &p) const
{
return has_on_boundary(p);
@ -203,7 +205,7 @@ public:
return R().bounded_side_3_object()(*this,p);
}
bool
Boolean
is_degenerate() const
{
return R().is_degenerate_3_object()(*this);

View File

@ -27,6 +27,8 @@ namespace CGAL {
template <class R_>
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_::FT FT;
typedef typename R_::Point_2 Point_2;
@ -94,19 +96,6 @@ public:
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)
vertex(int i) const
{
@ -169,22 +158,19 @@ public:
return R().compute_area_2_object()(*this);
}
bool
Boolean
has_on_boundary(const Point_2 &p) const
{
return R().has_on_boundary_2_object()(*this,p);
}
bool
Boolean
has_on_bounded_side(const Point_2 &p) const
{
return R().has_on_bounded_side_2_object()(*this,p);
}
bool
Boolean
has_on_unbounded_side(const Point_2 &p) const
{
return R().has_on_unbounded_side_2_object()(*this,p);
@ -196,8 +182,7 @@ public:
return R().bounded_side_2_object()(*this,p);
}
bool
Boolean
is_degenerate() const
{
return R().is_degenerate_2_object()(*this);

View File

@ -19,62 +19,25 @@
#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 {
template < typename T, typename K1, typename K2 >
struct Type_mapper;
namespace internal {
// the default implementation is required to catch the odd one-out
// object like Bbox
template<typename T, typename K1, typename K2 >
template < typename T, typename K1, typename K2, typename = void > // last tparam is for SFINAE
struct Type_mapper_impl {
typedef T type;
};
template < typename T, typename K1, typename K2 >
struct Type_mapper_impl<std::vector< T >, K1, K2 > {
typedef std::vector< typename Type_mapper_impl<T, K1, K2>::type > type;
template < typename K1, typename K2>
struct Type_mapper_impl<K1, K1, K2> {
typedef K2 type;
};
template < typename T, typename K1, typename K2 >
struct Type_mapper_impl<std::optional<T>, K1, K2 > {
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
// 'Rep' gets a weird partial specialization because of Return_base_tag shenanigans.
// See https://github.com/CGAL/cgal/issues/3035#issuecomment-428721414
#define CGAL_Kernel_obj(X) \
template < typename K1, typename 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 >
{ 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
// This is a tool to obtain the K2::Point_2 from K1 and K1::Point_2.
// Similarly for other kernel types.
// TODO : add more specializations ? Use a different mechanism ?
// This is a tool to obtain e.g. K2::Point_2 from K1 and K1::Point_2.
template < typename T, typename K1, typename K2 >
struct Type_mapper :
internal::Type_mapper_impl< std::remove_cv_t<
std::remove_reference_t< T >
>, K1, K2 >
struct Type_mapper
: internal::Type_mapper_impl<CGAL::cpp20::remove_cvref_t<T>, K1, K2 >
{ };
} //namespace CGAL
} // namespace CGAL
#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>
inline
Comparison_result
typename Kernel_traits<T1>::Kernel::Comparison_result
compare_distance(const T1 &o1,
const T2 &o2,
const T3 &o3)
@ -39,7 +39,7 @@ compare_distance(const T1 &o1,
template <class T1, class T2, class T3, class T4>
inline
Comparison_result
typename Kernel_traits<T1>::Kernel::Comparison_result
compare_distance(const T1 &o1,
const T2 &o2,
const T3 &o3,
@ -51,7 +51,7 @@ compare_distance(const T1 &o1,
template <typename O>
inline
bool
typename Kernel_traits<O>::Kernel::Boolean
parallel(const O &o1, const O &o2)
{
typedef typename Kernel_traits<O>::Kernel K;

View File

@ -28,23 +28,9 @@
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 >
inline
Angle
typename K::Angle
angle(const Vector_2<K> &u,
const Vector_2<K> &v)
{
@ -53,7 +39,7 @@ angle(const Vector_2<K> &u,
template < class K >
inline
Angle
typename K::Angle
angle(const Point_2<K> &p,
const Point_2<K> &q,
const Point_2<K> &r)
@ -63,7 +49,7 @@ angle(const Point_2<K> &p,
template < class K >
inline
Angle
typename K::Angle
angle(const Point_2<K> &p,
const Point_2<K> &q,
const Point_2<K> &r,
@ -764,7 +750,9 @@ midpoint(const Point_2<K> &p, const Point_2<K> &q)
}
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());
}
@ -787,6 +775,264 @@ min_vertex(const Iso_rectangle_2<K> &ir)
// FIXME TODO : What do we do with the operators ?
// 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 >
inline
typename K::Boolean
@ -811,24 +1057,6 @@ typename K::Boolean
operator<=(const Direction_2<K>& d1, const Direction_2<K>& d2)
{ 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 >
inline
typename K::Boolean
@ -847,18 +1075,6 @@ 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 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::Vector_2

View File

@ -28,7 +28,7 @@ namespace CGAL {
template <typename K>
inline
Angle
typename K::Angle
angle(const Vector_3<K> &u, const Vector_3<K> &v)
{
return internal::angle(u, v, K());
@ -36,7 +36,7 @@ angle(const Vector_3<K> &u, const Vector_3<K> &v)
template <typename K>
inline
Angle
typename K::Angle
angle(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r)
{
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>
inline
Angle
typename K::Angle
angle(const Point_3<K> &p, const Point_3<K> &q,
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>
inline
Angle
typename K::Angle
angle(const Point_3<K> &p, const Point_3<K> &q,
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 >
inline
Point_3<K>
typename K::Point_3
centroid(const Point_3<K> &p, const Point_3<K> &q,
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 >
inline
Point_3<K>
typename K::Point_3
centroid(const Point_3<K> &p, const Point_3<K> &q, const Point_3<K> &r)
{
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 >
inline
Point_3<K>
typename K::Point_3
centroid(const Tetrahedron_3<K> &t)
{
return internal::centroid(t, K());
@ -231,7 +231,7 @@ centroid(const Tetrahedron_3<K> &t)
template < class K >
inline
Point_3<K>
typename K::Point_3
centroid(const Triangle_3<K> &t)
{
return internal::centroid(t, K());
@ -804,12 +804,80 @@ typename K::Boolean
operator==(const Point_3<K>& p, const Origin& 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 >
inline
typename K::Boolean
operator!=(const Point_3<K>& p, const Origin& 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 >
inline
typename K::Boolean
@ -939,8 +1007,20 @@ operator==(const Vector_3<K>& p, const Null_vector& o)
template < class K >
inline
typename K::Boolean
operator!=(const Vector_3<K>& p, const Null_vector& o)
{ return ! (p == o); }
operator==(const Null_vector& o, const Vector_3<K>& v)
{ 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 >
@ -967,6 +1047,12 @@ typename K::Boolean
operator>=(const Point_3<K>& p, const Point_3<K>& 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 >
inline
typename K::Vector_3

View File

@ -91,9 +91,11 @@ template <class R,int dim>
class Construct_bbox_projected_2 {
public:
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>
@ -177,17 +179,19 @@ public:
template <class R,int dim>
class Side_of_bounded_circle_projected_3
{
public:
typedef typename R::Bounded_side Bounded_side;
typedef typename R::Point_3 Point;
public:
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::Point_2 project(const Point& p) const
{
return typename R::Point_2(x(p),y(p));
}
CGAL::Bounded_side operator() (const Point &p,
Bounded_side operator()(const Point &p,
const Point &q,
const Point &r,
const Point &s) const
@ -195,7 +199,7 @@ public:
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 &r) const
{
@ -207,9 +211,11 @@ template <class R,int dim>
class Compare_distance_projected_3
{
public:
typedef typename R::Comparison_result Comparison_result;
typedef typename R::Point_3 Point_3;
typedef typename R::Point_2 Point_2;
typedef typename R::FT RT;
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); }
@ -255,19 +261,20 @@ template <class R, int dim>
class Compare_signed_distance_to_line_projected_3
{
public:
typedef typename R::Comparison_result Comparison_result;
typedef typename R::Point_3 Point_3;
typedef typename R::Point_2 Point_2;
typedef typename R::FT RT;
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); }
typedef typename R::Comparison_result result_type;
Point_2 project(const Point_3& p) const
{
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& r,
const Point_3& s) const
@ -281,19 +288,20 @@ template <class R, int dim>
class Less_signed_distance_to_line_projected_3
{
public:
typedef typename R::Boolean Boolean;
typedef typename R::Point_3 Point_3;
typedef typename R::Point_2 Point_2;
typedef typename R::FT RT;
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); }
typedef typename R::Boolean result_type;
Point_2 project(const Point_3& p) const
{
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& r,
const Point_3& s) const
@ -314,6 +322,7 @@ public:
typedef typename R::Segment_3 Segment_3;
typedef typename R::Segment_2 Segment_2;
typedef typename R::FT RT;
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); }
@ -598,8 +607,6 @@ class Compute_squared_length_projected_3
typedef typename R::Vector_3 Vector_3;
typedef typename R::FT FT;
typedef FT result_type;
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); }
@ -634,6 +641,7 @@ template <class R, int dim>
class Compare_power_distance_projected_3
{
public:
typedef typename R::Comparison_result Comparison_result;
typedef typename R::Point_2 Point_2;
typedef typename R::Weighted_point_2 Weighted_point_2;
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
{
public:
typedef typename R::Bounded_side Bounded_side;
typedef typename R::Point_2 Point_2;
typedef typename R::Weighted_point_2 Weighted_point_2;
typedef typename R::Point_3 Point_3;
@ -830,7 +839,7 @@ public:
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 &wr,
const Weighted_point_3 &ws) const
@ -839,14 +848,14 @@ public:
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 &wr) const
{
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
{
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;
struct Less_xy_2 {
typedef typename R::Boolean result_type;
bool operator()(const Point_2& p, const Point_2& q) const
typedef typename R::Comparison_result Comparison_result;
typedef typename R::Boolean Boolean;
Boolean operator()(const Point_2& p, const Point_2& q) const
{
Compare_x_2 cx;
Comparison_result crx = cx(p,q);
@ -988,8 +999,8 @@ public:
struct Less_yx_2 {
typedef typename R::Boolean result_type;
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_y_2 cy;
Comparison_result cry = cy(p,q);
@ -1001,8 +1012,8 @@ public:
};
struct Equal_2 {
typedef typename R::Boolean result_type;
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
{
Equal_x_2 eqx;
@ -1012,8 +1023,8 @@ public:
};
struct Left_turn_2 {
typedef typename R::Boolean result_type;
bool operator()(const Point_2& p, const Point_2& q, const Point_2& r) const
typedef typename R::Boolean Boolean;
Boolean operator()(const Point_2& p, const Point_2& q, const Point_2& r) const
{
Orientation_2 ori;
@ -1022,7 +1033,7 @@ public:
};
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
{
Orientation_2 ori;

View File

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

View File

@ -223,19 +223,6 @@ public:
{
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