Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79641 - in trunk/boost/geometry: algorithms/detail extensions/algorithms/buffer
From: barend.gehrels_at_[hidden]
Date: 2012-07-21 14:18:51


Author: barendgehrels
Date: 2012-07-21 14:18:50 EDT (Sat, 21 Jul 2012)
New Revision: 79641
URL: http://svn.boost.org/trac/boost/changeset/79641

Log:
[geometry] Get rid of auto which was (temporary) inserted during creating buffer operations
Text files modified:
   trunk/boost/geometry/algorithms/detail/get_left_turns.hpp | 22 +++++++++++++---------
   trunk/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection.hpp | 39 +++++++++++++++++++++++++++------------
   2 files changed, 40 insertions(+), 21 deletions(-)

Modified: trunk/boost/geometry/algorithms/detail/get_left_turns.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/get_left_turns.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/get_left_turns.hpp 2012-07-21 14:18:50 EDT (Sat, 21 Jul 2012)
@@ -120,10 +120,10 @@
 
     bool result = false;
     std::pair<segment_identifier, segment_identifier> pair = ordered_pair(outgoing_seg_id, incoming_seg_id);
- auto it = turn_segment_indices.find(pair);
+ typename boost::range_iterator<TurnSegmentIndices const>::type it = turn_segment_indices.find(pair);
     if (it != turn_segment_indices.end())
     {
- for (auto sit = it->second.begin(); sit != it->second.end(); ++sit)
+ for (std::set<int>::const_iterator sit = it->second.begin(); sit != it->second.end(); ++sit)
         {
             if (process_include(outgoing_seg_id, incoming_seg_id, *sit, turns[*sit], keep_indices, priority))
             {
@@ -148,14 +148,17 @@
             std::set<int>& indices)
 {
     std::map<segment_identifier, int> map;
- for (auto sit = indices.begin(); sit != indices.end(); ++sit)
+ for (std::set<int>::const_iterator sit = indices.begin();
+ sit != indices.end();
+ ++sit)
     {
         map[turns[*sit].operations[0].seg_id]++;
         map[turns[*sit].operations[1].seg_id]++;
     }
 
     std::set<segment_identifier> segment_occuring_once;
- for (auto mit = map.begin(); mit != map.end(); ++mit)
+ for (std::map<segment_identifier, int>::const_iterator mit = map.begin();
+ mit != map.end();++mit)
     {
         if (mit->second == 1)
         {
@@ -176,13 +179,14 @@
         segment_identifier back = *soo_it;
 
         std::pair<segment_identifier, segment_identifier> pair = ordered_pair(front, back);
- auto it = turn_segment_indices.find(pair);
+
+ typename boost::range_iterator<TurnSegmentIndices const>::type it = turn_segment_indices.find(pair);
         if (it != turn_segment_indices.end())
         {
             // debug_turns_by_indices("Found", it->second);
             // Check which is the union/continue
             segment_identifier good;
- for (auto sit = it->second.begin(); sit != it->second.end(); ++sit)
+ for (std::set<int>::const_iterator sit = it->second.begin(); sit != it->second.end(); ++sit)
             {
                 if (turns[*sit].operations[0].operation == detail::overlay::operation_union)
                 {
@@ -200,7 +204,7 @@
 
             // Find in indexes-to-keep this segment with the union. Discard the other one
             std::set<int> ok_indices;
- for (auto sit = indices.begin(); sit != indices.end(); ++sit)
+ for (std::set<int>::const_iterator sit = indices.begin(); sit != indices.end(); ++sit)
             {
                 if (corresponds<0>(turns[*sit], good) || corresponds<1>(turns[*sit], good))
                 {
@@ -223,7 +227,7 @@
 {
     // Find max prio
     int min_prio = 1024, max_prio = 0;
- for (auto sit = indices.begin(); sit != indices.end(); ++sit)
+ for (std::set<int>::const_iterator sit = indices.begin(); sit != indices.end(); ++sit)
     {
         if (turns[*sit].priority > max_prio)
         {
@@ -242,7 +246,7 @@
 
     // Only keep indices with high prio
     std::set<int> ok_indices;
- for (auto sit = indices.begin(); sit != indices.end(); ++sit)
+ for (std::set<int>::const_iterator sit = indices.begin(); sit != indices.end(); ++sit)
     {
         if (turns[*sit].priority >= max_prio)
         {

Modified: trunk/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection.hpp 2012-07-21 14:18:50 EDT (Sat, 21 Jul 2012)
@@ -28,14 +28,22 @@
 #include <boost/geometry/extensions/algorithms/buffer/buffer_policies.hpp>
 #include <boost/geometry/extensions/algorithms/buffer/side_on_convex_range.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/calculate_distance_policy.hpp>
 #include <boost/geometry/algorithms/detail/overlay/enrichment_info.hpp>
+#include <boost/geometry/algorithms/detail/overlay/ring_properties.hpp>
 #include <boost/geometry/algorithms/detail/overlay/traversal_info.hpp>
 #include <boost/geometry/algorithms/detail/overlay/traverse.hpp>
 #include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
 #include <boost/geometry/algorithms/detail/occupation_info.hpp>
 #include <boost/geometry/algorithms/detail/partition.hpp>
 
+#ifdef BOOST_GEOMETRY_DEBUG_BUFFER_OCCUPATION
+# include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp>
+# include <boost/geometry/io/wkt/wkt.hpp>
+#endif
+
 
 namespace boost { namespace geometry
 {
@@ -396,7 +404,7 @@
         }
 
                 int flat_ends_involved = 0;
- for (int i = 0; i < boost::size(turn.operations); i++)
+ for (int i = 0; i < int(boost::size(turn.operations)); i++)
         {
                         // Don't check any turn against a piece of which is itself the result
                         if (turn.operations[i].piece_index == pc.index)
@@ -486,7 +494,7 @@
     {
 #ifdef BOOST_GEOMETRY_DEBUG_BUFFER_OCCUPATION
         std::cout << caption << ": " << indices.size() << std::endl;
- for (auto sit = indices.begin(); sit != indices.end(); ++sit)
+ for (std::set<int>::const_iterator sit = indices.begin(); sit != indices.end(); ++sit)
         {
             int const index = *sit;
             std::cout << "Keep " << index // << "[" << sit->second << "]"
@@ -675,8 +683,9 @@
 #ifdef BOOST_GEOMETRY_DEBUG_BUFFER_SITUATION_MAP
         inline int get_side(point_type const& point, Ring const& ring, int segment_index)
         {
- auto it = boost::begin(ring) + segment_index;
- auto prev = it++;
+ typedef typename boost::range_iterator<Ring const> iterator_type;
+ iterator_type it = boost::begin(ring) + segment_index;
+ iterator_type prev = it++;
                 return side_strategy::apply(point, *prev, *it);
         }
 #endif
@@ -690,14 +699,16 @@
 
         inline int get_side(segment_identifier const& seg_id1, segment_identifier const& seg_id2, int which = 1) const
         {
+ typedef typename boost::range_iterator<Ring const>::type iterator_type;
+
         Ring const& ring1 = offsetted_rings[seg_id1.multi_index];
         Ring const& ring2 = offsetted_rings[seg_id2.multi_index];
 
- auto it1 = boost::begin(ring1) + seg_id1.segment_index;
- auto it2 = boost::begin(ring2) + seg_id2.segment_index;
+ iterator_type it1 = boost::begin(ring1) + seg_id1.segment_index;
+ iterator_type it2 = boost::begin(ring2) + seg_id2.segment_index;
 
- auto prev1 = it1++;
- auto prev2 = it2++;
+ iterator_type prev1 = it1++;
+ iterator_type prev2 = it2++;
 
                 int code1 = side_strategy::apply(select_for_side(prev1, it1, which), *prev2, *it2);
                 int code2 = side_strategy::apply(select_for_side(prev2, it2, which), *prev1, *it1);
@@ -777,7 +788,8 @@
         {
                 bool result = false;
         //if (cluster.intersecting_ids.count(seg_id) > 0)
- for(auto it = cluster.intersecting_segments.begin(); it != cluster.intersecting_segments.end(); it++)
+ typedef typename boost::range_iterator<std::vector<cluster_info> const>::type iterator_type;
+ for(iterator_type it = cluster.intersecting_segments.begin(); it != cluster.intersecting_segments.end(); it++)
                 {
                         if (it->operation.seg_id == seg_id)
                         {
@@ -829,12 +841,15 @@
 
         inline void add_mutual_intersections(clustered_info const& cluster, std::map<segment_identifier, clustered_info> const& map)
         {
- for(auto it1 = cluster.intersecting_segments.begin(); it1 != cluster.intersecting_segments.end(); it1++)
+ typedef std::map<segment_identifier, clustered_info> map_type;
+ typedef typename boost::range_iterator<map_type const>::type map_it;
+ typedef typename boost::range_iterator<std::vector<cluster_info> const>::type cluster_it;
+ for(cluster_it it1 = cluster.intersecting_segments.begin(); it1 != cluster.intersecting_segments.end(); it1++)
                 {
- auto const& other_cluster_it = map.find(it1->operation.seg_id);
+ map_it const& other_cluster_it = map.find(it1->operation.seg_id);
                         if (other_cluster_it != map.end())
                         {
- for(auto it2 = it1 + 1; it2 != cluster.intersecting_segments.end(); it2++)
+ for(cluster_it it2 = it1 + 1; it2 != cluster.intersecting_segments.end(); it2++)
                                 {
                                         if (! m_occupation_map.contains_turn_index(it1->turn_index)
                                                 || ! m_occupation_map.contains_turn_index(it2->turn_index))


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