mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 05:24:02 +00:00
Pass equals policy to strategies from less policy
This commit is contained in:
parent
a4923db148
commit
f719a26b44
@ -190,7 +190,7 @@ private:
|
|||||||
|
|
||||||
point_type most_left, most_right;
|
point_type most_left, most_right;
|
||||||
|
|
||||||
geometry::less<point_type, -1, Strategy> less;
|
geometry::less_exact<point_type, -1, Strategy> less;
|
||||||
|
|
||||||
detail::convex_hull::get_extremes(in_proxy, most_left, most_right, less);
|
detail::convex_hull::get_extremes(in_proxy, most_left, most_right, less);
|
||||||
|
|
||||||
|
@ -38,6 +38,29 @@ namespace boost { namespace geometry
|
|||||||
on equal x-es then on y, etc.
|
on equal x-es then on y, etc.
|
||||||
If a dimension is specified, only that dimension is considered
|
If a dimension is specified, only that dimension is considered
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
template
|
||||||
|
<
|
||||||
|
typename Point = void,
|
||||||
|
int Dimension = -1,
|
||||||
|
typename StrategyOrTag = void
|
||||||
|
>
|
||||||
|
struct less_exact
|
||||||
|
{
|
||||||
|
using first_argument_type = Point;
|
||||||
|
using second_argument_type = Point;
|
||||||
|
using result_type = bool;
|
||||||
|
|
||||||
|
inline bool operator()(Point const& left, Point const& right) const
|
||||||
|
{
|
||||||
|
return StrategyOrTag::template compare_type
|
||||||
|
<
|
||||||
|
strategy::compare::less,
|
||||||
|
strategy::compare::equals_exact
|
||||||
|
>::apply(left, right);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template
|
template
|
||||||
<
|
<
|
||||||
typename Point = void,
|
typename Point = void,
|
||||||
@ -54,7 +77,8 @@ struct less
|
|||||||
{
|
{
|
||||||
return StrategyOrTag::template compare_type
|
return StrategyOrTag::template compare_type
|
||||||
<
|
<
|
||||||
strategy::compare::less
|
strategy::compare::less,
|
||||||
|
strategy::compare::equals_epsilon
|
||||||
>::apply(left, right);
|
>::apply(left, right);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -91,7 +115,8 @@ struct less<void, Dimension, Strategy>
|
|||||||
{
|
{
|
||||||
return Strategy::template compare_type
|
return Strategy::template compare_type
|
||||||
<
|
<
|
||||||
strategy::compare::less
|
strategy::compare::less,
|
||||||
|
strategy::compare::equals_epsilon
|
||||||
>::apply(left, right);
|
>::apply(left, right);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -50,11 +50,11 @@ public:
|
|||||||
return side_strategy_type();
|
return side_strategy_type();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename ComparePolicy>
|
template <typename ComparePolicy, typename EqualsPolicy>
|
||||||
using compare_type = typename strategy::compare::cartesian
|
using compare_type = typename strategy::compare::cartesian
|
||||||
<
|
<
|
||||||
ComparePolicy,
|
ComparePolicy,
|
||||||
strategy::compare::equals_exact,
|
EqualsPolicy,
|
||||||
-1
|
-1
|
||||||
>;
|
>;
|
||||||
};
|
};
|
||||||
|
@ -65,11 +65,11 @@ public:
|
|||||||
>(base_t::m_spheroid);
|
>(base_t::m_spheroid);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename ComparePolicy>
|
template <typename ComparePolicy, typename EqualsPolicy>
|
||||||
using compare_type = typename strategy::compare::spherical
|
using compare_type = typename strategy::compare::spherical
|
||||||
<
|
<
|
||||||
ComparePolicy,
|
ComparePolicy,
|
||||||
strategy::compare::equals_exact,
|
EqualsPolicy,
|
||||||
-1
|
-1
|
||||||
>;
|
>;
|
||||||
};
|
};
|
||||||
|
@ -47,11 +47,11 @@ public:
|
|||||||
return strategy::side::spherical_side_formula<CalculationType>();
|
return strategy::side::spherical_side_formula<CalculationType>();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename ComparePolicy>
|
template <typename ComparePolicy, typename EqualsPolicy>
|
||||||
using compare_type = typename strategy::compare::spherical
|
using compare_type = typename strategy::compare::spherical
|
||||||
<
|
<
|
||||||
ComparePolicy,
|
ComparePolicy,
|
||||||
strategy::compare::equals_exact,
|
EqualsPolicy,
|
||||||
-1
|
-1
|
||||||
>;
|
>;
|
||||||
};
|
};
|
||||||
|
@ -189,11 +189,11 @@ public:
|
|||||||
return strategy::within::cartesian_box_box();
|
return strategy::within::cartesian_box_box();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename ComparePolicy>
|
template <typename ComparePolicy, typename EqualsPolicy>
|
||||||
using compare_type = typename strategy::compare::cartesian
|
using compare_type = typename strategy::compare::cartesian
|
||||||
<
|
<
|
||||||
ComparePolicy,
|
ComparePolicy,
|
||||||
strategy::compare::equals_epsilon,
|
EqualsPolicy,
|
||||||
-1
|
-1
|
||||||
>;
|
>;
|
||||||
};
|
};
|
||||||
|
@ -211,16 +211,13 @@ public:
|
|||||||
return strategy::within::spherical_box_box();
|
return strategy::within::spherical_box_box();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename ComparePolicy>
|
template <typename ComparePolicy, typename EqualsPolicy>
|
||||||
using compare_type = typename strategy::compare::spherical
|
using compare_type = typename strategy::compare::spherical
|
||||||
<
|
<
|
||||||
ComparePolicy,
|
ComparePolicy,
|
||||||
strategy::compare::equals_epsilon,
|
EqualsPolicy,
|
||||||
-1
|
-1
|
||||||
>;
|
>;
|
||||||
|
|
||||||
//template <typename ComparePolicy, typename EqualsPolicy, int Dimension>
|
|
||||||
//using compare_type = strategy::compare::spherical<ComparePolicy, EqualsPolicy, Dimension>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -293,12 +290,12 @@ struct strategy_converter<strategy::intersection::geographic_segments<FormulaPol
|
|||||||
>(base_t::m_spheroid);
|
>(base_t::m_spheroid);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename ComparePolicy>
|
template <typename ComparePolicy, typename EqualsPolicy>
|
||||||
using compare_type = typename strategy::compare::cartesian
|
using compare_type = typename strategy::compare::spherical
|
||||||
<
|
<
|
||||||
ComparePolicy,
|
ComparePolicy,
|
||||||
strategy::compare::equals_epsilon,
|
EqualsPolicy,
|
||||||
-1
|
-1
|
||||||
>;
|
>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -195,11 +195,11 @@ public:
|
|||||||
return strategy::within::spherical_box_box();
|
return strategy::within::spherical_box_box();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename ComparePolicy>
|
template <typename ComparePolicy, typename EqualsPolicy>
|
||||||
using compare_type = typename strategy::compare::spherical
|
using compare_type = typename strategy::compare::spherical
|
||||||
<
|
<
|
||||||
ComparePolicy,
|
ComparePolicy,
|
||||||
strategy::compare::equals_epsilon,
|
EqualsPolicy,
|
||||||
-1
|
-1
|
||||||
>;
|
>;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user