diff --git a/doc/other/status.xls b/doc/other/status.xls index 1a6ed5c1a..2fe9fc18b 100644 Binary files a/doc/other/status.xls and b/doc/other/status.xls differ diff --git a/doc/src/examples/algorithms/Jamfile.v2 b/doc/src/examples/algorithms/Jamfile.v2 index 72677def0..76e8f03e0 100644 --- a/doc/src/examples/algorithms/Jamfile.v2 +++ b/doc/src/examples/algorithms/Jamfile.v2 @@ -22,6 +22,8 @@ exe assign_box_corners : assign_box_corners.cpp ; exe assign_point_from_index : assign_point_from_index.cpp ; exe assign_point_to_index : assign_point_to_index.cpp ; +exe clear : clear.cpp ; + exe for_each_point : for_each_point.cpp ; exe for_each_point_const : for_each_point_const.cpp ; exe for_each_segment_const : for_each_segment_const.cpp ; diff --git a/doc/src/examples/algorithms/clear.cpp b/doc/src/examples/algorithms/clear.cpp new file mode 100644 index 000000000..50b10b4e8 --- /dev/null +++ b/doc/src/examples/algorithms/clear.cpp @@ -0,0 +1,62 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// +// Copyright Barend Gehrels 2011, 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) +// +// Quickbook Example + +//[clear +//` Shows how to clear a ring or polygon + +#include + +#include +#include +#include + +#include + +int main() +{ + using boost::assign::tuple_list_of; + + typedef boost::tuple point; + typedef boost::geometry::model::polygon polygon; + typedef boost::geometry::model::ring ring; + + polygon poly; + + // Fill the polygon (using its own methods + Boost.Assign) + poly.outer() = tuple_list_of(0, 0)(0, 10)(11, 11)(0, 0); + poly.inners().push_back(tuple_list_of(0, 0)(0, 10)(11, 11)(0, 0)); + + std::cout << boost::geometry::dsv(poly) << std::endl; + boost::geometry::clear(poly); + std::cout << boost::geometry::dsv(poly) << std::endl; + + // Create a ring using Boost.Assign + ring r = tuple_list_of(0, 0)(0, 9)(8, 8)(0, 0); + + std::cout << boost::geometry::dsv(r) << std::endl; + boost::geometry::clear(r); + std::cout << boost::geometry::dsv(r) << std::endl; + + return 0; +} + +//] + + +//[clear_output +/*` +Output: +[pre +(((0, 0), (0, 10), (11, 11), (0, 0)), ((0, 0), (0, 10), (11, 11), (0, 0))) +(()) +((0, 0), (0, 9), (8, 8), (0, 0)) +() +] +*/ +//] diff --git a/doc/src/examples/algorithms/difference.cpp b/doc/src/examples/algorithms/difference.cpp index 0d1112fdd..65d968805 100644 --- a/doc/src/examples/algorithms/difference.cpp +++ b/doc/src/examples/algorithms/difference.cpp @@ -54,7 +54,7 @@ int main() std::cout << i++ << ": " << boost::geometry::area(p) << std::endl; } - /*<-*/ create_svg("difference_a.svg", green, blue, output); /*->*/ + /*<-*/ create_svg("difference_b.svg", green, blue, output); /*->*/ return 0; } diff --git a/test/algorithms/intersection.cpp b/test/algorithms/intersection.cpp index b6eb2560f..cb822fc8f 100644 --- a/test/algorithms/intersection.cpp +++ b/test/algorithms/intersection.cpp @@ -32,9 +32,9 @@ static std::string pie_2_3_23_0[2] = template void test_areal() { - /*test_one("pie_2_3_23_0", + test_one("pie_2_3_23_0", pie_2_3_23_0[0], pie_2_3_23_0[1], - 1, 4, 163292.677335535, 0.01);*/ + 1, 4, 163292.679042133, 0.1); test_one("simplex_with_empty_1", simplex_normal[0], polygon_empty, diff --git a/test/algorithms/overlay/robustness/intersection_pies.cpp b/test/algorithms/overlay/robustness/intersection_pies.cpp index 8d6724ccc..3a3ca4d37 100644 --- a/test/algorithms/overlay/robustness/intersection_pies.cpp +++ b/test/algorithms/overlay/robustness/intersection_pies.cpp @@ -255,10 +255,10 @@ int main(int argc, char** argv) description.add_options() ("help", "Help message") - ("svg", po::value(&svg)->default_value(false), "Create an SVG filename for all tests") ("multi", po::value(&multi)->default_value(false), "Multiple tangencies at one point") ("ccw", po::value(&ccw)->default_value(false), "Counter clockwise polygons") - ("open", po::value(&open)->default_value(false), "Open polytons") + ("open", po::value(&open)->default_value(false), "Open polygons") + ("svg", po::value(&svg)->default_value(false), "Create an SVG filename for all tests") ; po::variables_map varmap; diff --git a/test/algorithms/overlay/robustness/recursive_polygons.cpp b/test/algorithms/overlay/robustness/recursive_polygons.cpp index 35ae2d65e..a9d00aef7 100644 --- a/test/algorithms/overlay/robustness/recursive_polygons.cpp +++ b/test/algorithms/overlay/robustness/recursive_polygons.cpp @@ -160,6 +160,8 @@ int main(int argc, char** argv) int seed = static_cast(std::time(0)); int level = 3; int field_size = 10; + bool ccw = false; + bool open = false; bool svg = false; std::string form = "box"; @@ -170,6 +172,8 @@ int main(int argc, char** argv) ("level", po::value(&level)->default_value(3), "Level to reach (higher->slower)") ("size", po::value(&field_size)->default_value(10), "Size of the field") ("form", po::value(&form)->default_value("box"), "Form of the polygons (box, triangle)") + ("ccw", po::value(&ccw)->default_value(false), "Counter clockwise polygons") + ("open", po::value(&open)->default_value(false), "Open polygons") ("svg", po::value(&svg)->default_value(false), "Create an SVG filename for all tests") ; @@ -183,8 +187,25 @@ int main(int argc, char** argv) return 1; } + bool triangular = form != "box"; - test_all(seed, count, field_size, svg, level, form != "box"); + + if (ccw && open) + { + test_all(seed, count, field_size, svg, level, triangular); + } + else if (ccw) + { + test_all(seed, count, field_size, svg, level, triangular); + } + else if (open) + { + test_all(seed, count, field_size, svg, level, triangular); + } + else + { + test_all(seed, count, field_size, svg, level, triangular); + } #if defined(HAVE_TTMATH) // test_all(seed, count, max, svg, level); diff --git a/test/algorithms/overlay/robustness/test_overlay_p_q.hpp b/test/algorithms/overlay/robustness/test_overlay_p_q.hpp index d3d06d20a..66f5f6dd7 100644 --- a/test/algorithms/overlay/robustness/test_overlay_p_q.hpp +++ b/test/algorithms/overlay/robustness/test_overlay_p_q.hpp @@ -48,7 +48,7 @@ static bool test_overlay_p_q(std::string const& caseid, CalculationType area_q = bg::area(q); bg::intersection(p, q, out_i); - CalculationType area_i = abs(bg::area(out_i)); // TEMP abs call, TODO solve this + CalculationType area_i = bg::area(out_i); bg::union_(p, q, out_u); CalculationType area_u = bg::area(out_u); @@ -77,6 +77,8 @@ static bool test_overlay_p_q(std::string const& caseid, result = false; svg = true; } + bg::unique(out_i); + bg::unique(out_u); std::cout << "type: " << string_from_type::name() @@ -94,6 +96,8 @@ static bool test_overlay_p_q(std::string const& caseid, << std::setprecision(20) << " p: " << bg::wkt(p) << std::endl << " q: " << bg::wkt(q) << std::endl + << " i: " << bg::wkt(out_i) << std::endl + << " u: " << bg::wkt(out_u) << std::endl ; }