Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69519 - trunk/boost/geometry/extensions/algorithms
From: barend.gehrels_at_[hidden]
Date: 2011-03-03 11:17:48


Author: barendgehrels
Date: 2011-03-03 11:17:47 EST (Thu, 03 Mar 2011)
New Revision: 69519
URL: http://svn.boost.org/trac/boost/changeset/69519

Log:
Fixed behaviour of new approach for dissolve
Text files modified:
   trunk/boost/geometry/extensions/algorithms/dissolve.hpp | 31 ++++++++++++++++++++++++++++---
   1 files changed, 28 insertions(+), 3 deletions(-)

Modified: trunk/boost/geometry/extensions/algorithms/dissolve.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/dissolve.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/dissolve.hpp 2011-03-03 11:17:47 EST (Thu, 03 Mar 2011)
@@ -26,7 +26,11 @@
 
 #include <boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp>
 #include <boost/geometry/algorithms/detail/overlay/traverse.hpp>
-#include <boost/geometry/algorithms/detail/overlay/assemble.hpp>
+
+#include <boost/geometry/algorithms/detail/overlay/add_rings.hpp>
+#include <boost/geometry/algorithms/detail/overlay/assign_parents.hpp>
+#include <boost/geometry/algorithms/detail/overlay/ring_properties.hpp>
+#include <boost/geometry/algorithms/detail/overlay/select_rings.hpp>
 
 #include <boost/geometry/algorithms/convert.hpp>
 
@@ -102,8 +106,29 @@
 
             std::map<ring_identifier, int> map;
             map_turns(map, turns);
- return detail::overlay::assemble<GeometryOut>(rings, map,
- geometry, geometry, overlay_dissolve, true, false, out);
+
+ typedef detail::overlay::ring_properties<typename geometry::point_type<Geometry>::type> properties;
+
+ std::map<ring_identifier, properties> selected;
+
+ detail::overlay::select_rings<overlay_union>(geometry, map, selected);
+
+ // Add intersected rings
+ {
+ ring_identifier id(2, 0, -1);
+ for (typename boost::range_iterator<std::vector<ring_type> const>::type
+ it = boost::begin(rings);
+ it != boost::end(rings);
+ ++it)
+ {
+ selected[id] = properties(*it);
+ id.multi_index++;
+ }
+ }
+
+ detail::overlay::assign_parents(geometry, rings, selected);
+ return detail::overlay::add_rings<GeometryOut>(selected, geometry, rings, out);
+
         }
         else
         {


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