summaryrefslogtreecommitdiff
path: root/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/geometry/algorithms/detail/overlay/intersection_insert.hpp')
-rw-r--r--boost/geometry/algorithms/detail/overlay/intersection_insert.hpp63
1 files changed, 30 insertions, 33 deletions
diff --git a/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp b/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp
index bb82003a23..3244480f48 100644
--- a/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp
+++ b/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp
@@ -2,10 +2,11 @@
// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
-// This file was modified by Oracle on 2014, 2015.
-// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
+// This file was modified by Oracle on 2014, 2015, 2017.
+// Modifications copyright (c) 2014-2017 Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
+// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -71,7 +72,7 @@ struct intersection_segment_segment_point
Segment2 const& segment2,
RobustPolicy const& robust_policy,
OutputIterator out,
- Strategy const& )
+ Strategy const& strategy)
{
typedef typename point_type<PointOut>::type point_type;
@@ -106,16 +107,15 @@ struct intersection_segment_segment_point
>::type
> intersection_return_type;
- typedef strategy::intersection::relate_cartesian_segments
+ typedef policies::relate::segments_intersection_points
<
- policies::relate::segments_intersection_points
- <
- intersection_return_type
- >
- > policy;
+ intersection_return_type
+ > policy_type;
- intersection_return_type is = policy::apply(segment1, segment2,
- robust_policy, pi_rob, pj_rob, qi_rob, qj_rob);
+ intersection_return_type
+ is = strategy.apply(segment1, segment2,
+ policy_type(), robust_policy,
+ pi_rob, pj_rob, qi_rob, qj_rob);
for (std::size_t i = 0; i < is.count; i++)
{
@@ -134,13 +134,14 @@ struct intersection_linestring_linestring_point
<
typename Linestring1, typename Linestring2,
typename RobustPolicy,
- typename OutputIterator, typename Strategy
+ typename OutputIterator,
+ typename Strategy
>
static inline OutputIterator apply(Linestring1 const& linestring1,
Linestring2 const& linestring2,
RobustPolicy const& robust_policy,
OutputIterator out,
- Strategy const& )
+ Strategy const& strategy)
{
typedef typename point_type<PointOut>::type point_type;
@@ -151,7 +152,8 @@ struct intersection_linestring_linestring_point
> turn_info;
std::deque<turn_info> turns;
- geometry::get_intersection_points(linestring1, linestring2, robust_policy, turns);
+ geometry::get_intersection_points(linestring1, linestring2,
+ robust_policy, turns, strategy);
for (typename boost::range_iterator<std::deque<turn_info> const>::type
it = boost::begin(turns); it != boost::end(turns); ++it)
@@ -295,7 +297,7 @@ struct intersection_of_linestring_with_areal
static inline OutputIterator apply(LineString const& linestring, Areal const& areal,
RobustPolicy const& robust_policy,
OutputIterator out,
- Strategy const& )
+ Strategy const& strategy)
{
if (boost::size(linestring) == 0)
{
@@ -325,7 +327,7 @@ struct intersection_of_linestring_with_areal
false,
(OverlayType == overlay_intersection ? ReverseAreal : !ReverseAreal),
detail::overlay::assign_null_policy
- >(linestring, areal, robust_policy, turns, policy);
+ >(linestring, areal, strategy, robust_policy, turns, policy);
if (no_crossing_turns_or_empty(turns))
{
@@ -621,7 +623,7 @@ struct intersection_insert
static inline OutputIterator apply(Geometry1 const& geometry1,
Geometry2 const& geometry2,
RobustPolicy const& robust_policy,
- OutputIterator out, Strategy const& )
+ OutputIterator out, Strategy const& strategy)
{
typedef detail::overlay::turn_info
@@ -635,7 +637,7 @@ struct intersection_insert
geometry::get_turns
<
false, false, detail::overlay::assign_null_policy
- >(geometry1, geometry2, robust_policy, turns, policy);
+ >(geometry1, geometry2, strategy, robust_policy, turns, policy);
for (typename std::vector<turn_info>::const_iterator it
= turns.begin(); it != turns.end(); ++it)
{
@@ -996,7 +998,11 @@ inline OutputIterator intersection_insert(Geometry1 const& geometry1,
concepts::check<Geometry1 const>();
concepts::check<Geometry2 const>();
- typedef typename Strategy::rescale_policy_type rescale_policy_type;
+ typedef typename geometry::rescale_policy_type
+ <
+ typename geometry::point_type<Geometry1>::type // TODO from both
+ >::type rescale_policy_type;
+
rescale_policy_type robust_policy
= geometry::get_rescale_policy<rescale_policy_type>(geometry1, geometry2);
@@ -1037,22 +1043,13 @@ inline OutputIterator intersection_insert(Geometry1 const& geometry1,
concepts::check<Geometry1 const>();
concepts::check<Geometry2 const>();
- typedef typename geometry::rescale_policy_type
- <
- typename geometry::point_type<Geometry1>::type // TODO from both
- >::type rescale_policy_type;
-
- typedef intersection_strategies
+ typedef typename strategy::intersection::services::default_strategy
<
- typename cs_tag<GeometryOut>::type,
- Geometry1,
- Geometry2,
- typename geometry::point_type<GeometryOut>::type,
- rescale_policy_type
- > strategy;
-
+ typename cs_tag<GeometryOut>::type
+ >::type strategy_type;
+
return intersection_insert<GeometryOut>(geometry1, geometry2, out,
- strategy());
+ strategy_type());
}
}} // namespace detail::intersection