From bf2362ed52bc11edf18c3a90fc28bdabbead3b6d Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 28 May 2015 11:57:34 +0300 Subject: [PATCH] [algorithms][inbtersection] add dispatch implementation for intersection(areal, areal, linear) --- .../detail/overlay/intersection_insert.hpp | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp index 5b9562674..782639a96 100644 --- a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -574,6 +575,46 @@ struct intersection_insert_reversed }; +// dispatch for intersection(areal, areal, linear) +template +< + typename Geometry1, typename Geometry2, + typename LinestringOut, + bool Reverse1, bool Reverse2, bool ReverseOut, + typename Tag1, typename Tag2 +> +struct intersection_insert + < + Geometry1, Geometry2, + LinestringOut, + overlay_intersection, + Reverse1, Reverse2, ReverseOut, + Tag1, Tag2, linestring_tag, + true, true, false + > +{ + template + < + typename RobustPolicy, typename OutputIterator, typename Strategy + > + static inline OutputIterator apply(Geometry1 const& geometry1, + Geometry2 const& geometry2, + RobustPolicy const& robust_policy, + OutputIterator oit, + Strategy const& strategy) + { + detail::boundary_view view1(geometry1); + detail::boundary_view view2(geometry2); + + return detail::overlay::linear_linear_linestring + < + detail::boundary_view, + detail::boundary_view, + LinestringOut, + overlay_intersection + >::apply(view1, view2, robust_policy, oit, strategy); + } +}; // dispatch for non-areal geometries template