|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65913 - in sandbox/geometry: boost/geometry boost/geometry/algorithms/detail/overlay libs/geometry/test/algorithms libs/geometry/test/algorithms/overlay libs/geometry/test/test_geometries
From: barend.gehrels_at_[hidden]
Date: 2010-10-11 12:18:58
Author: barendgehrels
Date: 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
New Revision: 65913
URL: http://svn.boost.org/trac/boost/changeset/65913
Log:
Replaced ignore field by ignore method for swapping operations (for counter clockwise)
Added test/algorithms/overlay/ccw_traverse.cpp to test counterclockwise polygon overlays
Added test/algorithms/overlay to standards Jamfile.v2
Moved some testcases to overlay_cases.hpp
Some warning removals in test cases
Added:
sandbox/geometry/libs/geometry/test/algorithms/overlay/ccw_traverse.cpp (contents, props changed)
sandbox/geometry/libs/geometry/test/algorithms/overlay/ccw_traverse.vcproj (contents, props changed)
Text files modified:
sandbox/geometry/boost/geometry/algorithms/detail/overlay/assemble.hpp | 2
sandbox/geometry/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp | 2
sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp | 12 ---
sandbox/geometry/boost/geometry/algorithms/detail/overlay/traverse.hpp | 4
sandbox/geometry/boost/geometry/algorithms/detail/overlay/turn_info.hpp | 11 ++-
sandbox/geometry/boost/geometry/geometry.hpp | 1
sandbox/geometry/libs/geometry/test/algorithms/Jamfile.v2 | 2
sandbox/geometry/libs/geometry/test/algorithms/append.cpp | 4
sandbox/geometry/libs/geometry/test/algorithms/distance.cpp | 24 +++---
sandbox/geometry/libs/geometry/test/algorithms/intersection.cpp | 2
sandbox/geometry/libs/geometry/test/algorithms/overlay/assemble.cpp | 2
sandbox/geometry/libs/geometry/test/algorithms/overlay/enrich_intersection_points.vcproj | 1
sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.cpp | 5 +
sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.vcproj | 1
sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.cpp | 14 ++--
sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.vcproj | 1
sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay.sln | 6 +
sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_cases.hpp | 49 ++++++++++++++
sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp | 134 +++++++++++----------------------------
sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.vcproj | 5
sandbox/geometry/libs/geometry/test/test_geometries/wrapped_boost_array.hpp | 2
21 files changed, 141 insertions(+), 143 deletions(-)
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-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -252,7 +252,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
Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -398,7 +398,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
Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -47,10 +47,6 @@
{
ti.operations[0].operation = op;
ti.operations[1].operation = op;
- if (op == operation_union)
- {
- ti.ignore = true;
- }
}
// If condition, first union/second intersection, else vice versa
@@ -292,7 +288,6 @@
uu_else_ii(! q_turns_left, ti);
if (block_q)
{
- ti.ignore = false;
ti.operations[1].operation = operation_blocked;
}
//block_second(block_q, ti);
@@ -314,12 +309,6 @@
? operation_union
: operation_intersection;
- if (ti.operations[0].operation == operation_union
- && ti.operations[1].operation == operation_union)
- {
- ti.ignore = true;
- }
-
return;
}
}
@@ -373,6 +362,7 @@
}
// Normally a robustness issue.
+ // TODO: solve this!
std::cout << "Not yet handled" << std::endl
<< "pi " << get<0>(pi) << " , " << get<1>(pi)
<< " pj " << get<0>(pj) << " , " << get<1>(pj)
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-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -285,8 +285,8 @@
! fail && it != boost::end(turns);
++it)
{
- // Skip the ones marked ignore (these are: "uu", so self-tangent)
- if (! it->ignore)
+ // Skip the self-tangent ones (uu)
+ if (! it->ignore())
{
for (turn_operation_iterator_type iit = boost::begin(it->operations);
! fail && iit != boost::end(it->operations);
Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/turn_info.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/turn_info.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/turn_info.hpp 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -87,17 +87,20 @@
Point point;
method_type method;
- bool ignore;
Container operations;
- turn_info()
+ inline turn_info()
: method(method_none)
- , ignore(false)
{}
-};
+ inline bool ignore() const
+ {
+ return this->operations[0].operation == operation_union
+ && this->operations[1].operation == operation_union;
+ }
+};
}} // namespace detail::overlay
Modified: sandbox/geometry/boost/geometry/geometry.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometry.hpp (original)
+++ sandbox/geometry/boost/geometry/geometry.hpp 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -51,6 +51,7 @@
#include <boost/geometry/algorithms/make.hpp>
#include <boost/geometry/algorithms/num_points.hpp>
#include <boost/geometry/algorithms/perimeter.hpp>
+#include <boost/geometry/algorithms/reverse.hpp>
#include <boost/geometry/algorithms/simplify.hpp>
#include <boost/geometry/algorithms/transform.hpp>
#include <boost/geometry/algorithms/union.hpp>
Modified: sandbox/geometry/libs/geometry/test/algorithms/Jamfile.v2
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/Jamfile.v2 (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/Jamfile.v2 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -35,3 +35,5 @@
[ run unique.cpp ]
[ run within.cpp ]
;
+
+build-project overlay ;
Modified: sandbox/geometry/libs/geometry/test/algorithms/append.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/append.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/append.cpp 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -31,10 +31,10 @@
typedef typename boost::geometry::point_type<G>::type P;
boost::geometry::append(geometry, boost::geometry::make_zero<P>());
- BOOST_CHECK_EQUAL(boost::geometry::num_points(geometry), 1);
+ BOOST_CHECK_EQUAL(boost::geometry::num_points(geometry), 1u);
boost::geometry::clear(geometry);
- BOOST_CHECK_EQUAL(boost::geometry::num_points(geometry), 0);
+ BOOST_CHECK_EQUAL(boost::geometry::num_points(geometry), 0u);
//P p = boost::range::front(geometry);
}
Modified: sandbox/geometry/libs/geometry/test/algorithms/distance.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/distance.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/distance.cpp 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -97,11 +97,11 @@
bg::segment<P const> const seg(s1, s2);
- return_type d1 = bg::distance(p1, seg);
- return_type d2 = bg::distance(p2, seg);
- return_type d3 = bg::distance(p3, seg);
- return_type d4 = bg::distance(p4, seg);
- return_type d5 = bg::distance(p5, seg);
+ return_type d1 = bg::distance(p1, seg);
+ return_type d2 = bg::distance(p2, seg);
+ return_type d3 = bg::distance(p3, seg);
+ return_type d4 = bg::distance(p4, seg);
+ return_type d5 = bg::distance(p5, seg);
BOOST_CHECK_CLOSE(d1, return_type(1), 0.001);
BOOST_CHECK_CLOSE(d2, return_type(1), 0.001);
@@ -110,8 +110,8 @@
BOOST_CHECK_CLOSE(d5, return_type(0), 0.001);
// Reverse case: segment/point instead of point/segment
- return_type dr1 = bg::distance(seg, p1);
- return_type dr2 = bg::distance(seg, p2);
+ return_type dr1 = bg::distance(seg, p1);
+ return_type dr2 = bg::distance(seg, p2);
BOOST_CHECK_CLOSE(dr1, d1, 0.001);
BOOST_CHECK_CLOSE(dr2, d2, 0.001);
@@ -119,17 +119,17 @@
// Test specifying strategy manually:
// 1) point-point-distance
typename bg::strategy::distance::services::default_strategy<bg::point_tag, P>::type pp_strategy;
- d1 = bg::distance(p1, seg, pp_strategy);
+ d1 = bg::distance(p1, seg, pp_strategy);
BOOST_CHECK_CLOSE(d1, return_type(1), 0.001);
// 2) point-segment-distance
typename bg::strategy::distance::services::default_strategy<bg::segment_tag, P>::type ps_strategy;
- d1 = bg::distance(p1, seg, ps_strategy);
+ d1 = bg::distance(p1, seg, ps_strategy);
BOOST_CHECK_CLOSE(d1, return_type(1), 0.001);
// 3) custom point strategy
taxicab_distance<P> tcd;
- return_type d = bg::distance(p1, seg, tcd);
+ d1 = bg::distance(p1, seg, tcd);
BOOST_CHECK_CLOSE(d1, return_type(1), 0.001);
}
@@ -147,7 +147,7 @@
bg::set<1>(points[1], 3);
P p;
- bg::set<0>(p, 2);
+ bg::set<0>(p, 2);
bg::set<1>(p, 1);
return_type d = bg::distance(p, points);
@@ -201,7 +201,7 @@
test_geometry<P, bg::polygon<P> >("POINT(3 3)", donut, 0.0);
// other way round
test_geometry<bg::polygon<P>, P>(donut, "POINT(2 2)", 0.5 * sqrt(2.0));
- // open
+ // open
test_geometry<P, bg::polygon<P, std::vector, std::vector, true, false> >("POINT(2 2)", "POLYGON ((0 0,1 9,8 1),(1 1,4 1,1 4))", 0.5 * sqrt(2.0));
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-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -279,7 +279,7 @@
n += boost::geometry::num_points(*it);
}
- BOOST_CHECK_EQUAL(clip.size(), 1);
+ BOOST_CHECK_EQUAL(clip.size(), 1u);
BOOST_CHECK_EQUAL(n, 2);
BOOST_CHECK_CLOSE(length, sqrt(2.0 * 6.0 * 6.0), 0.001);
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/assemble.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/assemble.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/assemble.cpp 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -42,7 +42,7 @@
bg::union_inserter<Geometry>(p, q, std::back_inserter(u));
bg::intersection_inserter<Geometry>(p, q, std::back_inserter(i));
- typedef bg::coordinate_type<Geometry>::type type;
+ typedef typename bg::coordinate_type<Geometry>::type type;
type area_p = bg::area(p);
type area_q = bg::area(q);
type area_i = 0;
Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/ccw_traverse.cpp
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/ccw_traverse.cpp 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -0,0 +1,309 @@
+
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+
+#include <boost/foreach.hpp>
+
+#include <geometry_test_common.hpp>
+
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+#if defined(TEST_WITH_SVG)
+# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
+#endif
+
+#include <algorithms/overlay/overlay_cases.hpp>
+
+namespace bg = boost::geometry;
+
+template <typename Vector>
+void reverse_operations(Vector& v)
+{
+ using namespace bg::detail::overlay;
+
+ typedef typename boost::range_value<Vector>::type item;
+ BOOST_FOREACH(item& it, v)
+ {
+ for (int i = 0; i < 2; i++)
+ {
+ operation_type& op = it.operations[i].operation;
+ switch(op)
+ {
+ case operation_none : op = operation_none; break;
+ case operation_union : op = operation_intersection; break;
+ case operation_intersection : op = operation_union; break;
+ case operation_blocked : op = operation_blocked; break;
+ case operation_continue : op = operation_continue; break;
+ }
+ }
+ }
+}
+
+template <typename Geometry>
+inline typename bg::coordinate_type<Geometry>::type intersect(Geometry const& g1, Geometry const& g2, std::string const& name,
+ bg::detail::overlay::operation_type op)
+{
+ typedef typename bg::strategy_side
+ <
+ typename bg::cs_tag<Geometry>::type
+ >::type side_strategy_type;
+
+
+ typedef bg::detail::overlay::traversal_turn_info
+ <
+ typename boost::geometry::point_type<Geometry>::type
+ > turn_info;
+ std::vector<turn_info> turns;
+
+ bg::detail::get_turns::no_interrupt_policy policy;
+ bg::get_turns<bg::detail::overlay::calculate_distance_policy>(g1, g2, turns, policy);
+
+ bool const reverse = bg::point_order<Geometry>::value == bg::counterclockwise;
+ if (reverse)
+ {
+ reverse_operations(turns);
+ }
+ bg::enrich_intersection_points(turns, g1, g2, side_strategy_type());
+
+ typedef bg::linear_ring<typename bg::point_type<Geometry>::type> ring_type;
+ typedef std::vector<ring_type> out_vector;
+ out_vector v;
+
+ bg::traverse(g1, g2, op, turns, v);
+
+ if (reverse)
+ {
+ BOOST_FOREACH(ring_type& ring, v)
+ {
+ bg::reverse(ring);
+ }
+ }
+ typename bg::coordinate_type<Geometry>::type result = 0.0;
+ BOOST_FOREACH(ring_type& ring, v)
+ {
+ result += bg::area(ring);
+ }
+
+#if defined(TEST_WITH_SVG)
+ {
+ std::ostringstream filename;
+ filename
+ << name << "_"
+ << (op == bg::detail::overlay::operation_intersection ? "i" : "u")
+ << (reverse ? "_ccw" : "")
+ << ".svg";
+
+ std::ofstream svg(filename.str().c_str());
+
+ bg::svg_mapper<typename bg::point_type<Geometry>::type> mapper(svg, 500, 500);
+ mapper.add(g1);
+ mapper.add(g2);
+
+ // Input shapes in green/blue
+ mapper.map(g1, "fill-opacity:0.5;fill:rgb(153,204,0);"
+ "stroke:rgb(153,204,0);stroke-width:3");
+ mapper.map(g2, "fill-opacity:0.3;fill:rgb(51,51,153);"
+ "stroke:rgb(51,51,153);stroke-width:3");
+
+ // Traversal rings in magenta/light yellow fill
+ BOOST_FOREACH(ring_type const& ring, v)
+ {
+ mapper.map(ring, "fill-opacity:0.3;stroke-opacity:0.4;fill:rgb(255,255,0);"
+ "stroke:rgb(255,0,255);stroke-width:8");
+ }
+
+
+ // turn points in orange, + enrichment/traversal info
+ typedef typename bg::coordinate_type<Geometry>::type coordinate_type;
+
+ // Simple map to avoid two texts at same place (note that can still overlap!)
+ std::map<std::pair<int, int>, int> offsets;
+ int index = 0;
+ int const lineheight = 10;
+ int const margin = 5;
+
+ BOOST_FOREACH(turn_info const& turn, turns)
+ {
+ mapper.map(turn.point, "fill:rgb(255,128,0);"
+ "stroke:rgb(0,0,0);stroke-width:1", 3);
+
+ {
+ // Map characteristics
+ // Create a rounded off point
+ std::pair<int, int> p
+ = std::make_pair(
+ boost::numeric_cast<int>(0.5 + 10 * bg::get<0>(turn.point)),
+ boost::numeric_cast<int>(0.5 + 10 * bg::get<1>(turn.point))
+ );
+ std::string style = "fill:rgb(0,0,0);font-family:Arial;font-size:10px";
+
+ std::ostringstream out;
+ out << index
+ << ": " << bg::method_char(turn.method)
+ << std::endl
+ << "op: " << bg::operation_char(turn.operations[0].operation)
+ << " / " << bg::operation_char(turn.operations[1].operation)
+ << (turn.ignore() ? " (ignore) " : "")
+ << std::endl;
+
+ if (turn.operations[0].enriched.next_ip_index != -1)
+ {
+ out << "ip: " << turn.operations[0].enriched.next_ip_index;
+ }
+ else
+ {
+ out << "vx: " << turn.operations[0].enriched.travels_to_vertex_index;
+ }
+ out << " ";
+ if (turn.operations[1].enriched.next_ip_index != -1)
+ {
+ out << "ip: " << turn.operations[1].enriched.next_ip_index;
+ }
+ else
+ {
+ out << "vx: " << turn.operations[1].enriched.travels_to_vertex_index;
+ }
+
+ out << std::endl;
+
+ out
+
+ << std::setprecision(3)
+ << "dist: " << turn.operations[0].enriched.distance
+ << " / " << turn.operations[1].enriched.distance
+ << std::endl;
+
+ offsets[p] += lineheight;
+ int offset = offsets[p];
+ offsets[p] += lineheight * 5;
+ mapper.text(turn.point, out.str(), style, margin, offset, lineheight);
+ }
+ index++;
+ }
+ }
+#endif
+
+ return result;
+}
+
+template <typename Geometry>
+inline typename bg::coordinate_type<Geometry>::type intersect(std::string const& wkt1, std::string const& wkt2, std::string const& name,
+ bg::detail::overlay::operation_type op)
+{
+ Geometry p1, p2;
+ bg::read_wkt(wkt1, p1);
+ bg::read_wkt(wkt2, p2);
+
+ // Adapt to cw/ccw
+ bg::correct(p1);
+ bg::correct(p2);
+
+ return intersect(p1, p2, name, op);
+}
+
+template <typename T>
+inline void test_intersect(std::string const& wkt1, std::string const& wkt2, std::string const& name)
+{
+ typedef bg::point_xy<T> point;
+ typedef bg::polygon<point> clock;
+ typedef bg::polygon<point, std::vector, std::vector, false> counter;
+
+ namespace ov = bg::detail::overlay;
+ T area1 = intersect<clock>(wkt1, wkt2, name, ov::operation_intersection);
+ T area2 = intersect<counter>(wkt1, wkt2, name, ov::operation_intersection);
+ T area3 = intersect<clock>(wkt1, wkt2, name, ov::operation_union);
+ T area4 = intersect<counter>(wkt1, wkt2, name, ov::operation_union);
+
+ BOOST_CHECK_CLOSE(area1, area2, 0.001);
+ BOOST_CHECK_CLOSE(area3, area4, 0.001);
+}
+
+int test_main(int, char* [])
+{
+ //bool const ig = true;
+ test_intersect<double>(case_1[0], case_1[1], "c1");
+ test_intersect<double>(case_2[0], case_2[1], "c2");
+ test_intersect<double>(case_3[0], case_3[1], "c3");
+ test_intersect<double>(case_4[0], case_4[1], "c4");
+ test_intersect<double>(case_5[0], case_5[1], "c5");
+ test_intersect<double>(case_6[0], case_6[1], "c6");
+ test_intersect<double>(case_7[0], case_7[1], "c7");
+ test_intersect<double>(case_8[0], case_8[1], "c8");
+ test_intersect<double>(case_9[0], case_9[1], "c9" /*, ig */);
+
+
+ test_intersect<double>(case_10[0], case_10[1], "c10");
+ test_intersect<double>(case_11[0], case_11[1], "c11");
+ test_intersect<double>(case_12[0], case_12[1], "c12");
+ test_intersect<double>(case_13[0], case_13[1], "c13");
+ test_intersect<double>(case_14[0], case_14[1], "c14");
+ test_intersect<double>(case_15[0], case_15[1], "c15");
+ test_intersect<double>(case_16[0], case_16[1], "c16");
+ test_intersect<double>(case_17[0], case_17[1], "c17");
+ test_intersect<double>(case_18[0], case_18[1], "c18");
+ test_intersect<double>(case_19[0], case_19[1], "c19");
+ test_intersect<double>(case_20[0], case_20[1], "c20");
+ test_intersect<double>(case_21[0], case_21[1], "c21");
+ test_intersect<double>(case_22[0], case_22[1], "c22" /*, ig */);
+ test_intersect<double>(case_23[0], case_23[1], "c23");
+ test_intersect<double>(case_24[0], case_24[1], "c24");
+ test_intersect<double>(case_25[0], case_25[1], "c25" /*, ig */);
+ test_intersect<double>(case_26[0], case_26[1], "c26" /*, ig */);
+ test_intersect<double>(case_27[0], case_27[1], "c27");
+ test_intersect<double>(case_28[0], case_28[1], "c28");
+ test_intersect<double>(case_29[0], case_29[1], "c29");
+ test_intersect<double>(case_30[0], case_30[1], "c30");
+ test_intersect<double>(case_31[0], case_31[1], "c31" /*, ig */);
+ test_intersect<double>(case_32[0], case_32[1], "c32" /*, ig */);
+ test_intersect<double>(case_33[0], case_33[1], "c33" /*, ig */);
+ test_intersect<double>(case_34[0], case_34[1], "c34");
+ test_intersect<double>(case_35[0], case_35[1], "c35");
+ test_intersect<double>(case_36[0], case_36[1], "c36" /*, ig */);
+ test_intersect<double>(case_37[0], case_37[1], "c37" /*, ig */);
+ test_intersect<double>(case_38[0], case_38[1], "c38" /*, ig */);
+ test_intersect<double>(case_39[0], case_39[1], "c39");
+ test_intersect<double>(case_40[0], case_40[1], "c40" /*, ig */);
+ test_intersect<double>(case_41[0], case_41[1], "c41");
+ test_intersect<double>(case_42[0], case_42[1], "c42");
+ //test_intersect<double>(case_43[0], case_43[1], "c43", inv);
+ test_intersect<double>(case_44[0], case_44[1], "c44");
+ test_intersect<double>(case_45[0], case_45[1], "c45");
+ //test_intersect<double>(case_46[0], case_46[1], "c46", inv);
+ //test_intersect<double>(case_47[0], case_47[1], "c47" /*, ig */);
+ //test_intersect<double>(case_48[0], case_48[1], "c48");
+ test_intersect<double>(case_49[0], case_49[1], "c49");
+ test_intersect<double>(case_50[0], case_50[1], "c50");
+ test_intersect<double>(case_51[0], case_51[1], "c51");
+ test_intersect<double>(case_52[0], case_52[1], "c52" /*, ig */);
+ test_intersect<double>(case_53[0], case_53[1], "c53");
+ // Invalid ones / overlaying intersection points / self tangencies
+ //test_intersect<double>(case_54[0], case_54[1], "c54");
+ //test_intersect<double>(case_55[0], case_55[1], "c55");
+ //test_intersect<double>(case_56[0], case_56[1], "c56");
+ //test_intersect<double>(case_57[0], case_57[1], "c57" /*, ig */);
+ //test_intersect<double>(case_58[0], case_58[1], "c58");
+ //test_intersect<double>(case_59[0], case_59[1], "c59");
+
+ test_intersect<double>(pie_16_4_12[0], pie_16_4_12[1], "pie_16_4_12");
+ test_intersect<double>(pie_23_21_12_500[0], pie_23_21_12_500[1], "pie_23_21_12_500");
+ test_intersect<double>(pie_23_23_3_2000[0], pie_23_23_3_2000[1], "pie_23_23_3_2000");
+ test_intersect<double>(pie_23_16_16[0], pie_23_16_16[1], "pie_23_16_16");
+ test_intersect<double>(pie_16_2_15_0[0], pie_16_2_15_0[1], "pie_16_2_15_0");
+ test_intersect<double>(pie_4_13_15[0], pie_4_13_15[1], "pie_4_13_15");
+ test_intersect<double>(pie_20_20_7_100[0], pie_20_20_7_100[1], "pie_20_20_7_100");
+
+ test_intersect<double>(hv_1[0], hv_1[1], "hv1");
+ test_intersect<double>(hv_2[0], hv_2[1], "hv2");
+ test_intersect<double>(hv_3[0], hv_3[1], "hv3");
+ test_intersect<double>(hv_4[0], hv_4[1], "hv4");
+ test_intersect<double>(hv_5[0], hv_5[1], "hv5");
+ test_intersect<double>(hv_6[0], hv_6[1], "hv6");
+ test_intersect<double>(hv_7[0], hv_7[1], "hv7");
+ test_intersect<double>(dz_1[0], dz_1[1], "dz_1");
+ test_intersect<double>(dz_2[0], dz_2[1], "dz_2");
+ test_intersect<double>(dz_3[0], dz_3[1], "dz_3");
+
+ return 0;
+}
Added: sandbox/geometry/libs/geometry/test/algorithms/overlay/ccw_traverse.vcproj
==============================================================================
--- (empty file)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/ccw_traverse.vcproj 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="ccw_traverse"
+ ProjectGUID="{BA789719-B2FC-405A-9258-E9E4ABCE1791}"
+ RootNamespace="ccw_traverse"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\ccw_traverse"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
+ ExceptionHandling="2"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="1"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)\ccw_traverse"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\..\boost.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ ExceptionHandling="2"
+ UsePrecompiledHeader="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\ccw_traverse.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/enrich_intersection_points.vcproj
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/enrich_intersection_points.vcproj (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/enrich_intersection_points.vcproj 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -46,6 +46,7 @@
ExceptionHandling="2"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
+ DebugInformationFormat="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.cpp 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -88,7 +88,7 @@
if (info.size() > 1)
{
- BOOST_CHECK_EQUAL(info.size(), 2);
+ BOOST_CHECK_EQUAL(info.size(), 2u);
BOOST_CHECK_EQUAL(info[1].method, expected_method);
BOOST_CHECK_CLOSE(bg::get<0>(info[1].point), ip_x2, 0.001);
BOOST_CHECK_CLOSE(bg::get<1>(info[1].point), ip_y2, 0.001);
@@ -802,11 +802,14 @@
4, 3, 2, 3, 0, 3, // q
method_touch, 2, 3, "xx");
+ /***
+ TODO, work this out further / check this
// Case where
test_both<P, double>("issue_buffer_mill",
5.1983614873206241 , 6.7259025813913107 , 5.0499999999999998 , 6.4291796067500622 , 5.1983614873206241 , 6.7259025813913107, // p
5.0499999999999998 , 6.4291796067500622 , 5.0499999999999998 , 6.4291796067500622 , 5.1983614873206241 , 6.7259025813913107, // q
method_collinear, 2, 0, "tt");
+ ***/
}
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.vcproj
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.vcproj (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turn_info.vcproj 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -46,6 +46,7 @@
ExceptionHandling="2"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
+ DebugInformationFormat="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.cpp 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -21,8 +21,8 @@
#include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp>
-#include <overlay_common.hpp>
-#include <overlay_cases.hpp>
+#include <algorithms/overlay/overlay_common.hpp>
+#include <algorithms/overlay/overlay_cases.hpp>
@@ -120,7 +120,7 @@
<< ": " << bg::operation_char(turn.operations[0].operation)
<< " " << bg::operation_char(turn.operations[1].operation)
<< " (" << bg::method_char(turn.method) << ")"
- << (turn.ignore ? " (ignore) " : " ")
+ << (turn.ignore() ? " (ignore) " : " ")
;
offsets[p] += 10;
@@ -248,7 +248,7 @@
test_overlay<polygon, polygon, test_get_turns, Tuple>("54bb", boost::make_tuple(13, 0.0, 0.0), case_54[1], case_54[3]);
test_overlay<polygon, polygon, test_get_turns, Tuple>("55", boost::make_tuple(10, 0.0, 0.0), case_55[0], case_55[1]);
- test_overlay<polygon, polygon, test_get_turns, Tuple>("56", boost::make_tuple(8, 0.0, 0.0), case_56[0], case_56[1]);
+ test_overlay<polygon, polygon, test_get_turns, Tuple>("56", boost::make_tuple(9, 0.0, 0.0), case_56[0], case_56[1]);
// other
@@ -273,9 +273,9 @@
test_overlay<linestring, linestring, test_get_turns, Tuple>("lineline1", boost::make_tuple(3, 1.6190476, 3.4761905), line_line1[0], line_line1[1]);
// line-polygon
- test_overlay<linestring, polygon, test_get_turns, Tuple>("line_poly1", boost::make_tuple(3, 1.6190476, 3.4761905), line_line1[0], case_1[1]);
- test_overlay<linestring, polygon, test_get_turns, Tuple>("line_poly2", boost::make_tuple(3, 1.6190476, 3.4761905), line_line1[1], case_1[0]);
- test_overlay<polygon, linestring, test_get_turns, Tuple>("poly_line", boost::make_tuple(3, 1.6190476, 3.4761905), case_1[1], line_line1[0]);
+ test_overlay<linestring, polygon, test_get_turns, Tuple>("line_poly1", boost::make_tuple(4, 1.6190476, 3.4761905), line_line1[0], case_1[1]);
+ test_overlay<linestring, polygon, test_get_turns, Tuple>("line_poly2", boost::make_tuple(4, 1.6190476, 3.4761905), line_line1[1], case_1[0]);
+ test_overlay<polygon, linestring, test_get_turns, Tuple>("poly_line", boost::make_tuple(4, 1.6190476, 3.4761905), case_1[1], line_line1[0]);
}
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.vcproj
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.vcproj (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/get_turns.vcproj 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -46,6 +46,7 @@
ExceptionHandling="2"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
+ DebugInformationFormat="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay.sln
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay.sln (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay.sln 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -18,6 +18,8 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dissolver", "dissolver.vcproj", "{6CCB145C-C682-4B9F-8672-6D04DB5C76DD}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ccw_traverse", "ccw_traverse.vcproj", "{BA789719-B2FC-405A-9258-E9E4ABCE1791}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -60,6 +62,10 @@
{6CCB145C-C682-4B9F-8672-6D04DB5C76DD}.Debug|Win32.Build.0 = Debug|Win32
{6CCB145C-C682-4B9F-8672-6D04DB5C76DD}.Release|Win32.ActiveCfg = Release|Win32
{6CCB145C-C682-4B9F-8672-6D04DB5C76DD}.Release|Win32.Build.0 = Release|Win32
+ {BA789719-B2FC-405A-9258-E9E4ABCE1791}.Debug|Win32.ActiveCfg = Debug|Win32
+ {BA789719-B2FC-405A-9258-E9E4ABCE1791}.Debug|Win32.Build.0 = Debug|Win32
+ {BA789719-B2FC-405A-9258-E9E4ABCE1791}.Release|Win32.ActiveCfg = Release|Win32
+ {BA789719-B2FC-405A-9258-E9E4ABCE1791}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_cases.hpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_cases.hpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/overlay_cases.hpp 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -332,7 +332,56 @@
"POLYGON((2500 3000,2500 1875,2208 1913,1937 2025,1704 2204,1525 2437,1413 2708,1375 3000,1413 3291,1525 3562,1704 3795,1937 3974,2208 4086,2499 4125,2791 4086,3062 3974,3295 3795,3474 3562,3586 3291,3625 3000,3586 2708,3474 2437,2500 3000))"
};
+// Cases coming from High volume (hv) tests
+static std::string hv_1[2] = {
+ "POLYGON((24.995166778564453 50.011310577392578,46.630809783935547 37.494682312011719,46.661380767822266 12.499360084533691,25.003841400146484 0.020658308640122414,3.3419711589813232 12.491842269897461,3.3638687133789062 37.487174987792969,24.995166778564453 50.011310577392578))",
+ "POLYGON((25.025228500366211 49.992599487304688,46.6719970703125 37.482185363769531,46.631874084472656 12.480358123779297,24.974153518676758 -0.011088892817497253,3.3419976234436035 12.524576187133789,3.3529467582702637 37.526435852050781,25.025228500366211 49.992599487304688))"
+ };
+
+static std::string hv_2[2] = {
+ "POLYGON((24.988700866699219 49.986705780029297,46.643772125244141 37.5079345703125,46.645118713378906 12.514699935913086,25.010652542114258 0.00024537215358577669,3.3652000427246094 12.495694160461426,3.3445985317230225 37.488922119140625,24.988700866699219 49.986705780029297))",
+ "POLYGON((24.993022918701172 49.977996826171875,46.643772125244141 37.503200531005859,46.634654998779297 12.51569938659668,25.005790710449219 0.0029967525042593479,3.3705389499664307 12.504646301269531,3.348651647567749 37.492141723632812,24.993022918701172 49.977996826171875))"
+ };
+
+static std::string hv_3[2] = {
+ "POLYGON((25.007728576660156 49.988899230957031,46.667163848876953 37.501667022705078,46.637229919433594 12.500443458557129,24.993251800537109 -0.01356174610555172,3.3565254211425781 12.512973785400391,3.3410670757293701 37.514209747314453,25.007728576660156 49.988899230957031))",
+ "POLYGON((24.998353958129883 49.993511199951172,46.659591674804688 37.507373809814453,46.646518707275391 12.505118370056152,25.002584457397461 -0.0109936548396945,3.3565335273742676 12.501456260681152,3.3392288684844971 37.503707885742188,24.998353958129883 49.993511199951172))"
+ };
+
+static std::string hv_4[2] = {
+ "POLYGON((25.009130477905273 50.022209167480469,46.670387268066406 37.500617980957031,46.666873931884766 12.480625152587891,24.992231369018555 -0.017777863889932632,3.3260366916656494 12.495262145996094,3.3394229412078857 37.515254974365234,25.009130477905273 50.022209167480469))",
+ "POLYGON((25.00263786315918 50.019630432128906,46.669231414794922 37.507579803466797,46.666202545166016 12.487733840942383,24.997152328491211 -0.020060751587152481,3.3308455944061279 12.492485046386719,3.3333024978637695 37.5123291015625,25.00263786315918 50.019630432128906))"
+ };
+
+static std::string hv_5[2] = {
+ "POLYGON((24.987522125244141 49.997768402099609,46.643741607666016 37.509471893310547,46.654956817626953 12.510490417480469,25.011669158935547 -0.00019846600480377674,3.3563058376312256 12.489578247070313,3.3433761596679687 37.488559722900391,24.987522125244141 49.997768402099609))",
+ "POLYGON((25.005760192871094 50.008182525634766,46.648590087890625 37.491542816162109,46.655918121337891 12.489977836608887,24.994773864746094 0.0050580352544784546,3.3391191959381104 12.499494552612305,3.3574333190917969 37.501052856445312,25.005760192871094 50.008182525634766))"
+ };
+static std::string hv_6[2] = {
+ "POLYGON((25.011470794677734 50.017532348632813,42.678981781005859 42.661365509033203,50.017532348632813 24.986530303955078,42.661365509033203 7.3190178871154785,24.986530303955078 -0.019533095881342888,7.3190178871154785 7.336634635925293,-0.019533095881342888 25.011470794677734,7.336634635925293 42.678981781005859,25.011470794677734 50.017532348632813))",
+ "POLYGON((25.002880096435547 50.013965606689453,46.671913146972656 37.507381439208984,46.660655975341797 12.488155364990234,24.9951171875 -0.024483053013682365,3.3334629535675049 12.494877815246582,3.3299689292907715 37.514102935791016,25.002880096435547 50.013965606689453))"
+ };
+
+static std::string hv_7[2] = {
+ "POLYGON((24.983684539794922 49.995647430419922,46.643482208251953 37.513137817382813,46.654392242431641 12.51393985748291,25.014318466186523 -0.0027416276279836893,3.3589246273040771 12.487411499023438,3.3391971588134766 37.486602783203125,24.983684539794922 49.995647430419922))",
+ "POLYGON((24.990163803100586 49.9993896484375,46.655281066894531 37.512466430664062,46.654388427734375 12.506458282470703,25.007841110229492 -0.012621366418898106,3.3524465560913086 12.491152763366699,3.3338801860809326 37.497154235839844,24.990163803100586 49.9993896484375))"
+ };
+
+static std::string dz_1[2] = {
+ "POLYGON((30.526203155517578 56.781166076660156,38.987510681152344 58.710700988769531,41.042613983154297 50.279010772705078,48.390048980712891 45.660350799560547,43.881126403808594 38.245067596435547,45.810657501220703 29.783760070800781,37.378971099853516 27.728654861450195,32.760307312011719 20.381219863891602,25.345026016235352 24.890144348144531,16.883718490600586 22.960611343383789,14.828612327575684 31.392299652099609,7.481177806854248 36.010959625244141,11.990103721618652 43.426242828369141,10.060568809509277 51.887550354003906,18.492258071899414 53.942657470703125,23.110919952392578 61.290092468261719,30.526203155517578 56.781166076660156))",
+ "POLYGON((12.580197334289551 33.274467468261719,14.852641105651855 24.577714920043945,21.524574279785156 30.601236343383789,18.734457015991211 22.056488037109375,27.603805541992188 23.51667594909668,20.636968612670898 17.836828231811523,28.887777328491211 14.270085334777832,19.956142425537109 13.258448600769043,24.968837738037109 5.7971897125244141,16.908138275146484 9.7749528884887695,17.091224670410156 0.78807485103607178,12.460672378540039 8.4923257827758789,7.7560214996337891 0.83309894800186157,8.0257854461669922 9.8177928924560547,-0.072908863425254822 5.9179673194885254,5.0115232467651367 13.330527305603027,-3.9099369049072266 14.42827033996582,4.3748917579650879 17.915260314941406,-2.5368332862854004 23.662046432495117,6.3180174827575684 22.116373062133789,3.6104514598846436 30.687637329101563,10.223971366882324 24.600040435791016,12.580197334289551 33.274467468261719))"
+ };
+
+static std::string dz_2[2] = {
+ "POLYGON((24.587966918945313 61.027225494384766,32.1783447265625 62.988296508789063,34.655326843261719 55.550270080566406,41.730445861816406 52.173538208007812,38.846851348876953 44.883510589599609,42.096187591552734 37.748981475830078,35.201282501220703 34.018035888671875,33.104434967041016 26.46403694152832,25.42442512512207 28.037921905517578,18.962528228759766 23.599054336547852,14.090974807739258 29.741334915161133,6.2876262664794922 30.494592666625977,6.5039811134338379 38.331226348876953,1.0104535818099976 43.924152374267578,6.2134823799133301 49.788291931152344,5.6002583503723145 57.603889465332031,13.355405807495117 58.751640319824219,17.909420013427734 65.132911682128906,24.587966918945313 61.027225494384766))",
+ "POLYGON((43.551433563232422 47.905071258544922,46.384872436523438 39.57366943359375,53.589195251464844 44.627212524414063,50.984420776367188 36.221515655517578,59.783241271972656 36.075325012207031,52.735191345214844 30.806018829345703,59.767654418945313 25.51593017578125,50.968441009521484 25.395713806152344,53.548389434814453 16.982362747192383,46.359016418457031 22.057153701782227,43.500991821289063 13.734155654907227,40.667552947998047 22.065553665161133,33.463230133056641 17.012012481689453,36.068000793457031 25.417709350585938,27.269184112548828 25.563901901245117,34.317234039306641 30.833206176757812,27.284770965576172 36.123294830322266,36.083980560302734 36.243511199951172,33.504035949707031 44.6568603515625,40.693408966064453 39.582073211669922,43.551433563232422 47.905071258544922))"
+ };
+
+static std::string dz_3[2] = {
+ "POLYGON((20.813335418701172 73.060707092285156,22.815366744995117 61.968788146972656,31.383756637573242 69.291458129882813,28.001794815063477 58.539661407470703,38.991741180419922 61.041633605957031,31.000555038452148 53.093067169189453,41.894393920898437 50.201171875,31.124666213989258 46.876754760742188,39.426750183105469 39.253490447998047,28.345697402954102 41.314804077148438,32.154121398925781 30.706569671630859,23.300275802612305 37.681396484375,21.742572784423828 26.518407821655273,17.144247055053711 36.808895111083984,10.5772705078125 27.648460388183594,11.287883758544922 38.897186279296875,1.2160475254058838 33.837848663330078,7.0728073120117187 43.467861175537109,-4.1965517997741699 43.668655395507812,5.4646410942077637 49.473834991455078,-4.4205660820007324 54.888763427734375,6.8317971229553223 55.539215087890625,0.59532338380813599 64.927780151367187,10.861076354980469 60.274494171142578,9.7020368576049805 71.485885620117188,16.629419326782227 62.594875335693359,20.813335418701172 73.060707
092285156))",
+ "POLYGON((1.6459450721740723 46.720386505126953,10.693820953369141 61.892372131347656,7.2385158538818359 44.568569183349609,23.921955108642578 50.3751220703125,10.139513969421387 39.325347900390625,26.652151107788086 33.049518585205078,8.9915294647216797 33.444084167480469,17.606916427612305 18.02239990234375,4.3317174911499023 29.676681518554687,1.0186206102371216 12.32512378692627,-1.6595441102981567 29.785955429077148,-15.35089111328125 18.623508453369141,-6.1788778305053711 33.720771789550781,-23.842140197753906 33.970470428466797,-7.1116366386413574 39.639987945556641,-20.481979370117188 51.184993743896484,-4.0213727951049805 44.773937225341797,-6.8426628112792969 62.212215423583984,1.6459450721740723 46.720386505126953))"
+ };
static std::string ticket_17[2] = {
"POLYGON ((-122.28139163 37.37319149,-122.28100699 37.37273669,-122.28002186 37.37303123,-122.27979681 37.37290072,-122.28007349 37.37240493,-122.27977334 37.37220360,-122.27819720 37.37288580,-122.27714184 37.37275161,-122.27678628 37.37253167,-122.27766437 37.37180973,-122.27804382 37.37121453,-122.27687664 37.37101354,-122.27645829 37.37203386,-122.27604423 37.37249110,-122.27632234 37.37343339,-122.27760980 37.37391082,-122.27812478 37.37800320,-122.26117222 37.39121007,-122.25572289 37.39566631,-122.25547269 37.39564971,-122.25366304 37.39552993,-122.24919976 37.39580268,-122.24417933 37.39366907,-122.24051443 37.39094143,-122.23246277 37.38100418,-122.23606766 37.38141338,-122.24001587 37.37738940,-122.23666848 37.37609347,-122.23057450 37.37882170,-122.22679803 37.37807143,-122.22525727 37.37448817,-122.22523229 37.37443000,-122.23083199 37.37609347,-122.23033486 37.37777891,-122.23169030 37.37732117,-122.23229178 37.37709687,-122.23237761 37.37631249,-122.23297776 37.37438834,-122.23872850 37.37
165986,-122.24044511 37.36934068,-122.24671067 37.36865847,-122.24825570 37.36981819,-122.25151719 37.36947713,-122.25357721 37.36756706,-122.26001451 37.36579354,-122.25615213 37.36545239,-122.25486458 37.36245083,-122.25357721 37.36108651,-122.25194642 37.36013139,-122.24885652 37.35958557,-122.24911401 37.35849399,-122.25357721 37.35808470,-122.25675286 37.35897159,-122.25855539 37.35753887,-122.26181687 37.35828939,-122.26713837 37.35897159,-122.26782510 37.36108651,-122.26662339 37.36456559,-122.27288911 37.36722601,-122.27366159 37.36531602,-122.27168740 37.36470213,-122.27391900 37.36374701,-122.27074326 37.36245083,-122.27134408 37.35951742,-122.27426240 37.36135926,-122.27709482 37.36115474,-122.27966974 37.36231438,-122.27958391 37.36463382,-122.27572152 37.36463382,-122.27563569 37.36524779,-122.27700899 37.36593000,-122.27709482 37.36763529,-122.27554978 37.36838573,-122.27667254 37.36931478,-122.27677932 37.36932073,-122.27769362 37.36853987,-122.27942490 37.36830803,-122.28178776 37.36677917,-1
22.28509559 37.36443500,-122.28845129 37.36413744,-122.29194403 37.36695946,-122.29382577 37.36726817,-122.29600414 37.36898512,-122.29733083 37.36995398,-122.29593239 37.37141436,-122.29416649 37.37075898,-122.29325026 37.37108436,-122.29652910 37.37311697,-122.29584237 37.37374461,-122.29537583 37.37573372,-122.29487677 37.37752502,-122.30923212 37.37593011,-122.31122484 37.38230086,-122.31467994 37.38092472,-122.31715663 37.38252181,-122.32307970 37.38166978,-122.31985618 37.37667694,-122.32210304 37.37580220,-122.32581446 37.37589532,-122.32401730 37.37331839,-122.32960417 37.37189020,-122.33465527 37.37331906,-122.33425328 37.37623680,-122.33620676 37.37726132,-122.33397986 37.37822382,-122.33358918 37.38036590,-122.33202637 37.37986918,-122.33147954 37.38101784,-122.33394080 37.38198017,-122.33545239 37.38587943,-122.33478058 37.38785697,-122.33386050 37.38723721,-122.33350041 37.38571137,-122.33122003 37.38548891,-122.33140008 37.38650606,-122.33366042 37.38817490,-122.33244019 37.39157602,-122.332981
57 37.39419201,-122.33164013 37.39477028,-122.33202017 37.39518351,-122.33358038 37.39499282,-122.33376050 37.39597811,-122.33550067 37.39734478,-122.33556069 37.39481797,-122.33344040 37.39292676,-122.33638094 37.38892189,-122.34240644 37.38852719,-122.34906293 37.38726898,-122.35072321 37.39338769,-122.34910291 37.39445252,-122.34796272 37.39410291,-122.34449043 37.39640534,-122.34500223 37.39729709,-122.34936291 37.39670910,-122.35098322 37.39531066,-122.35364623 37.39554510,-122.35434369 37.39612111,-122.35798429 37.39600988,-122.35768430 37.39478621,-122.36334519 37.39206871,-122.36604726 37.39203267,-122.36778592 37.39335592,-122.36518870 37.40022011,-122.36554552 37.40247752,-122.36370519 37.40331974,-122.36270506 37.40530591,-122.36320512 37.40670418,-122.36149849 37.40851392,-122.36730580 37.41054938,-122.37263720 37.41378932,-122.37161871 37.42076600,-122.36566153 37.42006292,-122.36520547 37.42742106,-122.37165953 37.43661157,-122.35943972 37.44459022,-122.35356359 37.44600810,-122.33792254 37.457
96329,-122.35228518 37.47478091,-122.35127080 37.48181199,-122.34867342 37.48487322,-122.34359717 37.48801082,-122.33388431 37.48677650,-122.33142321 37.48429747,-122.32929580 37.48473149,-122.32609609 37.48291144,-122.32344850 37.48228229,-122.31924364 37.48410234,-122.31677299 37.48114051,-122.31431751 37.47848973,-122.31259201 37.47682190,-122.31515972 37.47568196,-122.31691389 37.47360309,-122.31292494 37.46960081,-122.31130153 37.46937743,-122.30889894 37.47124987,-122.30612839 37.47011613,-122.30149630 37.46568378,-122.30064277 37.46363784,-122.29283821 37.45922376,-122.28630141 37.45415497,-122.28883099 37.44629920,-122.28316717 37.44197138,-122.27554148 37.42297597,-122.25597410 37.40553692,-122.25196579 37.40129593,-122.25012043 37.40049143,-122.24823207 37.39897758,-122.24754551 37.39740941,-122.24778582 37.39621607,-122.24934787 37.39599102,-122.25005170 37.39871849,-122.25222328 37.39863668,-122.25342491 37.39737529,-122.25520162 37.39667289,-122.25528737 37.39522726,-122.27747460 37.37809616,-12
2.27977493 37.37858717,-122.28157729 37.37920106,-122.28322534 37.37952846,-122.28416939 37.38092656,-122.28621223 37.37984219,-122.28638389 37.37613857,-122.28382607 37.37843722,-122.27930278 37.37718220,-122.28196361 37.37652740,-122.28295058 37.37568167,-122.28216101 37.37523148,-122.28114822 37.37543608,-122.27934569 37.37528613,-122.27996369 37.37448121,-122.28104521 37.37454944,-122.28185197 37.37422883,-122.28290767 37.37474038,-122.28376597 37.37467224,-122.28428104 37.37399012,-122.28402346 37.37338989,-122.28610922 37.37364914,-122.28651264 37.37327388,-122.28672722 37.37207343,-122.28628398 37.37205448,-122.28574460 37.37166682,-122.28479711 37.37200981,-122.28327731 37.37137228,-122.28285511 37.37100700,-122.28279409 37.37125669,-122.28315527 37.37173756,-122.28321872 37.37220569,-122.28187007 37.37231918,-122.28193109 37.37294908,-122.28139163 37.37319149))",
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.cpp 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -49,8 +49,8 @@
#include <boost/geometry/strategies/strategies.hpp>
-#include <overlay_common.hpp>
-#include <overlay_cases.hpp>
+#include <algorithms/overlay/overlay_common.hpp>
+#include <algorithms/overlay/overlay_cases.hpp>
#if defined(TEST_WITH_SVG)
# include <boost/geometry/extensions/io/svg/svg_mapper.hpp>
@@ -145,10 +145,10 @@
mapper.map(g2, "fill-opacity:0.3;fill:rgb(51,51,153);"
"stroke:rgb(51,51,153);stroke-width:3");
- // Traversal rings in magenta/light yellow fill
+ // Traversal rings in magenta outline/red fill -> over blue/green this gives brown
BOOST_FOREACH(ring_type const& ring, v)
{
- mapper.map(ring, "fill-opacity:0.05;stroke-opacity:0.4;fill:rbg(255,255,128);"
+ mapper.map(ring, "fill-opacity:0.2;stroke-opacity:0.4;fill:rgb(255,0,0);"
"stroke:rgb(255,0,255);stroke-width:8");
}
@@ -181,7 +181,7 @@
<< ": " << bg::operation_char(turn.operations[0].operation)
<< " " << bg::operation_char(turn.operations[1].operation)
<< " (" << bg::method_char(turn.method) << ")"
- << (turn.ignore ? " (ignore) " : " ")
+ << (turn.ignore() ? " (ignore) " : " ")
<< std::endl
<< "ip: " << turn.operations[0].enriched.travels_to_ip_index
@@ -241,15 +241,10 @@
#ifdef BOOST_GEOMETRY_DEBUG_OVERLAY_ONLY_ONE
{
- // distance-zero-2
- std::string dz[2] = {
- "POLYGON((24.587966918945313 61.027225494384766,32.1783447265625 62.988296508789063,34.655326843261719 55.550270080566406,41.730445861816406 52.173538208007812,38.846851348876953 44.883510589599609,42.096187591552734 37.748981475830078,35.201282501220703 34.018035888671875,33.104434967041016 26.46403694152832,25.42442512512207 28.037921905517578,18.962528228759766 23.599054336547852,14.090974807739258 29.741334915161133,6.2876262664794922 30.494592666625977,6.5039811134338379 38.331226348876953,1.0104535818099976 43.924152374267578,6.2134823799133301 49.788291931152344,5.6002583503723145 57.603889465332031,13.355405807495117 58.751640319824219,17.909420013427734 65.132911682128906,24.587966918945313 61.027225494384766))",
- "POLYGON((43.551433563232422 47.905071258544922,46.384872436523438 39.57366943359375,53.589195251464844 44.627212524414063,50.984420776367188 36.221515655517578,59.783241271972656 36.075325012207031,52.735191345214844 30.806018829345703,59.767654418945313 25.51593017578125,50.968441009521484 25.395713806152344,53.548389434814453 16.982362747192383,46.359016418457031 22.057153701782227,43.500991821289063 13.734155654907227,40.667552947998047 22.065553665161133,33.463230133056641 17.012012481689453,36.068000793457031 25.417709350585938,27.269184112548828 25.563901901245117,34.317234039306641 30.833206176757812,27.284770965576172 36.123294830322266,36.083980560302734 36.243511199951172,33.504035949707031 44.6568603515625,40.693408966064453 39.582073211669922,43.551433563232422 47.905071258544922))"
- };
test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("dz_2",
- boost::make_tuple(2, 68.678921274288541), dz[0], dz[1]);
+ boost::make_tuple(2, 68.678921274288541), dz_2[0], dz_2[1]);
test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("dz_2",
- boost::make_tuple(2, 1505.4202304878663), dz[0], dz[1]);
+ boost::make_tuple(2, 1505.4202304878663), dz_2[0], dz_2[1]);
}
return;
#endif
@@ -263,10 +258,10 @@
return;
*/
- test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("49b", boost::make_tuple(1, 15), case_49[0], case_49[1]);
- test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("55c", boost::make_tuple(3, 18), case_55[0], case_55[1]);
- test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("55c", boost::make_tuple(1, 2), case_55[0], case_55[1]);
- return;
+ //test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("49b", boost::make_tuple(1, 15), case_49[0], case_49[1]);
+ //test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("55c", boost::make_tuple(3, 18), case_55[0], case_55[1]);
+ //test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("55c", boost::make_tuple(1, 2), case_55[0], case_55[1]);
+ //return;
// 1-6
@@ -485,67 +480,29 @@
// Solved now.
// ("hv" means "high volume")
{
- std::string hv[2] = {
- "POLYGON((24.995166778564453 50.011310577392578,46.630809783935547 37.494682312011719,46.661380767822266 12.499360084533691,25.003841400146484 0.020658308640122414,3.3419711589813232 12.491842269897461,3.3638687133789062 37.487174987792969,24.995166778564453 50.011310577392578))",
- "POLYGON((25.025228500366211 49.992599487304688,46.6719970703125 37.482185363769531,46.631874084472656 12.480358123779297,24.974153518676758 -0.011088892817497253,3.3419976234436035 12.524576187133789,3.3529467582702637 37.526435852050781,25.025228500366211 49.992599487304688))"
- };
- test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv1", boost::make_tuple(1, 1624.508688461573), hv[0], hv[1], 0.1);
- test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv1", boost::make_tuple(1, 1622.7200125123809), hv[0], hv[1], 0.1);
- }
- {
- std::string hv[2] = {
- "POLYGON((24.988700866699219 49.986705780029297,46.643772125244141 37.5079345703125,46.645118713378906 12.514699935913086,25.010652542114258 0.00024537215358577669,3.3652000427246094 12.495694160461426,3.3445985317230225 37.488922119140625,24.988700866699219 49.986705780029297))",
- "POLYGON((24.993022918701172 49.977996826171875,46.643772125244141 37.503200531005859,46.634654998779297 12.51569938659668,25.005790710449219 0.0029967525042593479,3.3705389499664307 12.504646301269531,3.348651647567749 37.492141723632812,24.993022918701172 49.977996826171875))"
- };
- test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv2", boost::make_tuple(1, 1622.9193392726836), hv[0], hv[1], 0.1);
- test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv2", boost::make_tuple(1, 1622.1733591429329), hv[0], hv[1], 0.1);
- }
- {
- std::string hv[2] = {
- "POLYGON((25.007728576660156 49.988899230957031,46.667163848876953 37.501667022705078,46.637229919433594 12.500443458557129,24.993251800537109 -0.01356174610555172,3.3565254211425781 12.512973785400391,3.3410670757293701 37.514209747314453,25.007728576660156 49.988899230957031))",
- "POLYGON((24.998353958129883 49.993511199951172,46.659591674804688 37.507373809814453,46.646518707275391 12.505118370056152,25.002584457397461 -0.0109936548396945,3.3565335273742676 12.501456260681152,3.3392288684844971 37.503707885742188,24.998353958129883 49.993511199951172))"
- };
- test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv3", boost::make_tuple(1, 1624.22079205664), hv[0], hv[1], 0.1);
- test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv3", boost::make_tuple(1, 1623.8265057282042), hv[0], hv[1], 0.1);
- }
- {
- std::string hv[2] = {
- "POLYGON((25.009130477905273 50.022209167480469,46.670387268066406 37.500617980957031,46.666873931884766 12.480625152587891,24.992231369018555 -0.017777863889932632,3.3260366916656494 12.495262145996094,3.3394229412078857 37.515254974365234,25.009130477905273 50.022209167480469))",
- "POLYGON((25.00263786315918 50.019630432128906,46.669231414794922 37.507579803466797,46.666202545166016 12.487733840942383,24.997152328491211 -0.020060751587152481,3.3308455944061279 12.492485046386719,3.3333024978637695 37.5123291015625,25.00263786315918 50.019630432128906))"
- };
- test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv4", boost::make_tuple(1, 1626.5146964146334), hv[0], hv[1], 0.1);
- test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv4", boost::make_tuple(1, 1626.2580370864305), hv[0], hv[1], 0.1);
- }
- {
- std::string hv[2] = {
- "POLYGON((24.987522125244141 49.997768402099609,46.643741607666016 37.509471893310547,46.654956817626953 12.510490417480469,25.011669158935547 -0.00019846600480377674,3.3563058376312256 12.489578247070313,3.3433761596679687 37.488559722900391,24.987522125244141 49.997768402099609))",
- "POLYGON((25.005760192871094 50.008182525634766,46.648590087890625 37.491542816162109,46.655918121337891 12.489977836608887,24.994773864746094 0.0050580352544784546,3.3391191959381104 12.499494552612305,3.3574333190917969 37.501052856445312,25.005760192871094 50.008182525634766))"
- };
- test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv5", boost::make_tuple(1, 1624.2158307261871), hv[0], hv[1], 0.1);
- test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv5", boost::make_tuple(1, 1623.4506071521519), hv[0], hv[1], 0.1);
- }
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv1", boost::make_tuple(1, 1624.508688461573), hv_1[0], hv_1[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv1", boost::make_tuple(1, 1622.7200125123809), hv_1[0], hv_1[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv2", boost::make_tuple(1, 1622.9193392726836), hv_2[0], hv_2[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv2", boost::make_tuple(1, 1622.1733591429329), hv_2[0], hv_2[1], 0.1);
- // Case 2009-12-07
- {
- std::string hv[2] = {
- "POLYGON((25.011470794677734 50.017532348632813,42.678981781005859 42.661365509033203,50.017532348632813 24.986530303955078,42.661365509033203 7.3190178871154785,24.986530303955078 -0.019533095881342888,7.3190178871154785 7.336634635925293,-0.019533095881342888 25.011470794677734,7.336634635925293 42.678981781005859,25.011470794677734 50.017532348632813))",
- "POLYGON((25.002880096435547 50.013965606689453,46.671913146972656 37.507381439208984,46.660655975341797 12.488155364990234,24.9951171875 -0.024483053013682365,3.3334629535675049 12.494877815246582,3.3299689292907715 37.514102935791016,25.002880096435547 50.013965606689453))"
- };
- test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv6", boost::make_tuple(1, 1604.6318757402121), hv[0], hv[1], 0.1);
- test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv6", boost::make_tuple(1, 1790.091872401327), hv[0], hv[1], 0.1);
- }
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv3", boost::make_tuple(1, 1624.22079205664), hv_3[0], hv_3[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv3", boost::make_tuple(1, 1623.8265057282042), hv_3[0], hv_3[1], 0.1);
- // Case 2009-12-08, needing sorting on side in enrich_intersection_points
- {
- std::string hv[2] = {
- "POLYGON((24.983684539794922 49.995647430419922,46.643482208251953 37.513137817382813,46.654392242431641 12.51393985748291,25.014318466186523 -0.0027416276279836893,3.3589246273040771 12.487411499023438,3.3391971588134766 37.486602783203125,24.983684539794922 49.995647430419922))",
- "POLYGON((24.990163803100586 49.9993896484375,46.655281066894531 37.512466430664062,46.654388427734375 12.506458282470703,25.007841110229492 -0.012621366418898106,3.3524465560913086 12.491152763366699,3.3338801860809326 37.497154235839844,24.990163803100586 49.9993896484375))"
- };
- test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv7", boost::make_tuple(1, 1624.5779453641017), hv[0], hv[1], 0.1);
- test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv7", boost::make_tuple(1, 1623.6936420295772), hv[0], hv[1], 0.1);
- }
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv4", boost::make_tuple(1, 1626.5146964146334), hv_4[0], hv_4[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv4", boost::make_tuple(1, 1626.2580370864305), hv_4[0], hv_4[1], 0.1);
+
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv5", boost::make_tuple(1, 1624.2158307261871), hv_5[0], hv_5[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv5", boost::make_tuple(1, 1623.4506071521519), hv_5[0], hv_5[1], 0.1);
+ // Case 2009-12-07
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv6", boost::make_tuple(1, 1604.6318757402121), hv_6[0], hv_6[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv6", boost::make_tuple(1, 1790.091872401327), hv_6[0], hv_6[1], 0.1);
+
+ // Case 2009-12-08, needing sorting on side in enrich_intersection_points
+ test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("hv7", boost::make_tuple(1, 1624.5779453641017), hv_7[0], hv_7[1], 0.1);
+ test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("hv7", boost::make_tuple(1, 1623.6936420295772), hv_7[0], hv_7[1], 0.1);
+ }
// From "Random Ellipse Stars", this all went wrong
// when distances was zero (dz)
@@ -556,40 +513,23 @@
// Solved (by sorting on sides instead of on distance)
{
// distance-zero-1
- std::string dz[2] = {
- "POLYGON((30.526203155517578 56.781166076660156,38.987510681152344 58.710700988769531,41.042613983154297 50.279010772705078,48.390048980712891 45.660350799560547,43.881126403808594 38.245067596435547,45.810657501220703 29.783760070800781,37.378971099853516 27.728654861450195,32.760307312011719 20.381219863891602,25.345026016235352 24.890144348144531,16.883718490600586 22.960611343383789,14.828612327575684 31.392299652099609,7.481177806854248 36.010959625244141,11.990103721618652 43.426242828369141,10.060568809509277 51.887550354003906,18.492258071899414 53.942657470703125,23.110919952392578 61.290092468261719,30.526203155517578 56.781166076660156))",
- "POLYGON((12.580197334289551 33.274467468261719,14.852641105651855 24.577714920043945,21.524574279785156 30.601236343383789,18.734457015991211 22.056488037109375,27.603805541992188 23.51667594909668,20.636968612670898 17.836828231811523,28.887777328491211 14.270085334777832,19.956142425537109 13.258448600769043,24.968837738037109 5.7971897125244141,16.908138275146484 9.7749528884887695,17.091224670410156 0.78807485103607178,12.460672378540039 8.4923257827758789,7.7560214996337891 0.83309894800186157,8.0257854461669922 9.8177928924560547,-0.072908863425254822 5.9179673194885254,5.0115232467651367 13.330527305603027,-3.9099369049072266 14.42827033996582,4.3748917579650879 17.915260314941406,-2.5368332862854004 23.662046432495117,6.3180174827575684 22.116373062133789,3.6104514598846436 30.687637329101563,10.223971366882324 24.600040435791016,12.580197334289551 33.274467468261719))"
- };
test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("dz_1",
- boost::make_tuple(3, 16.887537949472005), dz[0], dz[1]);
+ boost::make_tuple(3, 16.887537949472005), dz_1[0], dz_1[1]);
test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("dz_1",
- boost::make_tuple(3, 1444.2621305732864), dz[0], dz[1]);
- }
- {
+ boost::make_tuple(3, 1444.2621305732864), dz_1[0], dz_1[1]);
+
// distance-zero-2
- std::string dz[2] = {
- "POLYGON((24.587966918945313 61.027225494384766,32.1783447265625 62.988296508789063,34.655326843261719 55.550270080566406,41.730445861816406 52.173538208007812,38.846851348876953 44.883510589599609,42.096187591552734 37.748981475830078,35.201282501220703 34.018035888671875,33.104434967041016 26.46403694152832,25.42442512512207 28.037921905517578,18.962528228759766 23.599054336547852,14.090974807739258 29.741334915161133,6.2876262664794922 30.494592666625977,6.5039811134338379 38.331226348876953,1.0104535818099976 43.924152374267578,6.2134823799133301 49.788291931152344,5.6002583503723145 57.603889465332031,13.355405807495117 58.751640319824219,17.909420013427734 65.132911682128906,24.587966918945313 61.027225494384766))",
- "POLYGON((43.551433563232422 47.905071258544922,46.384872436523438 39.57366943359375,53.589195251464844 44.627212524414063,50.984420776367188 36.221515655517578,59.783241271972656 36.075325012207031,52.735191345214844 30.806018829345703,59.767654418945313 25.51593017578125,50.968441009521484 25.395713806152344,53.548389434814453 16.982362747192383,46.359016418457031 22.057153701782227,43.500991821289063 13.734155654907227,40.667552947998047 22.065553665161133,33.463230133056641 17.012012481689453,36.068000793457031 25.417709350585938,27.269184112548828 25.563901901245117,34.317234039306641 30.833206176757812,27.284770965576172 36.123294830322266,36.083980560302734 36.243511199951172,33.504035949707031 44.6568603515625,40.693408966064453 39.582073211669922,43.551433563232422 47.905071258544922))"
- };
test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("dz_2",
- boost::make_tuple(2, 68.678921274288541), dz[0], dz[1]);
+ boost::make_tuple(2, 68.678921274288541), dz_2[0], dz_2[1]);
test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("dz_2",
- boost::make_tuple(2, 1505.4202304878663), dz[0], dz[1]);
- }
+ boost::make_tuple(2, 1505.4202304878663), dz_2[0], dz_2[1]);
- {
// distance-zero-3
- std::string dz[2] = {
- "POLYGON((20.813335418701172 73.060707092285156,22.815366744995117 61.968788146972656,31.383756637573242 69.291458129882813,28.001794815063477 58.539661407470703,38.991741180419922 61.041633605957031,31.000555038452148 53.093067169189453,41.894393920898437 50.201171875,31.124666213989258 46.876754760742188,39.426750183105469 39.253490447998047,28.345697402954102 41.314804077148438,32.154121398925781 30.706569671630859,23.300275802612305 37.681396484375,21.742572784423828 26.518407821655273,17.144247055053711 36.808895111083984,10.5772705078125 27.648460388183594,11.287883758544922 38.897186279296875,1.2160475254058838 33.837848663330078,7.0728073120117187 43.467861175537109,-4.1965517997741699 43.668655395507812,5.4646410942077637 49.473834991455078,-4.4205660820007324 54.888763427734375,6.8317971229553223 55.539215087890625,0.59532338380813599 64.927780151367187,10.861076354980469 60.274494171142578,9.7020368576049805 71.485885620117188,16.629419326782227 62.594875335693359,20.813335418701172 7
3.060707092285156))",
- "POLYGON((1.6459450721740723 46.720386505126953,10.693820953369141 61.892372131347656,7.2385158538818359 44.568569183349609,23.921955108642578 50.3751220703125,10.139513969421387 39.325347900390625,26.652151107788086 33.049518585205078,8.9915294647216797 33.444084167480469,17.606916427612305 18.02239990234375,4.3317174911499023 29.676681518554687,1.0186206102371216 12.32512378692627,-1.6595441102981567 29.785955429077148,-15.35089111328125 18.623508453369141,-6.1788778305053711 33.720771789550781,-23.842140197753906 33.970470428466797,-7.1116366386413574 39.639987945556641,-20.481979370117188 51.184993743896484,-4.0213727951049805 44.773937225341797,-6.8426628112792969 62.212215423583984,1.6459450721740723 46.720386505126953))"
- };
test_overlay<polygon, polygon, test_traverse<operation_intersection>, Tuple>("dz_3",
- boost::make_tuple(6, 192.49316937645651), dz[0], dz[1]);
+ boost::make_tuple(6, 192.49316937645651), dz_3[0], dz_3[1]);
test_overlay<polygon, polygon, test_traverse<operation_union>, Tuple>("dz_3",
- boost::make_tuple(6, 1446.496005965641), dz[0], dz[1]);
+ boost::make_tuple(6, 1446.496005965641), dz_3[0], dz_3[1]);
}
- return;
-
return;
Modified: sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.vcproj
==============================================================================
--- sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.vcproj (original)
+++ sandbox/geometry/libs/geometry/test/algorithms/overlay/traverse.vcproj 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -41,11 +41,12 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories=".;../../../../..;../..;c:\svn\msm"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;TEST_WITH_SVG"
ExceptionHandling="2"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
+ DebugInformationFormat="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -113,7 +114,7 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=".;../../../../..;../..;c:\svn\msm"
+ AdditionalIncludeDirectories=".;../../../../..;../.."
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
ExceptionHandling="2"
UsePrecompiledHeader="0"
Modified: sandbox/geometry/libs/geometry/test/test_geometries/wrapped_boost_array.hpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/test_geometries/wrapped_boost_array.hpp (original)
+++ sandbox/geometry/libs/geometry/test/test_geometries/wrapped_boost_array.hpp 2010-10-11 12:18:51 EDT (Mon, 11 Oct 2010)
@@ -148,7 +148,7 @@
inline this_type& operator=(Point const& value)
{
// Check if not passed beyond
- if (m_array.size < Count)
+ if (std::size_t(m_array.size) < Count)
{
*m_current++ = value;
m_array.size++;
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