Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67321 - in sandbox/geometry/boost/geometry: algorithms algorithms/detail/overlay extensions/nsphere extensions/nsphere/geometries geometries multi/algorithms multi/algorithms/detail/overlay
From: barend.gehrels_at_[hidden]
Date: 2010-12-19 07:18:14


Author: barendgehrels
Date: 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
New Revision: 67321
URL: http://svn.boost.org/trac/boost/changeset/67321

Log:
Implemented counterclockwise-geometry / box
Removed obsolete order in traverse/copy segments
Added option ReverseOut in overlay to support ccw or difference better, this should be enhanced
Obsoleted cartesian2d and cartesian3d

Removed:
   sandbox/geometry/boost/geometry/algorithms/detail/overlay/reverse_operations.hpp
Text files modified:
   sandbox/geometry/boost/geometry/algorithms/detail/overlay/copy_segments.hpp | 53 ++++++++++++--------------------------
   sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turns.hpp | 54 +++++++++++++++++++++++++--------------
   sandbox/geometry/boost/geometry/algorithms/detail/overlay/overlay.hpp | 14 ++-------
   sandbox/geometry/boost/geometry/algorithms/detail/overlay/traverse.hpp | 10 ++----
   sandbox/geometry/boost/geometry/algorithms/difference.hpp | 2
   sandbox/geometry/boost/geometry/algorithms/dissolve.hpp | 7 ++--
   sandbox/geometry/boost/geometry/algorithms/intersection.hpp | 40 +++++++++++++++--------------
   sandbox/geometry/boost/geometry/algorithms/sym_difference.hpp | 4 +-
   sandbox/geometry/boost/geometry/algorithms/union.hpp | 18 +++++++-----
   sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian2d.hpp | 28 --------------------
   sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian3d.hpp | 28 --------------------
   sandbox/geometry/boost/geometry/extensions/nsphere/nsphere.hpp | 2 -
   sandbox/geometry/boost/geometry/geometries/cartesian2d.hpp | 36 -------------------------
   sandbox/geometry/boost/geometry/geometries/cartesian3d.hpp | 38 ---------------------------
   sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp | 6 +--
   sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp | 5 ++-
   sandbox/geometry/boost/geometry/multi/algorithms/intersection.hpp | 21 ++++++--------
   17 files changed, 116 insertions(+), 250 deletions(-)

Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/copy_segments.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/copy_segments.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/copy_segments.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -128,8 +128,7 @@
 <
     typename Box,
     typename SegmentIdentifier,
- typename RangeOut,
- order_selector Order
+ typename RangeOut
>
 struct copy_segments_box
 {
@@ -144,29 +143,18 @@
             ? to_index - index + 1
             : 5 - index + to_index + 1;
 
- boost::array<typename point_type<Box>::type, 4> bp;
- boost::array<int, 5> point_index;
+ // Create array of points, the fifth one closes it
+ boost::array<typename point_type<Box>::type, 5> bp;
 
- // 1: They are retrieved by "assign_box_order" in order ll, lr, ul, ur
+ // Points are retrieved by "assign_box_order" in order ll, lr, ul, ur
         assign_box_corners(box, bp[0], bp[3], bp[1], bp[2]);
+ bp[4] = bp[0];
 
- // 2: set indexes, reverse direction if necessary
- bool const reverse = Order == counterclockwise;
- point_index[0] = 0;
- point_index[1] = reverse ? 3 : 1;
- point_index[2] = 2;
- point_index[3] = reverse ? 1 : 3;
- point_index[4] = 0;
-
- // 3: (possibly cyclic) copy to output
+ // (possibly cyclic) copy to output
         // (see comments in ring-version)
- for (int i = 0; i < count; ++i)
+ for (int i = 0; i < count; i++, index++)
         {
- geometry::append(current_output, bp[point_index[index++]]);
- if (index == 5)
- {
- index = 0;
- }
+ geometry::append(current_output, bp[index % 5]);
         }
     }
 };
@@ -180,15 +168,13 @@
 namespace dispatch
 {
 
-// Note: Order is specified explicitly, because Box does not have an own direction
 template
 <
     typename Tag,
     typename GeometryIn,
     bool Reverse,
     typename SegmentIdentifier,
- typename RangeOut,
- order_selector Order
+ typename RangeOut
>
 struct copy_segments
 {
@@ -205,10 +191,9 @@
     typename Ring,
     bool Reverse,
     typename SegmentIdentifier,
- typename RangeOut,
- order_selector Order
+ typename RangeOut
>
-struct copy_segments<ring_tag, Ring, Reverse, SegmentIdentifier, RangeOut, Order>
+struct copy_segments<ring_tag, Ring, Reverse, SegmentIdentifier, RangeOut>
     : detail::copy_segments::copy_segments_ring
         <
             Ring, Reverse, SegmentIdentifier, RangeOut
@@ -221,10 +206,9 @@
     typename Polygon,
     bool Reverse,
     typename SegmentIdentifier,
- typename RangeOut,
- order_selector Order
+ typename RangeOut
>
-struct copy_segments<polygon_tag, Polygon, Reverse, SegmentIdentifier, RangeOut, Order>
+struct copy_segments<polygon_tag, Polygon, Reverse, SegmentIdentifier, RangeOut>
     : detail::copy_segments::copy_segments_polygon
         <
             Polygon, Reverse, SegmentIdentifier, RangeOut
@@ -237,13 +221,12 @@
     typename Box,
     bool Reverse,
     typename SegmentIdentifier,
- typename RangeOut,
- order_selector Order
+ typename RangeOut
>
-struct copy_segments<box_tag, Box, Reverse, SegmentIdentifier, RangeOut, Order>
+struct copy_segments<box_tag, Box, Reverse, SegmentIdentifier, RangeOut>
     : detail::copy_segments::copy_segments_box
         <
- Box, SegmentIdentifier, RangeOut, Order
+ Box, SegmentIdentifier, RangeOut
>
 {};
 
@@ -260,7 +243,6 @@
  */
 template
 <
- order_selector Order,
     bool Reverse,
     typename Geometry,
     typename SegmentIdentifier,
@@ -278,8 +260,7 @@
             Geometry,
             Reverse,
             SegmentIdentifier,
- RangeOut,
- Order
+ RangeOut
>::apply(geometry, seg_id, to_index, range_out);
 }
 

Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turns.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turns.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turns.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -524,6 +524,7 @@
 template
 <
     typename Range,
+ bool Reverse,
     typename Box,
     typename Turns,
     typename TurnPolicy,
@@ -535,6 +536,24 @@
     typedef typename geometry::point_type<Range>::type point_type;
     typedef typename geometry::point_type<Box>::type box_point_type;
 
+ typedef typename closeable_view
+ <
+ Range const,
+ closure<Range>::value
+ >::type cview_type;
+
+ typedef typename reversible_view
+ <
+ cview_type const,
+ Reverse ? iterate_reverse : iterate_forward
+ >::type view_type;
+
+ typedef typename boost::range_iterator
+ <
+ view_type const
+ >::type iterator_type;
+
+
     static inline void apply(
                 int source_id1, Range const& range,
                 int source_id2, Box const& box,
@@ -547,24 +566,20 @@
             return;
         }
 
- // Box-points in order ll, ul, ur, lr
+ // Box-points in clockwise order ll, ul, ur, lr
         boost::array<box_point_type,4> bp;
 
- // They are retrieved by "assign_box_order" in order ll, lr, ul, ur
+ // Points are retrieved by "assign_box_order" in order ll, lr, ul, ur,
+ // so make them clockwise here
         assign_box_corners(box, bp[0], bp[3], bp[1], bp[2]);
 
- // The arrangement is now OK for clockwise,
- // for counter clockwise we only need to swap ul with lr (== 1 with 3)
- // Note we swap the index, not the point itself.
- int const i1 = point_order<Range>::value == clockwise ? 1 : 3;
- int const i3 = point_order<Range>::value == clockwise ? 3 : 1;
-
- typedef typename boost::range_iterator
- <Range const>::type iterator_type;
- iterator_type it = boost::begin(range);
+ cview_type cview(range);
+ view_type view(cview);
 
- ever_circling_iterator<iterator_type> next(boost::begin(range),
- boost::end(range), it, true);
+ iterator_type it = boost::begin(view);
+
+ ever_circling_iterator<iterator_type> next(
+ boost::begin(view), boost::end(view), it, true);
         next++;
         next++;
 
@@ -575,7 +590,7 @@
         int index = 0;
 
         for (iterator_type prev = it++;
- it != boost::end(range);
+ it != boost::end(view);
             prev = it++, next++, index++)
         {
             segment_identifier seg_id(source_id1,
@@ -608,7 +623,7 @@
             {
                 get_turns_with_box(seg_id, source_id2,
                         *prev, *it, *next,
- bp[0], bp[i1], bp[2], bp[i3], // note the "i" here
+ bp[0], bp[1], bp[2], bp[3],
                         turns);
                 // TODO: call the interrupt policy if applicable
             }
@@ -681,7 +696,7 @@
 
 template
 <
- typename Polygon,
+ typename Polygon, bool Reverse,
     typename Box,
     typename Turns,
     typename TurnPolicy,
@@ -699,7 +714,7 @@
 
         typedef detail::get_turns::get_turns_cs
             <
- ring_type,
+ ring_type, Reverse,
                 Box,
                 Turns,
                 TurnPolicy,
@@ -776,7 +791,8 @@
         InterruptPolicy
> : detail::get_turns::get_turns_polygon_cs
             <
- Polygon, Box,
+ Polygon, ReversePolygon,
+ Box,
                 Turns, TurnPolicy, InterruptPolicy
>
 {};
@@ -800,7 +816,7 @@
         InterruptPolicy
> : detail::get_turns::get_turns_cs
             <
- Ring, Box,
+ Ring, ReverseRing, Box,
                 Turns, TurnPolicy, InterruptPolicy
>
 

Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/overlay.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/overlay.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/overlay.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -21,7 +21,6 @@
 #include <boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp>
 #include <boost/geometry/algorithms/detail/overlay/enrichment_info.hpp>
 #include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
-#include <boost/geometry/algorithms/detail/overlay/reverse_operations.hpp>
 #include <boost/geometry/algorithms/detail/overlay/traverse.hpp>
 #include <boost/geometry/algorithms/detail/overlay/traversal_info.hpp>
 #include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
@@ -51,9 +50,9 @@
 template
 <
     typename Geometry1, typename Geometry2,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename OutputIterator, typename GeometryOut,
- int Direction, order_selector Order,
+ int Direction,
     typename Strategy
>
 struct overlay
@@ -106,11 +105,6 @@
                 detail::overlay::calculate_distance_policy
>(geometry1, geometry2, turn_points, policy);
 
- if (Order == counterclockwise)
- {
- detail::overlay::reverse_operations(turn_points);
- }
-
 #ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE
 std::cout << "enrich" << std::endl;
 #endif
@@ -126,7 +120,7 @@
 std::cout << "traverse" << std::endl;
 #endif
         ring_container_type rings;
- geometry::traverse<Order, Reverse1, Reverse2>(geometry1, geometry2,
+ geometry::traverse<Reverse1, Reverse2>(geometry1, geometry2,
                 Direction == -1
                     ? boost::geometry::detail::overlay::operation_intersection
                     : boost::geometry::detail::overlay::operation_union
@@ -134,7 +128,7 @@
                 turn_points, rings);
 
         // TEMP condition, reversal should be done in traverse by calling "push_front"
- if (Reverse1 && Reverse2)
+ if (ReverseOut && (Reverse1 || Reverse2))
         {
             for (typename boost::range_iterator<ring_container_type>::type
                     it = boost::begin(rings);

Deleted: sandbox/geometry/boost/geometry/algorithms/detail/overlay/reverse_operations.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/reverse_operations.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
+++ (empty file)
@@ -1,53 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2010, Geodan, Amsterdam, the Netherlands.
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_REVERSE_OPERATIONS_HPP
-#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_REVERSE_OPERATIONS_HPP
-
-
-#include <boost/range/functions.hpp>
-#include <boost/range/metafunctions.hpp>
-
-#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-#ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace overlay
-{
-
-
-template <typename Turns>
-void reverse_operations(Turns& turns)
-{
- for(typename boost::range_iterator<Turns>::type it
- = boost::begin(turns); it != boost::end(turns); ++it)
- {
- for (unsigned int i = 0; i < it->operations.size(); i++)
- {
- operation_type& op = it->operations[i].operation;
- switch(op)
- {
- case operation_union : op = operation_intersection; break;
- case operation_intersection : op = operation_union; break;
- default : break;
- }
- }
- }
-}
-
-
-}} // namespace detail::overlay
-#endif //DOXYGEN_NO_DETAIL
-
-
-}} // namespace boost::geometry
-
-
-#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_REVERSE_OPERATIONS_HPP

Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/traverse.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/traverse.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/traverse.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -104,7 +104,6 @@
 
 template
 <
- order_selector Order,
     bool Reverse1, bool Reverse2,
     typename GeometryOut,
     typename G1,
@@ -132,13 +131,13 @@
 
         if (info.seg_id.source_index == 0)
         {
- geometry::copy_segments<Order, Reverse1>(g1, info.seg_id,
+ geometry::copy_segments<Reverse1>(g1, info.seg_id,
                     info.enriched.travels_to_vertex_index,
                     current_output);
         }
         else
         {
- geometry::copy_segments<Order, Reverse2>(g2, info.seg_id,
+ geometry::copy_segments<Reverse2>(g2, info.seg_id,
                     info.enriched.travels_to_vertex_index,
                     current_output);
         }
@@ -303,7 +302,6 @@
  */
 template
 <
- order_selector Order,
     bool Reverse1, bool Reverse2,
     typename Geometry1,
     typename Geometry2,
@@ -355,7 +353,7 @@
                         turn_operation_iterator_type current_iit = iit;
                         segment_identifier current_seg_id;
 
- if (! detail::overlay::assign_next_ip<Order, Reverse1, Reverse2>(
+ if (! detail::overlay::assign_next_ip<Reverse1, Reverse2>(
                                     geometry1, geometry2,
                                     turns,
                                     current, current_output,
@@ -416,7 +414,7 @@
                                     // will continue with the next one.
 
                                     // Below three reasons to stop.
- detail::overlay::assign_next_ip<Order, Reverse1, Reverse2>(
+ detail::overlay::assign_next_ip<Reverse1, Reverse2>(
                                         geometry1, geometry2,
                                         turns, current, current_output,
                                         *current_iit, current_seg_id);

Modified: sandbox/geometry/boost/geometry/algorithms/difference.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/difference.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/difference.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -51,7 +51,7 @@
> strategy;
 
 
- detail::intersection::inserter<geometry_out, false, true>(
+ detail::intersection::inserter<geometry_out, false, true, false>(
             geometry1, geometry2,
             std::back_inserter(output_collection),
             strategy());

Modified: sandbox/geometry/boost/geometry/algorithms/dissolve.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/dissolve.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/dissolve.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -82,8 +82,8 @@
                         side_strategy_type());
 
 
- // Traverse the polygons twice in two different directions
- traverse<point_order<Geometry>::value, false, false>(geometry, geometry,
+ // Traverse the polygons twice for union...
+ traverse<false, false>(geometry, geometry,
                             detail::overlay::operation_union,
                             turns, rings);
 
@@ -95,7 +95,8 @@
                         side_strategy_type());
 
 
- traverse<point_order<Geometry>::value, false, false>(geometry, geometry,
+ // ... and for intersection
+ traverse<false, false>(geometry, geometry,
                             detail::overlay::operation_intersection,
                             turns, rings);
 

Modified: sandbox/geometry/boost/geometry/algorithms/intersection.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/intersection.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/intersection.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -120,7 +120,7 @@
     bool Areal1, bool Areal2, bool ArealOut,
     // real types
     typename Geometry1, typename Geometry2,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename OutputIterator,
     typename GeometryOut,
     typename Strategy
@@ -139,7 +139,7 @@
 <
     typename TagIn1, typename TagIn2, typename TagOut,
     typename Geometry1, typename Geometry2,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename OutputIterator,
     typename GeometryOut,
     typename Strategy
@@ -149,11 +149,11 @@
         TagIn1, TagIn2, TagOut,
         true, true, true,
         Geometry1, Geometry2,
- Reverse1, Reverse2,
+ Reverse1, Reverse2, ReverseOut,
         OutputIterator, GeometryOut,
         Strategy
> : detail::overlay::overlay
- <Geometry1, Geometry2, Reverse1, Reverse2, OutputIterator, GeometryOut, -1, clockwise, Strategy>
+ <Geometry1, Geometry2, Reverse1, Reverse2, ReverseOut, OutputIterator, GeometryOut, -1, Strategy>
 {};
 
 
@@ -162,7 +162,7 @@
 <
     typename TagIn, typename TagOut,
     typename Geometry, typename Box,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename OutputIterator,
     typename GeometryOut,
     typename Strategy
@@ -172,18 +172,18 @@
         TagIn, box_tag, TagOut,
         true, true, true,
         Geometry, Box,
- Reverse1, Reverse2,
+ Reverse1, Reverse2, ReverseOut,
         OutputIterator, GeometryOut,
         Strategy
> : detail::overlay::overlay
- <Geometry, Box, Reverse1, Reverse2, OutputIterator, GeometryOut, -1, clockwise, Strategy>
+ <Geometry, Box, Reverse1, Reverse2, ReverseOut, OutputIterator, GeometryOut, -1, Strategy>
 {};
 
 
 template
 <
     typename Segment1, typename Segment2,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename OutputIterator, typename GeometryOut,
     typename Strategy
>
@@ -192,7 +192,7 @@
         segment_tag, segment_tag, point_tag,
         false, false, false,
         Segment1, Segment2,
- Reverse1, Reverse2,
+ Reverse1, Reverse2, ReverseOut,
         OutputIterator, GeometryOut,
         Strategy
> : detail::intersection::intersection_segment_segment_point
@@ -207,7 +207,7 @@
 template
 <
     typename Linestring1, typename Linestring2,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename OutputIterator, typename GeometryOut,
     typename Strategy
>
@@ -216,7 +216,7 @@
         linestring_tag, linestring_tag, point_tag,
         false, false, false,
         Linestring1, Linestring2,
- Reverse1, Reverse2,
+ Reverse1, Reverse2, ReverseOut,
         OutputIterator, GeometryOut,
         Strategy
> : detail::intersection::intersection_linestring_linestring_point
@@ -231,7 +231,7 @@
 template
 <
     typename Linestring, typename Box,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename OutputIterator, typename GeometryOut,
     typename Strategy
>
@@ -240,7 +240,7 @@
         linestring_tag, box_tag, linestring_tag,
         false, true, false,
         Linestring, Box,
- Reverse1, Reverse2,
+ Reverse1, Reverse2, ReverseOut,
         OutputIterator, GeometryOut,
         Strategy
>
@@ -258,7 +258,7 @@
 template
 <
     typename Segment, typename Box,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename OutputIterator, typename GeometryOut,
     typename Strategy
>
@@ -267,7 +267,7 @@
         segment_tag, box_tag, linestring_tag,
         false, true, false,
         Segment, Box,
- Reverse1, Reverse2,
+ Reverse1, Reverse2, ReverseOut,
         OutputIterator, GeometryOut,
         Strategy
>
@@ -291,7 +291,7 @@
     typename GeometryTag1, typename GeometryTag2, typename GeometryTag3,
     bool Areal1, bool Areal2, bool ArealOut,
     typename Geometry1, typename Geometry2,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename OutputIterator, typename GeometryOut,
     typename Strategy
>
@@ -306,7 +306,7 @@
                 GeometryTag2, GeometryTag1, GeometryTag3,
                 Areal2, Areal1, ArealOut,
                 Geometry2, Geometry1,
- Reverse1, Reverse2,
+ Reverse2, Reverse1, ReverseOut,
                 OutputIterator, GeometryOut,
                 Strategy
>::apply(g2, g1, out, strategy);
@@ -327,7 +327,7 @@
 template
 <
     typename GeometryOut,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename Geometry1, typename Geometry2,
     typename OutputIterator,
     typename Strategy
@@ -354,6 +354,7 @@
                 Geometry1, Geometry2,
                 overlay::do_reverse<point_order<Geometry1>::value, Reverse1>::value,
                 overlay::do_reverse<point_order<Geometry2>::value, Reverse2>::value,
+ ReverseOut,
                 OutputIterator, GeometryOut,
                 Strategy
>,
@@ -371,6 +372,7 @@
                 Geometry1, Geometry2,
                 overlay::do_reverse<point_order<Geometry1>::value, Reverse1>::value,
                 overlay::do_reverse<point_order<Geometry2>::value, Reverse2>::value,
+ ReverseOut,
                 OutputIterator, GeometryOut,
                 Strategy
>
@@ -418,7 +420,7 @@
     concept::check<Geometry1 const>();
     concept::check<Geometry2 const>();
 
- return detail::intersection::inserter<GeometryOut, false, false>(
+ return detail::intersection::inserter<GeometryOut, false, false, true>(
             geometry1, geometry2, out, strategy);
 }
 

Modified: sandbox/geometry/boost/geometry/algorithms/sym_difference.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/sym_difference.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/sym_difference.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -53,11 +53,11 @@
> strategy;
 
 
- detail::intersection::inserter<geometry_out, false, true>(
+ detail::intersection::inserter<geometry_out, false, true, false>(
             geometry1, geometry2,
             std::back_inserter(output_collection),
             strategy());
- detail::intersection::inserter<geometry_out, true, false>(
+ detail::intersection::inserter<geometry_out, true, false, false>(
             geometry1, geometry2,
             std::back_inserter(output_collection),
             strategy());

Modified: sandbox/geometry/boost/geometry/algorithms/union.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/union.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/union.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -36,7 +36,7 @@
     bool Areal1, bool Areal2, bool ArealOut,
     // real types
     typename Geometry1, typename Geometry2,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename OutputIterator,
     typename GeometryOut,
     typename Strategy
@@ -55,7 +55,7 @@
 <
     typename TagIn1, typename TagIn2, typename TagOut,
     typename Geometry1, typename Geometry2,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename OutputIterator,
     typename GeometryOut,
     typename Strategy
@@ -65,11 +65,11 @@
         TagIn1, TagIn2, TagOut,
         true, true, true,
         Geometry1, Geometry2,
- Reverse1, Reverse2,
+ Reverse1, Reverse2, ReverseOut,
         OutputIterator, GeometryOut,
         Strategy
> : detail::overlay::overlay
- <Geometry1, Geometry2, Reverse1, Reverse2, OutputIterator, GeometryOut, 1, clockwise, Strategy>
+ <Geometry1, Geometry2, Reverse1, Reverse2, ReverseOut, OutputIterator, GeometryOut, 1, Strategy>
 {};
 
 
@@ -79,7 +79,7 @@
     typename GeometryTag1, typename GeometryTag2, typename GeometryTag3,
     bool Areal1, bool Areal2, bool ArealOut,
     typename Geometry1, typename Geometry2,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename OutputIterator, typename GeometryOut,
     typename Strategy
>
@@ -94,7 +94,7 @@
                 GeometryTag2, GeometryTag1, GeometryTag3,
                 Areal2, Areal1, ArealOut,
                 Geometry2, Geometry1,
- Reverse2, Reverse1,
+ Reverse2, Reverse1, ReverseOut,
                 OutputIterator, GeometryOut,
                 Strategy
>::apply(g2, g1, out, strategy);
@@ -112,7 +112,7 @@
 template
 <
     typename GeometryOut,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename Geometry1, typename Geometry2,
     typename OutputIterator,
     typename Strategy
@@ -136,6 +136,7 @@
                 Geometry1, Geometry2,
                 overlay::do_reverse<point_order<Geometry1>::value, Reverse1>::value,
                 overlay::do_reverse<point_order<Geometry2>::value, Reverse2>::value,
+ ReverseOut,
                 OutputIterator, GeometryOut,
                 Strategy
>,
@@ -150,6 +151,7 @@
                 Geometry1, Geometry2,
                 overlay::do_reverse<point_order<Geometry1>::value, Reverse1>::value,
                 overlay::do_reverse<point_order<Geometry2>::value, Reverse2>::value,
+ ReverseOut,
                 OutputIterator, GeometryOut,
                 Strategy
>
@@ -187,7 +189,7 @@
             OutputIterator out,
             Strategy const& strategy)
 {
- return detail::union_::inserter<GeometryOut, false, false>(geometry1, geometry2, out, strategy);
+ return detail::union_::inserter<GeometryOut, false, false, true>(geometry1, geometry2, out, strategy);
 }
 
 /*!

Modified: sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian2d.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian2d.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian2d.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -1,27 +1 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands.
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_EXTENSION_NSPHERE_GEOMETRIES_CARTESIAN2D_HPP
-#define BOOST_GEOMETRY_EXTENSION_NSPHERE_GEOMETRIES_CARTESIAN2D_HPP
-
-
-#include <boost/geometry/geometries/cartesian2d.hpp>
-#include <boost/geometry/extensions/nsphere/geometries/nsphere.hpp>
-
-namespace boost { namespace geometry
-{
-
-namespace model { namespace d2
-{
-
-typedef model::nsphere<d2::point, double> circle;
-
-}} // namespace model::d2
-
-}} // namespace boost::geometry
-
-#endif // BOOST_GEOMETRY_EXTENSION_NSPHERE_GEOMETRIES_CARTESIAN2D_HPP
+// obsolete
\ No newline at end of file

Modified: sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian3d.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian3d.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/nsphere/geometries/cartesian3d.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -1,27 +1 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands.
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_EXTENSION_NSPHERE_GEOMETRIES_CARTESIAN3D_HPP
-#define BOOST_GEOMETRY_EXTENSION_NSPHERE_GEOMETRIES_CARTESIAN3D_HPP
-
-
-#include <boost/geometry/geometries/cartesian3d.hpp>
-#include <boost/geometry/extensions/nsphere/geometries/nsphere.hpp>
-
-namespace boost { namespace geometry
-{
-
-namespace model { namespace d3
-{
-
-typedef model::nsphere<d3::point, double> sphere;
-
-}} // namespace model::d3
-
-}} // namespace boost::geometry
-
-#endif // BOOST_GEOMETRY_EXTENSION_NSPHERE_GEOMETRIES_CARTESIAN3D_HPP
+// obsolete
\ No newline at end of file

Modified: sandbox/geometry/boost/geometry/extensions/nsphere/nsphere.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/nsphere/nsphere.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/nsphere/nsphere.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -18,8 +18,6 @@
 #include <boost/geometry/extensions/nsphere/geometries/concepts/check.hpp>
 #include <boost/geometry/extensions/nsphere/geometries/concepts/nsphere_concept.hpp>
 
-#include <boost/geometry/extensions/nsphere/geometries/cartesian2d.hpp>
-#include <boost/geometry/extensions/nsphere/geometries/cartesian3d.hpp>
 #include <boost/geometry/extensions/nsphere/geometries/nsphere.hpp>
 
 #include <boost/geometry/extensions/nsphere/algorithms/append.hpp>

Modified: sandbox/geometry/boost/geometry/geometries/cartesian2d.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometries/cartesian2d.hpp (original)
+++ sandbox/geometry/boost/geometry/geometries/cartesian2d.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -1,36 +1,2 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands.
-// Copyright Bruno Lalande 2008, 2009
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
+// obsolete
 
-#ifndef BOOST_GEOMETRY_GEOMETRIES_CARTESIAN2D_HPP
-#define BOOST_GEOMETRY_GEOMETRIES_CARTESIAN2D_HPP
-
-// Predeclare common Cartesian 2D points for convenience
-// Note that they are always "double"
-
-#include <boost/geometry/geometries/geometries.hpp>
-
-namespace boost { namespace geometry
-{
-
-namespace model { namespace d2
-{
-
-typedef model::d2::point_xy<double, cs::cartesian> point;
-typedef model::linestring<point> linestring;
-typedef model::linear_ring<point> ring;
-typedef model::polygon<point> polygon;
-typedef model::box<point> box;
-typedef model::segment<point> segment;
-
-
-}} // namespace model::d2
-
-
-}} // namespace boost::geometry
-
-#endif // BOOST_GEOMETRY_GEOMETRIES_CARTESIAN2D_HPP

Modified: sandbox/geometry/boost/geometry/geometries/cartesian3d.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometries/cartesian3d.hpp (original)
+++ sandbox/geometry/boost/geometry/geometries/cartesian3d.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -1,37 +1 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Copyright Barend Gehrels 2007-2009, Geodan, Amsterdam, the Netherlands.
-// Copyright Bruno Lalande 2008, 2009
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_GEOMETRIES_CARTESIAN3D_HPP
-#define BOOST_GEOMETRY_GEOMETRIES_CARTESIAN3D_HPP
-
-// Predeclare common Cartesian 3D points for convenience
-
-#include <boost/geometry/geometries/geometries.hpp>
-
-namespace boost { namespace geometry
-{
-
-namespace model { namespace d3
-{
-
-// Todo: create point_xyz in between to enable methods .x(), .y(), .z()
-// the same way as d2::point has
-
-typedef model::point<double, 3, cs::cartesian> point;
-typedef model::linestring<point> linestring;
-typedef model::linear_ring<point> ring;
-typedef model::polygon<point> polygon;
-typedef model::box<point> box;
-
-}} // namespace model::d3
-
-
-}} // namespace boost::geometry
-
-
-#endif // BOOST_GEOMETRY_GEOMETRIES_CARTESIAN3D_HPP
+// obsolete

Modified: sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -68,8 +68,7 @@
     typename MultiPolygon,
     bool Reverse,
     typename SegmentIdentifier,
- typename RangeOut,
- order_selector Order
+ typename RangeOut
>
 struct copy_segments
     <
@@ -77,8 +76,7 @@
         MultiPolygon,
         Reverse,
         SegmentIdentifier,
- RangeOut,
- Order
+ RangeOut
>
     : detail::copy_segments::copy_segments_multi
         <

Modified: sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -30,6 +30,7 @@
 template
 <
     typename Multi,
+ bool Reverse,
     typename Box,
     typename Turns,
     typename TurnPolicy,
@@ -55,7 +56,7 @@
             // Call its single version
             get_turns_polygon_cs
                 <
- typename boost::range_value<Multi>::type,
+ typename boost::range_value<Multi>::type, Reverse,
                     Box,
                     Turns, TurnPolicy, InterruptPolicy
>::apply(source_id1, *it, source_id2, box,
@@ -92,7 +93,7 @@
>
     : detail::get_turns::get_turns_multi_polygon_cs
         <
- MultiPolygon,
+ MultiPolygon, ReverseMultiPolygon,
             Box,
             Turns,
             TurnPolicy, InterruptPolicy

Modified: sandbox/geometry/boost/geometry/multi/algorithms/intersection.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/algorithms/intersection.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/algorithms/intersection.hpp 2010-12-19 07:17:10 EST (Sun, 19 Dec 2010)
@@ -144,17 +144,16 @@
 template
 <
     typename MultiLinestring1, typename MultiLinestring2,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename OutputIterator, typename GeometryOut,
- typename Strategy//, order_selector Order
+ typename Strategy
>
 struct intersection_inserter
     <
         multi_linestring_tag, multi_linestring_tag, point_tag,
- ////Order, Order, Order,
         false, false, false,
         MultiLinestring1, MultiLinestring2,
- Reverse1, Reverse2,
+ Reverse1, Reverse2, ReverseOut,
         OutputIterator, GeometryOut,
         Strategy
> : detail::intersection::intersection_multi_linestring_multi_linestring_point
@@ -170,16 +169,15 @@
 <
     typename Linestring, typename MultiLinestring,
     typename OutputIterator, typename GeometryOut,
- bool Reverse1, bool Reverse2,
- typename Strategy//, order_selector Order
+ bool Reverse1, bool Reverse2, bool ReverseOut,
+ typename Strategy
>
 struct intersection_inserter
     <
         linestring_tag, multi_linestring_tag, point_tag,
- ////Order, Order, Order,
         false, false, false,
         Linestring, MultiLinestring,
- Reverse1, Reverse2,
+ Reverse1, Reverse2, ReverseOut,
         OutputIterator, GeometryOut,
         Strategy
> : detail::intersection::intersection_linestring_multi_linestring_point
@@ -194,17 +192,16 @@
 template
 <
     typename MultiLinestring, typename Box,
- bool Reverse1, bool Reverse2,
+ bool Reverse1, bool Reverse2, bool ReverseOut,
     typename OutputIterator, typename GeometryOut,
- typename Strategy//, order_selector Order
+ typename Strategy
>
 struct intersection_inserter
     <
         multi_linestring_tag, box_tag, linestring_tag,
- ////Order, Order, Order,
         false, true, false,
         MultiLinestring, Box,
- Reverse1, Reverse2,
+ Reverse1, Reverse2, ReverseOut,
         OutputIterator, GeometryOut,
         Strategy
> : detail::intersection::clip_multi_linestring


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