Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not rely on result_type definitions in kernels #8586

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ee451ed
Fix dangling reference in Construct_center_3(Circle_3)
MaelRL Nov 2, 2024
dd2fca2
Actually test the full EPECK family
MaelRL Nov 3, 2024
425fe50
Add missing tests for filtered Cartesian kernels
MaelRL Nov 3, 2024
69c9aba
Remove obsolete debug cout
MaelRL Nov 3, 2024
b32491a
Revert sidechange
MaelRL Nov 3, 2024
181ccd2
More instances of result_type --> dcltype(auto)
MaelRL Nov 6, 2024
b02776b
Remove wrong result_type (WIP: does not compile anymore)
MaelRL Nov 6, 2024
0d452b7
Remove extra parenthesis
MaelRL Nov 12, 2024
dcb38f3
Fix broken doc link
MaelRL Nov 12, 2024
a052572
Remove unused functor
MaelRL Dec 12, 2024
ea9c2a3
Remove unused functors
MaelRL Dec 12, 2024
8524c6a
Remove unused functors
MaelRL Dec 12, 2024
abc4fe6
Remove unused Lazy_rep objects
MaelRL Dec 17, 2024
db1fa6d
Factorize Lazy_construction_object into a single operator()
MaelRL Dec 17, 2024
7f1e16d
Factorize operator()s of Lazy_construction_variant
MaelRL Dec 17, 2024
4783005
Remove unused functor
MaelRL Dec 17, 2024
9188e8a
Fix name: polygonal_envelope > polyhedral_envelope
MaelRL Dec 17, 2024
9d10860
Use a single Lazy_construction class
MaelRL Dec 18, 2024
7b6755f
Remove code that was used to filter between different lazy constructions
MaelRL Dec 18, 2024
778ae1b
Remove unused class
MaelRL Dec 20, 2024
9c9892c
Use variadic functions in Static_filtered_predicate
MaelRL Dec 20, 2024
6b1e666
Remove superfluous code in Lazy_construction
MaelRL Dec 20, 2024
e534750
Fix but don't fix broken Has_static_filters for EPECK
MaelRL Dec 20, 2024
a886420
Misc cleaning
MaelRL Dec 20, 2024
468dde7
Use a clearer name than "Static_filtered_predicate" for EPECK static …
MaelRL Dec 20, 2024
4d4549c
Get rid of result_type in Kernels + fix some bad return types (wip)
MaelRL Dec 20, 2024
9c517a4
Fix bad return types
MaelRL Dec 20, 2024
c22fada
Do not rely on the predicate providing result_type in Filtered_predicate
MaelRL Dec 20, 2024
7b6886e
Misc cleaning
MaelRL Dec 20, 2024
7b160e3
Template the Uncertain enum_cast overload with Uncertain, not base enum
MaelRL Dec 29, 2024
c85b388
Update test for enum_cast<Uncertain>
MaelRL Dec 29, 2024
040f965
Fix include filename
MaelRL Dec 29, 2024
f26f41c
Minor CH3 test improvement
MaelRL Dec 29, 2024
b7de40a
Update enum_cast<Uncertain> calls to new API
MaelRL Jan 8, 2025
b8830ca
Remove superfluous precision
MaelRL Jan 8, 2025
8c95fcc
Update Filtered_predicate_with_state not to rely on a 'result_type' t…
MaelRL Jan 8, 2025
d02e817
Get rid of result types in function objects of Circular_kernel_23
MaelRL Jan 8, 2025
981e68c
Fix using non-existant has_on_2 API
MaelRL Jan 8, 2025
30064c1
Do not return const values
MaelRL Jan 8, 2025
2f82508
Use the kernel's Boolean and enums
MaelRL Jan 16, 2025
604103d
Regroup definitions of operator<=> for kernel objects + add missing
MaelRL Jan 16, 2025
e4c0bf1
Use const& for data member
MaelRL Jan 16, 2025
98201c6
Point_3 is no different from other kernel objects
MaelRL Jan 16, 2025
1e46c44
Enable some disabled tests: operator==(Origin, Point_x) now exists
MaelRL Jan 16, 2025
d2f6836
Use CGAL_AND
MaelRL Jan 16, 2025
3b7a4ed
Merge remote-tracking branch 'cgal/master' into Kernel_23-Fix_danglin…
MaelRL Jan 16, 2025
06f862e
Misc post-merge fixes
MaelRL Jan 17, 2025
2f84ba4
Fix compilation
MaelRL Jan 17, 2025
d3e7014
Merge remote-tracking branch 'cgal/master' into Kernel_23-Fix_danglin…
MaelRL Jan 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions Cartesian_kernel/include/CGAL/Cartesian/Circle_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -49,8 +50,8 @@ class CircleC2
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
{
Expand All @@ -69,6 +70,25 @@ class CircleC2

};

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
35 changes: 17 additions & 18 deletions Cartesian_kernel/include/CGAL/Cartesian/Circle_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -130,12 +132,12 @@ class CircleC3 {
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();
}
Expand All @@ -155,7 +157,7 @@ class CircleC3 {
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();
}
Expand Down Expand Up @@ -200,15 +202,15 @@ class CircleC3 {
(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();
}
Expand All @@ -217,7 +219,7 @@ class CircleC3 {

template < class R >
inline
bool
typename R::Boolean
CircleC3<R>::
has_on(const typename CircleC3<R>::Point_3 &p) const
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand All @@ -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))
Expand All @@ -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);
Expand Down
10 changes: 6 additions & 4 deletions Cartesian_kernel/include/CGAL/Cartesian/Direction_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -49,8 +51,8 @@ class DirectionC2
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;

Expand All @@ -66,7 +68,7 @@ class DirectionC2

template < class R >
inline
bool
typename R::Boolean
DirectionC2<R>::operator==(const DirectionC2<R> &d) const
{
if (CGAL::identical(base, d.base))
Expand All @@ -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 );
Expand Down
18 changes: 10 additions & 8 deletions Cartesian_kernel/include/CGAL/Cartesian/Iso_cuboid_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -98,8 +100,8 @@ class Iso_cuboidC3
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
{
Expand All @@ -118,11 +120,11 @@ class Iso_cuboidC3
}

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;
Expand Down Expand Up @@ -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
{
Expand Down
17 changes: 9 additions & 8 deletions Cartesian_kernel/include/CGAL/Cartesian/Line_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -65,8 +66,8 @@ class LineC3
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;
Expand All @@ -88,13 +89,13 @@ class LineC3

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))
Expand All @@ -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);
Expand Down Expand Up @@ -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
{
Expand All @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions Cartesian_kernel/include/CGAL/Cartesian/Point_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ class PointC3
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();
Expand Down
21 changes: 11 additions & 10 deletions Cartesian_kernel/include/CGAL/Cartesian/Segment_3.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -44,11 +45,11 @@ class SegmentC3
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
{
Expand All @@ -73,12 +74,12 @@ class SegmentC3
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))
Expand All @@ -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);
Expand Down Expand Up @@ -184,15 +185,15 @@ SegmentC3<R>::opposite() const

template < class R >
inline
bool
typename R::Boolean
SegmentC3<R>::is_degenerate() const
{
return source() == target();
}

template < class R >
inline
bool
typename R::Boolean
SegmentC3<R>::
has_on(const typename SegmentC3<R>::Point_3 &p) const
{
Expand All @@ -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
{
Expand Down
Loading
Loading