The free function must call the functor

This commit is contained in:
Andreas Fabri
2021-04-22 17:35:27 +01:00
parent 6e4be92b5e
commit d3b26a60cb
8 changed files with 93 additions and 2 deletions
@@ -2741,6 +2741,7 @@ namespace CartesianKernelFunctors {
{
typedef typename K::FT FT;
typedef typename K::Point_2 Point_2;
typedef typename K::Segment_2 Segment_2;
public:
typedef Point_2 result_type;
@@ -2752,6 +2753,17 @@ namespace CartesianKernelFunctors {
midpointC2(p.x(), p.y(), q.x(), q.y(), x, y);
return construct_point_2(x, y);
}
Point_2
operator()(const Segment_2& s) const
{
typename K::Construct_point_2 construct_point_2;
FT x, y;
const Point_2& p = s.source();
const Point_2& q = s.target();
midpointC2(p.x(), p.y(), q.x(), q.y(), x, y);
return construct_point_2(x, y);
}
};
template <typename K>
@@ -2759,6 +2771,7 @@ namespace CartesianKernelFunctors {
{
typedef typename K::FT FT;
typedef typename K::Point_3 Point_3;
typedef typename K::Segment_3 Segment_3;
public:
typedef Point_3 result_type;
@@ -2770,6 +2783,17 @@ namespace CartesianKernelFunctors {
midpointC3(p.x(), p.y(), p.z(), q.x(), q.y(), q.z(), x, y, z);
return construct_point_3(x, y, z);
}
Point_3
operator()(const Segment_3& s) const
{
const Point_3& p = s.source();
const Point_3& q = s.target();
typename K::Construct_point_3 construct_point_3;
FT x, y, z;
midpointC3(p.x(), p.y(), p.z(), q.x(), q.y(), q.z(), x, y, z);
return construct_point_3(x, y, z);
}
};
template <typename K>