Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60642 - in sandbox/geometry/boost/geometry: . algorithms algorithms/detail/sections algorithms/overlay multi multi/algorithms multi/algorithms/detail/sections multi/algorithms/overlay
From: barend.gehrels_at_[hidden]
Date: 2010-03-16 07:35:49


Author: barendgehrels
Date: 2010-03-16 07:35:47 EDT (Tue, 16 Mar 2010)
New Revision: 60642
URL: http://svn.boost.org/trac/boost/changeset/60642

Log:
Moved sectionalize/get_section to detail/sections/

Added:
   sandbox/geometry/boost/geometry/algorithms/detail/sections/get_section.hpp
      - copied, changed from r60608, /sandbox/geometry/boost/geometry/algorithms/get_section.hpp
   sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp
      - copied, changed from r60640, /sandbox/geometry/boost/geometry/algorithms/sectionalize.hpp
   sandbox/geometry/boost/geometry/multi/algorithms/detail/sections/get_section.hpp
      - copied, changed from r60608, /sandbox/geometry/boost/geometry/multi/algorithms/get_section.hpp
   sandbox/geometry/boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp
      - copied, changed from r60608, /sandbox/geometry/boost/geometry/multi/algorithms/sectionalize.hpp
Removed:
   sandbox/geometry/boost/geometry/algorithms/get_section.hpp
   sandbox/geometry/boost/geometry/algorithms/sectionalize.hpp
   sandbox/geometry/boost/geometry/multi/algorithms/get_section.hpp
   sandbox/geometry/boost/geometry/multi/algorithms/sectionalize.hpp
Text files modified:
   sandbox/geometry/boost/geometry/algorithms/detail/sections/get_section.hpp | 6 +++---
   sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp | 14 +++++++-------
   sandbox/geometry/boost/geometry/algorithms/overlay/get_turns.hpp | 6 +++---
   sandbox/geometry/boost/geometry/geometry.hpp | 6 +++++-
   sandbox/geometry/boost/geometry/multi/algorithms/detail/sections/get_section.hpp | 8 ++++----
   sandbox/geometry/boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp | 17 +++++++----------
   sandbox/geometry/boost/geometry/multi/algorithms/overlay/get_turns.hpp | 8 +++++---
   sandbox/geometry/boost/geometry/multi/multi.hpp | 7 ++++---
   8 files changed, 38 insertions(+), 34 deletions(-)

Copied: sandbox/geometry/boost/geometry/algorithms/detail/sections/get_section.hpp (from r60608, /sandbox/geometry/boost/geometry/algorithms/get_section.hpp)
==============================================================================
--- /sandbox/geometry/boost/geometry/algorithms/get_section.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/sections/get_section.hpp 2010-03-16 07:35:47 EDT (Tue, 16 Mar 2010)
@@ -6,8 +6,8 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_GEOMETRY_ALGORITHMS_GET_SECTION_HPP
-#define BOOST_GEOMETRY_ALGORITHMS_GET_SECTION_HPP
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_GET_SECTION_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_GET_SECTION_HPP
 
 
 #include <boost/range/functions.hpp>
@@ -113,4 +113,4 @@
 
 }} // namespace boost::geometry
 
-#endif // BOOST_GEOMETRY_ALGORITHMS_GET_SECTION_HPP
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_GET_SECTION_HPP

Copied: sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp (from r60640, /sandbox/geometry/boost/geometry/algorithms/sectionalize.hpp)
==============================================================================
--- /sandbox/geometry/boost/geometry/algorithms/sectionalize.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp 2010-03-16 07:35:47 EDT (Tue, 16 Mar 2010)
@@ -6,8 +6,8 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_GEOMETRY_ALGORITHMS_SECTIONALIZE_HPP
-#define BOOST_GEOMETRY_ALGORITHMS_SECTIONALIZE_HPP
+#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_SECTIONALIZE_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_SECTIONALIZE_HPP
 
 #include <cstddef>
 #include <vector>
@@ -109,7 +109,7 @@
 
 
 #ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace sectionalize
+namespace detail { namespace sectionalize
 {
 
 template <typename Segment, std::size_t Dimension, std::size_t DimensionCount>
@@ -263,8 +263,8 @@
     typedef typename boost::range_iterator<Range const>::type iterator_type;
 
     static inline void apply(Sections& sections, section_type& section,
- std::size_t& index, int& ndi,
- Range const& range,
+ std::size_t& index, int& ndi,
+ Range const& range,
                 int ring_index = -1, int multi_index = -1)
     {
 
@@ -403,7 +403,7 @@
             <
                 Range, Point, Sections,
                 DimensionCount, MaxCount
- >::apply(sections, section, index, ndi,
+ >::apply(sections, section, index, ndi,
                         range, ring_index, multi_index);
 
         // Add last section if applicable
@@ -629,4 +629,4 @@
 }} // namespace boost::geometry
 
 
-#endif // BOOST_GEOMETRY_ALGORITHMS_SECTIONALIZE_HPP
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_SECTIONALIZE_HPP

Deleted: sandbox/geometry/boost/geometry/algorithms/get_section.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/get_section.hpp 2010-03-16 07:35:47 EDT (Tue, 16 Mar 2010)
+++ (empty file)
@@ -1,116 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands.
-// Copyright Bruno Lalande 2008, 2009
-// 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_ALGORITHMS_GET_SECTION_HPP
-#define BOOST_GEOMETRY_ALGORITHMS_GET_SECTION_HPP
-
-
-#include <boost/range/functions.hpp>
-#include <boost/range/metafunctions.hpp>
-
-
-#include <boost/geometry/core/access.hpp>
-#include <boost/geometry/core/exterior_ring.hpp>
-#include <boost/geometry/core/interior_rings.hpp>
-
-#include <boost/geometry/iterators/range_type.hpp>
-
-#include <boost/geometry/geometries/segment.hpp>
-
-
-
-namespace boost { namespace geometry
-{
-
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace dispatch
-{
-
-template <typename Tag, typename Geometry, typename Section>
-struct get_section
-{
- typedef typename boost::range_const_iterator
- <
- typename geometry::range_type<Geometry>::type
- >::type iterator_type;
-
- static inline void apply(Geometry const& geometry, Section const& section,
- iterator_type& begin, iterator_type& end)
- {
- begin = boost::begin(geometry) + section.begin_index;
- end = boost::begin(geometry) + section.end_index + 1;
- }
-};
-
-template <typename Polygon, typename Section>
-struct get_section<polygon_tag, Polygon, Section>
-{
- typedef typename boost::range_const_iterator
- <
- typename geometry::range_type<Polygon>::type
- >::type iterator_type;
-
- static inline void apply(Polygon const& polygon, Section const& section,
- iterator_type& begin, iterator_type& end)
- {
- typedef typename geometry::ring_type<Polygon>::type ring_type;
- ring_type const& ring = section.ring_index < 0
- ? geometry::exterior_ring(polygon)
- : geometry::interior_rings(polygon)[section.ring_index];
-
- begin = boost::begin(ring) + section.begin_index;
- end = boost::begin(ring) + section.end_index + 1;
- }
-};
-
-} // namespace dispatch
-#endif
-
-
-
-
-/*!
- \brief Get iterators for a specified section
- \ingroup sectionalize
- \tparam Geometry type
- \tparam Section type of section to get from
- \param geometry geometry which might be located in the neighborhood
- \param section structure with section
- \param begin begin-iterator (const iterator over points of section)
- \param end end-iterator (const iterator over points of section)
- \todo Create non-const version as well
-
- */
-template <typename Geometry, typename Section>
-inline void get_section(Geometry const& geometry, Section const& section,
- typename boost::range_const_iterator
- <
- typename geometry::range_type<Geometry>::type
- >::type& begin,
- typename boost::range_const_iterator
- <
- typename geometry::range_type<Geometry>::type
- >::type& end)
-{
- concept::check<const Geometry>();
-
- dispatch::get_section
- <
- typename tag<Geometry>::type,
- Geometry,
- Section
- >::apply(geometry, section, begin, end);
-}
-
-
-
-
-}} // namespace boost::geometry
-
-#endif // BOOST_GEOMETRY_ALGORITHMS_GET_SECTION_HPP

Modified: sandbox/geometry/boost/geometry/algorithms/overlay/get_turns.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/overlay/get_turns.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/overlay/get_turns.hpp 2010-03-16 07:35:47 EDT (Tue, 16 Mar 2010)
@@ -50,8 +50,8 @@
 
 #include <boost/geometry/algorithms/combine.hpp>
 #include <boost/geometry/algorithms/distance.hpp>
-#include <boost/geometry/algorithms/sectionalize.hpp>
-#include <boost/geometry/algorithms/get_section.hpp>
+#include <boost/geometry/algorithms/detail/sections/sectionalize.hpp>
+#include <boost/geometry/algorithms/detail/sections/get_section.hpp>
 #include <boost/geometry/algorithms/within.hpp>
 
 #ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION
@@ -654,7 +654,7 @@
 namespace dispatch
 {
 
-// Because this is "detail" method, and most implementations will use "generic",
+// Because this is "detail" method, and most implementations will use "generic",
 // we take the freedom to derive it from "generic".
 template
 <

Deleted: sandbox/geometry/boost/geometry/algorithms/sectionalize.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/sectionalize.hpp 2010-03-16 07:35:47 EDT (Tue, 16 Mar 2010)
+++ (empty file)
@@ -1,632 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands.
-// Copyright Bruno Lalande 2008, 2009
-// 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_ALGORITHMS_SECTIONALIZE_HPP
-#define BOOST_GEOMETRY_ALGORITHMS_SECTIONALIZE_HPP
-
-#include <cstddef>
-#include <vector>
-
-#include <boost/concept_check.hpp>
-
-#include <boost/range/functions.hpp>
-#include <boost/range/metafunctions.hpp>
-
-#include <boost/geometry/algorithms/assign.hpp>
-#include <boost/geometry/algorithms/combine.hpp>
-
-#include <boost/geometry/core/access.hpp>
-#include <boost/geometry/core/exterior_ring.hpp>
-
-#include <boost/geometry/geometries/concepts/check.hpp>
-
-
-#include <boost/geometry/util/math.hpp>
-#include <boost/geometry/geometries/segment.hpp>
-
-
-/*!
-\defgroup sectionalize sectionalize: split a geometry (polygon, linestring, etc)
- into monotonic sections
-
-\par Geometries:
-- LINESTRING:
-- RING:
-- POLYGON:
-- BOX
-*/
-
-namespace boost { namespace geometry
-{
-
-
-/*!
- \brief Structure containing section information
- \details Section information consists of a bounding box, direction
- information (if it is increasing or decreasing, per dimension),
- index information (begin-end, ring, multi) and the number of
- segments in this section
-
- \tparam Box box-type
- \tparam DimensionCount number of dimensions for this section
- \ingroup sectionalize
- */
-template <typename Box, std::size_t DimensionCount>
-struct section
-{
- typedef Box box_type;
-
- int id;
- int directions[DimensionCount];
- int ring_index;
- int multi_index;
- Box bounding_box;
-
- int begin_index;
- int end_index;
- std::size_t count;
- std::size_t range_count;
- bool duplicate;
- int non_duplicate_index;
-
- inline section()
- : id(-1)
- , ring_index(-99)
- , multi_index(-99)
- , begin_index(-1)
- , end_index(-1)
- , count(0)
- , range_count(0)
- , duplicate(false)
- , non_duplicate_index(-1)
- {
- assign_inverse(bounding_box);
- for (register std::size_t i = 0; i < DimensionCount; i++)
- {
- directions[i] = 0;
- }
- }
-};
-
-
-/*!
- \brief Structure containing a collection of sections
- \note Derived from a vector, proves to be faster than of deque
- \note vector might be templated in the future
- \ingroup sectionalize
- */
-template <typename Box, std::size_t DimensionCount>
-struct sections : std::vector<section<Box, DimensionCount> >
-{
- typedef Box box_type;
- static const std::size_t value = DimensionCount;
-};
-
-
-#ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace sectionalize
-{
-
-template <typename Segment, std::size_t Dimension, std::size_t DimensionCount>
-struct get_direction_loop
-{
- typedef typename coordinate_type<Segment>::type coordinate_type;
-
- static inline void apply(Segment const& seg,
- int directions[DimensionCount])
- {
- coordinate_type const diff =
- geometry::get<1, Dimension>(seg) - geometry::get<0, Dimension>(seg);
-
- coordinate_type zero = coordinate_type();
- directions[Dimension] = diff > zero ? 1 : diff < zero ? -1 : 0;
-
- get_direction_loop
- <
- Segment, Dimension + 1, DimensionCount
- >::apply(seg, directions);
- }
-};
-
-template <typename Segment, std::size_t DimensionCount>
-struct get_direction_loop<Segment, DimensionCount, DimensionCount>
-{
- static inline void apply(Segment const& seg,
- int directions[DimensionCount])
- {
- boost::ignore_unused_variable_warning(seg);
- boost::ignore_unused_variable_warning(directions);
- }
-};
-
-template <typename T, std::size_t Dimension, std::size_t DimensionCount>
-struct copy_loop
-{
- static inline void apply(const T source[DimensionCount],
- T target[DimensionCount])
- {
- target[Dimension] = source[Dimension];
- copy_loop<T, Dimension + 1, DimensionCount>::apply(source, target);
- }
-};
-
-template <typename T, std::size_t DimensionCount>
-struct copy_loop<T, DimensionCount, DimensionCount>
-{
- static inline void apply(const T source[DimensionCount],
- T target[DimensionCount])
- {
- boost::ignore_unused_variable_warning(source);
- boost::ignore_unused_variable_warning(target);
- }
-};
-
-template <typename T, std::size_t Dimension, std::size_t DimensionCount>
-struct compare_loop
-{
- static inline bool apply(const T source[DimensionCount],
- const T target[DimensionCount])
- {
- bool const not_equal = target[Dimension] != source[Dimension];
-
- return not_equal
- ? false
- : compare_loop
- <
- T, Dimension + 1, DimensionCount
- >::apply(source, target);
- }
-};
-
-template <typename T, std::size_t DimensionCount>
-struct compare_loop<T, DimensionCount, DimensionCount>
-{
- static inline bool apply(const T source[DimensionCount],
- const T target[DimensionCount])
- {
- boost::ignore_unused_variable_warning(source);
- boost::ignore_unused_variable_warning(target);
-
- return true;
- }
-};
-
-
-template <typename Segment, std::size_t Dimension, std::size_t DimensionCount>
-struct check_duplicate_loop
-{
- typedef typename coordinate_type<Segment>::type coordinate_type;
-
- static inline bool apply(Segment const& seg)
- {
- coordinate_type const diff =
- geometry::get<1, Dimension>(seg) - geometry::get<0, Dimension>(seg);
-
- if (! geometry::math::equals(diff, 0))
- {
- return false;
- }
-
- return check_duplicate_loop
- <
- Segment, Dimension + 1, DimensionCount
- >::apply(seg);
- }
-};
-
-template <typename Segment, std::size_t DimensionCount>
-struct check_duplicate_loop<Segment, DimensionCount, DimensionCount>
-{
- static inline bool apply(Segment const&)
- {
- return true;
- }
-};
-
-template <typename T, std::size_t Dimension, std::size_t DimensionCount>
-struct assign_loop
-{
- static inline void apply(T dims[DimensionCount], int const value)
- {
- dims[Dimension] = value;
- assign_loop<T, Dimension + 1, DimensionCount>::apply(dims, value);
- }
-};
-
-template <typename T, std::size_t DimensionCount>
-struct assign_loop<T, DimensionCount, DimensionCount>
-{
- static inline void apply(T dims[DimensionCount], int const)
- {
- boost::ignore_unused_variable_warning(dims);
- }
-};
-
-/// @brief Helper class to create sections of a part of a range, on the fly
-template
-<
- typename Range,
- typename Point,
- typename Sections,
- std::size_t DimensionCount,
- std::size_t MaxCount
->
-struct sectionalize_part
-{
- typedef geometry::segment<Point const> segment_type;
- typedef typename boost::range_value<Sections>::type section_type;
- typedef typename boost::range_iterator<Range const>::type iterator_type;
-
- static inline void apply(Sections& sections, section_type& section,
- std::size_t& index, int& ndi,
- Range const& range,
- int ring_index = -1, int multi_index = -1)
- {
-
- std::size_t const n = boost::size(range);
- if (n <= index + 1)
- {
- // Zero points, or only one point
- // -> no section can be generated
- return;
- }
-
- if (index == 0)
- {
- ndi = 0;
- }
-
- iterator_type it = boost::begin(range);
- it += index;
-
- for(iterator_type previous = it++;
- it != boost::end(range);
- previous = it++, index++)
- {
- segment_type segment(*previous, *it);
-
- int direction_classes[DimensionCount] = {0};
- get_direction_loop
- <
- segment_type, 0, DimensionCount
- >::apply(segment, direction_classes);
-
- // if "dir" == 0 for all point-dimensions, it is duplicate.
- // Those sections might be omitted, if wished, lateron
- bool duplicate = false;
-
- if (direction_classes[0] == 0)
- {
- // Recheck because ALL dimensions should be checked,
- // not only first one.
- // (DimensionCount might be < dimension<P>::value)
- if (check_duplicate_loop
- <
- segment_type, 0, geometry::dimension<Point>::type::value
- >::apply(segment)
- )
- {
- duplicate = true;
-
- // Change direction-info to force new section
- // Note that wo consecutive duplicate segments will generate
- // only one duplicate-section.
- // Actual value is not important as long as it is not -1,0,1
- assign_loop
- <
- int, 0, DimensionCount
- >::apply(direction_classes, -99);
- }
- }
-
- if (section.count > 0
- && (!compare_loop
- <
- int, 0, DimensionCount
- >::apply(direction_classes, section.directions)
- || section.count > MaxCount
- )
- )
- {
- sections.push_back(section);
- section = section_type();
- }
-
- if (section.count == 0)
- {
- section.begin_index = index;
- section.ring_index = ring_index;
- section.multi_index = multi_index;
- section.duplicate = duplicate;
- section.non_duplicate_index = ndi;
- section.range_count = boost::size(range);
-
- copy_loop
- <
- int, 0, DimensionCount
- >::apply(direction_classes, section.directions);
- geometry::combine(section.bounding_box, *previous);
- }
-
- geometry::combine(section.bounding_box, *it);
- section.end_index = index + 1;
- section.count++;
- if (! duplicate)
- {
- ndi++;
- }
- }
- }
-};
-
-
-template
-<
- typename Range,
- typename Point,
- typename Sections,
- std::size_t DimensionCount,
- std::size_t MaxCount
->
-struct sectionalize_range
-{
- static inline void apply(Range const& range, Sections& sections,
- int ring_index = -1, int multi_index = -1)
- {
- typedef segment<const Point> segment_type;
-
- std::size_t const n = boost::size(range);
- if (n == 0)
- {
- // Zero points, no section
- return;
- }
-
- if (n == 1)
- {
- // Line with one point ==> no sections
- return;
- }
-
- std::size_t index = 0;
- int ndi = 0; // non duplicate index
-
- typedef typename boost::range_value<Sections>::type section_type;
- section_type section;
-
- sectionalize_part
- <
- Range, Point, Sections,
- DimensionCount, MaxCount
- >::apply(sections, section, index, ndi,
- range, ring_index, multi_index);
-
- // Add last section if applicable
- if (section.count > 0)
- {
- sections.push_back(section);
- }
- }
-};
-
-template
-<
- typename Polygon,
- typename Sections,
- std::size_t DimensionCount,
- std::size_t MaxCount
->
-struct sectionalize_polygon
-{
- static inline void apply(Polygon const& poly, Sections& sections,
- int multi_index = -1)
- {
- typedef typename point_type<Polygon>::type point_type;
- typedef typename ring_type<Polygon>::type ring_type;
- typedef sectionalize_range
- <
- ring_type, point_type, Sections, DimensionCount, MaxCount
- > sectionalizer_type;
-
- typedef typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type iterator_type;
-
- sectionalizer_type::apply(exterior_ring(poly), sections, -1, multi_index);
-
- int i = 0;
- for (iterator_type it = boost::begin(interior_rings(poly));
- it != boost::end(interior_rings(poly));
- ++it, ++i)
- {
- sectionalizer_type::apply(*it, sections, i, multi_index);
- }
- }
-};
-
-template
-<
- typename Box,
- typename Sections,
- std::size_t DimensionCount,
- std::size_t MaxCount
->
-struct sectionalize_box
-{
- static inline void apply(Box const& box, Sections& sections)
- {
- typedef typename point_type<Box>::type point_type;
-
- assert_dimension<Box, 2>();
-
- // Add all four sides of the 2D-box as separate section.
- // Easiest is to convert it to a polygon.
- // However, we don't have the polygon type
- // (or polygon would be a helper-type).
- // Therefore we mimic a linestring/std::vector of 5 points
-
- point_type ll, lr, ul, ur;
- assign_box_corners(box, ll, lr, ul, ur);
-
- std::vector<point_type> points;
- points.push_back(ll);
- points.push_back(ul);
- points.push_back(ur);
- points.push_back(lr);
- points.push_back(ll);
-
- sectionalize_range
- <
- std::vector<point_type>,
- point_type,
- Sections,
- DimensionCount,
- MaxCount
- >::apply(points, sections);
- }
-};
-
-}} // namespace detail::sectionalize
-#endif // DOXYGEN_NO_DETAIL
-
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace dispatch
-{
-
-template
-<
- typename Tag,
- typename Geometry,
- typename Sections,
- std::size_t DimensionCount,
- std::size_t MaxCount
->
-struct sectionalize
-{};
-
-template
-<
- typename Box,
- typename Sections,
- std::size_t DimensionCount,
- std::size_t MaxCount
->
-struct sectionalize<box_tag, Box, Sections, DimensionCount, MaxCount>
- : detail::sectionalize::sectionalize_box
- <
- Box,
- Sections,
- DimensionCount,
- MaxCount
- >
-{};
-
-template
-<
- typename LineString, typename
- Sections,
- std::size_t DimensionCount,
- std::size_t MaxCount
->
-struct sectionalize
- <
- linestring_tag,
- LineString,
- Sections,
- DimensionCount,
- MaxCount
- >
- : detail::sectionalize::sectionalize_range
- <
- LineString,
- typename point_type<LineString>::type,
- Sections,
- DimensionCount,
- MaxCount
- >
-{};
-
-template
-<
- typename Range,
- typename Sections,
- std::size_t DimensionCount,
- std::size_t MaxCount
->
-struct sectionalize<ring_tag, Range, Sections, DimensionCount, MaxCount>
- : detail::sectionalize::sectionalize_range
- <
- Range,
- typename point_type<Range>::type,
- Sections,
- DimensionCount,
- MaxCount
- >
-{};
-
-template
-<
- typename Polygon,
- typename Sections,
- std::size_t DimensionCount,
- std::size_t MaxCount
->
-struct sectionalize<polygon_tag, Polygon, Sections, DimensionCount, MaxCount>
- : detail::sectionalize::sectionalize_polygon
- <
- Polygon, Sections, DimensionCount, MaxCount
- >
-{};
-
-} // namespace dispatch
-#endif
-
-
-/*!
- \brief Split a geometry into monotonic sections
- \ingroup sectionalize
- \tparam Geometry type of geometry to check
- \tparam Sections type of sections to create
- \param geometry geometry to create sections from
- \param sections structure with sections
-
- */
-template<typename Geometry, typename Sections>
-inline void sectionalize(Geometry const& geometry, Sections& sections)
-{
- concept::check<const Geometry>();
-
- // A maximum of 10 segments per section seems to give the fastest results
- static const std::size_t max_segments_per_section = 10;
- typedef dispatch::sectionalize
- <
- typename tag<Geometry>::type,
- Geometry,
- Sections,
- Sections::value,
- max_segments_per_section
- > sectionalizer_type;
-
- sections.clear();
- sectionalizer_type::apply(geometry, sections);
- int index = 0;
- for (typename boost::range_iterator<Sections>::type it = boost::begin(sections);
- it != boost::end(sections);
- ++it)
- {
- it->id = index++;
- }
-}
-
-
-}} // namespace boost::geometry
-
-
-#endif // BOOST_GEOMETRY_ALGORITHMS_SECTIONALIZE_HPP

Modified: sandbox/geometry/boost/geometry/geometry.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometry.hpp (original)
+++ sandbox/geometry/boost/geometry/geometry.hpp 2010-03-16 07:35:47 EDT (Tue, 16 Mar 2010)
@@ -41,6 +41,7 @@
 #include <boost/geometry/algorithms/convert.hpp>
 #include <boost/geometry/algorithms/convex_hull.hpp>
 #include <boost/geometry/algorithms/correct.hpp>
+#include <boost/geometry/algorithms/dissolve.hpp>
 #include <boost/geometry/algorithms/distance.hpp>
 #include <boost/geometry/algorithms/envelope.hpp>
 #include <boost/geometry/algorithms/for_each.hpp>
@@ -50,13 +51,16 @@
 #include <boost/geometry/algorithms/make.hpp>
 #include <boost/geometry/algorithms/num_points.hpp>
 #include <boost/geometry/algorithms/perimeter.hpp>
-#include <boost/geometry/algorithms/sectionalize.hpp>
 #include <boost/geometry/algorithms/simplify.hpp>
 #include <boost/geometry/algorithms/transform.hpp>
 #include <boost/geometry/algorithms/union.hpp>
 #include <boost/geometry/algorithms/unique.hpp>
 #include <boost/geometry/algorithms/within.hpp>
 
+#include <boost/geometry/algorithms/detail/sections/get_section.hpp>
+#include <boost/geometry/algorithms/detail/sections/sectionalize.hpp>
+
+
 // check includes all concepts
 #include <boost/geometry/geometries/concepts/check.hpp>
 

Copied: sandbox/geometry/boost/geometry/multi/algorithms/detail/sections/get_section.hpp (from r60608, /sandbox/geometry/boost/geometry/multi/algorithms/get_section.hpp)
==============================================================================
--- /sandbox/geometry/boost/geometry/multi/algorithms/get_section.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/algorithms/detail/sections/get_section.hpp 2010-03-16 07:35:47 EDT (Tue, 16 Mar 2010)
@@ -6,8 +6,8 @@
 // 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_GET_SECTION_HPP
-#define BOOST_GEOMETRY_MULTI_ALGORITHMS_GET_SECTION_HPP
+#ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_SECTIONS_GET_SECTION_HPP
+#define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_SECTIONS_GET_SECTION_HPP
 
 
 #include <boost/assert.hpp>
@@ -17,7 +17,7 @@
 
 #include <boost/geometry/multi/core/tags.hpp>
 
-#include <boost/geometry/algorithms/get_section.hpp>
+#include <boost/geometry/algorithms/detail/sections/get_section.hpp>
 
 
 namespace boost { namespace geometry
@@ -63,4 +63,4 @@
 }} // namespace boost::geometry
 
 
-#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_GET_SECTION_HPP
+#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_SECTIONS_GET_SECTION_HPP

Copied: sandbox/geometry/boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp (from r60608, /sandbox/geometry/boost/geometry/multi/algorithms/sectionalize.hpp)
==============================================================================
--- /sandbox/geometry/boost/geometry/multi/algorithms/sectionalize.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp 2010-03-16 07:35:47 EDT (Tue, 16 Mar 2010)
@@ -6,8 +6,8 @@
 // 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_SECTIONALIZE_HPP
-#define BOOST_GEOMETRY_MULTI_ALGORITHMS_SECTIONALIZE_HPP
+#ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_SECTIONS_SECTIONALIZE_HPP
+#define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_SECTIONS_SECTIONALIZE_HPP
 
 #include <cstddef>
 #include <vector>
@@ -16,8 +16,7 @@
 #include <boost/range/functions.hpp>
 #include <boost/range/metafunctions.hpp>
 
-#include <boost/geometry/algorithms/sectionalize.hpp>
-
+#include <boost/geometry/algorithms/detail/sections/sectionalize.hpp>
 
 
 namespace boost { namespace geometry
@@ -25,7 +24,8 @@
 
 
 #ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace sectionalize {
+namespace detail { namespace sectionalize
+{
 
 
 template <typename MultiGeometry, typename Sections, std::size_t DimensionCount, typename Policy>
@@ -45,8 +45,6 @@
 };
 
 
-
-
 }} // namespace detail::sectionalize
 #endif // DOXYGEN_NO_DETAIL
 
@@ -79,8 +77,7 @@
 #endif
 
 
-
-
 }} // namespace boost::geometry
 
-#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_SECTIONALIZE_HPP
+
+#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_SECTIONS_SECTIONALIZE_HPP

Deleted: sandbox/geometry/boost/geometry/multi/algorithms/get_section.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/algorithms/get_section.hpp 2010-03-16 07:35:47 EDT (Tue, 16 Mar 2010)
+++ (empty file)
@@ -1,66 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands.
-// Copyright Bruno Lalande 2008, 2009
-// 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_GET_SECTION_HPP
-#define BOOST_GEOMETRY_MULTI_ALGORITHMS_GET_SECTION_HPP
-
-
-#include <boost/assert.hpp>
-#include <boost/concept/requires.hpp>
-#include <boost/range/functions.hpp>
-#include <boost/range/metafunctions.hpp>
-
-#include <boost/geometry/multi/core/tags.hpp>
-
-#include <boost/geometry/algorithms/get_section.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace dispatch
-{
-
-
-template <typename MultiPolygon, typename Section>
-struct get_section<multi_polygon_tag, MultiPolygon, Section>
-{
- typedef typename boost::range_const_iterator
- <
- typename geometry::range_type<MultiPolygon>::type
- >::type iterator_type;
-
- static inline void apply(MultiPolygon const& multi_polygon,
- Section const& section,
- iterator_type& begin, iterator_type& end)
- {
- BOOST_ASSERT(
- section.multi_index >= 0
- && section.multi_index < boost::size(multi_polygon)
- );
-
- get_section
- <
- polygon_tag,
- typename boost::range_value<MultiPolygon>::type,
- Section
- >::apply(multi_polygon[section.multi_index], section, begin, end);
- }
-};
-
-
-} // namespace dispatch
-#endif
-
-
-}} // namespace boost::geometry
-
-
-#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_GET_SECTION_HPP

Modified: sandbox/geometry/boost/geometry/multi/algorithms/overlay/get_turns.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/algorithms/overlay/get_turns.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/algorithms/overlay/get_turns.hpp 2010-03-16 07:35:47 EDT (Tue, 16 Mar 2010)
@@ -10,12 +10,14 @@
 
 #include <boost/geometry/multi/core/is_multi.hpp>
 
+#include <boost/geometry/algorithms/overlay/get_turns.hpp>
+
 #include <boost/geometry/multi/algorithms/distance.hpp>
-#include <boost/geometry/multi/algorithms/get_section.hpp>
-#include <boost/geometry/multi/algorithms/sectionalize.hpp>
 #include <boost/geometry/multi/iterators/range_type.hpp>
 
-#include <boost/geometry/algorithms/overlay/get_turns.hpp>
+#include <boost/geometry/multi/algorithms/detail/sections/get_section.hpp>
+#include <boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp>
+
 
 
 namespace boost { namespace geometry

Deleted: sandbox/geometry/boost/geometry/multi/algorithms/sectionalize.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/algorithms/sectionalize.hpp 2010-03-16 07:35:47 EDT (Tue, 16 Mar 2010)
+++ (empty file)
@@ -1,86 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands.
-// Copyright Bruno Lalande 2008, 2009
-// 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_SECTIONALIZE_HPP
-#define BOOST_GEOMETRY_MULTI_ALGORITHMS_SECTIONALIZE_HPP
-
-#include <cstddef>
-#include <vector>
-
-#include <boost/concept/requires.hpp>
-#include <boost/range/functions.hpp>
-#include <boost/range/metafunctions.hpp>
-
-#include <boost/geometry/algorithms/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)
- {
- int multi_index = 0;
- for (typename boost::range_const_iterator<MultiGeometry>::type
- it = boost::begin(multi);
- it != boost::end(multi);
- ++it, ++multi_index)
- {
- Policy::apply(*it, sections, multi_index);
- }
- }
-};
-
-
-
-
-}} // namespace detail::sectionalize
-#endif // DOXYGEN_NO_DETAIL
-
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace dispatch
-{
-
-
-template <typename MultiPolygon, typename Sections, std::size_t DimensionCount, std::size_t MaxCount>
-struct sectionalize<multi_polygon_tag, MultiPolygon, Sections, DimensionCount, MaxCount>
- : detail::sectionalize::sectionalize_multi
- <
- MultiPolygon,
- Sections,
- DimensionCount,
- detail::sectionalize::sectionalize_polygon
- <
- typename boost::range_value<MultiPolygon>::type,
- Sections,
- DimensionCount,
- MaxCount
- >
- >
-
-{};
-
-
-} // namespace dispatch
-#endif
-
-
-
-
-}} // namespace boost::geometry
-
-#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_SECTIONALIZE_HPP

Modified: sandbox/geometry/boost/geometry/multi/multi.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/multi.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/multi.hpp 2010-03-16 07:35:47 EDT (Tue, 16 Mar 2010)
@@ -30,12 +30,10 @@
 #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/get_section.hpp>
 #include <boost/geometry/multi/algorithms/intersection.hpp>
 #include <boost/geometry/multi/algorithms/length.hpp>
 #include <boost/geometry/multi/algorithms/num_points.hpp>
 #include <boost/geometry/multi/algorithms/perimeter.hpp>
-#include <boost/geometry/multi/algorithms/sectionalize.hpp>
 #include <boost/geometry/multi/algorithms/simplify.hpp>
 #include <boost/geometry/multi/algorithms/transform.hpp>
 #include <boost/geometry/multi/algorithms/union.hpp>
@@ -44,10 +42,13 @@
 
 #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/get_section.hpp>
+#include <boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp>
+
 #include <boost/geometry/multi/algorithms/overlay/copy_segments.hpp>
 #include <boost/geometry/multi/algorithms/overlay/self_turn_points.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>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk