Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77063 - in trunk: boost/geometry/algorithms/detail/overlay boost/geometry/extensions/algorithms boost/geometry/extensions/algorithms/buffer libs/geometry/test_extensions/algorithms
From: barend.gehrels_at_[hidden]
Date: 2012-02-18 06:04:20


Author: barendgehrels
Date: 2012-02-18 06:04:19 EST (Sat, 18 Feb 2012)
New Revision: 77063
URL: http://svn.boost.org/trac/boost/changeset/77063

Log:
Boost.Geometry fixes for offset-extension w.r.t. new buffer approach (does not run yet but compiles)
Text files modified:
   trunk/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp | 5 ++-
   trunk/boost/geometry/extensions/algorithms/buffer/buffered_piece_collection.hpp | 4 ++
   trunk/boost/geometry/extensions/algorithms/buffer/buffered_ring.hpp | 5 +--
   trunk/boost/geometry/extensions/algorithms/offset.hpp | 56 +++++++++++++++-------------------------
   trunk/libs/geometry/test_extensions/algorithms/offset.cpp | 3 -
   5 files changed, 30 insertions(+), 43 deletions(-)

Modified: trunk/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp 2012-02-18 06:04:19 EST (Sat, 18 Feb 2012)
@@ -763,8 +763,9 @@
 
     typedef typename si::segment_intersection_strategy_type strategy;
 
-
-
+ // Intersect pi-pj with qi-qj
+ // The points pk and qk are only used do determine more information
+ // about the turn.
     template <typename OutputIterator>
     static inline OutputIterator apply(
                 Point1 const& pi, Point1 const& pj, Point1 const& pk,

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-02-18 06:04:19 EST (Sat, 18 Feb 2012)
@@ -20,9 +20,11 @@
 #include <boost/geometry/algorithms/covered_by.hpp>
 #include <boost/geometry/extensions/strategies/buffer_side.hpp>
 
-#include <boost/geometry/algorithms/detail/overlay/turn_info.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/traversal_info.hpp>
+#include <boost/geometry/algorithms/detail/overlay/traverse.hpp>
+#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
 
 #include <boost/geometry/extensions/algorithms/buffer/buffered_ring.hpp>
 

Modified: trunk/boost/geometry/extensions/algorithms/buffer/buffered_ring.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/buffer/buffered_ring.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/buffer/buffered_ring.hpp 2012-02-18 06:04:19 EST (Sat, 18 Feb 2012)
@@ -16,13 +16,12 @@
 #include <boost/geometry/core/coordinate_type.hpp>
 #include <boost/geometry/core/point_type.hpp>
 
-#include <boost/geometry/algorithms/equals.hpp>
-#include <boost/geometry/algorithms/covered_by.hpp>
 #include <boost/geometry/extensions/strategies/buffer_side.hpp>
 
-#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
 #include <boost/geometry/algorithms/detail/overlay/enrichment_info.hpp>
+#include <boost/geometry/algorithms/detail/overlay/get_ring.hpp>
 #include <boost/geometry/algorithms/detail/overlay/traversal_info.hpp>
+#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
 
 #include <boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp>
 #include <boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp>

Modified: trunk/boost/geometry/extensions/algorithms/offset.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/offset.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/offset.hpp 2012-02-18 06:04:19 EST (Sat, 18 Feb 2012)
@@ -14,9 +14,7 @@
 #include <boost/range/functions.hpp>
 
 #include <boost/geometry/core/point_type.hpp>
-#include <boost/geometry/extensions/algorithms/buffer/line_line_intersection.hpp>
-#include <boost/geometry/extensions/algorithms/buffer/range_buffer.hpp>
-#include <boost/geometry/extensions/algorithms/offset_appender.hpp>
+#include <boost/geometry/extensions/algorithms/buffer/buffer_inserter.hpp>
 #include <boost/geometry/algorithms/detail/disjoint.hpp>
 #include <boost/geometry/geometries/concepts/check.hpp>
 
@@ -34,26 +32,25 @@
 template
 <
     typename Range,
- typename RangeOut,
- typename JoinStrategy,
- typename DistanceStrategy
+ typename RangeOut
>
 struct offset_range
- : public geometry::detail::buffer::range_buffer
+ : public geometry::detail::buffer::buffer_range
         <
             RangeOut,
- DistanceStrategy,
- JoinStrategy,
             linestring_tag
>
 {
- template <typename Appender>
- static inline void apply(Range const& range,
- Appender& appender,
+ template
+ <
+ typename Collection, typename DistanceStrategy, typename JoinStrategy
+ >
+ static inline void apply(Collection& collection, Range const& range,
                 DistanceStrategy const& distance,
                 JoinStrategy const& join)
     {
- iterate(appender, boost::begin(range), boost::end(range),
+ collection.add_input();
+ iterate(collection, boost::begin(range), boost::end(range),
             buffer_side_left,
             distance, join);
     }
@@ -73,9 +70,7 @@
     typename GeometryTag,
     typename GeometryOutTag,
     typename Geometry,
- typename GeometryOut,
- typename JoinStrategy,
- typename DistanceStrategy
+ typename GeometryOut
>
 struct offset
 {};
@@ -84,25 +79,19 @@
 template
 <
     typename Geometry,
- typename GeometryOut,
- typename JoinStrategy,
- typename DistanceStrategy
+ typename GeometryOut
>
 struct offset
     <
         linestring_tag,
         linestring_tag,
         Geometry,
- GeometryOut,
- JoinStrategy,
- DistanceStrategy
+ GeometryOut
>
     : detail::offset::offset_range
         <
             Geometry,
- GeometryOut,
- JoinStrategy,
- DistanceStrategy
+ GeometryOut
>
 {};
 
@@ -131,23 +120,20 @@
> distance_strategy_type;
     distance_strategy_type distance_strategy(distance, distance);
 
-
- typedef detail::offset::offset_appender
+ detail::buffer::buffered_piece_collection
         <
- GeometryOut
- > appender_type;
-
- appender_type appender(out);
+ //typename geometry::ring_type<GeometryOut>::type
+ // TODO the piece collection will not require a polygonal argument
+ model::ring<typename point_type<Geometry>::type>
+ > collection;
 
     dispatch::offset
     <
         typename tag<Geometry>::type,
         typename tag<GeometryOut>::type,
         Geometry,
- GeometryOut,
- JoinStrategy,
- distance_strategy_type
- >::apply(geometry, appender, distance_strategy, join);
+ GeometryOut
+ >::apply(collection, geometry, distance_strategy, join);
 }
 
 

Modified: trunk/libs/geometry/test_extensions/algorithms/offset.cpp
==============================================================================
--- trunk/libs/geometry/test_extensions/algorithms/offset.cpp (original)
+++ trunk/libs/geometry/test_extensions/algorithms/offset.cpp 2012-02-18 06:04:19 EST (Sat, 18 Feb 2012)
@@ -45,8 +45,7 @@
     typedef bg::strategy::buffer::join_round
         <
             point_type,
- point_type,
- false
+ point_type
> join_strategy;
 
     GeometryOut moved_by_offset;


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