diff --git a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h index ab740590345..d5e6aab5919 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/function_objects.h @@ -36,20 +36,20 @@ namespace CartesianKernelFunctors { template class Angle_2 { + typedef typename K::Angle Angle; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; - public: - typedef typename K::Angle result_type; - result_type + public: + Angle operator()(const Vector_2& u, const Vector_2& v) const { return angleC2(u.x(), u.y(), v.x(), v.y()); } - result_type + Angle operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { return angleC2(p.x(), p.y(), q.x(), q.y(), r.x(), r.y()); } - result_type + Angle operator()(const Point_2& p, const Point_2& q, const Point_2& r, const Point_2& s) const { @@ -63,18 +63,19 @@ namespace CartesianKernelFunctors { template class Angle_3 { + typedef typename K::Angle Angle; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; - public: - typedef typename K::Angle result_type; - result_type + public: + Angle operator()(const Vector_3& u, const Vector_3& v) const { return angleC3(u.x(), u.y(), u.z(), v.x(), v.y(), v.z()); } - result_type + + Angle operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { return angleC3(p.x(), p.y(), p.z(), @@ -82,7 +83,7 @@ namespace CartesianKernelFunctors { r.x(), r.y(), r.z()); } - result_type + Angle operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const { @@ -92,7 +93,7 @@ namespace CartesianKernelFunctors { s.x(), s.y(), s.z()); } - result_type + Angle operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Vector_3& n) const { @@ -103,18 +104,17 @@ namespace CartesianKernelFunctors { template class Are_parallel_2 { + typedef typename K::Boolean Boolean; typedef typename K::Line_2 Line_2; typedef typename K::Segment_2 Segment_2; typedef typename K::Ray_2 Ray_2; public: - typedef typename K::Boolean result_type; - - result_type + Boolean operator()(const Line_2& l1, const Line_2& l2) const { return parallelC2(l1.a(), l1.b(), l2.a(), l2.b()); } - result_type + Boolean operator()(const Segment_2& s1, const Segment_2& s2) const { return parallelC2(s1.source().x(), s1.source().y(), s1.target().x(), s1.target().y(), @@ -122,7 +122,7 @@ namespace CartesianKernelFunctors { s2.target().x(), s2.target().y()); } - result_type + Boolean operator()(const Ray_2& r1, const Ray_2& r2) const { return parallelC2(r1.source().x(), r1.source().y(), r1.second_point().x(), r1.second_point().y(), @@ -134,28 +134,27 @@ namespace CartesianKernelFunctors { template class Are_parallel_3 { + typedef typename K::Boolean Boolean; typedef typename K::Line_3 Line_3; typedef typename K::Segment_3 Segment_3; typedef typename K::Ray_3 Ray_3; typedef typename K::Plane_3 Plane_3; public: - typedef typename K::Boolean result_type; - - result_type + Boolean operator()(const Line_3& l1, const Line_3& l2) const { return parallelC3( l1.to_vector().x(), l1.to_vector().y(), l1.to_vector().z(), l2.to_vector().x(), l2.to_vector().y(), l2.to_vector().z()); } - result_type + Boolean operator()(const Plane_3& h1, const Plane_3& h2) const { return parallelC3(h1.a(), h1.b(), h1.c(), h2.a(), h2.b(), h2.c()); } - result_type + Boolean operator()(const Segment_3& s1, const Segment_3& s2) const { return parallelC3(s1.source().x(), s1.source().y(), s1.source().z(), s1.target().x(), s1.target().y(), s1.target().z(), @@ -163,7 +162,7 @@ namespace CartesianKernelFunctors { s2.target().x(), s2.target().y(), s2.target().z()); } - result_type + Boolean operator()(const Ray_3& r1, const Ray_3& r2) const { return parallelC3(r1.source().x(), r1.source().y(), r1.source().z(), r1.second_point().x(), r1.second_point().y(), r1.second_point().z(), @@ -175,14 +174,14 @@ namespace CartesianKernelFunctors { template class Bounded_side_2 { + typedef typename K::Bounded_side Bounded_side; typedef typename K::Point_2 Point_2; typedef typename K::Circle_2 Circle_2; typedef typename K::Triangle_2 Triangle_2; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; - public: - typedef typename K::Bounded_side result_type; - result_type + public: + Bounded_side operator()( const Circle_2& c, const Point_2& p) const { typename K::Compute_squared_distance_2 squared_distance; @@ -190,7 +189,7 @@ namespace CartesianKernelFunctors { squared_distance(c.center(),p))); } - result_type + Bounded_side operator()( const Triangle_2& t, const Point_2& p) const { typename K::Collinear_are_ordered_along_line_2 @@ -213,7 +212,7 @@ namespace CartesianKernelFunctors { : ON_UNBOUNDED_SIDE; } - result_type + Bounded_side operator()( const Iso_rectangle_2& r, const Point_2& p) const { bool x_incr = (r.xmin() < p.x()) && (p.x() < r.xmax()), @@ -236,24 +235,24 @@ namespace CartesianKernelFunctors { template class Bounded_side_3 { + typedef typename K::Bounded_side Bounded_side; typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Sphere_3 Sphere_3; typedef typename K::Circle_3 Circle_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; - public: - typedef typename K::Bounded_side result_type; - result_type + public: + Bounded_side operator()( const Sphere_3& s, const Point_3& p) const { return s.rep().bounded_side(p); } - result_type + Bounded_side operator()( const Circle_3& s, const Point_3& p) const { return s.rep().bounded_side(p); } - result_type + Bounded_side operator()( const Tetrahedron_3& t, const Point_3& p) const { FT alpha, beta, gamma, denom; @@ -273,7 +272,7 @@ namespace CartesianKernelFunctors { return ON_BOUNDED_SIDE; } - result_type + Bounded_side operator()( const Iso_cuboid_3& c, const Point_3& p) const { return c.rep().bounded_side(p); @@ -284,11 +283,11 @@ namespace CartesianKernelFunctors { template class Collinear_are_ordered_along_line_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { CGAL_kernel_exactness_precondition( collinear(p, q, r) ); @@ -300,11 +299,11 @@ namespace CartesianKernelFunctors { template class Collinear_are_ordered_along_line_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { CGAL_kernel_exactness_precondition( collinear(p, q, r) ); @@ -317,11 +316,11 @@ namespace CartesianKernelFunctors { template class Collinear_are_strictly_ordered_along_line_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { CGAL_kernel_exactness_precondition( collinear(p, q, r) ); @@ -333,11 +332,11 @@ namespace CartesianKernelFunctors { template class Collinear_are_strictly_ordered_along_line_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { CGAL_kernel_exactness_precondition( collinear(p, q, r) ); @@ -350,13 +349,13 @@ namespace CartesianKernelFunctors { template class Collinear_has_on_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Ray_2 Ray_2; typedef typename K::Segment_2 Segment_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Ray_2& r, const Point_2& p) const { const Point_2 & source = r.source(); @@ -378,7 +377,7 @@ namespace CartesianKernelFunctors { } // switch } - result_type + Boolean operator()( const Segment_2& s, const Point_2& p) const { return collinear_are_ordered_along_line(s.source(), p, s.target()); @@ -388,16 +387,17 @@ namespace CartesianKernelFunctors { template class Collinear_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Orientation_2 Orientation_2; - Orientation_2 o; - public: - typedef typename K::Boolean result_type; + Orientation_2 o; + + public: Collinear_2() {} Collinear_2(const Orientation_2 o_) : o(o_) {} - result_type + Boolean operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { return o(p, q, r) == COLLINEAR; } }; @@ -405,11 +405,11 @@ namespace CartesianKernelFunctors { template class Collinear_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { return collinearC3(p.x(), p.y(), p.z(), @@ -421,11 +421,11 @@ namespace CartesianKernelFunctors { template class Compare_angle_with_x_axis_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Direction_2 Direction_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()(const Direction_2& d1, const Direction_2& d2) const { return compare_angle_with_x_axisC2(d1.dx(), d1.dy(), d2.dx(), d2.dy()); @@ -435,25 +435,25 @@ namespace CartesianKernelFunctors { template class Compare_distance_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { return cmp_dist_to_pointC2(p.x(), p.y(), q.x(), q.y(), r.x(), r.y()); } template - Needs_FT + Needs_FT operator()(const T1& p, const T2& q, const T3& r) const { return CGAL::compare(squared_distance(p, q), squared_distance(p, r)); } template - Needs_FT + Needs_FT operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { return CGAL::compare(squared_distance(p, q), squared_distance(r, s)); @@ -560,12 +560,12 @@ namespace CartesianKernelFunctors { template class Compare_distance_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; typedef typename K::Segment_3 Segment_3; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { return cmp_dist_to_pointC3(p.x(), p.y(), p.z(), @@ -573,33 +573,33 @@ namespace CartesianKernelFunctors { r.x(), r.y(), r.z()); } - result_type + Comparison_result operator()(const Point_3& p1, const Segment_3& s1, const Segment_3& s2) const { return internal::compare_distance_pssC3(p1,s1,s2, K()); } - result_type + Comparison_result operator()(const Point_3& p1, const Point_3& p2, const Segment_3& s2) const { return internal::compare_distance_ppsC3(p1,p2,s2, K()); } - result_type + Comparison_result operator()(const Point_3& p1, const Segment_3& s2, const Point_3& p2) const { return opposite(internal::compare_distance_ppsC3(p1,p2,s2, K())); } template - Needs_FT + Needs_FT operator()(const T1& p, const T2& q, const T3& r) const { return CGAL::compare(squared_distance(p, q), squared_distance(p, r)); } template - Needs_FT + Needs_FT operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { return CGAL::compare(squared_distance(p, q), squared_distance(r, s)); @@ -614,8 +614,7 @@ namespace CartesianKernelFunctors { typedef typename K::Point_2 Point_2; typedef typename K::Comparison_result Comparison_result; - typedef Comparison_result result_type; - +public: Comparison_result operator()(const Point_2& r, const Weighted_point_2& p, const Weighted_point_2& q) const @@ -629,14 +628,13 @@ namespace CartesianKernelFunctors { template class Compare_signed_distance_to_line_2 { - typedef typename K::Point_2 Point_2; - typedef typename K::Line_2 Line_2; - typedef typename K::Equal_2 Equal_2; + typedef typename K::Comparison_result Comparison_result; + typedef typename K::Point_2 Point_2; + typedef typename K::Line_2 Line_2; + typedef typename K::Equal_2 Equal_2; public: - typedef typename K::Comparison_result result_type; - - result_type + Comparison_result operator()(const Point_2& a, const Point_2& b, const Point_2& c, const Point_2& d) const { @@ -649,7 +647,7 @@ namespace CartesianKernelFunctors { d.x(), d.y()); } - result_type + Comparison_result operator()(const Line_2& l, const Point_2& p, const Point_2& q) const { return cmp_signed_dist_to_directionC2(l.a(), l.b(), @@ -661,12 +659,12 @@ namespace CartesianKernelFunctors { template class Compare_squared_radius_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; typedef typename K::FT FT; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s, const FT& ft) const { FT num, den; @@ -678,7 +676,7 @@ namespace CartesianKernelFunctors { return CGAL::compare(num, den * ft); } - result_type + Comparison_result operator()(const Point_3& p, const Point_3& q, const Point_3& r, const FT& ft) const { FT num, den; @@ -689,7 +687,7 @@ namespace CartesianKernelFunctors { return CGAL::compare(num, den * ft); } - result_type + Comparison_result operator()(const Point_3& p, const Point_3& q, const FT& ft) const { FT num, den; @@ -699,7 +697,7 @@ namespace CartesianKernelFunctors { return CGAL::compare(num, den * ft); } - result_type + Comparison_result operator()(const Point_3&, const FT& ft) const { return - CGAL_NTS sign(ft); @@ -707,23 +705,22 @@ namespace CartesianKernelFunctors { }; - template class Compare_slope_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; typedef typename K::Segment_2 Segment_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()(const Line_2& l1, const Line_2& l2) const { return compare_slopesC2(l1.a(), l1.b(), l2.a(), l2.b()); } - result_type + Comparison_result operator()(const Segment_2& s1, const Segment_2& s2) const { return compare_slopesC2(s1.source().x(), s1.source().y(), @@ -732,7 +729,7 @@ namespace CartesianKernelFunctors { s2.target().x(), s2.target().y()); } - result_type + Comparison_result operator()(const Point_2& s1s, const Point_2& s1t, const Point_2& s2s, const Point_2& s2t) const { return compare_slopesC2(s1s.x(), s1s.y(), @@ -745,30 +742,30 @@ namespace CartesianKernelFunctors { template class Compare_x_at_y_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_2& p, const Line_2& h) const { return compare_y_at_xC2(p.y(), p.x(), h.b(), h.a(), h.c()); } - result_type + Comparison_result operator()( const Point_2& p, const Line_2& h1, const Line_2& h2) const { return compare_y_at_xC2(p.y(), h1.b(), h1.a(), h1.c(), h2.b(), h2.a(), h2.c()); } - result_type + Comparison_result operator()( const Line_2& l1, const Line_2& l2, const Line_2& h) const { return compare_y_at_xC2(l1.b(), l1.a(), l1.c(), l2.b(), l2.a(), l2.c(), h.b(), h.a(), h.c()); } - result_type + Comparison_result operator()( const Line_2& l1, const Line_2& l2, const Line_2& h1, const Line_2& h2) const { @@ -780,11 +777,11 @@ namespace CartesianKernelFunctors { template class Compare_xyz_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_3& p, const Point_3& q) const { return compare_lexicographically_xyzC3(p.x(), p.y(), p.z(), @@ -795,11 +792,11 @@ namespace CartesianKernelFunctors { template class Compare_xy_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_2& p, const Point_2& q) const { return compare_lexicographically_xyC2(p.x(), p.y(), q.x(), q.y()); } }; @@ -807,11 +804,11 @@ namespace CartesianKernelFunctors { template class Compare_xy_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_3& p, const Point_3& q) const { return compare_lexicographically_xyC2(p.x(), p.y(), q.x(), q.y()); } }; @@ -819,27 +816,27 @@ namespace CartesianKernelFunctors { template class Compare_x_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_2& p, const Point_2& q) const { return CGAL::compare(p.x(), q.x()); } - result_type + Comparison_result operator()( const Point_2& p, const Line_2& l, const Line_2& h) const { return compare_xC2(p.x(), l.a(), l.b(), l.c(), h.a(), h.b(), h.c()); } - result_type + Comparison_result operator()( const Line_2& l, const Line_2& h1, const Line_2& h2) const { return compare_xC2(l.a(), l.b(), l.c(), h1.a(), h1.b(), h1.c(), h2.a(), h2.b(), h2.c()); } - result_type + Comparison_result operator()( const Line_2& l1, const Line_2& l2, const Line_2& h1, const Line_2& h2) const { @@ -851,11 +848,11 @@ namespace CartesianKernelFunctors { template class Compare_x_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_3& p, const Point_3& q) const { return CGAL::compare(p.x(), q.x()); } }; @@ -863,11 +860,11 @@ namespace CartesianKernelFunctors { template class Compare_yx_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_2& p, const Point_2& q) const { return compare_lexicographically_xyC2(p.y(), p.x(), q.y(), q.x()); } }; @@ -875,31 +872,31 @@ namespace CartesianKernelFunctors { template class Compare_y_at_x_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; typedef typename K::Segment_2 Segment_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_2& p, const Line_2& h) const { return compare_y_at_xC2(p.x(), p.y(), h.a(), h.b(), h.c()); } - result_type + Comparison_result operator()( const Point_2& p, const Line_2& h1, const Line_2& h2) const { return compare_y_at_xC2(p.x(), h1.a(), h1.b(), h1.c(), h2.a(), h2.b(), h2.c()); } - result_type + Comparison_result operator()( const Line_2& l1, const Line_2& l2, const Line_2& h) const { return compare_y_at_xC2(l1.a(), l1.b(), l1.c(), l2.a(), l2.b(), l2.c(), h.a(), h.b(), h.c()); } - result_type + Comparison_result operator()( const Line_2& l1, const Line_2& l2, const Line_2& h1, const Line_2& h2) const { @@ -907,7 +904,7 @@ namespace CartesianKernelFunctors { h1.a(), h1.b(), h1.c(), h2.a(), h2.b(), h2.c()); } - result_type + Comparison_result operator()( const Point_2& p, const Segment_2& s) const { return compare_y_at_xC2(p.x(), p.y(), @@ -915,7 +912,7 @@ namespace CartesianKernelFunctors { s.target().x(), s.target().y()); } - result_type + Comparison_result operator()( const Point_2& p, const Segment_2& s1, const Segment_2& s2) const { @@ -930,16 +927,16 @@ namespace CartesianKernelFunctors { template class Compare_y_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_2& p, const Point_2& q) const { return CGAL::compare(p.y(), q.y()); } - result_type + Comparison_result operator()( const Point_2& p, const Line_2& l1, const Line_2& l2) const { return compare_xC2(p.y(), @@ -947,14 +944,14 @@ namespace CartesianKernelFunctors { l2.b(), l2.a(), l2.c()); } - result_type + Comparison_result operator()( const Line_2& l, const Line_2& h1, const Line_2& h2) const { return compare_xC2(l.b(), l.a(), l.c(), h1.b(), h1.a(), h1.c(), l.b(), l.a(), l.c(), h2.b(), h2.a(), h2.c()); } - result_type + Comparison_result operator()( const Line_2& l1, const Line_2& l2, const Line_2& h1, const Line_2& h2) const { @@ -966,11 +963,11 @@ namespace CartesianKernelFunctors { template class Compare_y_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_3& p, const Point_3& q) const { return CGAL::compare(p.y(), q.y()); } }; @@ -978,11 +975,11 @@ namespace CartesianKernelFunctors { template class Compare_z_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_3& p, const Point_3& q) const { return CGAL::compare(p.z(), q.z()); } }; @@ -994,10 +991,7 @@ namespace CartesianKernelFunctors { typedef typename K::FT FT; public: - - typedef double result_type; - - result_type + double operator() (const Circle_3 & c) const // { return c.rep().approximate_area(); } { return CGAL_PI * to_double(c.squared_radius()); } @@ -1010,10 +1004,7 @@ namespace CartesianKernelFunctors { typedef typename K::FT FT; public: - - typedef double result_type; - - result_type + double operator() (const Circle_3 & c) const // { return c.rep().approximate_squared_length(); } { return CGAL_PI * CGAL_PI * 4.0 * to_double(c.squared_radius()); } @@ -1027,10 +1018,9 @@ namespace CartesianKernelFunctors { typedef typename K::Iso_rectangle_2 Iso_rectangle_2; typedef typename K::Triangle_2 Triangle_2; typedef typename K::Point_2 Point_2; - public: - typedef FT result_type; - result_type + public: + FT operator()( const Point_2& p, const Point_2& q, const Point_2& r ) const { FT v1x = q.x() - p.x(); @@ -1040,11 +1030,11 @@ namespace CartesianKernelFunctors { return determinant(v1x, v1y, v2x, v2y)/2; } - result_type + FT operator()( const Iso_rectangle_2& r ) const { return (r.xmax()-r.xmin()) * (r.ymax()-r.ymin()); } - result_type + FT operator()( const Triangle_2& t ) const { return t.area(); } }; @@ -1066,10 +1056,9 @@ namespace CartesianKernelFunctors { { typedef typename K::FT FT; typedef typename K::Vector_2 Vector_2; - public: - typedef FT result_type; - result_type + public: + FT operator()(const Vector_2& v, const Vector_2& w) const { return determinant(v.x(), v.y(), w.x(), w.y()); @@ -1081,10 +1070,9 @@ namespace CartesianKernelFunctors { { typedef typename K::FT FT; typedef typename K::Vector_3 Vector_3; - public: - typedef FT result_type; - result_type + public: + FT operator()(const Vector_3& v, const Vector_3& w, const Vector_3& t) const { return determinant(v.x(), v.y(), v.z(), @@ -1098,10 +1086,9 @@ namespace CartesianKernelFunctors { { typedef typename K::FT FT; typedef typename K::Vector_2 Vector_2; - public: - typedef FT result_type; - result_type + public: + FT operator()(const Vector_2& v, const Vector_2& w) const { return v.x() * w.x() + v.y() * w.y(); @@ -1113,10 +1100,9 @@ namespace CartesianKernelFunctors { { typedef typename K::FT FT; typedef typename K::Vector_3 Vector_3; - public: - typedef FT result_type; - result_type + public: + FT operator()(const Vector_3& v, const Vector_3& w) const { return v.x() * w.x() + v.y() * w.y() + v.z() * w.z(); @@ -1129,16 +1115,15 @@ namespace CartesianKernelFunctors { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Triangle_3 Triangle_3; - public: - typedef FT result_type; - result_type + public: + FT operator()( const Triangle_3& t ) const { return this->operator()(t.vertex(0), t.vertex(1), t.vertex(2)); } - result_type + FT operator()( const Point_3& p, const Point_3& q, const Point_3& r ) const { return squared_areaC3(p.x(), p.y(), p.z(), @@ -1153,10 +1138,9 @@ namespace CartesianKernelFunctors { { typedef typename K::FT FT; typedef typename K::Point_2 Point_2; - public: - typedef FT result_type; - result_type + public: + FT operator()( const Point_2& p, const Point_2& q) const { return squared_distanceC2(p.x(), p.y(), q.x(), q.y()); @@ -1166,14 +1150,11 @@ namespace CartesianKernelFunctors { template class Compute_squared_length_divided_by_pi_square_3 { - typedef typename K::Circle_3 Circle_3; typedef typename K::FT FT; + typedef typename K::Circle_3 Circle_3; public: - - typedef FT result_type; - - result_type + FT operator() (const Circle_3 & c) const { return c.rep().squared_length_divided_by_pi_square(); } @@ -1271,10 +1252,9 @@ public: typedef typename K::Point_3 Point_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; - public: - typedef FT result_type; - result_type + public: + FT operator()(const Point_3& p0, const Point_3& p1, const Point_3& p2, const Point_3& p3) const { @@ -1283,14 +1263,14 @@ public: p3.x()-p0.x(), p3.y()-p0.y(), p3.z()-p0.z())/6; } - result_type + FT operator()( const Tetrahedron_3& t ) const { return this->operator()(t.vertex(0), t.vertex(1), t.vertex(2), t.vertex(3)); } - result_type + FT operator()( const Iso_cuboid_3& c ) const { return c.rep().volume(); } }; @@ -1299,20 +1279,17 @@ public: template class Compute_x_2 { - typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Point_2& p) const { return p.rep().x(); } - result_type + decltype(auto) operator()(const Vector_2& v) const { return v.rep().x(); @@ -1322,20 +1299,17 @@ public: template class Compute_x_3 { - typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Point_3& p) const { return p.rep().x(); } - result_type + decltype(auto) operator()(const Vector_3& v) const { return v.rep().x(); @@ -1346,20 +1320,17 @@ public: template class Compute_y_2 { - typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Point_2& p) const { return p.rep().y(); } - result_type + decltype(auto) operator()(const Vector_2& v) const { return v.rep().y(); @@ -1370,20 +1341,17 @@ public: template class Compute_y_3 { - typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Point_3& p) const { return p.rep().y(); } - result_type + decltype(auto) operator()(const Vector_3& v) const { return v.rep().y(); @@ -1393,38 +1361,30 @@ public: template class Compute_z_3 { - typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Point_3& p) const { return p.rep().z(); } - result_type + decltype(auto) operator()(const Vector_3& v) const { return v.rep().z(); } }; - - template class Compute_dx_2 { - typedef typename K::FT FT; typedef typename K::Direction_2 Direction_2; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Direction_2& d) const { return d.rep().dx(); @@ -1434,13 +1394,10 @@ public: template class Compute_dx_3 { - typedef typename K::FT FT; typedef typename K::Direction_3 Direction_3; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Direction_3& d) const { return d.rep().dx(); @@ -1450,13 +1407,10 @@ public: template class Compute_dy_2 { - typedef typename K::FT FT; typedef typename K::Direction_2 Direction_2; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Direction_2& d) const { return d.rep().dy(); @@ -1466,13 +1420,10 @@ public: template class Compute_dy_3 { - typedef typename K::FT FT; typedef typename K::Direction_3 Direction_3; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Direction_3& d) const { return d.rep().dy(); @@ -1482,13 +1433,10 @@ public: template class Compute_dz_3 { - typedef typename K::FT FT; typedef typename K::Direction_3 Direction_3; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Direction_3& d) const { return d.rep().dz(); @@ -1498,20 +1446,17 @@ public: template class Compute_hx_2 { - typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Point_2& p) const { return p.rep().hx(); } - result_type + decltype(auto) operator()(const Vector_2& v) const { return v.rep().hx(); @@ -1521,20 +1466,17 @@ public: template class Compute_hx_3 { - typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Point_3& p) const { return p.rep().hx(); } - result_type + decltype(auto) operator()(const Vector_3& v) const { return v.rep().hx(); @@ -1544,20 +1486,17 @@ public: template class Compute_hy_2 { - typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Point_2& p) const { return p.rep().hy(); } - result_type + decltype(auto) operator()(const Vector_2& v) const { return v.rep().hy(); @@ -1567,20 +1506,17 @@ public: template class Compute_hy_3 { - typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Point_3& p) const { return p.rep().hy(); } - result_type + decltype(auto) operator()(const Vector_3& v) const { return v.rep().hy(); @@ -1590,20 +1526,17 @@ public: template class Compute_hz_3 { - typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Point_3& p) const { return p.rep().hz(); } - result_type + decltype(auto) operator()(const Vector_3& v) const { return v.rep().hz(); @@ -1613,20 +1546,17 @@ public: template class Compute_hw_2 { - typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Point_2& p) const { return p.rep().hw(); } - result_type + decltype(auto) operator()(const Vector_2& v) const { return v.rep().hw(); @@ -1636,20 +1566,17 @@ public: template class Compute_hw_3 { - typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Point_3& p) const { return p.rep().hw(); } - result_type + decltype(auto) operator()(const Vector_3& v) const { return v.rep().hw(); @@ -1660,13 +1587,10 @@ public: template class Compute_xmin_2 { - typedef typename K::FT FT; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Iso_rectangle_2& r) const { return (r.min)().x(); @@ -1676,13 +1600,10 @@ public: template class Compute_xmax_2 { - typedef typename K::FT FT; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Iso_rectangle_2& r) const { return (r.max)().x(); @@ -1692,13 +1613,10 @@ public: template class Compute_ymin_2 { - typedef typename K::FT FT; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Iso_rectangle_2& r) const { return (r.min)().y(); @@ -1708,29 +1626,24 @@ public: template class Compute_ymax_2 { - typedef typename K::FT FT; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; public: - typedef const FT& result_type; - - result_type + decltype(auto) operator()(const Iso_rectangle_2& r) const { return (r.max)().y(); } }; - template class Construct_barycenter_2 { typedef typename K::FT FT; typedef typename K::Point_2 Point_2; - public: - typedef Point_2 result_type; - result_type + public: + Point_2 operator()(const Point_2& p1, const FT&w1, const Point_2& p2) const { typename K::Construct_point_2 construct_point_2; @@ -1739,7 +1652,7 @@ public: return construct_point_2(x, y); } - result_type + Point_2 operator()(const Point_2& p1, const FT& w1, const Point_2& p2, const FT& w2) const { typename K::Construct_point_2 construct_point_2; @@ -1748,7 +1661,7 @@ public: return construct_point_2(x, y); } - result_type + Point_2 operator()(const Point_2& p1, const FT& w1, const Point_2& p2, const FT& w2, const Point_2& p3) const { @@ -1758,7 +1671,7 @@ public: return construct_point_2(x, y); } - result_type + Point_2 operator()(const Point_2& p1, const FT& w1, const Point_2& p2, const FT& w2, const Point_2& p3, const FT& w3) const { @@ -1768,7 +1681,7 @@ public: return construct_point_2(x, y); } - result_type + Point_2 operator()(const Point_2& p1, const FT& w1, const Point_2& p2, const FT& w2, const Point_2& p3, const FT& w3, const Point_2& p4) const { @@ -1778,7 +1691,7 @@ public: return construct_point_2(x, y); } - result_type + Point_2 operator()(const Point_2& p1, const FT& w1, const Point_2& p2, const FT& w2, const Point_2& p3, const FT& w3, const Point_2& p4, const FT& w4) const { @@ -1795,10 +1708,9 @@ public: { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; - public: - typedef Point_3 result_type; - result_type + public: + Point_3 operator()(const Point_3& p1, const FT&w1, const Point_3& p2) const { typename K::Construct_point_3 construct_point_3; @@ -1807,7 +1719,7 @@ public: return construct_point_3(x, y, z); } - result_type + Point_3 operator()(const Point_3& p1, const FT& w1, const Point_3& p2, const FT& w2) const { typename K::Construct_point_3 construct_point_3; @@ -1816,7 +1728,7 @@ public: return construct_point_3(x, y, z); } - result_type + Point_3 operator()(const Point_3& p1, const FT& w1, const Point_3& p2, const FT& w2, const Point_3& p3) const { @@ -1826,7 +1738,7 @@ public: return construct_point_3(x, y, z); } - result_type + Point_3 operator()(const Point_3& p1, const FT& w1, const Point_3& p2, const FT& w2, const Point_3& p3, const FT& w3) const { @@ -1837,7 +1749,7 @@ public: return construct_point_3(x, y, z); } - result_type + Point_3 operator()(const Point_3& p1, const FT& w1, const Point_3& p2, const FT& w2, const Point_3& p3, const FT& w3, const Point_3& p4) const { @@ -1848,7 +1760,7 @@ public: return construct_point_3(x, y, z); } - result_type + Point_3 operator()(const Point_3& p1, const FT& w1, const Point_3& p2, const FT& w2, const Point_3& p3, const FT& w3, const Point_3& p4, const FT& w4) const { @@ -1873,16 +1785,15 @@ public: Construct_orthogonal_vector_3; Construct_cross_product_vector_3 cp; Construct_orthogonal_vector_3 co; - public: - typedef Vector_3 result_type; + public: Construct_base_vector_3() {} Construct_base_vector_3(const Construct_cross_product_vector_3& cp_, const Construct_orthogonal_vector_3& co_) : cp(cp_), co(co_) {} - result_type + Vector_3 operator()( const Plane_3& h, int index ) const { if (index == 1) { @@ -1924,10 +1835,9 @@ public: typedef typename K::Iso_rectangle_2 Iso_rectangle_2; typedef typename K::Triangle_2 Triangle_2; typedef typename K::Circle_2 Circle_2; - public: - typedef Bbox_2 result_type; - result_type + public: + Bbox_2 operator()(const Point_2& p) const { std::pair xp = CGAL_NTS to_interval(p.x()); @@ -1935,11 +1845,11 @@ public: return Bbox_2(xp.first, yp.first, xp.second, yp.second); } - result_type + Bbox_2 operator()(const Segment_2& s) const { return s.source().bbox() + s.target().bbox(); } - result_type + Bbox_2 operator()(const Triangle_2& t) const { Bbox_2 bb = this->operator()(t.vertex(0)); @@ -1959,14 +1869,14 @@ public: */ } - result_type + Bbox_2 operator()(const Iso_rectangle_2& r) const { typename K::Construct_bbox_2 construct_bbox_2; return construct_bbox_2((r.min)()) + construct_bbox_2((r.max)()); } - result_type + Bbox_2 operator()(const Circle_2& c) const { typename K::Construct_bbox_2 construct_bbox_2; @@ -1997,9 +1907,8 @@ public: typedef typename K::Tetrahedron_3 Tetrahedron_3; typedef typename K::Sphere_3 Sphere_3; typedef typename K::Circle_3 Circle_3; - public: - typedef Bbox_3 result_type; + public: Bbox_3 operator()(const Point_3& p) const { @@ -2061,7 +1970,7 @@ public: maxx.sup(), maxy.sup(), maxz.sup()); } - Bbox_3 + decltype(auto) operator()(const Circle_3& c) const { return c.rep().bbox(); } @@ -2074,10 +1983,9 @@ public: typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; - public: - typedef Line_2 result_type; - result_type + public: + Line_2 operator()(const Point_2& p, const Point_2& q) const { FT a, b, c; @@ -2085,7 +1993,7 @@ public: return Line_2(a, b, c); } - result_type + Line_2 operator()(const Line_2& p, const Line_2& q) const { FT a, b, c; @@ -2102,10 +2010,9 @@ public: typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Plane_3 Plane_3; - public: - typedef Plane_3 result_type; - result_type + public: + Plane_3 operator()(const Point_3& p, const Point_3& q) const { FT a, b, c, d; @@ -2115,7 +2022,7 @@ public: return Plane_3(a, b, c, d); } - result_type + Plane_3 operator()(const Plane_3& p, const Plane_3& q) const { FT a, b, c, d; @@ -2132,10 +2039,9 @@ public: typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Triangle_2 Triangle_2; - public: - typedef Point_2 result_type; - result_type + public: + Point_2 operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { typename K::Construct_point_2 construct_point_2; @@ -2144,13 +2050,13 @@ public: return construct_point_2(x, y); } - result_type + Point_2 operator()(const Triangle_2& t) const { return this->operator()(t.vertex(0), t.vertex(1), t.vertex(2)); } - result_type + Point_2 operator()(const Point_2& p, const Point_2& q, const Point_2& r, const Point_2& s) const { @@ -2168,10 +2074,9 @@ public: typedef typename K::Point_3 Point_3; typedef typename K::Triangle_3 Triangle_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; - public: - typedef Point_3 result_type; - result_type + public: + Point_3 operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { typename K::Construct_point_3 construct_point_3; @@ -2183,7 +2088,7 @@ public: return construct_point_3(x, y, z); } - result_type + Point_3 operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const { @@ -2197,13 +2102,13 @@ public: return construct_point_3(x, y, z); } - result_type + Point_3 operator()(const Triangle_3& t) const { return this->operator()(t.vertex(0), t.vertex(1), t.vertex(2)); } - result_type + Point_3 operator()(const Tetrahedron_3& t) const { return this->operator()(t.vertex(0), t.vertex(1), @@ -2216,9 +2121,8 @@ public: { typedef typename K::Point_2 Point_2; typedef typename K::Triangle_2 Triangle_2; - public: - typedef Point_2 result_type; + public: Point_2 operator()(const Point_2& p, const Point_2& q) const { @@ -2226,7 +2130,7 @@ public: return construct_midpoint_2(p, q); } - result_type + Point_2 operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { typename K::Construct_point_2 construct_point_2; @@ -2236,7 +2140,7 @@ public: return construct_point_2(x, y); } - result_type + Point_2 operator()(const Triangle_2& t) const { return this->operator()(t.vertex(0), t.vertex(1), t.vertex(2)); @@ -2250,9 +2154,8 @@ public: typedef typename K::Tetrahedron_3 Tetrahedron_3; typedef typename K::Triangle_3 Triangle_3; typedef typename K::Point_3 Point_3; - public: - typedef Point_3 result_type; + public: Point_3 operator()(const Point_3& p, const Point_3& q) const { @@ -2304,9 +2207,8 @@ public: class Construct_cross_product_vector_3 { typedef typename K::Vector_3 Vector_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()(const Vector_3& v, const Vector_3& w) const { @@ -2325,15 +2227,14 @@ public: typedef typename K::Construct_base_vector_3 Construct_base_vector_3; typedef typename K::Construct_point_on_3 Construct_point_on_3; typedef typename K::Construct_scaled_vector_3 Construct_scaled_vector_3; - typedef typename K::Construct_translated_point_3 - Construct_translated_point_3; + typedef typename K::Construct_translated_point_3 Construct_translated_point_3; + Construct_base_vector_3 cb; Construct_point_on_3 cp; Construct_scaled_vector_3 cs; Construct_translated_point_3 ct; - public: - typedef Point_3 result_type; + public: Construct_lifted_point_3() {} Construct_lifted_point_3(const Construct_base_vector_3& cb_, const Construct_point_on_3& cp_, @@ -2362,8 +2263,6 @@ public: typedef typename K::RT RT; public: - typedef Direction_2 result_type; - Rep // Direction_2 operator()(Return_base_tag, const RT& x, const RT& y) const { return Rep(x, y); } @@ -2438,9 +2337,8 @@ public: typedef typename K::Segment_3 Segment_3; typedef typename K::RT RT; typedef typename Direction_3::Rep Rep; - public: - typedef Direction_3 result_type; + public: Rep // Direction_3 operator()(Return_base_tag, const RT& x, const RT& y, const RT& z) const { return Rep(x, y, z); } @@ -2491,9 +2389,8 @@ public: typedef typename K::Vector_3 Vector_3; typedef typename K::Line_3 Line_3; typedef typename Line_3::Rep Rep; - public: - typedef Line_3 result_type; + public: Line_3 operator()( const Point_3& p, const Point_3& q, const Point_3& s) const { @@ -2543,7 +2440,6 @@ public: FT z = s.z() + num_z*inv; return Rep(Point_3(x, y, z), Vector_3(rsx, rsy, rsz)); } - }; template @@ -2556,8 +2452,6 @@ public: typedef typename Iso_rectangle_2::Rep Rep; public: - typedef Iso_rectangle_2 result_type; - Rep // Iso_rectangle_2 operator()(Return_base_tag, const Point_2& p, const Point_2& q, int) const { @@ -2661,10 +2555,10 @@ public: typedef typename K::Line_2 Line_2; typedef typename Line_2::Rep Rep; typedef typename K::Construct_point_on_2 Construct_point_on_2; - Construct_point_on_2 c; - public: - typedef Line_2 result_type; + Construct_point_on_2 c; + + public: Construct_line_2() {} Construct_line_2(const Construct_point_on_2& c_) : c(c_) {} @@ -2740,9 +2634,8 @@ public: typedef typename K::Line_3 Line_3; typedef typename K::Vector_3 Vector_3; typedef typename Line_3::Rep Rep; - public: - typedef Line_3 result_type; + public: Rep // Line_3 operator()(Return_base_tag, const Point_3& p, const Point_3& q) const { return Rep(p, Vector_3(p, q)); } @@ -2791,9 +2684,8 @@ public: 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; + public: Point_2 operator()(const Point_2& p, const Point_2& q) const { @@ -2821,9 +2713,8 @@ public: 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; + public: Point_3 operator()(const Point_3& p, const Point_3& q) const { @@ -2849,9 +2740,8 @@ public: class Construct_opposite_vector_2 { typedef typename K::Vector_2 Vector_2; - public: - typedef Vector_2 result_type; + public: Vector_2 operator()( const Vector_2& v) const { return Vector_2(-v.x(), -v.y()); } @@ -2861,9 +2751,8 @@ public: class Construct_difference_of_vectors_2 { typedef typename K::Vector_2 Vector_2; - public: - typedef Vector_2 result_type; + public: Vector_2 operator()( const Vector_2& v, const Vector_2& w) const { return Vector_2(v.x()-w.x(), v.y()-w.y()); } @@ -2873,9 +2762,8 @@ public: class Construct_difference_of_vectors_3 { typedef typename K::Vector_3 Vector_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()( const Vector_3& v, const Vector_3& w) const { return Vector_3(v.x()-w.x(), v.y()-w.y(), v.z()-w.z()); } @@ -2889,8 +2777,6 @@ public: typedef typename K::Weighted_point_2 Weighted_point_2; typedef typename K::Line_2 Line_2; - typedef Line_2 result_type; - Line_2 operator() ( const Weighted_point_2 & p, const Weighted_point_2 & q) const { @@ -2908,9 +2794,8 @@ public: class Construct_sum_of_vectors_2 { typedef typename K::Vector_2 Vector_2; - public: - typedef Vector_2 result_type; + public: Vector_2 operator()( const Vector_2& v, const Vector_2& w) const { return Vector_2(v.x()+w.x(), v.y()+w.y()); } @@ -2920,9 +2805,8 @@ public: class Construct_sum_of_vectors_3 { typedef typename K::Vector_3 Vector_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()( const Vector_3& v, const Vector_3& w) const { return Vector_3(v.x()+w.x(), v.y()+w.y(), v.z()+w.z()); } @@ -2932,9 +2816,8 @@ public: class Construct_opposite_vector_3 { typedef typename K::Vector_3 Vector_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()( const Vector_3& v) const { return Vector_3(-v.x(), -v.y(), -v.z()); } @@ -2947,9 +2830,8 @@ public: typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; typedef typename K::Plane_3 Plane_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()( const Plane_3& p ) const { return Vector_3(p.a(), p.b(), p.c()); } @@ -2989,9 +2871,8 @@ public: class Construct_perpendicular_vector_2 { typedef typename K::Vector_2 Vector_2; - public: - typedef Vector_2 result_type; + public: Vector_2 operator()( const Vector_2& v, Orientation o) const { @@ -3007,9 +2888,8 @@ public: class Construct_perpendicular_direction_2 { typedef typename K::Direction_2 Direction_2; - public: - typedef Direction_2 result_type; + public: Direction_2 operator()( const Direction_2& d, Orientation o) const { @@ -3027,9 +2907,8 @@ public: { typedef typename K::Line_2 Line_2; typedef typename K::Point_2 Point_2; - public: - typedef Line_2 result_type; + public: Line_2 operator()( const Line_2& l, const Point_2& p) const { @@ -3049,23 +2928,8 @@ public: typedef typename K::Weighted_point_2 Weighted_point_2; typedef typename K::Line_2 Line_2; typedef typename Point_2::Rep Rep; + public: - - template - struct result { - typedef Point_2 type; - }; - - template - struct result { - typedef const Point_2& type; - }; - - template - struct result { - typedef const Point_2& type; - }; - Rep // Point_2 operator()(Return_base_tag, Origin o) const { return Rep(o); } @@ -3100,7 +2964,7 @@ public: operator()(const Point_2 & p) const { return p; } - const Point_2& + decltype(auto) operator()(const Weighted_point_2 & p) const { return p.rep().point(); } @@ -3159,7 +3023,7 @@ public: operator()(const Point_3 & p) const { return p; } - const Point_3& + decltype(auto) operator()(const Weighted_point_3 & p) const { return p.rep().point(); } @@ -3184,9 +3048,8 @@ public: typedef typename K::Point_2 Point_2; typedef typename K::Weighted_point_2 Weighted_point_2; typedef typename Weighted_point_2::Rep Rep; - public: - typedef Weighted_point_2 result_type; + public: Rep operator()(Return_base_tag, Origin o) const { return Rep(o); } @@ -3227,9 +3090,8 @@ public: typedef typename K::Point_3 Point_3; typedef typename K::Weighted_point_3 Weighted_point_3; typedef typename Weighted_point_3::Rep Rep; - public: - typedef Weighted_point_3 result_type; + public: Rep operator()(Return_base_tag, Origin o) const { return Rep(o); } @@ -3269,9 +3131,8 @@ public: { typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; - public: - typedef Point_2 result_type; + public: Point_2 operator()( const Line_2& l, const Point_2& p ) const { @@ -3353,10 +3214,7 @@ public: typedef typename K::FT FT; public: - - typedef Line_2 result_type; - - result_type + Line_2 operator() (const Circle_2 & c1, const Circle_2 & c2) const { // Concentric Circles don't have radical line @@ -3379,10 +3237,7 @@ public: typedef typename K::FT FT; public: - - typedef Plane_3 result_type; - - result_type + Plane_3 operator() (const Sphere_3 & s1, const Sphere_3 & s2) const { // Concentric Spheres don't have radical plane @@ -3406,9 +3261,8 @@ public: { typedef typename K::FT FT; typedef typename K::Vector_2 Vector_2; - public: - typedef Vector_2 result_type; + public: Vector_2 operator()( const Vector_2& v, const FT& c) const { @@ -3421,9 +3275,8 @@ public: { typedef typename K::FT FT; typedef typename K::Vector_2 Vector_2; - public: - typedef Vector_2 result_type; + public: Vector_2 operator()( const Vector_2& v, const FT& c) const { @@ -3436,9 +3289,8 @@ public: { typedef typename K::FT FT; typedef typename K::Vector_3 Vector_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()( const Vector_3& v, const FT& c) const { @@ -3451,9 +3303,8 @@ public: { typedef typename K::FT FT; typedef typename K::Vector_3 Vector_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()( const Vector_3& w, const FT& c) const { @@ -3466,9 +3317,8 @@ public: { typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; - public: - typedef Point_2 result_type; + public: Point_2 operator()( const Point_2& p, const Vector_2& v) const { @@ -3489,9 +3339,8 @@ public: { typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; - public: - typedef Point_3 result_type; + public: Point_3 operator()( const Point_3& p, const Vector_3& v) const { @@ -3519,9 +3368,8 @@ public: typedef typename K::Point_2 Point_2; typedef typename K::Direction_2 Direction_2; typedef typename Vector_2::Rep Rep; - public: - typedef Vector_2 result_type; + public: Rep // Vector_2 operator()(Return_base_tag, const Point_2& p, const Point_2& q) const { return Rep(q.x() - p.x(), q.y() - p.y()); } @@ -3617,9 +3465,8 @@ public: typedef typename K::Vector_3 Vector_3; typedef typename K::Point_3 Point_3; typedef typename Vector_3::Rep Rep; - public: - typedef Vector_3 result_type; + public: Rep // Vector_3 operator()(Return_base_tag, const Point_3& p, const Point_3& q) const { @@ -3719,22 +3566,13 @@ public: typedef typename K::Segment_2 Segment_2; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; typedef typename K::Triangle_2 Triangle_2; + public: - template - struct result { - typedef const Point_2& type; - }; - - template - struct result { - typedef Point_2 type; - }; - - const Point_2 & + decltype(auto) operator()( const Segment_2& s, int i) const { return s.vertex(i); } - const Point_2 & + decltype(auto) operator()( const Triangle_2& t, int i) const { return t.rep().vertex(i); } @@ -3757,6 +3595,7 @@ namespace CartesianKernelFunctors { template class Coplanar_orientation_3 { + typedef typename K::Orientation Orientation; typedef typename K::Point_3 Point_3; #ifdef CGAL_kernel_exactness_preconditions typedef typename K::Coplanar_3 Coplanar_3; @@ -3764,9 +3603,8 @@ namespace CartesianKernelFunctors { Coplanar_3 cp; Collinear_3 cl; #endif // CGAL_kernel_exactness_preconditions - public: - typedef typename K::Orientation result_type; + public: #ifdef CGAL_kernel_exactness_preconditions Coplanar_orientation_3() {} Coplanar_orientation_3(const Coplanar_3& cp_, const Collinear_3& cl_) @@ -3774,7 +3612,7 @@ namespace CartesianKernelFunctors { {} #endif // CGAL_kernel_exactness_preconditions - result_type + Orientation operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { return coplanar_orientationC3(p.x(), p.y(), p.z(), @@ -3782,7 +3620,7 @@ namespace CartesianKernelFunctors { r.x(), r.y(), r.z()); } - result_type + Orientation operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const { @@ -3805,16 +3643,16 @@ namespace CartesianKernelFunctors { template class Coplanar_side_of_bounded_circle_3 { - typedef typename K::Point_3 Point_3; + typedef typename K::Bounded_side Bounded_side; + typedef typename K::Point_3 Point_3; #ifdef CGAL_kernel_exactness_preconditions typedef typename K::Coplanar_3 Coplanar_3; typedef typename K::Collinear_3 Collinear_3; Coplanar_3 cp; Collinear_3 cl; #endif // CGAL_kernel_exactness_preconditions - public: - typedef typename K::Bounded_side result_type; + public: #ifdef CGAL_kernel_exactness_preconditions Coplanar_side_of_bounded_circle_3() {} Coplanar_side_of_bounded_circle_3(const Coplanar_3& cp_, @@ -3823,7 +3661,7 @@ namespace CartesianKernelFunctors { {} #endif // CGAL_kernel_exactness_preconditions - result_type + Bounded_side operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& t) const { @@ -3843,11 +3681,11 @@ namespace CartesianKernelFunctors { template class Equal_xy_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_3& p, const Point_3& q) const { return CGAL_AND( p.x() == q.x() , p.y() == q.y() ); @@ -3857,11 +3695,11 @@ namespace CartesianKernelFunctors { template class Equal_x_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_2& p, const Point_2& q) const { return p.x() == q.x(); } }; @@ -3869,11 +3707,11 @@ namespace CartesianKernelFunctors { template class Equal_x_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_3& p, const Point_3& q) const { return p.x() == q.x(); } }; @@ -3881,11 +3719,11 @@ namespace CartesianKernelFunctors { template class Equal_y_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_2& p, const Point_2& q) const { return p.y() == q.y(); } }; @@ -3893,11 +3731,11 @@ namespace CartesianKernelFunctors { template class Equal_y_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_3& p, const Point_3& q) const { return p.y() == q.y(); } }; @@ -3905,11 +3743,11 @@ namespace CartesianKernelFunctors { template class Equal_z_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_3& p, const Point_3& q) const { return p.z() == q.z(); } }; @@ -3917,6 +3755,7 @@ namespace CartesianKernelFunctors { template class Has_on_3 { + typedef typename K::Boolean Boolean; typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; @@ -3927,30 +3766,29 @@ namespace CartesianKernelFunctors { typedef typename K::Triangle_3 Triangle_3; typedef typename K::Circle_3 Circle_3; typedef typename K::Sphere_3 Sphere_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Line_3& l, const Point_3& p) const { return l.rep().has_on(p); } - result_type + Boolean operator()( const Ray_3& r, const Point_3& p) const { return r.rep().has_on(p); } - result_type + Boolean operator()( const Segment_3& s, const Point_3& p) const { return s.rep().has_on(p); } - result_type + Boolean operator()( const Plane_3& pl, const Point_3& p) const { return pl.rep().has_on(p); } - result_type + Boolean operator()( const Plane_3& pl, const Line_3& l) const { return pl.rep().has_on(l); } - result_type + Boolean operator()( const Triangle_3& t, const Point_3& p) const { Point_3 o = t.vertex(0) + t.supporting_plane().orthogonal_vector(); @@ -3964,19 +3802,19 @@ namespace CartesianKernelFunctors { && ((alpha+beta+gamma == denum)); } - result_type + Boolean operator()(const Circle_3 &a, const Point_3 &p) const { return a.rep().has_on(p); } - Needs_FT + Needs_FT operator()(const Sphere_3 &a, const Circle_3 &p) const { return a.rep().has_on(p); } - result_type + Boolean operator()(const Sphere_3 &a, const Point_3 &p) const { return a.rep().has_on(p); } - result_type + Boolean operator()(const Plane_3 &a, const Circle_3 &p) const { return a.rep().has_on(p); } @@ -3986,11 +3824,11 @@ namespace CartesianKernelFunctors { template class Less_distance_to_point_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { return has_smaller_dist_to_pointC2(p.x(), p.y(), @@ -4002,11 +3840,11 @@ namespace CartesianKernelFunctors { template class Less_distance_to_point_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { return has_smaller_dist_to_pointC3(p.x(), p.y(), p.z(), @@ -4019,13 +3857,13 @@ namespace CartesianKernelFunctors { template class Less_signed_distance_to_line_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; typedef typename K::Equal_2 Equal_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()(const Point_2& a, const Point_2& b, const Point_2& c, const Point_2& d) const { @@ -4037,7 +3875,7 @@ namespace CartesianKernelFunctors { d.x(), d.y()) == SMALLER; } - result_type + Boolean operator()(const Line_2& l, const Point_2& p, const Point_2& q) const { return has_smaller_signed_dist_to_directionC2(l.a(), l.b(), @@ -4049,13 +3887,13 @@ namespace CartesianKernelFunctors { template class Less_signed_distance_to_plane_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Plane_3 Plane_3; typedef typename K::Collinear_3 Collinear_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Plane_3& h, const Point_3& p, const Point_3& q) const { return has_smaller_signed_dist_to_directionC3(h.a(), h.b(), h.c(), @@ -4063,7 +3901,7 @@ namespace CartesianKernelFunctors { q.x(), q.y(), q.z()); } - result_type + Boolean operator()( const Point_3& hp, const Point_3& hq, const Point_3& hr, const Point_3& p, const Point_3& q) const { @@ -4080,16 +3918,17 @@ namespace CartesianKernelFunctors { template class Less_xyz_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Compare_xyz_3 Compare_xyz_3; - Compare_xyz_3 c; - public: - typedef typename K::Boolean result_type; + Compare_xyz_3 c; + + public: Less_xyz_3() {} Less_xyz_3(const Compare_xyz_3& c_) : c(c_) {} - result_type + Boolean operator()( const Point_3& p, const Point_3& q) const { return c(p, q) == SMALLER; } }; @@ -4097,16 +3936,17 @@ namespace CartesianKernelFunctors { template class Less_xy_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Compare_xy_2 Compare_xy_2; - Compare_xy_2 c; - public: - typedef typename K::Boolean result_type; + Compare_xy_2 c; + + public: Less_xy_2() {} Less_xy_2(const Compare_xy_2& c_) : c(c_) {} - result_type + Boolean operator()( const Point_2& p, const Point_2& q) const { return c(p, q) == SMALLER; } }; @@ -4114,16 +3954,17 @@ namespace CartesianKernelFunctors { template class Less_xy_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Compare_xy_3 Compare_xy_3; - Compare_xy_3 c; - public: - typedef typename K::Boolean result_type; + Compare_xy_3 c; + + public: Less_xy_3() {} Less_xy_3(const Compare_xy_3& c_) : c(c_) {} - result_type + Boolean operator()( const Point_3& p, const Point_3& q) const { return c(p, q) == SMALLER; } }; @@ -4131,11 +3972,11 @@ namespace CartesianKernelFunctors { template class Less_x_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_2& p, const Point_2& q) const { return p.x() < q.x(); } }; @@ -4143,11 +3984,11 @@ namespace CartesianKernelFunctors { template class Less_x_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_3& p, const Point_3& q) const { return p.x() < q.x(); } }; @@ -4155,11 +3996,11 @@ namespace CartesianKernelFunctors { template class Less_yx_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_2& p, const Point_2& q) const { return compare_lexicographically_xyC2(p.y(), p.x(), @@ -4170,11 +4011,11 @@ namespace CartesianKernelFunctors { template class Less_y_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_2& p, const Point_2& q) const { return p.y() < q.y(); } }; @@ -4182,11 +4023,11 @@ namespace CartesianKernelFunctors { template class Less_y_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_3& p, const Point_3& q) const { return p.y() < q.y(); } }; @@ -4194,11 +4035,11 @@ namespace CartesianKernelFunctors { template class Less_z_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_3& p, const Point_3& q) const { return p.z() < q.z(); } }; @@ -4206,24 +4047,25 @@ namespace CartesianKernelFunctors { template class Orientation_2 { + typedef typename K::Orientation Orientation; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; typedef typename K::Circle_2 Circle_2; - public: - typedef typename K::Orientation result_type; - result_type operator()(const Point_2& p, const Point_2& q, const Point_2& r) const + public: + Orientation + operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { return orientationC2(p.x(), p.y(), q.x(), q.y(), r.x(), r.y()); } - result_type + Orientation operator()(const Vector_2& u, const Vector_2& v) const { return orientationC2(u.x(), u.y(), v.x(), v.y()); } - result_type + Orientation operator()(const Circle_2& c) const { return c.rep().orientation(); @@ -4233,14 +4075,14 @@ namespace CartesianKernelFunctors { template class Orientation_3 { + typedef typename K::Orientation Orientation; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; typedef typename K::Sphere_3 Sphere_3; - public: - typedef typename K::Orientation result_type; - result_type + public: + Orientation operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const { @@ -4250,7 +4092,7 @@ namespace CartesianKernelFunctors { s.x(), s.y(), s.z()); } - result_type + Orientation operator()( const Vector_3& u, const Vector_3& v, const Vector_3& w) const { return orientationC3(u.x(), u.y(), u.z(), @@ -4258,7 +4100,7 @@ namespace CartesianKernelFunctors { w.x(), w.y(), w.z()); } - result_type + Orientation operator()( Origin, const Point_3& u, const Point_3& v, const Point_3& w) const { @@ -4267,13 +4109,13 @@ namespace CartesianKernelFunctors { w.x(), w.y(), w.z()); } - result_type + Orientation operator()( const Tetrahedron_3& t) const { return t.rep().orientation(); } - result_type + Orientation operator()(const Sphere_3& s) const { return s.rep().orientation(); @@ -4284,10 +4126,8 @@ namespace CartesianKernelFunctors { class Power_side_of_oriented_power_circle_2 { public: - typedef typename K::Weighted_point_2 Weighted_point_2; typedef typename K::Oriented_side Oriented_side; - - typedef Oriented_side result_type; + typedef typename K::Weighted_point_2 Weighted_point_2; Oriented_side operator()(const Weighted_point_2& p, const Weighted_point_2& q, @@ -4336,24 +4176,24 @@ namespace CartesianKernelFunctors { template class Oriented_side_2 { + typedef typename K::Oriented_side Oriented_side; typedef typename K::Point_2 Point_2; typedef typename K::Circle_2 Circle_2; typedef typename K::Line_2 Line_2; typedef typename K::Triangle_2 Triangle_2; typedef typename K::Segment_2 Segment_2; typedef typename K::FT FT; - public: - typedef typename K::Oriented_side result_type; - result_type + public: + Oriented_side operator()( const Circle_2& c, const Point_2& p) const { return enum_cast(c.bounded_side(p)) * c.orientation(); } - result_type + Oriented_side operator()( const Line_2& l, const Point_2& p) const { return side_of_oriented_lineC2(l.a(), l.b(), l.c(), p.x(), p.y()); } - result_type + Oriented_side operator()( const Triangle_2& t, const Point_2& p) const { typename K::Collinear_are_ordered_along_line_2 @@ -4379,7 +4219,7 @@ namespace CartesianKernelFunctors { : opposite(ot); } - result_type + Oriented_side operator()(const Segment_2& s, const Triangle_2& t) const { typename K::Construct_source_2 source; @@ -4407,11 +4247,11 @@ namespace CartesianKernelFunctors { template class Side_of_bounded_circle_2 { + typedef typename K::Bounded_side Bounded_side; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Bounded_side result_type; - result_type + public: + Bounded_side operator()( const Point_2& p, const Point_2& q, const Point_2& t) const { return side_of_bounded_circleC2(p.x(), p.y(), @@ -4419,7 +4259,7 @@ namespace CartesianKernelFunctors { t.x(), t.y()); } - result_type + Bounded_side operator()( const Point_2& p, const Point_2& q, const Point_2& r, const Point_2& t) const { @@ -4431,11 +4271,11 @@ namespace CartesianKernelFunctors { template class Side_of_bounded_sphere_3 { + typedef typename K::Bounded_side Bounded_side; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Bounded_side result_type; - result_type + public: + Bounded_side operator()( const Point_3& p, const Point_3& q, const Point_3& test) const { return side_of_bounded_sphereC3(p.x(), p.y(), p.z(), @@ -4443,7 +4283,7 @@ namespace CartesianKernelFunctors { test.x(), test.y(), test.z()); } - result_type + Bounded_side operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& test) const { @@ -4453,7 +4293,7 @@ namespace CartesianKernelFunctors { test.x(), test.y(), test.z()); } - result_type + Bounded_side operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s, const Point_3& test) const { @@ -4468,11 +4308,11 @@ namespace CartesianKernelFunctors { template class Side_of_oriented_circle_2 { + typedef typename K::Oriented_side Oriented_side; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Oriented_side result_type; - result_type + public: + Oriented_side operator()( const Point_2& p, const Point_2& q, const Point_2& r, const Point_2& t) const { @@ -4486,11 +4326,11 @@ namespace CartesianKernelFunctors { template class Side_of_oriented_sphere_3 { + typedef typename K::Oriented_side Oriented_side; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Oriented_side result_type; - result_type + public: + Oriented_side operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s, const Point_3& test) const { diff --git a/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h b/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h index ff7119586a5..d4cea361700 100644 --- a/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h +++ b/Circular_kernel_3/include/CGAL/Circular_kernel_3/function_objects_polynomial_sphere.h @@ -72,13 +72,10 @@ template < class SK > \ class Compute_circular_x_3 { typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; - typedef typename SK::Root_of_2 Root_of_2; public: - - typedef const Root_of_2& result_type; - - result_type operator() (const Circular_arc_point_3 & a) const + // SK::Root_of_2 + decltype(auto) operator() (const Circular_arc_point_3 & a) const { return (a.rep().x()); } }; @@ -86,13 +83,10 @@ template < class SK > \ class Compute_circular_y_3 { typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; - typedef typename SK::Root_of_2 Root_of_2; public: - - typedef const Root_of_2& result_type; - - result_type operator() (const Circular_arc_point_3 & a) const + // SK::Root_of_2 + decltype(auto) operator() (const Circular_arc_point_3 & a) const { return (a.rep().y()); } }; @@ -100,13 +94,10 @@ template < class SK > \ class Compute_circular_z_3 { typedef typename SK::Circular_arc_point_3 Circular_arc_point_3; - typedef typename SK::Root_of_2 Root_of_2; public: - - typedef const Root_of_2& result_type; - - result_type operator() (const Circular_arc_point_3 & a) const + // SK::Root_of_2 + decltype(auto) operator() (const Circular_arc_point_3 & a) const { return (a.rep().z()); } }; @@ -309,83 +300,78 @@ template < class SK > \ class Construct_sphere_3 { typedef typename SK::Circular_arc_3 Circular_arc_3; - typedef typename SK::Linear_kernel LK; - typedef typename LK::Point_3 Point_3; - typedef typename LK::Circle_3 Circle_3; - typedef typename LK::Sphere_3 Sphere_3; + typedef typename SK::Sphere_3 Sphere_3; + typedef typename SK::Point_3 Point_3; + typedef typename SK::Circle_3 Circle_3; + typedef typename SK::FT FT; + + typedef typename SK::Linear_kernel LK; typedef typename LK::Construct_sphere_3 LK_Construct_sphere_3; - typedef typename LK::FT FT; public: - - typedef typename SK::Linear_kernel::Construct_sphere_3::result_type result_type; - - result_type + Sphere_3 operator()( Return_base_tag tag, const Point_3& center, const FT& squared_radius, Orientation orientation = COUNTERCLOCKWISE) const { return LK_Construct_sphere_3()(tag, center, squared_radius, orientation); } - result_type + Sphere_3 operator()( Return_base_tag tag, const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const { return LK_Construct_sphere_3()(tag, p, q, r, s); } - result_type + Sphere_3 operator()( Return_base_tag tag, const Point_3& p, const Point_3& q, const Point_3& r, Orientation orientation = COUNTERCLOCKWISE) const { return LK_Construct_sphere_3()(tag, p, q, r, orientation); } - result_type + Sphere_3 operator()( Return_base_tag tag, const Point_3& p, const Point_3& q, Orientation orientation = COUNTERCLOCKWISE) const { return LK_Construct_sphere_3()(tag, p, q, orientation); } - result_type + Sphere_3 operator()( Return_base_tag tag, const Point_3& center, Orientation orientation = COUNTERCLOCKWISE) const { return LK_Construct_sphere_3()(tag, center, orientation); } - result_type + decltype(auto) operator() (Return_base_tag tag, const Circle_3 & c) const { return LK_Construct_sphere_3()(tag, c); } - - - - result_type + Sphere_3 operator()( const Point_3& center, const FT& squared_radius, Orientation orientation = COUNTERCLOCKWISE) const { return LK_Construct_sphere_3()(center, squared_radius, orientation); } - result_type + Sphere_3 operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const { return LK_Construct_sphere_3()(p, q, r, s); } - result_type + Sphere_3 operator()( const Point_3& p, const Point_3& q, const Point_3& r, Orientation orientation = COUNTERCLOCKWISE) const { return LK_Construct_sphere_3()(p, q, r, orientation); } - result_type + Sphere_3 operator()( const Point_3& p, const Point_3& q, Orientation orientation = COUNTERCLOCKWISE) const { return LK_Construct_sphere_3()(p, q, orientation); } - result_type + Sphere_3 operator()( const Point_3& center, Orientation orientation = COUNTERCLOCKWISE) const { return LK_Construct_sphere_3()(center, orientation); } - result_type + decltype(auto) operator() (const Circle_3 & c) const { return LK_Construct_sphere_3()(c); } - result_type + Sphere_3 operator() ( const typename SK::Polynomial_for_spheres_2_3 &eq ) { return SphericalFunctors::construct_sphere_3(eq); } - result_type operator() (const Circular_arc_3 & c) const + decltype(auto) operator() (const Circular_arc_3 & c) const { return c.rep().diametral_sphere(); } }; @@ -394,93 +380,89 @@ template < class SK > \ class Construct_plane_3 { typedef typename SK::Circular_arc_3 Circular_arc_3; + typedef typename SK::RT RT; + typedef typename SK::Point_3 Point_3; + typedef typename SK::Vector_3 Vector_3; + typedef typename SK::Direction_3 Direction_3; + typedef typename SK::Line_3 Line_3; + typedef typename SK::Ray_3 Ray_3; + typedef typename SK::Segment_3 Segment_3; + typedef typename SK::Plane_3 Plane_3; + typedef typename SK::Circle_3 Circle_3; + typedef typename SK::Linear_kernel LK; typedef typename LK::Construct_plane_3 LK_Construct_plane_3; - typedef typename LK::RT RT; - typedef typename LK::Point_3 Point_3; - typedef typename LK::Vector_3 Vector_3; - typedef typename LK::Direction_3 Direction_3; - typedef typename LK::Line_3 Line_3; - typedef typename LK::Ray_3 Ray_3; - typedef typename LK::Segment_3 Segment_3; - typedef typename LK::Plane_3 Plane_3; - typedef typename LK::Circle_3 Circle_3; public: - - typedef typename SK::Linear_kernel::Construct_plane_3::result_type result_type; - - public: - - result_type + Plane_3 operator()(Return_base_tag tag, const RT& a, const RT& b, const RT& c, const RT& d) const { return LK_Construct_plane_3()(tag, a, b, c, d); } - result_type + Plane_3 operator()(Return_base_tag tag, const Point_3& p, const Point_3& q, const Point_3& r) const { return LK_Construct_plane_3()(tag, p, q, r); } - result_type + Plane_3 operator()(Return_base_tag tag, const Point_3& p, const Direction_3& d) const { return LK_Construct_plane_3()(tag, p, d); } - result_type + Plane_3 operator()(Return_base_tag tag, const Point_3& p, const Vector_3& v) const { return LK_Construct_plane_3()(tag, p, v); } - result_type + Plane_3 operator()(Return_base_tag tag, const Line_3& l, const Point_3& p) const { return LK_Construct_plane_3()(tag, l, p); } - result_type + Plane_3 operator()(Return_base_tag tag, const Ray_3& r, const Point_3& p) const { return LK_Construct_plane_3()(tag, r, p); } - result_type + Plane_3 operator()(Return_base_tag tag, const Segment_3& s, const Point_3& p) const { return LK_Construct_plane_3()(tag, s, p); } - result_type + decltype(auto) operator()(Return_base_tag tag, const Circle_3 & c) const { return LK_Construct_plane_3()(tag, c); } - result_type + Plane_3 operator()(const RT& a, const RT& b, const RT& c, const RT& d) const { return this->operator()(Return_base_tag(), a, b, c, d); } - result_type + Plane_3 operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { return this->operator()(Return_base_tag(), p, q, r); } - result_type + Plane_3 operator()(const Point_3& p, const Direction_3& d) const { return this->operator()(Return_base_tag(), p, d); } - result_type + Plane_3 operator()(const Point_3& p, const Vector_3& v) const { return this->operator()(Return_base_tag(), p, v); } - result_type + Plane_3 operator()(const Line_3& l, const Point_3& p) const { return this->operator()(Return_base_tag(), l, p); } - result_type + Plane_3 operator()(const Ray_3& r, const Point_3& p) const { return this->operator()(Return_base_tag(), r, p); } - result_type + Plane_3 operator()(const Segment_3& s, const Point_3& p) const { return this->operator()(Return_base_tag(), s, p); } - result_type + decltype(auto) operator()(const Circle_3 & c) const { return this->operator()(Return_base_tag(), c); } - result_type + Plane_3 operator() ( const typename SK::Polynomial_1_3 &eq ) { return SphericalFunctors::construct_plane_3(eq); } - result_type operator() (const Circular_arc_3 & c) const + decltype(auto) operator() (const Circular_arc_3 & c) const { return c.rep().supporting_plane(); } }; @@ -498,54 +480,53 @@ template < class SK > \ typedef typename SK::Ray_3 Ray_3; public: typedef typename SK::Linear_kernel::Construct_line_3 LK_Construct_line_3; - typedef typename LK_Construct_line_3::result_type result_type; - result_type + Line_3 operator()(Return_base_tag, const Point_3& p, const Point_3& q) const { return LK_Construct_line_3()(p, Vector_3(p, q)); } - result_type + Line_3 operator()(Return_base_tag, const Point_3& p, const Direction_3& d) const { return operator()(Return_base_tag(), p, Vector_3(d.dx(), d.dy(), d.dz())); } - result_type + Line_3 operator()(Return_base_tag, const Point_3& p, const Vector_3& v) const { return LK_Construct_line_3()(p, v); } - result_type + Line_3 operator()(Return_base_tag, const Segment_3& s) const { return LK_Construct_line_3()(s.source(), Vector_3(s.source(), s.target())); } - result_type + Line_3 operator()(Return_base_tag, const Ray_3& r) const { return LK_Construct_line_3()(r.source(), Vector_3(r.source(), r.second_point())); } - result_type + Line_3 operator()(const Point_3& p, const Point_3& q) const { return this->operator()(Return_base_tag(), p, q); } - result_type + Line_3 operator()(const Point_3& p, const Direction_3& d) const { return this->operator()(Return_base_tag(), p, d); } - result_type + Line_3 operator()(const Point_3& p, const Vector_3& v) const { return this->operator()(Return_base_tag(), p, v); } - result_type + Line_3 operator()(const Segment_3& s) const { return this->operator()(Return_base_tag(), s); } - result_type + Line_3 operator()(const Ray_3& r) const { return this->operator()(Return_base_tag(), r); } - const result_type& + decltype(auto) operator() (const Line_arc_3 & a) const { return (a.rep().supporting_line()); } - result_type + Line_3 operator() ( const typename SK::Polynomials_for_line_3 &eq ) { return SphericalFunctors::construct_line_3(eq); } @@ -554,8 +535,6 @@ template < class SK > \ template < class SK > class Construct_circle_3 { - typedef typename SK::Linear_kernel::Construct_circle_3 Extended; - typedef typename Extended::result_type forwarded_result_type; typedef typename SK::FT FT; typedef typename SK::Point_3 Point_3; typedef typename SK::Plane_3 Plane_3; @@ -564,57 +543,57 @@ template < class SK > \ typedef typename SK::Vector_3 Vector_3; typedef typename SK::Direction_3 Direction_3; typedef typename SK::Circular_arc_3 Circular_arc_3; - typedef typename SK::Kernel_base::Circle_3 RCircle_3; typedef typename Circle_3::Rep Rep; - public: - forwarded_result_type + typedef typename SK::Linear_kernel::Construct_circle_3 LK_Construct_circle_3; + + public: + Circle_3 operator()(const Point_3& p, const FT& sr, const Plane_3& plane) const - { return Extended()(p, sr, plane); } + { return LK_Construct_circle_3()(p, sr, plane); } - forwarded_result_type + Circle_3 operator() (const Point_3& p, const FT& sr, const Vector_3& v) const - { return Extended()(p, sr, v); } + { return LK_Construct_circle_3()(p, sr, v); } - forwarded_result_type + Circle_3 operator() (const Point_3& p, const FT& sr, const Direction_3& d) const - { return Extended()(p, sr, d); } + { return LK_Construct_circle_3()(p, sr, d); } - forwarded_result_type + Circle_3 operator() (const Sphere_3& s1, const Sphere_3& s2) const - { return Extended()(s1, s2); } + { return LK_Construct_circle_3()(s1, s2); } - forwarded_result_type + Circle_3 operator() (const Plane_3& p, const Sphere_3& s) const - { return Extended()(p, s); } + { return LK_Construct_circle_3()(p, s); } - forwarded_result_type + Circle_3 operator() (const Sphere_3& s, const Plane_3& p) const - { return Extended()(p, s); } + { return LK_Construct_circle_3()(p, s); } - forwarded_result_type + Circle_3 operator() (const Plane_3& p, const Sphere_3& s, int a) const - { return Extended()(p, s, a); } + { return LK_Construct_circle_3()(p, s, a); } - forwarded_result_type + Circle_3 operator() (const Sphere_3& s, const Plane_3& p, int a) const - { return Extended()(p, s, a); } + { return LK_Construct_circle_3()(p, s, a); } - forwarded_result_type + Circle_3 operator()( const Point_3& p1, const Point_3& p2, const Point_3& p3) const - { return Extended()(p1, p2, p3); } + { return LK_Construct_circle_3()(p1, p2, p3); } - forwarded_result_type + Circle_3 operator() ( const typename SK::Polynomials_for_circle_3 &eq ) - { return Rep(construct_circle_3(eq)); } + { return construct_circle_3(eq); } - const forwarded_result_type& + decltype(auto) operator() (const Circular_arc_3 & a) const { return (a.rep().supporting_circle()); } - }; template < class SK > @@ -1297,18 +1276,15 @@ template < class SK > \ typedef typename SK::Line_arc_3 Line_arc_3; public: - - typedef typename SK::Linear_kernel::Construct_bbox_3::result_type result_type; - using SK::Linear_kernel::Construct_bbox_3::operator(); - result_type operator() (const Circular_arc_point_3 & c) const + decltype(auto) operator() (const Circular_arc_point_3 & c) const { return c.rep().bbox(); } - result_type operator() (const Line_arc_3 & l) const + decltype(auto) operator() (const Line_arc_3 & l) const { return l.rep().bbox(); } - result_type operator() (const Circular_arc_3 & c) const + decltype(auto) operator() (const Circular_arc_3 & c) const { return c.rep().bbox(); } }; @@ -1322,8 +1298,8 @@ template < class SK > \ typedef typename SK::FT FT; public: - typedef double result_type; + using SK::Linear_kernel::Compute_approximate_squared_length_3::operator(); result_type operator() (const Circular_arc_3 & c) const @@ -1341,7 +1317,6 @@ template < class SK > \ typedef typename SK::FT FT; public: - typedef double result_type; using SK::Linear_kernel::Compute_approximate_angle_3::operator(); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Angle_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Angle_3.h index e9428fd2917..f54f028d47d 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Angle_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Angle_3.h @@ -34,13 +34,12 @@ template < typename K_base > class Angle_3 : public K_base::Angle_3 { - typedef typename K_base::Point_3 Point_3; + typedef typename K_base::Angle Angle; + typedef typename K_base::Point_3 Point_3; + typedef typename K_base::Angle_3 Base; 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); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Collinear_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Collinear_3.h index 9279f60c3d2..4dd64070b5c 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Collinear_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Collinear_3.h @@ -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; + + 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); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_distance_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_distance_3.h index f3880b3f0e2..4589aa9aa81 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_distance_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_distance_3.h @@ -30,17 +30,16 @@ template < typename K_base > class Compare_distance_3 : public K_base::Compare_distance_3 { - typedef typename K_base::Point_3 Point_3; - typedef typename K_base::Vector_3 Vector_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); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_squared_radius_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_squared_radius_3.h index 8e0683677aa..aecee9d3618 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_squared_radius_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_squared_radius_3.h @@ -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::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::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: 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(int_tmp_result); + return static_cast(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 diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_weighted_squared_radius_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_weighted_squared_radius_3.h index 41b9f1b9e77..3a8afc92ba3 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_weighted_squared_radius_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_weighted_squared_radius_3.h @@ -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::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::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: 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, diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_x_2.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_x_2.h index 29c6d291051..3478f524983 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_x_2.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_x_2.h @@ -31,17 +31,16 @@ template < typename K_base > class Compare_x_2 : public K_base::Compare_x_2 { - typedef typename K_base::Point_2 Point_2; - typedef typename K_base::Line_2 Line_2; - typedef typename K_base::Compare_x_2 Base; + 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); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_y_2.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_y_2.h index da9b97215a8..043a174ce99 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_y_2.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_y_2.h @@ -31,17 +31,16 @@ template < typename K_base > class Compare_y_2 : public K_base::Compare_y_2 { - typedef typename K_base::Point_2 Point_2; - typedef typename K_base::Line_2 Line_2; - typedef typename K_base::Compare_y_2 Base; + 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); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_y_at_x_2.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_y_at_x_2.h index 5de1af9d7b2..8c9204f718f 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_y_at_x_2.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Compare_y_at_x_2.h @@ -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::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; + 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 diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Coplanar_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Coplanar_3.h index fedf31fcba9..38c4384769c 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Coplanar_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Coplanar_3.h @@ -25,17 +25,14 @@ template < typename K_base, typename SFK > class Coplanar_3 : public K_base::Coplanar_3 { - typedef typename K_base::Point_3 Point_3; + typedef typename K_base::Boolean Boolean; + typedef typename K_base::Point_3 Point_3; + typedef typename K_base::Coplanar_3 Base; typedef typename 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; diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Coplanar_orientation_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Coplanar_orientation_3.h index 212dddec6cf..255f95c1ab7 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Coplanar_orientation_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Coplanar_orientation_3.h @@ -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( diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Do_intersect_2.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Do_intersect_2.h index a5533c253fa..088648b9d72 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Do_intersect_2.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Do_intersect_2.h @@ -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()); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Do_intersect_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Do_intersect_3.h index 2b0ef97d7fc..1d19ce5a469 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Do_intersect_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Do_intersect_3.h @@ -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 ub = + const Uncertain ub = Intersections::internal::do_intersect_bbox_segment_aux 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 ub = + const Uncertain ub = Intersections::internal::do_intersect_bbox_segment_aux 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 : ") + diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Equal_2.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Equal_2.h index 60b2360a939..79832da2535 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Equal_2.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Equal_2.h @@ -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); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Equal_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Equal_3.h index 10c44051ae2..5d04c892d7f 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Equal_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Equal_3.h @@ -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); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Is_degenerate_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Is_degenerate_3.h index a4af481f7e1..6b43f629126 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Is_degenerate_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Is_degenerate_3.h @@ -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 : ") + diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_2.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_2.h index cbb4494e7cd..11cd803458a 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_2.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_2.h @@ -25,16 +25,14 @@ 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; + typedef typename K_base::Circle_2 Circle_2; typedef typename K_base::Orientation_2 Base; public: - - typedef typename Base::result_type result_type; - using Base::operator(); Orientation diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_3.h index 2fdffde6fda..f7d126dfaf0 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Orientation_3.h @@ -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 { diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Power_side_of_oriented_power_sphere_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Power_side_of_oriented_power_sphere_3.h index d4621b756a5..fe2057ca243 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Power_side_of_oriented_power_sphere_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Power_side_of_oriented_power_sphere_3.h @@ -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); @@ -410,7 +410,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates { } } } - return static_cast(cmp * int_tmp_result_FFWKCAA); + return static_cast(cmp * int_tmp_result_FFWKCAA); } int int_tmp_result_k60Ocge; double RT_tmp_result_3SPBwDj = CGAL::determinant( dpx, dpz, dpt, dqx, dqz, dqt, drx, drz, drt ); @@ -498,7 +498,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates { } } } - return static_cast(cmp * int_tmp_result_k3Lzf6g); + return static_cast(cmp * int_tmp_result_k3Lzf6g); } int int_tmp_result_AvrrXBP; double RT_tmp_result_feLwnHn = CGAL::determinant( dpy, dpz, dpt, dqy, dqz, dqt, dry, drz, drt ); @@ -581,15 +581,15 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates { } } } - return static_cast(cmp * int_tmp_result_agX3WsT); + return static_cast(cmp * int_tmp_result_agX3WsT); } 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); @@ -679,7 +679,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates { } } } - return static_cast(cmp * int_tmp_result); + return static_cast(cmp * int_tmp_result); } cmp = ((py > qy) ? 1 : ((py < qy) ? -1 : 0)); if( (cmp != 0) ) @@ -722,7 +722,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates { } } } - return static_cast(cmp * int_tmp_result_FFWKCAA); + return static_cast(cmp * int_tmp_result_FFWKCAA); } cmp = ((pz > qz) ? 1 : ((pz < qz) ? -1 : 0)); int int_tmp_result_3SPBwDj; @@ -765,7 +765,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates { } } } - return static_cast(cmp * int_tmp_result_3SPBwDj); + return static_cast(cmp * int_tmp_result_3SPBwDj); } else return Base::operator()(p,q,t); diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Side_of_oriented_circle_2.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Side_of_oriented_circle_2.h index 3b59fed08db..0762a4948f4 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Side_of_oriented_circle_2.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Side_of_oriented_circle_2.h @@ -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 { diff --git a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Side_of_oriented_sphere_3.h b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Side_of_oriented_sphere_3.h index 41a54d33012..90b128c5eee 100644 --- a/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Side_of_oriented_sphere_3.h +++ b/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Side_of_oriented_sphere_3.h @@ -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 diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h index 3028950d7af..c7aefef8197 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h @@ -49,26 +49,27 @@ namespace HomogeneousKernelFunctors { template class Angle_2 { + typedef typename K::Angle Angle; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; typedef typename K::Construct_vector_2 Construct_vector_2; - Construct_vector_2 c; - public: - typedef typename K::Angle result_type; + Construct_vector_2 c; + + public: Angle_2() {} Angle_2(const Construct_vector_2& c_) : c(c_) {} - result_type + Angle operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { return operator()(c(q,p), c(q,r)); } - result_type + Angle operator()(const Point_2& p, const Point_2& q, const Point_2& r, const Point_2& s) const { return operator()(c(q,p), c(s,r)); } - result_type + Angle operator()(const Vector_2& u, const Vector_2& v) const { return enum_cast(CGAL_NTS sign(u * v)); } @@ -78,33 +79,34 @@ namespace HomogeneousKernelFunctors { template class Angle_3 { + typedef typename K::Angle Angle; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; typedef typename K::Construct_vector_3 Construct_vector_3; - Construct_vector_3 c; - public: - typedef typename K::Angle result_type; + Construct_vector_3 c; + + public: Angle_3() {} Angle_3(const Construct_vector_3& c_) : c(c_) {} - result_type + Angle operator()(const Vector_3& u, const Vector_3& v) const { return enum_cast(CGAL_NTS sign(u * v)); } // FIXME: scalar product - result_type + Angle operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { return enum_cast(CGAL_NTS sign(c(q,p) * c(q,r))); } // FIXME: scalar product - result_type + Angle operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const { return enum_cast(CGAL_NTS sign(c(q,p) * c(s,r))); } // FIXME: scalar product - result_type + Angle operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Vector_3& n) const { @@ -116,14 +118,14 @@ namespace HomogeneousKernelFunctors { template class Bounded_side_2 { + typedef typename K::Bounded_side Bounded_side; typedef typename K::Point_2 Point_2; typedef typename K::Circle_2 Circle_2; typedef typename K::Triangle_2 Triangle_2; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; - public: - typedef typename K::Bounded_side result_type; - result_type + public: + Bounded_side operator()( const Circle_2& c, const Point_2& p) const { typename K::Compute_squared_distance_2 squared_distance; @@ -131,7 +133,7 @@ namespace HomogeneousKernelFunctors { squared_distance(c.center(),p))); } - result_type + Bounded_side operator()( const Triangle_2& t, const Point_2& p) const { typename K::Collinear_are_ordered_along_line_2 @@ -154,7 +156,7 @@ namespace HomogeneousKernelFunctors { : ON_UNBOUNDED_SIDE; } - result_type + Bounded_side operator()( const Iso_rectangle_2& r, const Point_2& p) const { return r.rep().bounded_side(p); @@ -164,20 +166,20 @@ namespace HomogeneousKernelFunctors { template class Bounded_side_3 { + typedef typename K::Bounded_side Bounded_side; typedef typename K::RT RT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; typedef typename K::Sphere_3 Sphere_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; - public: - typedef typename K::Bounded_side result_type; - result_type + public: + Bounded_side operator()( const Sphere_3& s, const Point_3& p) const { return s.rep().bounded_side(p); } - result_type + Bounded_side operator()( const Tetrahedron_3& t, const Point_3& p) const { Vector_3 v1 = t.vertex(1)-t.vertex(0); @@ -250,7 +252,7 @@ namespace HomogeneousKernelFunctors { return (t5 && t6) ? ON_BOUNDED_SIDE : ON_BOUNDARY; } - result_type + Bounded_side operator()( const Iso_cuboid_3& c, const Point_3& p) const { return c.rep().bounded_side(p); } }; @@ -258,21 +260,21 @@ namespace HomogeneousKernelFunctors { template class Collinear_are_ordered_along_line_2 { + typedef typename K::Boolean Boolean; typedef typename K::RT RT; typedef typename K::Point_2 Point_2; #ifdef CGAL_kernel_exactness_preconditions typedef typename K::Collinear_2 Collinear_2; Collinear_2 c; #endif // CGAL_kernel_exactness_preconditions - public: - typedef typename K::Boolean result_type; + public: #ifdef CGAL_kernel_exactness_preconditions Collinear_are_ordered_along_line_2() {} Collinear_are_ordered_along_line_2(const Collinear_2& c_) : c(c_) {} #endif // CGAL_kernel_exactness_preconditions - result_type + Boolean operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { CGAL_kernel_exactness_precondition( c(p, q, r) ); @@ -309,20 +311,20 @@ namespace HomogeneousKernelFunctors { template class Collinear_are_ordered_along_line_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; #ifdef CGAL_kernel_exactness_preconditions typedef typename K::Collinear_3 Collinear_3; Collinear_3 c; #endif // CGAL_kernel_exactness_preconditions - public: - typedef typename K::Boolean result_type; + public: #ifdef CGAL_kernel_exactness_preconditions Collinear_are_ordered_along_line_3() {} Collinear_are_ordered_along_line_3(const Collinear_3& c_) : c(c_) {} #endif // CGAL_kernel_exactness_preconditions - result_type + Boolean operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { CGAL_kernel_exactness_precondition( c(p, q, r) ); @@ -390,21 +392,21 @@ namespace HomogeneousKernelFunctors { template class Collinear_are_strictly_ordered_along_line_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; #ifdef CGAL_kernel_exactness_preconditions typedef typename K::Collinear_2 Collinear_2; Collinear_2 c; #endif // CGAL_kernel_exactness_preconditions - public: - typedef typename K::Boolean result_type; + public: #ifdef CGAL_kernel_exactness_preconditions Collinear_are_strictly_ordered_along_line_2() {} Collinear_are_strictly_ordered_along_line_2(const Collinear_2& c_) : c(c_) {} #endif // CGAL_kernel_exactness_preconditions - result_type + Boolean operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { CGAL_kernel_exactness_precondition( c(p, q, r) ); @@ -440,22 +442,22 @@ namespace HomogeneousKernelFunctors { template class Collinear_are_strictly_ordered_along_line_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Direction_3 Direction_3; #ifdef CGAL_kernel_exactness_preconditions typedef typename K::Collinear_3 Collinear_3; Collinear_3 c; #endif // CGAL_kernel_exactness_preconditions - public: - typedef typename K::Boolean result_type; + public: #ifdef CGAL_kernel_exactness_preconditions Collinear_are_strictly_ordered_along_line_3() {} Collinear_are_strictly_ordered_along_line_3(const Collinear_3& c_) : c(c_) {} #endif // CGAL_kernel_exactness_preconditions - result_type + Boolean operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { CGAL_kernel_exactness_precondition( c(p, q, r) ); @@ -469,6 +471,7 @@ namespace HomogeneousKernelFunctors { template class Collinear_has_on_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Direction_2 Direction_2; typedef typename K::Ray_2 Ray_2; @@ -480,23 +483,22 @@ namespace HomogeneousKernelFunctors { Collinear_are_ordered_along_line_2 co; Construct_point_on_2 cp; Compare_xy_2 cxy; - public: - typedef typename K::Boolean result_type; + public: Collinear_has_on_2() {} Collinear_has_on_2(const Construct_point_on_2& cp_, const Compare_xy_2& cxy_) : cp(cp_), cxy(cxy_) {} - result_type + Boolean operator()( const Ray_2& r, const Point_2& p) const { const Point_2 & source = cp(r,0); return p == source || Direction_2(p - source) == r.direction(); } // FIXME - result_type + Boolean operator()( const Segment_2& s, const Point_2& p) const { return co(cp(s,0), p, cp(s,1)); @@ -506,16 +508,17 @@ namespace HomogeneousKernelFunctors { template class Collinear_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Orientation_2 Orientation_2; - Orientation_2 o; - public: - typedef typename K::Boolean result_type; + Orientation_2 o; + + public: Collinear_2() {} Collinear_2(const Orientation_2 o_) : o(o_) {} - result_type + Boolean operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { typedef typename K::RT RT; @@ -558,13 +561,13 @@ namespace HomogeneousKernelFunctors { template class Compare_angle_with_x_axis_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; typedef typename K::Direction_2 Direction_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()(const Direction_2& d1, const Direction_2& d2) const { typedef typename K::RT RT; @@ -625,11 +628,11 @@ namespace HomogeneousKernelFunctors { template class Compare_distance_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { typedef typename K::RT RT; @@ -673,14 +676,14 @@ namespace HomogeneousKernelFunctors { } template - result_type + Comparison_result operator()(const T1& p, const T2& q, const T3& r) const { return CGAL::compare(squared_distance(p, q), squared_distance(p, r)); } template - result_type + Comparison_result operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { return CGAL::compare(squared_distance(p, q), squared_distance(r, s)); @@ -690,11 +693,11 @@ namespace HomogeneousKernelFunctors { template class Compare_distance_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { typedef typename K::RT RT; @@ -724,16 +727,15 @@ namespace HomogeneousKernelFunctors { return CGAL_NTS sign(dosd); } - template - result_type + Comparison_result operator()(const T1& p, const T2& q, const T3& r) const { return CGAL::compare(squared_distance(p, q), squared_distance(p, r)); } template - result_type + Comparison_result operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { return CGAL::compare(squared_distance(p, q), squared_distance(r, s)); @@ -743,13 +745,11 @@ namespace HomogeneousKernelFunctors { template < typename K > class Compare_power_distance_2 { - public: + typedef typename K::Comparison_result Comparison_result; typedef typename K::Weighted_point_2 Weighted_point_2; typedef typename K::Point_2 Point_2; - typedef typename K::Comparison_result Comparison_result; - - typedef Comparison_result result_type; + public: Comparison_result operator()(const Point_2& r, const Weighted_point_2& p, const Weighted_point_2& q) const @@ -763,14 +763,13 @@ namespace HomogeneousKernelFunctors { template class Compare_signed_distance_to_line_2 { - typedef typename K::Point_2 Point_2; - typedef typename K::Line_2 Line_2; + typedef typename K::Comparison_result Comparison_result; + typedef typename K::Point_2 Point_2; + typedef typename K::Line_2 Line_2; typedef typename K::Less_signed_distance_to_line_2 Less_signed_distance_to_line_2; public: - typedef Comparison_result result_type; - - result_type + Comparison_result operator()(const Point_2& p, const Point_2& q, const Point_2& r, const Point_2& s) const { @@ -796,7 +795,7 @@ namespace HomogeneousKernelFunctors { return compare(scaled_dist_r_minus_scaled_dist_s, 0); } - result_type + Comparison_result operator()(const Line_2& l, const Point_2& p, const Point_2& q) const { Less_signed_distance_to_line_2 less = K().less_signed_distance_to_line_2_object(); @@ -809,13 +808,13 @@ namespace HomogeneousKernelFunctors { template class Compare_slope_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; typedef typename K::Segment_2 Segment_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()(const Line_2& l1, const Line_2& l2) const { if (l1.is_horizontal()) @@ -840,22 +839,22 @@ namespace HomogeneousKernelFunctors { CGAL::abs(l1.a() * l2.b()) ); } // FIXME - result_type + Comparison_result operator()(const Segment_2& s1, const Segment_2& s2) const { return (*this)(s1.source(), s1.target(), s2.source(), s2.target()); } - result_type + Comparison_result operator()(const Point_2& s1s, const Point_2& s1t, const Point_2& s2s, const Point_2& s2t) const { typedef typename K::FT FT; - typename K::Comparison_result cmp_y1 = compare_y(s1s, s1t); + Comparison_result cmp_y1 = compare_y(s1s, s1t); if (cmp_y1 == EQUAL) // horizontal { - typename K::Comparison_result cmp_x2 = compare_x(s2s, s2t); + Comparison_result cmp_x2 = compare_x(s2s, s2t); if (cmp_x2 == EQUAL) return SMALLER; FT s_hw = s2s.hw(); @@ -864,10 +863,10 @@ namespace HomogeneousKernelFunctors { CGAL_NTS sign(s2s.hx()*t_hw - s2t.hx()*s_hw); } - typename K::Comparison_result cmp_y2 = compare_y(s2s, s2t); + Comparison_result cmp_y2 = compare_y(s2s, s2t); if (cmp_y2 == EQUAL) { - typename K::Comparison_result cmp_x1 = compare_x(s1s, s1t); + Comparison_result cmp_x1 = compare_x(s1s, s1t); if (cmp_x1 == EQUAL) return LARGER; FT s_hw = s1s.hw(); @@ -876,8 +875,8 @@ namespace HomogeneousKernelFunctors { CGAL_NTS sign(s1s.hx()*t_hw - s1t.hx()*s_hw); } - typename K::Comparison_result cmp_x1 = compare_x(s1s, s1t); - typename K::Comparison_result cmp_x2 = compare_x(s2s, s2t); + Comparison_result cmp_x1 = compare_x(s1s, s1t); + Comparison_result cmp_x2 = compare_x(s2s, s2t); if (cmp_x1 == EQUAL) return cmp_x2 == EQUAL ? EQUAL : LARGER; @@ -909,12 +908,12 @@ namespace HomogeneousKernelFunctors { template class Compare_x_at_y_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_2& p, const Line_2& h) const { typedef typename K::RT RT; @@ -927,17 +926,17 @@ namespace HomogeneousKernelFunctors { return ( ors == ON_NEGATIVE_SIDE ) ? SMALLER : EQUAL; } // FIXME - result_type + Comparison_result operator()( const Point_2& p, const Line_2& h1, const Line_2& h2) const { return CGAL::compare(h1.x_at_y( p.y() ), h2.x_at_y( p.y() )); } // FIXME - result_type + Comparison_result operator()( const Line_2& l1, const Line_2& l2, const Line_2& h) const { return compare_x_at_y( gp_linear_intersection( l1, l2 ), h); } // FIXME - result_type + Comparison_result operator()( const Line_2& l1, const Line_2& l2, const Line_2& h1, const Line_2& h2) const { return compare_x_at_y( gp_linear_intersection( l1, l2 ), h1, h2 ); } @@ -947,11 +946,11 @@ namespace HomogeneousKernelFunctors { template class Compare_xyz_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_3& p, const Point_3& q) const { typedef typename K::RT RT; @@ -986,11 +985,11 @@ namespace HomogeneousKernelFunctors { template class Compare_xy_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_2& p, const Point_2& q) const { typedef typename K::RT RT; @@ -1016,11 +1015,11 @@ namespace HomogeneousKernelFunctors { template class Compare_yx_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_2& p, const Point_2& q) const { typedef typename K::RT RT; @@ -1046,11 +1045,11 @@ namespace HomogeneousKernelFunctors { template class Compare_xy_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_3& p, const Point_3& q) const { typedef typename K::RT RT; @@ -1074,31 +1073,31 @@ namespace HomogeneousKernelFunctors { template class Compare_x_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_2& p, const Point_2& q) const { return CGAL::compare(p.hx()*q.hw(), q.hx()*p.hw()); } - result_type + Comparison_result operator()( const Point_2& p, const Line_2& l1, const Line_2& l2) const { Point_2 ip = gp_linear_intersection( l1, l2 ); return this->operator()(p, ip); } // FIXME - result_type + Comparison_result operator()( const Line_2& l, const Line_2& h1, const Line_2& h2) const { return this->operator()(l, h1, l, h2); } // FIXME - result_type + Comparison_result operator()( const Line_2& l1, const Line_2& l2, const Line_2& h1, const Line_2& h2) const { @@ -1111,11 +1110,11 @@ namespace HomogeneousKernelFunctors { template class Compare_x_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_3& p, const Point_3& q) const { return CGAL::compare(p.hx() * q.hw(), q.hx() * p.hw() ); } }; @@ -1123,13 +1122,13 @@ namespace HomogeneousKernelFunctors { template class Compare_y_at_x_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; typedef typename K::Segment_2 Segment_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_2& p, const Line_2& h) const { CGAL_kernel_precondition( ! h.is_vertical() ); @@ -1139,23 +1138,23 @@ namespace HomogeneousKernelFunctors { return ors; } // FIXME - result_type + Comparison_result operator()( const Point_2& p, const Line_2& h1, const Line_2& h2) const { return CGAL::compare(h1.y_at_x( p.x() ), h2.y_at_x( p.x() )); } // FIXME - result_type + Comparison_result operator()( const Line_2& l1, const Line_2& l2, const Line_2& h) const { return compare_y_at_x( gp_linear_intersection( l1, l2 ), h); } // FIXME - result_type + Comparison_result operator()( const Line_2& l1, const Line_2& l2, const Line_2& h1, const Line_2& h2) const { return compare_y_at_x( gp_linear_intersection( l1, l2 ), h1, h2 ); } // FIXME - result_type + Comparison_result operator()( const Point_2& p, const Segment_2& s) const { // compares the y-coordinates of p and the vertical projection of p on s. @@ -1183,7 +1182,7 @@ namespace HomogeneousKernelFunctors { } } // FIXME - result_type + Comparison_result operator()( const Point_2& p, const Segment_2& s1, const Segment_2& s2) const { @@ -1243,12 +1242,12 @@ namespace HomogeneousKernelFunctors { template class Compare_y_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_2& p, const Point_2& q) const { typedef typename K::RT RT; @@ -1260,20 +1259,20 @@ namespace HomogeneousKernelFunctors { return CGAL::compare(phy * qhw, qhy * phw); } - result_type + Comparison_result operator()( const Point_2& p, const Line_2& l1, const Line_2& l2) const { Point_2 ip = gp_linear_intersection( l1, l2 ); return compare_y( p, ip ); } // FIXME - result_type + Comparison_result operator()( const Line_2& l, const Line_2& h1, const Line_2& h2) const { return this->operator()(l, h1, l, h2); } - result_type + Comparison_result operator()( const Line_2& l1, const Line_2& l2, const Line_2& h1, const Line_2& h2) const { @@ -1286,11 +1285,11 @@ namespace HomogeneousKernelFunctors { template class Compare_y_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_3& p, const Point_3& q) const { return CGAL::compare(p.hy() * q.hw(), q.hy() * p.hw() ); } }; @@ -1298,11 +1297,11 @@ namespace HomogeneousKernelFunctors { template class Compare_z_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()( const Point_3& p, const Point_3& q) const { return CGAL::compare(p.hz() * q.hw(), q.hz() * p.hw() ); } }; @@ -1317,10 +1316,10 @@ namespace HomogeneousKernelFunctors { typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; typedef typename K::Construct_vector_2 Construct_vector_2; - Construct_vector_2 co; - public: - typedef FT result_type; + Construct_vector_2 co; + + public: FT operator()( const Point_2& p, const Point_2& q, const Point_2& r ) const { @@ -1346,10 +1345,9 @@ namespace HomogeneousKernelFunctors { { typedef typename K::FT FT; typedef typename K::Vector_2 Vector_2; - public: - typedef FT result_type; - result_type + public: + FT operator()(const Vector_2& v, const Vector_2& w) const { return determinant(v.hx(), v.hy(), @@ -1362,10 +1360,9 @@ namespace HomogeneousKernelFunctors { { typedef typename K::FT FT; typedef typename K::Vector_3 Vector_3; - public: - typedef FT result_type; - result_type + public: + FT operator()(const Vector_3& v, const Vector_3& w, const Vector_3& t) const { return determinant(v.hx(), v.hy(), v.hz(), @@ -1381,9 +1378,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::RT RT; typedef typename K::FT FT; typedef typename K::Vector_2 Vector_2; - public: - typedef FT result_type; + public: FT operator()(const Vector_2& v, const Vector_2& w) const { @@ -1398,9 +1394,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::RT RT; typedef typename K::FT FT; typedef typename K::Vector_3 Vector_3; - public: - typedef FT result_type; + public: FT operator()(const Vector_3& v, const Vector_3& w) const { @@ -1416,10 +1411,9 @@ namespace HomogeneousKernelFunctors { typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Circle_2 Circle_2; - public: - typedef FT result_type; - FT + public: + decltype(auto) operator()( const Circle_2& c) const { return c.rep().squared_radius(); } @@ -1446,10 +1440,9 @@ namespace HomogeneousKernelFunctors { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Sphere_3 Sphere_3; - public: - typedef FT result_type; - FT + public: + decltype(auto) operator()( const Sphere_3& s) const { return s.rep().squared_radius(); } @@ -1486,9 +1479,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::Vector_3 Vector_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; - public: - typedef FT result_type; + public: FT operator()(const Point_3& p0, const Point_3& p1, const Point_3& p2, const Point_3& p3) const @@ -1531,20 +1523,17 @@ namespace HomogeneousKernelFunctors { template class Compute_x_2 { - typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: - typedef FT result_type; - - FT + decltype(auto) operator()(const Point_2& p) const { return p.rep().x(); } - FT + decltype(auto) operator()(const Vector_2& v) const { return v.rep().x(); @@ -1554,20 +1543,17 @@ namespace HomogeneousKernelFunctors { template class Compute_x_3 { - typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef FT result_type; - - FT + decltype(auto) operator()(const Point_3& p) const { return p.rep().x(); } - FT + decltype(auto) operator()(const Vector_3& v) const { return v.rep().x(); @@ -1577,20 +1563,17 @@ namespace HomogeneousKernelFunctors { template class Compute_y_2 { - typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: - typedef FT result_type; - - FT + decltype(auto) operator()(const Point_2& p) const { return p.rep().y(); } - FT + decltype(auto) operator()(const Vector_2& v) const { return v.rep().y(); @@ -1600,20 +1583,17 @@ namespace HomogeneousKernelFunctors { template class Compute_y_3 { - typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef FT result_type; - - FT + decltype(auto) operator()(const Point_3& p) const { return p.rep().y(); } - FT + decltype(auto) operator()(const Vector_3& v) const { return v.rep().y(); @@ -1623,20 +1603,17 @@ namespace HomogeneousKernelFunctors { template class Compute_z_3 { - typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef FT result_type; - - FT + decltype(auto) operator()(const Point_3& p) const { return p.rep().z(); } - FT + decltype(auto) operator()(const Vector_3& v) const { return v.rep().z(); @@ -1646,13 +1623,10 @@ namespace HomogeneousKernelFunctors { template class Compute_dx_2 { - typedef typename K::RT RT; typedef typename K::Direction_2 Direction_2; public: - typedef const RT& result_type; - - result_type + decltype(auto) operator()(const Direction_2& d) const { return d.rep().dx(); @@ -1662,13 +1636,10 @@ namespace HomogeneousKernelFunctors { template class Compute_dx_3 { - typedef typename K::RT RT; typedef typename K::Direction_3 Direction_3; public: - typedef const RT& result_type; - - result_type + decltype(auto) operator()(const Direction_3& d) const { return d.rep().dx(); @@ -1678,13 +1649,10 @@ namespace HomogeneousKernelFunctors { template class Compute_dy_2 { - typedef typename K::RT RT; typedef typename K::Direction_2 Direction_2; public: - typedef const RT& result_type; - - result_type + decltype(auto) operator()(const Direction_2& d) const { return d.rep().dy(); @@ -1694,13 +1662,10 @@ namespace HomogeneousKernelFunctors { template class Compute_dy_3 { - typedef typename K::RT RT; typedef typename K::Direction_3 Direction_3; public: - typedef const RT& result_type; - - result_type + decltype(auto) operator()(const Direction_3& d) const { return d.rep().dy(); @@ -1710,13 +1675,10 @@ namespace HomogeneousKernelFunctors { template class Compute_dz_3 { - typedef typename K::RT RT; typedef typename K::Direction_3 Direction_3; public: - typedef const RT& result_type; - - result_type + decltype(auto) operator()(const Direction_3& d) const { return d.rep().dz(); @@ -1726,21 +1688,17 @@ namespace HomogeneousKernelFunctors { template class Compute_hx_2 { - typedef typename K::FT FT; - typedef typename K::RT RT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: - typedef const RT& result_type; - - result_type + decltype(auto) operator()(const Point_2& p) const { return p.rep().hx(); } - result_type + decltype(auto) operator()(const Vector_2& v) const { return v.rep().hx(); @@ -1750,21 +1708,17 @@ namespace HomogeneousKernelFunctors { template class Compute_hx_3 { - typedef typename K::FT FT; - typedef typename K::RT RT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef const RT& result_type; - - result_type + decltype(auto) operator()(const Point_3& p) const { return p.rep().hx(); } - result_type + decltype(auto) operator()(const Vector_3& v) const { return v.rep().hx(); @@ -1774,21 +1728,17 @@ namespace HomogeneousKernelFunctors { template class Compute_hy_2 { - typedef typename K::FT FT; - typedef typename K::RT RT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: - typedef const RT& result_type; - - result_type + decltype(auto) operator()(const Point_2& p) const { return p.rep().hy(); } - result_type + decltype(auto) operator()(const Vector_2& v) const { return v.rep().hy(); @@ -1798,21 +1748,17 @@ namespace HomogeneousKernelFunctors { template class Compute_hy_3 { - typedef typename K::FT FT; - typedef typename K::RT RT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef const RT & result_type; - - result_type + decltype(auto) operator()(const Point_3& p) const { return p.rep().hy(); } - result_type + decltype(auto) operator()(const Vector_3& v) const { return v.rep().hy(); @@ -1822,21 +1768,17 @@ namespace HomogeneousKernelFunctors { template class Compute_hz_3 { - typedef typename K::FT FT; - typedef typename K::RT RT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef const RT& result_type; - - result_type + decltype(auto) operator()(const Point_3& p) const { return p.rep().hz(); } - result_type + decltype(auto) operator()(const Vector_3& v) const { return v.rep().hz(); @@ -1846,21 +1788,17 @@ namespace HomogeneousKernelFunctors { template class Compute_hw_2 { - typedef typename K::FT FT; - typedef typename K::RT RT; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; public: - typedef const RT& result_type; - - result_type + decltype(auto) operator()(const Point_2& p) const { return p.rep().hw(); } - result_type + decltype(auto) operator()(const Vector_2& v) const { return v.rep().hw(); @@ -1870,21 +1808,17 @@ namespace HomogeneousKernelFunctors { template class Compute_hw_3 { - typedef typename K::FT FT; - typedef typename K::RT RT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef const RT& result_type; - - result_type + decltype(auto) operator()(const Point_3& p) const { return p.rep().hw(); } - result_type + decltype(auto) operator()(const Vector_3& v) const { return v.rep().hw(); @@ -1898,11 +1832,11 @@ namespace HomogeneousKernelFunctors { typedef typename K::Plane_3 Plane_3; typedef typename K::RT RT; typedef typename K::Construct_orthogonal_vector_3 + Construct_orthogonal_vector_3; Construct_orthogonal_vector_3 co; - public: - typedef Vector_3 result_type; + public: Construct_base_vector_3() {} Construct_base_vector_3(const Construct_orthogonal_vector_3& co_) : co(co_) @@ -1951,9 +1885,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::Iso_rectangle_2 Iso_rectangle_2; typedef typename K::Triangle_2 Triangle_2; typedef typename K::Circle_2 Circle_2; - public: - typedef Bbox_2 result_type; + public: Bbox_2 operator()( const Point_2& p) const { @@ -2016,9 +1949,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::Tetrahedron_3 Tetrahedron_3; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; typedef typename K::Sphere_3 Sphere_3; - public: - typedef Bbox_3 result_type; + public: Bbox_3 operator()(const Point_3& p) const { @@ -2091,12 +2023,10 @@ namespace HomogeneousKernelFunctors { class Construct_bisector_2 { typedef typename K::RT RT; - typedef typename K::FT FT; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; - public: - typedef Line_2 result_type; + public: Line_2 operator()(const Point_2& p, const Point_2& q) const { @@ -2134,12 +2064,10 @@ namespace HomogeneousKernelFunctors { class Construct_bisector_3 { typedef typename K::RT RT; - typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Plane_3 Plane_3; - public: - typedef Plane_3 result_type; + public: Plane_3 operator()(const Point_3& p, const Point_3& q) const { @@ -2180,16 +2108,14 @@ namespace HomogeneousKernelFunctors { template class Construct_centroid_2 { - typedef typename K::FT FT; + typedef typename K::RT RT; typedef typename K::Point_2 Point_2; typedef typename K::Triangle_2 Triangle_2; - public: - typedef Point_2 result_type; + public: Point_2 operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { - typedef typename K::RT RT; const RT phw(p.hw()); const RT qhw(q.hw()); const RT rhw(r.hw()); @@ -2230,9 +2156,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::Point_3 Point_3; typedef typename K::Triangle_3 Triangle_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; - public: - typedef Point_3 result_type; + public: Point_3 operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { @@ -2281,12 +2206,11 @@ namespace HomogeneousKernelFunctors { template class Construct_circumcenter_2 { - typedef typename K::FT FT; + typedef typename K::RT RT; typedef typename K::Point_2 Point_2; typedef typename K::Triangle_2 Triangle_2; - public: - typedef Point_2 result_type; + public: Point_2 operator()(const Point_2& p, const Point_2& q) const { @@ -2297,7 +2221,6 @@ namespace HomogeneousKernelFunctors { Point_2 operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { - typedef typename K::RT RT; const RT & phx = p.hx(); const RT & phy = p.hy(); const RT & phw = p.hw(); @@ -2361,14 +2284,13 @@ namespace HomogeneousKernelFunctors { template class Construct_circumcenter_3 { - typedef typename K::FT FT; + typedef typename K::RT RT; typedef typename K::Point_3 Point_3; typedef typename K::Triangle_3 Triangle_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; typedef typename K::Plane_3 Plane_3; - public: - typedef Point_3 result_type; + public: Point_3 operator()(const Point_3& p, const Point_3& q) const { @@ -2394,8 +2316,6 @@ namespace HomogeneousKernelFunctors { operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const { - typedef typename K::RT RT; - RT phw( p.hw() ); RT qhw( q.hw() ); RT rhw( r.hw() ); @@ -2468,9 +2388,8 @@ namespace HomogeneousKernelFunctors { class Construct_cross_product_vector_3 { typedef typename K::Vector_3 Vector_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()(const Vector_3& a, const Vector_3& b) const { @@ -2485,9 +2404,8 @@ namespace HomogeneousKernelFunctors { class Construct_difference_of_vectors_2 { typedef typename K::Vector_2 Vector_2; - public: - typedef Vector_2 result_type; + public: Vector_2 operator()(const Vector_2& v, const Vector_2& w) const { @@ -2501,9 +2419,8 @@ namespace HomogeneousKernelFunctors { class Construct_difference_of_vectors_3 { typedef typename K::Vector_3 Vector_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()(const Vector_3& v, const Vector_3& w) const { @@ -2528,8 +2445,6 @@ namespace HomogeneousKernelFunctors { typedef typename K::RT RT; public: - typedef Direction_2 result_type; - Rep // Direction_2 operator()(Return_base_tag, const RT& x, const RT& y) const { return Rep(x, y); } @@ -2595,9 +2510,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::Segment_3 Segment_3; typedef typename K::RT RT; typedef typename Direction_3::Rep Rep; - public: - typedef Direction_3 result_type; + public: Rep // Direction_3 operator()(Return_base_tag, const RT& x, const RT& y, const RT& z) const { return Rep(x, y, z); } @@ -2646,9 +2560,8 @@ namespace HomogeneousKernelFunctors { class Construct_sum_of_vectors_2 { typedef typename K::Vector_2 Vector_2; - public: - typedef Vector_2 result_type; + public: Vector_2 operator()(const Vector_2& v, const Vector_2& w) const { @@ -2662,9 +2575,8 @@ namespace HomogeneousKernelFunctors { class Construct_sum_of_vectors_3 { typedef typename K::Vector_3 Vector_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()(const Vector_3& v, const Vector_3& w) const { @@ -2681,9 +2593,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::FT FT; typedef typename K::RT RT; typedef typename K::Vector_2 Vector_2; - public: - typedef Vector_2 result_type; + public: Vector_2 operator()(const Vector_2& v, const FT& f ) const { @@ -2704,9 +2615,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::FT FT; typedef typename K::RT RT; typedef typename K::Vector_3 Vector_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()(const Vector_3& v, const FT& f ) const { @@ -2732,8 +2642,6 @@ namespace HomogeneousKernelFunctors { typedef typename Iso_rectangle_2::Rep Rep; public: - typedef Iso_rectangle_2 result_type; - Rep // Iso_rectangle_2 operator()(Return_base_tag, const Point_2& p, const Point_2& q, int) const { @@ -2851,9 +2759,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::Point_2 Point_2; typedef typename K::Point_3 Point_3; typedef typename K::Plane_3 Plane_3; - public: - typedef Point_3 result_type; + public: Point_3 operator()(const Plane_3& h, const Point_2& p) const { @@ -2875,10 +2782,10 @@ namespace HomogeneousKernelFunctors { typedef typename K::Line_2 Line_2; typedef typename Line_2::Rep Rep; typedef typename K::Construct_point_on_2 Construct_point_on_2; - Construct_point_on_2 cp; - public: - typedef Line_2 result_type; + Construct_point_on_2 cp; + + public: Construct_line_2() {} Construct_line_2(const Construct_point_on_2& cp_) : cp(cp_) {} @@ -2958,9 +2865,8 @@ namespace HomogeneousKernelFunctors { 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; + public: Point_2 operator()(const Point_2& p, const Point_2& q) const { @@ -2992,9 +2898,8 @@ namespace HomogeneousKernelFunctors { 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; + public: Point_3 operator()(const Point_3& p, const Point_3& q) const { @@ -3027,9 +2932,8 @@ namespace HomogeneousKernelFunctors { class Construct_opposite_vector_2 { typedef typename K::Vector_2 Vector_2; - public: - typedef Vector_2 result_type; + public: Vector_2 operator()( const Vector_2& v) const { return Vector_2(-v.hx(), -v.hy(), v.hw()); } @@ -3039,9 +2943,8 @@ namespace HomogeneousKernelFunctors { class Construct_opposite_vector_3 { typedef typename K::Vector_3 Vector_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()( const Vector_3& v) const { return Vector_3(-v.hx(), -v.hy(), -v.hz(), v.hw()); } @@ -3053,9 +2956,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; typedef typename K::Plane_3 Plane_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()( const Plane_3& p ) const { return p.rep().orthogonal_vector(); } @@ -3071,9 +2973,8 @@ namespace HomogeneousKernelFunctors { class Construct_perpendicular_vector_2 { typedef typename K::Vector_2 Vector_2; - public: - typedef Vector_2 result_type; + public: Vector_2 operator()( const Vector_2& v, Orientation o) const { @@ -3089,9 +2990,8 @@ namespace HomogeneousKernelFunctors { class Construct_perpendicular_direction_2 { typedef typename K::Direction_2 Direction_2; - public: - typedef Direction_2 result_type; + public: Direction_2 operator()( const Direction_2& d, Orientation o) const { @@ -3110,9 +3010,8 @@ namespace HomogeneousKernelFunctors { { typedef typename K::Line_2 Line_2; typedef typename K::Point_2 Point_2; - public: - typedef Line_2 result_type; + public: Line_2 operator()( const Line_2& l, const Point_2& p) const { return typename K::Line_2( -l.b()*p.hw(), l.a()*p.hw(), l.b()*p.hx() - l.a()*p.hy()); } @@ -3128,23 +3027,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::Vector_2 Vector_2; typedef typename K::Line_2 Line_2; typedef typename Point_2::Rep Rep; + public: - - template - struct result { - typedef Point_2 type; - }; - - template - struct result { - typedef const Point_2& type; - }; - - template - struct result { - typedef const Point_2& type; - }; - Rep // Point_2 operator()(Return_base_tag, Origin o) const { return Rep(o); } @@ -3193,7 +3077,7 @@ namespace HomogeneousKernelFunctors { operator()(const Point_2 & p) const { return p; } - const Point_2& + decltype(auto) operator()(const Weighted_point_2 & p) const { return p.rep().point(); } @@ -3221,22 +3105,6 @@ namespace HomogeneousKernelFunctors { typedef typename Point_3::Rep Rep; public: - - template - struct result { - typedef Point_3 type; - }; - - template - struct result { - typedef const Point_3& type; - }; - - template - struct result { - typedef const Point_3& type; - }; - Rep // Point_3 operator()(Return_base_tag, Origin o) const { return Rep(o); } @@ -3258,7 +3126,7 @@ namespace HomogeneousKernelFunctors { operator()(const Point_3 & p) const { return p; } - const Point_3& + decltype(auto) operator()(const Weighted_point_3 & p) const { return p.rep().point(); } @@ -3288,9 +3156,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::Point_2 Point_2; typedef typename K::Weighted_point_2 Weighted_point_2; typedef typename Weighted_point_2::Rep Rep; - public: - typedef Weighted_point_2 result_type; + public: Rep operator()(Return_base_tag, Origin o) const { return Rep(o); } @@ -3331,9 +3198,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::Point_3 Point_3; typedef typename K::Weighted_point_3 Weighted_point_3; typedef typename Weighted_point_3::Rep Rep; - public: - typedef Weighted_point_3 result_type; + public: Rep operator()(Return_base_tag, Origin o) const { return Rep(o); } @@ -3373,9 +3239,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::Point_2 Point_2; typedef typename K::Direction_2 Direction_2; typedef typename K::Line_2 Line_2; - public: - typedef Point_2 result_type; + public: Point_2 operator()( const Line_2& l, const Point_2& p ) const { @@ -3400,16 +3265,6 @@ namespace HomogeneousKernelFunctors { typedef typename K::Ray_3 Ray_3; public: - template - struct result { - typedef const Point_3 type; - }; - - template - struct result { - typedef const Point_3& type; - }; - Point_3 operator()( const Line_3& l, const Point_3& p ) const { @@ -3432,7 +3287,7 @@ namespace HomogeneousKernelFunctors { return l.point() + ( (lambda_num * dir)/lambda_den ); } - Point_3 + decltype(auto) operator()( const Plane_3& h, const Point_3& p ) const { return h.rep().projection(p); } @@ -3462,10 +3317,7 @@ namespace HomogeneousKernelFunctors { typedef typename K::FT FT; public: - - typedef Line_2 result_type; - - result_type + Line_2 operator() (const Circle_2 & c1, const Circle_2 & c2) const { // Concentric Circles don't have radical line @@ -3494,10 +3346,7 @@ namespace HomogeneousKernelFunctors { typedef typename K::FT FT; public: - - typedef Plane_3 result_type; - - result_type + Plane_3 operator() (const Sphere_3 & s1, const Sphere_3 & s2) const { // Concentric Spheres don't have radical plane @@ -3527,9 +3376,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::RT RT; typedef typename K::FT FT; typedef typename K::Vector_2 Vector_2; - public: - typedef Vector_2 result_type; + public: Vector_2 operator()( const Vector_2& v, const RT& c) const { @@ -3549,9 +3397,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::RT RT; typedef typename K::FT FT; typedef typename K::Vector_3 Vector_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()( const Vector_3& v, const RT& c) const { @@ -3570,9 +3417,8 @@ namespace HomogeneousKernelFunctors { { typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; - public: - typedef Point_2 result_type; + public: Point_2 operator()( const Point_2& p, const Vector_2& v) const { @@ -3593,9 +3439,8 @@ namespace HomogeneousKernelFunctors { { typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; - public: - typedef Point_3 result_type; + public: Point_3 operator()( const Point_3& p, const Vector_3& v) const { @@ -3624,9 +3469,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::Point_2 Point_2; typedef typename K::Direction_2 Direction_2; typedef typename Vector_2::Rep Rep; - public: - typedef Vector_2 result_type; + public: Rep // Vector_2 operator()(Return_base_tag, const Point_2& p, const Point_2& q) const { @@ -3731,9 +3575,8 @@ namespace HomogeneousKernelFunctors { typedef typename K::Vector_3 Vector_3; typedef typename K::Point_3 Point_3; typedef typename Vector_3::Rep Rep; - public: - typedef Vector_3 result_type; + public: Rep // Vector_3 operator()(Return_base_tag, const Point_3& p, const Point_3& q) const { @@ -3835,22 +3678,13 @@ namespace HomogeneousKernelFunctors { typedef typename K::Segment_2 Segment_2; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; typedef typename K::Triangle_2 Triangle_2; + public: - template - struct result { - typedef const Point_2& type; - }; - - template - struct result { - typedef Point_2 type; - }; - - const Point_2 & + decltype(auto) operator()( const Segment_2& s, int i) const { return s.vertex(i); } - const Point_2 & + decltype(auto) operator()( const Triangle_2& t, int i) const { return t.rep().vertex(i); } @@ -3871,14 +3705,10 @@ namespace HomogeneousKernelFunctors { } }; -} //namespace HomogeneousKernelFunctors - - -namespace HomogeneousKernelFunctors { - template class Coplanar_orientation_3 { + typedef typename K::Orientation Orientation; typedef typename K::Point_3 Point_3; #ifdef CGAL_kernel_exactness_preconditions typedef typename K::Coplanar_3 Coplanar_3; @@ -3887,7 +3717,6 @@ namespace HomogeneousKernelFunctors { Collinear_3 cl; #endif // CGAL_kernel_exactness_preconditions public: - typedef typename K::Orientation result_type; #ifdef CGAL_kernel_exactness_preconditions Coplanar_orientation_3() {} @@ -3895,7 +3724,7 @@ namespace HomogeneousKernelFunctors { : cp(cp_), cl(cl_) {} #endif // CGAL_kernel_exactness_preconditions - result_type + Orientation operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { Orientation oxy_pqr = sign_of_determinant(p.hx(), p.hy(), p.hw(), @@ -3915,7 +3744,7 @@ namespace HomogeneousKernelFunctors { r.hx(), r.hz(), r.hw()); } - result_type + Orientation operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const { @@ -3960,6 +3789,7 @@ namespace HomogeneousKernelFunctors { template class Coplanar_side_of_bounded_circle_3 { + typedef typename K::Bounded_side Bounded_side; typedef typename K::Point_3 Point_3; #ifdef CGAL_kernel_exactness_preconditions typedef typename K::Coplanar_3 Coplanar_3; @@ -3968,7 +3798,6 @@ namespace HomogeneousKernelFunctors { Collinear_3 cl; #endif // CGAL_kernel_exactness_preconditions public: - typedef typename K::Bounded_side result_type; #ifdef CGAL_kernel_exactness_preconditions Coplanar_side_of_bounded_circle_3() {} @@ -3977,7 +3806,7 @@ namespace HomogeneousKernelFunctors { : cp(cp_), cl(cl_) {} #endif // CGAL_kernel_exactness_preconditions - result_type + Bounded_side operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& t) const { @@ -3995,11 +3824,11 @@ namespace HomogeneousKernelFunctors { template class Equal_xy_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_3& p, const Point_3& q) const { return (p.hx() * q.hw() == q.hx() * p.hw() ) @@ -4010,11 +3839,11 @@ namespace HomogeneousKernelFunctors { template class Equal_x_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_2& p, const Point_2& q) const { return p.hx()*q.hw() == q.hx()*p.hw(); } }; @@ -4022,11 +3851,11 @@ namespace HomogeneousKernelFunctors { template class Equal_x_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_3& p, const Point_3& q) const { return p.hx()*q.hw() == q.hx()*p.hw(); } }; @@ -4034,11 +3863,11 @@ namespace HomogeneousKernelFunctors { template class Equal_y_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_2& p, const Point_2& q) const { return p.hy()*q.hw() == q.hy()*p.hw(); } }; @@ -4046,11 +3875,11 @@ namespace HomogeneousKernelFunctors { template class Equal_y_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_3& p, const Point_3& q) const { return p.hy()*q.hw() == q.hy()*p.hw(); } }; @@ -4058,11 +3887,11 @@ namespace HomogeneousKernelFunctors { template class Equal_z_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_3& p, const Point_3& q) const { return p.hz()*q.hw() == q.hz()*p.hw(); } }; @@ -4070,6 +3899,7 @@ namespace HomogeneousKernelFunctors { template class Has_on_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Line_3 Line_3; typedef typename K::Ray_3 Ray_3; @@ -4077,30 +3907,29 @@ namespace HomogeneousKernelFunctors { typedef typename K::Plane_3 Plane_3; typedef typename K::Triangle_3 Triangle_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Line_3& l, const Point_3& p) const { return l.rep().has_on(p); } - result_type + Boolean operator()( const Ray_3& r, const Point_3& p) const { return r.rep().has_on(p); } - result_type + Boolean operator()( const Segment_3& s, const Point_3& p) const { return s.rep().has_on(p); } - result_type + Boolean operator()( const Plane_3& pl, const Point_3& p) const { return pl.rep().has_on(p); } - result_type + Boolean operator()( const Plane_3& pl, const Line_3& l) const { return pl.rep().has_on(l); } - result_type + Boolean operator()( const Triangle_3& t, const Point_3& p) const { if (!t.is_degenerate() ) @@ -4143,11 +3972,11 @@ namespace HomogeneousKernelFunctors { template class Less_distance_to_point_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { typedef typename K::RT RT; @@ -4195,11 +4024,11 @@ namespace HomogeneousKernelFunctors { template class Less_distance_to_point_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { typedef typename K::RT RT; @@ -4232,19 +4061,19 @@ namespace HomogeneousKernelFunctors { template class Less_signed_distance_to_line_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()(const Point_2& p, const Point_2& q, const Point_2& r, const Point_2& s) const { return Compare_signed_distance_to_line_2().operator()(p, q, r, s) == SMALLER; } - result_type + Boolean operator()(const Line_2& l, const Point_2& p, const Point_2& q) const { @@ -4270,14 +4099,14 @@ namespace HomogeneousKernelFunctors { template class Less_signed_distance_to_plane_3 { + typedef typename K::Boolean Boolean; typedef typename K::RT RT; typedef typename K::Point_3 Point_3; typedef typename K::Plane_3 Plane_3; typedef typename K::Construct_plane_3 Construct_plane_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Plane_3& pl, const Point_3& p, const Point_3& q) const { const RT & pla = pl.a(); @@ -4300,7 +4129,7 @@ namespace HomogeneousKernelFunctors { return scaled_dist_p_minus_scaled_dist_q < 0; } - result_type + Boolean operator()(const Point_3& plp, const Point_3& plq, const Point_3& plr, const Point_3& p, const Point_3& q) const { @@ -4312,16 +4141,17 @@ namespace HomogeneousKernelFunctors { template class Less_xyz_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Compare_xyz_3 Compare_xyz_3; - Compare_xyz_3 c; - public: - typedef typename K::Boolean result_type; + Compare_xyz_3 c; + + public: Less_xyz_3() {} Less_xyz_3(const Compare_xyz_3& c_) : c(c_) {} - result_type + Boolean operator()( const Point_3& p, const Point_3& q) const { return c(p, q) == SMALLER; } }; @@ -4329,16 +4159,17 @@ namespace HomogeneousKernelFunctors { template class Less_xy_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Compare_xy_2 Compare_xy_2; - Compare_xy_2 c; - public: - typedef typename K::Boolean result_type; + Compare_xy_2 c; + + public: Less_xy_2() {} Less_xy_2(const Compare_xy_2& c_) : c(c_) {} - result_type + Boolean operator()( const Point_2& p, const Point_2& q) const { return c(p, q) == SMALLER; } }; @@ -4346,16 +4177,17 @@ namespace HomogeneousKernelFunctors { template class Less_xy_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Compare_xy_3 Compare_xy_3; - Compare_xy_3 c; - public: - typedef typename K::Boolean result_type; + Compare_xy_3 c; + + public: Less_xy_3() {} Less_xy_3(const Compare_xy_3& c_) : c(c_) {} - result_type + Boolean operator()( const Point_3& p, const Point_3& q) const { return c(p, q) == SMALLER; } }; @@ -4363,11 +4195,11 @@ namespace HomogeneousKernelFunctors { template class Less_x_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_2& p, const Point_2& q) const { return ( p.hx()*q.hw() < q.hx()*p.hw() ); } }; @@ -4375,11 +4207,11 @@ namespace HomogeneousKernelFunctors { template class Less_x_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_3& p, const Point_3& q) const { return ( p.hx()*q.hw() < q.hx()*p.hw() ); } }; @@ -4387,11 +4219,11 @@ namespace HomogeneousKernelFunctors { template class Less_yx_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_2& p, const Point_2& q) const { typedef typename K::RT RT; @@ -4422,11 +4254,11 @@ namespace HomogeneousKernelFunctors { template class Less_y_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_2& p, const Point_2& q) const { return ( p.hy()*q.hw() < q.hy()*p.hw() ); } }; @@ -4434,11 +4266,11 @@ namespace HomogeneousKernelFunctors { template class Less_y_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_3& p, const Point_3& q) const { return ( p.hy()*q.hw() < q.hy()*p.hw() ); } }; @@ -4446,11 +4278,11 @@ namespace HomogeneousKernelFunctors { template class Less_z_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Point_3& p, const Point_3& q) const { return (p.hz() * q.hw() < q.hz() * p.hw() ); } }; @@ -4458,13 +4290,13 @@ namespace HomogeneousKernelFunctors { template class Orientation_2 { + typedef typename K::Orientation Orientation; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; typedef typename K::Circle_2 Circle_2; - public: - typedef typename K::Orientation result_type; - result_type + public: + Orientation operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { typedef typename K::RT RT; @@ -4490,14 +4322,14 @@ namespace HomogeneousKernelFunctors { return CGAL::compare(A*D, B*C); } - result_type + Orientation operator()(const Vector_2& u, const Vector_2& v) const { return sign_of_determinant(u.hx(), u.hy(), v.hx(), v.hy()); } - result_type + Orientation operator()(const Circle_2& c) const { return c.rep().orientation(); @@ -4507,14 +4339,14 @@ namespace HomogeneousKernelFunctors { template class Orientation_3 { + typedef typename K::Orientation Orientation; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; typedef typename K::Sphere_3 Sphere_3; - public: - typedef typename K::Orientation result_type; - result_type + public: + Orientation operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const { @@ -4525,7 +4357,7 @@ namespace HomogeneousKernelFunctors { s.hx(), s.hy(), s.hz(), s.hw()); } - result_type + Orientation operator()( const Vector_3& u, const Vector_3& v, const Vector_3& w) const { return sign_of_determinant( u.hx(), u.hy(), u.hz(), @@ -4533,13 +4365,13 @@ namespace HomogeneousKernelFunctors { w.hx(), w.hy(), w.hz()); } - result_type + Orientation operator()( const Tetrahedron_3& t) const { return t.rep().orientation(); } - result_type + Orientation operator()(const Sphere_3& s) const { return s.rep().orientation(); @@ -4561,7 +4393,7 @@ namespace HomogeneousKernelFunctors { typedef typename K::FT FT; typedef typename K::Weighted_point_3 Weighted_point_3; typedef typename K::Oriented_side Oriented_side; - typedef Oriented_side result_type; + typedef typename K::Oriented_side Orientation; Oriented_side operator() ( const Weighted_point_3 & p, const Weighted_point_3 & q, @@ -4625,12 +4457,10 @@ namespace HomogeneousKernelFunctors { template < typename K > class Power_side_of_oriented_power_circle_2 { - public: - typedef typename K::Weighted_point_2 Weighted_point_2; typedef typename K::Oriented_side Oriented_side; + typedef typename K::Weighted_point_2 Weighted_point_2; - typedef Oriented_side result_type; - + public: Oriented_side operator()(const Weighted_point_2& p, const Weighted_point_2& q, const Weighted_point_2& r, @@ -4678,20 +4508,20 @@ namespace HomogeneousKernelFunctors { template class Oriented_side_2 { + typedef typename K::Oriented_side Oriented_side; typedef typename K::RT RT; typedef typename K::Point_2 Point_2; typedef typename K::Circle_2 Circle_2; typedef typename K::Line_2 Line_2; typedef typename K::Triangle_2 Triangle_2; typedef typename K::Segment_2 Segment_2; - public: - typedef typename K::Oriented_side result_type; - result_type + public: + Oriented_side operator()( const Circle_2& c, const Point_2& p) const { return Oriented_side(static_cast(c.bounded_side(p)) * static_cast(c.orientation())); } - result_type + Oriented_side operator()( const Line_2& l, const Point_2& p) const { CGAL_kernel_precondition( ! l.is_degenerate() ); @@ -4699,7 +4529,7 @@ namespace HomogeneousKernelFunctors { return CGAL_NTS sign(v); } - result_type + Oriented_side operator()( const Triangle_2& t, const Point_2& p) const { typename K::Collinear_are_ordered_along_line_2 @@ -4724,7 +4554,7 @@ namespace HomogeneousKernelFunctors { : -ot; } - result_type + Oriented_side operator()(const Segment_2& s, const Triangle_2& t) const { typename K::Construct_source_2 source; @@ -4764,11 +4594,11 @@ namespace HomogeneousKernelFunctors { template class Side_of_bounded_circle_2 { + typedef typename K::Bounded_side Bounded_side; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Bounded_side result_type; - result_type + public: + Bounded_side operator()( const Point_2& p, const Point_2& q, const Point_2& t) const { typedef typename K::RT RT; @@ -4783,12 +4613,11 @@ namespace HomogeneousKernelFunctors { const RT& thy = t.hy(); const RT& thw = t.hw(); - return enum_cast( - CGAL::compare((thx*phw-phx*thw)*(qhx*thw-thx*qhw), + return enum_cast(CGAL::compare((thx*phw-phx*thw)*(qhx*thw-thx*qhw), (thy*phw-phy*thw)*(thy*qhw-qhy*thw)) ); } - result_type + Bounded_side operator()( const Point_2& q, const Point_2& r, const Point_2& s, const Point_2& t) const { @@ -4854,11 +4683,11 @@ namespace HomogeneousKernelFunctors { template class Side_of_bounded_sphere_3 { + typedef typename K::Bounded_side Bounded_side; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Bounded_side result_type; - result_type + public: + Bounded_side operator()( const Point_3& p, const Point_3& q, const Point_3& t) const { typedef typename K::RT RT; @@ -4882,7 +4711,7 @@ namespace HomogeneousKernelFunctors { + (thz*phw-phz*thw)*(qhz*thw-thz*qhw))); } - result_type + Bounded_side operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& t) const { @@ -4890,7 +4719,7 @@ namespace HomogeneousKernelFunctors { return enum_cast( compare_distance_to_point(center, p, t) ); } // FIXME - result_type + Bounded_side operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s, const Point_3& test) const { @@ -4920,11 +4749,11 @@ namespace HomogeneousKernelFunctors { template class Side_of_oriented_circle_2 { + typedef typename K::Oriented_side Oriented_side; typedef typename K::Point_2 Point_2; - public: - typedef typename K::Oriented_side result_type; - result_type + public: + Oriented_side operator()( const Point_2& q, const Point_2& r, const Point_2& s, const Point_2& t) const { @@ -4981,11 +4810,11 @@ namespace HomogeneousKernelFunctors { template class Side_of_oriented_sphere_3 { + typedef typename K::Oriented_side Oriented_side; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Oriented_side result_type; - result_type + 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 { @@ -5034,13 +4863,11 @@ namespace HomogeneousKernelFunctors { template < typename K > class Construct_radical_axis_2 { - public: typedef typename K::Weighted_point_2 Weighted_point_2; typedef typename K::Line_2 Line_2; typedef typename K::RT RT; - typedef Line_2 result_type; - + public: Line_2 operator()(const Weighted_point_2 & p, const Weighted_point_2 & q) const { diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_2/internal/Hyperbolic_Delaunay_triangulation_traits_2_functions.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_2/internal/Hyperbolic_Delaunay_triangulation_traits_2_functions.h index 16e863753e2..63bb0c0c47f 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_2/internal/Hyperbolic_Delaunay_triangulation_traits_2_functions.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_triangulation_2/internal/Hyperbolic_Delaunay_triangulation_traits_2_functions.h @@ -225,13 +225,11 @@ 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, - const Hyperbolic_point_2& q, - const Hyperbolic_point_2& query) const + Oriented_side operator()(const Hyperbolic_point_2& p, + const Hyperbolic_point_2& q, + const Hyperbolic_point_2& query) const { // Check first if the points are collinear with the origin Circle_2 poincare(Hyperbolic_point_2(FT(0),FT(0)), FT(1)); diff --git a/Kernel_23/examples/Kernel_23/MyConstruct_point_2.h b/Kernel_23/examples/Kernel_23/MyConstruct_point_2.h index 962bdd88742..8e9407486d3 100644 --- a/Kernel_23/examples/Kernel_23/MyConstruct_point_2.h +++ b/Kernel_23/examples/Kernel_23/MyConstruct_point_2.h @@ -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. diff --git a/Kernel_23/examples/Kernel_23/intersection_visitor.cpp b/Kernel_23/examples/Kernel_23/intersection_visitor.cpp index ffe5c09c7d8..52abcdaf9d6 100644 --- a/Kernel_23/examples/Kernel_23/intersection_visitor.cpp +++ b/Kernel_23/examples/Kernel_23/intersection_visitor.cpp @@ -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; diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index 89c15f606eb..c85b8f51aa9 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -45,9 +45,7 @@ namespace CommonKernelFunctors { typedef typename K::Vector_3 Vector_3; public: - typedef int result_type; - - result_type operator()(const Vector_3& vec) const + int operator()(const Vector_3& vec) const { if(certainly_not(is_zero(vec.hx()))){ return 0; @@ -73,6 +71,7 @@ namespace CommonKernelFunctors { template class Are_ordered_along_line_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Collinear_2 Collinear_2; typedef typename K::Collinear_are_ordered_along_line_2 @@ -80,16 +79,15 @@ namespace CommonKernelFunctors { Collinear_2 c; Collinear_are_ordered_along_line_2 cao; - public: - typedef typename K::Boolean result_type; + public: Are_ordered_along_line_2() {} Are_ordered_along_line_2(const Collinear_2& c_, const Collinear_are_ordered_along_line_2& cao_) : c(c_), cao(cao_) {} - result_type + Boolean operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { return c(p, q, r) && cao(p, q, r); } }; @@ -97,6 +95,7 @@ namespace CommonKernelFunctors { template class Are_ordered_along_line_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Collinear_3 Collinear_3; typedef typename K::Collinear_are_ordered_along_line_3 @@ -104,16 +103,15 @@ namespace CommonKernelFunctors { Collinear_3 c; Collinear_are_ordered_along_line_3 cao; - public: - typedef typename K::Boolean result_type; + public: Are_ordered_along_line_3() {} Are_ordered_along_line_3(const Collinear_3& c_, const Collinear_are_ordered_along_line_3& cao_) : c(c_), cao(cao_) {} - result_type + Boolean operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { return c(p, q, r) && cao(p, q, r); } }; @@ -121,6 +119,7 @@ namespace CommonKernelFunctors { template class Are_strictly_ordered_along_line_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Collinear_2 Collinear_2; typedef typename K::Collinear_are_strictly_ordered_along_line_2 @@ -128,9 +127,8 @@ namespace CommonKernelFunctors { Collinear_2 c; Collinear_are_strictly_ordered_along_line_2 cao; - public: - typedef typename K::Boolean result_type; + public: Are_strictly_ordered_along_line_2() {} Are_strictly_ordered_along_line_2( const Collinear_2& c_, @@ -138,7 +136,7 @@ namespace CommonKernelFunctors { : c(c_), cao(cao_) {} - result_type + Boolean operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { return c(p, q, r) && cao(p, q, r); } }; @@ -146,6 +144,7 @@ namespace CommonKernelFunctors { template class Are_strictly_ordered_along_line_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Collinear_3 Collinear_3; typedef typename K::Collinear_are_strictly_ordered_along_line_3 @@ -153,31 +152,27 @@ namespace CommonKernelFunctors { Collinear_3 c; Collinear_are_strictly_ordered_along_line_3 cao; - public: - typedef typename K::Boolean result_type; + public: Are_strictly_ordered_along_line_3() {} - Are_strictly_ordered_along_line_3( - const Collinear_3& c_, + Are_strictly_ordered_along_line_3(const Collinear_3& c_, const Collinear_are_strictly_ordered_along_line_3& cao_) : c(c_), cao(cao_) {} - result_type + Boolean operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { return c(p, q, r) && cao(p, q, r); } - }; + };; template class Assign_2 { typedef typename K::Object_2 Object_2; - public: - //typedef typename K::Boolean result_type; - typedef bool result_type; + public: template - result_type + bool operator()(T& t, const Object_2& o) const { return assign(t, o); } }; @@ -186,12 +181,10 @@ namespace CommonKernelFunctors { class Assign_3 { typedef typename K::Object_3 Object_3; - public: - //typedef typename K::Boolean result_type; - typedef bool result_type; + public: template - result_type + bool operator()(T& t, const Object_3& o) const { return assign(t, o); } }; @@ -199,13 +192,13 @@ namespace CommonKernelFunctors { template class Compare_angle_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; typedef typename K::FT FT; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()(const Point_3& a, const Point_3& b, const Point_3& c, const FT& cosine) const { @@ -242,13 +235,13 @@ namespace CommonKernelFunctors { template class Compare_dihedral_angle_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; typedef typename K::FT FT; - public: - typedef typename K::Comparison_result result_type; - result_type + public: + Comparison_result operator()(const Point_3& a1, const Point_3& b1, const Point_3& c1, const Point_3& d1, const Point_3& a2, const Point_3& b2, @@ -264,7 +257,7 @@ namespace CommonKernelFunctors { return this->operator()(ab1, ac1, ad1, ab2, ac2, ad2); } - result_type + Comparison_result operator()(const Point_3& a1, const Point_3& b1, const Point_3& c1, const Point_3& d1, const FT& cosine) const @@ -276,10 +269,9 @@ namespace CommonKernelFunctors { return this->operator()(ab1, ac1, ad1, cosine); } - result_type + Comparison_result operator()(const Vector_3& ab1, const Vector_3& ac1, const Vector_3& ad1, - const FT& cosine) - const + const FT& cosine) const { typedef typename K::FT FT; typedef typename K::Construct_cross_product_vector_3 Cross_product; @@ -318,7 +310,7 @@ namespace CommonKernelFunctors { } } - result_type + Comparison_result operator()(const Vector_3& ab1, const Vector_3& ac1, const Vector_3& ad1, const Vector_3& ab2, const Vector_3& ac2, const Vector_3& ad2) const @@ -378,8 +370,6 @@ namespace CommonKernelFunctors { typedef typename K::Point_3 Point_3; typedef typename K::Comparison_result Comparison_result; - typedef Comparison_result result_type; - Comparison_result operator()(const Point_3 & p, const Weighted_point_3 & q, const Weighted_point_3 & r) const @@ -398,8 +388,6 @@ namespace CommonKernelFunctors { typedef typename K::Point_3 Point_3; typedef typename K::FT FT; - typedef Point_3 result_type; - Point_3 operator()(const Weighted_point_3 & p, const Weighted_point_3 & q, const Weighted_point_3 & r, @@ -440,10 +428,10 @@ namespace CommonKernelFunctors { template < class K > class Power_side_of_bounded_power_circle_2 { - public: + typedef typename K::Bounded_side Bounded_side; typedef typename K::Weighted_point_2 Weighted_point_2; - typedef Bounded_side result_type; + public: Bounded_side operator()(const Weighted_point_2& p, const Weighted_point_2& q, const Weighted_point_2& r, @@ -454,10 +442,11 @@ namespace CommonKernelFunctors { typename K::Construct_point_2 wp2p = traits.construct_point_2_object(); typename K::Power_side_of_oriented_power_circle_2 power_test = traits.power_side_of_oriented_power_circle_2_object(); + typename K::Orientation o = orientation(wp2p(p),wp2p(q),wp2p(r)); typename K::Oriented_side os = power_test(p,q,r,t); - CGAL_assertion(o != COPLANAR); + return enum_cast(o * os); } @@ -487,11 +476,10 @@ namespace CommonKernelFunctors { class Power_side_of_bounded_power_sphere_3 { public: + typedef typename K::Bounded_side Bounded_side; typedef typename K::Weighted_point_3 Weighted_point_3; typedef typename K::Sign Sign; - typedef Bounded_side result_type; - Bounded_side operator()(const Weighted_point_3 & p, const Weighted_point_3 & q, const Weighted_point_3 & r, @@ -548,10 +536,8 @@ namespace CommonKernelFunctors { class Power_side_of_oriented_power_sphere_3 { public: - typedef typename K::Weighted_point_3 Weighted_point_3; typedef typename K::Oriented_side Oriented_side; - - typedef Oriented_side result_type; + typedef typename K::Weighted_point_3 Weighted_point_3; Oriented_side operator()(const Weighted_point_3 & p, const Weighted_point_3 & q, @@ -613,11 +599,9 @@ namespace CommonKernelFunctors { { public: typedef typename K::Weighted_point_2 Weighted_point_2; - typedef typename K::FT Weight; - typedef const Weight& result_type; - - const Weight& operator()(const Weighted_point_2 & p) const + decltype(auto) + operator()(const Weighted_point_2 & p) const { return p.rep().weight(); } @@ -628,11 +612,9 @@ namespace CommonKernelFunctors { { public: typedef typename K::Weighted_point_3 Weighted_point_3; - typedef typename K::FT Weight; - typedef const Weight& result_type; - - const Weight& operator()(const Weighted_point_3 & p) const + decltype(auto) + operator()(const Weighted_point_3 & p) const { return p.rep().weight(); } @@ -645,8 +627,6 @@ namespace CommonKernelFunctors { typedef typename K::Weighted_point_2 Weighted_point_2; typedef typename K::FT FT; - typedef FT result_type; - FT operator()(const Weighted_point_2 & p, const Weighted_point_2 & q) const { @@ -662,8 +642,6 @@ namespace CommonKernelFunctors { typedef typename K::Weighted_point_3 Weighted_point_3; typedef typename K::FT FT; - typedef FT result_type; - FT operator()(const Weighted_point_3 & p, const Weighted_point_3 & q) const { @@ -679,8 +657,6 @@ namespace CommonKernelFunctors { typedef typename K::Weighted_point_2 Weighted_point_2; typedef typename K::FT FT; - typedef FT result_type; - FT operator()(const Weighted_point_2& p, const Weighted_point_2& q, const Weighted_point_2& r) const @@ -710,8 +686,6 @@ namespace CommonKernelFunctors { typedef typename K::Weighted_point_3 Weighted_point_3; typedef typename K::FT FT; - typedef FT result_type; - FT operator()(const Weighted_point_3 & p, const Weighted_point_3 & q, const Weighted_point_3 & r, @@ -754,13 +728,11 @@ namespace CommonKernelFunctors { typedef typename K::Weighted_point_3 Weighted_point_3; typedef typename K::FT FT; - typedef FT result_type; - - 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 + FT 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 { return power_distance_to_power_sphereC3 (p.x(),p.y(),p.z(),FT(p.weight()), q.x(),q.y(),q.z(),FT(q.weight()), @@ -778,9 +750,7 @@ namespace CommonKernelFunctors { typedef typename K::Comparison_result Comparison_result; typedef typename K::FT FT; - typedef Comparison_result result_type; - - Needs_FT + Needs_FT operator()(const Weighted_point_3 & p, const Weighted_point_3 & q, const Weighted_point_3 & r, @@ -795,7 +765,7 @@ namespace CommonKernelFunctors { w); } - Needs_FT + Needs_FT operator()(const Weighted_point_3 & p, const Weighted_point_3 & q, const Weighted_point_3 & r, @@ -808,7 +778,7 @@ namespace CommonKernelFunctors { w); } - Needs_FT + Needs_FT operator()(const Weighted_point_3 & p, const Weighted_point_3 & q, const FT& w) const @@ -819,8 +789,8 @@ namespace CommonKernelFunctors { w); } - result_type operator()(const Weighted_point_3 & p, - const FT& w) const + Comparison_result operator()(const Weighted_point_3 & p, + const FT& w) const { return CGAL::compare(-p.weight(), w); } @@ -829,12 +799,12 @@ namespace CommonKernelFunctors { template class Compare_slope_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::FT FT; typedef typename K::Point_3 Point_3; - public: - typedef typename K::Comparison_result result_type; - result_type operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const + public: + Comparison_result operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const { Comparison_result sign_pq = CGAL::compare(q.z(),p.z()); Comparison_result sign_rs = CGAL::compare(s.z(),r.z()); @@ -859,19 +829,19 @@ namespace CommonKernelFunctors { template class Compare_squared_distance_2 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::FT FT; - public: - typedef typename K::Comparison_result result_type; + public: template - Needs_FT + Needs_FT operator()(const T1& p, const T2& q, const FT& d2) const { return CGAL::compare(internal::squared_distance(p, q, K()), d2); } template - Needs_FT + Needs_FT operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { return CGAL::compare(internal::squared_distance(p, q, K()), @@ -882,19 +852,19 @@ namespace CommonKernelFunctors { template class Compare_squared_distance_3 { + typedef typename K::Comparison_result Comparison_result; typedef typename K::FT FT; - public: - typedef typename K::Comparison_result result_type; + public: template - Needs_FT + Needs_FT operator()(const T1& p, const T2& q, const FT& d2) const { return CGAL::compare(internal::squared_distance(p, q, K()), d2); } template - Needs_FT + Needs_FT operator()(const T1& p, const T2& q, const T3& r, const T4& s) const { return CGAL::compare(internal::squared_distance(p, q, K()), @@ -905,14 +875,12 @@ namespace CommonKernelFunctors { template class Compute_approximate_angle_3 { + typedef typename K::FT FT; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; public: - typedef typename K::FT result_type; - - result_type - operator()(const Vector_3& u, const Vector_3& v) const + FT operator()(const Vector_3& u, const Vector_3& v) const { K k; typename K::Compute_scalar_product_3 scalar_product = @@ -938,7 +906,7 @@ namespace CommonKernelFunctors { } - result_type + FT operator()(const Point_3& p, const Point_3& q, const Point_3& r) const { K k; @@ -954,11 +922,11 @@ namespace CommonKernelFunctors { template class Compute_approximate_dihedral_angle_3 { + typedef typename K::FT FT; typedef typename K::Point_3 Point_3; - public: - typedef typename K::FT result_type; - result_type + public: + FT operator()(const Point_3& a, const Point_3& b, const Point_3& c, const Point_3& d) const { K k; @@ -1024,8 +992,6 @@ namespace CommonKernelFunctors { typedef typename K::Point_3 Point_3; typedef typename K::Triangle_3 Triangle_3; public: - typedef FT result_type; - FT operator()( const Triangle_3& t ) const { @@ -1043,10 +1009,8 @@ namespace CommonKernelFunctors { class Compute_squared_distance_2 { typedef typename K::FT FT; - public: - typedef FT result_type; - // There are 25 combinaisons, we use a template. + public: template FT operator()( const T1& t1, const T2& t2) const @@ -1058,9 +1022,8 @@ namespace CommonKernelFunctors { { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; - public: - typedef FT result_type; + public: // There are 25 combinaisons, we use a template. template FT @@ -1083,8 +1046,6 @@ namespace CommonKernelFunctors { typedef typename K::Segment_2 Segment_2; typedef typename K::Vector_2 Vector_2; public: - typedef FT result_type; - FT operator()( const Vector_2& v) const { return CGAL_NTS square(K().compute_x_2_object()(v)) + @@ -1102,8 +1063,6 @@ namespace CommonKernelFunctors { typedef typename K::Segment_3 Segment_3; typedef typename K::Vector_3 Vector_3; public: - typedef FT result_type; - FT operator()( const Vector_3& v) const { return v.rep().squared_length(); } @@ -1116,11 +1075,10 @@ namespace CommonKernelFunctors { template class Compute_a_2 { - typedef typename K::RT RT; typedef typename K::Line_2 Line_2; public: - const RT& + decltype(auto) operator()(const Line_2& l) const { return l.rep().a(); @@ -1130,11 +1088,10 @@ namespace CommonKernelFunctors { template class Compute_a_3 { - typedef typename K::RT RT; typedef typename K::Plane_3 Plane_3; public: - const RT& + decltype(auto) operator()(const Plane_3& l) const { return l.rep().a(); @@ -1145,11 +1102,10 @@ namespace CommonKernelFunctors { template class Compute_b_2 { - typedef typename K::RT RT; typedef typename K::Line_2 Line_2; public: - const RT& + decltype(auto) operator()(const Line_2& l) const { return l.rep().b(); @@ -1159,11 +1115,10 @@ namespace CommonKernelFunctors { template class Compute_b_3 { - typedef typename K::RT RT; typedef typename K::Plane_3 Plane_3; public: - const RT& + decltype(auto) operator()(const Plane_3& l) const { return l.rep().b(); @@ -1174,11 +1129,10 @@ namespace CommonKernelFunctors { template class Compute_c_2 { - typedef typename K::RT RT; typedef typename K::Line_2 Line_2; public: - const RT& + decltype(auto) operator()(const Line_2& l) const { return l.rep().c(); @@ -1188,11 +1142,10 @@ namespace CommonKernelFunctors { template class Compute_c_3 { - typedef typename K::RT RT; typedef typename K::Plane_3 Plane_3; public: - const RT& + decltype(auto) operator()(const Plane_3& l) const { return l.rep().c(); @@ -1202,11 +1155,10 @@ namespace CommonKernelFunctors { template class Compute_d_3 { - typedef typename K::RT RT; typedef typename K::Plane_3 Plane_3; public: - const RT& + decltype(auto) operator()(const Plane_3& l) const { return l.rep().d(); @@ -1221,8 +1173,6 @@ namespace CommonKernelFunctors { typedef typename K::Line_2 Line_2; public: - typedef FT result_type; - FT operator()(const Line_2& l, const FT& y) const { @@ -1239,8 +1189,6 @@ namespace CommonKernelFunctors { typedef typename K::Line_2 Line_2; public: - typedef FT result_type; - FT operator()(const Line_2& l, const FT& x) const { @@ -1259,8 +1207,6 @@ namespace CommonKernelFunctors { //typedef typename K::Cartesian_coordinate_type Cartesian_coordinate_type; public: - typedef FT result_type; - Cartesian_coordinate_type operator()(const Iso_rectangle_2& r) const { @@ -1277,8 +1223,6 @@ namespace CommonKernelFunctors { //typedef typename K::Cartesian_coordinate_type Cartesian_coordinate_type; public: - typedef FT result_type; - Cartesian_coordinate_type operator()(const Iso_cuboid_3& r) const { @@ -1295,8 +1239,6 @@ namespace CommonKernelFunctors { //typedef typename K::Cartesian_coordinate_type Cartesian_coordinate_type; public: - typedef FT result_type; - Cartesian_coordinate_type operator()(const Iso_rectangle_2& r) const { @@ -1313,8 +1255,6 @@ namespace CommonKernelFunctors { //typedef typename K::Cartesian_coordinate_type Cartesian_coordinate_type; public: - typedef FT result_type; - Cartesian_coordinate_type operator()(const Iso_cuboid_3& r) const { @@ -1331,8 +1271,6 @@ namespace CommonKernelFunctors { //typedef typename K::Cartesian_coordinate_type Cartesian_coordinate_type; public: - typedef FT result_type; - Cartesian_coordinate_type operator()(const Iso_rectangle_2& r) const { @@ -1349,8 +1287,6 @@ namespace CommonKernelFunctors { //typedef typename K::Cartesian_coordinate_type Cartesian_coordinate_type; public: - typedef FT result_type; - Cartesian_coordinate_type operator()(const Iso_cuboid_3& r) const { @@ -1367,8 +1303,6 @@ namespace CommonKernelFunctors { //typedef typename K::Cartesian_coordinate_type Cartesian_coordinate_type; public: - typedef FT result_type; - Cartesian_coordinate_type operator()(const Iso_rectangle_2& r) const { @@ -1385,8 +1319,6 @@ namespace CommonKernelFunctors { //typedef typename K::Cartesian_coordinate_type Cartesian_coordinate_type; public: - typedef FT result_type; - Cartesian_coordinate_type operator()(const Iso_cuboid_3& r) const { @@ -1403,8 +1335,6 @@ namespace CommonKernelFunctors { //typedef typename K::Cartesian_coordinate_type Cartesian_coordinate_type; public: - typedef FT result_type; - Cartesian_coordinate_type operator()(const Iso_cuboid_3& r) const { @@ -1421,8 +1351,6 @@ namespace CommonKernelFunctors { //typedef typename K::Cartesian_coordinate_type Cartesian_coordinate_type; public: - typedef FT result_type; - Cartesian_coordinate_type operator()(const Iso_cuboid_3& r) const { @@ -1437,9 +1365,7 @@ namespace CommonKernelFunctors { typedef typename K::Point_2 Point_2; public: - typedef FT result_type; - - result_type + FT operator()(const Point_2& p, const Point_2& q) const { @@ -1455,9 +1381,7 @@ namespace CommonKernelFunctors { typedef typename K::Point_3 Point_3; public: - typedef FT result_type; - - result_type + FT operator()(const Point_3& p, const Point_3& q) const { @@ -1504,9 +1428,8 @@ namespace CommonKernelFunctors { typedef typename K::Point_2 Point_2; typedef typename K::Circle_2 Circle_2; typedef typename Circle_2::Rep Rep; - public: - typedef Circle_2 result_type; + public: Rep // Circle_2 operator()( Return_base_tag, const Point_2& center, const FT& squared_radius, @@ -1624,8 +1547,6 @@ namespace CommonKernelFunctors { typedef typename Circle_3::Rep Rep; public: - typedef Circle_3 result_type; - Rep operator() (Return_base_tag, const Point_3& p, const FT& sr, const Plane_3& plane) const @@ -1708,9 +1629,8 @@ namespace CommonKernelFunctors { typedef typename K::Point_3 Point_3; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; typedef typename Iso_cuboid_3::Rep Rep; - public: - typedef Iso_cuboid_3 result_type; + public: Rep // Iso_cuboid_3 operator()(Return_base_tag, const Point_3& p, const Point_3& q, int) const { return Rep(p, q, 0); } @@ -1769,9 +1689,8 @@ namespace CommonKernelFunctors { typedef typename K::Line_3 Line; typedef typename K::Point_3 Point; typename K::Construct_line_3 construct_line; - public: - typedef Point result_type; + public: Point operator()(const Point& l11, const Point& l12, const Point& l21, const Point& l22) const @@ -1790,17 +1709,15 @@ namespace CommonKernelFunctors { template class Construct_max_vertex_2 { - typedef typename K::Point_2 Point_2; typedef typename K::Segment_2 Segment_2; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; - public: - typedef const Point_2& result_type; - result_type + public: + decltype(auto) operator()(const Iso_rectangle_2& r) const { return (r.rep().max)(); } - result_type + decltype(auto) operator()(const Segment_2& s) const { return (s.max)(); } }; @@ -1809,37 +1726,31 @@ namespace CommonKernelFunctors { template class Construct_min_vertex_2 { - typedef typename K::Point_2 Point_2; typedef typename K::Segment_2 Segment_2; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; - public: - typedef const Point_2& result_type; - result_type + public: + decltype(auto) operator()(const Iso_rectangle_2& r) const { return (r.rep().min)(); } - result_type + decltype(auto) operator()(const Segment_2& s) const { return (s.min)(); } }; - - template class Construct_max_vertex_3 { - typedef typename K::Point_3 Point_3; typedef typename K::Segment_3 Segment_3; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; - public: - typedef const Point_3& result_type; - result_type + public: + decltype(auto) operator()(const Iso_cuboid_3& r) const { return (r.rep().max)(); } - result_type + decltype(auto) operator()(const Segment_3& s) const { return (s.rep().max)(); } }; @@ -1847,17 +1758,15 @@ namespace CommonKernelFunctors { template class Construct_min_vertex_3 { - typedef typename K::Point_3 Point_3; typedef typename K::Segment_3 Segment_3; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; - public: - typedef const Point_3& result_type; - result_type + public: + decltype(auto) operator()(const Iso_cuboid_3& r) const { return (r.rep().min)(); } - result_type + decltype(auto) operator()(const Segment_3& s) const { return (s.rep().min)(); } }; @@ -1867,9 +1776,8 @@ namespace CommonKernelFunctors { { typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()(const Point_3& p,const Point_3& q, const Point_3& r) const { @@ -1883,9 +1791,8 @@ namespace CommonKernelFunctors { class Construct_object_2 { typedef typename K::Object_2 Object_2; - public: - typedef Object_2 result_type; + public: template Object_2 operator()( const Cls& c) const @@ -1896,9 +1803,8 @@ namespace CommonKernelFunctors { class Construct_object_3 { typedef typename K::Object_3 Object_3; - public: - typedef Object_3 result_type; + public: template Object_3 operator()( const Cls& c) const @@ -1909,9 +1815,8 @@ namespace CommonKernelFunctors { class Construct_opposite_circle_2 { typedef typename K::Circle_2 Circle_2; - public: - typedef Circle_2 result_type; + public: Circle_2 operator()( const Circle_2& c) const { return c.opposite(); } @@ -1922,9 +1827,8 @@ namespace CommonKernelFunctors { { typedef typename K::Direction_2 Direction_2; typedef typename Direction_2::Rep Rep; - public: - typedef Direction_2 result_type; + public: Direction_2 operator()( const Direction_2& d) const { return Rep(-d.dx(), -d.dy()); } @@ -1935,9 +1839,8 @@ namespace CommonKernelFunctors { { typedef typename K::Direction_3 Direction_3; typedef typename Direction_3::Rep Rep; - public: - typedef Direction_3 result_type; + public: Direction_3 operator()( const Direction_3& d) const { return Rep(-d.dx(), -d.dy(), -d.dz()); } @@ -1947,9 +1850,8 @@ namespace CommonKernelFunctors { class Construct_opposite_line_2 { typedef typename K::Line_2 Line_2; - public: - typedef Line_2 result_type; + public: Line_2 operator()( const Line_2& l) const { return Line_2( -l.a(), -l.b(), -l.c()); } @@ -1959,9 +1861,8 @@ namespace CommonKernelFunctors { class Construct_opposite_line_3 { typedef typename K::Line_3 Line_3; - public: - typedef Line_3 result_type; + public: Line_3 operator()( const Line_3& l) const { return l.rep().opposite(); } @@ -1971,9 +1872,8 @@ namespace CommonKernelFunctors { class Construct_opposite_plane_3 { typedef typename K::Plane_3 Plane_3; - public: - typedef Plane_3 result_type; + public: Plane_3 operator()( const Plane_3& p) const { return p.rep().opposite(); } @@ -1983,9 +1883,8 @@ namespace CommonKernelFunctors { class Construct_opposite_ray_2 { typedef typename K::Ray_2 Ray_2; - public: - typedef Ray_2 result_type; + public: Ray_2 operator()( const Ray_2& r) const { return r.opposite(); } @@ -1995,9 +1894,8 @@ namespace CommonKernelFunctors { class Construct_opposite_ray_3 { typedef typename K::Ray_3 Ray_3; - public: - typedef Ray_3 result_type; + public: Ray_3 operator()( const Ray_3& r) const { return r.opposite(); } @@ -2007,9 +1905,8 @@ namespace CommonKernelFunctors { class Construct_opposite_segment_2 { typedef typename K::Segment_2 Segment_2; - public: - typedef Segment_2 result_type; + public: Segment_2 operator()( const Segment_2& s) const { return Segment_2(s.target(), s.source()); } @@ -2019,9 +1916,8 @@ namespace CommonKernelFunctors { class Construct_opposite_segment_3 { typedef typename K::Segment_3 Segment_3; - public: - typedef Segment_3 result_type; + public: Segment_3 operator()( const Segment_3& s) const { return s.rep().opposite(); } @@ -2031,9 +1927,8 @@ namespace CommonKernelFunctors { class Construct_opposite_sphere_3 { typedef typename K::Sphere_3 Sphere_3; - public: - typedef Sphere_3 result_type; + public: Sphere_3 operator()( const Sphere_3& s) const { return s.rep().opposite(); } @@ -2043,9 +1938,8 @@ namespace CommonKernelFunctors { class Construct_opposite_triangle_2 { typedef typename K::Triangle_2 Triangle_2; - public: - typedef Triangle_2 result_type; + public: Triangle_2 operator()( const Triangle_2& t) const { return Triangle_2(t.vertex(0), t.vertex(2), t.vertex(1));} @@ -2057,9 +1951,8 @@ namespace CommonKernelFunctors { typedef typename K::Line_3 Line_3; typedef typename K::Point_3 Point_3; typedef typename K::Plane_3 Plane_3; - public: - typedef Line_3 result_type; + public: Line_3 operator()( const Plane_3& pl, const Point_3& p) const { return pl.rep().perpendicular_line(p); } @@ -2071,9 +1964,8 @@ namespace CommonKernelFunctors { typedef typename K::Line_3 Line_3; typedef typename K::Point_3 Point_3; typedef typename K::Plane_3 Plane_3; - public: - typedef Plane_3 result_type; + public: Plane_3 operator()( const Line_3& l, const Point_3& p) const { return l.rep().perpendicular_plane(p); } @@ -2165,7 +2057,6 @@ namespace CommonKernelFunctors { decltype(auto) operator()(const Circle_3 & c) const { return this->operator()(Return_base_tag(), c); } - }; template @@ -2176,9 +2067,8 @@ namespace CommonKernelFunctors { typedef typename K::Point_3 Point; typename K::Construct_plane_3 construct_plane; typename K::Construct_line_3 construct_line; - public: - typedef Point result_type; + public: Point operator()(const Point& p1, const Point& p2, const Point& p3, const Point& l1, const Point& l2) const @@ -2215,9 +2105,8 @@ namespace CommonKernelFunctors { typedef typename K::Segment_2 Segment_2; typedef typename K::Line_2 Line_2; typedef typename K::Ray_2 Ray_2; - public: - typedef Point_2 result_type; + public: Point_2 operator()( const Line_2& l, const FT i) const { return l.point(i); } @@ -2242,7 +2131,7 @@ namespace CommonKernelFunctors { typedef typename K::Plane_3 Plane_3; public: - const Point_3& + decltype(auto) operator()( const Line_3& l) const { return l.rep().point(); } @@ -2258,7 +2147,7 @@ namespace CommonKernelFunctors { operator()( const Ray_3& r, const FT i) const { return r.rep().point(i); } - Point_3 + decltype(auto) operator()( const Plane_3& p) const { return p.rep().point(); } }; @@ -2269,9 +2158,8 @@ namespace CommonKernelFunctors { typedef typename K::Point_2 Point_2; typedef typename K::Point_3 Point_3; typedef typename K::Plane_3 Plane_3; - public: - typedef Point_2 result_type; + public: Point_2 operator()( const Plane_3& h, const Point_3& p) const { return h.rep().to_2d(p); } @@ -2286,9 +2174,8 @@ namespace CommonKernelFunctors { typedef typename K::Line_2 Line_2; typedef typename K::Ray_2 Ray_2; typedef typename Ray_2::Rep Rep; - public: - typedef Ray_2 result_type; + public: Rep // Ray_2 operator()(Return_base_tag, const Point_2& p, const Point_2& q) const { return Rep(p, q); } @@ -2332,9 +2219,8 @@ namespace CommonKernelFunctors { typedef typename K::Line_3 Line_3; typedef typename K::Ray_3 Ray_3; typedef typename Ray_3::Rep Rep; - public: - typedef Ray_3 result_type; + public: Rep // Ray_3 operator()(Return_base_tag, const Point_3& p, const Point_3& q) const { return Rep(p, q); } @@ -2375,9 +2261,8 @@ namespace CommonKernelFunctors { typedef typename K::Segment_2 Segment_2; typedef typename Segment_2::Rep Rep; typedef typename K::Point_2 Point_2; - public: - typedef Segment_2 result_type; + public: Rep // Segment_2 operator()(Return_base_tag, const Point_2& p, const Point_2& q) const { return Rep(p, q); } @@ -2393,9 +2278,8 @@ namespace CommonKernelFunctors { typedef typename K::Segment_3 Segment_3; typedef typename K::Point_3 Point_3; typedef typename Segment_3::Rep Rep; - public: - typedef Segment_3 result_type; + public: Rep // Segment_3 operator()(Return_base_tag, const Point_3& p, const Point_3& q) const { return Rep(p, q); } @@ -2405,23 +2289,18 @@ namespace CommonKernelFunctors { { return this->operator()(Return_base_tag(), p, q); } }; - - - template class Construct_source_2 { typedef typename K::Segment_2 Segment_2; typedef typename K::Ray_2 Ray_2; - typedef typename K::Point_2 Point_2; - public: - typedef const Point_2& result_type; - result_type + public: + decltype(auto) operator()(const Segment_2& s) const { return s.rep().source(); } - result_type + decltype(auto) operator()(const Ray_2& r) const { return r.rep().source(); } }; @@ -2431,15 +2310,13 @@ namespace CommonKernelFunctors { { typedef typename K::Segment_3 Segment_3; typedef typename K::Ray_3 Ray_3; - typedef typename K::Point_3 Point_3; - public: - typedef const Point_3& result_type; - result_type + public: + decltype(auto) operator()(const Segment_3& s) const { return s.rep().source(); } - result_type + decltype(auto) operator()(const Ray_3& r) const { return r.rep().source(); } }; @@ -2449,11 +2326,9 @@ namespace CommonKernelFunctors { class Construct_target_2 { typedef typename K::Segment_2 Segment_2; - typedef typename K::Point_2 Point_2; - public: - typedef const Point_2& result_type; - result_type + public: + decltype(auto) operator()(const Segment_2& s) const { return s.rep().target(); } }; @@ -2462,11 +2337,9 @@ namespace CommonKernelFunctors { class Construct_target_3 { typedef typename K::Segment_3 Segment_3; - typedef typename K::Point_3 Point_3; - public: - typedef const Point_3& result_type; - result_type + public: + decltype(auto) operator()(const Segment_3& s) const { return s.rep().target(); } }; @@ -2475,11 +2348,9 @@ namespace CommonKernelFunctors { class Construct_second_point_2 { typedef typename K::Ray_2 Ray_2; - typedef typename K::Point_2 Point_2; - public: - typedef const Point_2& result_type; - result_type + public: + decltype(auto) operator()(const Ray_2& r) const { return r.rep().second_point(); } }; @@ -2488,11 +2359,9 @@ namespace CommonKernelFunctors { class Construct_second_point_3 { typedef typename K::Ray_3 Ray_3; - typedef typename K::Point_3 Point_3; - public: - typedef Point_3 result_type; - result_type // const result_type& // Homogeneous... + public: + decltype(auto) operator()(const Ray_3& r) const { return r.rep().second_point(); } }; @@ -2571,10 +2440,9 @@ namespace CommonKernelFunctors { { typedef typename K::Triangle_3 Triangle_3; typedef typename K::Plane_3 Plane_3; - public: - typedef Plane_3 result_type; - Plane_3 + public: + decltype(auto) operator()( const Triangle_3& t) const { return t.rep().supporting_plane(); } @@ -2586,9 +2454,8 @@ namespace CommonKernelFunctors { typedef typename K::Tetrahedron_3 Tetrahedron_3; typedef typename K::Point_3 Point_3; typedef typename Tetrahedron_3::Rep Rep; - public: - typedef Tetrahedron_3 result_type; + public: Rep // Tetrahedron_3 operator()(Return_base_tag, const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const @@ -2606,9 +2473,8 @@ namespace CommonKernelFunctors { typedef typename K::Triangle_2 Triangle_2; typedef typename Triangle_2::Rep Rep; typedef typename K::Point_2 Point_2; - public: - typedef Triangle_2 result_type; + public: Rep // Triangle_2 operator()(Return_base_tag, const Point_2& p, const Point_2& q, const Point_2& r) const { return Rep(p, q, r); } @@ -2624,9 +2490,8 @@ namespace CommonKernelFunctors { typedef typename K::Triangle_3 Triangle_3; typedef typename K::Point_3 Point_3; typedef typename Triangle_3::Rep Rep; - public: - typedef Triangle_3 result_type; + public: Rep // Triangle_3 operator()(Return_base_tag, const Point_3& p, const Point_3& q, const Point_3& r) const { return Rep(p, q, r); } @@ -2641,9 +2506,8 @@ namespace CommonKernelFunctors { { typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; - public: - typedef Vector_3 result_type; + public: Vector_3 operator()(const Point_3& p,const Point_3& q, const Point_3& r) const { @@ -2662,21 +2526,21 @@ namespace CommonKernelFunctors { typedef typename K::Iso_cuboid_3 Iso_cuboid_3; typedef typename K::Triangle_3 Triangle_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; - public: - const Point_3& + public: + decltype(auto) operator()( const Segment_3& s, int i) const { return s.rep().vertex(i); } - const Point_3& + decltype(auto) operator()( const Triangle_3& t, int i) const { return t.rep().vertex(i); } - Point_3 + decltype(auto) operator()( const Iso_cuboid_3& r, int i) const { return r.rep().vertex(i); } - const Point_3& + decltype(auto) operator()( const Tetrahedron_3& t, int i) const { return t.rep().vertex(i); } }; @@ -2690,8 +2554,6 @@ namespace CommonKernelFunctors { Cartesian_const_iterator_2; public: - typedef Cartesian_const_iterator_2 result_type; - Cartesian_const_iterator_2 operator()( const Point_2& p) const { @@ -2726,8 +2588,6 @@ namespace CommonKernelFunctors { Cartesian_const_iterator_3; public: - typedef Cartesian_const_iterator_3 result_type; - Cartesian_const_iterator_3 operator()( const Point_3& p) const { @@ -3045,16 +2905,17 @@ namespace CommonKernelFunctors { template class Coplanar_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Orientation_3 Orientation_3; - Orientation_3 o; - public: - typedef typename K::Boolean result_type; + Orientation_3 o; + + public: Coplanar_3() {} Coplanar_3(const Orientation_3& o_) : o(o_) {} - result_type + Boolean operator()( const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s) const { @@ -3065,11 +2926,11 @@ namespace CommonKernelFunctors { template class Counterclockwise_in_between_2 { + typedef typename K::Boolean Boolean; typedef typename K::Direction_2 Direction_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Direction_2& p, const Direction_2& q, const Direction_2& r) const { @@ -3083,12 +2944,12 @@ namespace CommonKernelFunctors { template class Do_intersect_2 { - public: - typedef typename K::Boolean result_type; + typedef typename K::Boolean Boolean; + public: // Needs_FT because Line/Line (and variations) as well as Circle_2/X compute intersections template - Needs_FT + Needs_FT operator()(const T1& t1, const T2& t2) const { return { Intersections::internal::do_intersect(t1, t2, K())}; } }; @@ -3096,17 +2957,18 @@ namespace CommonKernelFunctors { template class Do_intersect_3 { - public: - typedef typename K::Boolean result_type; + typedef typename K::Boolean Boolean; + public: template - result_type + Boolean operator()(const T1& t1, const T2& t2) const { return Intersections::internal::do_intersect(t1, t2, K()); } - result_type operator()(const typename K::Plane_3& pl1, - const typename K::Plane_3& pl2, - const typename K::Plane_3& pl3) const + Boolean + operator()(const typename K::Plane_3& pl1, + const typename K::Plane_3& pl2, + const typename K::Plane_3& pl3) const { return Intersections::internal::do_intersect(pl1, pl2, pl3, K()); } @@ -3115,6 +2977,7 @@ namespace CommonKernelFunctors { template class Equal_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Vector_2 Vector_2; typedef typename K::Direction_2 Direction_2; @@ -3126,51 +2989,49 @@ namespace CommonKernelFunctors { typedef typename K::Circle_2 Circle_2; public: - typedef typename K::Boolean result_type; - - result_type + Boolean operator()(const Point_2 &p, const Point_2 &q) const { return p.rep() == q.rep(); } - result_type + Boolean operator()(const Vector_2 &v1, const Vector_2 &v2) const { return v1.rep() == v2.rep(); } - result_type + Boolean operator()(const Vector_2 &v, const Null_vector &n) const { return v.rep() == n; } - result_type + Boolean operator()(const Direction_2 &d1, const Direction_2 &d2) const { return d1.rep() == d2.rep(); } - result_type + Boolean operator()(const Segment_2 &s1, const Segment_2 &s2) const { return s1.source() == s2.source() && s1.target() == s2.target(); } - result_type + Boolean operator()(const Line_2 &l1, const Line_2 &l2) const { return l1.rep() == l2.rep(); } - result_type + Boolean operator()(const Ray_2& r1, const Ray_2& r2) const { return r1.source() == r2.source() && r1.direction() == r2.direction(); } - result_type + Boolean operator()(const Circle_2& c1, const Circle_2& c2) const { return c1.center() == c2.center() && @@ -3178,7 +3039,7 @@ namespace CommonKernelFunctors { c1.orientation() == c2.orientation(); } - result_type + Boolean operator()(const Triangle_2& t1, const Triangle_2& t2) const { int i; @@ -3190,7 +3051,7 @@ namespace CommonKernelFunctors { && t1.vertex(2) == t2.vertex(i+2); } - result_type + Boolean operator()(const Iso_rectangle_2& i1, const Iso_rectangle_2& i2) const { return CGAL_AND((i1.min)() == (i2.min)(), (i1.max)() == (i2.max)()); @@ -3200,6 +3061,7 @@ namespace CommonKernelFunctors { template class Equal_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Vector_3 Vector_3; typedef typename K::Direction_3 Direction_3; @@ -3214,82 +3076,81 @@ namespace CommonKernelFunctors { typedef typename K::Circle_3 Circle_3; public: - typedef typename K::Boolean result_type; // Point_3 is special case since the global operator== would recurse. - result_type + Boolean operator()(const Point_3 &p, const Point_3 &q) const { return CGAL_AND_3(p.x() == q.x(), p.y() == q.y(), p.z() == q.z()); } - result_type + Boolean operator()(const Plane_3 &v1, const Plane_3 &v2) const { return v1.rep() == v2.rep(); } - result_type + Boolean operator()(const Iso_cuboid_3 &v1, const Iso_cuboid_3 &v2) const { return v1.rep() == v2.rep(); } - result_type + Boolean operator()(const Sphere_3 &v1, const Sphere_3 &v2) const { return v1.rep() == v2.rep(); } - result_type + Boolean operator()(const Tetrahedron_3 &v1, const Tetrahedron_3 &v2) const { return v1.rep() == v2.rep(); } - result_type + Boolean operator()(const Triangle_3 &v1, const Triangle_3 &v2) const { return v1.rep() == v2.rep(); } - result_type + Boolean operator()(const Ray_3 &v1, const Ray_3 &v2) const { return v1.rep() == v2.rep(); } - result_type + Boolean operator()(const Line_3 &v1, const Line_3 &v2) const { return v1.rep() == v2.rep(); } - result_type + Boolean operator()(const Direction_3 &v1, const Direction_3 &v2) const { return v1.rep() == v2.rep(); } - result_type + Boolean operator()(const Segment_3 &v1, const Segment_3 &v2) const { return v1.rep() == v2.rep(); } - result_type + Boolean operator()(const Vector_3 &v1, const Vector_3 &v2) const { return v1.rep() == v2.rep(); } - result_type + Boolean operator()(const Vector_3 &v, const Null_vector &n) const { return v.rep() == n; } - result_type + Boolean operator()(const Circle_3 &v1, const Circle_3 &v2) const { return v1.rep() == v2.rep(); @@ -3299,22 +3160,22 @@ namespace CommonKernelFunctors { template class Has_on_boundary_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; typedef typename K::Circle_2 Circle_2; typedef typename K::Triangle_2 Triangle_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Circle_2& c, const Point_2& p) const { return c.has_on_boundary(p); } - result_type + Boolean operator()( const Triangle_2& t, const Point_2& p) const { return t.has_on_boundary(p); } - result_type + Boolean operator()( const Iso_rectangle_2& r, const Point_2& p) const { return K().bounded_side_2_object()(r,p) == ON_BOUNDARY; } }; @@ -3322,23 +3183,23 @@ namespace CommonKernelFunctors { template class Has_on_boundary_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; typedef typename K::Sphere_3 Sphere_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; typedef typename K::Plane_3 Plane_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Sphere_3& s, const Point_3& p) const { return s.rep().has_on_boundary(p); } - result_type + Boolean operator()( const Tetrahedron_3& t, const Point_3& p) const { return t.rep().has_on_boundary(p); } - result_type + Boolean operator()( const Iso_cuboid_3& c, const Point_3& p) const { return c.rep().has_on_boundary(p); } @@ -3347,22 +3208,22 @@ namespace CommonKernelFunctors { template class Has_on_bounded_side_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; typedef typename K::Circle_2 Circle_2; typedef typename K::Triangle_2 Triangle_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Circle_2& c, const Point_2& p) const { return c.has_on_bounded_side(p); } - result_type + Boolean operator()( const Triangle_2& t, const Point_2& p) const { return t.has_on_bounded_side(p); } - result_type + Boolean operator()( const Iso_rectangle_2& r, const Point_2& p) const { return K().bounded_side_2_object()(r,p) == ON_BOUNDED_SIDE; } }; @@ -3370,27 +3231,27 @@ namespace CommonKernelFunctors { template class Has_on_bounded_side_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; typedef typename K::Sphere_3 Sphere_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; typedef typename K::Circle_3 Circle_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Sphere_3& s, const Point_3& p) const { return s.has_on_bounded_side(p); } - result_type + Boolean operator()( const Tetrahedron_3& t, const Point_3& p) const { return t.rep().has_on_bounded_side(p); } - result_type + Boolean operator()( const Iso_cuboid_3& c, const Point_3& p) const { return c.rep().has_on_bounded_side(p); } - result_type + Boolean operator()(const Circle_3& c, const Point_3& p) const { CGAL_kernel_precondition( @@ -3400,7 +3261,7 @@ namespace CommonKernelFunctors { } // returns true iff the line segment ab is inside the union of the bounded sides of s1 and s2. - Needs_FT + Needs_FT operator()(const Sphere_3& s1, const Sphere_3& s2, const Point_3& a, const Point_3& b) const { @@ -3439,22 +3300,22 @@ namespace CommonKernelFunctors { template class Has_on_negative_side_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; typedef typename K::Circle_2 Circle_2; typedef typename K::Triangle_2 Triangle_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Circle_2& c, const Point_2& p) const { return c.has_on_negative_side(p); } - result_type + Boolean operator()( const Triangle_2& t, const Point_2& p) const { return t.has_on_negative_side(p); } - result_type + Boolean operator()( const Line_2& l, const Point_2& p) const { return l.has_on_negative_side(p); } }; @@ -3462,22 +3323,22 @@ namespace CommonKernelFunctors { template class Has_on_negative_side_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Plane_3 Plane_3; typedef typename K::Sphere_3 Sphere_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Sphere_3& s, const Point_3& p) const { return s.has_on_negative_side(p); } - result_type + Boolean operator()( const Tetrahedron_3& t, const Point_3& p) const { return t.rep().has_on_negative_side(p); } - result_type + Boolean operator()( const Plane_3& pl, const Point_3& p) const { return pl.rep().has_on_negative_side(p); } }; @@ -3485,22 +3346,22 @@ namespace CommonKernelFunctors { template class Has_on_positive_side_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; typedef typename K::Circle_2 Circle_2; typedef typename K::Triangle_2 Triangle_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Circle_2& c, const Point_2& p) const { return c.has_on_positive_side(p); } - result_type + Boolean operator()( const Triangle_2& t, const Point_2& p) const { return t.has_on_positive_side(p); } - result_type + Boolean operator()( const Line_2& l, const Point_2& p) const { return l.has_on_positive_side(p); } }; @@ -3508,22 +3369,22 @@ namespace CommonKernelFunctors { template class Has_on_positive_side_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Plane_3 Plane_3; typedef typename K::Sphere_3 Sphere_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Sphere_3& s, const Point_3& p) const { return s.has_on_positive_side(p); } - result_type + Boolean operator()( const Tetrahedron_3& t, const Point_3& p) const { return t.rep().has_on_positive_side(p); } - result_type + Boolean operator()( const Plane_3& pl, const Point_3& p) const { return pl.rep().has_on_positive_side(p); } }; @@ -3531,22 +3392,22 @@ namespace CommonKernelFunctors { template class Has_on_unbounded_side_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; typedef typename K::Circle_2 Circle_2; typedef typename K::Triangle_2 Triangle_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Circle_2& c, const Point_2& p) const { return c.has_on_unbounded_side(p); } - result_type + Boolean operator()( const Triangle_2& t, const Point_2& p) const { return t.has_on_unbounded_side(p); } - result_type + Boolean operator()( const Iso_rectangle_2& r, const Point_2& p) const { return K().bounded_side_2_object()(r,p)== ON_UNBOUNDED_SIDE; @@ -3557,27 +3418,27 @@ namespace CommonKernelFunctors { template class Has_on_unbounded_side_3 { + typedef typename K::Boolean Boolean; typedef typename K::Point_3 Point_3; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; typedef typename K::Sphere_3 Sphere_3; typedef typename K::Circle_3 Circle_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Sphere_3& s, const Point_3& p) const { return s.has_on_unbounded_side(p); } - result_type + Boolean operator()( const Tetrahedron_3& t, const Point_3& p) const { return t.rep().has_on_unbounded_side(p); } - result_type + Boolean operator()( const Iso_cuboid_3& c, const Point_3& p) const { return c.rep().has_on_unbounded_side(p); } - result_type + Boolean operator()(const Circle_3& c, const Point_3& p) const { CGAL_kernel_precondition( @@ -3590,22 +3451,22 @@ namespace CommonKernelFunctors { template class Has_on_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Line_2 Line_2; typedef typename K::Ray_2 Ray_2; typedef typename K::Segment_2 Segment_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Line_2& l, const Point_2& p) const { return l.has_on(p); } - result_type + Boolean operator()( const Ray_2& r, const Point_2& p) const { return r.has_on(p); } - result_type + Boolean operator()( const Segment_2& s, const Point_2& p) const { return s.has_on(p); } }; @@ -3614,8 +3475,6 @@ namespace CommonKernelFunctors { class Intersect_2 { public: - - // 25 possibilities, so I keep the template. template typename CGAL::Intersection_traits::result_type operator()(const T1& t1, const T2& t2) const @@ -3626,9 +3485,8 @@ namespace CommonKernelFunctors { class Intersect_3 { typedef typename K::Plane_3 Plane_3; - public: - // n possibilities, so I keep the template. + public: template typename CGAL::Intersection_traits::result_type operator()(const T1& t1, const T2& t2) const @@ -3670,6 +3528,7 @@ namespace CommonKernelFunctors { template class Is_degenerate_2 { + typedef typename K::Boolean Boolean; typedef typename K::Circle_2 Circle_2; typedef typename K::Iso_rectangle_2 Iso_rectangle_2; typedef typename K::Line_2 Line_2; @@ -3677,34 +3536,33 @@ namespace CommonKernelFunctors { typedef typename K::Segment_2 Segment_2; typedef typename K::Triangle_2 Triangle_2; typedef typename K::Circle_3 Circle_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Circle_2& c) const { return c.is_degenerate(); } - result_type + Boolean operator()( const Iso_rectangle_2& r) const { return (r.xmin() == r.xmax()) || (r.ymin() == r.ymax()); } - result_type + Boolean operator()( const Line_2& l) const { return CGAL_NTS is_zero(l.a()) && CGAL_NTS is_zero(l.b()); } - result_type + Boolean operator()( const Ray_2& r) const { return r.rep().is_degenerate(); } - result_type + Boolean operator()( const Segment_2& s) const { return s.source() == s.target(); } - result_type + Boolean operator()( const Triangle_2& t) const { return t.is_degenerate(); } - result_type + Boolean operator()( const Circle_3& c) const { return c.rep().is_degenerate(); } }; @@ -3712,6 +3570,7 @@ namespace CommonKernelFunctors { template class Is_degenerate_3 { + typedef typename K::Boolean Boolean; typedef typename K::Iso_cuboid_3 Iso_cuboid_3; typedef typename K::Line_3 Line_3; typedef typename K::Circle_3 Circle_3; @@ -3721,42 +3580,41 @@ namespace CommonKernelFunctors { typedef typename K::Sphere_3 Sphere_3; typedef typename K::Triangle_3 Triangle_3; typedef typename K::Tetrahedron_3 Tetrahedron_3; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Iso_cuboid_3& c) const { return c.rep().is_degenerate(); } - result_type + Boolean operator()( const Line_3& l) const { return l.rep().is_degenerate(); } - result_type + Boolean operator()( const Plane_3& pl) const { return pl.rep().is_degenerate(); } - result_type + Boolean operator()( const Ray_3& r) const { return r.rep().is_degenerate(); } - result_type + Boolean operator()( const Segment_3& s) const { return s.rep().is_degenerate(); } - result_type + Boolean operator()( const Sphere_3& s) const { return s.rep().is_degenerate(); } - result_type + Boolean operator()( const Triangle_3& t) const { return t.rep().is_degenerate(); } - result_type + Boolean operator()( const Tetrahedron_3& t) const { return t.rep().is_degenerate(); } - result_type + Boolean operator()( const Circle_3& t) const { return t.rep().is_degenerate(); } @@ -3765,21 +3623,21 @@ namespace CommonKernelFunctors { template class Is_horizontal_2 { + typedef typename K::Boolean Boolean; typedef typename K::Line_2 Line_2; typedef typename K::Segment_2 Segment_2; typedef typename K::Ray_2 Ray_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Line_2& l) const { return CGAL_NTS is_zero(l.a()); } - result_type + Boolean operator()( const Segment_2& s) const { return s.is_horizontal(); } - result_type + Boolean operator()( const Ray_2& r) const { return r.is_horizontal(); } }; @@ -3787,21 +3645,21 @@ namespace CommonKernelFunctors { template class Is_vertical_2 { + typedef typename K::Boolean Boolean; typedef typename K::Line_2 Line_2; typedef typename K::Segment_2 Segment_2; typedef typename K::Ray_2 Ray_2; - public: - typedef typename K::Boolean result_type; - result_type + public: + Boolean operator()( const Line_2& l) const { return CGAL_NTS is_zero(l.b()); } - result_type + Boolean operator()( const Segment_2& s) const { return s.is_vertical(); } - result_type + Boolean operator()( const Ray_2& r) const { return r.is_vertical(); } }; @@ -3809,16 +3667,17 @@ namespace CommonKernelFunctors { template class Left_turn_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Orientation_2 Orientation_2; - Orientation_2 o; - public: - typedef typename K::Boolean result_type; + Orientation_2 o; + + public: Left_turn_2() {} Left_turn_2(const Orientation_2& o_) : o(o_) {} - result_type + Boolean operator()(const Point_2& p, const Point_2& q, const Point_2& r) const { return o(p, q, r) == LEFT_TURN; } }; @@ -3826,22 +3685,23 @@ namespace CommonKernelFunctors { template class Less_rotate_ccw_2 { + typedef typename K::Boolean Boolean; typedef typename K::Point_2 Point_2; typedef typename K::Orientation_2 Orientation_2; typedef typename K::Collinear_are_ordered_along_line_2 + Collinear_are_ordered_along_line_2; Orientation_2 o; Collinear_are_ordered_along_line_2 co; - public: - typedef typename K::Boolean result_type; + public: Less_rotate_ccw_2() {} Less_rotate_ccw_2(const Orientation_2& o_, const Collinear_are_ordered_along_line_2& co_) : o(o_), co(co_) {} - result_type + Boolean operator()(const Point_2& r, const Point_2& p, const Point_2& q) const { typename K::Orientation ori = o(r, p, q); @@ -3868,23 +3728,23 @@ namespace CommonKernelFunctors { typedef typename K::Plane_3 Plane_3; typedef typename K::Sphere_3 Sphere_3; public: - typedef typename K::Oriented_side result_type; + typedef typename K::Oriented_side Oriented_side; - result_type + Oriented_side operator()( const Sphere_3& s, const Point_3& p) const { return s.rep().oriented_side(p); } - result_type + Oriented_side operator()( const Plane_3& pl, const Point_3& p) const { return pl.rep().oriented_side(p); } - result_type + Oriented_side operator()( const Point_3& plane_pt, const Vector_3& plane_normal, const Point_3& query) const { return typename K::Construct_plane_3()(plane_pt, plane_normal).rep().oriented_side(query); } - result_type + Oriented_side operator()( const Tetrahedron_3& t, const Point_3& p) const { return t.rep().oriented_side(p); } }; @@ -3898,9 +3758,7 @@ public: typedef typename K::Point_2 Point_2; typedef typename K::FT FT; - typedef Point_2 result_type; - - result_type operator() (const Weighted_point_2 & p, + Point_2 operator() (const Weighted_point_2 & p, const Weighted_point_2 & q, const Weighted_point_2 & r) const { diff --git a/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_3.h b/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_3.h index 9f9896ac7eb..ff2483b75b5 100644 --- a/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_3.h +++ b/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_3.h @@ -254,22 +254,23 @@ template 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::x(p); } typename R::FT y(const Point_3 &p) const { return Projector::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, - const Point_3& q, - const Point_3& r, - const Point_3& s) const + Comparison_result operator()(const Point_3& p, + const Point_3& q, + const Point_3& r, + const Point_3& s) const { return typename R::Compare_signed_distance_to_line_2() ( project(p), project(q), project(r), project(s) ); @@ -280,22 +281,23 @@ template 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::x(p); } typename R::FT y(const Point_3 &p) const { return Projector::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, - const Point_3& q, - const Point_3& r, - const Point_3& s) const + Boolean operator()(const Point_3& p, + const Point_3& q, + const Point_3& r, + const Point_3& s) const { return typename R::Less_signed_distance_to_line_2() ( project(p), project(q), project(r), project(s) ); @@ -597,8 +599,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::x(v); } FT y(const Vector_3 &v) const { return Projector::y(v); } @@ -972,8 +972,8 @@ public: struct Less_xy_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_x_2 cx; Comparison_result crx = cx(p,q); @@ -986,8 +986,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); @@ -999,8 +999,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; @@ -1010,8 +1010,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; @@ -1020,7 +1020,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; diff --git a/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_base_3.h b/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_base_3.h index 42c3bc31859..385d036f34e 100644 --- a/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_base_3.h +++ b/Kernel_23/include/CGAL/Kernel_23/internal/Projection_traits_base_3.h @@ -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 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 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,6 +345,7 @@ template class Less_xy_along_axis { // private members + typedef typename Traits::Boolean Boolean; typedef typename Traits::Vector_3 Vector_3; typedef typename Traits::Point_2 Point; Vector_3 base1, base2; @@ -359,9 +356,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 cx(base1); Comparison_result crx = cx(p, q);