diff --git a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp index 83be5c399..3db6d6a72 100644 --- a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp @@ -532,7 +532,7 @@ struct intersection_insert false, false, false > : detail::overlay::linear_linear_linestring < - LineStringOut, overlay_difference + Linear1, Linear2, LineStringOut, overlay_difference > {}; @@ -554,7 +554,7 @@ struct intersection_insert false, false, false > : detail::overlay::linear_linear_linestring < - LineStringOut, overlay_intersection + Linear1, Linear2, LineStringOut, overlay_intersection > {}; diff --git a/include/boost/geometry/algorithms/detail/overlay/linear_linear.hpp b/include/boost/geometry/algorithms/detail/overlay/linear_linear.hpp index 6a5653f08..28c8b6e93 100644 --- a/include/boost/geometry/algorithms/detail/overlay/linear_linear.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/linear_linear.hpp @@ -30,6 +30,37 @@ namespace detail { namespace overlay { +namespace core +{ + +template +struct is_linear : not_implemented +{}; + +template <> +struct is_linear +{}; + +template <> +struct is_linear +{}; + + +template +struct are_linear + : is_linear, is_linear +{}; + +template +struct are_linear + : is_linear +{}; + + + + +} + //=========================================================================== //=========================================================================== //=========================================================================== @@ -112,8 +143,18 @@ struct linear_linear_no_intersections -template +template +< + typename Linear1, + typename Linear2, + typename LinestringOut, + overlay_type OverlayType +> class linear_linear_linestring + : core::are_linear + < + typename tag::type, typename tag::type + > { protected: typedef typename point_type::type PointOut; @@ -206,20 +247,25 @@ protected: #endif - template + template + < + typename Turns, + typename LinearGeometry1, + typename LinearGeometry2 + > static inline void compute_turns(Turns& turns, - Linear1 const& linear1, - Linear2 const& linear2) + LinearGeometry1 const& linear1, + LinearGeometry2 const& linear2) { turns.clear(); geometry::detail::relate::turns::get_turns < - Linear1, - Linear2, + LinearGeometry1, + LinearGeometry2, detail::get_turns::get_turn_info_type < - Linear1, - Linear2, + LinearGeometry1, + LinearGeometry2, AssignPolicy > >::apply(turns, linear1, linear2); @@ -231,21 +277,21 @@ protected: overlay_type OverlayTypeForFollow, bool FollowIsolatedPoints, typename Turns, - typename Linear1, - typename Linear2, + typename LinearGeometry1, + typename LinearGeometry2, typename OutputIterator > static inline OutputIterator follow_turns(Turns const& turns, Turns const& reverse_turns, - Linear1 const& linear1, - Linear2 const& linear2, + LinearGeometry1 const& linear1, + LinearGeometry2 const& linear2, OutputIterator oit) { return detail::overlay::following::linear::follow < LinestringOut, - Linear1, - Linear2, + LinearGeometry1, + LinearGeometry2, OverlayTypeForFollow, FollowIsolatedPoints >::apply(linear1, linear2, turns, reverse_turns, oit); @@ -257,15 +303,15 @@ protected: overlay_type OverlayTypeForFollow, bool FollowIsolatedPoints, typename Turns, - typename Linear1, - typename Linear2, + typename LinearGeometry1, + typename LinearGeometry2, typename OutputIterator > static inline OutputIterator sort_and_follow_turns(Turns& turns, Turns& reverse_turns, - Linear1 const& linear1, - Linear2 const& linear2, + LinearGeometry1 const& linear1, + LinearGeometry2 const& linear2, OutputIterator oit) { // remove turns that have no added value @@ -304,7 +350,6 @@ protected: public: template < - typename Linear1, typename Linear2, typename OutputIterator, typename Strategy > static inline OutputIterator apply(Linear1 const& linear1, @@ -373,14 +418,22 @@ public: -template -struct linear_linear_linestring - : linear_linear_linestring +template +< + typename Linear1, + typename Linear2, + typename LinestringOut +> +struct linear_linear_linestring + : linear_linear_linestring + < + Linear1, Linear2, LinestringOut, overlay_difference + > { protected: typedef linear_linear_linestring < - LinestringOut, overlay_difference + Linear1, Linear2, LinestringOut, overlay_difference > Base; typedef typename Base::Turns Turns; @@ -388,7 +441,6 @@ protected: public: template < - typename Linear1, typename Linear2, typename OutputIterator, typename Strategy > static inline OutputIterator apply(Linear1 const& linear1, diff --git a/include/boost/geometry/algorithms/union.hpp b/include/boost/geometry/algorithms/union.hpp index ef9bd5e5b..ef8b4c5be 100644 --- a/include/boost/geometry/algorithms/union.hpp +++ b/include/boost/geometry/algorithms/union.hpp @@ -116,7 +116,7 @@ struct union_insert false > : detail::overlay::linear_linear_linestring < - LineStringOut, overlay_union + Linear1, Linear2, LineStringOut, overlay_union > {};