|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r69943 - in trunk/boost/geometry: algorithms algorithms/detail/overlay algorithms/detail/sections extensions/algorithms extensions/algorithms/buffer extensions/algorithms/detail/overlay multi/algorithms/detail/sections
From: barend.gehrels_at_[hidden]
Date: 2011-03-13 10:46:12
Author: barendgehrels
Date: 2011-03-13 10:46:07 EDT (Sun, 13 Mar 2011)
New Revision: 69943
URL: http://svn.boost.org/trac/boost/changeset/69943
Log:
Revised get_turns using partition instead of own implementation
Changed section to make use of ring_identifier instead of own indexes
Cleanup in using boost::geometry:: inside sources
Text files modified:
trunk/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp | 4
trunk/boost/geometry/algorithms/detail/overlay/get_turns.hpp | 254 ++++++++++++---------------------------
trunk/boost/geometry/algorithms/detail/overlay/overlay.hpp | 14 +-
trunk/boost/geometry/algorithms/detail/sections/range_by_section.hpp | 4
trunk/boost/geometry/algorithms/detail/sections/sectionalize.hpp | 42 +++---
trunk/boost/geometry/algorithms/intersection_inserter.hpp | 2
trunk/boost/geometry/extensions/algorithms/buffer/polygon_buffer.hpp | 2
trunk/boost/geometry/extensions/algorithms/buffer/splitting_buffer.hpp | 2
trunk/boost/geometry/extensions/algorithms/connect.hpp | 2
trunk/boost/geometry/extensions/algorithms/detail/overlay/split_rings.hpp | 4
trunk/boost/geometry/extensions/algorithms/mark_spikes.hpp | 6
trunk/boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp | 6
trunk/boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp | 8
13 files changed, 130 insertions(+), 220 deletions(-)
Modified: trunk/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp 2011-03-13 10:46:07 EDT (Sun, 13 Mar 2011)
@@ -33,9 +33,9 @@
static inline void apply(Info& info, Point1 const& p1, Point2 const& p2)
{
info.operations[0].enriched.distance
- = boost::geometry::distance(info.point, p1);
+ = geometry::distance(info.point, p1);
info.operations[1].enriched.distance
- = boost::geometry::distance(info.point, p2);
+ = geometry::distance(info.point, p2);
}
};
Modified: trunk/boost/geometry/algorithms/detail/overlay/get_turns.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/get_turns.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/get_turns.hpp 2011-03-13 10:46:07 EDT (Sun, 13 Mar 2011)
@@ -43,6 +43,7 @@
#include <boost/geometry/strategies/intersection_result.hpp>
#include <boost/geometry/algorithms/detail/disjoint.hpp>
+#include <boost/geometry/algorithms/detail/partition.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_turn_info.hpp>
#include <boost/geometry/algorithms/detail/overlay/segment_identifier.hpp>
@@ -151,8 +152,8 @@
bool const same_source =
source_id1 == source_id2
- && sec1.multi_index == sec2.multi_index
- && sec1.ring_index == sec2.ring_index;
+ && sec1.ring_id.multi_index == sec2.ring_id.multi_index
+ && sec1.ring_id.ring_index == sec2.ring_id.ring_index;
range1_iterator prev1, it1, end1;
@@ -222,9 +223,9 @@
turn_info ti;
ti.operations[0].seg_id = segment_identifier(source_id1,
- sec1.multi_index, sec1.ring_index, index1),
+ sec1.ring_id.multi_index, sec1.ring_id.ring_index, index1),
ti.operations[1].seg_id = segment_identifier(source_id2,
- sec2.multi_index, sec2.ring_index, index2),
+ sec2.ring_id.multi_index, sec2.ring_id.ring_index, index2),
ti.operations[0].other_id = ti.operations[1].seg_id;
ti.operations[1].other_id = ti.operations[0].seg_id;
@@ -319,7 +320,23 @@
}
};
+struct get_section_box
+{
+ template <typename Box, typename InputItem>
+ static inline void apply(Box& total, InputItem const& item)
+ {
+ geometry::expand(total, item.bounding_box);
+ }
+};
+struct ovelaps_section_box
+{
+ template <typename Box, typename InputItem>
+ static inline bool apply(Box const& box, InputItem const& item)
+ {
+ return ! detail::disjoint::disjoint_box_box(box, item.bounding_box);
+ }
+};
template
<
@@ -329,155 +346,54 @@
typename TurnPolicy,
typename InterruptPolicy
>
-class get_turns_generic
+struct section_visitor
{
- template <typename Box, typename Sections>
- static inline void add_sections(Box& box, Sections const& sections)
- {
- for (typename boost::range_iterator<Sections const>::type
- it = sections.begin();
- it != sections.end();
- ++it)
- {
- geometry::expand(box, it->bounding_box);
- }
- }
-
- template <typename Sections, typename Box>
- static inline void get_sections(Sections const& sections,
- Box const& box, Sections& selection)
- {
- for (typename boost::range_iterator<Sections const>::type
- it = sections.begin();
- it != sections.end();
- ++it)
- {
- if (! geometry::detail::disjoint::disjoint_box_box(box, it->bounding_box))
- {
- selection.push_back(*it);
- }
- }
- }
-
- template <typename Sections1, typename Sections2, typename Map>
- static inline bool intersect(
- int source_id1, Geometry1 const& geometry1,
- int source_id2, Geometry2 const& geometry2,
- Turns& turns,
- InterruptPolicy& interrupt_policy,
- Sections1 const& sec1, Sections2 const& sec2,
- Map& map)
- {
- for (typename boost::range_iterator<Sections1 const>::type
- it1 = sec1.begin();
- it1 != sec1.end();
- ++it1)
- {
- for (typename boost::range_iterator<Sections2 const>::type
- it2 = sec2.begin();
- it2 != sec2.end();
- ++it2)
- {
- std::pair<int, int> p = std::make_pair(it1->id, it2->id);
- bool processed = map[p];
- if (! processed)
- {
- map[p] = true;
- if (! geometry::detail::disjoint::disjoint_box_box(
- it1->bounding_box, it2->bounding_box))
- {
- if (! get_turns_in_sections
- <
- Geometry1,
- Geometry2,
- Reverse1, Reverse2,
- typename boost::range_value<Sections1>::type,
- typename boost::range_value<Sections2>::type,
- Turns,
- TurnPolicy,
- InterruptPolicy
- >::apply(
- source_id1, geometry1, *it1,
- source_id2, geometry2, *it2,
- turns, interrupt_policy)
- )
- {
- return false;
- }
- }
- }
- }
- }
- return true;
+ int m_source_id1;
+ Geometry1 const& m_geometry1;
+ int m_source_id2;
+ Geometry2 const& m_geometry2;
+ Turns& m_turns;
+ InterruptPolicy& m_interrupt_policy;
+
+ section_visitor(int id1, Geometry1 const& g1,
+ int id2, Geometry2 const& g2,
+ Turns& turns, InterruptPolicy& ip)
+ : m_source_id1(id1), m_geometry1(g1)
+ , m_source_id2(id2), m_geometry2(g2)
+ , m_turns(turns)
+ , m_interrupt_policy(ip)
+ {}
+
+ template <typename Section>
+ inline bool apply(Section const& sec1, Section const& sec2)
+ {
+ return get_turns_in_sections
+ <
+ Geometry1,
+ Geometry2,
+ Reverse1, Reverse2,
+ Section, Section,
+ Turns,
+ TurnPolicy,
+ InterruptPolicy
+ >::apply(
+ m_source_id1, m_geometry1, sec1,
+ m_source_id2, m_geometry2, sec2,
+ m_turns, m_interrupt_policy);
}
+};
- // Divide and conquer (suggested by Luke during Boost.Geometry Formal Review)
- template
- <
- std::size_t Dimension,
- typename Box,
- typename Sections1, typename Sections2,
- typename Map
- >
- static inline bool divide_and_conquer(
- int source_id1, Geometry1 const& geometry1,
- int source_id2, Geometry2 const& geometry2,
- Turns& turns,
- InterruptPolicy& interrupt_policy,
-
- Box const& box,
- Sections1 const& sec1, Sections2 const& sec2,
- Map& map,
- std::size_t iteration = 0, std::size_t previous_count = 0)
- {
- // To stop the iteration, fallback to (quadratic) behaviour below certain limits,
- // or if dividing does not give any profit.
- std::size_t n = sec1.size() + sec2.size();
- if (sec1.size() < 5
- || sec2.size() < 5
- || n == previous_count
- || iteration > 100)
- {
- return intersect(source_id1, geometry1, source_id2, geometry2,
- turns, interrupt_policy, sec1, sec2, map);
- }
-
- // Divide the complete box in two (alternating) halves
- Box lower = box, upper = box;
- typename geometry::coordinate_type<Box>::type two = 2;
- typename geometry::coordinate_type<Box>::type mid
- = (geometry::get<min_corner, Dimension>(box)
- + geometry::get<max_corner, Dimension>(box)) / two;
-
- geometry::set<max_corner, Dimension>(lower, mid);
- geometry::set<min_corner, Dimension>(upper, mid);
-
- Sections1 lower1, upper1;
- Sections2 lower2, upper2;
- get_sections(sec1, lower, lower1);
- get_sections(sec2, lower, lower2);
- get_sections(sec1, upper, upper1);
- get_sections(sec2, upper, upper2);
-
-#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION_DIVIDE_AND_CONQUER
- std::cout
- << "Get IP's, iteration: " << iteration
- << " box: " << geometry::dsv(box)
- << " n: " << n
- << " lower: " << lower1.size() << " , " << lower2.size()
- << " upper: " << upper1.size() << " , " << upper2.size()
- << std::endl;
-#endif
-
- // Recursively handle lower and upper half, dividing in other dimension
- return divide_and_conquer<1 - Dimension>(source_id1, geometry1,
- source_id2, geometry2, turns, interrupt_policy,
- lower, lower1, lower2, map, iteration + 1, n)
- && divide_and_conquer<1 - Dimension>(source_id1, geometry1,
- source_id2, geometry2, turns, interrupt_policy,
- upper, upper1, upper2, map, iteration + 1, n);
- }
+template
+<
+ typename Geometry1, typename Geometry2,
+ bool Reverse1, bool Reverse2,
+ typename Turns,
+ typename TurnPolicy,
+ typename InterruptPolicy
+>
+class get_turns_generic
+{
public:
static inline void apply(
@@ -485,35 +401,29 @@
int source_id2, Geometry2 const& geometry2,
Turns& turns, InterruptPolicy& interrupt_policy)
{
- // Create monotonic sections in ONE direction
- // - in most cases ONE direction is faster (e.g. ~1% faster for the NLP4 testset)
- // - the sections now have a limit (default 10) so will not be too large
-
- // Note that the sections contain boxes, are dynamic, and therefore
- // are specified using output/intersection-point-type
- // (to enable input-pointer-point-types)
+ // First create monotonic sections...
typedef typename boost::range_value<Turns>::type ip_type;
typedef typename ip_type::point_type point_type;
- typedef typename geometry::sections<model::box<point_type>, 1> sections1_type;
- typedef typename geometry::sections<model::box<point_type>, 1> sections2_type;
+ typedef model::box<point_type> box_type;
+ typedef typename geometry::sections<box_type, 2> sections_type;
- sections1_type sec1;
- sections2_type sec2;
+ sections_type sec1, sec2;
- geometry::sectionalize<Reverse1>(geometry1, sec1);
- geometry::sectionalize<Reverse2>(geometry2, sec2);
+ geometry::sectionalize<Reverse1>(geometry1, sec1, 0);
+ geometry::sectionalize<Reverse2>(geometry2, sec2, 1);
- // Divide and conquer
- model::box<point_type> box;
- geometry::assign_inverse(box);
- add_sections(box, sec1);
- add_sections(box, sec2);
-
- // House-keeping map, to avoid section-pairs being compared twice
- std::map<std::pair<int, int>, bool> map;
+ // ... and then partition them, intersecting overlapping sections in visitor method
+ section_visitor
+ <
+ Geometry1, Geometry2,
+ Reverse1, Reverse2,
+ Turns, TurnPolicy, InterruptPolicy
+ > visitor(source_id1, geometry1, source_id2, geometry2, turns, interrupt_policy);
- divide_and_conquer<1>(source_id1, geometry1, source_id2, geometry2,
- turns, interrupt_policy, box, sec1, sec2, map);
+ geometry::partition
+ <
+ box_type, get_section_box, ovelaps_section_box
+ >::apply(sec1, sec2, visitor, 2);
}
};
Modified: trunk/boost/geometry/algorithms/detail/overlay/overlay.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/overlay.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/overlay.hpp 2011-03-13 10:46:07 EDT (Sun, 13 Mar 2011)
@@ -99,7 +99,7 @@
typename Geometry1, typename Geometry2,
typename OutputIterator
>
-inline OutputIterator return_if_one_input_is_empty(Geometry1 const& geometry1,
+inline OutputIterator return_if_one_input_is_empty(Geometry1 const& geometry1,
Geometry2 const& geometry2,
OutputIterator out)
{
@@ -154,7 +154,7 @@
// "Use" rangetype for ringtype:
// -> for polygon, it is the type of the exterior ring.
- // -> for ring, it is the ring itself.
+ // -> for ring, it is the ring itself.
// -> for multi-polygon, it is also the type of the ring.
typedef typename geometry::range_type<GeometryOut>::type ring_type;
typedef std::deque<ring_type> ring_container_type;
@@ -178,7 +178,7 @@
std::cout << "get turns" << std::endl;
#endif
detail::get_turns::no_interrupt_policy policy;
- boost::geometry::get_turns
+ geometry::get_turns
<
Reverse1, Reverse2,
detail::overlay::calculate_distance_policy
@@ -194,8 +194,8 @@
typename Strategy::side_strategy_type side_strategy;
geometry::enrich_intersection_points<Reverse1, Reverse2>(turn_points,
Direction == overlay_union
- ? boost::geometry::detail::overlay::operation_union
- : boost::geometry::detail::overlay::operation_intersection,
+ ? geometry::detail::overlay::operation_union
+ : geometry::detail::overlay::operation_intersection,
geometry1, geometry2,
side_strategy);
@@ -213,8 +213,8 @@
ring_container_type rings;
geometry::traverse<Reverse1, Reverse2>(geometry1, geometry2,
Direction == overlay_union
- ? boost::geometry::detail::overlay::operation_union
- : boost::geometry::detail::overlay::operation_intersection,
+ ? geometry::detail::overlay::operation_union
+ : geometry::detail::overlay::operation_intersection,
turn_points, rings);
#ifdef BOOST_GEOMETRY_TIME_OVERLAY
Modified: trunk/boost/geometry/algorithms/detail/sections/range_by_section.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/sections/range_by_section.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/sections/range_by_section.hpp 2011-03-13 10:46:07 EDT (Sun, 13 Mar 2011)
@@ -42,9 +42,9 @@
{
static inline typename ring_return_type<Polygon const>::type apply(Polygon const& polygon, Section const& section)
{
- return section.ring_index < 0
+ return section.ring_id.ring_index < 0
? geometry::exterior_ring(polygon)
- : geometry::interior_rings(polygon)[section.ring_index];
+ : geometry::interior_rings(polygon)[section.ring_id.ring_index];
}
};
Modified: trunk/boost/geometry/algorithms/detail/sections/sectionalize.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/sections/sectionalize.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/sections/sectionalize.hpp 2011-03-13 10:46:07 EDT (Sun, 13 Mar 2011)
@@ -19,6 +19,8 @@
#include <boost/geometry/algorithms/assign.hpp>
#include <boost/geometry/algorithms/expand.hpp>
+#include <boost/geometry/algorithms/detail/ring_identifier.hpp>
+
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/closure.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
@@ -52,11 +54,10 @@
typedef Box box_type;
// unique ID used in get_turns to mark section-pairs already handled.
- int id;
+ int id; // might be obsolete now, BSG 14-03-2011 TODO decide about this
int directions[DimensionCount];
- int ring_index;
- int multi_index;
+ ring_identifier ring_id;
Box bounding_box;
int begin_index;
@@ -68,8 +69,6 @@
inline section()
: id(-1)
- , ring_index(-99)
- , multi_index(-99)
, begin_index(-1)
, end_index(-1)
, count(0)
@@ -248,7 +247,7 @@
static inline void apply(Sections& sections, section_type& section,
int& index, int& ndi,
Range const& range,
- int ring_index = -1, int multi_index = -1)
+ ring_identifier ring_id)
{
if (boost::size(range) <= index)
{
@@ -319,8 +318,7 @@
if (section.count == 0)
{
section.begin_index = index;
- section.ring_index = ring_index;
- section.multi_index = multi_index;
+ section.ring_id = ring_id;
section.duplicate = duplicate;
section.non_duplicate_index = ndi;
section.range_count = boost::size(range);
@@ -361,8 +359,8 @@
Reverse ? iterate_reverse : iterate_forward
>::type view_type;
- static inline void apply(Range const& range, Sections& sections,
- int ring_index = -1, int multi_index = -1)
+ static inline void apply(Range const& range, Sections& sections,
+ ring_identifier ring_id)
{
typedef model::referring_segment<Point const> segment_type;
@@ -393,7 +391,7 @@
view_type, Point, Sections,
DimensionCount, MaxCount
>::apply(sections, section, index, ndi,
- view, ring_index, multi_index);
+ view, ring_id);
// Add last section if applicable
if (section.count > 0)
@@ -414,7 +412,7 @@
struct sectionalize_polygon
{
static inline void apply(Polygon const& poly, Sections& sections,
- int multi_index = -1)
+ ring_identifier ring_id)
{
typedef typename point_type<Polygon>::type point_type;
typedef typename ring_type<Polygon>::type ring_type;
@@ -424,16 +422,16 @@
point_type, Sections, DimensionCount, MaxCount
> sectionalizer_type;
- sectionalizer_type::apply(exterior_ring(poly), sections, -1, multi_index);
-
- int i = 0;
+ ring_id.ring_index = -1;
+ sectionalizer_type::apply(exterior_ring(poly), sections, ring_id);//-1, multi_index);
+ ring_id.ring_index++;
typename interior_return_type<Polygon const>::type rings
= interior_rings(poly);
for (BOOST_AUTO(it, boost::begin(rings)); it != boost::end(rings);
- ++it, ++i)
+ ++it, ++ring_id.ring_index)
{
- sectionalizer_type::apply(*it, sections, i, multi_index);
+ sectionalizer_type::apply(*it, sections, ring_id);
}
}
};
@@ -447,7 +445,7 @@
>
struct sectionalize_box
{
- static inline void apply(Box const& box, Sections& sections)
+ static inline void apply(Box const& box, Sections& sections, ring_identifier const& ring_id)
{
typedef typename point_type<Box>::type point_type;
@@ -476,7 +474,7 @@
Sections,
DimensionCount,
MaxCount
- >::apply(points, sections);
+ >::apply(points, sections, ring_id);
}
};
@@ -612,7 +610,7 @@
*/
template<bool Reverse, typename Geometry, typename Sections>
-inline void sectionalize(Geometry const& geometry, Sections& sections)
+inline void sectionalize(Geometry const& geometry, Sections& sections, int source_index = 0)
{
concept::check<Geometry const>();
@@ -629,7 +627,9 @@
> sectionalizer_type;
sections.clear();
- sectionalizer_type::apply(geometry, sections);
+ ring_identifier ring_id;
+ ring_id.source_index = source_index;
+ sectionalizer_type::apply(geometry, sections, ring_id);
detail::sectionalize::set_section_unique_ids(sections);
}
Modified: trunk/boost/geometry/algorithms/intersection_inserter.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/intersection_inserter.hpp (original)
+++ trunk/boost/geometry/algorithms/intersection_inserter.hpp 2011-03-13 10:46:07 EDT (Sun, 13 Mar 2011)
@@ -286,7 +286,7 @@
static inline OutputIterator apply(Segment const& segment,
Box const& box, OutputIterator out, Strategy const& strategy)
{
- typedef boost::geometry::segment_range<Segment> range_type;
+ typedef geometry::segment_range<Segment> range_type;
range_type range(segment);
typedef typename point_type<GeometryOut>::type point_type;
Modified: trunk/boost/geometry/extensions/algorithms/buffer/polygon_buffer.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/buffer/polygon_buffer.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/buffer/polygon_buffer.hpp 2011-03-13 10:46:07 EDT (Sun, 13 Mar 2011)
@@ -191,7 +191,7 @@
#endif
)
{
- boost::geometry::clear(buffered);
+ geometry::clear(buffered);
typedef typename ring_type<PolygonInput>::type input_ring_type;
typedef typename ring_type<PolygonOutput>::type output_ring_type;
Modified: trunk/boost/geometry/extensions/algorithms/buffer/splitting_buffer.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/buffer/splitting_buffer.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/buffer/splitting_buffer.hpp 2011-03-13 10:46:07 EDT (Sun, 13 Mar 2011)
@@ -77,7 +77,7 @@
std::vector<ring_type> rings;
BOOST_FOREACH(GeometryOut const& polygon, buffered)
{
-//std::cout << bg::wkt(polygon) << " ; POLYGON" << std::endl;
+//std::cout << geometry::wkt(polygon) << " ; POLYGON" << std::endl;
geometry::split_rings(polygon, rings);
}
Modified: trunk/boost/geometry/extensions/algorithms/connect.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/connect.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/connect.hpp 2011-03-13 10:46:07 EDT (Sun, 13 Mar 2011)
@@ -69,7 +69,7 @@
<
Point,
std::vector<node<Point> >,
- boost::geometry::less<Point>
+ geometry::less<Point>
> map_type;
typedef typename map_type::const_iterator map_iterator_type;
Modified: trunk/boost/geometry/extensions/algorithms/detail/overlay/split_rings.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/detail/overlay/split_rings.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/detail/overlay/split_rings.hpp 2011-03-13 10:46:07 EDT (Sun, 13 Mar 2011)
@@ -263,9 +263,9 @@
static inline void apply(Info& info, Point1 const& p1, Point2 const& p2)
{
info.operations[0].distance
- = boost::geometry::distance(info.point, p1);
+ = geometry::distance(info.point, p1);
info.operations[1].distance
- = boost::geometry::distance(info.point, p2);
+ = geometry::distance(info.point, p2);
}
};
Modified: trunk/boost/geometry/extensions/algorithms/mark_spikes.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/mark_spikes.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/mark_spikes.hpp 2011-03-13 10:46:07 EDT (Sun, 13 Mar 2011)
@@ -187,9 +187,9 @@
// Divide polygon in monotonic sections (in two directions)
typedef model::box<point_type> box_type;
- typedef boost::geometry::sections<box_type, 2> sections_type;
+ typedef geometry::sections<box_type, 2> sections_type;
sections_type sections;
- boost::geometry::sectionalize<false>(range, sections);
+ geometry::sectionalize<false>(range, sections);
for (typename boost::range_iterator<sections_type>::type it = boost::begin(sections);
it != boost::end(sections);
@@ -197,7 +197,7 @@
{
// Enlarge each box with the wished max with of the gap to be sure that
// when walking through sections all point-pairs are considered
- boost::geometry::buffer(it->bounding_box, it->bounding_box, policy.gap_width() * 1.001);
+ geometry::buffer(it->bounding_box, it->bounding_box, policy.gap_width() * 1.001);
}
double const whole_area = geometry::area(range);
Modified: trunk/boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/detail/sections/range_by_section.hpp 2011-03-13 10:46:07 EDT (Sun, 13 Mar 2011)
@@ -39,11 +39,11 @@
{
BOOST_ASSERT
(
- section.multi_index >= 0
- && section.multi_index < boost::size(multi)
+ section.ring_id.multi_index >= 0
+ && section.ring_id.multi_index < boost::size(multi)
);
- return Policy::apply(multi[section.multi_index], section);
+ return Policy::apply(multi[section.ring_id.multi_index], section);
}
};
Modified: trunk/boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp 2011-03-13 10:46:07 EDT (Sun, 13 Mar 2011)
@@ -30,15 +30,15 @@
template <typename MultiGeometry, typename Sections, std::size_t DimensionCount, typename Policy>
struct sectionalize_multi
{
- static inline void apply(MultiGeometry const& multi, Sections& sections)
+ static inline void apply(MultiGeometry const& multi, Sections& sections, ring_identifier ring_id)
{
- int multi_index = 0;
+ ring_id.multi_index = 0;
for (typename boost::range_iterator<MultiGeometry const>::type
it = boost::begin(multi);
it != boost::end(multi);
- ++it, ++multi_index)
+ ++it, ++ring_id.multi_index)
{
- Policy::apply(*it, sections, multi_index);
+ Policy::apply(*it, sections, ring_id);
}
}
};
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