Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84044 - in trunk/boost/geometry/extensions: algorithms/buffer strategies
From: adam.wulkiewicz_at_[hidden]
Date: 2013-04-25 06:41:04


Author: awulkiew
Date: 2013-04-25 06:41:03 EDT (Thu, 25 Apr 2013)
New Revision: 84044
URL: http://svn.boost.org/trac/boost/changeset/84044

Log:
geometry extensions: tabs replaced by spaces.
Text files modified:
   trunk/boost/geometry/extensions/algorithms/buffer/buffer_inserter.hpp | 64 ++++++------
   trunk/boost/geometry/extensions/algorithms/buffer/buffer_policies.hpp | 22 ++--
   trunk/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection_with_mapper.hpp | 190 ++++++++++++++++++++--------------------
   trunk/boost/geometry/extensions/algorithms/buffer/multi_buffer_inserter.hpp | 6
   trunk/boost/geometry/extensions/algorithms/buffer/side_on_convex_range.hpp | 12 +-
   trunk/boost/geometry/extensions/strategies/buffer_end_round.hpp | 4
   6 files changed, 149 insertions(+), 149 deletions(-)

Modified: trunk/boost/geometry/extensions/algorithms/buffer/buffer_inserter.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/buffer/buffer_inserter.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/buffer/buffer_inserter.hpp 2013-04-25 06:41:03 EDT (Thu, 25 Apr 2013)
@@ -202,7 +202,7 @@
 
 template
 <
- typename Point,
+ typename Point,
     typename RingOutput
>
 struct buffer_point
@@ -222,15 +222,15 @@
>::type promoted_type;
 
 
- template <typename RangeOut>
+ template <typename RangeOut>
     static inline void generate_points(Point const& point,
                 promoted_type const& buffer_distance,
                 RangeOut& range_out)
     {
 
- promoted_type two = 2.0;
+ promoted_type two = 2.0;
         promoted_type two_pi = two * geometry::math::pi<promoted_type>();
- int point_buffer_count = 88; // 88 gives now fixed problem (collinear opposite / robustness. TODO: make this value flexible
+ int point_buffer_count = 88; // 88 gives now fixed problem (collinear opposite / robustness. TODO: make this value flexible
 
         promoted_type diff = two_pi / promoted_type(point_buffer_count);
         promoted_type a = 0;
@@ -261,23 +261,23 @@
         typename EndStrategy
>
     static inline void generate_circle(Point const& point,
- Collection& collection,
+ Collection& collection,
                 DistanceStrategy const& distance,
                 JoinStrategy const& join_strategy,
                 EndStrategy const& end_strategy)
     {
- std::vector<output_point_type> range_out;
+ std::vector<output_point_type> range_out;
         //RingOutput range_out;
 
- generate_points(point,
- distance.apply(point, point, buffer_side_left),
- range_out);
+ generate_points(point,
+ distance.apply(point, point, buffer_side_left),
+ range_out);
 
         collection.add_piece(buffered_circle, range_out, false);
 
         //std::cout << std::setprecision(20);
         //std::cout << geometry::wkt(range_out) << std::endl;
- }
+ }
 };
 
 }} // namespace detail::buffer
@@ -305,7 +305,7 @@
     typename RingOutput
>
 struct buffer_inserter<point_tag, Point, RingOutput>
- : public detail::buffer::buffer_point<Point, RingOutput>
+ : public detail::buffer::buffer_point<Point, RingOutput>
 {
     template<typename Collection, typename DistanceStrategy, typename JoinStrategy, typename EndStrategy>
     static inline void apply(Point const& point, Collection& collection,
@@ -313,9 +313,9 @@
             JoinStrategy const& join_strategy,
             EndStrategy const& end_strategy)
     {
- collection.start_new_ring();
- typedef detail::buffer::buffer_point<Point, RingOutput> base;
- base::generate_circle(point, collection, distance, join_strategy, end_strategy);
+ collection.start_new_ring();
+ typedef detail::buffer::buffer_point<Point, RingOutput> base;
+ base::generate_circle(point, collection, distance, join_strategy, end_strategy);
     }
 };
 
@@ -348,12 +348,12 @@
             JoinStrategy const& join_strategy,
             EndStrategy const& end_strategy)
     {
- if (boost::size(ring) > 3)
- {
- base::iterate(collection, boost::begin(ring), boost::end(ring),
- buffer_side_left,
- distance, join_strategy, end_strategy);
- }
+ if (boost::size(ring) > 3)
+ {
+ base::iterate(collection, boost::begin(ring), boost::end(ring),
+ buffer_side_left,
+ distance, join_strategy, end_strategy);
+ }
     }
 };
 
@@ -382,17 +382,17 @@
             JoinStrategy const& join_strategy,
             EndStrategy const& end_strategy)
     {
- if (boost::size(linestring) > 1)
- {
- collection.start_new_ring();
- base::iterate(collection, boost::begin(linestring), boost::end(linestring),
- buffer_side_left,
- distance, join_strategy, end_strategy);
+ if (boost::size(linestring) > 1)
+ {
+ collection.start_new_ring();
+ base::iterate(collection, boost::begin(linestring), boost::end(linestring),
+ buffer_side_left,
+ distance, join_strategy, end_strategy);
                 
- base::iterate(collection, boost::rbegin(linestring), boost::rend(linestring),
- buffer_side_right,
- distance, join_strategy, end_strategy, true);
- }
+ base::iterate(collection, boost::rbegin(linestring), boost::rend(linestring),
+ buffer_side_right,
+ distance, join_strategy, end_strategy, true);
+ }
 
     }
 };
@@ -483,8 +483,8 @@
 
 #ifdef BOOST_GEOMETRY_DEBUG_WITH_MAPPER
     //collection.map_offsetted(mapper);
- //collection.map_offsetted_points(mapper);
- collection.map_turns(mapper);
+ //collection.map_offsetted_points(mapper);
+ collection.map_turns(mapper);
     //collection.map_opposite_locations(mapper);
 #endif
 

Modified: trunk/boost/geometry/extensions/algorithms/buffer/buffer_policies.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/buffer/buffer_policies.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/buffer/buffer_policies.hpp 2013-04-25 06:41:03 EDT (Thu, 25 Apr 2013)
@@ -87,12 +87,12 @@
     template <typename Point1, typename Point2, typename Turn, typename IntersectionInfo, typename DirInfo>
     static inline void apply(Turn& turn, Point1 const& p1, Point2 const& p2, IntersectionInfo const& intersection_info, DirInfo const& dir_info)
     {
- detail::overlay::calculate_distance_policy::apply(turn, p1, p2,
- intersection_info, dir_info);
- if (dir_info.opposite && intersection_info.count == 2)
- {
- turn.is_opposite = true;
- }
+ detail::overlay::calculate_distance_policy::apply(turn, p1, p2,
+ intersection_info, dir_info);
+ if (dir_info.opposite && intersection_info.count == 2)
+ {
+ turn.is_opposite = true;
+ }
     }
 };
 
@@ -114,13 +114,13 @@
 template <typename Point>
 struct buffer_turn_info : public detail::overlay::turn_info<Point, buffer_turn_operation<Point> >
 {
- bool is_opposite;
+ bool is_opposite;
     
     intersection_location_type location;
     
     int priority;
     int count_within, count_on_helper, count_on_offsetted, count_on_corner;
- int count_on_occupied;
+ int count_on_occupied;
     int count_on_multi;
 #if defined(BOOST_GEOMETRY_COUNT_DOUBLE_UU)
     int count_on_uu;
@@ -129,18 +129,18 @@
     std::set<int> piece_indices_to_skip;
     
 #ifdef BOOST_GEOMETRY_DEBUG_WITH_MAPPER
- std::string debug_string;
+ std::string debug_string;
 #endif
 
     inline buffer_turn_info()
- : is_opposite(false)
+ : is_opposite(false)
         , location(location_ok)
         , priority(0)
         , count_within(0)
         , count_on_helper(0)
         , count_on_offsetted(0)
         , count_on_corner(0)
- , count_on_occupied(0)
+ , count_on_occupied(0)
         , count_on_multi(0)
 #if defined(BOOST_GEOMETRY_COUNT_DOUBLE_UU)
         , count_on_uu(0)

Modified: trunk/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection_with_mapper.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection_with_mapper.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection_with_mapper.hpp 2013-04-25 06:41:03 EDT (Thu, 25 Apr 2013)
@@ -39,15 +39,15 @@
             boost::begin(m_occupation_map.map);
             it != boost::end(m_occupation_map.map); ++it)
         {
- mapper.map(it->first, it->second.occupied() ? "fill:rgb(255,0,255);" : "fill:rgb(0,192,0);", 7);
+ mapper.map(it->first, it->second.occupied() ? "fill:rgb(255,0,255);" : "fill:rgb(0,192,0);", 7);
 
- std::ostringstream out;
- out << it->second.angles.size() << std::endl;
+ std::ostringstream out;
+ out << it->second.angles.size() << std::endl;
             for (std::set<int>::const_iterator sit = it->second.turn_indices.begin(); sit != it->second.turn_indices.end(); ++sit)
             {
                 out << "," << *sit;
             }
- mapper.text(it->first, out.str(), "fill:rgb(0,0,0);font-family='Arial';font-size:10px", 6, 8);
+ mapper.text(it->first, out.str(), "fill:rgb(0,0,0);font-family='Arial';font-size:10px", 6, 8);
 
             for (unsigned int i = 0; i < it->second.angles.size(); i++)
             {
@@ -61,7 +61,7 @@
                 geometry::set<1>(p1, geometry::get<1>(it->first) + sin(angle) * 0.1);
                 geometry::set<0>(p2, geometry::get<0>(it->first) + cos(angle) * 0.4);
                 geometry::set<1>(p2, geometry::get<1>(it->first) + sin(angle) * 0.4);
- std::ostringstream out;
+ std::ostringstream out;
                 out << (incoming ? "i" : "o") << " " << si(seg_id);
                 // out << " " << angle;
                 if (incoming)
@@ -71,17 +71,17 @@
                     //out << " " << tp.debug_info;
                     line.push_back(p1);
                     line.push_back(p2);
- mapper.map(line, "stroke:rgb(0,0,255);stroke-width:1", 1);
- mapper.map(p1, "fill:rgb(0,0,0);", 2);
- mapper.text(p2, out.str(), "fill:rgb(0,0,0);font-family='Arial';font-size:8px", 2, offset);
+ mapper.map(line, "stroke:rgb(0,0,255);stroke-width:1", 1);
+ mapper.map(p1, "fill:rgb(0,0,0);", 2);
+ mapper.text(p2, out.str(), "fill:rgb(0,0,0);font-family='Arial';font-size:8px", 2, offset);
                 }
                 else
                 {
                     line.push_back(p1);
                     line.push_back(p2);
- mapper.map(line, "stroke:rgb(255,0,0);stroke-width:1", 1);
- mapper.map(p2, "fill:rgb(0,0,0);", 2);
- mapper.text(p2, out.str(), "fill:rgb(0,0,0);font-family='Arial';font-size:8px", 2, -2);
+ mapper.map(line, "stroke:rgb(255,0,0);stroke-width:1", 1);
+ mapper.map(p2, "fill:rgb(0,0,0);", 2);
+ mapper.text(p2, out.str(), "fill:rgb(0,0,0);font-family='Arial';font-size:8px", 2, -2);
                 }
             }
         }
@@ -98,54 +98,54 @@
         for (typename boost::range_iterator<turn_vector_type>::type it =
             boost::begin(m_turns); it != boost::end(m_turns); ++it)
         {
- if (! it->opposite())
- {
- std::pair<coordinate_type, coordinate_type> p
- = std::make_pair(geometry::get<0>(it->point), geometry::get<1>(it->point));
-
- char color = 'g';
- std::string fill = "fill:rgb(0,255,0);";
- switch(it->location)
- {
- case inside_buffer : fill = "fill:rgb(255,0,0);"; color = 'r'; break;
- case inside_original : fill = "fill:rgb(0,0,255);"; color = 'b'; break;
- }
- std::ostringstream out;
- out << it->operations[0].piece_index << "/" << it->operations[1].piece_index
+ if (! it->opposite())
+ {
+ std::pair<coordinate_type, coordinate_type> p
+ = std::make_pair(geometry::get<0>(it->point), geometry::get<1>(it->point));
+
+ char color = 'g';
+ std::string fill = "fill:rgb(0,255,0);";
+ switch(it->location)
+ {
+ case inside_buffer : fill = "fill:rgb(255,0,0);"; color = 'r'; break;
+ case inside_original : fill = "fill:rgb(0,0,255);"; color = 'b'; break;
+ }
+ std::ostringstream out;
+ out << it->operations[0].piece_index << "/" << it->operations[1].piece_index
                     << " " << si(it->operations[0].seg_id) << "/" << si(it->operations[1].seg_id)
                     << std::endl;
- //out << " " << m_pieces[it->operations[0].piece_index].first_seg_id.segment_index
- // << "+" << m_pieces[it->operations[1].piece_index].first_seg_id.segment_index;
- //out << " " << m_pieces[it->operations[0].piece_index].index
- // << "," << m_pieces[it->operations[1].piece_index].index << std::endl;
- //out << " " << it->operations[0].seg_id.segment_index
- // << "|" << it->operations[1].seg_id.segment_index;
- out << " " << method_char(it->method)
- << ":" << operation_char(it->operations[0].operation)
- << "/" << operation_char(it->operations[1].operation);
- out << " " << it->count_within
- << "-" << it->count_on_helper
- << "-" << it->count_on_corner
- << "-" << it->count_on_offsetted
- << "-" << it->count_on_occupied
- << "-" << it->count_on_multi
- //<< it->debug_string
- ;
- out << color << std::endl;
-
- out << " " << it->operations[0].seg_id.segment_index
- << "|" << it->operations[1].seg_id.segment_index;
- //out << it->operations[0].enriched.travels_to_vertex_index
- // << "/" << it->operations[1].enriched.travels_to_vertex_index;
+ //out << " " << m_pieces[it->operations[0].piece_index].first_seg_id.segment_index
+ // << "+" << m_pieces[it->operations[1].piece_index].first_seg_id.segment_index;
+ //out << " " << m_pieces[it->operations[0].piece_index].index
+ // << "," << m_pieces[it->operations[1].piece_index].index << std::endl;
+ //out << " " << it->operations[0].seg_id.segment_index
+ // << "|" << it->operations[1].seg_id.segment_index;
+ out << " " << method_char(it->method)
+ << ":" << operation_char(it->operations[0].operation)
+ << "/" << operation_char(it->operations[1].operation);
+ out << " " << it->count_within
+ << "-" << it->count_on_helper
+ << "-" << it->count_on_corner
+ << "-" << it->count_on_offsetted
+ << "-" << it->count_on_occupied
+ << "-" << it->count_on_multi
+ //<< it->debug_string
+ ;
+ out << color << std::endl;
+
+ out << " " << it->operations[0].seg_id.segment_index
+ << "|" << it->operations[1].seg_id.segment_index;
+ //out << it->operations[0].enriched.travels_to_vertex_index
+ // << "/" << it->operations[1].enriched.travels_to_vertex_index;
 
- offsets[p] += 10;
- int offset = offsets[p];
+ offsets[p] += 10;
+ int offset = offsets[p];
 
- mapper.map(it->point, fill, 6);
- mapper.text(it->point, out.str(), "fill:rgb(0,0,0);font-family='Arial';font-size:9px;", 5, offset);
+ mapper.map(it->point, fill, 6);
+ mapper.text(it->point, out.str(), "fill:rgb(0,0,0);font-family='Arial';font-size:9px;", 5, offset);
 
- offsets[p] += 25;
- }
+ offsets[p] += 25;
+ }
         }
     }
 
@@ -158,31 +158,31 @@
         {
             Ring corner;
 
- segment_identifier seg_id = it->first_seg_id;
+ segment_identifier seg_id = it->first_seg_id;
+
+ if (seg_id.segment_index >= 0)
+ {
+ buffered_ring<Ring> const& ring = offsetted_rings[seg_id.multi_index];
+
+ std::copy(boost::begin(ring) + seg_id.segment_index,
+ boost::begin(ring) + it->last_segment_index,
+ std::back_inserter(corner));
+ std::copy(boost::begin(it->helper_segments),
+ boost::end(it->helper_segments),
+ std::back_inserter(corner));
+ }
 
- if (seg_id.segment_index >= 0)
- {
- buffered_ring<Ring> const& ring = offsetted_rings[seg_id.multi_index];
-
- std::copy(boost::begin(ring) + seg_id.segment_index,
- boost::begin(ring) + it->last_segment_index,
- std::back_inserter(corner));
- std::copy(boost::begin(it->helper_segments),
- boost::end(it->helper_segments),
- std::back_inserter(corner));
- }
-
- {
- // Corners of onesided buffers are empty.
- // Mapping this might result (for buffer_line_two_bends_right_d_r) in a
- // "unknown location(0): fatal error in "test_main_caller( argc, argv )":
- // class boost::numeric::positive_overflow: bad numeric conversion: positive overflow"
- // This is only in release-mode of MSVC, only for the pieces (mapping of rings)
- // Must be somewhere in either transform or ublas
- // TODO: find out why
- // Making them unique helps somehow (while it then still has the same coordinates...)
- geometry::unique(corner);
- }
+ {
+ // Corners of onesided buffers are empty.
+ // Mapping this might result (for buffer_line_two_bends_right_d_r) in a
+ // "unknown location(0): fatal error in "test_main_caller( argc, argv )":
+ // class boost::numeric::positive_overflow: bad numeric conversion: positive overflow"
+ // This is only in release-mode of MSVC, only for the pieces (mapping of rings)
+ // Must be somewhere in either transform or ublas
+ // TODO: find out why
+ // Making them unique helps somehow (while it then still has the same coordinates...)
+ geometry::unique(corner);
+ }
 
             if (pieces && ! corner.empty())
             {
@@ -208,14 +208,14 @@
 
                 // Put starting piece_index / segment_index in centroid
                 point_type centroid;
- if (corner.size() > 3)
- {
- geometry::centroid(corner, centroid);
- }
- else
- {
- centroid = corner.front();
- }
+ if (corner.size() > 3)
+ {
+ geometry::centroid(corner, centroid);
+ }
+ else
+ {
+ centroid = corner.front();
+ }
                 std::ostringstream out;
                 out << it->index << "/" << it->first_seg_id.segment_index << ".." << it->last_segment_index - 1;
                 mapper.text(centroid, out.str(), "fill:rgb(255,0,0);font-family='Arial';", 5, 5);
@@ -231,15 +231,15 @@
             oit != boost::end(offsetted_rings);
             ++oit)
         {
- int index = 0;
- for (typename boost::range_iterator<std::vector<point_type> const>::type pit = boost::begin(*oit); pit != boost::end(*oit); ++pit)
- {
- mapper.map(*pit, "fill:rgb(0,0,0);", 2);
- std::ostringstream out;
- out << index++;
- mapper.text(*pit, out.str(), "fill:rgb(0,0,255);font-family='Arial';", -5, -5);
- }
- }
+ int index = 0;
+ for (typename boost::range_iterator<std::vector<point_type> const>::type pit = boost::begin(*oit); pit != boost::end(*oit); ++pit)
+ {
+ mapper.map(*pit, "fill:rgb(0,0,0);", 2);
+ std::ostringstream out;
+ out << index++;
+ mapper.text(*pit, out.str(), "fill:rgb(0,0,255);font-family='Arial';", -5, -5);
+ }
+ }
     }
 
     template <typename Mapper>

Modified: trunk/boost/geometry/extensions/algorithms/buffer/multi_buffer_inserter.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/buffer/multi_buffer_inserter.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/buffer/multi_buffer_inserter.hpp 2013-04-25 06:41:03 EDT (Thu, 25 Apr 2013)
@@ -112,7 +112,7 @@
     typename PolygonOutput
>
 struct buffer_inserter<multi_polygon_tag, Multi, PolygonOutput>
- : public detail::buffer::multi_buffer_inserter<Multi, PolygonOutput>
+ : public detail::buffer::multi_buffer_inserter<Multi, PolygonOutput>
 {};
 
 template
@@ -121,7 +121,7 @@
     typename PolygonOutput
>
 struct buffer_inserter<multi_linestring_tag, Multi, PolygonOutput>
- : public detail::buffer::multi_buffer_inserter<Multi, PolygonOutput>
+ : public detail::buffer::multi_buffer_inserter<Multi, PolygonOutput>
 {};
 
 
@@ -131,7 +131,7 @@
     typename PolygonOutput
>
 struct buffer_inserter<multi_point_tag, Multi, PolygonOutput>
- : public detail::buffer::multi_buffer_inserter<Multi, PolygonOutput>
+ : public detail::buffer::multi_buffer_inserter<Multi, PolygonOutput>
 {};
 
 

Modified: trunk/boost/geometry/extensions/algorithms/buffer/side_on_convex_range.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/buffer/side_on_convex_range.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/buffer/side_on_convex_range.hpp 2013-04-25 06:41:03 EDT (Thu, 25 Apr 2013)
@@ -22,7 +22,7 @@
 template <int D>
 struct collinear_point_on_segment_check
 {
- template <typename T>
+ template <typename T>
     static inline bool apply_sorted(T const& subject, T const& c1, T const& c2)
     {
         return subject >= c1 && subject <= c2;
@@ -31,7 +31,7 @@
     template <typename P0, typename P1, typename P2>
     static inline bool apply(P0 const& subject, P1 const& p1, P2 const& p2)
     {
- typedef typename geometry::coordinate_type<P0>::type coordinate_type;
+ typedef typename geometry::coordinate_type<P0>::type coordinate_type;
         coordinate_type const cs = geometry::get<D>(subject);
         coordinate_type const c1 = geometry::get<D>(p1);
         coordinate_type const c2 = geometry::get<D>(p2);
@@ -94,9 +94,9 @@
 
 template <typename SideStrategy, typename Point, typename Iterator>
 static inline int side_on_convex_range(Point const& subject,
- Iterator first, Iterator last,
- /* by value: */ segment_identifier seg_id,
- segment_identifier& on_segment_seg_id)
+ Iterator first, Iterator last,
+ /* by value: */ segment_identifier seg_id,
+ segment_identifier& on_segment_seg_id)
 {
     bool has_collinear = false;
     Iterator it = first;
@@ -113,7 +113,7 @@
                 // or it is still on one of the other segments (if segments are collinear)
                 if (collinear_point_on_segment(subject, *prev, *it))
                 {
- on_segment_seg_id = seg_id;
+ on_segment_seg_id = seg_id;
                     return 0;
                 }
                 has_collinear = true;

Modified: trunk/boost/geometry/extensions/strategies/buffer_end_round.hpp
==============================================================================
--- trunk/boost/geometry/extensions/strategies/buffer_end_round.hpp (original)
+++ trunk/boost/geometry/extensions/strategies/buffer_end_round.hpp 2013-04-25 06:41:03 EDT (Thu, 25 Apr 2013)
@@ -58,10 +58,10 @@
                 promoted_type const& buffer_distance,
                 RangeOut& range_out) const
     {
- promoted_type const two = 2.0;
+ promoted_type const two = 2.0;
         promoted_type const two_pi = two * geometry::math::pi<promoted_type>();
 
- int point_buffer_count = m_steps_per_circle;
+ int point_buffer_count = m_steps_per_circle;
 
         promoted_type const diff = two_pi / promoted_type(point_buffer_count);
 


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