diff --git a/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp b/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp index f1ddb8d74..f2306d4d9 100644 --- a/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -38,16 +39,16 @@ namespace detail { namespace copy_segments { -template -< - typename Ring, - bool Reverse, - typename SegmentIdentifier, - typename RangeOut -> +template struct copy_segments_ring { - template + template + < + typename Ring, + typename SegmentIdentifier, + typename RobustPolicy, + typename RangeOut + > static inline void apply(Ring const& ring, SegmentIdentifier const& seg_id, int to_index, RobustPolicy const& robust_policy, @@ -101,16 +102,16 @@ struct copy_segments_ring } }; -template -< - typename LineString, - bool Reverse, - typename SegmentIdentifier, - typename RangeOut -> +template struct copy_segments_linestring { - template + template + < + typename LineString, + typename SegmentIdentifier, + typename RobustPolicy, + typename RangeOut + > static inline void apply(LineString const& ls, SegmentIdentifier const& seg_id, int to_index, RobustPolicy const& robust_policy, @@ -138,51 +139,45 @@ struct copy_segments_linestring } }; -template -< - typename Polygon, - bool Reverse, - typename SegmentIdentifier, - typename RangeOut -> +template struct copy_segments_polygon { - template + template + < + typename Polygon, + typename SegmentIdentifier, + typename RobustPolicy, + typename RangeOut + > static inline void apply(Polygon const& polygon, SegmentIdentifier const& seg_id, int to_index, RobustPolicy const& robust_policy, RangeOut& current_output) { // Call ring-version with the right ring - copy_segments_ring - < - typename geometry::ring_type::type, - Reverse, - SegmentIdentifier, - RangeOut - >::apply - ( - seg_id.ring_index < 0 - ? geometry::exterior_ring(polygon) - : geometry::interior_rings(polygon)[seg_id.ring_index], - seg_id, to_index, - robust_policy, - current_output - ); + copy_segments_ring::apply + ( + seg_id.ring_index < 0 + ? geometry::exterior_ring(polygon) + : geometry::interior_rings(polygon)[seg_id.ring_index], + seg_id, to_index, + robust_policy, + current_output + ); } }; -template -< - typename Box, - bool Reverse, - typename SegmentIdentifier, - typename RangeOut -> +template struct copy_segments_box { - template + template + < + typename Box, + typename SegmentIdentifier, + typename RobustPolicy, + typename RangeOut + > static inline void apply(Box const& box, SegmentIdentifier const& seg_id, int to_index, RobustPolicy const& robust_policy, @@ -223,80 +218,33 @@ namespace dispatch template < typename Tag, - typename GeometryIn, - bool Reverse, - typename SegmentIdentifier, - typename RangeOut + bool Reverse > -struct copy_segments -{ - BOOST_MPL_ASSERT_MSG - ( - false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE - , (types) - ); -}; - - -template -< - typename Ring, - bool Reverse, - typename SegmentIdentifier, - typename RangeOut -> -struct copy_segments - : detail::copy_segments::copy_segments_ring - < - Ring, Reverse, SegmentIdentifier, RangeOut - > +struct copy_segments : not_implemented {}; - -template -< - typename LineString, - bool Reverse, - typename SegmentIdentifier, - typename RangeOut -> -struct copy_segments - : detail::copy_segments::copy_segments_linestring - < - LineString, Reverse, SegmentIdentifier, RangeOut - > -{}; - -template -< - typename Polygon, - bool Reverse, - typename SegmentIdentifier, - typename RangeOut -> -struct copy_segments - : detail::copy_segments::copy_segments_polygon - < - Polygon, Reverse, SegmentIdentifier, RangeOut - > +template +struct copy_segments + : detail::copy_segments::copy_segments_ring {}; -template -< - typename Box, - bool Reverse, - typename SegmentIdentifier, - typename RangeOut -> -struct copy_segments - : detail::copy_segments::copy_segments_box - < - Box, Reverse, SegmentIdentifier, RangeOut - > +template +struct copy_segments + : detail::copy_segments::copy_segments_linestring {}; +template +struct copy_segments + : detail::copy_segments::copy_segments_polygon +{}; + + +template +struct copy_segments + : detail::copy_segments::copy_segments_box +{}; } // namespace dispatch @@ -326,10 +274,7 @@ inline void copy_segments(Geometry const& geometry, dispatch::copy_segments < typename tag::type, - Geometry, - Reverse, - SegmentIdentifier, - RangeOut + Reverse >::apply(geometry, seg_id, to_index, robust_policy, range_out); } diff --git a/include/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp b/include/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp index 9b9573dd2..e6d62dffb 100644 --- a/include/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp +++ b/include/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp @@ -28,16 +28,16 @@ namespace detail { namespace copy_segments { -template -< - typename MultiGeometry, - typename SegmentIdentifier, - typename RangeOut, - typename Policy -> +template struct copy_segments_multi { - template + template + < + typename MultiGeometry, + typename SegmentIdentifier, + typename RobustPolicy, + typename RangeOut + > static inline void apply(MultiGeometry const& multi_geometry, SegmentIdentifier const& seg_id, int to_index, RobustPolicy const& robust_policy, @@ -68,33 +68,11 @@ namespace dispatch { -template -< - typename MultiPolygon, - bool Reverse, - typename SegmentIdentifier, - typename RangeOut -> -struct copy_segments - < - multi_polygon_tag, - MultiPolygon, - Reverse, - SegmentIdentifier, - RangeOut - > +template +struct copy_segments : detail::copy_segments::copy_segments_multi < - MultiPolygon, - SegmentIdentifier, - RangeOut, - detail::copy_segments::copy_segments_polygon - < - typename boost::range_value::type, - Reverse, - SegmentIdentifier, - RangeOut - > + detail::copy_segments::copy_segments_polygon > {};