diff options
Diffstat (limited to 'boost/geometry/multi')
66 files changed, 221 insertions, 4064 deletions
diff --git a/boost/geometry/multi/algorithms/append.hpp b/boost/geometry/multi/algorithms/append.hpp index e72be036ae..d1589aca84 100644 --- a/boost/geometry/multi/algorithms/append.hpp +++ b/boost/geometry/multi/algorithms/append.hpp @@ -1,8 +1,14 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2014 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2014 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2014. +// Modifications copyright (c) 2014, 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 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -14,39 +20,8 @@ #ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_APPEND_HPP #define BOOST_GEOMETRY_MULTI_ALGORITHMS_APPEND_HPP -#include <boost/geometry/algorithms/append.hpp> - -#include <boost/geometry/multi/core/tags.hpp> - - -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -namespace splitted_dispatch -{ -template <typename Geometry, typename Point> -struct append_point<multi_point_tag, Geometry, Point> - : detail::append::append_point<Geometry, Point> -{}; - -template <typename Geometry, typename Range> -struct append_range<multi_point_tag, Geometry, Range> - : detail::append::append_range<Geometry, Range> -{}; - -} - - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - -}} // namespace boost::geometry +#include <boost/geometry/algorithms/append.hpp> #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_APPEND_HPP diff --git a/boost/geometry/multi/algorithms/area.hpp b/boost/geometry/multi/algorithms/area.hpp index 6695686358..0e25ffc64e 100644 --- a/boost/geometry/multi/algorithms/area.hpp +++ b/boost/geometry/multi/algorithms/area.hpp @@ -15,43 +15,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_AREA_HPP -#include <boost/range/metafunctions.hpp> - #include <boost/geometry/algorithms/area.hpp> -#include <boost/geometry/multi/core/point_type.hpp> -#include <boost/geometry/multi/algorithms/detail/multi_sum.hpp> -#include <boost/geometry/multi/algorithms/num_points.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ -template <typename MultiGeometry, typename Strategy> -struct area<MultiGeometry, Strategy, multi_polygon_tag> - : detail::multi_sum - < - typename Strategy::return_type, - MultiGeometry, - Strategy, - area - < - typename boost::range_value<MultiGeometry>::type, - Strategy, - polygon_tag - > - > -{}; - - -} // namespace dispatch -#endif - - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_AREA_HPP diff --git a/boost/geometry/multi/algorithms/centroid.hpp b/boost/geometry/multi/algorithms/centroid.hpp index 855ed22fda..1c9902f2bf 100644 --- a/boost/geometry/multi/algorithms/centroid.hpp +++ b/boost/geometry/multi/algorithms/centroid.hpp @@ -15,163 +15,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_CENTROID_HPP -#include <boost/range.hpp> - #include <boost/geometry/algorithms/centroid.hpp> -#include <boost/geometry/multi/core/point_type.hpp> -#include <boost/geometry/multi/algorithms/num_points.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace centroid -{ - - -/*! - \brief Building block of a multi-point, to be used as Policy in the - more generec centroid_multi -*/ -template -< - typename Point, - typename Strategy -> -struct centroid_multi_point_state -{ - static inline void apply(Point const& point, - Strategy const& strategy, typename Strategy::state_type& state) - { - strategy.apply(point, state); - } -}; - - - -/*! - \brief Generic implementation which calls a policy to calculate the - centroid of the total of its single-geometries - \details The Policy is, in general, the single-version, with state. So - detail::centroid::centroid_polygon_state is used as a policy for this - detail::centroid::centroid_multi - -*/ -template -< - typename Multi, - typename Point, - typename Strategy, - typename Policy -> -struct centroid_multi -{ - static inline void apply(Multi const& multi, Point& centroid, - Strategy const& strategy) - { -#if ! defined(BOOST_GEOMETRY_CENTROID_NO_THROW) - // If there is nothing in any of the ranges, it is not possible - // to calculate the centroid - if (geometry::num_points(multi) == 0) - { - throw centroid_exception(); - } -#endif - - typename Strategy::state_type state; - - for (typename boost::range_iterator<Multi const>::type - it = boost::begin(multi); - it != boost::end(multi); - ++it) - { - Policy::apply(*it, strategy, state); - } - Strategy::result(state, centroid); - } -}; - - - -}} // namespace detail::centroid -#endif // DOXYGEN_NO_DETAIL - - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template -< - typename MultiLinestring, - typename Point, - typename Strategy -> -struct centroid<multi_linestring_tag, MultiLinestring, Point, Strategy> - : detail::centroid::centroid_multi - < - MultiLinestring, - Point, - Strategy, - detail::centroid::centroid_range_state - < - typename boost::range_value<MultiLinestring>::type, - closed, - Strategy - > - > -{}; - -template -< - typename MultiPolygon, - typename Point, - typename Strategy -> -struct centroid<multi_polygon_tag, MultiPolygon, Point, Strategy> - : detail::centroid::centroid_multi - < - MultiPolygon, - Point, - Strategy, - detail::centroid::centroid_polygon_state - < - typename boost::range_value<MultiPolygon>::type, - Strategy - > - > -{}; - - -template -< - typename MultiPoint, - typename Point, - typename Strategy -> -struct centroid<multi_point_tag, MultiPoint, Point, Strategy> - : detail::centroid::centroid_multi - < - MultiPoint, - Point, - Strategy, - detail::centroid::centroid_multi_point_state - < - typename boost::range_value<MultiPoint>::type, - Strategy - > - > -{}; - - -} // namespace dispatch -#endif - - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_CENTROID_HPP diff --git a/boost/geometry/multi/algorithms/clear.hpp b/boost/geometry/multi/algorithms/clear.hpp index 0b14b6ce9c..6d9e284d0a 100644 --- a/boost/geometry/multi/algorithms/clear.hpp +++ b/boost/geometry/multi/algorithms/clear.hpp @@ -15,29 +15,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_CLEAR_HPP -#include <boost/geometry/multi/core/tags.hpp> #include <boost/geometry/algorithms/clear.hpp> -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template <typename Geometry> -struct clear<Geometry, multi_tag> - : detail::clear::collection_clear<Geometry> -{}; - - -} // namespace dispatch -#endif - - -}} // namespace boost::geometry - - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_CLEAR_HPP diff --git a/boost/geometry/multi/algorithms/convert.hpp b/boost/geometry/multi/algorithms/convert.hpp index 4745791135..0e7b2946d4 100644 --- a/boost/geometry/multi/algorithms/convert.hpp +++ b/boost/geometry/multi/algorithms/convert.hpp @@ -15,114 +15,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_CONVERT_HPP -#include <boost/range/metafunctions.hpp> - #include <boost/geometry/algorithms/convert.hpp> -#include <boost/geometry/multi/core/tags.hpp> - - -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace conversion -{ - -template <typename Single, typename Multi, typename Policy> -struct single_to_multi: private Policy -{ - static inline void apply(Single const& single, Multi& multi) - { - traits::resize<Multi>::apply(multi, 1); - Policy::apply(single, *boost::begin(multi)); - } -}; - - - -template <typename Multi1, typename Multi2, typename Policy> -struct multi_to_multi: private Policy -{ - static inline void apply(Multi1 const& multi1, Multi2& multi2) - { - traits::resize<Multi2>::apply(multi2, boost::size(multi1)); - - typename boost::range_iterator<Multi1 const>::type it1 - = boost::begin(multi1); - typename boost::range_iterator<Multi2>::type it2 - = boost::begin(multi2); - - for (; it1 != boost::end(multi1); ++it1, ++it2) - { - Policy::apply(*it1, *it2); - } - } -}; - - -}} // namespace detail::convert -#endif // DOXYGEN_NO_DETAIL - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -// Dispatch for multi <-> multi, specifying their single-version as policy. -// Note that, even if the multi-types are mutually different, their single -// version types might be the same and therefore we call boost::is_same again - -template <typename Multi1, typename Multi2, std::size_t DimensionCount> -struct convert<Multi1, Multi2, multi_tag, multi_tag, DimensionCount, false> - : detail::conversion::multi_to_multi - < - Multi1, - Multi2, - convert - < - typename boost::range_value<Multi1>::type, - typename boost::range_value<Multi2>::type, - typename single_tag_of - < - typename tag<Multi1>::type - >::type, - typename single_tag_of - < - typename tag<Multi2>::type - >::type, - DimensionCount - > - > -{}; - -template <typename Single, typename Multi, typename SingleTag, std::size_t DimensionCount> -struct convert<Single, Multi, SingleTag, multi_tag, DimensionCount, false> - : detail::conversion::single_to_multi - < - Single, - Multi, - convert - < - Single, - typename boost::range_value<Multi>::type, - typename tag<Single>::type, - typename single_tag_of - < - typename tag<Multi>::type - >::type, - DimensionCount, - false - > - > -{}; - - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - -}} // namespace boost::geometry - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_CONVERT_HPP diff --git a/boost/geometry/multi/algorithms/correct.hpp b/boost/geometry/multi/algorithms/correct.hpp index d0c3e10753..83d26ca60c 100644 --- a/boost/geometry/multi/algorithms/correct.hpp +++ b/boost/geometry/multi/algorithms/correct.hpp @@ -15,52 +15,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_CORRECT_HPP -#include <boost/range/metafunctions.hpp> - #include <boost/geometry/algorithms/correct.hpp> -#include <boost/geometry/multi/algorithms/detail/modify.hpp> - -#include <boost/geometry/multi/core/tags.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template <typename MultiPoint> -struct correct<MultiPoint, multi_point_tag> - : detail::correct::correct_nop<MultiPoint> -{}; - - -template <typename MultiLineString> -struct correct<MultiLineString, multi_linestring_tag> - : detail::correct::correct_nop<MultiLineString> -{}; - - -template <typename Geometry> -struct correct<Geometry, multi_polygon_tag> - : detail::multi_modify - < - Geometry, - detail::correct::correct_polygon - < - typename boost::range_value<Geometry>::type - > - > -{}; - - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_CORRECT_HPP diff --git a/boost/geometry/multi/algorithms/covered_by.hpp b/boost/geometry/multi/algorithms/covered_by.hpp index ba398c0f42..706bc78475 100644 --- a/boost/geometry/multi/algorithms/covered_by.hpp +++ b/boost/geometry/multi/algorithms/covered_by.hpp @@ -3,6 +3,10 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2013, 2014. +// Modifications copyright (c) 2013, 2014 Oracle and/or its affiliates. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -11,60 +15,13 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + #ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_COVERED_BY_HPP #define BOOST_GEOMETRY_MULTI_ALGORITHMS_COVERED_BY_HPP #include <boost/geometry/algorithms/covered_by.hpp> -#include <boost/geometry/multi/core/closure.hpp> -#include <boost/geometry/multi/core/point_order.hpp> -#include <boost/geometry/multi/core/tags.hpp> -#include <boost/geometry/multi/algorithms/within.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template <typename Point, typename MultiPolygon> -struct covered_by<Point, MultiPolygon, point_tag, multi_polygon_tag> -{ - template <typename Strategy> - static inline bool apply(Point const& point, - MultiPolygon const& multi_polygon, Strategy const& strategy) - { - return detail::within::geometry_multi_within_code - < - Point, - MultiPolygon, - Strategy, - detail::within::point_in_polygon - < - Point, - typename boost::range_value<MultiPolygon>::type, - order_as_direction - < - geometry::point_order<MultiPolygon>::value - >::value, - geometry::closure<MultiPolygon>::value, - Strategy - > - >::apply(point, multi_polygon, strategy) >= 0; - } -}; - - -} // namespace dispatch - - -#endif // DOXYGEN_NO_DISPATCH - - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_COVERED_BY_HPP diff --git a/boost/geometry/multi/algorithms/detail/extreme_points.hpp b/boost/geometry/multi/algorithms/detail/extreme_points.hpp new file mode 100644 index 0000000000..da2ac5e9fa --- /dev/null +++ b/boost/geometry/multi/algorithms/detail/extreme_points.hpp @@ -0,0 +1,19 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2013 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2013 Mateusz Loskot, London, UK. +// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_EXTREME_POINTS_HPP +#define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_EXTREME_POINTS_HPP + + +#include <boost/geometry/algorithms/detail/extreme_points.hpp> + + +#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_EXTREME_POINTS_HPP diff --git a/boost/geometry/multi/algorithms/detail/for_each_range.hpp b/boost/geometry/multi/algorithms/detail/for_each_range.hpp index 08ab14bd69..2fe475ed58 100644 --- a/boost/geometry/multi/algorithms/detail/for_each_range.hpp +++ b/boost/geometry/multi/algorithms/detail/for_each_range.hpp @@ -15,72 +15,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_FOR_EACH_RANGE_HPP -#include <boost/range.hpp> -#include <boost/typeof/typeof.hpp> - #include <boost/geometry/algorithms/detail/for_each_range.hpp> -#include <boost/geometry/multi/core/tags.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace for_each -{ - - -template <typename Multi, typename Actor, bool IsConst> -struct fe_range_multi -{ - static inline void apply( - typename add_const_if_c<IsConst, Multi>::type& multi, - Actor& actor) - { - for(BOOST_AUTO_TPL(it, boost::begin(multi)); it != boost::end(multi); ++it) - { - geometry::detail::for_each_range(*it, actor); - } - } -}; - - - -}} // namespace detail::for_each -#endif // DOXYGEN_NO_DETAIL - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -template <typename MultiPoint, typename Actor, bool IsConst> -struct for_each_range<multi_point_tag, MultiPoint, Actor, IsConst> - : detail::for_each::fe_range_range<MultiPoint, Actor, IsConst> -{}; - -template <typename Geometry, typename Actor, bool IsConst> -struct for_each_range<multi_linestring_tag, Geometry, Actor, IsConst> - : - detail::for_each::fe_range_multi<Geometry, Actor, IsConst> -{}; - -template <typename Geometry, typename Actor, bool IsConst> -struct for_each_range<multi_polygon_tag, Geometry, Actor, IsConst> - : - detail::for_each::fe_range_multi<Geometry, Actor, IsConst> -{}; - - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - - -}} // namespace boost::geometry - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_FOR_EACH_RANGE_HPP diff --git a/boost/geometry/multi/algorithms/detail/modify.hpp b/boost/geometry/multi/algorithms/detail/modify.hpp index b52efd2512..ae52e002f0 100644 --- a/boost/geometry/multi/algorithms/detail/modify.hpp +++ b/boost/geometry/multi/algorithms/detail/modify.hpp @@ -15,39 +15,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_MODIFY_HPP -#include <boost/range.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace detail -{ - - -template <typename MultiGeometry, typename Policy> -struct multi_modify -{ - static inline void apply(MultiGeometry& multi) - { - typedef typename boost::range_iterator<MultiGeometry>::type iterator_type; - for (iterator_type it = boost::begin(multi); - it != boost::end(multi); - ++it) - { - Policy::apply(*it); - } - } -}; - - -} // namespace detail -#endif - - -}} // namespace boost::geometry +#include <boost/geometry/algorithms/detail/multi_modify.hpp> #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_MODIFY_HPP diff --git a/boost/geometry/multi/algorithms/detail/modify_with_predicate.hpp b/boost/geometry/multi/algorithms/detail/modify_with_predicate.hpp index 4ae79058da..1a82a67142 100644 --- a/boost/geometry/multi/algorithms/detail/modify_with_predicate.hpp +++ b/boost/geometry/multi/algorithms/detail/modify_with_predicate.hpp @@ -15,38 +15,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_MODIFY_WITH_PREDICATE_HPP -#include <boost/range.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace detail -{ - -template <typename MultiGeometry, typename Predicate, typename Policy> -struct multi_modify_with_predicate -{ - static inline void apply(MultiGeometry& multi, Predicate const& predicate) - { - typedef typename boost::range_iterator<MultiGeometry>::type iterator_type; - for (iterator_type it = boost::begin(multi); - it != boost::end(multi); - ++it) - { - Policy::apply(*it, predicate); - } - } -}; - - -} // namespace detail -#endif - - -}} // namespace boost::geometry +#include <boost/geometry/algorithms/detail/multi_modify_with_predicate.hpp> #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_MODIFY_WITH_PREDICATE_HPP diff --git a/boost/geometry/multi/algorithms/detail/multi_sum.hpp b/boost/geometry/multi/algorithms/detail/multi_sum.hpp index a47685ceb1..b91970a164 100644 --- a/boost/geometry/multi/algorithms/detail/multi_sum.hpp +++ b/boost/geometry/multi/algorithms/detail/multi_sum.hpp @@ -11,48 +11,11 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_GEOMETRY_MULTI_SUM_HPP -#define BOOST_GEOMETRY_MULTI_SUM_HPP - -#include <boost/range.hpp> - - -namespace boost { namespace geometry -{ -#ifndef DOXYGEN_NO_DETAIL -namespace detail -{ - -template -< - typename ReturnType, - typename MultiGeometry, - typename Strategy, - typename Policy -> -struct multi_sum -{ - static inline ReturnType apply(MultiGeometry const& geometry, Strategy const& strategy) - { - ReturnType sum = ReturnType(); - for (typename boost::range_iterator - < - MultiGeometry const - >::type it = boost::begin(geometry); - it != boost::end(geometry); - ++it) - { - sum += Policy::apply(*it, strategy); - } - return sum; - } -}; - - -} // namespace detail -#endif - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_MULTI_SUM_HPP +#ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_MULTI_SUM_HPP +#define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_MULTI_SUM_HPP + + +#include <boost/geometry/algorithms/detail/multi_sum.hpp> + + +#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_MULTI_SUM_HPP diff --git a/boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp b/boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp index 72be5ddbf4..5e23cf4bad 100644 --- a/boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp +++ b/boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp @@ -2,6 +2,9 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2013. +// Modifications copyright (c) 2013, Oracle and/or its affiliates. + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -10,92 +13,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_COPY_SEGMENT_POINT_HPP -#include <boost/range.hpp> - -#include <boost/geometry/multi/core/tags.hpp> #include <boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp> -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace copy_segments -{ - - -template -< - typename MultiGeometry, - typename SegmentIdentifier, - typename PointOut, - typename Policy -> -struct copy_segment_point_multi -{ - static inline bool apply(MultiGeometry const& multi, - SegmentIdentifier const& seg_id, bool second, - PointOut& point) - { - - BOOST_ASSERT - ( - seg_id.multi_index >= 0 - && seg_id.multi_index < int(boost::size(multi)) - ); - - // Call the single-version - return Policy::apply(multi[seg_id.multi_index], seg_id, second, point); - } -}; - - -}} // namespace detail::copy_segments -#endif // DOXYGEN_NO_DETAIL - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -template -< - typename MultiGeometry, - bool Reverse, - typename SegmentIdentifier, - typename PointOut -> -struct copy_segment_point - < - multi_polygon_tag, - MultiGeometry, - Reverse, - SegmentIdentifier, - PointOut - > - : detail::copy_segments::copy_segment_point_multi - < - MultiGeometry, - SegmentIdentifier, - PointOut, - detail::copy_segments::copy_segment_point_polygon - < - typename boost::range_value<MultiGeometry>::type, - Reverse, - SegmentIdentifier, - PointOut - > - > -{}; - - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - -}} // namespace boost::geometry - - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_COPY_SEGMENT_POINT_HPP diff --git a/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp b/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp index f474b12fdf..54114bfae4 100644 --- a/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp +++ b/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp @@ -10,95 +10,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_COPY_SEGMENTS_HPP -#include <boost/assert.hpp> -#include <boost/range.hpp> - #include <boost/geometry/algorithms/detail/overlay/copy_segments.hpp> -#include <boost/geometry/multi/core/ring_type.hpp> -#include <boost/geometry/multi/core/tags.hpp> - - -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace copy_segments -{ - - -template -< - typename MultiGeometry, - typename SegmentIdentifier, - typename RangeOut, - typename Policy -> -struct copy_segments_multi -{ - static inline void apply(MultiGeometry const& multi_geometry, - SegmentIdentifier const& seg_id, int to_index, - RangeOut& current_output) - { - - BOOST_ASSERT - ( - seg_id.multi_index >= 0 - && seg_id.multi_index < int(boost::size(multi_geometry)) - ); - - // Call the single-version - Policy::apply(multi_geometry[seg_id.multi_index], - seg_id, to_index, current_output); - } -}; - - -}} // namespace detail::copy_segments -#endif // DOXYGEN_NO_DETAIL - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -template -< - typename MultiPolygon, - bool Reverse, - typename SegmentIdentifier, - typename RangeOut -> -struct copy_segments - < - multi_polygon_tag, - MultiPolygon, - Reverse, - SegmentIdentifier, - RangeOut - > - : detail::copy_segments::copy_segments_multi - < - MultiPolygon, - SegmentIdentifier, - RangeOut, - detail::copy_segments::copy_segments_polygon - < - typename boost::range_value<MultiPolygon>::type, - Reverse, - SegmentIdentifier, - RangeOut - > - > -{}; - - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - -}} // namespace boost::geometry - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_COPY_SEGMENTS_HPP diff --git a/boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp b/boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp index e23acf99b3..65e00d064b 100644 --- a/boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp +++ b/boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp @@ -10,45 +10,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_GET_RING_HPP -#include <boost/assert.hpp> -#include <boost/range.hpp> - #include <boost/geometry/algorithms/detail/overlay/get_ring.hpp> -#include <boost/geometry/multi/core/ring_type.hpp> - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace overlay -{ - -template<> -struct get_ring<multi_polygon_tag> -{ - template<typename MultiPolygon> - static inline typename ring_type<MultiPolygon>::type const& apply( - ring_identifier const& id, - MultiPolygon const& multi_polygon) - { - BOOST_ASSERT - ( - id.multi_index >= 0 - && id.multi_index < int(boost::size(multi_polygon)) - ); - return get_ring<polygon_tag>::apply(id, - multi_polygon[id.multi_index]); - } -}; - - - -}} // namespace detail::overlay -#endif // DOXYGEN_NO_DETAIL - - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_GET_RING_HPP diff --git a/boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp b/boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp index 1ee03cc4d0..a83fb77393 100644 --- a/boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp +++ b/boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp @@ -10,102 +10,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_GET_TURNS_HPP -#include <boost/geometry/multi/core/ring_type.hpp> - #include <boost/geometry/algorithms/detail/overlay/get_turns.hpp> -#include <boost/geometry/multi/algorithms/distance.hpp> -#include <boost/geometry/multi/views/detail/range_type.hpp> - -#include <boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp> -#include <boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace get_turns -{ - -template -< - typename Multi, typename Box, - bool Reverse, bool ReverseBox, - typename Turns, - typename TurnPolicy, - typename InterruptPolicy -> -struct get_turns_multi_polygon_cs -{ - static inline void apply( - int source_id1, Multi const& multi, - int source_id2, Box const& box, - Turns& turns, InterruptPolicy& interrupt_policy) - { - typedef typename boost::range_iterator - < - Multi const - >::type iterator_type; - - int i = 0; - for (iterator_type it = boost::begin(multi); - it != boost::end(multi); - ++it, ++i) - { - // Call its single version - get_turns_polygon_cs - < - typename boost::range_value<Multi>::type, Box, - Reverse, ReverseBox, - Turns, TurnPolicy, InterruptPolicy - >::apply(source_id1, *it, source_id2, box, - turns, interrupt_policy, i); - } - } -}; - -}} // namespace detail::get_turns -#endif // DOXYGEN_NO_DETAIL - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -template -< - typename MultiPolygon, - typename Box, - bool ReverseMultiPolygon, bool ReverseBox, - typename Turns, - typename TurnPolicy, - typename InterruptPolicy -> -struct get_turns - < - multi_polygon_tag, box_tag, - MultiPolygon, Box, - ReverseMultiPolygon, ReverseBox, - Turns, - TurnPolicy, InterruptPolicy - > - : detail::get_turns::get_turns_multi_polygon_cs - < - MultiPolygon, Box, - ReverseMultiPolygon, ReverseBox, - Turns, - TurnPolicy, InterruptPolicy - > -{}; - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - -}} // namespace boost::geometry - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_GET_TURNS_HPP diff --git a/boost/geometry/multi/algorithms/detail/overlay/select_rings.hpp b/boost/geometry/multi/algorithms/detail/overlay/select_rings.hpp index 4636187880..c780c4cd9a 100644 --- a/boost/geometry/multi/algorithms/detail/overlay/select_rings.hpp +++ b/boost/geometry/multi/algorithms/detail/overlay/select_rings.hpp @@ -10,53 +10,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_SELECT_RINGS_HPP -#include <boost/range.hpp> - #include <boost/geometry/algorithms/detail/overlay/select_rings.hpp> -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace overlay -{ - -namespace dispatch -{ - - template <typename Multi> - struct select_rings<multi_polygon_tag, Multi> - { - template <typename Geometry, typename Map> - static inline void apply(Multi const& multi, Geometry const& geometry, - ring_identifier id, Map& map, bool midpoint) - { - typedef typename boost::range_iterator - < - Multi const - >::type iterator_type; - - typedef select_rings<polygon_tag, typename boost::range_value<Multi>::type> per_polygon; - - id.multi_index = 0; - for (iterator_type it = boost::begin(multi); it != boost::end(multi); ++it) - { - id.ring_index = -1; - per_polygon::apply(*it, geometry, id, map, midpoint); - id.multi_index++; - } - } - }; -} - - -}} // namespace detail::overlay -#endif // DOXYGEN_NO_DETAIL - - -}} // namespace boost::geometry - - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_SELECT_RINGS_HPP diff --git a/boost/geometry/multi/algorithms/detail/overlay/self_turn_points.hpp b/boost/geometry/multi/algorithms/detail/overlay/self_turn_points.hpp index 57d5ff92ca..39bfea2fb3 100644 --- a/boost/geometry/multi/algorithms/detail/overlay/self_turn_points.hpp +++ b/boost/geometry/multi/algorithms/detail/overlay/self_turn_points.hpp @@ -10,47 +10,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_SELF_TURN_POINTS_HPP -#include <boost/geometry/multi/core/tags.hpp> #include <boost/geometry/algorithms/detail/overlay/self_turn_points.hpp> -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -template -< - typename MultiPolygon, - typename Turns, - typename TurnPolicy, - typename InterruptPolicy -> -struct self_get_turn_points - < - multi_polygon_tag, MultiPolygon, - Turns, - TurnPolicy, InterruptPolicy - > - : detail::self_get_turn_points::get_turns - < - MultiPolygon, - Turns, - TurnPolicy, - InterruptPolicy - > -{}; - - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - -}} // namespace boost::geometry - - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_SELF_TURN_POINTS_HPP diff --git a/boost/geometry/multi/algorithms/detail/point_on_border.hpp b/boost/geometry/multi/algorithms/detail/point_on_border.hpp index ac462ed4c5..2ee789c5da 100644 --- a/boost/geometry/multi/algorithms/detail/point_on_border.hpp +++ b/boost/geometry/multi/algorithms/detail/point_on_border.hpp @@ -4,6 +4,9 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2013. +// Modifications copyright (c) 2013, Oracle and/or its affiliates. + // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -14,82 +17,8 @@ #ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_POINT_ON_BORDER_HPP #define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_POINT_ON_BORDER_HPP -#include <boost/range.hpp> -#include <boost/geometry/multi/core/tags.hpp> #include <boost/geometry/algorithms/detail/point_on_border.hpp> -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace point_on_border -{ - - -template -< - typename Point, - typename MultiGeometry, - typename Policy -> -struct point_on_multi -{ - static inline bool apply(Point& point, MultiGeometry const& multi, bool midpoint) - { - // Take a point on the first multi-geometry - // (i.e. the first that is not empty) - for (typename boost::range_iterator - < - MultiGeometry const - >::type it = boost::begin(multi); - it != boost::end(multi); - ++it) - { - if (Policy::apply(point, *it, midpoint)) - { - return true; - } - } - return false; - } -}; - - - - -}} // namespace detail::point_on_border -#endif // DOXYGEN_NO_DETAIL - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -template<typename Point, typename Multi> -struct point_on_border<multi_polygon_tag, Point, Multi> - : detail::point_on_border::point_on_multi - < - Point, - Multi, - detail::point_on_border::point_on_polygon - < - Point, - typename boost::range_value<Multi>::type - > - > -{}; - - - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - - -}} // namespace boost::geometry - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_POINT_ON_BORDER_HPP diff --git a/boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp b/boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp index 28a4805ed1..5604d9d74f 100644 --- a/boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp +++ b/boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp @@ -4,6 +4,9 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2013. +// Modifications copyright (c) 2013, Oracle and/or its affiliates. + // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -11,80 +14,13 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + #ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_SECTIONS_RANGE_BY_SECTION_HPP #define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_SECTIONS_RANGE_BY_SECTION_HPP -#include <boost/assert.hpp> -#include <boost/range.hpp> - -#include <boost/geometry/multi/core/tags.hpp> -#include <boost/geometry/multi/core/ring_type.hpp> #include <boost/geometry/algorithms/detail/sections/range_by_section.hpp> -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace section -{ - - -template -< - typename MultiGeometry, - typename Section, - typename Policy -> -struct full_section_multi -{ - static inline typename ring_return_type<MultiGeometry const>::type apply( - MultiGeometry const& multi, Section const& section) - { - BOOST_ASSERT - ( - section.ring_id.multi_index >= 0 - && section.ring_id.multi_index < int(boost::size(multi)) - ); - - return Policy::apply(multi[section.ring_id.multi_index], section); - } -}; - - -}} // namespace detail::section -#endif - - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -template <typename MultiPolygon, typename Section> -struct range_by_section<multi_polygon_tag, MultiPolygon, Section> - : detail::section::full_section_multi - < - MultiPolygon, - Section, - detail::section::full_section_polygon - < - typename boost::range_value<MultiPolygon>::type, - Section - > - > -{}; - - -} // namespace dispatch -#endif - - - - -}} // namespace boost::geometry - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_SECTIONS_RANGE_BY_SECTION_HPP diff --git a/boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp b/boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp index 16f70c193d..ef98021237 100644 --- a/boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp +++ b/boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp @@ -4,6 +4,9 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2013. +// Modifications copyright (c) 2013, Oracle and/or its affiliates. + // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -14,82 +17,8 @@ #ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_SECTIONS_SECTIONALIZE_HPP #define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_SECTIONS_SECTIONALIZE_HPP -#include <cstddef> -#include <vector> - -#include <boost/concept/requires.hpp> -#include <boost/range.hpp> #include <boost/geometry/algorithms/detail/sections/sectionalize.hpp> -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace sectionalize -{ - - -template <typename MultiGeometry, typename Sections, std::size_t DimensionCount, typename Policy> -struct sectionalize_multi -{ - static inline void apply(MultiGeometry const& multi, Sections& sections, ring_identifier ring_id) - { - ring_id.multi_index = 0; - for (typename boost::range_iterator<MultiGeometry const>::type - it = boost::begin(multi); - it != boost::end(multi); - ++it, ++ring_id.multi_index) - { - Policy::apply(*it, sections, ring_id); - } - } -}; - - -}} // namespace detail::sectionalize -#endif // DOXYGEN_NO_DETAIL - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -template -< - typename MultiPolygon, - bool Reverse, - typename Sections, - std::size_t DimensionCount, - std::size_t MaxCount -> -struct sectionalize<multi_polygon_tag, MultiPolygon, Reverse, Sections, DimensionCount, MaxCount> - : detail::sectionalize::sectionalize_multi - < - MultiPolygon, - Sections, - DimensionCount, - detail::sectionalize::sectionalize_polygon - < - typename boost::range_value<MultiPolygon>::type, - Reverse, - Sections, - DimensionCount, - MaxCount - > - > - -{}; - - -} // namespace dispatch -#endif - - -}} // namespace boost::geometry - - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_SECTIONS_SECTIONALIZE_HPP diff --git a/boost/geometry/multi/algorithms/disjoint.hpp b/boost/geometry/multi/algorithms/disjoint.hpp new file mode 100644 index 0000000000..55f0f01cd6 --- /dev/null +++ b/boost/geometry/multi/algorithms/disjoint.hpp @@ -0,0 +1,21 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2012-2014 Bruno Lalande, Paris, France. +// Copyright (c) 2012-2014 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2014. +// Modifications copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, 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 +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_DISJOINT_HPP +#define BOOST_GEOMETRY_MULTI_ALGORITHMS_DISJOINT_HPP + +#include <boost/geometry/algorithms/disjoint.hpp> + +#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DISJOINT_HPP diff --git a/boost/geometry/multi/algorithms/distance.hpp b/boost/geometry/multi/algorithms/distance.hpp index 8acb3f9006..4946b6f3e1 100644 --- a/boost/geometry/multi/algorithms/distance.hpp +++ b/boost/geometry/multi/algorithms/distance.hpp @@ -1,8 +1,13 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2014 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2014 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2014. +// Modifications copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -14,144 +19,9 @@ #ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_DISTANCE_HPP #define BOOST_GEOMETRY_MULTI_ALGORITHMS_DISTANCE_HPP - -#include <boost/numeric/conversion/bounds.hpp> -#include <boost/range.hpp> - -#include <boost/geometry/multi/core/tags.hpp> -#include <boost/geometry/multi/core/geometry_id.hpp> -#include <boost/geometry/multi/core/point_type.hpp> +// this file is intentionally empty (with the exception of the #include below) +// it is used for backward compatinility and may be removed in the future #include <boost/geometry/algorithms/distance.hpp> -#include <boost/geometry/multi/algorithms/num_points.hpp> -#include <boost/geometry/util/select_coordinate_type.hpp> - - -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace distance -{ - - -template<typename Geometry, typename MultiGeometry, typename Strategy> -struct distance_single_to_multi - : private dispatch::distance - < - Geometry, - typename range_value<MultiGeometry>::type, - Strategy - > -{ - typedef typename strategy::distance::services::return_type<Strategy>::type return_type; - - static inline return_type apply(Geometry const& geometry, - MultiGeometry const& multi, - Strategy const& strategy) - { - return_type mindist = return_type(); - bool first = true; - - for(typename range_iterator<MultiGeometry const>::type it = boost::begin(multi); - it != boost::end(multi); - ++it, first = false) - { - return_type dist = dispatch::distance - < - Geometry, - typename range_value<MultiGeometry>::type, - Strategy - >::apply(geometry, *it, strategy); - - if (first || dist < mindist) - { - mindist = dist; - } - } - - return mindist; - } -}; - -template<typename Multi1, typename Multi2, typename Strategy> -struct distance_multi_to_multi - : private distance_single_to_multi - < - typename range_value<Multi1>::type, - Multi2, - Strategy - > -{ - typedef typename strategy::distance::services::return_type<Strategy>::type return_type; - - static inline return_type apply(Multi1 const& multi1, - Multi2 const& multi2, Strategy const& strategy) - { - return_type mindist = return_type(); - bool first = true; - - for(typename range_iterator<Multi1 const>::type it = boost::begin(multi1); - it != boost::end(multi1); - ++it, first = false) - { - return_type dist = distance_single_to_multi - < - typename range_value<Multi1>::type, - Multi2, - Strategy - >::apply(*it, multi2, strategy); - if (first || dist < mindist) - { - mindist = dist; - } - } - - return mindist; - } -}; - - -}} // namespace detail::distance -#endif - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template -< - typename G1, - typename G2, - typename Strategy, - typename SingleGeometryTag -> -struct distance -< - G1, G2, Strategy, - SingleGeometryTag, multi_tag, strategy_tag_distance_point_point, - false -> - : detail::distance::distance_single_to_multi<G1, G2, Strategy> -{}; - -template <typename G1, typename G2, typename Strategy> -struct distance -< - G1, G2, Strategy, - multi_tag, multi_tag, strategy_tag_distance_point_point, - false -> - : detail::distance::distance_multi_to_multi<G1, G2, Strategy> -{}; - -} // namespace dispatch -#endif - - - -}} // namespace boost::geometry - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DISTANCE_HPP diff --git a/boost/geometry/multi/algorithms/envelope.hpp b/boost/geometry/multi/algorithms/envelope.hpp index 1876b5f91e..457dfaf3bc 100644 --- a/boost/geometry/multi/algorithms/envelope.hpp +++ b/boost/geometry/multi/algorithms/envelope.hpp @@ -14,104 +14,8 @@ #ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_ENVELOPE_HPP #define BOOST_GEOMETRY_MULTI_ALGORITHMS_ENVELOPE_HPP -#include <vector> -#include <boost/range/metafunctions.hpp> - - -#include <boost/geometry/core/exterior_ring.hpp> #include <boost/geometry/algorithms/envelope.hpp> -#include <boost/geometry/multi/core/point_type.hpp> - - -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DETAIL - -namespace detail { namespace envelope -{ - - -template<typename MultiLinestring, typename Box> -struct envelope_multi_linestring -{ - static inline void apply(MultiLinestring const& mp, Box& mbr) - { - assign_inverse(mbr); - for (typename boost::range_iterator<MultiLinestring const>::type - it = mp.begin(); - it != mp.end(); - ++it) - { - envelope_range_additional(*it, mbr); - } - } -}; - - -// version for multi_polygon: outer ring's of all polygons -template<typename MultiPolygon, typename Box> -struct envelope_multi_polygon -{ - static inline void apply(MultiPolygon const& mp, Box& mbr) - { - assign_inverse(mbr); - for (typename boost::range_const_iterator<MultiPolygon>::type - it = mp.begin(); - it != mp.end(); - ++it) - { - envelope_range_additional(exterior_ring(*it), mbr); - } - } -}; - - -}} // namespace detail::envelope - -#endif - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template -< - typename Multi, typename Box, - typename StrategyLess, typename StrategyGreater -> -struct envelope<multi_point_tag, box_tag, Multi, Box, StrategyLess, StrategyGreater> - : detail::envelope::envelope_range<Multi, Box> -{}; - -template -< - typename Multi, typename Box, - typename StrategyLess, typename StrategyGreater -> -struct envelope<multi_linestring_tag, box_tag, Multi, Box, StrategyLess, StrategyGreater> - : detail::envelope::envelope_multi_linestring<Multi, Box> -{}; - - -template -< - typename Multi, typename Box, - typename StrategyLess, typename StrategyGreater -> -struct envelope<multi_polygon_tag, box_tag, Multi, Box, StrategyLess, StrategyGreater> - : detail::envelope::envelope_multi_polygon<Multi, Box> -{}; - - -} // namespace dispatch -#endif - - -}} // namespace boost::geometry - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_ENVELOPE_HPP diff --git a/boost/geometry/multi/algorithms/equals.hpp b/boost/geometry/multi/algorithms/equals.hpp index a307ebae8b..0f045fff90 100644 --- a/boost/geometry/multi/algorithms/equals.hpp +++ b/boost/geometry/multi/algorithms/equals.hpp @@ -15,56 +15,8 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_EQUALS_HPP -#include <boost/geometry/multi/core/tags.hpp> -#include <boost/geometry/multi/core/geometry_id.hpp> - #include <boost/geometry/algorithms/equals.hpp> -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -template <typename MultiPolygon1, typename MultiPolygon2> -struct equals - < - multi_polygon_tag, multi_polygon_tag, - MultiPolygon1, MultiPolygon2, - 2 - > - : detail::equals::equals_by_collection - < - MultiPolygon1, MultiPolygon2, - detail::equals::area_check - > -{}; - - -template <typename Polygon, typename MultiPolygon> -struct equals - < - polygon_tag, multi_polygon_tag, - Polygon, MultiPolygon, - 2 - > - : detail::equals::equals_by_collection - < - Polygon, MultiPolygon, - detail::equals::area_check - > -{}; - - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - -}} // namespace boost::geometry - - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_EQUALS_HPP diff --git a/boost/geometry/multi/algorithms/for_each.hpp b/boost/geometry/multi/algorithms/for_each.hpp index 1be38e0a7e..d8b3af1ff2 100644 --- a/boost/geometry/multi/algorithms/for_each.hpp +++ b/boost/geometry/multi/algorithms/for_each.hpp @@ -15,115 +15,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_FOR_EACH_HPP -#include <boost/range.hpp> -#include <boost/typeof/typeof.hpp> - -#include <boost/geometry/multi/core/tags.hpp> -#include <boost/geometry/multi/core/point_type.hpp> - - #include <boost/geometry/algorithms/for_each.hpp> - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace for_each -{ - -// Implementation of multi, for both point and segment, -// just calling the single version. -template -< - typename MultiGeometry, - typename Functor, - bool IsConst, - typename Policy -> -struct for_each_multi -{ - static inline Functor apply( - typename add_const_if_c<IsConst, MultiGeometry>::type& multi, - Functor f) - { - for(BOOST_AUTO_TPL(it, boost::begin(multi)); it != boost::end(multi); ++it) - { - f = Policy::apply(*it, f); - } - return f; - } -}; - - -}} // namespace detail::for_each -#endif // DOXYGEN_NO_DETAIL - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template -< - typename MultiGeometry, - typename Functor, - bool IsConst -> -struct for_each_point<multi_tag, MultiGeometry, Functor, IsConst> - : detail::for_each::for_each_multi - < - MultiGeometry, - Functor, - IsConst, - // Specify the dispatch of the single-version as policy - for_each_point - < - typename single_tag_of - < - typename tag<MultiGeometry>::type - >::type, - typename boost::range_value<MultiGeometry>::type, - Functor, - IsConst - > - > -{}; - - -template -< - typename MultiGeometry, - typename Functor, - bool IsConst -> -struct for_each_segment<multi_tag, MultiGeometry, Functor, IsConst> - : detail::for_each::for_each_multi - < - MultiGeometry, - Functor, - IsConst, - // Specify the dispatch of the single-version as policy - for_each_segment - < - typename single_tag_of - < - typename tag<MultiGeometry>::type - >::type, - typename boost::range_value<MultiGeometry>::type, - Functor, - IsConst - > - > -{}; - - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - -}} // namespace boost::geometry - - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_FOR_EACH_HPP diff --git a/boost/geometry/multi/algorithms/intersection.hpp b/boost/geometry/multi/algorithms/intersection.hpp index 31e74a79ba..f434463253 100644 --- a/boost/geometry/multi/algorithms/intersection.hpp +++ b/boost/geometry/multi/algorithms/intersection.hpp @@ -2,6 +2,11 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2014. +// Modifications copyright (c) 2014, Oracle and/or its affiliates. + +// 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 // http://www.boost.org/LICENSE_1_0.txt) @@ -10,429 +15,8 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_INTERSECTION_HPP -#include <boost/geometry/multi/core/closure.hpp> -#include <boost/geometry/multi/core/geometry_id.hpp> -#include <boost/geometry/multi/core/is_areal.hpp> -#include <boost/geometry/multi/core/point_order.hpp> -#include <boost/geometry/multi/algorithms/covered_by.hpp> -#include <boost/geometry/multi/algorithms/envelope.hpp> -#include <boost/geometry/multi/algorithms/num_points.hpp> -#include <boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp> -#include <boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp> -#include <boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp> -#include <boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp> -#include <boost/geometry/multi/algorithms/detail/overlay/select_rings.hpp> -#include <boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp> -#include <boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp> - #include <boost/geometry/algorithms/intersection.hpp> -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace intersection -{ - - -template -< - typename MultiLinestring1, typename MultiLinestring2, - typename OutputIterator, typename PointOut, - typename Strategy -> -struct intersection_multi_linestring_multi_linestring_point -{ - static inline OutputIterator apply(MultiLinestring1 const& ml1, - MultiLinestring2 const& ml2, OutputIterator out, - Strategy const& strategy) - { - // Note, this loop is quadratic w.r.t. number of linestrings per input. - // Future Enhancement: first do the sections of each, then intersect. - for (typename boost::range_iterator - < - MultiLinestring1 const - >::type it1 = boost::begin(ml1); - it1 != boost::end(ml1); - ++it1) - { - for (typename boost::range_iterator - < - MultiLinestring2 const - >::type it2 = boost::begin(ml2); - it2 != boost::end(ml2); - ++it2) - { - out = intersection_linestring_linestring_point - < - typename boost::range_value<MultiLinestring1>::type, - typename boost::range_value<MultiLinestring2>::type, - OutputIterator, PointOut, Strategy - >::apply(*it1, *it2, out, strategy); - } - } - - return out; - } -}; - - -template -< - typename Linestring, typename MultiLinestring, - typename OutputIterator, typename PointOut, - typename Strategy -> -struct intersection_linestring_multi_linestring_point -{ - static inline OutputIterator apply(Linestring const& linestring, - MultiLinestring const& ml, OutputIterator out, - Strategy const& strategy) - { - for (typename boost::range_iterator - < - MultiLinestring const - >::type it = boost::begin(ml); - it != boost::end(ml); - ++it) - { - out = intersection_linestring_linestring_point - < - Linestring, - typename boost::range_value<MultiLinestring>::type, - OutputIterator, PointOut, Strategy - >::apply(linestring, *it, out, strategy); - } - - return out; - } -}; - - -// This loop is quite similar to the loop above, but beacuse the iterator -// is second (above) or first (below) argument, it is not trivial to merge them. -template -< - typename MultiLinestring, typename Areal, - bool ReverseAreal, - typename OutputIterator, typename LineStringOut, - overlay_type OverlayType, - typename Strategy -> -struct intersection_of_multi_linestring_with_areal -{ - static inline OutputIterator apply(MultiLinestring const& ml, Areal const& areal, - OutputIterator out, - Strategy const& strategy) - { - for (typename boost::range_iterator - < - MultiLinestring const - >::type it = boost::begin(ml); - it != boost::end(ml); - ++it) - { - out = intersection_of_linestring_with_areal - < - typename boost::range_value<MultiLinestring>::type, - Areal, ReverseAreal, - OutputIterator, LineStringOut, OverlayType, Strategy - >::apply(*it, areal, out, strategy); - } - - return out; - - } -}; - -// This one calls the one above with reversed arguments -template -< - typename Areal, typename MultiLinestring, - bool ReverseAreal, - typename OutputIterator, typename LineStringOut, - overlay_type OverlayType, - typename Strategy -> -struct intersection_of_areal_with_multi_linestring -{ - static inline OutputIterator apply(Areal const& areal, MultiLinestring const& ml, - OutputIterator out, - Strategy const& strategy) - { - return intersection_of_multi_linestring_with_areal - < - MultiLinestring, Areal, ReverseAreal, - OutputIterator, LineStringOut, - OverlayType, - Strategy - >::apply(ml, areal, out, strategy); - } -}; - - - -template -< - typename MultiLinestring, typename Box, - typename OutputIterator, typename LinestringOut, - typename Strategy -> -struct clip_multi_linestring -{ - static inline OutputIterator apply(MultiLinestring const& multi_linestring, - Box const& box, OutputIterator out, Strategy const& ) - { - typedef typename point_type<LinestringOut>::type point_type; - strategy::intersection::liang_barsky<Box, point_type> lb_strategy; - for (typename boost::range_iterator<MultiLinestring const>::type it - = boost::begin(multi_linestring); - it != boost::end(multi_linestring); ++it) - { - out = detail::intersection::clip_range_with_box - <LinestringOut>(box, *it, out, lb_strategy); - } - return out; - } -}; - - -}} // namespace detail::intersection -#endif // DOXYGEN_NO_DETAIL - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -// Linear -template -< - typename MultiLinestring1, typename MultiLinestring2, - bool Reverse1, bool Reverse2, bool ReverseOut, - typename OutputIterator, typename GeometryOut, - overlay_type OverlayType, - typename Strategy -> -struct intersection_insert - < - multi_linestring_tag, multi_linestring_tag, point_tag, - false, false, false, - MultiLinestring1, MultiLinestring2, - Reverse1, Reverse2, ReverseOut, - OutputIterator, GeometryOut, - OverlayType, - Strategy - > : detail::intersection::intersection_multi_linestring_multi_linestring_point - < - MultiLinestring1, MultiLinestring2, - OutputIterator, GeometryOut, - Strategy - > -{}; - - -template -< - typename Linestring, typename MultiLinestring, - typename OutputIterator, typename GeometryOut, - bool Reverse1, bool Reverse2, bool ReverseOut, - overlay_type OverlayType, - typename Strategy -> -struct intersection_insert - < - linestring_tag, multi_linestring_tag, point_tag, - false, false, false, - Linestring, MultiLinestring, - Reverse1, Reverse2, ReverseOut, - OutputIterator, GeometryOut, - OverlayType, - Strategy - > : detail::intersection::intersection_linestring_multi_linestring_point - < - Linestring, MultiLinestring, - OutputIterator, GeometryOut, - Strategy - > -{}; - - -template -< - typename MultiLinestring, typename Box, - bool Reverse1, bool Reverse2, bool ReverseOut, - typename OutputIterator, typename GeometryOut, - overlay_type OverlayType, - typename Strategy -> -struct intersection_insert - < - multi_linestring_tag, box_tag, linestring_tag, - false, true, false, - MultiLinestring, Box, - Reverse1, Reverse2, ReverseOut, - OutputIterator, GeometryOut, - OverlayType, - Strategy - > : detail::intersection::clip_multi_linestring - < - MultiLinestring, Box, - OutputIterator, GeometryOut, - Strategy - > -{}; - - -template -< - typename Linestring, typename MultiPolygon, - bool ReverseLinestring, bool ReverseMultiPolygon, bool ReverseOut, - typename OutputIterator, typename GeometryOut, - overlay_type OverlayType, - typename Strategy -> -struct intersection_insert - < - linestring_tag, multi_polygon_tag, linestring_tag, - false, true, false, - Linestring, MultiPolygon, - ReverseLinestring, ReverseMultiPolygon, ReverseOut, - OutputIterator, GeometryOut, - OverlayType, - Strategy - > : detail::intersection::intersection_of_linestring_with_areal - < - Linestring, MultiPolygon, - ReverseMultiPolygon, - OutputIterator, GeometryOut, - OverlayType, - Strategy - > -{}; - - -// Derives from areal/mls because runtime arguments are in that order. -// areal/mls reverses it itself to mls/areal -template -< - typename Polygon, typename MultiLinestring, - bool ReversePolygon, bool ReverseMultiLinestring, bool ReverseOut, - typename OutputIterator, typename GeometryOut, - overlay_type OverlayType, - typename Strategy -> -struct intersection_insert - < - polygon_tag, multi_linestring_tag, linestring_tag, - true, false, false, - Polygon, MultiLinestring, - ReversePolygon, ReverseMultiLinestring, ReverseOut, - OutputIterator, GeometryOut, - OverlayType, - Strategy - > : detail::intersection::intersection_of_areal_with_multi_linestring - < - Polygon, MultiLinestring, - ReversePolygon, - OutputIterator, GeometryOut, - OverlayType, - Strategy - > -{}; - - -template -< - typename MultiLinestring, typename Ring, - bool ReverseMultiLinestring, bool ReverseRing, bool ReverseOut, - typename OutputIterator, typename GeometryOut, - overlay_type OverlayType, - typename Strategy -> -struct intersection_insert - < - multi_linestring_tag, ring_tag, linestring_tag, - false, true, false, - MultiLinestring, Ring, - ReverseMultiLinestring, ReverseRing, ReverseOut, - OutputIterator, GeometryOut, - OverlayType, - Strategy - > : detail::intersection::intersection_of_multi_linestring_with_areal - < - MultiLinestring, Ring, - ReverseRing, - OutputIterator, GeometryOut, - OverlayType, - Strategy - > -{}; - -template -< - typename MultiLinestring, typename Polygon, - bool ReverseMultiLinestring, bool ReverseRing, bool ReverseOut, - typename OutputIterator, typename GeometryOut, - overlay_type OverlayType, - typename Strategy -> -struct intersection_insert - < - multi_linestring_tag, polygon_tag, linestring_tag, - false, true, false, - MultiLinestring, Polygon, - ReverseMultiLinestring, ReverseRing, ReverseOut, - OutputIterator, GeometryOut, - OverlayType, - Strategy - > : detail::intersection::intersection_of_multi_linestring_with_areal - < - MultiLinestring, Polygon, - ReverseRing, - OutputIterator, GeometryOut, - OverlayType, - Strategy - > -{}; - - - -template -< - typename MultiLinestring, typename MultiPolygon, - bool ReverseMultiLinestring, bool ReverseMultiPolygon, bool ReverseOut, - typename OutputIterator, typename GeometryOut, - overlay_type OverlayType, - typename Strategy -> -struct intersection_insert - < - multi_linestring_tag, multi_polygon_tag, linestring_tag, - false, true, false, - MultiLinestring, MultiPolygon, - ReverseMultiLinestring, ReverseMultiPolygon, ReverseOut, - OutputIterator, GeometryOut, - OverlayType, - Strategy - > : detail::intersection::intersection_of_multi_linestring_with_areal - < - MultiLinestring, MultiPolygon, - ReverseMultiPolygon, - OutputIterator, GeometryOut, - OverlayType, - Strategy - > -{}; - - -} // namespace dispatch -#endif - -}} // namespace boost::geometry - - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_INTERSECTION_HPP diff --git a/boost/geometry/multi/algorithms/length.hpp b/boost/geometry/multi/algorithms/length.hpp index 51ff9ef3c2..168e6a732f 100644 --- a/boost/geometry/multi/algorithms/length.hpp +++ b/boost/geometry/multi/algorithms/length.hpp @@ -15,43 +15,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_LENGTH_HPP -#include <boost/range/metafunctions.hpp> - #include <boost/geometry/algorithms/length.hpp> -#include <boost/geometry/multi/core/tags.hpp> -#include <boost/geometry/multi/algorithms/detail/multi_sum.hpp> -#include <boost/geometry/multi/algorithms/num_points.hpp> - - -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template <typename MultiLinestring, typename Strategy> -struct length<multi_linestring_tag, MultiLinestring, Strategy> - : detail::multi_sum - < - typename default_length_result<MultiLinestring>::type, - MultiLinestring, - Strategy, - detail::length::range_length - < - typename boost::range_value<MultiLinestring>::type, - Strategy, - closed // no need to close it explicitly - > - > -{}; - - -} // namespace dispatch -#endif - - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_LENGTH_HPP diff --git a/boost/geometry/multi/algorithms/num_geometries.hpp b/boost/geometry/multi/algorithms/num_geometries.hpp index 213339a18c..3a85f4e4bf 100644 --- a/boost/geometry/multi/algorithms/num_geometries.hpp +++ b/boost/geometry/multi/algorithms/num_geometries.hpp @@ -16,36 +16,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_NUM_GEOMETRIES_HPP -#include <cstddef> - -#include <boost/range.hpp> - #include <boost/geometry/algorithms/num_geometries.hpp> -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template <typename MultiGeometry> -struct num_geometries<multi_tag, MultiGeometry> -{ - static inline std::size_t apply(MultiGeometry const& multi_geometry) - { - return boost::size(multi_geometry); - } -}; - - -} // namespace dispatch -#endif - - -}} // namespace boost::geometry - - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_NUM_GEOMETRIES_HPP diff --git a/boost/geometry/multi/algorithms/num_interior_rings.hpp b/boost/geometry/multi/algorithms/num_interior_rings.hpp index 87b0bdea91..fbaa113aff 100644 --- a/boost/geometry/multi/algorithms/num_interior_rings.hpp +++ b/boost/geometry/multi/algorithms/num_interior_rings.hpp @@ -4,6 +4,11 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2014. +// Modifications copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -14,48 +19,8 @@ #ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_NUM_INTERIOR_RINGS_HPP #define BOOST_GEOMETRY_MULTI_ALGORITHMS_NUM_INTERIOR_RINGS_HPP -#include <cstddef> - -#include <boost/range.hpp> - -#include <boost/geometry/core/tag.hpp> -#include <boost/geometry/core/tags.hpp> -#include <boost/geometry/multi/core/tags.hpp> #include <boost/geometry/algorithms/num_interior_rings.hpp> -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -template <typename MultiPolygon> -struct num_interior_rings<multi_polygon_tag, MultiPolygon> -{ - static inline std::size_t apply(MultiPolygon const& multi_polygon) - { - std::size_t n = 0; - for (typename boost::range_iterator<MultiPolygon const>::type - it = boost::begin(multi_polygon); - it != boost::end(multi_polygon); - ++it) - { - n += geometry::num_interior_rings(*it); - } - return n; - } - -}; - -} // namespace dispatch -#endif - - -}} // namespace boost::geometry - - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_NUM_INTERIOR_RINGS_HPP diff --git a/boost/geometry/multi/algorithms/num_points.hpp b/boost/geometry/multi/algorithms/num_points.hpp index 5ea53854eb..a736f4254b 100644 --- a/boost/geometry/multi/algorithms/num_points.hpp +++ b/boost/geometry/multi/algorithms/num_points.hpp @@ -1,8 +1,13 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2014 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2014 Mateusz Loskot, London, UK. + +// This file was modified by Oracle on 2014. +// Modifications copyright (c) 2014, Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -16,66 +21,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_NUM_POINTS_HPP -#include <boost/range.hpp> - -#include <boost/geometry/multi/core/tags.hpp> #include <boost/geometry/algorithms/num_points.hpp> -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace num_points -{ - - -template <typename MultiGeometry> -struct multi_count -{ - static inline size_t apply(MultiGeometry const& geometry, bool add_for_open) - { - typedef typename boost::range_value<MultiGeometry>::type geometry_type; - typedef typename boost::range_iterator - < - MultiGeometry const - >::type iterator_type; - - std::size_t n = 0; - for (iterator_type it = boost::begin(geometry); - it != boost::end(geometry); - ++it) - { - n += dispatch::num_points - < - typename tag<geometry_type>::type, - geometry_type - >::apply(*it, add_for_open); - } - return n; - } -}; - - -}} // namespace detail::num_points -#endif - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -template <typename Geometry> -struct num_points<multi_tag, Geometry> - : detail::num_points::multi_count<Geometry> {}; - - -} // namespace dispatch -#endif - - -}} // namespace boost::geometry - - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_NUM_POINTS_HPP diff --git a/boost/geometry/multi/algorithms/perimeter.hpp b/boost/geometry/multi/algorithms/perimeter.hpp index 147f6fcc30..4820111f1f 100644 --- a/boost/geometry/multi/algorithms/perimeter.hpp +++ b/boost/geometry/multi/algorithms/perimeter.hpp @@ -15,42 +15,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_PERIMETER_HPP -#include <boost/range/metafunctions.hpp> - #include <boost/geometry/algorithms/perimeter.hpp> -#include <boost/geometry/multi/core/tags.hpp> - -#include <boost/geometry/multi/algorithms/detail/multi_sum.hpp> -#include <boost/geometry/multi/algorithms/num_points.hpp> - -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ -template <typename MultiPolygon, typename Strategy> -struct perimeter<multi_polygon_tag, MultiPolygon, Strategy> - : detail::multi_sum - < - typename default_length_result<MultiPolygon>::type, - MultiPolygon, - Strategy, - perimeter - < - polygon_tag, - typename boost::range_value<MultiPolygon>::type, - Strategy - > - > -{}; - -} // namespace dispatch -#endif - - -}} // namespace boost::geometry - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_PERIMETER_HPP diff --git a/boost/geometry/multi/algorithms/remove_spikes.hpp b/boost/geometry/multi/algorithms/remove_spikes.hpp new file mode 100644 index 0000000000..af224ec478 --- /dev/null +++ b/boost/geometry/multi/algorithms/remove_spikes.hpp @@ -0,0 +1,19 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2013 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2013 Mateusz Loskot, London, UK. +// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_REMOVE_SPIKES_HPP +#define BOOST_GEOMETRY_MULTI_ALGORITHMS_REMOVE_SPIKES_HPP + + +#include <boost/geometry/algorithms/remove_spikes.hpp> + + +#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_REMOVE_SPIKES_HPP diff --git a/boost/geometry/multi/algorithms/reverse.hpp b/boost/geometry/multi/algorithms/reverse.hpp index f8a9442ac0..a7872bdd2a 100644 --- a/boost/geometry/multi/algorithms/reverse.hpp +++ b/boost/geometry/multi/algorithms/reverse.hpp @@ -15,55 +15,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_REVERSE_HPP -#include <boost/range/metafunctions.hpp> - #include <boost/geometry/algorithms/reverse.hpp> -#include <boost/geometry/multi/algorithms/detail/modify.hpp> - -#include <boost/geometry/multi/core/tags.hpp> - - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -template <typename Geometry> -struct reverse<multi_linestring_tag, Geometry> - : detail::multi_modify - < - Geometry, - detail::reverse::range_reverse - < - typename boost::range_value<Geometry>::type - > - > -{}; - - -template <typename Geometry> -struct reverse<multi_polygon_tag, Geometry> - : detail::multi_modify - < - Geometry, - detail::reverse::polygon_reverse - < - typename boost::range_value<Geometry>::type - > - > -{}; - - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_REVERSE_HPP diff --git a/boost/geometry/multi/algorithms/simplify.hpp b/boost/geometry/multi/algorithms/simplify.hpp index dc3c7b5937..8648d366d1 100644 --- a/boost/geometry/multi/algorithms/simplify.hpp +++ b/boost/geometry/multi/algorithms/simplify.hpp @@ -14,104 +14,8 @@ #ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_SIMPLIFY_HPP #define BOOST_GEOMETRY_MULTI_ALGORITHMS_SIMPLIFY_HPP -#include <boost/range.hpp> -#include <boost/geometry/core/mutable_range.hpp> -#include <boost/geometry/multi/core/tags.hpp> - - -#include <boost/geometry/multi/algorithms/clear.hpp> #include <boost/geometry/algorithms/simplify.hpp> -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace simplify -{ - -template<typename MultiGeometry, typename Strategy, typename Policy> -struct simplify_multi -{ - static inline void apply(MultiGeometry const& multi, MultiGeometry& out, - double max_distance, Strategy const& strategy) - { - traits::resize<MultiGeometry>::apply(out, boost::size(multi)); - - typename boost::range_iterator<MultiGeometry>::type it_out - = boost::begin(out); - for (typename boost::range_iterator<MultiGeometry const>::type it_in - = boost::begin(multi); - it_in != boost::end(multi); - ++it_in, ++it_out) - { - Policy::apply(*it_in, *it_out, max_distance, strategy); - } - } -}; - - - -}} // namespace detail::simplify -#endif // DOXYGEN_NO_DETAIL - - - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template <typename MultiPoint, typename Strategy> -struct simplify<multi_point_tag, MultiPoint, Strategy> - : detail::simplify::simplify_copy - < - MultiPoint, - Strategy - > - -{}; - - -template <typename MultiLinestring, typename Strategy> -struct simplify<multi_linestring_tag, MultiLinestring, Strategy> - : detail::simplify::simplify_multi - < - MultiLinestring, - Strategy, - detail::simplify::simplify_range - < - typename boost::range_value<MultiLinestring>::type, - Strategy, - 2 - > - > - -{}; - - -template <typename MultiPolygon, typename Strategy> -struct simplify<multi_polygon_tag, MultiPolygon, Strategy> - : detail::simplify::simplify_multi - < - MultiPolygon, - Strategy, - detail::simplify::simplify_polygon - < - typename boost::range_value<MultiPolygon>::type, - Strategy - > - > - -{}; - - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - -}} // namespace boost::geometry - - #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_SIMPLIFY_HPP diff --git a/boost/geometry/multi/algorithms/transform.hpp b/boost/geometry/multi/algorithms/transform.hpp index 09926778f9..7aa691ec4a 100644 --- a/boost/geometry/multi/algorithms/transform.hpp +++ b/boost/geometry/multi/algorithms/transform.hpp @@ -14,89 +14,8 @@ #ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_TRANSFORM_HPP #define BOOST_GEOMETRY_MULTI_ALGORITHMS_TRANSFORM_HPP -#include <boost/range.hpp> -#include <boost/geometry/core/mutable_range.hpp> #include <boost/geometry/algorithms/transform.hpp> -#include <boost/geometry/multi/core/tags.hpp> - -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace transform -{ - -/*! - \brief Is able to transform any multi-geometry, calling the single-version as policy -*/ -template <typename Multi1, typename Multi2, typename Policy> -struct transform_multi -{ - template <typename S> - static inline bool apply(Multi1 const& multi1, Multi2& multi2, S const& strategy) - { - traits::resize<Multi2>::apply(multi2, boost::size(multi1)); - - typename boost::range_iterator<Multi1 const>::type it1 - = boost::begin(multi1); - typename boost::range_iterator<Multi2>::type it2 - = boost::begin(multi2); - - for (; it1 != boost::end(multi1); ++it1, ++it2) - { - if (! Policy::apply(*it1, *it2, strategy)) - { - return false; - } - } - - return true; - } -}; - - -}} // namespace detail::transform -#endif // DOXYGEN_NO_DETAIL - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template <typename Multi1, typename Multi2, typename Strategy> -struct transform - < - multi_tag, multi_tag, - Multi1, Multi2, - Strategy - > - : detail::transform::transform_multi - < - Multi1, - Multi2, - transform - < - typename single_tag_of - < - typename tag<Multi1>::type - >::type, - typename single_tag_of - < - typename tag<Multi2>::type - >::type, - typename boost::range_value<Multi1>::type, - typename boost::range_value<Multi2>::type, - Strategy - > - > -{}; - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_TRANSFORM_HPP diff --git a/boost/geometry/multi/algorithms/unique.hpp b/boost/geometry/multi/algorithms/unique.hpp index 5067e71f3f..fa063a312d 100644 --- a/boost/geometry/multi/algorithms/unique.hpp +++ b/boost/geometry/multi/algorithms/unique.hpp @@ -15,88 +15,7 @@ #define BOOST_GEOMETRY_MULTI_ALGORITHMS_UNIQUE_HPP -#include <boost/range.hpp> - #include <boost/geometry/algorithms/unique.hpp> -#include <boost/geometry/multi/core/tags.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace unique -{ - - -template <typename MultiGeometry, typename ComparePolicy, typename Policy> -struct multi_unique -{ - static inline void apply(MultiGeometry& multi, ComparePolicy const& compare) - { - for (typename boost::range_iterator<MultiGeometry>::type - it = boost::begin(multi); - it != boost::end(multi); - ++it) - { - Policy::apply(*it, compare); - } - } -}; - - -}} // namespace detail::unique -#endif // DOXYGEN_NO_DETAIL - - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -// For points, unique is not applicable and does nothing -// (Note that it is not "spatially unique" but that it removes duplicate coordinates, -// like std::unique does). Spatially unique is "dissolve" which can (or will be) -// possible for multi-points as well, removing points at the same location. - - -template <typename MultiLineString, typename ComparePolicy> -struct unique<multi_linestring_tag, MultiLineString, ComparePolicy> - : detail::unique::multi_unique - < - MultiLineString, - ComparePolicy, - detail::unique::range_unique - < - typename boost::range_value<MultiLineString>::type, - ComparePolicy - > - > -{}; - - -template <typename MultiPolygon, typename ComparePolicy> -struct unique<multi_polygon_tag, MultiPolygon, ComparePolicy> - : detail::unique::multi_unique - < - MultiPolygon, - ComparePolicy, - detail::unique::polygon_unique - < - typename boost::range_value<MultiPolygon>::type, - ComparePolicy - > - > -{}; - - -} // namespace dispatch -#endif - - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_UNIQUE_HPP diff --git a/boost/geometry/multi/algorithms/within.hpp b/boost/geometry/multi/algorithms/within.hpp index a3ec7514b7..9fdc5dd39a 100644 --- a/boost/geometry/multi/algorithms/within.hpp +++ b/boost/geometry/multi/algorithms/within.hpp @@ -3,6 +3,10 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. + +// This file was modified by Oracle on 2013, 2014. +// Modifications copyright (c) 2013, 2014 Oracle and/or its affiliates. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -11,94 +15,11 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + #ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_WITHIN_HPP #define BOOST_GEOMETRY_MULTI_ALGORITHMS_WITHIN_HPP - -#include <boost/range.hpp> - #include <boost/geometry/algorithms/within.hpp> -#include <boost/geometry/multi/core/closure.hpp> -#include <boost/geometry/multi/core/point_order.hpp> -#include <boost/geometry/multi/core/tags.hpp> - -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace within -{ - - -template -< - typename Geometry, - typename MultiGeometry, - typename Strategy, - typename Policy -> -struct geometry_multi_within_code -{ - static inline int apply(Geometry const& geometry, - MultiGeometry const& multi, - Strategy const& strategy) - { - for (typename boost::range_iterator<MultiGeometry const>::type it - = boost::begin(multi); - it != boost::end(multi); - ++it) - { - // Geometry coding on multi: 1 (within) if within one of them; - // 0 (touch) if on border of one of them - int const code = Policy::apply(geometry, *it, strategy); - if (code != -1) - { - return code; - } - } - return -1; - } -}; - - -}} // namespace detail::within -#endif // DOXYGEN_NO_DETAIL - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template <typename Point, typename MultiPolygon> -struct within<Point, MultiPolygon, point_tag, multi_polygon_tag> -{ - template <typename Strategy> - static inline bool apply(Point const& point, - MultiPolygon const& multi_polygon, Strategy const& strategy) - { - return detail::within::geometry_multi_within_code - < - Point, - MultiPolygon, - Strategy, - detail::within::point_in_polygon - < - Point, - typename boost::range_value<MultiPolygon>::type, - order_as_direction - < - geometry::point_order<MultiPolygon>::value - >::value, - geometry::closure<MultiPolygon>::value, - Strategy - > - >::apply(point, multi_polygon, strategy) == 1; - } -}; - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_WITHIN_HPP diff --git a/boost/geometry/multi/core/closure.hpp b/boost/geometry/multi/core/closure.hpp index 3964db256c..9e7cf3c248 100644 --- a/boost/geometry/multi/core/closure.hpp +++ b/boost/geometry/multi/core/closure.hpp @@ -14,45 +14,6 @@ #ifndef BOOST_GEOMETRY_MULTI_CORE_CLOSURE_HPP #define BOOST_GEOMETRY_MULTI_CORE_CLOSURE_HPP - -#include <boost/mpl/assert.hpp> -#include <boost/range.hpp> -#include <boost/type_traits/remove_const.hpp> - #include <boost/geometry/core/closure.hpp> -#include <boost/geometry/multi/core/tags.hpp> - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DISPATCH -namespace core_dispatch -{ - -template <typename Multi> -struct closure<multi_point_tag, Multi> : public core_detail::closure::closed {}; - -template <typename Multi> -struct closure<multi_linestring_tag, Multi> : public core_detail::closure::closed {}; - -// Specialization for polygon: the closure is the closure of its rings -template <typename MultiPolygon> -struct closure<multi_polygon_tag, MultiPolygon> -{ - static const closure_selector value = core_dispatch::closure - < - polygon_tag, - typename boost::range_value<MultiPolygon>::type - >::value ; -}; - - -} // namespace core_dispatch -#endif // DOXYGEN_NO_DISPATCH - - -}} // namespace boost::geometry - #endif // BOOST_GEOMETRY_MULTI_CORE_CLOSURE_HPP diff --git a/boost/geometry/multi/core/geometry_id.hpp b/boost/geometry/multi/core/geometry_id.hpp index 9d69cb20d9..7d5e888bab 100644 --- a/boost/geometry/multi/core/geometry_id.hpp +++ b/boost/geometry/multi/core/geometry_id.hpp @@ -15,42 +15,6 @@ #ifndef BOOST_GEOMETRY_MULTI_CORE_GEOMETRY_ID_HPP #define BOOST_GEOMETRY_MULTI_CORE_GEOMETRY_ID_HPP - -#include <boost/mpl/int.hpp> -#include <boost/type_traits.hpp> - - -#include <boost/geometry/core/tag.hpp> -#include <boost/geometry/core/tags.hpp> #include <boost/geometry/core/geometry_id.hpp> -#include <boost/geometry/multi/core/tags.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DISPATCH -namespace core_dispatch -{ - -template <> -struct geometry_id<multi_point_tag> : boost::mpl::int_<4> {}; - - -template <> -struct geometry_id<multi_linestring_tag> : boost::mpl::int_<5> {}; - - -template <> -struct geometry_id<multi_polygon_tag> : boost::mpl::int_<6> {}; - - -} // namespace core_dispatch -#endif - - -}} // namespace boost::geometry - #endif // BOOST_GEOMETRY_MULTI_CORE_GEOMETRY_ID_HPP diff --git a/boost/geometry/multi/core/interior_rings.hpp b/boost/geometry/multi/core/interior_rings.hpp index 5a200d486c..deeeff81d0 100644 --- a/boost/geometry/multi/core/interior_rings.hpp +++ b/boost/geometry/multi/core/interior_rings.hpp @@ -16,40 +16,7 @@ #define BOOST_GEOMETRY_MULTI_CORE_INTERIOR_RINGS_HPP -#include <cstddef> - -#include <boost/range.hpp> - #include <boost/geometry/core/interior_rings.hpp> -#include <boost/geometry/multi/core/tags.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DISPATCH -namespace core_dispatch -{ - - -template <typename MultiPolygon> -struct interior_type<multi_polygon_tag, MultiPolygon> -{ - typedef typename core_dispatch::interior_type - < - polygon_tag, - typename boost::range_value<MultiPolygon>::type - >::type type; -}; - - -} // namespace core_dispatch -#endif - - - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_CORE_INTERIOR_RINGS_HPP diff --git a/boost/geometry/multi/core/is_areal.hpp b/boost/geometry/multi/core/is_areal.hpp index ad8daeb497..30f98527ab 100644 --- a/boost/geometry/multi/core/is_areal.hpp +++ b/boost/geometry/multi/core/is_areal.hpp @@ -16,28 +16,7 @@ #define BOOST_GEOMETRY_MULTI_CORE_IS_AREAL_HPP -#include <boost/type_traits.hpp> - - #include <boost/geometry/core/is_areal.hpp> -#include <boost/geometry/multi/core/tags.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DISPATCH -namespace core_dispatch -{ - -template <> struct is_areal<multi_polygon_tag> : boost::true_type {}; - -} // namespace core_dispatch -#endif - - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_CORE_IS_AREAL_HPP diff --git a/boost/geometry/multi/core/point_order.hpp b/boost/geometry/multi/core/point_order.hpp index 6b08468e8c..119e55c3ba 100644 --- a/boost/geometry/multi/core/point_order.hpp +++ b/boost/geometry/multi/core/point_order.hpp @@ -15,43 +15,7 @@ #define BOOST_GEOMETRY_MULTI_CORE_POINT_ORDER_HPP -#include <boost/range.hpp> - #include <boost/geometry/core/point_order.hpp> -#include <boost/geometry/multi/core/tags.hpp> - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DISPATCH -namespace core_dispatch -{ - -template <typename Multi> -struct point_order<multi_point_tag, Multi> - : public detail::point_order::clockwise {}; - -template <typename Multi> -struct point_order<multi_linestring_tag, Multi> - : public detail::point_order::clockwise {}; - - -// Specialization for multi_polygon: the order is the order of its polygons -template <typename MultiPolygon> -struct point_order<multi_polygon_tag, MultiPolygon> -{ - static const order_selector value = core_dispatch::point_order - < - polygon_tag, - typename boost::range_value<MultiPolygon>::type - >::value ; -}; - -} // namespace core_dispatch -#endif // DOXYGEN_NO_DISPATCH - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_CORE_POINT_ORDER_HPP diff --git a/boost/geometry/multi/core/point_type.hpp b/boost/geometry/multi/core/point_type.hpp index 3c77e973b8..a7277d09a9 100644 --- a/boost/geometry/multi/core/point_type.hpp +++ b/boost/geometry/multi/core/point_type.hpp @@ -16,49 +16,7 @@ #define BOOST_GEOMETRY_MULTI_CORE_POINT_TYPE_HPP -#include <boost/range/metafunctions.hpp> - #include <boost/geometry/core/point_type.hpp> -#include <boost/geometry/multi/core/tags.hpp> - - - -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DISPATCH -namespace core_dispatch -{ - -template <typename MultiPoint> -struct point_type<multi_point_tag, MultiPoint> -{ - typedef typename boost::range_value<MultiPoint>::type type; -}; - - -template <typename MultiLinestring> -struct point_type<multi_linestring_tag, MultiLinestring> -{ - typedef typename point_type<linestring_tag, - typename boost::range_value<MultiLinestring>::type>::type type; -}; - - - -template <typename MultiPolygon> -struct point_type<multi_polygon_tag, MultiPolygon> -{ - typedef typename point_type<polygon_tag, - typename boost::range_value<MultiPolygon>::type>::type type; -}; - - -} -#endif - - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_CORE_POINT_TYPE_HPP diff --git a/boost/geometry/multi/core/ring_type.hpp b/boost/geometry/multi/core/ring_type.hpp index faafaed021..b27b5527c2 100644 --- a/boost/geometry/multi/core/ring_type.hpp +++ b/boost/geometry/multi/core/ring_type.hpp @@ -4,6 +4,9 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2013. +// Modifications copyright (c) 2013, Oracle and/or its affiliates. + // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -16,51 +19,7 @@ #define BOOST_GEOMETRY_MULTI_CORE_RING_TYPE_HPP -#include <boost/range/metafunctions.hpp> - #include <boost/geometry/core/ring_type.hpp> -#include <boost/geometry/multi/core/tags.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DISPATCH -namespace core_dispatch -{ - -template <typename MultiPolygon> -struct ring_return_type<multi_polygon_tag, MultiPolygon> -{ - typedef typename ring_return_type - < - polygon_tag, - typename mpl::if_ - < - boost::is_const<MultiPolygon>, - typename boost::range_value<MultiPolygon>::type const, - typename boost::range_value<MultiPolygon>::type - >::type - >::type type; -}; - - -template <typename MultiPolygon> -struct ring_type<multi_polygon_tag, MultiPolygon> -{ - typedef typename boost::remove_reference - < - typename ring_return_type<multi_polygon_tag, MultiPolygon>::type - >::type type; -}; - - -} // namespace core_dispatch -#endif - - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_CORE_RING_TYPE_HPP diff --git a/boost/geometry/multi/core/tags.hpp b/boost/geometry/multi/core/tags.hpp index dcfca65b2f..fb0758d95f 100644 --- a/boost/geometry/multi/core/tags.hpp +++ b/boost/geometry/multi/core/tags.hpp @@ -15,57 +15,8 @@ #ifndef BOOST_GEOMETRY_MULTI_CORE_TAGS_HPP #define BOOST_GEOMETRY_MULTI_CORE_TAGS_HPP -#include <boost/geometry/core/tags.hpp> - -namespace boost { namespace geometry -{ - -/// OGC Multi point identifying tag -struct multi_point_tag : multi_tag, pointlike_tag {}; - -/// OGC Multi linestring identifying tag -struct multi_linestring_tag : multi_tag, linear_tag {}; - -/// OGC Multi polygon identifying tag -struct multi_polygon_tag : multi_tag, polygonal_tag {}; - -/// OGC Geometry Collection identifying tag -struct geometry_collection_tag : multi_tag {}; - - - - -/*! -\brief Meta-function to get for a tag of a multi-geometry - the tag of the corresponding single-geometry -*/ -template <typename Tag> -struct single_tag_of -{}; - -#ifndef DOXYGEN_NO_DETAIL - -template <> -struct single_tag_of<multi_point_tag> -{ - typedef point_tag type; -}; - -template <> -struct single_tag_of<multi_linestring_tag> -{ - typedef linestring_tag type; -}; - -template <> -struct single_tag_of<multi_polygon_tag> -{ - typedef polygon_tag type; -}; - -#endif +#include <boost/geometry/core/tags.hpp> -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_CORE_TAGS_HPP diff --git a/boost/geometry/multi/core/topological_dimension.hpp b/boost/geometry/multi/core/topological_dimension.hpp index 55118f1c73..b4f1e89ae8 100644 --- a/boost/geometry/multi/core/topological_dimension.hpp +++ b/boost/geometry/multi/core/topological_dimension.hpp @@ -16,37 +16,7 @@ #define BOOST_GEOMETRY_MULTI_TOPOLOGICAL_DIMENSION_HPP -#include <boost/mpl/int.hpp> - - #include <boost/geometry/core/topological_dimension.hpp> -#include <boost/geometry/multi/core/tags.hpp> - - -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DISPATCH -namespace core_dispatch -{ - -template <> -struct top_dim<multi_point_tag> : boost::mpl::int_<0> {}; - - -template <> -struct top_dim<multi_linestring_tag> : boost::mpl::int_<1> {}; - - -template <> -struct top_dim<multi_polygon_tag> : boost::mpl::int_<2> {}; - - -} // namespace core_dispatch -#endif - - -}} // namespace boost::geometry #endif diff --git a/boost/geometry/multi/geometries/concepts/check.hpp b/boost/geometry/multi/geometries/concepts/check.hpp index 18f4ff0c25..c741afd794 100644 --- a/boost/geometry/multi/geometries/concepts/check.hpp +++ b/boost/geometry/multi/geometries/concepts/check.hpp @@ -16,68 +16,7 @@ #define BOOST_GEOMETRY_MULTI_GEOMETRIES_CONCEPTS_CHECK_HPP - -#include <boost/type_traits/is_const.hpp> - -#include <boost/geometry/multi/core/tags.hpp> - #include <boost/geometry/geometries/concepts/check.hpp> -#include <boost/geometry/multi/geometries/concepts/multi_point_concept.hpp> -#include <boost/geometry/multi/geometries/concepts/multi_linestring_concept.hpp> -#include <boost/geometry/multi/geometries/concepts/multi_polygon_concept.hpp> - - -namespace boost { namespace geometry -{ - - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - - -template <typename Geometry> -struct check<multi_point_tag, Geometry, true> - : detail::concept_check::check<concept::ConstMultiPoint<Geometry> > -{}; - - -template <typename Geometry> -struct check<multi_point_tag, Geometry, false> - : detail::concept_check::check<concept::MultiPoint<Geometry> > -{}; - - -template <typename Geometry> -struct check<multi_linestring_tag, Geometry, true> - : detail::concept_check::check<concept::ConstMultiLinestring<Geometry> > -{}; - - -template <typename Geometry> -struct check<multi_linestring_tag, Geometry, false> - : detail::concept_check::check<concept::MultiLinestring<Geometry> > -{}; - - -template <typename Geometry> -struct check<multi_polygon_tag, Geometry, true> - : detail::concept_check::check<concept::ConstMultiPolygon<Geometry> > -{}; - - -template <typename Geometry> -struct check<multi_polygon_tag, Geometry, false> - : detail::concept_check::check<concept::MultiPolygon<Geometry> > -{}; - - -} // namespace dispatch -#endif - - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_GEOMETRIES_CONCEPTS_CHECK_HPP diff --git a/boost/geometry/multi/geometries/concepts/multi_linestring_concept.hpp b/boost/geometry/multi/geometries/concepts/multi_linestring_concept.hpp index b0519f07ee..9a9438efcc 100644 --- a/boost/geometry/multi/geometries/concepts/multi_linestring_concept.hpp +++ b/boost/geometry/multi/geometries/concepts/multi_linestring_concept.hpp @@ -16,71 +16,7 @@ #define BOOST_GEOMETRY_MULTI_GEOMETRIES_CONCEPTS_MULTI_LINESTRING_CONCEPT_HPP -#include <boost/concept_check.hpp> -#include <boost/range/concepts.hpp> -#include <boost/range/metafunctions.hpp> - - -#include <boost/geometry/geometries/concepts/linestring_concept.hpp> - - -namespace boost { namespace geometry { namespace concept -{ - - -/*! -\brief multi-linestring concept -\ingroup concepts -\par Formal definition: -The multi linestring concept is defined as following: -- there must be a specialization of traits::tag defining multi_linestring_tag as - type -- it must behave like a Boost.Range -- its range value must fulfil the Linestring concept - -*/ -template <typename Geometry> -class MultiLinestring -{ -#ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename boost::range_value<Geometry>::type linestring_type; - - BOOST_CONCEPT_ASSERT( (concept::Linestring<linestring_type>) ); - BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) ); - - -public : - - BOOST_CONCEPT_USAGE(MultiLinestring) - { - } -#endif -}; - - -/*! -\brief concept for multi-linestring (const version) -\ingroup const_concepts -*/ -template <typename Geometry> -class ConstMultiLinestring -{ -#ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename boost::range_value<Geometry>::type linestring_type; - - BOOST_CONCEPT_ASSERT( (concept::ConstLinestring<linestring_type>) ); - BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) ); - - -public : - - BOOST_CONCEPT_USAGE(ConstMultiLinestring) - { - } -#endif -}; - -}}} // namespace boost::geometry::concept +#include <boost/geometry/geometries/concepts/multi_linestring_concept.hpp> #endif // BOOST_GEOMETRY_MULTI_GEOMETRIES_CONCEPTS_MULTI_LINESTRING_CONCEPT_HPP diff --git a/boost/geometry/multi/geometries/concepts/multi_point_concept.hpp b/boost/geometry/multi/geometries/concepts/multi_point_concept.hpp index f5942df070..14c1d25e57 100644 --- a/boost/geometry/multi/geometries/concepts/multi_point_concept.hpp +++ b/boost/geometry/multi/geometries/concepts/multi_point_concept.hpp @@ -16,70 +16,7 @@ #define BOOST_GEOMETRY_MULTI_GEOMETRIES_CONCEPTS_MULTI_POINT_CONCEPT_HPP -#include <boost/concept_check.hpp> -#include <boost/range/concepts.hpp> -#include <boost/range/metafunctions.hpp> - - -#include <boost/geometry/geometries/concepts/point_concept.hpp> - - -namespace boost { namespace geometry { namespace concept -{ - - -/*! -\brief MultiPoint concept -\ingroup concepts -\par Formal definition: -The multi point concept is defined as following: -- there must be a specialization of traits::tag defining multi_point_tag as type -- it must behave like a Boost.Range -- its range value must fulfil the Point concept - -*/ -template <typename Geometry> -class MultiPoint -{ -#ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename boost::range_value<Geometry>::type point_type; - - BOOST_CONCEPT_ASSERT( (concept::Point<point_type>) ); - BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) ); - - -public : - - BOOST_CONCEPT_USAGE(MultiPoint) - { - } -#endif -}; - - -/*! -\brief concept for multi-point (const version) -\ingroup const_concepts -*/ -template <typename Geometry> -class ConstMultiPoint -{ -#ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename boost::range_value<Geometry>::type point_type; - - BOOST_CONCEPT_ASSERT( (concept::ConstPoint<point_type>) ); - BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) ); - - -public : - - BOOST_CONCEPT_USAGE(ConstMultiPoint) - { - } -#endif -}; - -}}} // namespace boost::geometry::concept +#include <boost/geometry/geometries/concepts/multi_point_concept.hpp> #endif // BOOST_GEOMETRY_MULTI_GEOMETRIES_CONCEPTS_MULTI_POINT_CONCEPT_HPP diff --git a/boost/geometry/multi/geometries/concepts/multi_polygon_concept.hpp b/boost/geometry/multi/geometries/concepts/multi_polygon_concept.hpp index ca730d4f6b..5e46fb7539 100644 --- a/boost/geometry/multi/geometries/concepts/multi_polygon_concept.hpp +++ b/boost/geometry/multi/geometries/concepts/multi_polygon_concept.hpp @@ -16,71 +16,7 @@ #define BOOST_GEOMETRY_MULTI_GEOMETRIES_CONCEPTS_MULTI_POLYGON_CONCEPT_HPP -#include <boost/concept_check.hpp> -#include <boost/range/concepts.hpp> -#include <boost/range/metafunctions.hpp> - -#include <boost/geometry/geometries/concepts/polygon_concept.hpp> - - -namespace boost { namespace geometry { namespace concept -{ - - -/*! -\brief multi-polygon concept -\ingroup concepts -\par Formal definition: -The multi polygon concept is defined as following: -- there must be a specialization of traits::tag defining multi_polygon_tag - as type -- it must behave like a Boost.Range -- its range value must fulfil the Polygon concept - -*/ -template <typename Geometry> -class MultiPolygon -{ -#ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename boost::range_value<Geometry>::type polygon_type; - - BOOST_CONCEPT_ASSERT( (concept::Polygon<polygon_type>) ); - BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) ); - - -public : - - BOOST_CONCEPT_USAGE(MultiPolygon) - { - } -#endif -}; - - -/*! -\brief concept for multi-polygon (const version) -\ingroup const_concepts -*/ -template <typename Geometry> -class ConstMultiPolygon -{ -#ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename boost::range_value<Geometry>::type polygon_type; - - BOOST_CONCEPT_ASSERT( (concept::ConstPolygon<polygon_type>) ); - BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) ); - - -public : - - BOOST_CONCEPT_USAGE(ConstMultiPolygon) - { - } -#endif -}; - - -}}} // namespace boost::geometry::concept +#include <boost/geometry/geometries/concepts/multi_polygon_concept.hpp> #endif // BOOST_GEOMETRY_MULTI_GEOMETRIES_CONCEPTS_MULTI_POLYGON_CONCEPT_HPP diff --git a/boost/geometry/multi/geometries/multi_geometries.hpp b/boost/geometry/multi/geometries/multi_geometries.hpp index 90cf85a0f6..53042091bd 100644 --- a/boost/geometry/multi/geometries/multi_geometries.hpp +++ b/boost/geometry/multi/geometries/multi_geometries.hpp @@ -14,8 +14,8 @@ #ifndef BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_GEOMETRIES_HPP #define BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_GEOMETRIES_HPP -#include <boost/geometry/multi/geometries/multi_point.hpp> -#include <boost/geometry/multi/geometries/multi_linestring.hpp> -#include <boost/geometry/multi/geometries/multi_polygon.hpp> +#include <boost/geometry/geometries/multi_point.hpp> +#include <boost/geometry/geometries/multi_linestring.hpp> +#include <boost/geometry/geometries/multi_polygon.hpp> #endif // BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_GEOMETRIES_HPP diff --git a/boost/geometry/multi/geometries/multi_linestring.hpp b/boost/geometry/multi/geometries/multi_linestring.hpp index 67d4da06b7..696d907dcc 100644 --- a/boost/geometry/multi/geometries/multi_linestring.hpp +++ b/boost/geometry/multi/geometries/multi_linestring.hpp @@ -11,70 +11,11 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_GEOMETRY_MULTI_GEOMETRIES_LINESTRING_HPP -#define BOOST_GEOMETRY_MULTI_GEOMETRIES_LINESTRING_HPP +#ifndef BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_LINESTRING_HPP +#define BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_LINESTRING_HPP -#include <memory> -#include <vector> -#include <boost/concept/requires.hpp> +#include <boost/geometry/geometries/multi_linestring.hpp> -#include <boost/geometry/geometries/concepts/linestring_concept.hpp> -#include <boost/geometry/multi/core/tags.hpp> - -namespace boost { namespace geometry -{ - - -namespace model -{ - -/*! -\brief multi_line, a collection of linestring -\details Multi-linestring can be used to group lines belonging to each other, - e.g. a highway (with interruptions) -\ingroup geometries - -\qbk{before.synopsis, -[heading Model of] -[link geometry.reference.concepts.concept_multi_linestring MultiLineString Concept] -} -*/ -template -< - typename LineString, - template<typename, typename> class Container = std::vector, - template<typename> class Allocator = std::allocator -> -class multi_linestring : public Container<LineString, Allocator<LineString> > -{ - BOOST_CONCEPT_ASSERT( (concept::Linestring<LineString>) ); -}; - - -} // namespace model - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - -template -< - typename LineString, - template<typename, typename> class Container, - template<typename> class Allocator -> -struct tag< model::multi_linestring<LineString, Container, Allocator> > -{ - typedef multi_linestring_tag type; -}; - -} // namespace traits -#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS - - -}} // namespace boost::geometry - -#endif // BOOST_GEOMETRY_MULTI_GEOMETRIES_LINESTRING_HPP +#endif // BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_LINESTRING_HPP diff --git a/boost/geometry/multi/geometries/multi_point.hpp b/boost/geometry/multi/geometries/multi_point.hpp index 002d8f8a4b..750ad7802a 100644 --- a/boost/geometry/multi/geometries/multi_point.hpp +++ b/boost/geometry/multi/geometries/multi_point.hpp @@ -14,81 +14,8 @@ #ifndef BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_POINT_HPP #define BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_POINT_HPP -#include <memory> -#include <vector> -#include <boost/concept/requires.hpp> +#include <boost/geometry/geometries/multi_point.hpp> -#include <boost/geometry/geometries/concepts/point_concept.hpp> - -#include <boost/geometry/multi/core/tags.hpp> - -namespace boost { namespace geometry -{ - -namespace model -{ - - -/*! -\brief multi_point, a collection of points -\ingroup geometries -\tparam Point \tparam_point -\tparam Container \tparam_container -\tparam Allocator \tparam_allocator -\details Multipoint can be used to group points belonging to each other, - e.g. a constellation, or the result set of an intersection -\qbk{before.synopsis, -[heading Model of] -[link geometry.reference.concepts.concept_multi_point MultiPoint Concept] -} -*/ -template -< - typename Point, - template<typename, typename> class Container = std::vector, - template<typename> class Allocator = std::allocator -> -class multi_point : public Container<Point, Allocator<Point> > -{ - BOOST_CONCEPT_ASSERT( (concept::Point<Point>) ); - - typedef Container<Point, Allocator<Point> > base_type; - -public : - /// \constructor_default{multi_point} - inline multi_point() - : base_type() - {} - - /// \constructor_begin_end{multi_point} - template <typename Iterator> - inline multi_point(Iterator begin, Iterator end) - : base_type(begin, end) - {} -}; - -} // namespace model - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - -template -< - typename Point, - template<typename, typename> class Container, - template<typename> class Allocator -> -struct tag< model::multi_point<Point, Container, Allocator> > -{ - typedef multi_point_tag type; -}; - -} // namespace traits -#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_POINT_HPP diff --git a/boost/geometry/multi/geometries/multi_polygon.hpp b/boost/geometry/multi/geometries/multi_polygon.hpp index af8d042873..06fefc7856 100644 --- a/boost/geometry/multi/geometries/multi_polygon.hpp +++ b/boost/geometry/multi/geometries/multi_polygon.hpp @@ -14,65 +14,8 @@ #ifndef BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_POLYGON_HPP #define BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_POLYGON_HPP -#include <memory> -#include <vector> -#include <boost/concept/requires.hpp> +#include <boost/geometry/geometries/multi_polygon.hpp> -#include <boost/geometry/multi/core/tags.hpp> - -#include <boost/geometry/geometries/concepts/polygon_concept.hpp> - -namespace boost { namespace geometry -{ - -namespace model -{ - -/*! -\brief multi_polygon, a collection of polygons -\details Multi-polygon can be used to group polygons belonging to each other, - e.g. Hawaii -\ingroup geometries - -\qbk{before.synopsis, -[heading Model of] -[link geometry.reference.concepts.concept_multi_polygon MultiPolygon Concept] -} -*/ -template -< - typename Polygon, - template<typename, typename> class Container = std::vector, - template<typename> class Allocator = std::allocator -> -class multi_polygon : public Container<Polygon, Allocator<Polygon> > -{ - BOOST_CONCEPT_ASSERT( (concept::Polygon<Polygon>) ); -}; - - -} // namespace model - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - -template -< - typename Polygon, - template<typename, typename> class Container, - template<typename> class Allocator -> -struct tag< model::multi_polygon<Polygon, Container, Allocator> > -{ - typedef multi_polygon_tag type; -}; - -} // namespace traits -#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_GEOMETRIES_MULTI_POLYGON_HPP diff --git a/boost/geometry/multi/geometries/register/multi_linestring.hpp b/boost/geometry/multi/geometries/register/multi_linestring.hpp index 5ececdb8e8..2783a8455b 100644 --- a/boost/geometry/multi/geometries/register/multi_linestring.hpp +++ b/boost/geometry/multi/geometries/register/multi_linestring.hpp @@ -15,45 +15,8 @@ #ifndef BOOST_GEOMETRY_MULTI_GEOMETRIES_REGISTER_MULTI_LINESTRING_HPP #define BOOST_GEOMETRY_MULTI_GEOMETRIES_REGISTER_MULTI_LINESTRING_HPP -#include <boost/geometry/core/tag.hpp> -#include <boost/geometry/multi/core/tags.hpp> - -/*! -\brief \brief_macro{multi_linestring} -\ingroup register -\details \details_macro{BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING, multi_linestring} The - multi_linestring may contain template parameters, which must be specified then. -\param MultiLineString \param_macro_type{multi_linestring} - -\qbk{ -[heading Example] -[register_multi_linestring] -[register_multi_linestring_output] -} -*/ -#define BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING(MultiLineString) \ -namespace boost { namespace geometry { namespace traits { \ - template<> struct tag<MultiLineString> { typedef multi_linestring_tag type; }; \ -}}} - - -/*! -\brief \brief_macro{templated multi_linestring} -\ingroup register -\details \details_macro{BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING_TEMPLATED, templated multi_linestring} - \details_macro_templated{multi_linestring, linestring} -\param MultiLineString \param_macro_type{multi_linestring (without template parameters)} - -\qbk{ -[heading Example] -[register_multi_linestring_templated] -[register_multi_linestring_templated_output] -} -*/ -#define BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING_TEMPLATED(MultiLineString) \ -namespace boost { namespace geometry { namespace traits { \ - template<typename LineString> struct tag< MultiLineString<LineString> > { typedef multi_linestring_tag type; }; \ -}}} + +#include <boost/geometry/geometries/register/multi_linestring.hpp> #endif // BOOST_GEOMETRY_MULTI_GEOMETRIES_REGISTER_MULTI_LINESTRING_HPP diff --git a/boost/geometry/multi/geometries/register/multi_point.hpp b/boost/geometry/multi/geometries/register/multi_point.hpp index 813f54733d..6063492c2b 100644 --- a/boost/geometry/multi/geometries/register/multi_point.hpp +++ b/boost/geometry/multi/geometries/register/multi_point.hpp @@ -15,45 +15,8 @@ #ifndef BOOST_GEOMETRY_MULTI_GEOMETRIES_REGISTER_MULTI_POINT_HPP #define BOOST_GEOMETRY_MULTI_GEOMETRIES_REGISTER_MULTI_POINT_HPP -#include <boost/geometry/core/tag.hpp> -#include <boost/geometry/multi/core/tags.hpp> - -/*! -\brief \brief_macro{multi_point} -\ingroup register -\details \details_macro{BOOST_GEOMETRY_REGISTER_MULTI_POINT, multi_point} The - multi_point may contain template parameters, which must be specified then. -\param MultiPoint \param_macro_type{multi_point} - -\qbk{ -[heading Example] -[register_multi_point] -[register_multi_point_output] -} -*/ -#define BOOST_GEOMETRY_REGISTER_MULTI_POINT(MultiPoint) \ -namespace boost { namespace geometry { namespace traits { \ - template<> struct tag<MultiPoint> { typedef multi_point_tag type; }; \ -}}} - - -/*! -\brief \brief_macro{templated multi_point} -\ingroup register -\details \details_macro{BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED, templated multi_point} - \details_macro_templated{multi_point, point} -\param MultiPoint \param_macro_type{multi_point (without template parameters)} - -\qbk{ -[heading Example] -[register_multi_point_templated] -[register_multi_point_templated_output] -} -*/ -#define BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED(MultiPoint) \ -namespace boost { namespace geometry { namespace traits { \ - template<typename Point> struct tag< MultiPoint<Point> > { typedef multi_point_tag type; }; \ -}}} + +#include <boost/geometry/geometries/register/multi_point.hpp> #endif // BOOST_GEOMETRY_MULTI_GEOMETRIES_REGISTER_MULTI_POINT_HPP diff --git a/boost/geometry/multi/geometries/register/multi_polygon.hpp b/boost/geometry/multi/geometries/register/multi_polygon.hpp index 801b98cf24..6a3e47e3da 100644 --- a/boost/geometry/multi/geometries/register/multi_polygon.hpp +++ b/boost/geometry/multi/geometries/register/multi_polygon.hpp @@ -15,45 +15,8 @@ #ifndef BOOST_GEOMETRY_MULTI_GEOMETRIES_REGISTER_MULTI_POLYGON_HPP #define BOOST_GEOMETRY_MULTI_GEOMETRIES_REGISTER_MULTI_POLYGON_HPP -#include <boost/geometry/core/tag.hpp> -#include <boost/geometry/multi/core/tags.hpp> - -/*! -\brief \brief_macro{multi_polygon} -\ingroup register -\details \details_macro{BOOST_GEOMETRY_REGISTER_MULTI_POLYGON, multi_polygon} The - multi_polygon may contain template parameters, which must be specified then. -\param MultiPolygon \param_macro_type{multi_polygon} - -\qbk{ -[heading Example] -[register_multi_polygon] -[register_multi_polygon_output] -} -*/ -#define BOOST_GEOMETRY_REGISTER_MULTI_POLYGON(MultiPolygon) \ -namespace boost { namespace geometry { namespace traits { \ - template<> struct tag<MultiPolygon> { typedef multi_polygon_tag type; }; \ -}}} - - -/*! -\brief \brief_macro{templated multi_polygon} -\ingroup register -\details \details_macro{BOOST_GEOMETRY_REGISTER_MULTI_POLYGON_TEMPLATED, templated multi_polygon} - \details_macro_templated{multi_polygon, polygon} -\param MultiPolygon \param_macro_type{multi_polygon (without template parameters)} - -\qbk{ -[heading Example] -[register_multi_polygon_templated] -[register_multi_polygon_templated_output] -} -*/ -#define BOOST_GEOMETRY_REGISTER_MULTI_POLYGON_TEMPLATED(MultiPolygon) \ -namespace boost { namespace geometry { namespace traits { \ - template<typename Polygon> struct tag< MultiPolygon<Polygon> > { typedef multi_polygon_tag type; }; \ -}}} + +#include <boost/geometry/geometries/register/multi_polygon.hpp> #endif // BOOST_GEOMETRY_MULTI_GEOMETRIES_REGISTER_MULTI_POLYGON_HPP diff --git a/boost/geometry/multi/io/dsv/write.hpp b/boost/geometry/multi/io/dsv/write.hpp index be40b5da5a..092869f56c 100644 --- a/boost/geometry/multi/io/dsv/write.hpp +++ b/boost/geometry/multi/io/dsv/write.hpp @@ -14,70 +14,8 @@ #ifndef BOOST_GEOMETRY_MULTI_IO_DSV_WRITE_HPP #define BOOST_GEOMETRY_MULTI_IO_DSV_WRITE_HPP -#include <boost/range.hpp> #include <boost/geometry/io/dsv/write.hpp> -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace dsv -{ - -template <typename MultiGeometry> -struct dsv_multi -{ - typedef dispatch::dsv - < - typename single_tag_of - < - typename tag<MultiGeometry>::type - >::type, - typename boost::range_value<MultiGeometry>::type - > dispatch_one; - - typedef typename boost::range_iterator - < - MultiGeometry const - >::type iterator; - - - template <typename Char, typename Traits> - static inline void apply(std::basic_ostream<Char, Traits>& os, - MultiGeometry const& multi, - dsv_settings const& settings) - { - os << settings.list_open; - - bool first = true; - for(iterator it = boost::begin(multi); - it != boost::end(multi); - ++it, first = false) - { - os << (first ? "" : settings.list_separator); - dispatch_one::apply(os, *it, settings); - } - os << settings.list_close; - } -}; - -}} // namespace detail::dsv -#endif // DOXYGEN_NO_DETAIL - - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template <typename Geometry> -struct dsv<multi_tag, Geometry> - : detail::dsv::dsv_multi<Geometry> -{}; - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_IO_DSV_WRITE_HPP diff --git a/boost/geometry/multi/io/wkt/detail/prefix.hpp b/boost/geometry/multi/io/wkt/detail/prefix.hpp index 37b07979ba..34e2b241d0 100644 --- a/boost/geometry/multi/io/wkt/detail/prefix.hpp +++ b/boost/geometry/multi/io/wkt/detail/prefix.hpp @@ -14,38 +14,8 @@ #ifndef BOOST_GEOMETRY_MULTI_IO_WKT_DETAIL_PREFIX_HPP #define BOOST_GEOMETRY_MULTI_IO_WKT_DETAIL_PREFIX_HPP -#include <boost/geometry/multi/core/tags.hpp> -namespace boost { namespace geometry -{ +#include <boost/geometry/io/wkt/detail/prefix.hpp> -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace wkt -{ - -struct prefix_null -{ - static inline const char* apply() { return ""; } -}; - -struct prefix_multipoint -{ - static inline const char* apply() { return "MULTIPOINT"; } -}; - -struct prefix_multilinestring -{ - static inline const char* apply() { return "MULTILINESTRING"; } -}; - -struct prefix_multipolygon -{ - static inline const char* apply() { return "MULTIPOLYGON"; } -}; - -}} // namespace wkt::impl -#endif - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_IO_WKT_DETAIL_PREFIX_HPP diff --git a/boost/geometry/multi/io/wkt/read.hpp b/boost/geometry/multi/io/wkt/read.hpp index 218ddf9999..37e5f9e72e 100644 --- a/boost/geometry/multi/io/wkt/read.hpp +++ b/boost/geometry/multi/io/wkt/read.hpp @@ -14,154 +14,8 @@ #ifndef BOOST_GEOMETRY_MULTI_IO_WKT_READ_MULTI_HPP #define BOOST_GEOMETRY_MULTI_IO_WKT_READ_MULTI_HPP -#include <string> -#include <boost/geometry/core/mutable_range.hpp> -#include <boost/geometry/multi/core/tags.hpp> -#include <boost/geometry/multi/core/point_type.hpp> -#include <boost/geometry/multi/io/wkt/detail/prefix.hpp> #include <boost/geometry/io/wkt/read.hpp> -namespace boost { namespace geometry -{ - -namespace detail { namespace wkt -{ - -template <typename MultiGeometry, template<typename> class Parser, typename PrefixPolicy> -struct multi_parser -{ - static inline void apply(std::string const& wkt, MultiGeometry& geometry) - { - traits::clear<MultiGeometry>::apply(geometry); - - tokenizer tokens(wkt, boost::char_separator<char>(" ", ",()")); - tokenizer::iterator it; - if (initialize<MultiGeometry>(tokens, PrefixPolicy::apply(), wkt, it)) - { - handle_open_parenthesis(it, tokens.end(), wkt); - - // Parse sub-geometries - while(it != tokens.end() && *it != ")") - { - traits::resize<MultiGeometry>::apply(geometry, boost::size(geometry) + 1); - Parser - < - typename boost::range_value<MultiGeometry>::type - >::apply(it, tokens.end(), wkt, geometry.back()); - if (it != tokens.end() && *it == ",") - { - // Skip "," after multi-element is parsed - ++it; - } - } - - handle_close_parenthesis(it, tokens.end(), wkt); - } - - check_end(it, tokens.end(), wkt); - } -}; - -template <typename P> -struct noparenthesis_point_parser -{ - static inline void apply(tokenizer::iterator& it, tokenizer::iterator end, - std::string const& wkt, P& point) - { - parsing_assigner<P, 0, dimension<P>::value>::apply(it, end, point, wkt); - } -}; - -template <typename MultiGeometry, typename PrefixPolicy> -struct multi_point_parser -{ - static inline void apply(std::string const& wkt, MultiGeometry& geometry) - { - traits::clear<MultiGeometry>::apply(geometry); - - tokenizer tokens(wkt, boost::char_separator<char>(" ", ",()")); - tokenizer::iterator it; - - if (initialize<MultiGeometry>(tokens, PrefixPolicy::apply(), wkt, it)) - { - handle_open_parenthesis(it, tokens.end(), wkt); - - // If first point definition starts with "(" then parse points as (x y) - // otherwise as "x y" - bool using_brackets = (it != tokens.end() && *it == "("); - - while(it != tokens.end() && *it != ")") - { - traits::resize<MultiGeometry>::apply(geometry, boost::size(geometry) + 1); - - if (using_brackets) - { - point_parser - < - typename boost::range_value<MultiGeometry>::type - >::apply(it, tokens.end(), wkt, geometry.back()); - } - else - { - noparenthesis_point_parser - < - typename boost::range_value<MultiGeometry>::type - >::apply(it, tokens.end(), wkt, geometry.back()); - } - - if (it != tokens.end() && *it == ",") - { - // Skip "," after point is parsed - ++it; - } - } - - handle_close_parenthesis(it, tokens.end(), wkt); - } - - check_end(it, tokens.end(), wkt); - } -}; - -}} // namespace detail::wkt - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template <typename MultiGeometry> -struct read_wkt<multi_point_tag, MultiGeometry> - : detail::wkt::multi_point_parser - < - MultiGeometry, - detail::wkt::prefix_multipoint - > -{}; - -template <typename MultiGeometry> -struct read_wkt<multi_linestring_tag, MultiGeometry> - : detail::wkt::multi_parser - < - MultiGeometry, - detail::wkt::linestring_parser, - detail::wkt::prefix_multilinestring - > -{}; - -template <typename MultiGeometry> -struct read_wkt<multi_polygon_tag, MultiGeometry> - : detail::wkt::multi_parser - < - MultiGeometry, - detail::wkt::polygon_parser, - detail::wkt::prefix_multipolygon - > -{}; - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_IO_WKT_READ_MULTI_HPP diff --git a/boost/geometry/multi/io/wkt/wkt.hpp b/boost/geometry/multi/io/wkt/wkt.hpp index 55f1713d4d..a6159e1409 100644 --- a/boost/geometry/multi/io/wkt/wkt.hpp +++ b/boost/geometry/multi/io/wkt/wkt.hpp @@ -14,7 +14,7 @@ #ifndef BOOST_GEOMETRY_MULTI_IO_WKT_WKT_HPP #define BOOST_GEOMETRY_MULTI_IO_WKT_WKT_HPP -#include <boost/geometry/multi/io/wkt/read.hpp> -#include <boost/geometry/multi/io/wkt/write.hpp> +#include <boost/geometry/io/wkt/read.hpp> +#include <boost/geometry/io/wkt/write.hpp> #endif // BOOST_GEOMETRY_MULTI_IO_WKT_WKT_HPP diff --git a/boost/geometry/multi/io/wkt/write.hpp b/boost/geometry/multi/io/wkt/write.hpp index 374da28b53..2c26d3d2e4 100644 --- a/boost/geometry/multi/io/wkt/write.hpp +++ b/boost/geometry/multi/io/wkt/write.hpp @@ -14,95 +14,8 @@ #ifndef BOOST_GEOMETRY_MULTI_IO_WKT_WRITE_HPP #define BOOST_GEOMETRY_MULTI_IO_WKT_WRITE_HPP -#include <boost/geometry/multi/core/tags.hpp> -#include <boost/geometry/multi/io/wkt/detail/prefix.hpp> -#include <boost/geometry/io/wkt/write.hpp> - -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace wkt -{ - -template <typename Multi, typename StreamPolicy, typename PrefixPolicy> -struct wkt_multi -{ - template <typename Char, typename Traits> - static inline void apply(std::basic_ostream<Char, Traits>& os, - Multi const& geometry) - { - os << PrefixPolicy::apply(); - // TODO: check EMPTY here - os << "("; - - for (typename boost::range_iterator<Multi const>::type - it = boost::begin(geometry); - it != boost::end(geometry); - ++it) - { - if (it != boost::begin(geometry)) - { - os << ","; - } - StreamPolicy::apply(os, *it); - } - - os << ")"; - } -}; -}} // namespace wkt::impl -#endif - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template <typename Multi> -struct wkt<multi_point_tag, Multi> - : detail::wkt::wkt_multi - < - Multi, - detail::wkt::wkt_point - < - typename boost::range_value<Multi>::type, - detail::wkt::prefix_null - >, - detail::wkt::prefix_multipoint - > -{}; - -template <typename Multi> -struct wkt<multi_linestring_tag, Multi> - : detail::wkt::wkt_multi - < - Multi, - detail::wkt::wkt_sequence - < - typename boost::range_value<Multi>::type - >, - detail::wkt::prefix_multilinestring - > -{}; - -template <typename Multi> -struct wkt<multi_polygon_tag, Multi> - : detail::wkt::wkt_multi - < - Multi, - detail::wkt::wkt_poly - < - typename boost::range_value<Multi>::type, - detail::wkt::prefix_null - >, - detail::wkt::prefix_multipolygon - > -{}; - -} // namespace dispatch -#endif +#include <boost/geometry/io/wkt/write.hpp> -}} // namespace boost::geometry #endif // BOOST_GEOMETRY_MULTI_IO_WKT_WRITE_HPP diff --git a/boost/geometry/multi/multi.hpp b/boost/geometry/multi/multi.hpp index db33a9dd03..4b3063e520 100644 --- a/boost/geometry/multi/multi.hpp +++ b/boost/geometry/multi/multi.hpp @@ -4,6 +4,9 @@ // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// This file was modified by Oracle on 2013. +// Modifications copyright (c) 2013, Oracle and/or its affiliates. + // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -15,63 +18,64 @@ #define BOOST_GEOMETRY_MULTI_HPP -#include <boost/geometry/multi/core/closure.hpp> -#include <boost/geometry/multi/core/geometry_id.hpp> -#include <boost/geometry/multi/core/interior_rings.hpp> -#include <boost/geometry/multi/core/is_areal.hpp> -#include <boost/geometry/multi/core/point_order.hpp> -#include <boost/geometry/multi/core/point_type.hpp> -#include <boost/geometry/multi/core/ring_type.hpp> -#include <boost/geometry/multi/core/tags.hpp> -#include <boost/geometry/multi/core/topological_dimension.hpp> - -#include <boost/geometry/multi/algorithms/append.hpp> -#include <boost/geometry/multi/algorithms/area.hpp> -#include <boost/geometry/multi/algorithms/centroid.hpp> -#include <boost/geometry/multi/algorithms/clear.hpp> -#include <boost/geometry/multi/algorithms/convert.hpp> -#include <boost/geometry/multi/algorithms/correct.hpp> -#include <boost/geometry/multi/algorithms/covered_by.hpp> -#include <boost/geometry/multi/algorithms/distance.hpp> -#include <boost/geometry/multi/algorithms/envelope.hpp> -#include <boost/geometry/multi/algorithms/equals.hpp> -#include <boost/geometry/multi/algorithms/for_each.hpp> -#include <boost/geometry/multi/algorithms/intersection.hpp> -#include <boost/geometry/multi/algorithms/length.hpp> -#include <boost/geometry/multi/algorithms/num_geometries.hpp> -#include <boost/geometry/multi/algorithms/num_interior_rings.hpp> -#include <boost/geometry/multi/algorithms/num_points.hpp> -#include <boost/geometry/multi/algorithms/perimeter.hpp> -#include <boost/geometry/multi/algorithms/reverse.hpp> -#include <boost/geometry/multi/algorithms/simplify.hpp> -#include <boost/geometry/multi/algorithms/transform.hpp> -#include <boost/geometry/multi/algorithms/unique.hpp> -#include <boost/geometry/multi/algorithms/within.hpp> - -#include <boost/geometry/multi/algorithms/detail/for_each_range.hpp> -#include <boost/geometry/multi/algorithms/detail/modify_with_predicate.hpp> -#include <boost/geometry/multi/algorithms/detail/multi_sum.hpp> - -#include <boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp> -#include <boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp> - -#include <boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp> -#include <boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp> -#include <boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp> -#include <boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp> -#include <boost/geometry/multi/algorithms/detail/overlay/select_rings.hpp> -#include <boost/geometry/multi/algorithms/detail/overlay/self_turn_points.hpp> - -#include <boost/geometry/multi/geometries/concepts/check.hpp> -#include <boost/geometry/multi/geometries/concepts/multi_point_concept.hpp> -#include <boost/geometry/multi/geometries/concepts/multi_linestring_concept.hpp> -#include <boost/geometry/multi/geometries/concepts/multi_polygon_concept.hpp> - -#include <boost/geometry/multi/views/detail/range_type.hpp> -#include <boost/geometry/multi/strategies/cartesian/centroid_average.hpp> - -#include <boost/geometry/multi/io/dsv/write.hpp> -#include <boost/geometry/multi/io/wkt/wkt.hpp> +#include <boost/geometry/core/closure.hpp> +#include <boost/geometry/core/geometry_id.hpp> +#include <boost/geometry/core/interior_rings.hpp> +#include <boost/geometry/core/is_areal.hpp> +#include <boost/geometry/core/point_order.hpp> +#include <boost/geometry/core/point_type.hpp> +#include <boost/geometry/core/ring_type.hpp> +#include <boost/geometry/core/tags.hpp> +#include <boost/geometry/core/topological_dimension.hpp> + +#include <boost/geometry/algorithms/append.hpp> +#include <boost/geometry/algorithms/area.hpp> +#include <boost/geometry/algorithms/centroid.hpp> +#include <boost/geometry/algorithms/clear.hpp> +#include <boost/geometry/algorithms/convert.hpp> +#include <boost/geometry/algorithms/correct.hpp> +#include <boost/geometry/algorithms/covered_by.hpp> +#include <boost/geometry/algorithms/disjoint.hpp> +#include <boost/geometry/algorithms/distance.hpp> +#include <boost/geometry/algorithms/envelope.hpp> +#include <boost/geometry/algorithms/equals.hpp> +#include <boost/geometry/algorithms/for_each.hpp> +#include <boost/geometry/algorithms/intersection.hpp> +#include <boost/geometry/algorithms/length.hpp> +#include <boost/geometry/algorithms/num_geometries.hpp> +#include <boost/geometry/algorithms/num_interior_rings.hpp> +#include <boost/geometry/algorithms/num_points.hpp> +#include <boost/geometry/algorithms/perimeter.hpp> +#include <boost/geometry/algorithms/remove_spikes.hpp> +#include <boost/geometry/algorithms/reverse.hpp> +#include <boost/geometry/algorithms/simplify.hpp> +#include <boost/geometry/algorithms/transform.hpp> +#include <boost/geometry/algorithms/unique.hpp> +#include <boost/geometry/algorithms/within.hpp> + +#include <boost/geometry/algorithms/detail/point_on_border.hpp> + +#include <boost/geometry/algorithms/detail/for_each_range.hpp> +#include <boost/geometry/algorithms/detail/multi_modify_with_predicate.hpp> +#include <boost/geometry/algorithms/detail/multi_sum.hpp> + +#include <boost/geometry/algorithms/detail/sections/range_by_section.hpp> +#include <boost/geometry/algorithms/detail/sections/sectionalize.hpp> + +#include <boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp> +#include <boost/geometry/algorithms/detail/overlay/copy_segments.hpp> +#include <boost/geometry/algorithms/detail/overlay/get_ring.hpp> +#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp> +#include <boost/geometry/algorithms/detail/overlay/select_rings.hpp> +#include <boost/geometry/algorithms/detail/overlay/self_turn_points.hpp> + +#include <boost/geometry/geometries/concepts/check.hpp> + +#include <boost/geometry/views/detail/range_type.hpp> +#include <boost/geometry/strategies/cartesian/centroid_average.hpp> + +#include <boost/geometry/io/dsv/write.hpp> +#include <boost/geometry/io/wkt/wkt.hpp> #endif // BOOST_GEOMETRY_MULTI_HPP diff --git a/boost/geometry/multi/strategies/cartesian/centroid_average.hpp b/boost/geometry/multi/strategies/cartesian/centroid_average.hpp index f28daf20bb..ce614e2e76 100644 --- a/boost/geometry/multi/strategies/cartesian/centroid_average.hpp +++ b/boost/geometry/multi/strategies/cartesian/centroid_average.hpp @@ -15,102 +15,7 @@ #define BOOST_GEOMETRY_MULTI_STRATEGIES_CARTESIAN_CENTROID_AVERAGE_HPP -#include <boost/numeric/conversion/cast.hpp> -#include <boost/type_traits.hpp> - -#include <boost/geometry/core/coordinate_type.hpp> -#include <boost/geometry/core/point_type.hpp> -#include <boost/geometry/arithmetic/arithmetic.hpp> -#include <boost/geometry/strategies/centroid.hpp> - - -namespace boost { namespace geometry -{ - -namespace strategy { namespace centroid -{ - - -/*! -\brief Centroid calculation taking average of points -\ingroup strategies -*/ -template -< - typename PointCentroid, - typename Point = PointCentroid -> -class average -{ -private : - - /*! subclass to keep state */ - class sum - { - friend class average; - int count; - PointCentroid centroid; - - public : - inline sum() - : count(0) - { - assign_zero(centroid); - } - }; - -public : - typedef sum state_type; - typedef PointCentroid centroid_point_type; - typedef Point point_type; - - static inline void apply(Point const& p, sum& state) - { - add_point(state.centroid, p); - state.count++; - } - - static inline void result(sum const& state, PointCentroid& centroid) - { - centroid = state.centroid; - divide_value(centroid, state.count); - } - -}; - - -#ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS - - -namespace services -{ - -template <typename Point, std::size_t DimensionCount, typename Geometry> -struct default_strategy -< - cartesian_tag, - pointlike_tag, - DimensionCount, - Point, - Geometry -> -{ - typedef average - < - Point, - typename point_type<Geometry>::type - > type; -}; - -} // namespace services - -#endif - - -}} // namespace strategy::centroid - - -}} // namespace boost::geometry +#include <boost/geometry/strategies/cartesian/centroid_average.hpp> #endif // BOOST_GEOMETRY_MULTI_STRATEGIES_CARTESIAN_CENTROID_AVERAGE_HPP diff --git a/boost/geometry/multi/views/detail/range_type.hpp b/boost/geometry/multi/views/detail/range_type.hpp index 172feb251f..f8cb0e6e53 100644 --- a/boost/geometry/multi/views/detail/range_type.hpp +++ b/boost/geometry/multi/views/detail/range_type.hpp @@ -15,48 +15,7 @@ #define BOOST_GEOMETRY_MULTI_VIEWS_DETAIL_RANGE_TYPE_HPP -#include <boost/range.hpp> - #include <boost/geometry/views/detail/range_type.hpp> -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -// multi-point acts itself as a range -template <typename Geometry> -struct range_type<multi_point_tag, Geometry> -{ - typedef Geometry type; -}; - - -template <typename Geometry> -struct range_type<multi_linestring_tag, Geometry> -{ - typedef typename boost::range_value<Geometry>::type type; -}; - - -template <typename Geometry> -struct range_type<multi_polygon_tag, Geometry> -{ - // Call its single-version - typedef typename geometry::detail::range_type - < - typename boost::range_value<Geometry>::type - >::type type; -}; - - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - -}} // namespace boost::geometry - #endif // BOOST_GEOMETRY_MULTI_VIEWS_DETAIL_RANGE_TYPE_HPP |