|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65923 - in sandbox/geometry: boost/geometry/algorithms boost/geometry/algorithms/detail/overlay boost/geometry/algorithms/detail/sections boost/geometry/extensions/io/svg boost/geometry/multi/algorithms boost/geometry/multi/algorithms/detail/overlay libs/geometry/test/algorithms libs/geometry/test/multi/algorithms other/programs/doxygen_xml2qbk
From: barend.gehrels_at_[hidden]
Date: 2010-10-12 09:04:50
Author: barendgehrels
Date: 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
New Revision: 65923
URL: http://svn.boost.org/trac/boost/changeset/65923
Log:
Implemented ccw, plus check on areal feature, to union, conform intersection
Splitted assemble.hpp into get_ring.hpp, convert_ring.hpp, add_to_containment.hpp, overlay.hpp, assemble.hpp
Added some other mpl asserts
Added:
sandbox/geometry/boost/geometry/algorithms/detail/overlay/add_to_containment.hpp (contents, props changed)
sandbox/geometry/boost/geometry/algorithms/detail/overlay/convert_ring.hpp (contents, props changed)
sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_ring.hpp (contents, props changed)
sandbox/geometry/boost/geometry/algorithms/detail/overlay/overlay.hpp (contents, props changed)
sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/add_to_containment.hpp (contents, props changed)
sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp
- copied, changed from r65919, /sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/assemble.hpp
Removed:
sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/assemble.hpp
Text files modified:
sandbox/geometry/boost/geometry/algorithms/detail/overlay/assemble.hpp | 290 ---------------------------------------
sandbox/geometry/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp | 9 +
sandbox/geometry/boost/geometry/algorithms/detail/overlay/copy_segments.hpp | 6
sandbox/geometry/boost/geometry/algorithms/detail/sections/get_full_section.hpp | 9 +
sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp | 9 +
sandbox/geometry/boost/geometry/algorithms/envelope.hpp | 10 +
sandbox/geometry/boost/geometry/algorithms/intersection.hpp | 6
sandbox/geometry/boost/geometry/algorithms/num_points.hpp | 6
sandbox/geometry/boost/geometry/algorithms/union.hpp | 81 ++++++++++
sandbox/geometry/boost/geometry/extensions/io/svg/svg_mapper.hpp | 4
sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp | 49 ------
sandbox/geometry/boost/geometry/multi/algorithms/intersection.hpp | 12 +
sandbox/geometry/boost/geometry/multi/algorithms/union.hpp | 14 +
sandbox/geometry/libs/geometry/test/algorithms/intersection.cpp | 6
sandbox/geometry/libs/geometry/test/algorithms/test_union.hpp | 5
sandbox/geometry/libs/geometry/test/algorithms/union.cpp | 192 ++++++++++++++------------
sandbox/geometry/libs/geometry/test/multi/algorithms/multi_union.cpp | 45 ++++-
sandbox/geometry/other/programs/doxygen_xml2qbk/doxygen_xml2qbk.vcproj | 4
18 files changed, 301 insertions(+), 456 deletions(-)
Added: sandbox/geometry/boost/geometry/algorithms/detail/overlay/add_to_containment.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/add_to_containment.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -0,0 +1,118 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2007-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_ADD_TO_CONTAINMENT_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ADD_TO_CONTAINMENT_HPP
+
+
+#include <boost/mpl/assert.hpp>
+#include <boost/range.hpp>
+
+
+#include <boost/geometry/core/tags.hpp>
+#include <boost/geometry/core/exterior_ring.hpp>
+#include <boost/geometry/core/interior_rings.hpp>
+#include <boost/geometry/algorithms/detail/ring_identifier.hpp>
+
+#include <boost/geometry/algorithms/convert.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace overlay
+{
+
+
+template <typename Tag, typename Geometry>
+struct add_to_containment
+{
+ BOOST_MPL_ASSERT_MSG
+ (
+ false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
+ , (types<Geometry>)
+ );
+};
+
+template <typename Ring>
+struct add_to_containment<ring_tag, Ring>
+{
+ template <typename ContainmentContainer, typename Map>
+ static inline void apply(ContainmentContainer& container,
+ ring_identifier const& id, Ring const& ring, Map const& map,
+ bool dissolve)
+ {
+ typedef typename range_value<ContainmentContainer>::type prop;
+ bool found = map.find(id) != map.end();
+ if (! dissolve || ! found)
+ {
+ // For dissolve, do not add intersected rings
+ container.push_back(prop(id, ring, found));
+ }
+ }
+};
+
+template <typename Box>
+struct add_to_containment<box_tag, Box>
+{
+ template <typename ContainmentContainer, typename Map>
+ static inline void apply(ContainmentContainer& container,
+ ring_identifier const& id, Box const& box, Map const& map,
+ bool dissolve)
+ {
+ typedef typename range_value<ContainmentContainer>::type prop;
+ bool found = map.find(id) != map.end();
+ if (! dissolve || ! found)
+ {
+ container.push_back(prop(id, box, found));
+ }
+ }
+};
+
+
+template <typename Polygon>
+struct add_to_containment<polygon_tag, Polygon>
+{
+ template <typename ContainmentContainer, typename Map>
+ static inline void apply(ContainmentContainer& container,
+ ring_identifier const& id, Polygon const& polygon, Map const& map,
+ bool dissolve)
+ {
+ // Add exterior ring and interior rings
+ ring_identifier copy = id;
+
+ typedef add_to_containment
+ <
+ ring_tag,
+ typename ring_type<Polygon>::type
+ > policy;
+
+ policy::apply(container, copy, exterior_ring(polygon), map, dissolve);
+ copy.ring_index = 0;
+ for (typename boost::range_iterator
+ <
+ typename interior_type<Polygon>::type const
+ >::type it = boost::begin(interior_rings(polygon));
+ it != boost::end(interior_rings(polygon));
+ ++it, ++copy.ring_index)
+ {
+ policy::apply(container, copy, *it, map, dissolve);
+ }
+ }
+};
+
+
+}} // namespace detail::overlay
+#endif // DOXYGEN_NO_DETAIL
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ADD_TO_CONTAINMENT_HPP
Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/assemble.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/assemble.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/assemble.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -14,29 +14,18 @@
#include <vector>
#include <boost/range.hpp>
-#include <boost/mpl/assert.hpp>
-
-#include <boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp>
-#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/get_ring.hpp>
+#include <boost/geometry/algorithms/detail/overlay/convert_ring.hpp>
+#include <boost/geometry/algorithms/detail/overlay/add_to_containment.hpp>
#include <boost/geometry/algorithms/detail/overlay/ring_properties.hpp>
-#include <boost/geometry/algorithms/detail/overlay/reverse_operations.hpp>
//#include <boost/geometry/strategies/intersection_result.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>
-#include <boost/geometry/algorithms/detail/point_on_border.hpp>
-#include <boost/geometry/algorithms/convert.hpp>
#include <boost/geometry/algorithms/combine.hpp>
#include <boost/geometry/algorithms/envelope.hpp>
-#include <boost/geometry/algorithms/num_points.hpp>
#include <boost/geometry/algorithms/within.hpp>
-#include <boost/geometry/iterators/range_type.hpp>
#include <boost/geometry/util/math.hpp>
#include <boost/geometry/strategies/intersection.hpp>
@@ -55,189 +44,6 @@
{
-template<typename Tag>
-struct get_ring
-{};
-
-template<>
-struct get_ring<ring_tag>
-{
- template<typename Ring>
- static inline Ring const& apply(ring_identifier const& , Ring const& ring)
- {
- return ring;
- }
-};
-
-
-template<>
-struct get_ring<void>
-{
- template<typename Container>
- static inline typename boost::range_value<Container>::type const&
- apply(ring_identifier const& id, Container const& container)
- {
- return container[id.multi_index];
- }
-};
-
-
-template<>
-struct get_ring<box_tag>
-{
- template<typename Box>
- static inline Box const& apply(ring_identifier const& ,
- Box const& box)
- {
- return box;
- }
-};
-
-
-template<>
-struct get_ring<polygon_tag>
-{
- template<typename Polygon>
- static inline typename ring_type<Polygon>::type const& apply(
- ring_identifier const& id,
- Polygon const& polygon)
- {
- BOOST_ASSERT
- (
- id.ring_index >= -1
- && id.ring_index < boost::size(interior_rings(polygon))
- );
- return id.ring_index < 0
- ? exterior_ring(polygon)
- : interior_rings(polygon)[id.ring_index];
- }
-};
-
-
-
-
-template<typename Tag>
-struct convert_ring
-{};
-
-template<>
-struct convert_ring<ring_tag>
-{
- template<typename Destination, typename Source>
- static inline void apply(Destination& destination, Source const& source,
- bool append = false)
- {
- if (! append)
- {
- geometry::convert(source, destination);
- }
- }
-};
-
-
-
-
-template<>
-struct convert_ring<polygon_tag>
-{
- template<typename Destination, typename Source>
- static inline void apply(Destination& destination, Source const& source,
- bool append = false)
- {
- if (! append)
- {
- geometry::convert(source, exterior_ring(destination));
- }
- else
- {
- interior_rings(destination).resize(
- interior_rings(destination).size() + 1);
- geometry::convert(source, interior_rings(destination).back());
- }
- }
-};
-
-
-
-template <typename Tag, typename Geometry>
-struct add_to_containment
-{
- BOOST_MPL_ASSERT_MSG
- (
- false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
- , (types<Geometry>)
- );
-};
-
-template <typename Ring>
-struct add_to_containment<ring_tag, Ring>
-{
- template <typename ContainmentContainer, typename Map>
- static inline void apply(ContainmentContainer& container,
- ring_identifier const& id, Ring const& ring, Map const& map,
- bool dissolve)
- {
- typedef typename range_value<ContainmentContainer>::type prop;
- bool found = map.find(id) != map.end();
- if (! dissolve || ! found)
- {
- // For dissolve, do not add intersected rings
- container.push_back(prop(id, ring, found));
- }
- }
-};
-
-template <typename Box>
-struct add_to_containment<box_tag, Box>
-{
- template <typename ContainmentContainer, typename Map>
- static inline void apply(ContainmentContainer& container,
- ring_identifier const& id, Box const& box, Map const& map,
- bool dissolve)
- {
- typedef typename range_value<ContainmentContainer>::type prop;
- bool found = map.find(id) != map.end();
- if (! dissolve || ! found)
- {
- container.push_back(prop(id, box, found));
- }
- }
-};
-
-
-template <typename Polygon>
-struct add_to_containment<polygon_tag, Polygon>
-{
- template <typename ContainmentContainer, typename Map>
- static inline void apply(ContainmentContainer& container,
- ring_identifier const& id, Polygon const& polygon, Map const& map,
- bool dissolve)
- {
- // Add exterior ring and interior rings
- ring_identifier copy = id;
-
- typedef add_to_containment
- <
- ring_tag,
- typename ring_type<Polygon>::type
- > policy;
-
- policy::apply(container, copy, exterior_ring(polygon), map, dissolve);
- copy.ring_index = 0;
- for (typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type it = boost::begin(interior_rings(polygon));
- it != boost::end(interior_rings(polygon));
- ++it, ++copy.ring_index)
- {
- policy::apply(container, copy, *it, map, dissolve);
- }
- }
-};
-
-
-
template <typename TurnPoints, typename Map>
inline void map_turns(Map& map, TurnPoints const& turn_points)
{
@@ -250,7 +56,7 @@
it != boost::end(turn_points);
++it, ++index)
{
- if (! it->ignore())
+ if (! it->ignore())
{
int op_index = 0;
for (typename boost::range_iterator<container_type const>::type
@@ -623,7 +429,7 @@
template
<
- typename GeometryOut,
+ typename GeometryOut,
typename Rings, typename Map,
typename Geometry1, typename Geometry2,
typename OutputIterator
@@ -758,92 +564,6 @@
}
-template
-<
- typename Geometry1, typename Geometry2,
- typename OutputIterator, typename GeometryOut,
- int Direction, bool ClockWise,
- typename Strategy
->
-struct overlay
-{
- static inline OutputIterator apply(
- Geometry1 const& geometry1, Geometry2 const& geometry2,
- OutputIterator out,
- Strategy const& )
- {
- if (geometry::num_points(geometry1) == 0 && geometry::num_points(geometry2) == 0)
- {
- return out;
- }
-
- typedef typename geometry::point_type<GeometryOut>::type point_type;
- typedef detail::overlay::traversal_turn_info<point_type> turn_info;
- typedef std::deque<turn_info> container_type;
-
- // "Use" rangetype for ringtype:
- // for polygon, it is the type of the exterior ring.
- // for ring, it is the ring itself. That is what is
- // for multi-polygon, it is also the type of the ring.
- typedef typename geometry::range_type<GeometryOut>::type ring_type;
-
- // If one input is empty, output the other one for a union.
- // For an intersection, the intersection is empty.
- if (geometry::num_points(geometry1) == 0
- || geometry::num_points(geometry2) == 0)
- {
- if (Direction == 1)
- {
- std::map<ring_identifier, int> map;
- std::vector<ring_type> rings;
- return assemble<GeometryOut>(rings, map,
- geometry1, geometry2, Direction, false, false, out);
- }
- return out;
- }
-
- container_type turn_points;
-
-#ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE
-std::cout << "get turns" << std::endl;
-#endif
- detail::get_turns::no_interrupt_policy policy;
- boost::geometry::get_turns
- <
- detail::overlay::calculate_distance_policy
- >(geometry1, geometry2, turn_points, policy);
-
- if (! ClockWise)
- {
- detail::overlay::reverse_operations(turn_points);
- }
-
-#ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE
-std::cout << "enrich" << std::endl;
-#endif
- typename Strategy::side_strategy_type side_strategy;
- geometry::enrich_intersection_points(turn_points, geometry1, geometry2,
- side_strategy);
-
-#ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE
-std::cout << "traverse" << std::endl;
-#endif
- std::vector<ring_type> rings;
- geometry::traverse(geometry1, geometry2,
- Direction == -1
- ? boost::geometry::detail::overlay::operation_intersection
- : boost::geometry::detail::overlay::operation_union
- ,
- turn_points, rings);
-
- std::map<ring_identifier, int> map;
- map_turns(map, turn_points);
- return assemble<GeometryOut>(rings, map,
- geometry1, geometry2, Direction, false, false, out);
- }
-};
-
-
}} // namespace detail::overlay
#endif // DOXYGEN_NO_DETAIL
Added: sandbox/geometry/boost/geometry/algorithms/detail/overlay/convert_ring.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/convert_ring.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -0,0 +1,79 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2007-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_CONVERT_RING_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_CONVERT_RING_HPP
+
+
+#include <boost/range.hpp>
+
+
+#include <boost/geometry/core/tags.hpp>
+#include <boost/geometry/core/exterior_ring.hpp>
+#include <boost/geometry/core/interior_rings.hpp>
+#include <boost/geometry/algorithms/detail/ring_identifier.hpp>
+
+#include <boost/geometry/algorithms/convert.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace overlay
+{
+
+
+template<typename Tag>
+struct convert_ring
+{};
+
+template<>
+struct convert_ring<ring_tag>
+{
+ template<typename Destination, typename Source>
+ static inline void apply(Destination& destination, Source const& source,
+ bool append = false)
+ {
+ if (! append)
+ {
+ geometry::convert(source, destination);
+ }
+ }
+};
+
+
+template<>
+struct convert_ring<polygon_tag>
+{
+ template<typename Destination, typename Source>
+ static inline void apply(Destination& destination, Source const& source,
+ bool append = false)
+ {
+ if (! append)
+ {
+ geometry::convert(source, exterior_ring(destination));
+ }
+ else
+ {
+ interior_rings(destination).resize(
+ interior_rings(destination).size() + 1);
+ geometry::convert(source, interior_rings(destination).back());
+ }
+ }
+};
+
+
+}} // namespace detail::overlay
+#endif // DOXYGEN_NO_DETAIL
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_CONVERT_RING_HPP
Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -10,6 +10,7 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_COPY_SEGMENT_POINT_HPP
+#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>
#include <boost/geometry/core/ring_type.hpp>
@@ -129,7 +130,13 @@
typename PointOut
>
struct copy_segment_point
-{};
+{
+ BOOST_MPL_ASSERT_MSG
+ (
+ false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
+ , (types<GeometryIn>)
+ );
+};
template <typename LineString, typename SegmentIdentifier, typename PointOut>
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-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -10,6 +10,7 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_COPY_SEGMENTS_HPP
+#include <boost/mpl/assert.hpp>
#include <vector>
#include <boost/assert.hpp>
@@ -160,6 +161,11 @@
>
struct copy_segments
{
+ BOOST_MPL_ASSERT_MSG
+ (
+ false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
+ , (types<GeometryIn>)
+ );
};
Added: sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_ring.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_ring.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -0,0 +1,97 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2007-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_GET_RING_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_RING_HPP
+
+
+#include <boost/assert.hpp>
+#include <boost/range.hpp>
+
+
+#include <boost/geometry/core/tags.hpp>
+#include <boost/geometry/core/exterior_ring.hpp>
+#include <boost/geometry/core/interior_rings.hpp>
+#include <boost/geometry/algorithms/detail/ring_identifier.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace overlay
+{
+
+
+template<typename Tag>
+struct get_ring
+{};
+
+template<>
+struct get_ring<ring_tag>
+{
+ template<typename Ring>
+ static inline Ring const& apply(ring_identifier const& , Ring const& ring)
+ {
+ return ring;
+ }
+};
+
+
+template<>
+struct get_ring<void>
+{
+ template<typename Container>
+ static inline typename boost::range_value<Container>::type const&
+ apply(ring_identifier const& id, Container const& container)
+ {
+ return container[id.multi_index];
+ }
+};
+
+
+template<>
+struct get_ring<box_tag>
+{
+ template<typename Box>
+ static inline Box const& apply(ring_identifier const& ,
+ Box const& box)
+ {
+ return box;
+ }
+};
+
+
+template<>
+struct get_ring<polygon_tag>
+{
+ template<typename Polygon>
+ static inline typename ring_type<Polygon>::type const& apply(
+ ring_identifier const& id,
+ Polygon const& polygon)
+ {
+ BOOST_ASSERT
+ (
+ id.ring_index >= -1
+ && id.ring_index < boost::size(interior_rings(polygon))
+ );
+ return id.ring_index < 0
+ ? exterior_ring(polygon)
+ : interior_rings(polygon)[id.ring_index];
+ }
+};
+
+
+}} // namespace detail::overlay
+#endif // DOXYGEN_NO_DETAIL
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_RING_HPP
Added: sandbox/geometry/boost/geometry/algorithms/detail/overlay/overlay.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/overlay.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -0,0 +1,144 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2007-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_OVERLAY_HPP
+#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_OVERLAY_HPP
+
+
+#include <deque>
+#include <map>
+#include <vector>
+
+#include <boost/range.hpp>
+#include <boost/mpl/assert.hpp>
+
+
+#include <boost/geometry/algorithms/detail/overlay/assemble.hpp>
+#include <boost/geometry/algorithms/detail/overlay/calculate_distance_policy.hpp>
+#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>
+
+
+#include <boost/geometry/algorithms/num_points.hpp>
+
+#include <boost/geometry/iterators/range_type.hpp>
+
+
+#ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE
+# include <boost/geometry/util/write_dsv.hpp>
+#endif
+
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace overlay
+{
+
+
+
+template
+<
+ typename Geometry1, typename Geometry2,
+ typename OutputIterator, typename GeometryOut,
+ int Direction, bool ClockWise,
+ typename Strategy
+>
+struct overlay
+{
+ static inline OutputIterator apply(
+ Geometry1 const& geometry1, Geometry2 const& geometry2,
+ OutputIterator out,
+ Strategy const& )
+ {
+ if (geometry::num_points(geometry1) == 0 && geometry::num_points(geometry2) == 0)
+ {
+ return out;
+ }
+
+ typedef typename geometry::point_type<GeometryOut>::type point_type;
+ typedef detail::overlay::traversal_turn_info<point_type> turn_info;
+ typedef std::deque<turn_info> container_type;
+
+ // "Use" rangetype for ringtype:
+ // for polygon, it is the type of the exterior ring.
+ // for ring, it is the ring itself. That is what is
+ // for multi-polygon, it is also the type of the ring.
+ typedef typename geometry::range_type<GeometryOut>::type ring_type;
+
+ // If one input is empty, output the other one for a union.
+ // For an intersection, the intersection is empty.
+ if (geometry::num_points(geometry1) == 0
+ || geometry::num_points(geometry2) == 0)
+ {
+ if (Direction == 1)
+ {
+ std::map<ring_identifier, int> map;
+ std::vector<ring_type> rings;
+ return assemble<GeometryOut>(rings, map,
+ geometry1, geometry2, Direction, false, false, out);
+ }
+ return out;
+ }
+
+ container_type turn_points;
+
+#ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE
+std::cout << "get turns" << std::endl;
+#endif
+ detail::get_turns::no_interrupt_policy policy;
+ boost::geometry::get_turns
+ <
+ detail::overlay::calculate_distance_policy
+ >(geometry1, geometry2, turn_points, policy);
+
+ if (! ClockWise)
+ {
+ detail::overlay::reverse_operations(turn_points);
+ }
+
+#ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE
+std::cout << "enrich" << std::endl;
+#endif
+ typename Strategy::side_strategy_type side_strategy;
+ geometry::enrich_intersection_points(turn_points, geometry1, geometry2,
+ side_strategy);
+
+#ifdef BOOST_GEOMETRY_DEBUG_ASSEMBLE
+std::cout << "traverse" << std::endl;
+#endif
+ std::vector<ring_type> rings;
+ geometry::traverse(geometry1, geometry2,
+ Direction == -1
+ ? boost::geometry::detail::overlay::operation_intersection
+ : boost::geometry::detail::overlay::operation_union
+ ,
+ turn_points, rings);
+
+ std::map<ring_identifier, int> map;
+ map_turns(map, turn_points);
+ return assemble<GeometryOut>(rings, map,
+ geometry1, geometry2, Direction, false, false, out);
+ }
+};
+
+
+}} // namespace detail::overlay
+#endif // DOXYGEN_NO_DETAIL
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_OVERLAY_HPP
Modified: sandbox/geometry/boost/geometry/algorithms/detail/sections/get_full_section.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/sections/get_full_section.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/sections/get_full_section.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -9,6 +9,7 @@
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SECTIONS_GET_FULL_SECTION_HPP
+#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>
#include <boost/geometry/core/access.hpp>
@@ -75,7 +76,13 @@
typename Iterator
>
struct get_full_section
-{};
+{
+ BOOST_MPL_ASSERT_MSG
+ (
+ false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
+ , (types<Geometry>)
+ );
+};
template <typename LineString, typename Section, typename Iterator>
Modified: sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -12,6 +12,7 @@
#include <cstddef>
#include <vector>
+#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>
#include <boost/geometry/algorithms/assign.hpp>
@@ -496,7 +497,13 @@
std::size_t MaxCount
>
struct sectionalize
-{};
+{
+ BOOST_MPL_ASSERT_MSG
+ (
+ false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
+ , (types<Geometry>)
+ );
+};
template
<
Modified: sandbox/geometry/boost/geometry/algorithms/envelope.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/envelope.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/envelope.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -9,6 +9,7 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_ENVELOPE_HPP
#define BOOST_GEOMETRY_ALGORITHMS_ENVELOPE_HPP
+#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>
#include <boost/numeric/conversion/cast.hpp>
@@ -86,7 +87,14 @@
typename Geometry, typename Box,
typename StrategyLess, typename StrategyGreater
>
-struct envelope {};
+struct envelope
+{
+ BOOST_MPL_ASSERT_MSG
+ (
+ false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
+ , (types<Geometry>)
+ );
+};
template
Modified: sandbox/geometry/boost/geometry/algorithms/intersection.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/intersection.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/intersection.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -17,13 +17,13 @@
#include <boost/range/metafunctions.hpp>
-#include <boost/geometry/core/reverse_dispatch.hpp>
#include <boost/geometry/core/is_areal.hpp>
+#include <boost/geometry/core/point_order.hpp>
+#include <boost/geometry/core/reverse_dispatch.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
#include <boost/geometry/algorithms/detail/overlay/clip_linestring.hpp>
-#include <boost/geometry/algorithms/detail/overlay/assemble.hpp>
-#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
#include <boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp>
+#include <boost/geometry/algorithms/detail/overlay/overlay.hpp>
#include <boost/geometry/ranges/segment_range.hpp>
Modified: sandbox/geometry/boost/geometry/algorithms/num_points.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/num_points.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/num_points.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -11,6 +11,7 @@
#include <cstddef>
+#include <boost/mpl/assert.hpp>
#include <boost/range.hpp>
#include <boost/geometry/core/is_linear.hpp>
@@ -78,6 +79,11 @@
template <typename GeometryTag, bool Linear, typename Geometry>
struct num_points
{
+ BOOST_MPL_ASSERT_MSG
+ (
+ false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE
+ , (types<Geometry>)
+ );
};
template <typename GeometryTag, typename Geometry>
Modified: sandbox/geometry/boost/geometry/algorithms/union.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/union.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/union.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -14,11 +14,11 @@
#include <boost/range/metafunctions.hpp>
-#include <boost/geometry/core/interior_rings.hpp>
+#include <boost/geometry/core/is_areal.hpp>
+#include <boost/geometry/core/point_order.hpp>
#include <boost/geometry/core/reverse_dispatch.hpp>
#include <boost/geometry/geometries/concepts/check.hpp>
-#include <boost/geometry/algorithms/detail/overlay/assemble.hpp>
-#include <boost/geometry/algorithms/within.hpp>
+#include <boost/geometry/algorithms/detail/overlay/overlay.hpp>
namespace boost { namespace geometry
@@ -30,22 +30,75 @@
template
<
- typename Tag1, typename Tag2, typename Tag3,
- typename G1, typename G2,
+ // tag dispatching:
+ typename TagIn1, typename TagIn2, typename TagOut,
+ // orientation
+ order_selector Order1, order_selector Order2, order_selector OrderOut,
+ // metafunction finetuning helpers:
+ bool Areal1, bool Areal2, bool ArealOut,
+ // real types
+ typename Geometry1, typename Geometry2,
typename OutputIterator,
typename GeometryOut,
typename Strategy
>
struct union_inserter
- : detail::overlay::overlay
- <G1, G2, OutputIterator, GeometryOut, 1, true, Strategy>
{
+ BOOST_MPL_ASSERT_MSG
+ (
+ false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPES
+ , (types<Geometry1, Geometry2, GeometryOut>)
+ );
};
template
<
+ typename TagIn1, typename TagIn2, typename TagOut,
+ typename Geometry1, typename Geometry2,
+ typename OutputIterator,
+ typename GeometryOut,
+ typename Strategy
+>
+struct union_inserter
+ <
+ TagIn1, TagIn2, TagOut,
+ clockwise, clockwise, clockwise,
+ true, true, true,
+ Geometry1, Geometry2,
+ OutputIterator, GeometryOut,
+ Strategy
+ > : detail::overlay::overlay
+ <Geometry1, Geometry2, OutputIterator, GeometryOut, 1, true, Strategy>
+{};
+
+
+template
+<
+ typename TagIn1, typename TagIn2, typename TagOut,
+ typename Geometry1, typename Geometry2,
+ typename OutputIterator,
+ typename GeometryOut,
+ typename Strategy
+>
+struct union_inserter
+ <
+ TagIn1, TagIn2, TagOut,
+ counterclockwise, counterclockwise, counterclockwise,
+ true, true, true,
+ Geometry1, Geometry2,
+ OutputIterator, GeometryOut,
+ Strategy
+ > : detail::overlay::overlay
+ <Geometry1, Geometry2, OutputIterator, GeometryOut, 1, false, Strategy>
+{};
+
+
+template
+<
typename GeometryTag1, typename GeometryTag2, typename GeometryTag3,
+ order_selector Order1, order_selector Order2, order_selector OrderOut,
+ bool Areal1, bool Areal2, bool ArealOut,
typename Geometry1, typename Geometry2,
typename OutputIterator, typename GeometryOut,
typename Strategy
@@ -59,6 +112,8 @@
return union_inserter
<
GeometryTag2, GeometryTag1, GeometryTag3,
+ Order2, Order1, OrderOut,
+ Areal2, Areal1, ArealOut,
Geometry2, Geometry1,
OutputIterator, GeometryOut,
Strategy
@@ -109,6 +164,12 @@
typename tag<Geometry1>::type,
typename tag<Geometry2>::type,
typename tag<GeometryOut>::type,
+ point_order<Geometry1>::value,
+ point_order<Geometry2>::value,
+ point_order<GeometryOut>::value,
+ is_areal<Geometry1>::value,
+ is_areal<Geometry2>::value,
+ is_areal<GeometryOut>::value,
Geometry1,
Geometry2,
OutputIterator, GeometryOut,
@@ -119,6 +180,12 @@
typename tag<Geometry1>::type,
typename tag<Geometry2>::type,
typename tag<GeometryOut>::type,
+ point_order<Geometry1>::value,
+ point_order<Geometry2>::value,
+ point_order<GeometryOut>::value,
+ is_areal<Geometry1>::value,
+ is_areal<Geometry2>::value,
+ is_areal<GeometryOut>::value,
Geometry1,
Geometry2,
OutputIterator, GeometryOut,
Modified: sandbox/geometry/boost/geometry/extensions/io/svg/svg_mapper.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/io/svg/svg_mapper.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/io/svg/svg_mapper.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -35,8 +35,10 @@
#include <boost/geometry/geometries/point_xy.hpp>
-
+#include <boost/geometry/multi/core/is_multi.hpp>
#include <boost/geometry/multi/core/tags.hpp>
+#include <boost/geometry/multi/algorithms/envelope.hpp>
+#include <boost/geometry/multi/algorithms/num_points.hpp>
#include <boost/geometry/extensions/io/svg/write_svg.hpp>
Added: sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/add_to_containment.hpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/add_to_containment.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -0,0 +1,62 @@
+// 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_MULTI_ALGORITHMS_DETAIL_OVERLAY_ADD_TO_CONTAINMENT_HPP
+#define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_ADD_TO_CONTAINMENT_HPP
+
+
+#include <boost/range.hpp>
+
+#include <boost/geometry/algorithms/detail/ring_identifier.hpp>
+#include <boost/geometry/algorithms/detail/overlay/add_to_containment.hpp>
+#include <boost/geometry/multi/core/tags.hpp>
+
+
+namespace boost { namespace geometry
+{
+
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace overlay
+{
+
+
+template <typename MultiPolygon>
+struct add_to_containment<multi_polygon_tag, MultiPolygon>
+{
+ template <typename ContainmentContainer, typename Map>
+ static inline void apply(ContainmentContainer& container,
+ ring_identifier const& id, MultiPolygon const& multi_polygon,
+ Map const& map, bool dissolve)
+ {
+ ring_identifier copy = id;
+ copy.multi_index = 0;
+
+ // Add all rings with the updated index
+ for (typename boost::range_iterator<MultiPolygon const>::type it
+ = boost::begin(multi_polygon);
+ it != boost::end(multi_polygon);
+ ++it, ++copy.multi_index)
+ {
+ add_to_containment
+ <
+ polygon_tag,
+ typename boost::range_value<MultiPolygon>::type
+ >::apply(container, copy, *it, map, dissolve);
+ }
+ }
+};
+
+
+}} // namespace detail::overlay
+#endif // DOXYGEN_NO_DETAIL
+
+
+}} // namespace boost::geometry
+
+
+#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_ADD_TO_CONTAINMENT_HPP
Deleted: sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/assemble.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/assemble.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
+++ (empty file)
@@ -1,94 +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_MULTI_ALGORITHMS_DETAIL_OVERLAY_ASSEMBLE_HPP
-#define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_ASSEMBLE_HPP
-
-
-#include <boost/assert.hpp>
-#include <boost/range.hpp>
-
-#include <boost/geometry/algorithms/detail/overlay/assemble.hpp>
-
-#include <boost/geometry/multi/core/ring_type.hpp>
-
-#include <boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp>
-#include <boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp>
-#include <boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp>
-#include <boost/geometry/multi/algorithms/detail/point_on_border.hpp>
-#include <boost/geometry/multi/algorithms/detail/sections/get_full_section.hpp>
-
-#include <boost/geometry/multi/algorithms/envelope.hpp>
-#include <boost/geometry/multi/algorithms/num_points.hpp>
-#include <boost/geometry/multi/algorithms/within.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-
-#ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace overlay
-{
-
-
-template <typename MultiPolygon>
-struct add_to_containment<multi_polygon_tag, MultiPolygon>
-{
- template <typename ContainmentContainer, typename Map>
- static inline void apply(ContainmentContainer& container,
- ring_identifier const& id, MultiPolygon const& multi_polygon,
- Map const& map, bool dissolve)
- {
- ring_identifier copy = id;
- copy.multi_index = 0;
-
- // Add all rings with the updated index
- for (typename boost::range_iterator<MultiPolygon const>::type it
- = boost::begin(multi_polygon);
- it != boost::end(multi_polygon);
- ++it, ++copy.multi_index)
- {
- add_to_containment
- <
- polygon_tag,
- typename boost::range_value<MultiPolygon>::type
- >::apply(container, copy, *it, map, dissolve);
- }
- }
-};
-
-
-
-template<>
-struct get_ring<multi_polygon_tag>
-{
- template<typename MultiPolygon>
- static inline typename ring_type<MultiPolygon>::type const& apply(
- ring_identifier const& id,
- MultiPolygon const& multi_polygon)
- {
- BOOST_ASSERT
- (
- id.multi_index >= 0
- && id.multi_index < boost::size(multi_polygon)
- );
- return get_ring<polygon_tag>::apply(id,
- multi_polygon[id.multi_index]);
- }
-};
-
-
-
-}} // namespace detail::overlay
-#endif // DOXYGEN_NO_DETAIL
-
-
-}} // namespace boost::geometry
-
-
-#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_ASSEMBLE_HPP
Copied: sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp (from r65919, /sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/assemble.hpp)
==============================================================================
--- /sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/assemble.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -5,28 +5,16 @@
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
-#ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_ASSEMBLE_HPP
-#define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_ASSEMBLE_HPP
+#ifndef BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_GET_RING_HPP
+#define BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_GET_RING_HPP
#include <boost/assert.hpp>
#include <boost/range.hpp>
-#include <boost/geometry/algorithms/detail/overlay/assemble.hpp>
-
+#include <boost/geometry/algorithms/detail/overlay/get_ring.hpp>
#include <boost/geometry/multi/core/ring_type.hpp>
-#include <boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp>
-#include <boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp>
-#include <boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp>
-#include <boost/geometry/multi/algorithms/detail/point_on_border.hpp>
-#include <boost/geometry/multi/algorithms/detail/sections/get_full_section.hpp>
-
-#include <boost/geometry/multi/algorithms/envelope.hpp>
-#include <boost/geometry/multi/algorithms/num_points.hpp>
-#include <boost/geometry/multi/algorithms/within.hpp>
-
-
namespace boost { namespace geometry
{
@@ -35,35 +23,6 @@
namespace detail { namespace overlay
{
-
-template <typename MultiPolygon>
-struct add_to_containment<multi_polygon_tag, MultiPolygon>
-{
- template <typename ContainmentContainer, typename Map>
- static inline void apply(ContainmentContainer& container,
- ring_identifier const& id, MultiPolygon const& multi_polygon,
- Map const& map, bool dissolve)
- {
- ring_identifier copy = id;
- copy.multi_index = 0;
-
- // Add all rings with the updated index
- for (typename boost::range_iterator<MultiPolygon const>::type it
- = boost::begin(multi_polygon);
- it != boost::end(multi_polygon);
- ++it, ++copy.multi_index)
- {
- add_to_containment
- <
- polygon_tag,
- typename boost::range_value<MultiPolygon>::type
- >::apply(container, copy, *it, map, dissolve);
- }
- }
-};
-
-
-
template<>
struct get_ring<multi_polygon_tag>
{
@@ -91,4 +50,4 @@
}} // namespace boost::geometry
-#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_ASSEMBLE_HPP
+#endif // BOOST_GEOMETRY_MULTI_ALGORITHMS_DETAIL_OVERLAY_GET_RING_HPP
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-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -10,9 +10,19 @@
#include <boost/geometry/algorithms/intersection.hpp>
+#include <boost/geometry/multi/core/geometry_id.hpp>
#include <boost/geometry/multi/core/is_areal.hpp>
#include <boost/geometry/multi/core/point_order.hpp>
-#include <boost/geometry/multi/algorithms/detail/overlay/assemble.hpp>
+#include <boost/geometry/multi/algorithms/envelope.hpp>
+#include <boost/geometry/multi/algorithms/num_points.hpp>
+#include <boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp>
+#include <boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp>
+#include <boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp>
+#include <boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp>
+#include <boost/geometry/multi/algorithms/detail/overlay/add_to_containment.hpp>
+#include <boost/geometry/multi/algorithms/detail/sections/get_section.hpp>
+#include <boost/geometry/multi/algorithms/detail/sections/get_full_section.hpp>
+#include <boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp>
namespace boost { namespace geometry
Modified: sandbox/geometry/boost/geometry/multi/algorithms/union.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/algorithms/union.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/algorithms/union.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -10,7 +10,19 @@
#include <boost/geometry/algorithms/union.hpp>
-#include <boost/geometry/multi/algorithms/detail/overlay/assemble.hpp>
+#include <boost/geometry/multi/core/geometry_id.hpp>
+#include <boost/geometry/multi/core/is_areal.hpp>
+#include <boost/geometry/multi/core/point_order.hpp>
+#include <boost/geometry/multi/algorithms/envelope.hpp>
+#include <boost/geometry/multi/algorithms/num_points.hpp>
+#include <boost/geometry/multi/algorithms/detail/overlay/get_ring.hpp>
+#include <boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp>
+#include <boost/geometry/multi/algorithms/detail/overlay/copy_segments.hpp>
+#include <boost/geometry/multi/algorithms/detail/overlay/copy_segment_point.hpp>
+#include <boost/geometry/multi/algorithms/detail/overlay/add_to_containment.hpp>
+#include <boost/geometry/multi/algorithms/detail/sections/get_section.hpp>
+#include <boost/geometry/multi/algorithms/detail/sections/get_full_section.hpp>
+#include <boost/geometry/multi/algorithms/detail/sections/sectionalize.hpp>
namespace boost { namespace geometry
{
Modified: sandbox/geometry/libs/geometry/test/algorithms/intersection.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/intersection.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/intersection.cpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -21,7 +21,7 @@
template <typename Polygon>
-void test_polygons()
+void test_areal()
{
test_one<Polygon, Polygon, Polygon>("simplex_normal",
simplex_normal[0], simplex_normal[1],
@@ -159,10 +159,10 @@
std::string clip = "box(2 2,8 8)";
// Test clockwise polygons
- test_polygons<polygon>();
+ test_areal<polygon>();
// Test counter-clockwise polygons
- test_polygons<boost::geometry::polygon<P, std::vector, std::vector, false> >();
+ test_areal<boost::geometry::polygon<P, std::vector, std::vector, false> >();
// Basic check: box/linestring, is clipping OK? should compile in any order
Modified: sandbox/geometry/libs/geometry/test/algorithms/test_union.hpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/test_union.hpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/test_union.hpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -15,6 +15,7 @@
#include <boost/geometry/algorithms/union.hpp>
#include <boost/geometry/algorithms/area.hpp>
+#include <boost/geometry/algorithms/correct.hpp>
#include <boost/geometry/algorithms/length.hpp>
#include <boost/geometry/algorithms/num_points.hpp>
#include <boost/geometry/algorithms/unique.hpp>
@@ -121,6 +122,10 @@
G2 g2;
boost::geometry::read_wkt(wkt2, g2);
+ // Reverse if necessary
+ boost::geometry::correct(g1);
+ boost::geometry::correct(g2);
+
test_union<OutputType>(caseid, g1, g2,
expected_count, expected_hole_count, expected_point_count,
expected_area, percentage);
Modified: sandbox/geometry/libs/geometry/test/algorithms/union.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/union.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/union.cpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -18,208 +18,168 @@
#include <algorithms/overlay/overlay_cases.hpp>
-template <typename P>
-void test_all()
+template <typename Ring, typename Polygon>
+void test_areal()
{
- typedef boost::geometry::polygon<P> polygon;
- typedef boost::geometry::linear_ring<P> ring;
- typedef boost::geometry::box<P> box;
-
-
- test_one<polygon, box, polygon>("box_ring", example_box, example_ring,
- 1, 1, 15, 6.38875);
-
- test_one<polygon, box, polygon>("box_poly", example_box, example_polygon,
- 1, 3, 23, 6.30983);
-
- test_one<polygon, polygon, polygon>("star_ring", example_star, example_ring,
+ test_one<Polygon, Polygon, Polygon>("star_ring", example_star, example_ring,
1, 0, 23, 5.67017141);
- test_one<polygon, polygon, polygon>("star_poly", example_star, example_polygon,
+ test_one<Polygon, Polygon, Polygon>("star_poly", example_star, example_polygon,
1, 1, 27, 5.647949);
- test_one<polygon, box, polygon>("box_poly1", example_box,
- "POLYGON((3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2))",
- 1, 1, 15, 6.38875);
- test_one<polygon, box, polygon>("box_poly2", example_box,
- "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,5.3 2.5,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))",
- 1, 1, 15, 5.93625);
-
- // Same as 3, but now as polygon
+ // Pseudo-box as Polygon
// (note, internally, the intersection points is different, so yes,
// it has to be tested)
- test_one<polygon, polygon, polygon>("box_poly3", "POLYGON((1.5 1.5 , 1.5 2.5 , 4.5 2.5 , 4.5 1.5 , 1.5 1.5))",
+ test_one<Polygon, Polygon, Polygon>("box_poly3", "POLYGON((1.5 1.5 , 1.5 2.5 , 4.5 2.5 , 4.5 1.5 , 1.5 1.5))",
"POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,5.3 2.5,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))",
1, 1, 15, 5.93625);
-
- test_one<polygon, box, polygon>("box_poly4", example_box,
- "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 2.5,4.5 1.2,4.9 0.8,2.9 0.7,2 1.3))",
- 1, 1, 15, 4.651245);
-
- test_one<polygon, box, polygon>("box_poly5", example_box,
- "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 2.5,4.5 2.3,5.0 2.3,5.0 2.1,4.5 2.1,4.5 1.9,4.0 1.9,4.5 1.2,4.9 0.8,2.9 0.7,2 1.3))",
- 1, 1, 21, 4.7191);
-
- test_one<polygon, box, polygon>("box_poly6", example_box,
- "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 1.2,2.9 0.7,2 1.3))",
- 1, 1, 15, 4.2174);
-
- test_one<polygon, box, polygon>("box_poly7", example_box,
- "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.0 3.0,5.0 2.0,2.9 0.7,2 1.3))",
- 1, 1, 17, 4.270554);
-
- test_one<polygon, box, polygon>("box_poly8", "box(0 0, 3 3)",
- "POLYGON((2 2, 1 4, 2 4, 3 3, 2 2))",
- 1, 0, 8, 10.25);
-
-
// First inside second
- test_one<polygon, polygon, polygon>("first_within_second",
+ test_one<Polygon, Polygon, Polygon>("first_within_second",
first_within_second[0], first_within_second[1],
1, 0, 5, 25.0);
// Second inside first
- test_one<polygon, polygon, polygon>("seond_within_first",
+ test_one<Polygon, Polygon, Polygon>("seond_within_first",
first_within_second[1], first_within_second[0],
1, 0, 5, 25.0);
// First inside hole of second
- test_one<polygon, polygon, polygon>("first_within_hole_of_second",
+ test_one<Polygon, Polygon, Polygon>("first_within_hole_of_second",
first_within_hole_of_second[0], first_within_hole_of_second[1],
2, 1, 15, 17.0);
// forming new hole
- test_one<polygon, polygon, polygon>("new_hole",
+ test_one<Polygon, Polygon, Polygon>("new_hole",
new_hole[0], new_hole[1],
1, 1, 14, 23.0);
// side by side
- test_one<polygon, polygon, polygon>("side_side",
+ test_one<Polygon, Polygon, Polygon>("side_side",
side_side[0], side_side[1], 1, 0, 7, 2.0);
// identical
- test_one<polygon, polygon, polygon>("identical",
+ test_one<Polygon, Polygon, Polygon>("identical",
identical[0], identical[1], 1, 0, 5, 1.0);
// inside each other, having intersections; holes separate intersections
- test_one<polygon, polygon, polygon>("intersect_holes_intersect",
+ test_one<Polygon, Polygon, Polygon>("intersect_holes_intersect",
intersect_holes_intersect[0], intersect_holes_intersect[1],
1, 1, 14, 39.75);
- test_one<polygon, polygon, polygon>("intersect_holes_intersect_and_disjoint",
+ test_one<Polygon, Polygon, Polygon>("intersect_holes_intersect_and_disjoint",
intersect_holes_intersect_and_disjoint[0], intersect_holes_intersect_and_disjoint[1],
1, 1, 14, 39.75);
- test_one<polygon, polygon, polygon>("intersect_holes_intersect_and_touch",
+ test_one<Polygon, Polygon, Polygon>("intersect_holes_intersect_and_touch",
intersect_holes_intersect_and_touch[0], intersect_holes_intersect_and_touch[1],
1, 1, 14, 39.75);
- test_one<polygon, polygon, polygon>("intersect_holes_new_ring",
+ test_one<Polygon, Polygon, Polygon>("intersect_holes_new_ring",
intersect_holes_new_ring[0], intersect_holes_new_ring[1],
1, 2, 15, 253.8961);
// inside each other, having intersections but holes are disjoint
- test_one<polygon, polygon, polygon>("intersect_holes_disjoint",
+ test_one<Polygon, Polygon, Polygon>("intersect_holes_disjoint",
intersect_holes_disjoint[0],
intersect_holes_disjoint[1],
1, 0, 9, 40.0);
// inside each other, having no intersections but holes are disjoint
- test_one<polygon, polygon, polygon>("within_holes_disjoint",
+ test_one<Polygon, Polygon, Polygon>("within_holes_disjoint",
within_holes_disjoint[0], within_holes_disjoint[1],
1, 0, 5, 49.0);
- test_one<polygon, polygon, polygon>("winded",
+ test_one<Polygon, Polygon, Polygon>("winded",
winded[0], winded[1],
1, 5, 30, 114.0);
- test_one<polygon, polygon, polygon>("two_bends",
+ test_one<Polygon, Polygon, Polygon>("two_bends",
two_bends[0], two_bends[1],
1, 0, 7, 40.0);
- test_one<polygon, polygon, polygon>("equal_holes_disjoint",
+ test_one<Polygon, Polygon, Polygon>("equal_holes_disjoint",
equal_holes_disjoint[0], equal_holes_disjoint[1],
1, 1, 10, 81 - 3 * 7);
- test_one<polygon, polygon, polygon>("only_hole_intersections1",
+ test_one<Polygon, Polygon, Polygon>("only_hole_intersections1",
only_hole_intersections[0], only_hole_intersections[1],
1, 2, 13, 190.9090909);
- test_one<polygon, polygon, polygon>("only_hole_intersections2",
+ test_one<Polygon, Polygon, Polygon>("only_hole_intersections2",
only_hole_intersections[0], only_hole_intersections[2],
1, 2, 13, 190.9090909);
- test_one<polygon, polygon, polygon>("intersect_exterior_and_interiors_winded",
+ test_one<Polygon, Polygon, Polygon>("intersect_exterior_and_interiors_winded",
intersect_exterior_and_interiors_winded[0], intersect_exterior_and_interiors_winded[1],
1, 1, 26, 66.5333333);
- test_one<polygon, polygon, polygon>("simplex_normal",
+ test_one<Polygon, Polygon, Polygon>("simplex_normal",
simplex_normal[0], simplex_normal[1],
1, 0, 13, 11.526367);
- test_one<polygon, polygon, polygon>("fitting",
+ test_one<Polygon, Polygon, Polygon>("fitting",
fitting[0], fitting[1],
1, 0, 5, 25);
- test_one<polygon, polygon, polygon>("wrapped_a",
+ test_one<Polygon, Polygon, Polygon>("wrapped_a",
wrapped[0], wrapped[1],
1, 1, 16, 16);
- test_one<polygon, polygon, polygon>("wrapped_b",
+ test_one<Polygon, Polygon, Polygon>("wrapped_b",
wrapped[0], wrapped[2],
1, 1, 16, 16);
- test_one<polygon, polygon, polygon>("9",
+ test_one<Polygon, Polygon, Polygon>("9",
case_9[0], case_9[1], 2, 0, 8, 11);
- test_one<polygon, polygon, polygon>("22",
+ test_one<Polygon, Polygon, Polygon>("22",
case_22[0], case_22[1], 2, 0, 8, 9.5);
- test_one<polygon, polygon, polygon>("25",
+ test_one<Polygon, Polygon, Polygon>("25",
case_25[0], case_25[1], 2, 0, 8, 7);
- test_one<polygon, polygon, polygon>("26",
+ test_one<Polygon, Polygon, Polygon>("26",
case_26[0], case_26[1], 2, 0, 9, 7.5);
- test_one<polygon, polygon, polygon>("31",
+ test_one<Polygon, Polygon, Polygon>("31",
case_31[0], case_31[1], 2, 0, 8, 4.5);
- test_one<polygon, polygon, polygon>("32",
+ test_one<Polygon, Polygon, Polygon>("32",
case_32[0], case_32[1], 2, 0, 8, 4.5);
- test_one<polygon, polygon, polygon>("33",
+ test_one<Polygon, Polygon, Polygon>("33",
case_33[0], case_33[1], 2, 0, 8, 4.5);
- test_one<polygon, polygon, polygon>("40",
+ test_one<Polygon, Polygon, Polygon>("40",
case_40[0], case_40[1], 2, 0, 18, 11);
/*
- test_one<polygon, polygon, polygon>(102,
+ test_one<Polygon, Polygon, Polygon>(102,
simplex_normal[0], simplex_reversed[1],
1, 0, 7, X);
- test_one<polygon, polygon, polygon>(103,
+ test_one<Polygon, Polygon, Polygon>(103,
simplex_reversed[0], simplex_normal[1],
1, 0, 7, 24.0);
- test_one<polygon, polygon, polygon>(104,
+ test_one<Polygon, Polygon, Polygon>(104,
simplex_reversed[0], simplex_reversed[1],
1, 0, 7, 24.0);
- test_one<polygon, polygon, polygon>(100,
+ test_one<Polygon, Polygon, Polygon>(100,
star_15, comb_15,
1, 10, 7, 24.0);
*/
// test some other input/output types
- // 1 input ring
- test_one<polygon, polygon, ring>("identical_pr", identical[0], identical[1], 1, 0, 5, 1.0);
- test_one<polygon, ring, polygon>("identical_rp", identical[0], identical[1], 1, 0, 5, 1.0);
+ // 1 input Ring
+ test_one<Polygon, Polygon, Ring>("identical_pr", identical[0], identical[1], 1, 0, 5, 1.0);
+ test_one<Polygon, Ring, Polygon>("identical_rp", identical[0], identical[1], 1, 0, 5, 1.0);
// 2 input rings
- test_one<polygon, ring, ring>("identical_rr", identical[0], identical[1], 1, 0, 5, 1.0);
+ test_one<Polygon, Ring, Ring>("identical_rr", identical[0], identical[1], 1, 0, 5, 1.0);
- // output is also ring
- test_one<ring, ring, ring>("identical_rrr", identical[0], identical[1], 1, 0, 5, 1.0);
+ // output is also Ring
+ test_one<Ring, Ring, Ring>("identical_rrr", identical[0], identical[1], 1, 0, 5, 1.0);
- // "new hole", tested with ring -> the newly formed hole will be omitted
- test_one<ring, ring, ring>("new_hole_discarded", new_hole[0], new_hole[1], 1, 0, 9, 24.0);
+ // "new hole", tested with Ring -> the newly formed hole will be omitted
+ test_one<Ring, Ring, Ring>("new_hole_discarded", new_hole[0], new_hole[1], 1, 0, 9, 24.0);
// Isovist (submitted by Brandon during Formal Review)
/***
@@ -227,7 +187,7 @@
{
std::string tn = string_from_type<typename boost::geometry::coordinate_type<P>::type>::name();
//std::cout << tn << std::endl;
- test_one<polygon, polygon, polygon>("isovist", isovist[0], isovist[1], 1, 0,
+ test_one<Polygon, Polygon, Polygon>("isovist", isovist[0], isovist[1], 1, 0,
// Note, the number of resulting points differs per point type AND
// per operating system (showing this test is quite demanding)
@@ -245,10 +205,62 @@
***/
}
+template <typename P>
+void test_all()
+{
+ typedef boost::geometry::polygon<P> polygon;
+ typedef boost::geometry::linear_ring<P> ring;
+ typedef boost::geometry::box<P> box;
+
+ test_areal<ring, polygon>();
+
+ test_areal<boost::geometry::linear_ring<P, std::vector, false>,
+ boost::geometry::polygon<P, std::vector, std::vector, false> >();
+
+
+ test_one<polygon, box, polygon>("box_ring", example_box, example_ring,
+ 1, 1, 15, 6.38875);
+
+ test_one<polygon, box, polygon>("box_poly", example_box, example_polygon,
+ 1, 3, 23, 6.30983);
+
+
+ test_one<polygon, box, polygon>("box_poly1", example_box,
+ "POLYGON((3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2))",
+ 1, 1, 15, 6.38875);
+ test_one<polygon, box, polygon>("box_poly2", example_box,
+ "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,5.3 2.5,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3))",
+ 1, 1, 15, 5.93625);
+
+ // 3: see areal
+
+ test_one<polygon, box, polygon>("box_poly4", example_box,
+ "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 2.5,4.5 1.2,4.9 0.8,2.9 0.7,2 1.3))",
+ 1, 1, 15, 4.651245);
+
+ test_one<polygon, box, polygon>("box_poly5", example_box,
+ "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 2.5,4.5 2.3,5.0 2.3,5.0 2.1,4.5 2.1,4.5 1.9,4.0 1.9,4.5 1.2,4.9 0.8,2.9 0.7,2 1.3))",
+ 1, 1, 21, 4.7191);
+
+ test_one<polygon, box, polygon>("box_poly6", example_box,
+ "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 2.5,4.5 1.2,2.9 0.7,2 1.3))",
+ 1, 1, 15, 4.2174);
+
+ test_one<polygon, box, polygon>("box_poly7", example_box,
+ "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.0 3.0,5.0 2.0,2.9 0.7,2 1.3))",
+ 1, 1, 17, 4.270554);
+
+ test_one<polygon, box, polygon>("box_poly8", "box(0 0, 3 3)",
+ "POLYGON((2 2, 1 4, 2 4, 3 3, 2 2))",
+ 1, 0, 8, 10.25);
+
+
+}
+
int test_main(int, char* [])
{
- //test_all<boost::geometry::point_xy<float> >();
+ test_all<boost::geometry::point_xy<float> >();
test_all<boost::geometry::point_xy<double> >();
//test_all<boost::geometry::point_xy<long double> >();
Modified: sandbox/geometry/libs/geometry/test/multi/algorithms/multi_union.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/multi/algorithms/multi_union.cpp (original)
+++ sandbox/geometry/libs/geometry/test/multi/algorithms/multi_union.cpp 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -13,6 +13,7 @@
#include <algorithms/test_overlay.hpp>
#include <multi/algorithms/overlay/multi_overlay_cases.hpp>
+#include <boost/geometry/multi/algorithms/correct.hpp>
#include <boost/geometry/multi/algorithms/union.hpp>
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
@@ -21,42 +22,58 @@
#include <boost/geometry/extensions/gis/io/wkt/read_wkt_multi.hpp>
-template <typename P>
-void test_all()
+template <typename Ring, typename Polygon, typename MultiPolygon>
+void test_areal()
{
- namespace bg = boost::geometry;
- typedef bg::linear_ring<P> ring;
- typedef bg::polygon<P> polygon;
- typedef bg::multi_polygon<polygon> multi_polygon;
-
- test_one<polygon, multi_polygon, multi_polygon>("simplex_multi",
+ test_one<Polygon, MultiPolygon, MultiPolygon>("simplex_multi",
case_multi_simplex[0], case_multi_simplex[1],
1, 0, 20, 14.58);
- test_one<polygon, polygon, multi_polygon>("simplex_multi_p_mp",
+ test_one<Polygon, Polygon, MultiPolygon>("simplex_multi_p_mp",
case_single_simplex, case_multi_simplex[0],
1, 0, 20, 14.58);
- test_one<polygon, multi_polygon, polygon>("simplex_multi_mp_p",
+ test_one<Polygon, MultiPolygon, Polygon>("simplex_multi_mp_p",
case_multi_simplex[0], case_single_simplex,
1, 0, 20, 14.58);
- test_one<polygon, ring, multi_polygon>("simplex_multi_r_mp",
+ test_one<Polygon, Ring, MultiPolygon>("simplex_multi_r_mp",
case_single_simplex, case_multi_simplex[0],
1, 0, 20, 14.58);
- test_one<ring, multi_polygon, polygon>("simplex_multi_mp_r",
+ test_one<Ring, MultiPolygon, Polygon>("simplex_multi_mp_r",
case_multi_simplex[0], case_single_simplex,
1, 0, 20, 14.58);
// Normal test cases
- test_one<polygon, multi_polygon, multi_polygon>("case_multi_no_ip",
+ test_one<Polygon, MultiPolygon, MultiPolygon>("case_multi_no_ip",
case_multi_no_ip[0], case_multi_no_ip[1],
4, 0, 16, 66.5);
- test_one<polygon, multi_polygon, multi_polygon>("case_multi_2",
+ test_one<Polygon, MultiPolygon, MultiPolygon>("case_multi_2",
case_multi_2[0], case_multi_2[1],
3, 0, 16, 59.1);
}
+template <typename P>
+void test_all()
+{
+ namespace bg = boost::geometry;
+
+ {
+ typedef bg::linear_ring<P> ring;
+ typedef bg::polygon<P> polygon;
+ typedef bg::multi_polygon<polygon> multi_polygon;
+ test_areal<ring, polygon, multi_polygon>();
+ }
+
+ {
+ typedef bg::linear_ring<P, std::vector, false> ring_ccw;
+ typedef bg::polygon<P, std::vector, std::vector, false> polygon_ccw;
+ typedef bg::multi_polygon<polygon_ccw> multi_polygon_ccw;
+ test_areal<ring_ccw, polygon_ccw, multi_polygon_ccw>();
+ }
+
+}
+
int test_main(int, char* [])
{
Modified: sandbox/geometry/other/programs/doxygen_xml2qbk/doxygen_xml2qbk.vcproj
==============================================================================
--- sandbox/geometry/other/programs/doxygen_xml2qbk/doxygen_xml2qbk.vcproj (original)
+++ sandbox/geometry/other/programs/doxygen_xml2qbk/doxygen_xml2qbk.vcproj 2010-10-12 09:04:45 EDT (Tue, 12 Oct 2010)
@@ -39,7 +39,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".;contrib/rapidxml-1.13"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@@ -113,7 +113,7 @@
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=".;contrib/rapidxml-1.13"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
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