summaryrefslogtreecommitdiff
path: root/boost/geometry/algorithms/detail/distance/segment_to_box.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/geometry/algorithms/detail/distance/segment_to_box.hpp')
-rw-r--r--boost/geometry/algorithms/detail/distance/segment_to_box.hpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/boost/geometry/algorithms/detail/distance/segment_to_box.hpp b/boost/geometry/algorithms/detail/distance/segment_to_box.hpp
index d88a6699c8..93ebebe18d 100644
--- a/boost/geometry/algorithms/detail/distance/segment_to_box.hpp
+++ b/boost/geometry/algorithms/detail/distance/segment_to_box.hpp
@@ -542,10 +542,8 @@ private:
SBStrategy const& sb_strategy,
ReturnType& result)
{
- typedef typename geometry::strategy::side::services::default_strategy
- <
- typename geometry::cs_tag<SegmentPoint>::type
- >::type side;
+ typename SBStrategy::side_strategy_type
+ side_strategy = sb_strategy.get_side_strategy();
typedef cast_to_result<ReturnType> cast;
ReturnType diff1 = cast::apply(geometry::get<1>(p1))
@@ -555,12 +553,12 @@ private:
sb_strategy.get_distance_ps_strategy();
int sign = diff1 < 0 ? -1 : 1;
- if (side::apply(p0, p1, corner1) * sign < 0)
+ if (side_strategy.apply(p0, p1, corner1) * sign < 0)
{
result = cast::apply(ps_strategy.apply(corner1, p0, p1));
return true;
}
- if (side::apply(p0, p1, corner2) * sign > 0)
+ if (side_strategy.apply(p0, p1, corner2) * sign > 0)
{
result = cast::apply(ps_strategy.apply(corner2, p0, p1));
return true;
@@ -682,7 +680,7 @@ public:
BoxPoint const& bottom_right,
SBStrategy const& sb_strategy)
{
- BOOST_GEOMETRY_ASSERT( geometry::less<SegmentPoint>()(p0, p1)
+ BOOST_GEOMETRY_ASSERT( (geometry::less<SegmentPoint, -1, typename SBStrategy::cs_tag>()(p0, p1))
|| geometry::has_nan_coordinate(p0)
|| geometry::has_nan_coordinate(p1) );
@@ -782,15 +780,9 @@ public:
>,
typename strategy::distance::services::comparable_type
<
- typename detail::distance::default_strategy
- <
- segment_point, Box
- >::type
+ typename SBStrategy::distance_pb_strategy::type
>::type,
- typename detail::distance::default_strategy
- <
- segment_point, Box
- >::type
+ typename SBStrategy::distance_pb_strategy::type
>::type point_box_strategy_type;
return dispatch::distance
@@ -809,7 +801,8 @@ public:
bottom_left, bottom_right,
top_left, top_right);
- if (geometry::less<segment_point>()(p[0], p[1]))
+ typedef geometry::less<segment_point, -1, typename SBStrategy::cs_tag> less_type;
+ if (less_type()(p[0], p[1]))
{
return segment_to_box_2D
<