From 85810e31326f381663377c5aed6b3f1f99a68a7c Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 2 Apr 2011 23:17:11 +0000 Subject: [PATCH 01/70] Changes required for run without extensions for release [SVN r70917] --- .../detail/sections/sectionalize.cpp | 1 - test/algorithms/difference.cpp | 32 ++++--------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/test/algorithms/detail/sections/sectionalize.cpp b/test/algorithms/detail/sections/sectionalize.cpp index 0fe0c5138..7071e051e 100644 --- a/test/algorithms/detail/sections/sectionalize.cpp +++ b/test/algorithms/detail/sections/sectionalize.cpp @@ -27,7 +27,6 @@ #include -#define TEST_WITH_SVG #if defined(TEST_WITH_SVG) # include # include diff --git a/test/algorithms/difference.cpp b/test/algorithms/difference.cpp index 948b79bc9..c1564d20b 100644 --- a/test/algorithms/difference.cpp +++ b/test/algorithms/difference.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2010 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2010-2011 Barend Gehrels, 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 @@ -23,8 +23,8 @@ #include #include -#include -#include +//#include +//#include #include #include @@ -272,7 +272,8 @@ void test_all() ***/ } - +/******* +// To be moved to another file template void test_difference_parcel_precision() { @@ -340,31 +341,10 @@ void test_difference_parcel_precision() } #endif } - - -#include - - -template -void test_copy() -{ - std::vector

first; - first.push_back(P(1,1)); - first.push_back(P(2,2)); - - std::vector

second; - boost::copy(first, std::back_inserter(second)); - boost::reverse(second); - - std::vector

third, fourth; - boost::copy(second, boost::copy(first, std::back_inserter(third))); - -} +*****/ int test_main(int, char* []) { - //test_copy >(); - //test_difference_parcel_precision(); //test_difference_parcel_precision(); From 1431123722397604f070d7a7c3bfb7b4207b3bae Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sun, 3 Apr 2011 07:50:11 +0000 Subject: [PATCH 02/70] Ifdefed some examples for release branch [SVN r70919] --- .../examples/algorithms/assign_2d_point.cpp | 6 +++--- .../algorithms/create_svg_overlay.hpp | 7 ++++++- .../examples/algorithms/create_svg_two.hpp | 7 ++++++- example/05_a_overlay_polygon_example.cpp | 12 ++++++++++-- ...5_b_overlay_linestring_polygon_example.cpp | 9 +++++++-- example/06_b_transformation_example.cpp | 11 ++++++++--- example/07_a_graph_route_example.cpp | 19 ++++++++++++++----- example/07_b_graph_route_example.cpp | 18 +++++++++++++----- 8 files changed, 67 insertions(+), 22 deletions(-) diff --git a/doc/src/examples/algorithms/assign_2d_point.cpp b/doc/src/examples/algorithms/assign_2d_point.cpp index 140f0f0c5..e01da8d7a 100644 --- a/doc/src/examples/algorithms/assign_2d_point.cpp +++ b/doc/src/examples/algorithms/assign_2d_point.cpp @@ -16,7 +16,7 @@ #include #include -#if defined(_MSC_VER) +#if defined(HAVE_TTMATH) # include #endif @@ -29,7 +29,7 @@ int main() boost::geometry::model::d2::point_xy p1; assign(p1, 1.2345, 2.3456); -#if defined(_MSC_VER) +#if defined(HAVE_TTMATH) boost::geometry::model::d2::point_xy > p2; assign(p2, "1.2345", "2.3456"); /*< It is possible to assign coordinates with other types than the coordinate type. For ttmath, you can e.g. conveniently use strings. The advantage is that it then has higher precision, because @@ -40,7 +40,7 @@ int main() std::cout << std::setprecision(20) << boost::geometry::dsv(p1) << std::endl -#if defined(_MSC_VER) +#if defined(HAVE_TTMATH) << boost::geometry::dsv(p2) << std::endl #endif ; diff --git a/doc/src/examples/algorithms/create_svg_overlay.hpp b/doc/src/examples/algorithms/create_svg_overlay.hpp index f44dd56e9..a8ed47bcf 100644 --- a/doc/src/examples/algorithms/create_svg_overlay.hpp +++ b/doc/src/examples/algorithms/create_svg_overlay.hpp @@ -13,11 +13,15 @@ #include #include -#include + +#if defined(HAVE_SVG) +# include +#endif template void create_svg(std::string const& filename, Geometry const& a, Geometry const& b, Range const& range) { +#if defined(HAVE_SVG) std::cout << std::endl << "[$img/algorithms/" << boost::replace_all_copy(filename, ".svg", ".png") << "]" << std::endl << std::endl; typedef typename boost::geometry::point_type::type point_type; @@ -38,6 +42,7 @@ void create_svg(std::string const& filename, Geometry const& a, Geometry const& mapper.text(boost::geometry::return_centroid(g), out.str(), "fill:rgb(0,0,0);font-family:Arial;font-size:10px"); } +#endif } // NOTE: convert manually from svg to png using Inkscape ctrl-shift-E diff --git a/doc/src/examples/algorithms/create_svg_two.hpp b/doc/src/examples/algorithms/create_svg_two.hpp index db7843a90..98be922c6 100644 --- a/doc/src/examples/algorithms/create_svg_two.hpp +++ b/doc/src/examples/algorithms/create_svg_two.hpp @@ -13,11 +13,15 @@ #include #include -#include + +#if defined(HAVE_SVG) +# include +#endif template void create_svg(std::string const& filename, Geometry1 const& a, Geometry2 const& b) { +#if defined(HAVE_SVG) std::cout << std::endl << "[$img/algorithms/" << boost::replace_all_copy(filename, ".svg", ".png") << "]" << std::endl << std::endl; typedef typename boost::geometry::point_type::type point_type; @@ -36,6 +40,7 @@ void create_svg(std::string const& filename, Geometry1 const& a, Geometry2 const { mapper.map(b, "opacity:0.8;fill:none;stroke:rgb(255,128,0);stroke-width:4;stroke-dasharray:1,7;stroke-linecap:round"); } +#endif } // NOTE: convert manually from svg to png using Inkscape ctrl-shift-E diff --git a/example/05_a_overlay_polygon_example.cpp b/example/05_a_overlay_polygon_example.cpp index 40d7b4633..9d74b8273 100644 --- a/example/05_a_overlay_polygon_example.cpp +++ b/example/05_a_overlay_polygon_example.cpp @@ -21,7 +21,9 @@ #include #include -#include +#if defined(HAVE_SVG) +# include +#endif int main(void) @@ -32,8 +34,10 @@ int main(void) typedef bg::model::polygon polygon_2d; +#if defined(HAVE_SVG) std::ofstream stream("05_a_intersection_polygon_example.svg"); bg::svg_mapper svg(stream, 500, 500); +#endif // Define a polygons and fill the outer rings. polygon_2d a; @@ -45,7 +49,6 @@ int main(void) } bg::correct(a); std::cout << "A: " << bg::dsv(a) << std::endl; - svg.add(a); polygon_2d b; { @@ -56,10 +59,13 @@ int main(void) } bg::correct(b); std::cout << "B: " << bg::dsv(b) << std::endl; +#if defined(HAVE_SVG) + svg.add(a); svg.add(b); svg.map(a, "opacity:0.6;fill:rgb(0,255,0);"); svg.map(b, "opacity:0.6;fill:rgb(0,0,255);"); +#endif // Calculate interesection(s) @@ -70,7 +76,9 @@ int main(void) BOOST_FOREACH(polygon_2d const& polygon, intersection) { std::cout << bg::dsv(polygon) << std::endl; +#if defined(HAVE_SVG) svg.map(polygon, "opacity:0.5;fill:none;stroke:rgb(255,0,0);stroke-width:6"); +#endif } return 0; diff --git a/example/05_b_overlay_linestring_polygon_example.cpp b/example/05_b_overlay_linestring_polygon_example.cpp index 93cc98861..16eff548e 100644 --- a/example/05_b_overlay_linestring_polygon_example.cpp +++ b/example/05_b_overlay_linestring_polygon_example.cpp @@ -21,7 +21,9 @@ #include #include -#include +#if defined(HAVE_SVG) +# include +#endif int main(void) @@ -43,6 +45,7 @@ int main(void) } bg::correct(p); +#if defined(HAVE_SVG) // Create SVG-mapper std::ofstream stream("05_b_overlay_linestring_polygon_example.svg"); bg::svg_mapper svg(stream, 500, 500); @@ -52,7 +55,7 @@ int main(void) // Map geometries svg.map(ls, "opacity:0.6;stroke:rgb(255,0,0);stroke-width:2;"); svg.map(p, "opacity:0.6;fill:rgb(0,0,255);"); - +#endif // Calculate intersection points (turn points) typedef bg::detail::overlay::turn_info turn_info; @@ -76,8 +79,10 @@ int main(void) } std::cout << action << " polygon at " << bg::dsv(turn.point) << std::endl; +#if defined(HAVE_SVG) svg.map(turn.point, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1"); svg.text(turn.point, action, "fill:rgb(0,0,0);font-family:Arial;font-size:10px"); +#endif } return 0; diff --git a/example/06_b_transformation_example.cpp b/example/06_b_transformation_example.cpp index f31c7fd13..0b6a0542b 100644 --- a/example/06_b_transformation_example.cpp +++ b/example/06_b_transformation_example.cpp @@ -19,9 +19,12 @@ #include #include #include -#include #include +#if defined(HAVE_SVG) +# include +#endif + #include #include #include @@ -84,8 +87,9 @@ struct svg_output void put(G const& g, std::string const& label) { std::string style_str(style.fill(opacity) + style.stroke(5, opacity)); - os << ::boost::geometry::svg(g, style_str) << std::endl; - +#if defined(HAVE_SVG) + os << boost::geometry::svg(g, style_str) << std::endl; +#endif if (!label.empty()) { typename point_type::type c; @@ -101,6 +105,7 @@ private: random_style style; }; + int main() { using namespace boost::geometry::strategy::transform; diff --git a/example/07_a_graph_route_example.cpp b/example/07_a_graph_route_example.cpp index a41575a25..4ea9c5ae8 100644 --- a/example/07_a_graph_route_example.cpp +++ b/example/07_a_graph_route_example.cpp @@ -30,10 +30,12 @@ // Yes, this example currently uses some extensions: // For output: - #include + #if defined(HAVE_SVG) + # include + #endif // For distance-calculations over the Earth: - #include + //#include @@ -260,10 +262,11 @@ inline void build_route(Graph const& graph, int main() { - // Define a point in the Geographic coordinate system + // Define a point in the Geographic coordinate system (currently Spherical) + // (geographic calculations are in an extension; for sample it makes no difference) typedef boost::geometry::model::point < - double, 2, boost::geometry::cs::geographic + double, 2, boost::geometry::cs::spherical > point_type; typedef boost::geometry::model::linestring line_type; @@ -302,8 +305,12 @@ int main() double const km = 1000.0; std::cout << "distances, all in KM" << std::endl << std::fixed << std::setprecision(0); + + // To calculate distance, declare and construct a strategy with average earth radius + boost::geometry::strategy::distance::haversine haversine(6372795.0); // Main functionality: calculate shortest routes from/to all cities + // For the first one, the complete route is stored as a linestring bool first = true; @@ -329,7 +336,7 @@ int main() if (! boost::equals(city1.get<1>(), city2.get<1>())) { double distance = costs[city2.get<2>()] / km; - double acof = boost::geometry::distance(city1.get<0>(), city2.get<0>()) / km; + double acof = boost::geometry::distance(city1.get<0>(), city2.get<0>(), haversine) / km; std::cout << std::setiosflags (std::ios_base::left) << std::setw(15) @@ -351,6 +358,7 @@ int main() } } +#if defined(HAVE_SVG) // Create the SVG std::ofstream stream("routes.svg"); boost::geometry::svg_mapper mapper(stream, 600, 600); @@ -378,6 +386,7 @@ int main() mapper.text(city.get<0>(), city.get<1>(), "fill:rgb(0,0,0);font-family:Arial;font-size:10px", 5, 5); } +#endif return 0; } diff --git a/example/07_b_graph_route_example.cpp b/example/07_b_graph_route_example.cpp index 7ab224433..64f4844c9 100644 --- a/example/07_b_graph_route_example.cpp +++ b/example/07_b_graph_route_example.cpp @@ -34,10 +34,12 @@ // Yes, this example currently uses some extensions: // For output: - #include + #if defined(HAVE_SVG) + # include + #endif // For distance-calculations over the Earth: - #include + //#include @@ -246,10 +248,11 @@ inline void build_route(Graph const& graph, int main() { - // Define a point in the Geographic coordinate system + // Define a point in the Geographic coordinate system (currently Spherical) + // (geographic calculations are in an extension; for sample it makes no difference) typedef boost::geometry::model::point < - double, 2, boost::geometry::cs::geographic + double, 2, boost::geometry::cs::spherical > point_type; typedef boost::geometry::model::linestring line_type; @@ -291,6 +294,9 @@ int main() std::cout << "distances, all in KM" << std::endl << std::fixed << std::setprecision(0); + // To calculate distance, declare and construct a strategy with average earth radius + boost::geometry::strategy::distance::haversine haversine(6372795.0); + // Main functionality: calculate shortest routes from/to all cities // For the first one, the complete route is stored as a linestring @@ -317,7 +323,7 @@ int main() if (! boost::equals(city1.get<1>(), city2.get<1>())) { double distance = costs[city2.get<2>()] / km; - double acof = boost::geometry::distance(city1.get<0>(), city2.get<0>()) / km; + double acof = boost::geometry::distance(city1.get<0>(), city2.get<0>(), haversine) / km; std::cout << std::setiosflags (std::ios_base::left) << std::setw(15) @@ -339,6 +345,7 @@ int main() } } +#if defined(HAVE_SVG) // Create the SVG std::ofstream stream("routes.svg"); boost::geometry::svg_mapper mapper(stream, 600, 600); @@ -366,6 +373,7 @@ int main() mapper.text(city.get<0>(), city.get<1>(), "fill:rgb(0,0,0);font-family:Arial;font-size:10px", 5, 5); } +#endif return 0; } From 9a615d79d3d3f3fedecf683b18f9b32be67a1774 Mon Sep 17 00:00:00 2001 From: Bruno Lalande Date: Wed, 6 Apr 2011 06:56:16 +0000 Subject: [PATCH 03/70] Generalized linestring centroid to nD. [SVN r71027] --- .../cartesian/centroid_weighted_length.hpp | 59 +++++++++++++------ test/algorithms/centroid.cpp | 1 + 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp b/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp index 1538dcabf..21a8e45e3 100644 --- a/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp +++ b/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp @@ -13,10 +13,9 @@ #ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_CENTROID_WEIGHTED_LENGTH_HPP #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_CENTROID_WEIGHTED_LENGTH_HPP -#include - -#include #include +#include +#include #include #include #include @@ -37,16 +36,19 @@ namespace detail template struct weighted_length_sums { + typedef typename geometry::model::point + < + Type, DimensionCount, + cs::cartesian + > work_point; + Type length; - boost::array average_sum; + work_point average_sum; inline weighted_length_sums() : length(Type()) { - for (std::size_t i = 0; i < DimensionCount; i++) - { - average_sum[i] = Type(); - } + geometry::assign_zero(average_sum); } }; } @@ -66,7 +68,11 @@ private : >::type distance_type; public : - typedef detail::weighted_length_sums state_type; + typedef detail::weighted_length_sums + < + distance_type, + geometry::dimension::type::value + > state_type; static inline void apply(PointOfSegment const& p1, PointOfSegment const& p2, state_type& state) @@ -74,13 +80,12 @@ public : distance_type const d = geometry::distance(p1, p2); state.length += d; - distance_type two(2); - - // Might be made generic for N dimensions using specializations - distance_type const mx = (get<0>(p1) + get<0>(p2)) / two; - distance_type const my = (get<1>(p1) + get<1>(p2)) / two; - state.average_sum[0] += d * mx; - state.average_sum[1] += d * my; + typename state_type::work_point weighted_median; + geometry::assign_zero(weighted_median); + geometry::add_point(weighted_median, p1); + geometry::add_point(weighted_median, p2); + geometry::multiply_value(weighted_median, d/2); + geometry::add_point(state.average_sum, weighted_median); } static inline bool result(state_type const& state, Point& centroid) @@ -88,8 +93,9 @@ public : distance_type const zero = distance_type(); if (! geometry::math::equals(state.length, zero)) { - set<0>(centroid, state.average_sum[0] / state.length); - set<1>(centroid, state.average_sum[1] / state.length); + assign_zero(centroid); + add_point(centroid, state.average_sum); + divide_value(centroid, state.length); return true; } @@ -121,6 +127,23 @@ struct default_strategy > type; }; +template +struct default_strategy +< + cartesian_tag, + linear_tag, + 3, + Point, + Geometry +> +{ + typedef weighted_length + < + Point, + typename point_type::type + > type; +}; + } // namespace services diff --git a/test/algorithms/centroid.cpp b/test/algorithms/centroid.cpp index 22ce6bc11..47c335321 100644 --- a/test/algorithms/centroid.cpp +++ b/test/algorithms/centroid.cpp @@ -78,6 +78,7 @@ void test_2d() template void test_3d() { + test_centroid >("LINESTRING(1 2 3,4 5 -6,7 -8 9,-10 11 12,13 -14 -15, 16 17 18)", 5.6748865168734692, 0.31974938587214002, 1.9915270387763671); test_centroid >("POLYGON((1 2 3,5 6 7))", 3, 4, 5); test_centroid

("POINT(1 2 3)", 1, 2, 3); } From 85f1994a421f488d31ef8849182727d50924bc6b Mon Sep 17 00:00:00 2001 From: Bruno Lalande Date: Thu, 7 Apr 2011 21:11:17 +0000 Subject: [PATCH 04/70] Actually enabled centroid linestring calculation for nD. [SVN r71093] --- .../cartesian/centroid_weighted_length.hpp | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp b/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp index 21a8e45e3..0d89c735f 100644 --- a/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp +++ b/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp @@ -109,13 +109,15 @@ public : namespace services { -// Register this strategy for linestrings and polygons, in two or three dimensions -template + +// Register this strategy for linear geometries, in all dimensions + +template struct default_strategy < cartesian_tag, linear_tag, - 2, + N, Point, Geometry > @@ -127,24 +129,6 @@ struct default_strategy > type; }; -template -struct default_strategy -< - cartesian_tag, - linear_tag, - 3, - Point, - Geometry -> -{ - typedef weighted_length - < - Point, - typename point_type::type - > type; -}; - - } // namespace services From 2e024cff2136ab2e7d0775a0cfaaf51420dcafb7 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 8 Apr 2011 14:49:49 +0000 Subject: [PATCH 05/70] Moved convert to detail::convert Removed deprecated file copy.hpp [SVN r71117] --- include/boost/geometry/algorithms/append.hpp | 2 +- .../boost/geometry/algorithms/centroid.hpp | 6 +- .../algorithms/{ => detail}/convert.hpp | 26 ++++-- .../detail/convert_point_to_point.hpp | 4 +- .../detail/overlay/clip_linestring.hpp | 6 +- .../detail/overlay/convert_ring.hpp | 8 +- .../detail/overlay/copy_segment_point.hpp | 4 +- .../overlay/get_intersection_points.hpp | 4 +- .../detail/overlay/get_turn_info.hpp | 18 ++-- .../detail/overlay/intersection_insert.hpp | 6 +- .../boost/geometry/algorithms/envelope.hpp | 1 - .../boost/geometry/algorithms/simplify.hpp | 4 +- include/boost/geometry/core/radian_access.hpp | 2 +- .../geometry/domains/gis/io/wkt/write_wkt.hpp | 4 +- .../buffer/line_line_intersection.hpp | 2 +- .../extensions/algorithms/dissolve.hpp | 4 +- .../gis/io/veshape/write_veshape.hpp | 3 - .../project_inverse_transformer.hpp | 2 +- .../gis/projections/project_transformer.hpp | 2 +- .../extensions/nsphere/geometries/nsphere.hpp | 4 +- .../strategies/buffer_join_round.hpp | 6 +- include/boost/geometry/geometries/box.hpp | 6 +- include/boost/geometry/geometry.hpp | 1 - .../agnostic/simplify_douglas_peucker.hpp | 1 - .../cartesian/distance_projected_point.hpp | 8 +- .../strategies/strategy_transform.hpp | 16 ++-- include/boost/geometry/util/copy.hpp | 87 ------------------- include/boost/geometry/util/write_dsv.hpp | 2 - 28 files changed, 77 insertions(+), 162 deletions(-) rename include/boost/geometry/algorithms/{ => detail}/convert.hpp (91%) delete mode 100644 include/boost/geometry/util/copy.hpp diff --git a/include/boost/geometry/algorithms/append.hpp b/include/boost/geometry/algorithms/append.hpp index 0557d21f5..7e5f6b7b5 100644 --- a/include/boost/geometry/algorithms/append.hpp +++ b/include/boost/geometry/algorithms/append.hpp @@ -51,7 +51,7 @@ struct append_point int = 0, int = 0) { typename geometry::point_type::type copy; - geometry::detail::convert::convert_point_to_point(point, copy); + geometry::detail::conversion::convert_point_to_point(point, copy); traits::push_back::apply(geometry, copy); } }; diff --git a/include/boost/geometry/algorithms/centroid.hpp b/include/boost/geometry/algorithms/centroid.hpp index a400e2e0b..9b51ba07d 100644 --- a/include/boost/geometry/algorithms/centroid.hpp +++ b/include/boost/geometry/algorithms/centroid.hpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include @@ -83,7 +83,7 @@ struct centroid_point static inline void apply(Point const& point, PointCentroid& centroid, Strategy const&) { - geometry::convert(point, centroid); + geometry::detail::convert(point, centroid); } }; @@ -163,7 +163,7 @@ inline bool range_ok(Range const& range, Point& centroid) else // if (n == 1) { // Take over the first point in a "coordinate neutral way" - geometry::convert(*boost::begin(range), centroid); + geometry::detail::convert(*boost::begin(range), centroid); return false; } return true; diff --git a/include/boost/geometry/algorithms/convert.hpp b/include/boost/geometry/algorithms/detail/convert.hpp similarity index 91% rename from include/boost/geometry/algorithms/convert.hpp rename to include/boost/geometry/algorithms/detail/convert.hpp index 607898a3f..9301006a7 100644 --- a/include/boost/geometry/algorithms/convert.hpp +++ b/include/boost/geometry/algorithms/detail/convert.hpp @@ -11,8 +11,8 @@ // 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_CONVERT_HPP -#define BOOST_GEOMETRY_ALGORITHMS_CONVERT_HPP +#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_HPP +#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_HPP #include @@ -33,7 +33,7 @@ namespace boost { namespace geometry { #ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace convert +namespace detail { namespace conversion { template @@ -75,7 +75,7 @@ struct point_to_box }; -}} // namespace detail::convert +}} // namespace detail::conversion #endif // DOXYGEN_NO_DETAIL @@ -117,7 +117,7 @@ template typename Geometry1, typename Geometry2 > struct convert - : detail::convert::point_to_point + : detail::conversion::point_to_point {}; @@ -186,11 +186,11 @@ struct convert { static inline void apply(Point const& point, Box& box) { - detail::convert::point_to_box + detail::conversion::point_to_box < Point, Box, min_corner, 0, DimensionCount >::apply(point, box); - detail::convert::point_to_box + detail::conversion::point_to_box < Point, Box, max_corner, 0, DimensionCount >::apply(point, box); @@ -232,6 +232,11 @@ struct convert } // namespace dispatch #endif // DOXYGEN_NO_DISPATCH + +#ifndef DOXYGEN_NO_DETAIL +namespace detail +{ + /*! \brief Converts one geometry to another geometry \details The convert algorithm converts one geometry, e.g. a BOX, to another geometry, e.g. a RING. This only @@ -241,6 +246,8 @@ if it is possible and applicable. \tparam Geometry2 \tparam_geometry \param geometry1 \param_geometry (source) \param geometry2 \param_geometry (target) +\note It is moved to namespace detail because it overlaps functionality + of assign. So assign will be changed such that it also can convert. */ template inline void convert(Geometry1 const& geometry1, Geometry2& geometry2) @@ -257,8 +264,11 @@ inline void convert(Geometry1 const& geometry1, Geometry2& geometry2) >::apply(geometry1, geometry2); } +} +#endif // DOXYGEN_NO_DETAIL + }} // namespace boost::geometry -#endif // BOOST_GEOMETRY_ALGORITHMS_CONVERT_HPP +#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_CONVERT_HPP diff --git a/include/boost/geometry/algorithms/detail/convert_point_to_point.hpp b/include/boost/geometry/algorithms/detail/convert_point_to_point.hpp index 48981ce09..0c42fd936 100644 --- a/include/boost/geometry/algorithms/detail/convert_point_to_point.hpp +++ b/include/boost/geometry/algorithms/detail/convert_point_to_point.hpp @@ -28,7 +28,7 @@ namespace boost { namespace geometry { #ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace convert +namespace detail { namespace conversion { @@ -60,7 +60,7 @@ inline void convert_point_to_point(Source const& source, Destination& destinatio -}} // namespace detail::convert +}} // namespace detail::conversion #endif // DOXYGEN_NO_DETAIL }} // namespace boost::geometry diff --git a/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp b/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp index 6e8a7f6c3..b5bbab84c 100644 --- a/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include @@ -181,8 +181,8 @@ OutputIterator clip_range_with_box(Box const& b, Range const& range, ++previous, ++vertex) { point_type p1, p2; - geometry::convert(*previous, p1); - geometry::convert(*vertex, p2); + geometry::detail::convert(*previous, p1); + geometry::detail::convert(*vertex, p2); // Clip the segment. Five situations: // 1. Segment is invisible, finish line if any (shouldn't occur) diff --git a/include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp b/include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp index d81826f51..433908061 100644 --- a/include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include namespace boost { namespace geometry @@ -50,7 +50,7 @@ struct convert_ring { if (! append) { - geometry::convert(source, destination); + geometry::detail::convert(source, destination); if (reverse) { boost::reverse(destination); @@ -69,7 +69,7 @@ struct convert_ring { if (! append) { - geometry::convert(source, exterior_ring(destination)); + geometry::detail::convert(source, exterior_ring(destination)); if (reverse) { boost::reverse(exterior_ring(destination)); @@ -79,7 +79,7 @@ struct convert_ring { interior_rings(destination).resize( interior_rings(destination).size() + 1); - geometry::convert(source, interior_rings(destination).back()); + geometry::detail::convert(source, interior_rings(destination).back()); if (reverse) { boost::reverse(interior_rings(destination).back()); diff --git a/include/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp b/include/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp index ead786280..927cefb51 100644 --- a/include/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include @@ -71,7 +71,7 @@ struct copy_segment_point_range rview_type view(cview); - geometry::convert(*(boost::begin(view) + index), point); + geometry::detail::convert(*(boost::begin(view) + index), point); return true; } }; diff --git a/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp b/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp index 4a0fdc952..da7695e91 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp @@ -12,7 +12,7 @@ #include -#include +#include #include @@ -64,7 +64,7 @@ struct get_turn_without_info { TurnInfo tp; - geometry::convert(result.template get<0>().intersections[i], tp.point); + geometry::detail::convert(result.template get<0>().intersections[i], tp.point); *out++ = tp; } diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp index 2e7195310..74abdca0d 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include @@ -94,7 +94,7 @@ struct touch_interior : public base_turn_handler DirInfo const& dir_info) { ti.method = method_touch_interior; - geometry::convert(intersection_info.intersections[0], ti.point); + geometry::detail::convert(intersection_info.intersections[0], ti.point); // Both segments of q touch segment p somewhere in its interior // 1) We know: if q comes from LEFT or RIGHT @@ -213,7 +213,7 @@ struct touch : public base_turn_handler DirInfo const& dir_info) { ti.method = method_touch; - geometry::convert(intersection_info.intersections[0], ti.point); + geometry::detail::convert(intersection_info.intersections[0], ti.point); int const side_qi_p1 = dir_info.sides.template get<1, 0>(); int const side_qk_p1 = SideStrategy::apply(pi, pj, qk); @@ -376,7 +376,7 @@ struct touch : public base_turn_handler << " qk " << get<0>(qk) << " , " << get<1>(qk) << std::endl; #endif - + } }; @@ -404,7 +404,7 @@ struct equal : public base_turn_handler { ti.method = method_equal; // Copy the SECOND intersection point - geometry::convert(intersection_info.intersections[1], ti.point); + geometry::detail::convert(intersection_info.intersections[1], ti.point); int const side_pk_q2 = SideStrategy::apply(qj, qk, pk); int const side_pk_p = SideStrategy::apply(pi, pj, pk); @@ -486,7 +486,7 @@ struct collinear : public base_turn_handler DirInfo const& dir_info) { ti.method = method_collinear; - geometry::convert(intersection_info.intersections[1], ti.point); + geometry::detail::convert(intersection_info.intersections[1], ti.point); int const arrival = dir_info.arrival[0]; // Should not be 0, this is checked before @@ -585,7 +585,7 @@ private : // If P arrives within Q, set info on P (which is done above, index=0), // this turn-info belongs to the second intersection point, index=1 // (see e.g. figure CLO1) - geometry::convert(intersection_info.intersections[1 - Index], tp.point); + geometry::detail::convert(intersection_info.intersections[1 - Index], tp.point); return true; } @@ -661,7 +661,7 @@ struct crosses : public base_turn_handler DirInfo const& dir_info) { ti.method = method_crosses; - geometry::convert(intersection_info.intersections[0], ti.point); + geometry::detail::convert(intersection_info.intersections[0], ti.point); // In all casees: // If Q crosses P from left to right @@ -877,7 +877,7 @@ struct get_turn_info #ifdef BOOST_GEOMETRY_DEBUG_GET_TURNS std::cout << "get_turns, nyi: " << method << std::endl; #endif - break; + break; } return out; diff --git a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp index 75d240bc2..222e84fbc 100644 --- a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -65,7 +65,7 @@ struct intersection_segment_segment_point for (std::size_t i = 0; i < is.count; i++) { PointOut p; - geometry::convert(is.intersections[i], p); + geometry::detail::convert(is.intersections[i], p); *out++ = p; } return out; @@ -95,7 +95,7 @@ struct intersection_linestring_linestring_point it = boost::begin(turns); it != boost::end(turns); ++it) { PointOut p; - geometry::convert(it->point, p); + geometry::detail::convert(it->point, p); *out++ = p; } return out; diff --git a/include/boost/geometry/algorithms/envelope.hpp b/include/boost/geometry/algorithms/envelope.hpp index cae9fa0e1..370812f55 100644 --- a/include/boost/geometry/algorithms/envelope.hpp +++ b/include/boost/geometry/algorithms/envelope.hpp @@ -19,7 +19,6 @@ #include -#include #include #include #include diff --git a/include/boost/geometry/algorithms/simplify.hpp b/include/boost/geometry/algorithms/simplify.hpp index e6a75cc77..21ba86432 100644 --- a/include/boost/geometry/algorithms/simplify.hpp +++ b/include/boost/geometry/algorithms/simplify.hpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include @@ -181,7 +181,7 @@ struct simplify static inline void apply(Point const& point, Point& out, Distance const& max_distance, Strategy const& strategy) { - geometry::convert(point, out); + geometry::detail::convert(point, out); } }; diff --git a/include/boost/geometry/core/radian_access.hpp b/include/boost/geometry/core/radian_access.hpp index 37556e226..9aa833704 100644 --- a/include/boost/geometry/core/radian_access.hpp +++ b/include/boost/geometry/core/radian_access.hpp @@ -78,7 +78,7 @@ struct radian_access } }; -// Specialize, any "degree" coordinate system will convert to radian +// Specialize, any "degree" coordinate system will be converted to radian // but only for dimension 0,1 (so: dimension 2 and heigher are untouched) template diff --git a/include/boost/geometry/domains/gis/io/wkt/write_wkt.hpp b/include/boost/geometry/domains/gis/io/wkt/write_wkt.hpp index 424b2c429..fcf168aa7 100644 --- a/include/boost/geometry/domains/gis/io/wkt/write_wkt.hpp +++ b/include/boost/geometry/domains/gis/io/wkt/write_wkt.hpp @@ -24,7 +24,7 @@ #include -#include +#include #include #include #include @@ -199,7 +199,7 @@ struct wkt_box // Convert to ring, then stream typedef model::ring ring_type; ring_type ring; - geometry::convert(box, ring); + geometry::detail::convert(box, ring); os << "POLYGON("; wkt_sequence::apply(os, ring); os << ")"; diff --git a/include/boost/geometry/extensions/algorithms/buffer/line_line_intersection.hpp b/include/boost/geometry/extensions/algorithms/buffer/line_line_intersection.hpp index 3ebc72547..12022226e 100644 --- a/include/boost/geometry/extensions/algorithms/buffer/line_line_intersection.hpp +++ b/include/boost/geometry/extensions/algorithms/buffer/line_line_intersection.hpp @@ -21,7 +21,7 @@ namespace detail { namespace buffer { -// TODO: once convert this to proper strategy +// TODO: once change this to proper strategy // It is different from current segment intersection because these are not segments but lines // If we have the Line concept, we can create a strategy template diff --git a/include/boost/geometry/extensions/algorithms/dissolve.hpp b/include/boost/geometry/extensions/algorithms/dissolve.hpp index d796b5c38..f5aec42ff 100644 --- a/include/boost/geometry/extensions/algorithms/dissolve.hpp +++ b/include/boost/geometry/extensions/algorithms/dissolve.hpp @@ -33,7 +33,7 @@ #include #include -#include +#include #include @@ -134,7 +134,7 @@ struct dissolve_ring_or_polygon else { GeometryOut g; - geometry::convert(geometry, g); + geometry::detail::convert(geometry, g); *out++ = g; return out; } diff --git a/include/boost/geometry/extensions/gis/io/veshape/write_veshape.hpp b/include/boost/geometry/extensions/gis/io/veshape/write_veshape.hpp index eb5f374dc..90221ecf1 100644 --- a/include/boost/geometry/extensions/gis/io/veshape/write_veshape.hpp +++ b/include/boost/geometry/extensions/gis/io/veshape/write_veshape.hpp @@ -25,9 +25,6 @@ #include -#include - - namespace boost { namespace geometry { diff --git a/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp b/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp index 697fb68c9..e2df255f3 100644 --- a/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp +++ b/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/include/boost/geometry/extensions/gis/projections/project_transformer.hpp b/include/boost/geometry/extensions/gis/projections/project_transformer.hpp index 96f915cad..8f02acd78 100644 --- a/include/boost/geometry/extensions/gis/projections/project_transformer.hpp +++ b/include/boost/geometry/extensions/gis/projections/project_transformer.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/include/boost/geometry/extensions/nsphere/geometries/nsphere.hpp b/include/boost/geometry/extensions/nsphere/geometries/nsphere.hpp index 0966b5ff3..506d1fa71 100644 --- a/include/boost/geometry/extensions/nsphere/geometries/nsphere.hpp +++ b/include/boost/geometry/extensions/nsphere/geometries/nsphere.hpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include @@ -63,7 +63,7 @@ public: nsphere(P const& center, T const& radius) : m_radius(radius) { - geometry::convert(center, m_center); + geometry::detail::convert(center, m_center); } inline P const& center() const { return m_center; } diff --git a/include/boost/geometry/extensions/strategies/buffer_join_round.hpp b/include/boost/geometry/extensions/strategies/buffer_join_round.hpp index fb45d92a4..5b173b101 100644 --- a/include/boost/geometry/extensions/strategies/buffer_join_round.hpp +++ b/include/boost/geometry/extensions/strategies/buffer_join_round.hpp @@ -16,7 +16,7 @@ -#include +#include #include #include #include @@ -51,7 +51,7 @@ struct join_round2 static inline Vector create_vector(Point1 const& p1, Point2 const& p2) { Vector v; - geometry::convert(p1, v); + geometry::detail::convert(p1, v); subtract_point(v, p2); return v; } @@ -111,7 +111,7 @@ struct join_round2 PointOut projected_point; multiply_value(v, b); - geometry::convert(vertex, projected_point); + geometry::detail::convert(vertex, projected_point); add_point(projected_point, v); coordinate_type projected_distance = geometry::distance(projected_point, mid_point); diff --git a/include/boost/geometry/geometries/box.hpp b/include/boost/geometry/geometries/box.hpp index a42e72c91..6537f1298 100644 --- a/include/boost/geometry/geometries/box.hpp +++ b/include/boost/geometry/geometries/box.hpp @@ -18,7 +18,7 @@ #include -#include +#include #include @@ -57,8 +57,8 @@ public: */ inline box(Point const& min_corner, Point const& max_corner) { - geometry::convert(min_corner, m_min_corner); - geometry::convert(max_corner, m_max_corner); + geometry::detail::convert(min_corner, m_min_corner); + geometry::detail::convert(max_corner, m_max_corner); } inline Point const& min_corner() const { return m_min_corner; } diff --git a/include/boost/geometry/geometry.hpp b/include/boost/geometry/geometry.hpp index e0acee965..e8405f7a7 100644 --- a/include/boost/geometry/geometry.hpp +++ b/include/boost/geometry/geometry.hpp @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include diff --git a/include/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp b/include/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp index c8e8f0a0b..b4e95b8a4 100644 --- a/include/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp +++ b/include/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp @@ -20,7 +20,6 @@ #include #include -#include #include diff --git a/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp b/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp index 52eb4bd69..d0293c4b6 100644 --- a/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -132,8 +132,8 @@ public : // For consistency we define w also in FP fp_vector_type v, w; - geometry::convert(p2, v); - geometry::convert(p, w); + geometry::detail::convert(p2, v); + geometry::detail::convert(p, w); subtract_point(v, p1); subtract_point(w, p1); @@ -163,7 +163,7 @@ public : >::apply(strategy); fp_point_type projected; - geometry::convert(p1, projected); + geometry::detail::convert(p1, projected); multiply_value(v, b); add_point(projected, v); diff --git a/include/boost/geometry/strategies/strategy_transform.hpp b/include/boost/geometry/strategies/strategy_transform.hpp index cb9a14404..3961ee276 100644 --- a/include/boost/geometry/strategies/strategy_transform.hpp +++ b/include/boost/geometry/strategies/strategy_transform.hpp @@ -20,7 +20,7 @@ #include -#include +#include #include #include #include @@ -104,7 +104,7 @@ struct copy_per_coordinate // Defensive check, dimensions are equal, selected by specialization assert_dimension_equal(); - geometry::convert(p1, p2); + geometry::detail::convert(p1, p2); return true; } }; @@ -312,14 +312,14 @@ struct default_strategy type; }; -/// Specialization to convert from degree to radian for any coordinate system / point type combination +/// Specialization to transform from degree to radian for any coordinate system / point type combination template class CoordSys, typename P1, typename P2> struct default_strategy, CoordSys, 2, 2, P1, P2> { typedef degree_radian_vv type; }; -/// Specialization to convert from radian to degree for any coordinate system / point type combination +/// Specialization to transform from radian to degree for any coordinate system / point type combination template class CoordSys, typename P1, typename P2> struct default_strategy, CoordSys, 2, 2, P1, P2> { @@ -341,28 +341,28 @@ struct default_strategy, CoordSys type; }; -/// Specialization to convert from unit sphere(phi,theta) to XYZ +/// Specialization to transform from unit sphere(phi,theta) to XYZ template struct default_strategy { typedef from_spherical_2_to_cartesian_3 type; }; -/// Specialization to convert from sphere(phi,theta,r) to XYZ +/// Specialization to transform from sphere(phi,theta,r) to XYZ template struct default_strategy { typedef from_spherical_3_to_cartesian_3 type; }; -/// Specialization to convert from XYZ to unit sphere(phi,theta) +/// Specialization to transform from XYZ to unit sphere(phi,theta) template struct default_strategy { typedef from_cartesian_3_to_spherical_2 type; }; -/// Specialization to convert from XYZ to sphere(phi,theta,r) +/// Specialization to transform from XYZ to sphere(phi,theta,r) template struct default_strategy { diff --git a/include/boost/geometry/util/copy.hpp b/include/boost/geometry/util/copy.hpp deleted file mode 100644 index 10497df9e..000000000 --- a/include/boost/geometry/util/copy.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) - -// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2011 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2011 Mateusz Loskot, London, UK. - -// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library -// (geolib/GGL), copyright (c) 1995-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_UTIL_COPY_HPP -#define BOOST_GEOMETRY_UTIL_COPY_HPP - -#if defined(BOOST_MSVC_FULL_VER) -#pragma message ("copy_coordinates is deprecated. Use 'convert'") -#else -#warning "copy_coordinates is deprecated. Use 'convert'" -#endif - - - -#include - -#include -#include - -#include - -#include - - -namespace boost { namespace geometry -{ - -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace copy -{ - -template -struct copy_coordinates -{ - static inline void copy(Src const& source, Dst& dest) - { - typedef typename coordinate_type::type coordinate_type; - - set(dest, boost::numeric_cast(get(source))); - copy_coordinates::copy(source, dest); - } -}; - -template -struct copy_coordinates -{ - static inline void copy(Src const& , Dst& ) - { - } -}; - -}} // namespace detail::copy -#endif // DOXYGEN_NO_DETAIL - - -// Deprecated! -// This is the same as "convert", but this is specific to point, convert is more generic -template -inline void copy_coordinates(Src const& source, Dst& dest) -{ - BOOST_CONCEPT_ASSERT( (concept::ConstPoint) ); - BOOST_CONCEPT_ASSERT( (concept::Point) ); - - - //assert_dimension_equal(); - detail::copy::copy_coordinates - < - Src, - Dst, - 0, - dimension::type::value - >::copy(source, dest); -} - -}} // namespace boost::geometry - -#endif // BOOST_GEOMETRY_UTIL_COPY_HPP diff --git a/include/boost/geometry/util/write_dsv.hpp b/include/boost/geometry/util/write_dsv.hpp index 27df5d69c..3fef63e77 100644 --- a/include/boost/geometry/util/write_dsv.hpp +++ b/include/boost/geometry/util/write_dsv.hpp @@ -23,8 +23,6 @@ #include #include -#include - #include #include #include From 030f9e1d2e89a38cb281e0720ce85fceccec52f3 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 8 Apr 2011 14:55:06 +0000 Subject: [PATCH 06/70] Moved convert to detail::convert [SVN r71118] --- test/algorithms/Jamfile.v2 | 1 - test/algorithms/algorithms_tests.sln | 6 ------ test/algorithms/centroid.cpp | 1 + test/algorithms/detail/Jamfile.v2 | 1 + test/algorithms/{ => detail}/convert.cpp | 10 +++++----- test/algorithms/{ => detail}/convert.vcproj | 8 ++++---- test/algorithms/detail/detail.sln | 6 ++++++ 7 files changed, 17 insertions(+), 16 deletions(-) rename test/algorithms/{ => detail}/convert.cpp (93%) rename test/algorithms/{ => detail}/convert.vcproj (92%) diff --git a/test/algorithms/Jamfile.v2 b/test/algorithms/Jamfile.v2 index 4c3a0f705..daf06b6d4 100644 --- a/test/algorithms/Jamfile.v2 +++ b/test/algorithms/Jamfile.v2 @@ -16,7 +16,6 @@ test-suite boost-geometry-algorithms [ run buffer.cpp ] [ run centroid.cpp ] [ run comparable_distance.cpp ] - [ run convert.cpp ] [ run convex_hull.cpp ] [ run correct.cpp ] [ run difference.cpp ] diff --git a/test/algorithms/algorithms_tests.sln b/test/algorithms/algorithms_tests.sln index c4105b533..f929e0ba5 100644 --- a/test/algorithms/algorithms_tests.sln +++ b/test/algorithms/algorithms_tests.sln @@ -8,8 +8,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "assign", "assign.vcproj", " EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "expand", "expand.vcproj", "{5330DAB1-DF27-44FC-971B-3C5094F82FA3}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "convert", "convert.vcproj", "{FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "convex_hull", "convex_hull.vcproj", "{0AFF7A85-63A7-4178-92A5-CC692B09F5B9}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "distance", "distance.vcproj", "{347D08A4-22E9-45B1-A55B-AE84AA2EAA53}" @@ -78,10 +76,6 @@ Global {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Debug|Win32.Build.0 = Debug|Win32 {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Release|Win32.ActiveCfg = Release|Win32 {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Release|Win32.Build.0 = Release|Win32 - {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Debug|Win32.ActiveCfg = Debug|Win32 - {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Debug|Win32.Build.0 = Debug|Win32 - {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Release|Win32.ActiveCfg = Release|Win32 - {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Release|Win32.Build.0 = Release|Win32 {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Debug|Win32.ActiveCfg = Debug|Win32 {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Debug|Win32.Build.0 = Debug|Win32 {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/test/algorithms/centroid.cpp b/test/algorithms/centroid.cpp index 47c335321..e2b5d5205 100644 --- a/test/algorithms/centroid.cpp +++ b/test/algorithms/centroid.cpp @@ -94,6 +94,7 @@ int test_main(int, char* []) #if defined(HAVE_TTMATH) test_2d >(); + test_3d >(); #endif return 0; diff --git a/test/algorithms/detail/Jamfile.v2 b/test/algorithms/detail/Jamfile.v2 index e34d4986c..70eadd997 100644 --- a/test/algorithms/detail/Jamfile.v2 +++ b/test/algorithms/detail/Jamfile.v2 @@ -10,6 +10,7 @@ test-suite boost-geometry-algorithms-detail : + [ run convert.cpp ] [ run partition.cpp ] ; diff --git a/test/algorithms/convert.cpp b/test/algorithms/detail/convert.cpp similarity index 93% rename from test/algorithms/convert.cpp rename to test/algorithms/detail/convert.cpp index 5a3669e0a..2c6d227d3 100644 --- a/test/algorithms/convert.cpp +++ b/test/algorithms/detail/convert.cpp @@ -16,7 +16,7 @@ #include -#include +#include #include #include @@ -35,7 +35,7 @@ void test_all() bg::assign(p, 1, 2); box_type b; - bg::convert(p, b); + bg::detail::convert(p, b); BOOST_CHECK_CLOSE((bg::get<0, 0>(b)), 1.0, 0.001); BOOST_CHECK_CLOSE((bg::get<0, 1>(b)), 2.0, 0.001); @@ -59,7 +59,7 @@ void test_std() bg::set(b, 4); ring_type ring; - bg::convert(b, ring); + bg::detail::convert(b, ring); //std::cout << bg::wkt(b) << std::endl; //std::cout << bg::wkt(ring) << std::endl; @@ -85,10 +85,10 @@ void test_std() polygon_type polygon; - bg::convert(ring, polygon); + bg::detail::convert(ring, polygon); BOOST_CHECK_EQUAL(bg::num_points(polygon), 5u); - bg::convert(polygon, ring); + bg::detail::convert(polygon, ring); BOOST_CHECK_EQUAL(bg::num_points(ring), 5u); } diff --git a/test/algorithms/convert.vcproj b/test/algorithms/detail/convert.vcproj similarity index 92% rename from test/algorithms/convert.vcproj rename to test/algorithms/detail/convert.vcproj index c75bf0ee5..b3a11404f 100644 --- a/test/algorithms/convert.vcproj +++ b/test/algorithms/detail/convert.vcproj @@ -20,7 +20,7 @@ OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)\convert" ConfigurationType="1" - InheritedPropertySheets="..\boost.vsprops;..\ttmath.vsprops" + InheritedPropertySheets="..\..\boost.vsprops;..\..\ttmath.vsprops" CharacterSet="1" > @@ -114,7 +114,7 @@ /> Date: Fri, 8 Apr 2011 20:17:49 +0000 Subject: [PATCH 07/70] Doc update, added samples of clear, expand, reverse, unique Removed convert from doc [SVN r71123] --- doc/geometry.qbk | 4 +- doc/imports.qbk | 4 ++ doc/other/status.xls | Bin 18944 -> 19968 bytes doc/quickref.xml | 4 -- doc/reference.qbk | 4 -- doc/reference/algorithms/clear.qbk | 35 ++++++++++ doc/reference/algorithms/expand.qbk | 32 +++++++++ doc/reference/algorithms/reverse.qbk | 38 +++++++++++ doc/reference/algorithms/unique.qbk | 37 ++++++++++ doc/src/examples/algorithms/clear.cpp | 4 +- doc/src/examples/algorithms/expand.cpp | 46 +++++++++++++ .../algorithms/num_interior_rings.cpp | 2 +- doc/src/examples/algorithms/reverse.cpp | 64 ++++++++++++++++++ doc/src/examples/algorithms/unique.cpp | 38 +++++++++++ 14 files changed, 300 insertions(+), 12 deletions(-) create mode 100644 doc/reference/algorithms/clear.qbk create mode 100644 doc/reference/algorithms/expand.qbk create mode 100644 doc/reference/algorithms/reverse.qbk create mode 100644 doc/reference/algorithms/unique.qbk create mode 100644 doc/src/examples/algorithms/expand.cpp create mode 100644 doc/src/examples/algorithms/reverse.cpp create mode 100644 doc/src/examples/algorithms/unique.cpp diff --git a/doc/geometry.qbk b/doc/geometry.qbk index 52ef199eb..3519723ef 100644 --- a/doc/geometry.qbk +++ b/doc/geometry.qbk @@ -42,7 +42,8 @@ [def __linestring__ Linestring] [def __polygon__ Polygon] [def __ring__ Ring] -[def __multi_point__ Multi point] +[def __multi_point__ Multi Point] +[def __multi_linestring__ Multi Linestring] [def __multi_polygon__ Multi Polygon] [def __range__ Rangelike (linestring, ring)] [def __other__ Other geometries] @@ -51,6 +52,7 @@ [/Parts] [def __ret_zero__ Returns zero] [def __ret_one__ Returns 1] +[def __does_nothing__ Nothing happens, geometry is unchanged] [def __cs_units__ in the same units as the input coordinates] [def __sph1__ on a unit sphere (or another sphere, if specified as such in the constructor of the strategy)] [template qbk_ret[what] Returns [what]] diff --git a/doc/imports.qbk b/doc/imports.qbk index 708d276c4..788bc68d3 100644 --- a/doc/imports.qbk +++ b/doc/imports.qbk @@ -21,10 +21,12 @@ [import src/examples/algorithms/assign_with_range.cpp] [import src/examples/algorithms/assign_point_to_index.cpp] [import src/examples/algorithms/assign_point_from_index.cpp] +[import src/examples/algorithms/clear.cpp] [import src/examples/algorithms/centroid.cpp] [import src/examples/algorithms/distance.cpp] [import src/examples/algorithms/difference.cpp] [import src/examples/algorithms/envelope.cpp] +[import src/examples/algorithms/expand.cpp] [import src/examples/algorithms/for_each_point.cpp] [import src/examples/algorithms/for_each_point_const.cpp] [import src/examples/algorithms/for_each_segment_const.cpp] @@ -41,10 +43,12 @@ [import src/examples/algorithms/num_geometries.cpp] [import src/examples/algorithms/num_interior_rings.cpp] [import src/examples/algorithms/num_points.cpp] +[import src/examples/algorithms/reverse.cpp] [import src/examples/algorithms/return_envelope.cpp] [import src/examples/algorithms/simplify.cpp] [import src/examples/algorithms/sym_difference.cpp] [import src/examples/algorithms/union.cpp] +[import src/examples/algorithms/unique.cpp] [import src/examples/algorithms/within.cpp] [import src/examples/core/get_point.cpp] [import src/examples/core/get_box.cpp] diff --git a/doc/other/status.xls b/doc/other/status.xls index 2fe9fc18baba2d64088ca375b48a21421277bbf9..691984843ba039b24a5f6d83c962f8e66b39d0b0 100644 GIT binary patch delta 4124 zcmZpe!q_l}ae@J(>O@0n78M2thK+&i88`oDe8|qIIr$-{ttcZ00|OHS0|P4q0|O%z zvrabVGH35*TF=11U@*Cm%VP6hE?1^{HU@^&ih{(vl>ZD`EF26a91ILR3=9khIT#os z88nW|b22b&XJBAx=44=yX5{^FgOh=wfRT~GhKqsW3ge8E5)2#+3=9#+B^W>e#?Lq| z0k&82aGimGQ;0#uafmvQTR>`97#J8pSeRvU1+Q2=$0-R0A&`Cs2C#7;Cdj~&6A}#j zJgp4ga6e~02BksTH*j5M1R3>V{agbO`vcQuuv0+n$^112AT=4x5HXM(GsrG328K5* z5PisUfnqfh1|SQWKS06?q#2}%fq`MNDxYow$Rdzf&It(yTn2&ENW1|#nStR1=X2(k zXTb&!PDn76fDC2;#l>+028N>sKe!-{0)^R;6A<;2H}Or7-*HlcVZB6escf106cGCd zw+mD&1B1&+iOGrl_91EvAq*-EsR9fJAo{G78aRqKb_*DQ*dQ^GGp0zXfpu~)s4)Ct z1SJkIm*F;49K<{O!?oP#Qh%8M)8sGw3cUSgL8aF*KZ# zVCZ1H%s4quK#cD)BPbA;z=S3V*fCvZoP0?@$>uU6DAGC?a2mX3U|@)1U|>i%Edh2L z6I&lk&1;A^&5lbj{Qv*|KZ8IY$RGw#n6oiVwh&a|1v%JXgn_|Dfq`M&=1jp^tc+@t zS;W)XBp4VNnHVM)iYM7wF>o*mFmN$2FmN*bXJBBs%m_+gATe$fF$u6bPzr{q0~v9d zak8LF*Udt zDB&Zlo&?q_30K!&#=zL?I$2awiSgEC3(3rSc?JfCzhHl{Fi10~!g;I=vJA>_9vg!+ z11OXrD%lxi8Pwr&91PM7nou4n0f;fkL3vCJj12tXhydwhVqjt5XHbC4u`-A=DDc6# zYz$%y3X}Dur0Zcym>IxIpemRd*pRd{Gq8iS!{sau94Iz$FtF7l`JNN3lntts6GbT}ieorY9K(s?7%s3W>`+sJK&A-5t>=NbZE~CpA|3I9l)zQ+LR3Jt^P+?SFN)*&z!rhBH^}jPD30etF_RC) zOg@O2u%yigF?8}BBq#Bs_?91{0qP`vh{`Bs3O!*VH87!Q4AFU>l1*g6anjlWm^#xeIhV@_28mT1nL@yV? zilL$?hKizunkd*zSP~Uw0GA9$;E(S@kF)%+#!eRy-F;d{b7XvHhVvs^nDTSsIR1m{VkwWo= zG}shzs43D6NI9mSK^nzSX_PpWM)8F-ilH)KLqRPGP!!6bgp3S|nKCG5%AlB8FN0#J zEZ9&xu|7L3v3L#qWwJhAM)~09X=L0UN3VHB<$xPZ!El z1@rV67#OZI@GvMbGBDVHgF=Sk4Z{gg1L}hZ69a<)1IGtYMG9&lu&^*Nu<!%)G%&%pAbf`Nfy z5f2yGB&NwCD*n8z3qh z9|lm-2l5;P12#v%dNh+6xIdUNFfcSQ*ziwQSFr)ROCIVj6|lRQ83Y|{_@6U_dRd@e z1jt>YW!xS==B;(=dF@kmd4p{W)!YRNVo|C94rdT z(4c+*swgN|FfcGrmQhvXhnU95AOJF#g=_OfVQ0ooYAy;qpx!U2GWqxa|NqGWZX!IO y5(Jd}!2$(tBCMdsr}E}Tw{pfw9zU24s7?OmQN<`Sxzw|s2bBL9Kov0q0|Nj~GDttb-<0|OHS1T!))Fn}=A zWMeLK_GwJ385kH0Cl_*Ah_Ev-BZFWBMT= zWMIt1z~BOM03QRx35IHxH;mOR415d_@G{syfMEh7KNACk00RR93ls~pK-?+B_Pn0i z>ZAljF#`j``IIYV0_P;ao)9@D!EoWY1jEwOOJyJxJB~{*yv~QP8%{_tfaF0M?;Mw4 z_^^Ji0myJx1_lO@+=t^545?z*%3d6oV5spBX1dPAz@WgyzyNYA$Z;;rFup1S14w}5 zv;@PIlM)Q2`q#=p2ERE4vXX(JMgLlv&uNLtQhd4zZ4X44|A53985lvKtaDm|!OKd5 z8RRoRD+y*UD+y+hc!ZS%bK56jrW2gcnOmL(8$386!B7HnDL9sn8!#{&HSjqt!60&4 zf`Q}jYbKEXtpBf>CNJlkFxf>&adHH|t)>=32!jekssMulh(0T&1&-v6-2w(6Hb@L) z)f6eM$@}=lMYN#CGccU}VN`B(skJPHaq>%k1>V-OIEx&y4W}d+c4Q?@789^H5@g~4 z1=1-Ah7LwSCdtEf1_DkY1`|$6Fo48ChJwUFfw=^#W^%iL9g`r_F!!kn>na;t>4 zV5=KQj~HA&Y4Sk{VLdHyvIWV2k|@McAj>+yswLs7Tgw<2gWM)FNh&cuo2)9CS+B^z z!0;FB6BY((29Vz&JXQu-22cuw@Yoon88qN3*%@RRG~qlB25AOuC=V1#VhjpU9uos2 z13x$lK&CJ;urTm5fC>r-kCj23K?#%{AzU^FF$Sf{(o)ivFeS_kU?ot)m>JlRv@-IZ#~4fno+HSfvV7B`1nXPKXO9pOu!bhxwKZ zA_i5@4b~0HH6T}Wqv+;Fv4Q& z#2Bb4LSR!s73|tHnC=QiC7z&m{Hd6w{Oi;Zj1}#wQxfno& zJU@dN)KEzjLnToRl|*rr<$C{B|{ahf~>2edZ4 z&fvmui%Xq>A%`iBfset0A%ww#!HvO)~FBV zseyS03=9m{8Tc6T7#SD>Kq1KB#vsG+hT#OLW%J<#1E~AJ@c~rTf_fT^EDQ|%49p)k zFid`+95UHW)sB~gp_f69A(MfVL4jF$@ clear - Convert - - convert - Convex Hull convex_hull diff --git a/doc/reference.qbk b/doc/reference.qbk index d5a045365..40d5ca87d 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -69,10 +69,6 @@ [include generated/clear.qbk] [endsect] -[section:convert convert] -[include generated/convert.qbk] -[endsect] - [section:convex_hull convex_hull] [include generated/convex_hull.qbk] [endsect] diff --git a/doc/reference/algorithms/clear.qbk b/doc/reference/algorithms/clear.qbk new file mode 100644 index 000000000..7753e6a63 --- /dev/null +++ b/doc/reference/algorithms/clear.qbk @@ -0,0 +1,35 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[def __is_cleared__ is cleared] + +[heading Behavior] +[table +[[Case] [Behavior] ] +[[__point__][__does_nothing__]] +[[__segment__][__does_nothing__]] +[[__box__][__does_nothing__]] +[[__linestring__][__linestring__ __is_cleared__]] +[[__ring__][__ring__ is cleared]] +[[__polygon__][The exterior ring __is_cleared__ and all interior rings are removed]] +[[__multi_point__][__multi_point__ __is_cleared__]] +[[__multi_linestring__][__multi_linestring__ __is_cleared__]] +[[__multi_polygon__][__multi_polygon__ __is_cleared__]] +] + +[heading Complexity] +Constant + +[heading Examples] +[clear] +[clear_output] + diff --git a/doc/reference/algorithms/expand.qbk b/doc/reference/algorithms/expand.qbk new file mode 100644 index 000000000..9780e75a9 --- /dev/null +++ b/doc/reference/algorithms/expand.qbk @@ -0,0 +1,32 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[def __apply_expand__ Box is expanded to include the specified] + +[heading Behavior] +[table +[[Case] [Behavior] ] +[[__box__ / __point__][__apply_expand__ __point__]] +[[__box__ / __box__][__apply_expand__ __box__]] +[[__box__ / __other__][__nyiversion__]] +] + +[tip Expand is not defined within OGC or ISO] +[note To use expand with another geometry type then specified, use expand(make_envelope(geometry)] + +[heading Complexity] +Linear + +[heading Examples] +[expand] +[expand_output] + diff --git a/doc/reference/algorithms/reverse.qbk b/doc/reference/algorithms/reverse.qbk new file mode 100644 index 000000000..fcbc386cc --- /dev/null +++ b/doc/reference/algorithms/reverse.qbk @@ -0,0 +1,38 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + + +[heading Behavior] +[table +[[Case] [Behavior] ] +[[__point__][__does_nothing__]] +[[__segment__][__nyiversion__]] +[[__box__][__does_nothing__]] +[[__linestring__][Reverses the __linestring__]] +[[__ring__][Reverses the __ring__]] +[[__polygon__][Reverses the exterior ring and all interior rings in the polygon]] +[[__multi_point__][__does_nothing__]] +[[__multi_linestring__][Reverses all contained linestrings individually]] +[[__multi_polygon__][Reverses all contained polygons individually]] +] + +[note The reverse of a (multi)polygon or ring might make a valid geometry invalid because the (counter)clockwise orientation reverses.] + +[tip Conforms to std::reverse functionality. It is not defined within OGC or ISO] + +[heading Complexity] +Linear + +[heading Examples] +[reverse] +[reverse_output] + diff --git a/doc/reference/algorithms/unique.qbk b/doc/reference/algorithms/unique.qbk new file mode 100644 index 000000000..9e3a775d6 --- /dev/null +++ b/doc/reference/algorithms/unique.qbk @@ -0,0 +1,37 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[def __applies_unique__ Removes all consecutive duplicate points] + +[heading Behavior] +[table +[[Case] [Behavior] ] +[[__point__][__does_nothing__]] +[[__segment__][__does_nothing__]] +[[__box__][__does_nothing__]] +[[__linestring__][__applies_unique__]] +[[__ring__][__applies_unique__]] +[[__polygon__][__applies_unique__ in all rings]] +[[__multi_point__][__does_nothing__. Even if two equal points happen to be stored consecutively, they are kept]] +[[__multi_linestring__][__applies_unique__ in all contained linestrings]] +[[__multi_polygon__][__applies_unique__ in all contained polygons (all rings)]] +] + +[tip Conforms to std::unique functionality. It is not defined within OGC or ISO] + +[heading Complexity] +Linear + +[heading Examples] +[unique] +[unique_output] + diff --git a/doc/src/examples/algorithms/clear.cpp b/doc/src/examples/algorithms/clear.cpp index 1bca324f4..f9932ed26 100644 --- a/doc/src/examples/algorithms/clear.cpp +++ b/doc/src/examples/algorithms/clear.cpp @@ -29,8 +29,8 @@ int main() 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)); + poly.outer() = tuple_list_of(0, 0)(0, 9)(10, 10)(0, 0); + poly.inners().push_back(tuple_list_of(1, 2)(4, 6)(2, 8)(1, 2)); std::cout << boost::geometry::dsv(poly) << std::endl; boost::geometry::clear(poly); diff --git a/doc/src/examples/algorithms/expand.cpp b/doc/src/examples/algorithms/expand.cpp new file mode 100644 index 000000000..449b48fd9 --- /dev/null +++ b/doc/src/examples/algorithms/expand.cpp @@ -0,0 +1,46 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[expand +//` Shows the usage of expand + +#include +#include + +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::box box_type; + + using boost::geometry::expand; + + box_type box = boost::geometry::make_inverse(); /*< expand is usually preceded by a call to assign_inverse or make_inverse >*/ + + expand(box, point_type(0, 0)); + expand(box, point_type(1, 2)); + expand(box, point_type(5, 4)); + expand(box, boost::geometry::make(3, 3, 5, 5)); + + std::cout << boost::geometry::dsv(box) << std::endl; + + return 0; +} + +//] + +//[expand_output +/*` +Output: +[pre +((0, 0), (5, 5)) +] +*/ +//] diff --git a/doc/src/examples/algorithms/num_interior_rings.cpp b/doc/src/examples/algorithms/num_interior_rings.cpp index ca09fb57a..b4aa82940 100644 --- a/doc/src/examples/algorithms/num_interior_rings.cpp +++ b/doc/src/examples/algorithms/num_interior_rings.cpp @@ -8,7 +8,7 @@ // http://www.boost.org/LICENSE_1_0.txt) //[num_interior_rings -//` Get the number of interior rings in a polygon or multi-polygon +//` Get the number of interior rings in a multi-polygon #include diff --git a/doc/src/examples/algorithms/reverse.cpp b/doc/src/examples/algorithms/reverse.cpp new file mode 100644 index 000000000..33fc690fc --- /dev/null +++ b/doc/src/examples/algorithms/reverse.cpp @@ -0,0 +1,64 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[reverse +//` Shows how to reverse 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; + boost::geometry::exterior_ring(poly) = tuple_list_of(0, 0)(0, 9)(10, 10)(0, 0); + boost::geometry::interior_rings(poly).push_back(tuple_list_of(1, 2)(4, 6)(2, 8)(1, 2)); + + double area_before = boost::geometry::area(poly); + boost::geometry::reverse(poly); + double area_after = boost::geometry::area(poly); + std::cout << boost::geometry::dsv(poly) << std::endl; + std::cout << area_before << " -> " << area_after << std::endl; + + ring r = tuple_list_of(0, 0)(0, 9)(8, 8)(0, 0); + + area_before = boost::geometry::area(r); + boost::geometry::reverse(r); + area_after = boost::geometry::area(r); + std::cout << boost::geometry::dsv(r) << std::endl; + std::cout << area_before << " -> " << area_after << std::endl; + + return 0; +} + +//] + + +//[reverse_output +/*` +Output: +[pre +(((0, 0), (10, 10), (0, 9), (0, 0)), ((1, 2), (2, 8), (4, 6), (1, 2))) +38 -> -38 +((0, 0), (8, 8), (0, 9), (0, 0)) +36 -> -36 +] +*/ +//] diff --git a/doc/src/examples/algorithms/unique.cpp b/doc/src/examples/algorithms/unique.cpp new file mode 100644 index 000000000..294e1cd98 --- /dev/null +++ b/doc/src/examples/algorithms/unique.cpp @@ -0,0 +1,38 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[unique +//` Shows how to make a so-called minimal set of a polygon by removing duplicate points + +#include + +#include +#include + +int main() +{ + boost::geometry::model::polygon > poly; + boost::geometry::read_wkt("POLYGON((0 0,0 0,0 5,5 5,5 5,5 5,5 0,5 0,0 0,0 0,0 0,0 0))", poly); + boost::geometry::unique(poly); + std::cout << boost::geometry::wkt(poly) << std::endl; + + return 0; +} + +//] + + +//[unique_output +/*` +Output: +[pre +POLYGON((0 0,0 5,5 5,5 0,0 0)) +] +*/ +//] From 595bae61d9db994090b11b7f52c7c92ec7e9ff73 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 8 Apr 2011 20:19:01 +0000 Subject: [PATCH 08/70] Doc update, added behaviour/samples of clear, expand, reverse, unique [SVN r71124] --- include/boost/geometry/algorithms/clear.hpp | 4 ++++ include/boost/geometry/algorithms/expand.hpp | 8 +++++--- include/boost/geometry/algorithms/reverse.hpp | 7 ++++++- include/boost/geometry/algorithms/unique.hpp | 2 ++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/include/boost/geometry/algorithms/clear.hpp b/include/boost/geometry/algorithms/clear.hpp index 5635710d7..d4cf7fd77 100644 --- a/include/boost/geometry/algorithms/clear.hpp +++ b/include/boost/geometry/algorithms/clear.hpp @@ -134,7 +134,11 @@ struct clear the case of a polygon, this clear functionality is automatically called for the exterior ring, and for the interior ring collection. In the case of a point, boxes and segments, nothing will happen. \ingroup clear +\tparam Geometry \tparam_geometry +\param geometry \param_geometry which will be cleared \note points and boxes cannot be cleared, instead they can be set to zero by "assign_zero" + +\qbk{[include reference/algorithms/clear.qbk]} */ template inline void clear(Geometry& geometry) diff --git a/include/boost/geometry/algorithms/expand.hpp b/include/boost/geometry/algorithms/expand.hpp index 81217b23c..7d4496b96 100644 --- a/include/boost/geometry/algorithms/expand.hpp +++ b/include/boost/geometry/algorithms/expand.hpp @@ -291,12 +291,14 @@ inline void expand(Box& box, Geometry const& geometry, /*! -\brief Expands a box using the extend (envelope) of another geometry (box, point) +\brief Expands a box using the bounding box (envelope) of another geometry (box, point) \ingroup expand \tparam Box type of the box \tparam Geometry \tparam_geometry -\param box box to expand another geometry with, might be changed -\param geometry \param_geometry +\param box box to be expanded using another geometry, mutable +\param geometry \param_geometry geometry which envelope (bounding box) will be added to the box + +\qbk{[include reference/algorithms/expand.qbk]} */ template inline void expand(Box& box, Geometry const& geometry) diff --git a/include/boost/geometry/algorithms/reverse.hpp b/include/boost/geometry/algorithms/reverse.hpp index b8cf28d8a..3d208120b 100644 --- a/include/boost/geometry/algorithms/reverse.hpp +++ b/include/boost/geometry/algorithms/reverse.hpp @@ -106,10 +106,15 @@ struct reverse /*! -\brief Reverses a geometry +\brief Reverses the points within a geometry +\details Generic function to reverse a geometry. It resembles the std::reverse + functionality, but it takes the geometry type into account. Only for a ring + or for a linestring it is the same as the std::reverse. \ingroup reverse \tparam Geometry \tparam_geometry \param geometry \param_geometry which will be reversed + +\qbk{[include reference/algorithms/reverse.qbk]} */ template inline void reverse(Geometry& geometry) diff --git a/include/boost/geometry/algorithms/unique.hpp b/include/boost/geometry/algorithms/unique.hpp index 1f15f39d1..63c7357cb 100644 --- a/include/boost/geometry/algorithms/unique.hpp +++ b/include/boost/geometry/algorithms/unique.hpp @@ -124,6 +124,8 @@ struct unique \details \details_calc{unique,minimal set (where duplicate consecutive points are removed)}. \tparam Geometry \tparam_geometry \param geometry \param_geometry which will be made unique + +\qbk{[include reference/algorithms/unique.qbk]} */ template inline void unique(Geometry& geometry) From edc40b6580a49611c89f97a42b7bfa6441c816f0 Mon Sep 17 00:00:00 2001 From: Bruno Lalande Date: Fri, 8 Apr 2011 21:13:10 +0000 Subject: [PATCH 09/70] Added assign_value and assign_point to arithmetic functions. [SVN r71126] --- .../boost/geometry/arithmetic/arithmetic.hpp | 82 +++++++++++++++++-- test/arithmetic/arithmetic.cpp | 18 ++++ 2 files changed, 94 insertions(+), 6 deletions(-) diff --git a/include/boost/geometry/arithmetic/arithmetic.hpp b/include/boost/geometry/arithmetic/arithmetic.hpp index 7afee3ff6..a18e3f9ff 100644 --- a/include/boost/geometry/arithmetic/arithmetic.hpp +++ b/include/boost/geometry/arithmetic/arithmetic.hpp @@ -31,6 +31,7 @@ namespace boost { namespace geometry namespace detail { + template struct param { @@ -40,6 +41,7 @@ struct param >::param_type type; }; + template class Function> struct value_operation { @@ -74,11 +76,45 @@ struct point_operation } }; + +template +struct value_assignment +{ + C m_value; + + inline value_assignment(C const &value) + : m_value(value) + {} + + template + inline void apply(P& point) const + { + set(point, m_value); + } +}; + +template +struct point_assignment +{ + PointSrc const& m_source_point; + + inline point_assignment(PointSrc const& point) + : m_source_point(point) + {} + + template + inline void apply(PointDst& dest_point) const + { + set(dest_point, get(m_source_point)); + } +}; + + } // namespace detail #endif // DOXYGEN_NO_DETAIL /*! - \brief Adds a value to each coordinate of a point + \brief Adds the same value to each coordinate of a point \ingroup arithmetic \details \param p point @@ -110,7 +146,7 @@ inline void add_point(Point1& p1, Point2 const& p2) } /*! - \brief Subtracts a value to each coordinate of a point + \brief Subtracts the same value to each coordinate of a point \ingroup arithmetic \details \param p point @@ -142,7 +178,7 @@ inline void subtract_point(Point1& p1, Point2 const& p2) } /*! - \brief Multiplies each coordinate of a point by a value + \brief Multiplies each coordinate of a point by the same value \ingroup arithmetic \details \param p point @@ -159,7 +195,7 @@ inline void multiply_value(Point& p, typename detail::param::type value) /*! \brief Multiplies a point by another \ingroup arithmetic - \details The coordinates of the second point will be multiplied by those of the first point. + \details The coordinates of the first point will be multiplied by those of the second point. The second point is not modified. \param p1 first point \param p2 second point @@ -175,7 +211,7 @@ inline void multiply_point(Point1& p1, Point2 const& p2) } /*! - \brief Divides each coordinate of a point by a value + \brief Divides each coordinate of the same point by a value \ingroup arithmetic \details \param p point @@ -192,7 +228,7 @@ inline void divide_value(Point& p, typename detail::param::type value) /*! \brief Divides a point by another \ingroup arithmetic - \details The coordinates of the second point will be divided by those of the first point. + \details The coordinates of the first point will be divided by those of the second point. The second point is not modified. \param p1 first point \param p2 second point @@ -206,6 +242,40 @@ inline void divide_point(Point1& p1, Point2 const& p2) for_each_coordinate(p1, detail::point_operation(p2)); } +/*! + \brief Assign each coordinate of a point the same value + \ingroup arithmetic + \details + \param p point + \param value value to assign + */ +template +inline void assign_value(Point& p, typename detail::param::type value) +{ + BOOST_CONCEPT_ASSERT( (concept::Point) ); + + for_each_coordinate(p, detail::value_assignment::type>(value)); +} + +/*! + \brief Assign a point with another + \ingroup arithmetic + \details The coordinates of the first point will be assigned those of the second point. + The second point is not modified. + \param p1 first point + \param p2 second point + */ +template +inline void assign_point(Point1& p1, Point2& p2) +{ + BOOST_CONCEPT_ASSERT( (concept::Point) ); + BOOST_CONCEPT_ASSERT( (concept::ConstPoint) ); + + for_each_coordinate(p1, detail::point_assignment(p2)); +} + + }} // namespace boost::geometry + #endif // BOOST_GEOMETRY_ARITHMETIC_ARITHMETIC_HPP diff --git a/test/arithmetic/arithmetic.cpp b/test/arithmetic/arithmetic.cpp index 8ed3cd8d1..396c5dc99 100644 --- a/test/arithmetic/arithmetic.cpp +++ b/test/arithmetic/arithmetic.cpp @@ -98,6 +98,23 @@ void test_division() BOOST_CHECK(bg::get<2>(p1) == 5); } +template +void test_assign() +{ + P p1; + P p2; + bg::assign(p1, 12, 34, 56); + bg::assign_point(p2, p1); + BOOST_CHECK(bg::get<0>(p2) == 12); + BOOST_CHECK(bg::get<1>(p2) == 34); + BOOST_CHECK(bg::get<2>(p2) == 56); + + bg::assign_value(p2, 78); + BOOST_CHECK(bg::get<0>(p2) == 78); + BOOST_CHECK(bg::get<1>(p2) == 78); + BOOST_CHECK(bg::get<2>(p2) == 78); +} + template void test_all() @@ -106,6 +123,7 @@ void test_all() test_subtraction

(); test_multiplication

(); test_division

(); + test_assign

(); } From 9f6bf428bb775ddbf4c2fd836a3bf39ce3bbe04a Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 9 Apr 2011 20:29:34 +0000 Subject: [PATCH 10/70] Added and updated documentation of correct, transform, distance, comparable_distance [SVN r71152] --- .../geometry/algorithms/comparable_distance.hpp | 9 +++++++-- include/boost/geometry/algorithms/correct.hpp | 11 ++++++++--- include/boost/geometry/algorithms/distance.hpp | 4 +++- include/boost/geometry/algorithms/transform.hpp | 13 ++++++++++--- include/boost/geometry/geometry.hpp | 1 + 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/include/boost/geometry/algorithms/comparable_distance.hpp b/include/boost/geometry/algorithms/comparable_distance.hpp index 57837a5ed..fa4894272 100644 --- a/include/boost/geometry/algorithms/comparable_distance.hpp +++ b/include/boost/geometry/algorithms/comparable_distance.hpp @@ -25,13 +25,18 @@ namespace boost { namespace geometry /*! \brief \brief_calc2{comparable distance measurement} \ingroup distance -\details The default strategy is used, belonging to the corresponding coordinate system of the geometries - and the comparable strategy is used +\details The free function comparable_distance does not necessarily calculate the distance, + but it calculates a distance measure such that two distances are comparable to each other. + For example: for the Cartesian coordinate system, Pythagoras is used but the square root + is not taken, which makes it faster and the results of two point pairs can still be + compared to each other. \tparam Geometry1 first geometry type \tparam Geometry2 second geometry type \param geometry1 \param_geometry \param geometry2 \param_geometry \return \return_calc{comparable distance} + +\qbk{[include reference/algorithms/comparable_distance.qbk]} */ template inline typename default_distance_result::type comparable_distance( diff --git a/include/boost/geometry/algorithms/correct.hpp b/include/boost/geometry/algorithms/correct.hpp index 79e47c1e9..cc7911f3c 100644 --- a/include/boost/geometry/algorithms/correct.hpp +++ b/include/boost/geometry/algorithms/correct.hpp @@ -93,7 +93,7 @@ struct correct_box static inline void apply(Box& box) { - // Currently only for Cartesian coordinates + // Currently only for Cartesian coordinates // (or spherical without crossing dateline) // Future version: adapt using strategies correct_box_loop @@ -245,10 +245,15 @@ struct correct /*! \brief Corrects a geometry -\details Corrects a geometry +\details Corrects a geometry: all rings which are wrongly oriented with respect + to their expected orientation are reversed. To all rings which do not have a + closing point and are typed as they should have one, the first point is + appended. Also boxes can be corrected. \ingroup correct \tparam Geometry \tparam_geometry -\param geometry \param_geometry +\param geometry \param_geometry which will be corrected if necessary + +\qbk{[include reference/algorithms/correct.qbk]} */ template inline void correct(Geometry& geometry) diff --git a/include/boost/geometry/algorithms/distance.hpp b/include/boost/geometry/algorithms/distance.hpp index f2b6c7a9c..9371772b0 100644 --- a/include/boost/geometry/algorithms/distance.hpp +++ b/include/boost/geometry/algorithms/distance.hpp @@ -523,12 +523,14 @@ inline typename strategy::distance::services::return_type::type distan /*! \brief \brief_calc2{distance} \ingroup distance -\details The default strategy is used, belonging to the corresponding coordinate system of the geometries +\details The default strategy is used, corresponding to the coordinate system of the geometries \tparam Geometry1 \tparam_geometry \tparam Geometry2 \tparam_geometry \param geometry1 \param_geometry \param geometry2 \param_geometry \return \return_calc{distance} + +\qbk{[include reference/algorithms/distance.qbk]} */ template inline typename default_distance_result::type distance( diff --git a/include/boost/geometry/algorithms/transform.hpp b/include/boost/geometry/algorithms/transform.hpp index 47d142ad0..c5c8e985e 100644 --- a/include/boost/geometry/algorithms/transform.hpp +++ b/include/boost/geometry/algorithms/transform.hpp @@ -289,14 +289,19 @@ struct transform /*! -\brief Transforms from one geometry to another geometry using a strategy +\brief Transforms from one geometry to another geometry \brief_strategy \ingroup transform \tparam Geometry1 \tparam_geometry \tparam Geometry2 \tparam_geometry \tparam Strategy strategy \param geometry1 \param_geometry \param geometry2 \param_geometry -\param strategy the strategy to be used for transformation +\param strategy The strategy to be used for transformation +\return True if the transformation could be done + +\qbk{distinguish,with strategy} + +\qbk{[include reference/algorithms/transform_with_strategy.qbk]} */ template inline bool transform(Geometry1 const& geometry1, Geometry2& geometry2, @@ -325,7 +330,9 @@ inline bool transform(Geometry1 const& geometry1, Geometry2& geometry2, \tparam Geometry2 \tparam_geometry \param geometry1 \param_geometry \param geometry2 \param_geometry -\return true if the transformation could be done +\return True if the transformation could be done + +\qbk{[include reference/algorithms/transform.qbk]} */ template inline bool transform(Geometry1 const& geometry1, Geometry2& geometry2) diff --git a/include/boost/geometry/geometry.hpp b/include/boost/geometry/geometry.hpp index e8405f7a7..33b07f418 100644 --- a/include/boost/geometry/geometry.hpp +++ b/include/boost/geometry/geometry.hpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include From a8d62ccbaf33d4e05f2f9f155ab10e0f56df61a1 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 9 Apr 2011 20:31:35 +0000 Subject: [PATCH 11/70] Added and updated documentation of correct, transform, distance, comparable_distance [SVN r71153] --- doc/doxy/doxygen_output/html/doxygen.css | 380 +++--------------- doc/doxy/doxygen_output/html/doxygen.png | Bin 3942 -> 1281 bytes doc/doxy/doxygen_output/html/tabs.css | 134 ++++-- ...{make_envelope.png => return_envelope.png} | Bin doc/imports.qbk | 4 + doc/other/status.xls | Bin 19968 -> 20992 bytes doc/quickref.xml | 2 +- doc/reference.qbk | 32 +- doc/reference/algorithms/clear.qbk | 2 +- .../algorithms/comparable_distance.qbk | 25 ++ doc/reference/algorithms/correct.qbk | 33 ++ doc/reference/algorithms/difference.qbk | 6 +- doc/reference/algorithms/distance.qbk | 21 + doc/reference/algorithms/expand.qbk | 2 +- doc/reference/algorithms/intersection.qbk | 6 +- doc/reference/algorithms/reverse.qbk | 2 +- doc/reference/algorithms/sym_difference.qbk | 6 +- doc/reference/algorithms/transform.qbk | 28 ++ .../algorithms/transform_with_strategy.qbk | 19 + doc/reference/algorithms/union.qbk | 6 +- doc/reference/algorithms/unique.qbk | 2 +- .../implementation_status.cpp | 8 +- doc/src/examples/algorithms/Jamfile.v2 | 22 +- .../algorithms/comparable_distance.cpp | 66 +++ doc/src/examples/algorithms/correct.cpp | 65 +++ doc/src/examples/algorithms/distance.cpp | 13 +- doc/src/examples/algorithms/transform.cpp | 53 +++ .../algorithms/transform_with_strategy.cpp | 63 +++ 28 files changed, 567 insertions(+), 433 deletions(-) rename doc/html/img/algorithms/{make_envelope.png => return_envelope.png} (100%) create mode 100644 doc/reference/algorithms/comparable_distance.qbk create mode 100644 doc/reference/algorithms/correct.qbk create mode 100644 doc/reference/algorithms/distance.qbk create mode 100644 doc/reference/algorithms/transform.qbk create mode 100644 doc/reference/algorithms/transform_with_strategy.qbk create mode 100644 doc/src/examples/algorithms/comparable_distance.cpp create mode 100644 doc/src/examples/algorithms/correct.cpp create mode 100644 doc/src/examples/algorithms/transform.cpp create mode 100644 doc/src/examples/algorithms/transform_with_strategy.cpp diff --git a/doc/doxy/doxygen_output/html/doxygen.css b/doc/doxy/doxygen_output/html/doxygen.css index 74445fe1f..d6aaf2804 100644 --- a/doc/doxy/doxygen_output/html/doxygen.css +++ b/doc/doxy/doxygen_output/html/doxygen.css @@ -8,15 +8,10 @@ body, table, div, p, dl { /* @group Heading Levels */ h1 { + text-align: center; font-size: 150%; } -.title { - font-size: 150%; - font-weight: bold; - margin: 10px 2px; -} - h2 { font-size: 120%; } @@ -69,8 +64,8 @@ h3.version { } div.qindex, div.navtab{ - background-color: #EBEFF6; - border: 1px solid #A3B4D7; + background-color: #e8eef2; + border: 1px solid #84b0c7; text-align: center; margin: 2px; padding: 2px; @@ -88,13 +83,13 @@ div.navtab { /* @group Link Styling */ a { - color: #3D578C; + color: #153788; font-weight: normal; text-decoration: none; } .contents a:visited { - color: #4665A2; + color: #1b77c5; } a:hover { @@ -107,9 +102,9 @@ a.qindex { a.qindexHL { font-weight: bold; - background-color: #9CAFD4; + background-color: #6666cc; color: #ffffff; - border: 1px double #869DCA; + border: 1px double #9295C2; } .contents a.qindexHL:visited { @@ -124,11 +119,11 @@ a.elRef { } a.code { - color: #4665A2; + color: #3030f0; } a.codeRef { - color: #4665A2; + color: #3030f0; } /* @end */ @@ -143,8 +138,8 @@ dl.el { } pre.fragment { - border: 1px solid #C4CFE5; - background-color: #FBFCFD; + border: 1px solid #CCCCCC; + background-color: #f5f5f5; padding: 4px 6px; margin: 4px 8px 4px 2px; overflow: auto; @@ -158,22 +153,13 @@ div.ah { font-weight: bold; color: #ffffff; margin-bottom: 3px; - margin-top: 3px; - padding: 0.2em; - border: solid thin #333; - border-radius: 0.5em; - -webkit-border-radius: .5em; - -moz-border-radius: .5em; - box-shadow: 2px 2px 3px #999; - -webkit-box-shadow: 2px 2px 3px #999; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); - background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); + margin-top: 3px } div.groupHeader { margin-left: 16px; margin-top: 12px; + margin-bottom: 6px; font-weight: bold; } @@ -185,32 +171,27 @@ div.groupText { body { background: white; color: black; - margin: 0; -} - -div.contents { - margin-top: 10px; - margin-left: 10px; - margin-right: 5px; + margin-right: 20px; + margin-left: 20px; } td.indexkey { - background-color: #EBEFF6; + background-color: #e8eef2; font-weight: bold; - border: 1px solid #C4CFE5; + border: 1px solid #CCCCCC; margin: 2px 0px 2px 0; padding: 2px 10px; } td.indexvalue { - background-color: #EBEFF6; - border: 1px solid #C4CFE5; + background-color: #e8eef2; + border: 1px solid #CCCCCC; padding: 2px 10px; margin: 2px 0px; } tr.memlist { - background-color: #EEF1F7; + background-color: #f0f0f0; } p.formulaDsp { @@ -236,11 +217,6 @@ div.center img { border: 0px; } -address.footer { - text-align: right; - padding-right: 12px; -} - img.footer { border: 0px; vertical-align: middle; @@ -294,7 +270,6 @@ span.vhdllogic { /* @end */ -/* .search { color: #003399; font-weight: bold; @@ -311,7 +286,6 @@ input.search { font-weight: normal; background-color: #e8eef2; } -*/ td.tiny { font-size: 75%; @@ -320,18 +294,18 @@ td.tiny { .dirtab { padding: 4px; border-collapse: collapse; - border: 1px solid #A3B4D7; + border: 1px solid #84b0c7; } th.dirtab { - background: #EBEFF6; + background: #e8eef2; font-weight: bold; } hr { height: 0px; border: none; - border-top: 1px solid #4A6AAA; + border-top: 1px solid #666; } hr.footer { @@ -340,15 +314,10 @@ hr.footer { /* @group Member Descriptions */ -table.memberdecls { - border-spacing: 0px; - padding: 0px; -} - .mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams { - background-color: #F9FAFC; + background-color: #FAFAFA; border: none; margin: 4px; padding: 1px 0 0 8px; @@ -360,19 +329,15 @@ table.memberdecls { } .memItemLeft, .memItemRight, .memTemplParams { - border-top: 1px solid #C4CFE5; + border-top: 1px solid #ccc; } .memItemLeft, .memTemplItemLeft { white-space: nowrap; } -.memItemRight { - width: 100%; -} - .memTemplParams { - color: #4665A2; + color: #606060; white-space: nowrap; } @@ -384,28 +349,23 @@ table.memberdecls { .memtemplate { font-size: 80%; - color: #4665A2; + color: #606060; font-weight: normal; - margin-left: 9px; + margin-left: 3px; } .memnav { - background-color: #EBEFF6; - border: 1px solid #A3B4D7; + background-color: #e8eef2; + border: 1px solid #84b0c7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } -.mempage { - width: 100%; -} - .memitem { padding: 0; margin-bottom: 10px; - margin-right: 5px; } .memname { @@ -415,52 +375,40 @@ table.memberdecls { } .memproto { - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; - padding: 6px 0px 6px 0px; - color: #253555; + border-top: 1px solid #84b0c7; + border-left: 1px solid #84b0c7; + border-right: 1px solid #84b0c7; + padding: 0; + background-color: #d5e1e8; font-weight: bold; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - /* opera specific markup */ - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - border-top-right-radius: 8px; - border-top-left-radius: 8px; /* firefox specific markup */ + background-image: -moz-linear-gradient(rgba(228, 233, 245, 1.0) 0%, rgba(193, 205, 232, 1.0) 100%); -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; -moz-border-radius-topright: 8px; -moz-border-radius-topleft: 8px; /* webkit specific markup */ + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(228, 233, 245, 1.0)), to(rgba(193, 205, 232, 1.0))); -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -webkit-border-top-right-radius: 8px; -webkit-border-top-left-radius: 8px; - background-image:url('nav_f.png'); - background-repeat:repeat-x; - background-color: #E2E8F2; } .memdoc { - border-bottom: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #84b0c7; + border-left: 1px solid #84b0c7; + border-right: 1px solid #84b0c7; padding: 2px 5px; - background-color: #FBFCFD; + background-color: #eef3f5; border-top-width: 0; - /* opera specific markup */ - border-bottom-left-radius: 8px; - border-bottom-right-radius: 8px; - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); /* firefox specific markup */ -moz-border-radius-bottomleft: 8px; -moz-border-radius-bottomright: 8px; -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7); /* webkit specific markup */ -webkit-border-bottom-left-radius: 8px; -webkit-border-bottom-right-radius: 8px; -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7)); } .paramkey { @@ -479,28 +427,6 @@ table.memberdecls { font-style: normal; } -.params, .retval, .exception, .tparams { - border-spacing: 6px 2px; -} - -.params .paramname, .retval .paramname { - font-weight: bold; - vertical-align: top; -} - -.params .paramtype { - font-style: italic; - vertical-align: top; -} - -.params .paramdir { - font-family: "courier new",courier,monospace; - vertical-align: top; -} - - - - /* @end */ /* @group Directory (tree) */ @@ -509,7 +435,7 @@ table.memberdecls { .ftvtree { font-family: sans-serif; - margin: 0px; + margin: 0.5em; } /* these are for tree view when used as main index */ @@ -517,7 +443,6 @@ table.memberdecls { .directory { font-size: 9pt; font-weight: bold; - margin: 5px; } .directory h3 { @@ -595,13 +520,9 @@ proper pixel height of your image. /* @end */ -div.dynheader { - margin-top: 8px; -} - address { font-style: normal; - color: #2A3D61; + color: #333; } table.doxtable { @@ -609,12 +530,12 @@ table.doxtable { } table.doxtable td, table.doxtable th { - border: 1px solid #2D4068; + border: 1px solid #153788; padding: 3px 7px 2px; } table.doxtable th { - background-color: #374F7F; + background-color: #254798; color: #FFFFFF; font-size: 110%; padding-bottom: 4px; @@ -622,214 +543,3 @@ table.doxtable th { text-align:left; } -.tabsearch { - top: 0px; - left: 10px; - height: 36px; - background-image: url('tab_b.png'); - z-index: 101; - overflow: hidden; - font-size: 13px; -} - -.navpath ul -{ - font-size: 11px; - background-image:url('tab_b.png'); - background-repeat:repeat-x; - height:30px; - line-height:30px; - color:#8AA0CC; - border:solid 1px #C2CDE4; - overflow:hidden; - margin:0px; - padding:0px; -} - -.navpath li -{ - list-style-type:none; - float:left; - padding-left:10px; - padding-right:15px; - background-image:url('bc_s.png'); - background-repeat:no-repeat; - background-position:right; - color:#364D7C; -} - -.navpath li.navelem a -{ - height:32px; - display:block; - text-decoration: none; - outline: none; -} - -.navpath li.navelem a:hover -{ - color:#6884BD; -} - -.navpath li.footer -{ - list-style-type:none; - float:right; - padding-left:10px; - padding-right:15px; - background-image:none; - background-repeat:no-repeat; - background-position:right; - color:#364D7C; - font-size: 8pt; -} - - -div.summary -{ - float: right; - font-size: 8pt; - padding-right: 5px; - width: 50%; - text-align: right; -} - -div.summary a -{ - white-space: nowrap; -} - -div.ingroups -{ - font-size: 8pt; - padding-left: 5px; - width: 50%; - text-align: left; -} - -div.ingroups a -{ - white-space: nowrap; -} - -div.header -{ - background-image:url('nav_h.png'); - background-repeat:repeat-x; - background-color: #F9FAFC; - margin: 0px; - border-bottom: 1px solid #C4CFE5; -} - -div.headertitle -{ - padding: 5px 5px 5px 10px; -} - -dl -{ - padding: 0 0 0 10px; -} - -dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug -{ - border-left:4px solid; - padding: 0 0 0 6px; -} - -dl.note -{ - border-color: #D0C000; -} - -dl.warning, dl.attention -{ - border-color: #FF0000; -} - -dl.pre, dl.post, dl.invariant -{ - border-color: #00D000; -} - -dl.deprecated -{ - border-color: #505050; -} - -dl.todo -{ - border-color: #00C0E0; -} - -dl.test -{ - border-color: #3030E0; -} - -dl.bug -{ - border-color: #C08050; -} - -#projectlogo -{ - text-align: center; - vertical-align: bottom; - border-collapse: separate; -} - -#projectlogo img -{ - border: 0px none; -} - -#projectname -{ - font: 300% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 2px 0px; -} - -#projectbrief -{ - font: 120% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 0px; -} - -#projectnumber -{ - font: 50% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 0px; -} - -#titlearea -{ - padding: 0px; - margin: 0px; - width: 100%; - border-bottom: 1px solid #5373B4; -} - -.image -{ - text-align: center; -} - -.dotgraph -{ - text-align: center; -} - -.mscgraph -{ - text-align: center; -} - -.caption -{ - font-weight: bold; -} - diff --git a/doc/doxy/doxygen_output/html/doxygen.png b/doc/doxy/doxygen_output/html/doxygen.png index 635ed52fce7057ac24df92ec7664088a881fa5d0..f0a274bbaffdd67f6d784c894d9cf28729db0e14 100644 GIT binary patch literal 1281 zcmeAS@N?(olHy`uVBq!ia0y~yU`SzLV9@1YW?*2*&$c_nz`($g?&#~tz;Nxx75@k$ z1_lPn64!{5;QX|b^2DN42FH~Aq*MjZ+{En3It_%ze$M>CA zQd@cA-1}|2uU)?NYx1Id3)Vc?cIaz;`|_(dU!6R4?%|_n)qPib7ryS8d40jAAIsP5 zJaAy+-Mi<0{(SlM>+{#IpSrqOUcYuaBRy7LRyaPw#=%NCHzV}_|NnOn)EhD|Fvyn# z`33*S3mDEymI*L0F#q>-aSW-rl{CSbfsJFrVk-s?g%oAUmX_Am){F#B2Zn_aN;+Cv zT0YF)3``w*(->F;Vs#if6m~^02{@E&WKn2%k;Li1aPg>61B266mliXSidm{kN?SIt zC^Se+;1-#o%EQwk#5U7O#L8n)$0m-0X%15vI21a90xFqUlmxsJVgdx2lbkgaJ=r`J zGgdMSw!UuGX#ChR;fUfZMy3wNHO?%IEs{rCALJ++L`TGU#Ym_yhj8%uvUO-ovP)!B z32u>?z{7HrNx*^U!U~5VJ(Z?4EIwXNOhFQhIvoYh2)G+^t>G4vIHcirf{{g_S>{SW zM#jOA1I+x3BwJJ!q{NaVst!7A8q*n1 zi8kG06k^(_s&eqrqadMxTqlLl1Vhh`NGBc+Q3XrO28NhkLna0V4yHPECN~>yV*w7P zhQ2?!)iPh;mid18Ze4;!0O1Vfm?NsdjMoq3WRj9TY1uJPbnBX(jkGlxQfrlJM| z`L&fkzS^&P-_>?(CFpw z7{-#o!mOgEJcV@`i=@TRA3rQ48)Dqt6lMpzd9kS+I@WOESl0#qg%VE~m^vC8J4Fs0 z;5HFj)yjC{$x~KN2Hk_p+d-+xV^eG6^!fAWi>Gng%Y1lb+5!@skZpK~A*EBN=P>8y z=E)6u4Gc9HWaqOqnaje$jAWv;NMrl#c< zJ>EoL21b`=HUTvT?AdWqw<-gpi#Wb~+rY?>lF)Q=Z}3)s1_lNOPgg&ebxsLQ0N#Mr Aa{vGU literal 3942 zcmeAS@N?(olHy`uVBq!ia0y~yV8~!#V36lvV_;z5w(hvWz`(ET>Eakt!T2_|I-;lY z|GwfVRnb#Z{M@WoY;k*fVb!&kqzQBHzHqRvyWDqJ$;E?j;;pEuAExET_q=>za)j^Z zEydTm?MACZS2H{FrAButEuR(t@r?0jpWruN_r2fuZCA~@)vGJ*mcReI^ZomW@w_vA z+W5cyi`vdFvgiJ?#H`mJ*X{I~n*Wjg*T34;dS_o7-FqziTP3RZ+fz+zExnYb3>o@?@0yJFXj#e0hbZ`P)5`*0wdbyL}wD6WR*X34Cz zQ}!zA_>?d*Tz_wK=;-RL8&WFT7(6uf&)rOW`(o+xrOvAjx0NmavMahyY#Pt`i%*YQ zs=Aza@lKbYSL9dgYxzqua`kFsE&X$uFV<{VJv=!yZjSP{vM)vI1)FSR&s>aOZock* zWy_mj@g1x7zRo_Cc=E#*UHx;4uA9ofJYslYX&`Pi=PmoelhfRu&DYv-ROjznnQ1)! ziiX*CftMLCZ(hc}A*Etjgw^j4du-hgA94`~Ir86O^&M$t!a=LNKR1Q4Mr9>^&V2E2 zNy3Y-e>+NcSxP1UoHMcF>aA5_3&Pi~-B3JFC=sNf-0-tu#RNXpch53y}RU%h^yoPbu!u%mXQXMykc-@{+ATR!rR!zIJW*n>ou}c2uo@@RloF zWAdII5%q~vQv6>?Yw2{pqP4Pn zS8XZDu*^PmE$G!#32CYM!D;-r|LLbJpSGcM-;+6p+0T<&dL7yI?#T2q?r``qS=-tw zi~IJii>FtAxzt(1pxnFmZh=YWx<@Nw_w+uxf9!Ku-OC${$9r0tE7Hn@Rjw|rtloNYmE=iok`^3W-wu_;5XQI-s;eO7fHXlrY3gB)8~AxDEPiA-}31U`K&)zUzXfDeH7<(i!`f=5p#=>UR}O9DX$8 zM$N1_8 z9P@;!b;F;-O6IyU-ipR{UyV+kKAo7G%llN~)`=n+b6>p)8g4{yr!r5j& z!`t0Smd9D;qczK->n_Ub#P4#5sd;B{y70~xj_U0TF4P9zn^KxyWd7jx2?4Lznp>$$ z-rt(Ql+ZklZ|$?^!vB{%m}ydMDtAYF>(xsOr>;B}vz+DO%g4XBF|*yA`nTeNw3p8B zGo>jqKY#X4C{}Z*?EC83Dv;{ZDn8#@?zu%?)WLbS)e@&>q_KVu46TV^T5#{it+|>v zw#`twSMo0Gj_&z##tZo?9zS37w{s4k^f#|cS-Wj!FE;GtJmXf>c#1D=>BY0Xzb0{d zC!K$=M?+D}p>8*a_~*@Q&i0maGdOHs@Azrs z8kHAW-<68hez)#b`uuWS3az{}iTb)HY_1=-Tocl%o^!~;ZUr)C%=vDt**Li14LQm3W zk^4taJ>@>i@aWb&&9XuKMD;8?a%6hm;+-4)A}W4q?2lcr@o~D3Nc=8e#mg6xOyurpr*7GDY6-)m zzLY=B&&`aaok>^33#c>pY$EY z`z>e6>Dp&)wVIZX=lV>T%&Nw~>F~Dp@i}D^^J|@}y+22!l?ij{#jj32@mxKu{;u=k zE7zJWTOR5@I$r15RyXa=(OVaeCNbz7x>{ov?olhCzKKzxX3_aoCrbBRTvA_riuH+H z52yWX?H=V%PWKesjZYNC6op;-#An@bqStn|wu(7-U~ustk7e`LZF`jUA?5tx@1D_# zX)AVc+T8qn;Z8(4i$bmU8@^@QhiCK@I(>iGrZT(KEL`Iqmpa3;thc*o2=y1vE%f0~ zdBqdmZ=SUE(bLsoMmH{9`nW~o_|&yaL*3S@mUXULzk1GmKed(>dUh^!UGx?mwi!&NF`&u8L+wgUQ{L^V-Uk`}zUTF?qJ2jqr)xLE_YQA$N z4bP}fuuR*bsOlfRS>48dcKhO{6BDLQyOuC@=}}f!(L0fo*LbwApKiKz-+~oP3`dIM zy|qQ#`|M;HUKGWrTU@=WCaZBU(DBJ_6QS*E=YP_ZS^aJL`n8E!uN~i~X9Q3CcGt~| z@$_wRh71Nd<_xja^p)M4*{pp8|0WkJywu+l)O_OW=_8BY=!i|6zR$v>?d{i2%bB0Q zS~2ELo0HJFY4Z`C{P_2EZDx_4g^3p~zFS&$YQl@hJId^A!=}u2-T5ry-agZrFPUsh zOZ#WX9ne?U;5cP&s>_qM9cLp1cV?{%W?#cHQF;0KxYP5V8_(%E{zmuE&Bf7&86CEM zE6WvrcAk3@Q-s2)bEm=&ExBIy%W~GOUl;do{TdiweO8QNukpMm;W0m!u{^uc-)mK{ zBr)qXBSWg^NzD@BS&!cJJr#d=XQPGZ@5Oc%KT?i;<8b}_?RARPZGMIxldWH~_xblV z`^mF|ry98U@p5oKtX-!Nn)kbYjl-{Xyu153jl~6bo;i3}y*uQ& zhR(`^=cm6vbnp~IoL-mjk|T~542kx$LT~PS!r^7J{DGKJ@b?A(>RMSGY#B1LUK{JW zpFL7DU+{!Qq~7}JE7rwE1U0|tJ?+^TVi~c?v0?W9c`B^8ULL=F;_J)|PsV_<$BGOG z$~^w_v23Vix|Oeac3ZneQP=%h6BM@Dwq9Uft`+xv#>-4s!T0kIt+tpbIakSMhTNHN zoE{}Jx6RqEbYbGAXVcCK&Um<=<5Y#-pQ!E`zKTf%x$j6I=pvKH^%5dL2DC4+fa`Tiw>ua69<%N5R8`Uo5uyJ3JEEZ))?@a;l-ZU1j69 z$%a)s65Fd7go>;60}r)X%08ROy(OzwCU|FAq>ENw>{&(Dq6^X)m5JF`vbbiRYFYg& z{ny!v+$qaeu8rTPl_Q(;GL}D1t+r#vinAGczYa?=+%7n=;>FwO6;JdccQbD_*VDUj z<(hxrtxb~0n75vcsJWFoM_hG@%n2XW{wF^BEmJu=PnJC0bKE~pL8Ie#fr4@9M%DXI zig?<4y!v=%FE2Z1^wRkh&ylK!>_)+l(|(;bWEOaJIQIP4nGSbP%$>PMuHnd?yh$%^ z7pOL_yQY+P+ACdo!X zwv!%R4;1@8UzUSmmSiT=kMn#_zP!6^U-@c{Yl3n6DpqZg@Q3Yxtv|jwd6<=<@7ue} z`_n!@^XOu@eMxmkg^{AFvai4!d+P$t-gh!{H_X&}u&LC#AinCPs6GRm{a159)91NG6YIVY1TuZDD z&w8StpPtgzF9eyG-|-=n1C!s?AAj~v$>&Sgn;YTLw~Mi1#`*i&wacp?`b)GMo2NWk z^5BH(KV^^md+*Oz&?%WX<^28Z)oSyzpZ}`2&Sd@?_%qrtZ~EUaQL=X%#WqM7ik_;y zRsQ17dgl*sPC6^w)#p2lOGq&M()@TaF}NhvC;hVCW2t4^z*w0#oqENjnvH|N5ArC z=LPdphuU1%-@EG%m)xkhapT6Lpo5xMLjNyPoy=%7ljrU(P0^J%W-hYcF=u{b-redp z!F7y>kDY7lT=*{DX#SR8a;v)f7yRXz$nGamaU<(m3^p`*r^B|lZ? z*=HWOeC+;Z#vQZyq~#O*wpaaq@cN?8#}D`Nx3HJ5KjkO>wK_HD!t(Y{Cs)^g5E0$} zs&MHWwN>85AOD;@{3OrTZWmv|!wnlZ-~F#uXtnoIM#=L1S4GR?qo&;Z^y%h=xLH=o zPxs~Bt$y_La$EP^UEj|zC-^P4o_Kxsoh+^YTlX$~y3~99z1q2PCiZH7ZL2aDPG81X zmHpK@`S08S22lp5j1u+h|1Z`^hPt*hKVdRtIgF zLEoxXiw-}MySlWJK|$@G-HqzByLJH|>TdsMzBi9Adxk{Z90mpk22WQ%mvv4FO#pA$ Bq}%`i diff --git a/doc/doxy/doxygen_output/html/tabs.css b/doc/doxy/doxygen_output/html/tabs.css index 21920562a..a44416341 100644 --- a/doc/doxy/doxygen_output/html/tabs.css +++ b/doc/doxy/doxygen_output/html/tabs.css @@ -1,59 +1,105 @@ -.tabs, .tabs2, .tabs3 { - background-image: url('tab_b.png'); - width: 100%; - z-index: 101; - font-size: 13px; +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; } -.tabs2 { - font-size: 10px; -} -.tabs3 { - font-size: 9px; +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; } -.tablist { - margin: 0; - padding: 0; - display: table; +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; } -.tablist li { - float: left; - display: table-cell; - background-image: url('tab_b.png'); - line-height: 36px; - list-style: none; +DIV.tabs FORM +{ + float : right; } -.tablist a { - display: block; - padding: 0 20px; - font-weight: bold; - background-image:url('tab_s.png'); - background-repeat:no-repeat; - background-position:right; - color: #283A5D; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - text-decoration: none; - outline: none; +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : 80%; + font-weight : bold; + text-decoration : none; } -.tabs3 .tablist a { - padding: 0 10px; +DIV.tabs A:hover +{ + background-position: 100% -150px; } -.tablist a:hover { - background-image: url('tab_h.png'); - background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); - text-decoration: none; +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; } -.tablist li.current a { - background-image: url('tab_a.png'); - background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs #MSearchBox +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : 80%; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI.current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI.current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.navpath +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; + text-align : center; + margin : 2px; + padding : 2px; } diff --git a/doc/html/img/algorithms/make_envelope.png b/doc/html/img/algorithms/return_envelope.png similarity index 100% rename from doc/html/img/algorithms/make_envelope.png rename to doc/html/img/algorithms/return_envelope.png diff --git a/doc/imports.qbk b/doc/imports.qbk index 788bc68d3..547e5efd1 100644 --- a/doc/imports.qbk +++ b/doc/imports.qbk @@ -23,6 +23,8 @@ [import src/examples/algorithms/assign_point_from_index.cpp] [import src/examples/algorithms/clear.cpp] [import src/examples/algorithms/centroid.cpp] +[import src/examples/algorithms/comparable_distance.cpp] +[import src/examples/algorithms/correct.cpp] [import src/examples/algorithms/distance.cpp] [import src/examples/algorithms/difference.cpp] [import src/examples/algorithms/envelope.cpp] @@ -47,6 +49,8 @@ [import src/examples/algorithms/return_envelope.cpp] [import src/examples/algorithms/simplify.cpp] [import src/examples/algorithms/sym_difference.cpp] +[import src/examples/algorithms/transform.cpp] +[import src/examples/algorithms/transform_with_strategy.cpp] [import src/examples/algorithms/union.cpp] [import src/examples/algorithms/unique.cpp] [import src/examples/algorithms/within.cpp] diff --git a/doc/other/status.xls b/doc/other/status.xls index 691984843ba039b24a5f6d83c962f8e66b39d0b0..c24fe43fa0f894d3be8442243b8d82be25a1ca65 100644 GIT binary patch delta 1400 zcmZpe!`QHdae@J(`b0x%7BvP2hK+&i88`oDROjI3U|?Wigkp}##$1++n>OciaWFHz zV4Pget5^Sm@tCKT!5i)uj5AJ3Fx=n?2CM$Cey#zC&A}YZ0280gUt<7bH$cTea%?ON z3=CWh3=-TBeaLcwVl@T~3=9m+A0RFO=>_QliGi@^$sz-;dbSsgATx|kN-%(EkW)c4 zh|dL;1Brn&=bVsWz-1vwjl>%Xkhu&eIA1WfJPS5>a6*Ei1T4b9z{GIefPvwtfdVhY zL!e+eazcV(@?t(WP*A+)Qv*@L{91DQWug6+u{%ymF#K?ehH7VEa5*W#zyMMb&2Oct z#}LAx!jLM!U;v`eO6f5$fdai-zyQPsiGkcRMM`h-K7Mf#J-8uff5?^_U9v0t!7%wH zzXGpaSzwQ4?1ocdnlCi7SC@QIb#-1F2#Fs}f{j zgz9|3I5|#2jnQs$tAw_oog2sqF}P&(*kdF|o2Rh%qQk&X%r(ur}Y8e#{DCPTs0GS-OOqfgy(}j)9NCf+2*#g29a; zgh2*EPfk`+XAIfgtz^w8b%L3JL4bkd11N++n4N`zfuDi-!v^Nb50t||Q5&OfHMvMd zgY5;Q3~MmMh#K~a`W|+KN zZ7$0eh)jY4h#|rr432(Y1~G>4Laim=?YH?%L5!dO@0n78M2thK+&i88`oDROjGjWnf@ngksjo#$1++>o@0eaWFGI zXP#Wnt5^S=`Ix7b!5i-9%rj0(Fl^wu%m`BbVf|bK5c>nuWk#6zWd0fh5IchzA_kIU zW?^7p;9_8S!vfKVEEgzNW5B?`z`*$-NHBmEW3dpVM&gYG$XtdKoX?qCo&_5`I3dAM0v2IlU}89Kz`$_S z;0G7P@f-{c3`b5#Fic*|=LQOj*L-RqN|;|uuD4XSOnu6ZlM)O+xLu&y85mqnN-!{h zltlAeX{s@VFsLx33NRRe=(AF43{0Rv?-nosu|Z-W_e_yeo4k)-Ttp3S$k`vRUAd*d%j{b@B_vE@>}r28JA_I0ilj3x*H|3kEla z5C$0rEe1CRx5>Rq>Wpriw<=jPN_j9bFbFVkd;kR-C=0N#Ffi~lFn=&$n#`pV28zdp zT2_sb7=d#%FLuGcWDRF=} zpv*D(soGqY1Oceb5p^XF5Ql^NGUFtzpvevzs*@YEStf7L)|>oA+mTxUn!W`X1U5V9 zxHE3j^HH$<_y7NYQ3eJEF$M+(aRvqkPy&`@U|^79U|^7DU|;~r%Q7%9$T2W5$TKi7 zC@?TEC^9fGC^0ZFC~uzVm(Mscfn!oY&g8#>9Ft1|T9^)~P5u>7#V9hlG_amW29)pw IKm-E=0C52JuK)l5 diff --git a/doc/quickref.xml b/doc/quickref.xml index 268fcfaa5..464817358 100644 --- a/doc/quickref.xml +++ b/doc/quickref.xml @@ -387,7 +387,7 @@ Union - union + union Unique diff --git a/doc/reference.qbk b/doc/reference.qbk index 40d5ca87d..a64061fb1 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -65,25 +65,12 @@ [include generated/centroid.qbk] [endsect] -[section:clear clear] [include generated/clear.qbk] -[endsect] - -[section:convex_hull convex_hull] [include generated/convex_hull.qbk] -[endsect] - [include generated/correct.qbk] - -[section:difference difference] [include generated/difference.qbk] -[endsect] - -[section:disjoint disjoint] [include generated/disjoint.qbk] -[endsect] - [section:distance distance] [include generated/distance.qbk] @@ -93,21 +80,16 @@ [include generated/envelope.qbk] [endsect] -[section:equals equals] [include generated/equals.qbk] -[endsect] - -[section:expand expand] [include generated/expand.qbk] -[endsect] [section:for_each for_each] [include generated/for_each.qbk] [endsect] -[section:intersection intersection] +[/section:intersection intersection] [include generated/intersection.qbk] -[endsect] +[/endsect] [section:intersects intersects] [include generated/intersects.qbk] @@ -126,9 +108,7 @@ [include generated/num_points.qbk] -[section:overlaps overlaps] [include generated/overlaps.qbk] -[endsect] [section:perimeter perimeter] [include generated/perimeter.qbk] @@ -140,18 +120,18 @@ [include generated/simplify.qbk] [endsect] -[section:sym_difference sym_difference] +[/section:sym_difference sym_difference] [include generated/sym_difference.qbk] -[endsect] +[/endsect] [section:transform transform] [include generated/transform.qbk] [endsect] -[section:union union] +[/section:union union] [include generated/union.qbk] -[endsect] +[/endsect] [include generated/unique.qbk] diff --git a/doc/reference/algorithms/clear.qbk b/doc/reference/algorithms/clear.qbk index 7753e6a63..6214528a0 100644 --- a/doc/reference/algorithms/clear.qbk +++ b/doc/reference/algorithms/clear.qbk @@ -29,7 +29,7 @@ [heading Complexity] Constant -[heading Examples] +[heading Example] [clear] [clear_output] diff --git a/doc/reference/algorithms/comparable_distance.qbk b/doc/reference/algorithms/comparable_distance.qbk new file mode 100644 index 000000000..304b97ad6 --- /dev/null +++ b/doc/reference/algorithms/comparable_distance.qbk @@ -0,0 +1,25 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[heading Behaviour] +There is no (not yet) version with a strategy. + +It depends on the coordinate system of the geometry's point type if there is +a strategy available which can determine (more efficient than the standard +strategy) a measure of comparable distance. + +[heading Complexity] +Linear + +[heading Example] +[comparable_distance] +[comparable_distance_output] diff --git a/doc/reference/algorithms/correct.qbk b/doc/reference/algorithms/correct.qbk new file mode 100644 index 000000000..6af7f74dc --- /dev/null +++ b/doc/reference/algorithms/correct.qbk @@ -0,0 +1,33 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[def __corrected__ is corrected] + +[heading Behavior] +[table +[[Case] [Behavior] ] +[[__ring__][__ring__ __corrected__]] +[[__polygon__][__polygon__ __corrected__]] +[[__multi_polygon__][__multi_polygon__ __corrected__]] +[[__box__][__box__ __corrected__ with respect to minimal and maximal corners]] +[[__other__][__does_nothing__]] +] + +[tip Correct is not defined within OGC or ISO] + +[heading Complexity] +Linear + +[heading Example] +[correct] +[correct_output] + diff --git a/doc/reference/algorithms/difference.qbk b/doc/reference/algorithms/difference.qbk index 6552d3abb..2a2869a66 100644 --- a/doc/reference/algorithms/difference.qbk +++ b/doc/reference/algorithms/difference.qbk @@ -14,7 +14,7 @@ [difference] [difference_output] [heading See also] -* [link geometry.reference.algorithms.sym_difference.sym_difference sym_difference (symmetric difference)] -* [link geometry.reference.algorithms.intersection.intersection intersection] -* [link geometry.reference.algorithms.union.union_ union] +* [link geometry.reference.algorithms.sym_difference sym_difference (symmetric difference)] +* [link geometry.reference.algorithms.intersection intersection] +* [link geometry.reference.algorithms.union_ union] diff --git a/doc/reference/algorithms/distance.qbk b/doc/reference/algorithms/distance.qbk new file mode 100644 index 000000000..f92a385ee --- /dev/null +++ b/doc/reference/algorithms/distance.qbk @@ -0,0 +1,21 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[include generated/distance_status.qbk] + +[heading Complexity] +Linear +For multi-geometry to multi-geometry: currently quadratic + +[heading Example] +[distance] +[distance_output] diff --git a/doc/reference/algorithms/expand.qbk b/doc/reference/algorithms/expand.qbk index 9780e75a9..de146ae93 100644 --- a/doc/reference/algorithms/expand.qbk +++ b/doc/reference/algorithms/expand.qbk @@ -26,7 +26,7 @@ [heading Complexity] Linear -[heading Examples] +[heading Example] [expand] [expand_output] diff --git a/doc/reference/algorithms/intersection.qbk b/doc/reference/algorithms/intersection.qbk index e51377874..cb688c839 100644 --- a/doc/reference/algorithms/intersection.qbk +++ b/doc/reference/algorithms/intersection.qbk @@ -23,6 +23,6 @@ [intersection_output] [heading See also] -* [link geometry.reference.algorithms.union.union_ union] -* [link geometry.reference.algorithms.difference.difference difference] -* [link geometry.reference.algorithms.sym_difference.sym_difference sym_difference (symmetric difference)] +* [link geometry.reference.algorithms.union_ union] +* [link geometry.reference.algorithms.difference difference] +* [link geometry.reference.algorithms.sym_difference sym_difference (symmetric difference)] diff --git a/doc/reference/algorithms/reverse.qbk b/doc/reference/algorithms/reverse.qbk index fcbc386cc..9e1658549 100644 --- a/doc/reference/algorithms/reverse.qbk +++ b/doc/reference/algorithms/reverse.qbk @@ -32,7 +32,7 @@ [heading Complexity] Linear -[heading Examples] +[heading Example] [reverse] [reverse_output] diff --git a/doc/reference/algorithms/sym_difference.qbk b/doc/reference/algorithms/sym_difference.qbk index 2058ca2d9..89915a256 100644 --- a/doc/reference/algorithms/sym_difference.qbk +++ b/doc/reference/algorithms/sym_difference.qbk @@ -23,7 +23,7 @@ [sym_difference_output] [heading See also] -* [link geometry.reference.algorithms.difference.difference difference] -* [link geometry.reference.algorithms.intersection.intersection intersection] -* [link geometry.reference.algorithms.union.union_ union] +* [link geometry.reference.algorithms.difference difference] +* [link geometry.reference.algorithms.intersection intersection] +* [link geometry.reference.algorithms.union_ union] diff --git a/doc/reference/algorithms/transform.qbk b/doc/reference/algorithms/transform.qbk new file mode 100644 index 000000000..5028f9a67 --- /dev/null +++ b/doc/reference/algorithms/transform.qbk @@ -0,0 +1,28 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[heading Behavior] +[table +[[Case] [Behavior] ] +[[__sph__ (degree) / __sph__ (radian)][Transforms coordinates from degree to radian, or vice versa]] +[[__sph__ / __cart__ (3D)][Transforms coordinates from spherical coordinates to X,Y,Z, or vice versa, on a unit sphere]] +[[__sph__ (degree, with radius) / __sph__ (radian, with radius)][Transforms coordinates from degree to radian, or vice versa. Third coordinate (radius) is untouched]] +[[__sph__ (with radius) / __cart__ (3D)][Transforms coordinates from spherical coordinates to X,Y,Z, or vice versa, on a unit sphere. Third coordinate (radius) is taken into account]] +] + +[heading Complexity] +Linear + +[heading Example] +[transform] +[transform_output] + diff --git a/doc/reference/algorithms/transform_with_strategy.qbk b/doc/reference/algorithms/transform_with_strategy.qbk new file mode 100644 index 000000000..b1045823d --- /dev/null +++ b/doc/reference/algorithms/transform_with_strategy.qbk @@ -0,0 +1,19 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[heading Complexity] +Linear + +[heading Example] +[transform_with_strategy] +[transform_with_strategy_output] + diff --git a/doc/reference/algorithms/union.qbk b/doc/reference/algorithms/union.qbk index 8c86a6110..d620b24d4 100644 --- a/doc/reference/algorithms/union.qbk +++ b/doc/reference/algorithms/union.qbk @@ -20,6 +20,6 @@ [union_output] [heading See also] -* [link geometry.reference.algorithms.intersection.intersection intersection] -* [link geometry.reference.algorithms.difference.difference difference] -* [link geometry.reference.algorithms.sym_difference.sym_difference sym_difference (symmetric difference)] +* [link geometry.reference.algorithms.intersection intersection] +* [link geometry.reference.algorithms.difference difference] +* [link geometry.reference.algorithms.sym_difference sym_difference (symmetric difference)] diff --git a/doc/reference/algorithms/unique.qbk b/doc/reference/algorithms/unique.qbk index 9e3a775d6..955de48be 100644 --- a/doc/reference/algorithms/unique.qbk +++ b/doc/reference/algorithms/unique.qbk @@ -31,7 +31,7 @@ [heading Complexity] Linear -[heading Examples] +[heading Example] [unique] [unique_output] diff --git a/doc/src/docutils/tools/implementation_status/implementation_status.cpp b/doc/src/docutils/tools/implementation_status/implementation_status.cpp index 3ce54c289..2f7b4d7f6 100644 --- a/doc/src/docutils/tools/implementation_status/implementation_status.cpp +++ b/doc/src/docutils/tools/implementation_status/implementation_status.cpp @@ -71,8 +71,9 @@ struct compile_msvc command << "u"; } - command << "implementation_status.hpp tmp/t.cpp > tmp/t.out"; - // For debugging: << type1 << "_" << type2 << ".out"; + command << "implementation_status.hpp tmp/t.cpp > tmp/t" //.out"; + // For debugging: + << type1 << "_" << type2 << ".out"; int failed = system(command.str().c_str()); return failed == 0; @@ -300,7 +301,8 @@ int main(int argc, char** argv) algorithms.push_back(algorithm("correct")); algorithms.push_back(algorithm("distance", 2)); algorithms.push_back(algorithm("centroid", 2)); - //algorithms.push_back(algorithm("within", 2)); + algorithms.push_back(algorithm("intersects", 2)); + algorithms.push_back(algorithm("within", 2)); typedef std::vector cs_type; cs_type css; diff --git a/doc/src/examples/algorithms/Jamfile.v2 b/doc/src/examples/algorithms/Jamfile.v2 index d1be69fb9..25cade7dd 100644 --- a/doc/src/examples/algorithms/Jamfile.v2 +++ b/doc/src/examples/algorithms/Jamfile.v2 @@ -13,6 +13,8 @@ project boost-geometry-doc-example-algorithms : # requirements ; +exe append : append.cpp ; + exe area : area.cpp ; exe area_with_strategy : area_with_strategy.cpp ; @@ -26,9 +28,15 @@ exe assign_point_to_index : assign_point_to_index.cpp ; exe centroid : centroid.cpp ; exe clear : clear.cpp ; +exe comparable_distance : comparable_distance.cpp ; +exe correct : correct.cpp ; +exe difference : difference.cpp ; exe distance : distance.cpp ; +exe envelope : envelope.cpp ; +exe expand : expand.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 ; @@ -38,6 +46,9 @@ exe intersection_segment : intersection_segment.cpp ; exe intersects_linestring : intersects_linestring.cpp ; +exe length : length.cpp ; +exe length_with_strategy : length_with_strategy.cpp ; + exe make_2d_point : make_2d_point.cpp ; exe make_3d_point : make_3d_point.cpp ; exe make_inverse : make_inverse.cpp ; @@ -47,10 +58,17 @@ exe num_geometries : num_geometries.cpp ; exe num_interior_rings : num_interior_rings.cpp ; exe num_points : num_points.cpp ; +exe return_envelope : return_envelope.cpp ; -exe length : length.cpp ; -exe length_with_strategy : length_with_strategy.cpp ; +exe reverse : reverse.cpp ; exe simplify : length.cpp ; +exe sym_difference : sym_difference.cpp ; + +exe transform : transform.cpp ; +exe transform_with_strategy : transform_with_strategy.cpp ; + +exe union : union.cpp ; +exe unique : unique.cpp ; exe within : within.cpp ; diff --git a/doc/src/examples/algorithms/comparable_distance.cpp b/doc/src/examples/algorithms/comparable_distance.cpp new file mode 100644 index 000000000..a5153a392 --- /dev/null +++ b/doc/src/examples/algorithms/comparable_distance.cpp @@ -0,0 +1,66 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[comparable_distance +//` Shows how to efficiently get the closest point + +#include + +#include + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + + point_type p(1.4, 2.6); + + std::vector v; + for (double x = 0.0; x <= 4.0; x++) + { + for (double y = 0.0; y <= 4.0; y++) + { + v.push_back(point_type(x, y)); + } + } + + point_type min_p; + double min_d = boost::numeric::bounds::highest(); + BOOST_FOREACH(point_type const& pv, v) + { + double d = boost::geometry::comparable_distance(p, pv); + if (d < min_d) + { + min_d = d; + min_p = pv; + } + } + + std::cout + << "Closest: " << boost::geometry::dsv(minp) << std::endl + << "At: " << boost::geometry::distance(p, minp) << std::endl; + + return 0; +} + +//] + + +//[comparable_distance_output +/*` +Output: +[pre +Closest: (1, 3) +At: 0.565685 +] +*/ +//] + diff --git a/doc/src/examples/algorithms/correct.cpp b/doc/src/examples/algorithms/correct.cpp new file mode 100644 index 000000000..add730428 --- /dev/null +++ b/doc/src/examples/algorithms/correct.cpp @@ -0,0 +1,65 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[correct +//` Shows how to correct a polygon with respect to its orientation and closure + +#include + +#include +#include + +#include + +int main() +{ + using boost::assign::tuple_list_of; + + typedef boost::geometry::model::polygon + < + boost::tuple + > clockwise_closed_polygon; + + clockwise_closed_polygon cwcp; + + // Fill it counterclockwise (so wrongly), forgetting the closing point + boost::geometry::exterior_ring(cwcp) = tuple_list_of(0, 0)(10, 10)(0, 9); + + // Add a counterclockwise closed inner ring (this is correct) + boost::geometry::interior_rings(cwcp).push_back(tuple_list_of(1, 2)(4, 6)(2, 8)(1, 2)); + + // Its area should be negative (because of wrong orientation) + // and wrong (because of omitted closing point) + double area_before = boost::geometry::area(cwcp); + + // Correct it! + boost::geometry::correct(cwcp); + + // Check its new area + double area_after = boost::geometry::area(cwcp); + + // And output it + std::cout << boost::geometry::dsv(cwcp) << std::endl; + std::cout << area_before << " -> " << area_after << std::endl; + + return 0; +} + +//] + + +//[correct_output +/*` +Output: +[pre +(((0, 0), (0, 9), (10, 10), (0, 0)), ((1, 2), (4, 6), (2, 8), (1, 2))) +-7 -> 38 +] +*/ +//] diff --git a/doc/src/examples/algorithms/distance.cpp b/doc/src/examples/algorithms/distance.cpp index 2676af350..3d4e71d5a 100644 --- a/doc/src/examples/algorithms/distance.cpp +++ b/doc/src/examples/algorithms/distance.cpp @@ -41,9 +41,10 @@ int main() mp.push_back(point_type(0,0)); mp.push_back(point_type(3,3)); - std::cout << "distance: " << boost::geometry::distance(p, poly) << std::endl; - std::cout << "distance: " << boost::geometry::distance(p, line) << std::endl; - std::cout << "distance: " << boost::geometry::distance(p, mp) << std::endl; + std::cout + << "Point-Poly: " << boost::geometry::distance(p, poly) << std::endl + << "Point-Line: " << boost::geometry::distance(p, line) << std::endl + << "Point-MultiPoint: " << boost::geometry::distance(p, mp) << std::endl; return 0; } @@ -55,9 +56,9 @@ int main() /*` Output: [pre -distance: 1.22066 -distance: 1 -distance: 2.23607 +Point-Poly: 1.22066 +Point-Line: 1 +Point-MultiPoint: 2.23607 ] */ //] diff --git a/doc/src/examples/algorithms/transform.cpp b/doc/src/examples/algorithms/transform.cpp new file mode 100644 index 000000000..8eea3be30 --- /dev/null +++ b/doc/src/examples/algorithms/transform.cpp @@ -0,0 +1,53 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[transform +//` Shows how points can be transformed using the default strategy + +#include +#include + + +int main() +{ + namespace bg = boost::geometry; + + bg::model::point > p1(5.0, 52.0); + + // Transform from degree to radian. Default strategy is automatically selected, + // it will convert from degree to radian + bg::model::point > p2; + bg::transform(p1, p2); + + // Transform from degree (lon-lat) to 3D (x,y,z). Default strategy is automatically selected, + // it will consider points on a unit sphere + bg::model::point p3; + bg::transform(p1, p3); + + std::cout + << "p1: " << bg::dsv(p1) << std::endl + << "p2: " << bg::dsv(p2) << std::endl + << "p3: " << bg::dsv(p3) << std::endl; + + return 0; +} + +//] + + +//[transform_output +/*` +Output: +[pre +p1: (5, 52) +p2: (0.0872665, 0.907571) +p3: (0.785012, 0.0686797, 0.615661) +] +*/ +//] diff --git a/doc/src/examples/algorithms/transform_with_strategy.cpp b/doc/src/examples/algorithms/transform_with_strategy.cpp new file mode 100644 index 000000000..2fcfc57f4 --- /dev/null +++ b/doc/src/examples/algorithms/transform_with_strategy.cpp @@ -0,0 +1,63 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[transform_with_strategy +//` Shows how points can be scaled, translated or rotated + +#include +#include + + +int main() +{ + namespace trans = boost::geometry::strategy::transform; + using boost::geometry::dsv; + + typedef boost::geometry::model::point point_type; + + point_type p1(1.0, 1.0); + + // Translate over (1.5, 1.5) + point_type p2; + trans::translate_transformer translate(1.5, 1.5); + boost::geometry::transform(p1, p2, translate); + + // Scale with factor 3.0 + point_type p3; + trans::scale_transformer scale(3.0); + boost::geometry::transform(p1, p3, scale); + + // Rotate with respect to the origin (0,0) over 90 degrees (clockwise) + point_type p4; + trans::rotate_transformer rotate(90.0); + boost::geometry::transform(p1, p4, rotate); + + std::cout + << "p1: " << dsv(p1) << std::endl + << "p2: " << dsv(p2) << std::endl + << "p3: " << dsv(p3) << std::endl + << "p4: " << dsv(p4) << std::endl; + + return 0; +} + +//] + + +//[transform_with_strategy_output +/*` +Output: +[pre +p1: (1, 1) +p2: (2.5, 2.5) +p3: (3, 3) +p4: (1, -1) +] +*/ +//] From bcc46bd20e9f9072c74a14e7d65b9a481aad1ed7 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 9 Apr 2011 20:41:25 +0000 Subject: [PATCH 12/70] Bugfix in example [SVN r71154] --- doc/src/examples/algorithms/comparable_distance.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/examples/algorithms/comparable_distance.cpp b/doc/src/examples/algorithms/comparable_distance.cpp index a5153a392..0ed9a0490 100644 --- a/doc/src/examples/algorithms/comparable_distance.cpp +++ b/doc/src/examples/algorithms/comparable_distance.cpp @@ -45,8 +45,8 @@ int main() } std::cout - << "Closest: " << boost::geometry::dsv(minp) << std::endl - << "At: " << boost::geometry::distance(p, minp) << std::endl; + << "Closest: " << boost::geometry::dsv(min_p) << std::endl + << "At: " << boost::geometry::distance(p, min_p) << std::endl; return 0; } From 87b37952bfc269545bce999b9b83311604e4727c Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 9 Apr 2011 21:24:27 +0000 Subject: [PATCH 13/70] Added doc for equals [SVN r71155] --- doc/generated/equals_status.qbk | 10 +++ doc/imports.qbk | 3 + doc/other/status.xls | Bin 20992 -> 20992 bytes .../implementation_status.cpp | 1 + doc/src/examples/algorithms/Jamfile.v2 | 1 + doc/src/examples/algorithms/equals.cpp | 59 ++++++++++++++++++ 6 files changed, 74 insertions(+) create mode 100644 doc/generated/equals_status.qbk create mode 100644 doc/src/examples/algorithms/equals.cpp diff --git a/doc/generated/equals_status.qbk b/doc/generated/equals_status.qbk new file mode 100644 index 000000000..6dc8bc0b2 --- /dev/null +++ b/doc/generated/equals_status.qbk @@ -0,0 +1,10 @@ +[heading Supported geometries] +[table +[[ ][Point][Box][Linestring][Ring][Polygon][MultiPolygon]] +[[Point][[$img/ok.png]][[$img/nyi.png]][[$img/nyi.png]][[$img/nyi.png]][[$img/nyi.png]][[$img/nyi.png]]] +[[Box][[$img/nyi.png]][[$img/ok.png]][[$img/nyi.png]][[$img/ok.png]][[$img/ok.png]][[$img/nyi.png]]] +[[Linestring][[$img/nyi.png]][[$img/nyi.png]][[$img/ok.png]][[$img/nyi.png]][[$img/nyi.png]][[$img/nyi.png]]] +[[Ring][[$img/nyi.png]][[$img/ok.png]][[$img/nyi.png]][[$img/ok.png]][[$img/ok.png]][[$img/nyi.png]]] +[[Polygon][[$img/nyi.png]][[$img/ok.png]][[$img/nyi.png]][[$img/ok.png]][[$img/ok.png]][[$img/ok.png]]] +[[MultiPolygon][[$img/nyi.png]][[$img/nyi.png]][[$img/nyi.png]][[$img/nyi.png]][[$img/ok.png]][[$img/ok.png]]] +] diff --git a/doc/imports.qbk b/doc/imports.qbk index 547e5efd1..4e318c20b 100644 --- a/doc/imports.qbk +++ b/doc/imports.qbk @@ -11,6 +11,7 @@ =============================================================================/] [import src/examples/quick_start.cpp] + [import src/examples/algorithms/area.cpp] [import src/examples/algorithms/area_with_strategy.cpp] [import src/examples/algorithms/append.cpp] @@ -28,6 +29,7 @@ [import src/examples/algorithms/distance.cpp] [import src/examples/algorithms/difference.cpp] [import src/examples/algorithms/envelope.cpp] +[import src/examples/algorithms/equals.cpp] [import src/examples/algorithms/expand.cpp] [import src/examples/algorithms/for_each_point.cpp] [import src/examples/algorithms/for_each_point_const.cpp] @@ -54,6 +56,7 @@ [import src/examples/algorithms/union.cpp] [import src/examples/algorithms/unique.cpp] [import src/examples/algorithms/within.cpp] + [import src/examples/core/get_point.cpp] [import src/examples/core/get_box.cpp] [import src/examples/core/set_point.cpp] diff --git a/doc/other/status.xls b/doc/other/status.xls index c24fe43fa0f894d3be8442243b8d82be25a1ca65..de8455ab45465dd28c652b09912f9101eba7d5f2 100644 GIT binary patch delta 924 zcmZoz!q~8caf2EcFDC;710xi3PB!MUWZb+tmunuAG6R!5Cj-NF1_p*^P6h^PMh1o( zoD2*Fj0_AmTnr3X7{eYJOm-A9m1ALGU;trZ7KlMYY&RIKPD(I9z~p~IRxBUZ&o!8A zBb=b>d9uiWi|qy@NWIZX39vqp2ZnC40`XoP=$+@B&GAB51Ft$7kHh6GCf}sRr zA_Eh{aRUa1qXv^d3W`i#&gaBt&k(|(!jLM! zU;v`eO6fB&F)%P}>=rNpu|Z-WtEWimPu|BbE}{=Loq^%(57}~~OLk=;Op{;oD{%{Y z_CMHgN`k@Reez^60eeGp1`Y-WhK5rT3>}Q-43dZI3f+1c`%uv;?AN za+`oXqxs}x0?Lf$lV1r)i*~WpyoQ92*>MSm|NsC0XAtO`EG1~pTBE?g@N9FKAQKxS z!{kWubU_9N4kiHxE(Qh$PKN&=7f!w?F6`LB0*W$_3=cvE9Qq(JUbxtrIG8#CpMm*<0n21Al`zH|lM_{vS#L0!u$oUksj?Ex zx1M}Jon`VSRTb77jCWYgC*M|GfF!hqW-6hWp! zOgXEeq#&VqgYgQxIVfBhcp1bPcYg24f9}`Q-na^OzqX$=%mdVt=4`gHeUkd@_f2#pFCq5mAu8Krt|xf%}6QDCQX^ zARNuf$B@au&Y;2|Jo&z+C^rX#pu+^l8;loN%qM@-sF>WKZNSbCPURev7iv%8hOikK j_!;;oJLpW_q?e<_I^l3e%Ad)F0qsmB+M9m`urUGvWSif{ delta 1084 zcmZoz!q~8caf2EcF9!ny10xi3Og84SWZbklmuntVy~c5QP6meU3=9m-oD2-ojJzLi za569yFfuaOa4|4kVVrSNf&rvC;;|Y9NRAC;I~N0k1UEz0r?EZhslA&KzegdNHE~C5Tr)p4ajQ@3@12WFt$7k zHh6GCf}sRtkrV?10~5n>0|thp1`50oAAy4V$O(zbi}>6bUrc_*r_T6dvJk(j@{W@d z4C^KI%R>7tV?pd6PSGGEz}N*8v`jB1NAX*0>M?{cs4%1oFc^U7vr>8tObiSR8@mMz zKx~j0$VpSA^d|4)7Z=e3>jx2Mf5?^_U9v0t!7%wHzY=#~k7ewJQxXh6oT4X-3D_G3 zgQKb8lmtTuV=x0O-Y1+w#5+hF6hccNY9_Y{*fR!CJ|>{d7(DrvfV5~IOU-LYIG7!m zVEF(4|9=L7zR6O8=B#-N3=B6mhY2#VF-lC16i*klV&GsBVBlh4VBlo<&%nSCJo%!y zuwyU-1EU03h6gSq!N9;63>M>si$M}P$OJyP7+CLQRS9KL5Q_n&dHBG+19S%CH7czOJ$oESAjrg7FAz@Z^`O3&4E)$tTrRSYI&a zumw;4qy`haqz)1jVGo}CTYVn$1gOf}8cOUF7+)}&a0gG8*QuD?r!6vhf~FAj5hajq z_LHAzDzP6?dck;uCwMZi);#7H$`J9lT1xCMlwU9w@C8p6)2^62UB_VZU7c2bPH0l* nWZ-0AVd2``D7=SplU|Mz>xaD`-+Y-|7|_n-uC@7B02?C!#)13Z diff --git a/doc/src/docutils/tools/implementation_status/implementation_status.cpp b/doc/src/docutils/tools/implementation_status/implementation_status.cpp index 2f7b4d7f6..6f59fc3d7 100644 --- a/doc/src/docutils/tools/implementation_status/implementation_status.cpp +++ b/doc/src/docutils/tools/implementation_status/implementation_status.cpp @@ -303,6 +303,7 @@ int main(int argc, char** argv) algorithms.push_back(algorithm("centroid", 2)); algorithms.push_back(algorithm("intersects", 2)); algorithms.push_back(algorithm("within", 2)); + algorithms.push_back(algorithm("equals", 2)); typedef std::vector cs_type; cs_type css; diff --git a/doc/src/examples/algorithms/Jamfile.v2 b/doc/src/examples/algorithms/Jamfile.v2 index 25cade7dd..60aa72c13 100644 --- a/doc/src/examples/algorithms/Jamfile.v2 +++ b/doc/src/examples/algorithms/Jamfile.v2 @@ -35,6 +35,7 @@ exe difference : difference.cpp ; exe distance : distance.cpp ; exe envelope : envelope.cpp ; +exe equals : equals.cpp ; exe expand : expand.cpp ; exe for_each_point : for_each_point.cpp ; diff --git a/doc/src/examples/algorithms/equals.cpp b/doc/src/examples/algorithms/equals.cpp new file mode 100644 index 000000000..bdceebcb5 --- /dev/null +++ b/doc/src/examples/algorithms/equals.cpp @@ -0,0 +1,59 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[equals +//` Shows the predicate equals, which returns true if two geometries are spatially equal + +#include + +#include +#include +#include + +#include + +int main() +{ + using boost::assign::tuple_list_of; + + typedef boost::tuple point; + + boost::geometry::model::polygon poly1, poly2; + boost::geometry::exterior_ring(poly1) = tuple_list_of(0, 0)(0, 5)(5, 5)(5, 0)(0, 0); + boost::geometry::exterior_ring(poly2) = tuple_list_of(5, 0)(0, 0)(0, 5)(5, 5)(5, 0); + + std::cout + << "polygons are spatially " + << (boost::geometry::equals(poly1, poly2) ? "equal" : "not equal") + << std::endl; + + boost::geometry::model::box box; + boost::geometry::assign(box, 0, 0, 5, 5); + + std::cout + << "polygon and box are spatially " + << (boost::geometry::equals(box, poly2) ? "equal" : "not equal") + << std::endl; + + + return 0; +} + +//] + + +//[equals_output +/*` +Output: +[pre +polygons are spatially equal +polygon and box are spatially equal +] +*/ +//] From 731999217aa67edcad0152c457b5f86331160291 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 9 Apr 2011 21:24:54 +0000 Subject: [PATCH 14/70] Added doc for equals [SVN r71156] --- include/boost/geometry/algorithms/equals.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/boost/geometry/algorithms/equals.hpp b/include/boost/geometry/algorithms/equals.hpp index d80406327..b42dbcf04 100644 --- a/include/boost/geometry/algorithms/equals.hpp +++ b/include/boost/geometry/algorithms/equals.hpp @@ -271,12 +271,20 @@ struct equals_reversed /*! \brief \brief_check{are spatially equal} +\details \details_check12{equals, is spatially equal}. Spatially equal means + that the same point set is included. A box can therefore be spatially equal + to a ring or a polygon, or a linestring can be spatially equal to a + multi-linestring or a segment. This only theoretically, not all combinations + are implemented yet. \ingroup equals \tparam Geometry1 \tparam_geometry \tparam Geometry2 \tparam_geometry \param geometry1 \param_geometry \param geometry2 \param_geometry -\return \return_check2{are spatially disjoint} +\return \return_check2{are spatially equal} + +\qbk{[include reference/algorithms/equals.qbk]} + */ template inline bool equals(Geometry1 const& geometry1, Geometry2 const& geometry2) From 4b4d9578023791520deaceeac2db1913253b68eb Mon Sep 17 00:00:00 2001 From: Bruno Lalande Date: Sun, 10 Apr 2011 20:44:26 +0000 Subject: [PATCH 15/70] Small fix - forgotten const [SVN r71170] --- include/boost/geometry/arithmetic/arithmetic.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/geometry/arithmetic/arithmetic.hpp b/include/boost/geometry/arithmetic/arithmetic.hpp index a18e3f9ff..395a603b2 100644 --- a/include/boost/geometry/arithmetic/arithmetic.hpp +++ b/include/boost/geometry/arithmetic/arithmetic.hpp @@ -266,7 +266,7 @@ inline void assign_value(Point& p, typename detail::param::type value) \param p2 second point */ template -inline void assign_point(Point1& p1, Point2& p2) +inline void assign_point(Point1& p1, const Point2& p2) { BOOST_CONCEPT_ASSERT( (concept::Point) ); BOOST_CONCEPT_ASSERT( (concept::ConstPoint) ); From 603f435d47cea171c4a77bb6e01eb988d68cc14b Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Tue, 12 Apr 2011 18:24:24 +0000 Subject: [PATCH 16/70] Changed assign to assign_values / assign_points and copied in assign from convert [SVN r71208] --- include/boost/geometry/algorithms/assign.hpp | 77 +++++++++---------- .../geometry/algorithms/detail/convert.hpp | 12 +-- 2 files changed, 42 insertions(+), 47 deletions(-) diff --git a/include/boost/geometry/algorithms/assign.hpp b/include/boost/geometry/algorithms/assign.hpp index 4df4e2d6f..1823d8303 100644 --- a/include/boost/geometry/algorithms/assign.hpp +++ b/include/boost/geometry/algorithms/assign.hpp @@ -25,6 +25,8 @@ #include #include +#include +#include #include #include #include @@ -44,41 +46,6 @@ namespace boost { namespace geometry namespace detail { namespace assign { -template -struct assign_operation -{ - inline assign_operation(CoordinateType const& value) - : m_value(value) - {} - - template - inline void apply(P& point) const - { - geometry::set(point, m_value); - } - -private: - - CoordinateType m_value; -}; - - -/*! - \brief Assigns all coordinates of a specific point to a value - \ingroup assign - \details - \param p Point - \param value Value which is assigned to all coordinates of point p - */ -template -inline void assign_value(Point& p, - typename coordinate_type::type const& value) -{ - for_each_coordinate(p, - assign_operation::type>(value)); -} - - template < @@ -112,8 +79,7 @@ struct assign_zero_point { static inline void apply(Point& point) { - typedef typename coordinate_type::type coordinate_type; - assign_value(point, 0); + geometry::assign_value(point, 0); } }; @@ -405,7 +371,7 @@ struct assign_inverse } */ template -inline void assign(Geometry& geometry, Type const& c1, Type const& c2) +inline void assign_values(Geometry& geometry, Type const& c1, Type const& c2) { concept::check(); @@ -437,7 +403,7 @@ inline void assign(Geometry& geometry, Type const& c1, Type const& c2) } */ template -inline void assign(Geometry& geometry, +inline void assign_values(Geometry& geometry, Type const& c1, Type const& c2, Type const& c3) { concept::check(); @@ -464,7 +430,7 @@ inline void assign(Geometry& geometry, \qbk{distinguish, 4 coordinate values} */ template -inline void assign(Geometry& geometry, +inline void assign_values(Geometry& geometry, Type const& c1, Type const& c2, Type const& c3, Type const& c4) { concept::check(); @@ -500,7 +466,7 @@ inline void assign(Geometry& geometry, } */ template -inline void assign(Geometry& geometry, Range const& range) +inline void assign_points(Geometry& geometry, Range const& range) { concept::check(); @@ -667,7 +633,36 @@ inline void assign_point_from_index(Geometry const& geometry, Point& point) } +/*! +\brief Assigns one geometry to another geometry +\details The assign algorithm assigns one geometry, e.g. a BOX, to another geometry, e.g. a RING. This only +if it is possible and applicable. +\ingroup assign +\tparam Geometry1 \tparam_geometry +\tparam Geometry2 \tparam_geometry +\param geometry1 \param_geometry (source) +\param geometry2 \param_geometry (target) +\note It is moved to namespace detail because it overlaps functionality + of assign. So assign will be changed such that it also can convert. + */ +template +inline void assign(Geometry1 const& geometry1, Geometry2& geometry2) +{ + concept::check_concepts_and_equal_dimensions(); + + dispatch::convert + < + typename tag::type, + typename tag::type, + dimension::type::value, + Geometry1, + Geometry2 + >::apply(geometry1, geometry2); +} + + }} // namespace boost::geometry + #endif // BOOST_GEOMETRY_ALGORITHMS_ASSIGN_HPP diff --git a/include/boost/geometry/algorithms/detail/convert.hpp b/include/boost/geometry/algorithms/detail/convert.hpp index 9301006a7..ea4f4adeb 100644 --- a/include/boost/geometry/algorithms/detail/convert.hpp +++ b/include/boost/geometry/algorithms/detail/convert.hpp @@ -147,19 +147,19 @@ struct convert geometry::clear(ring); typename point_type::type point; - geometry::assign(point, get(box), get(box)); + geometry::assign_values(point, get(box), get(box)); geometry::append(ring, point); - geometry::assign(point, get(box), get(box)); + geometry::assign_values(point, get(box), get(box)); geometry::append(ring, point); - geometry::assign(point, get(box), get(box)); + geometry::assign_values(point, get(box), get(box)); geometry::append(ring, point); - geometry::assign(point, get(box), get(box)); + geometry::assign_values(point, get(box), get(box)); geometry::append(ring, point); - geometry::assign(point, get(box), get(box)); + geometry::assign_values(point, get(box), get(box)); geometry::append(ring, point); } }; @@ -247,7 +247,7 @@ if it is possible and applicable. \param geometry1 \param_geometry (source) \param geometry2 \param_geometry (target) \note It is moved to namespace detail because it overlaps functionality - of assign. So assign will be changed such that it also can convert. + of assign. */ template inline void convert(Geometry1 const& geometry1, Geometry2& geometry2) From 1af9fe70f48d7ae2ddfbf3aea90a38e8bf2f2432 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Tue, 12 Apr 2011 18:29:39 +0000 Subject: [PATCH 17/70] Changes in test/doc to reflect changes in assign [SVN r71209] --- doc/src/examples/algorithms/Jamfile.v2 | 1 + doc/src/examples/algorithms/assign.cpp | 61 ++++++++++++ .../examples/algorithms/assign_2d_point.cpp | 6 +- .../examples/algorithms/assign_3d_point.cpp | 2 +- .../algorithms/assign_point_from_index.cpp | 2 +- .../examples/algorithms/assign_with_range.cpp | 4 +- test/algorithms/assign.cpp | 93 ++++++++++++++++--- test/algorithms/detail/convert.cpp | 2 +- 8 files changed, 150 insertions(+), 21 deletions(-) create mode 100644 doc/src/examples/algorithms/assign.cpp diff --git a/doc/src/examples/algorithms/Jamfile.v2 b/doc/src/examples/algorithms/Jamfile.v2 index 60aa72c13..9731ce0f8 100644 --- a/doc/src/examples/algorithms/Jamfile.v2 +++ b/doc/src/examples/algorithms/Jamfile.v2 @@ -18,6 +18,7 @@ exe append : append.cpp ; exe area : area.cpp ; exe area_with_strategy : area_with_strategy.cpp ; +exe assign : assign.cpp ; exe assign_2d_point : assign_2d_point.cpp ; exe assign_3d_point : assign_3d_point.cpp ; exe assign_inverse : assign_inverse.cpp ; diff --git a/doc/src/examples/algorithms/assign.cpp b/doc/src/examples/algorithms/assign.cpp new file mode 100644 index 000000000..d7871680c --- /dev/null +++ b/doc/src/examples/algorithms/assign.cpp @@ -0,0 +1,61 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[assign +//` Shows how to assign a geometry to another + +#include + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point; + typedef boost::geometry::model::box box; + typedef boost::geometry::model::polygon polygon; + + point p1; + box b; + boost::geometry::assign_values(p1, 1, 1); + boost::geometry::assign_values(b, 1, 1, 2, 2); + + // Assign a box to a polygon (conversion box->poly) + polygon p; + boost::geometry::assign(b, p); + + // Assign a point to another point type (conversion of point-type) + boost::tuple p2; + boost::geometry::assign(p1, p2); + + + using boost::geometry::dsv; + std::cout + << "box: " << dsv(b) << std::endl + << "polygon: " << dsv(p) << std::endl + << "point: " << dsv(p) << std::endl + << "point tuples: " << dsv(p2) << std::endl + ; + + return 0; +} + +//] + + +//[assign_output +/*` +Output: +[pre +box: ((1, 1), (2, 2)) +first: (1, 1) +second: (2, 2) +] +*/ +//] diff --git a/doc/src/examples/algorithms/assign_2d_point.cpp b/doc/src/examples/algorithms/assign_2d_point.cpp index e01da8d7a..e32f5b5c7 100644 --- a/doc/src/examples/algorithms/assign_2d_point.cpp +++ b/doc/src/examples/algorithms/assign_2d_point.cpp @@ -23,15 +23,15 @@ int main() { - using boost::geometry::assign; + using boost::geometry::assign_values; boost::geometry::model::d2::point_xy p1; - assign(p1, 1.2345, 2.3456); + assign_values(p1, 1.2345, 2.3456); #if defined(HAVE_TTMATH) boost::geometry::model::d2::point_xy > p2; - assign(p2, "1.2345", "2.3456"); /*< It is possible to assign coordinates with other types than the coordinate type. + assign_values(p2, "1.2345", "2.3456"); /*< It is possible to assign coordinates with other types than the coordinate type. For ttmath, you can e.g. conveniently use strings. The advantage is that it then has higher precision, because if doubles are used for assignments the double-precision is used. >*/ diff --git a/doc/src/examples/algorithms/assign_3d_point.cpp b/doc/src/examples/algorithms/assign_3d_point.cpp index 51e91ff31..aa3ddb683 100644 --- a/doc/src/examples/algorithms/assign_3d_point.cpp +++ b/doc/src/examples/algorithms/assign_3d_point.cpp @@ -19,7 +19,7 @@ int main() { boost::geometry::model::point p; - boost::geometry::assign(p, 1.2345, 2.3456, 3.4567); + boost::geometry::assign_values(p, 1.2345, 2.3456, 3.4567); std::cout << boost::geometry::dsv(p) << std::endl; diff --git a/doc/src/examples/algorithms/assign_point_from_index.cpp b/doc/src/examples/algorithms/assign_point_from_index.cpp index 9b2da934b..2f5284693 100644 --- a/doc/src/examples/algorithms/assign_point_from_index.cpp +++ b/doc/src/examples/algorithms/assign_point_from_index.cpp @@ -23,7 +23,7 @@ int main() typedef model::segment segment; segment s; - assign(s, 1, 1, 2, 2); + assign_values(s, 1, 1, 2, 2); point first, second; assign_point_from_index<0>(s, first); diff --git a/doc/src/examples/algorithms/assign_with_range.cpp b/doc/src/examples/algorithms/assign_with_range.cpp index 1a212245f..771ef233f 100644 --- a/doc/src/examples/algorithms/assign_with_range.cpp +++ b/doc/src/examples/algorithms/assign_with_range.cpp @@ -46,8 +46,8 @@ int main() ls line1, line2, line3; line1 = tuple_list_of(0, 0)(2, 3)(4, 0)(6, 3)(8, 0)(10, 3)(12, 0); /*< tuple_list_of is part of Boost.Assign and can be used for Boost.Geometry if points are tuples >*/ - boost::geometry::assign(line2, tuple_list_of(0, 0)(2, 2)(4, 0)(6, 2)(8, 0)); /*< tuple_list_of delivers a range and can therefore be used in boost::geometry::assign >*/ - boost::geometry::assign(line3, line1 | boost::adaptors::filtered(x_between(4, 8))); /*< Boost.Range adaptors can also be used in boost::geometry::assign >*/ + boost::geometry::assign_points(line2, tuple_list_of(0, 0)(2, 2)(4, 0)(6, 2)(8, 0)); /*< tuple_list_of delivers a range and can therefore be used in boost::geometry::assign >*/ + boost::geometry::assign_points(line3, line1 | boost::adaptors::filtered(x_between(4, 8))); /*< Boost.Range adaptors can also be used in boost::geometry::assign >*/ std::cout << "line 1: " << boost::geometry::dsv(line1) << std::endl; std::cout << "line 2: " << boost::geometry::dsv(line2) << std::endl; diff --git a/test/algorithms/assign.cpp b/test/algorithms/assign.cpp index 96bd35e0a..be7cc2d70 100644 --- a/test/algorithms/assign.cpp +++ b/test/algorithms/assign.cpp @@ -14,6 +14,7 @@ #include +#include #include #include @@ -48,25 +49,25 @@ void test_assign_linestring_2d() { bg::model::linestring line; - // Test assignment of plain array (note that this is only possible if adapted c-array is included! + // Test assignment of plain array (note that this is only possible if adapted c-array is included!) const double coors[3][2] = { {1, 2}, {3, 4}, {5, 6} }; - bg::assign(line, coors); + bg::assign_points(line, coors); check_linestring_2d(line); // Test assignment of point array Point points[3]; - bg::assign(points[0], 1, 2); - bg::assign(points[1], 3, 4); - bg::assign(points[2], 5, 6); - bg::assign(line, points); + bg::assign_values(points[0], 1, 2); + bg::assign_values(points[1], 3, 4); + bg::assign_values(points[2], 5, 6); + bg::assign_points(line, points); check_linestring_2d(line); - // Test assignment of array with different point-type + // Test assignment of array with different point-type (tuple adaption should be included) boost::tuple tuples[3]; tuples[0] = boost::make_tuple(1, 2); tuples[1] = boost::make_tuple(3, 4); tuples[2] = boost::make_tuple(5, 6); - bg::assign(line, tuples); + bg::assign_points(line, tuples); check_linestring_2d(line); } @@ -76,7 +77,7 @@ namespace detail void test_assign_box_or_segment_2d() { BoxOrSegment geometry; - bg::assign(geometry, 1, 2, 3, 4); + bg::assign_values(geometry, 1, 2, 3, 4); BOOST_CHECK((bg::get(geometry) == 1)); BOOST_CHECK((bg::get(geometry) == 2)); BOOST_CHECK((bg::get(geometry) == 3)); @@ -114,12 +115,12 @@ template void test_assign_point_3d() { Point p; - bg::assign(p, 1, 2, 3); + bg::assign_values(p, 1, 2, 3); BOOST_CHECK(bg::get<0>(p) == 1); BOOST_CHECK(bg::get<1>(p) == 2); BOOST_CHECK(bg::get<2>(p) == 3); - bg::detail::assign::assign_value(p, 123); + bg::assign_value(p, 123); BOOST_CHECK(bg::get<0>(p) == 123); BOOST_CHECK(bg::get<1>(p) == 123); BOOST_CHECK(bg::get<2>(p) == 123); @@ -131,15 +132,74 @@ void test_assign_point_3d() } +template +void test_assign_conversion() +{ + typedef bg::model::box

box_type; + typedef bg::model::ring

ring_type; + typedef bg::model::polygon

polygon_type; + + P p; + bg::assign_values(p, 1, 2); + + box_type b; + bg::assign(p, b); + + BOOST_CHECK_CLOSE((bg::get<0, 0>(b)), 1.0, 0.001); + BOOST_CHECK_CLOSE((bg::get<0, 1>(b)), 2.0, 0.001); + BOOST_CHECK_CLOSE((bg::get<1, 0>(b)), 1.0, 0.001); + BOOST_CHECK_CLOSE((bg::get<1, 1>(b)), 2.0, 0.001); + + + bg::set(b, 1); + bg::set(b, 2); + bg::set(b, 3); + bg::set(b, 4); + + ring_type ring; + bg::assign(b, ring); + + //std::cout << bg::wkt(b) << std::endl; + //std::cout << bg::wkt(ring) << std::endl; + + typename boost::range_const_iterator::type it = ring.begin(); + BOOST_CHECK_CLOSE(bg::get<0>(*it), 1.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 2.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 1.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 4.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 3.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 4.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 3.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 2.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 1.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 2.0, 0.001); + + BOOST_CHECK_EQUAL(ring.size(), 5u); + + + polygon_type polygon; + + bg::assign(ring, polygon); + BOOST_CHECK_EQUAL(bg::num_points(polygon), 5u); + + bg::assign(polygon, ring); + BOOST_CHECK_EQUAL(bg::num_points(ring), 5u); +} + + template void test_assign_point_2d() { Point p; - bg::assign(p, 1, 2); + bg::assign_values(p, 1, 2); BOOST_CHECK(bg::get<0>(p) == 1); BOOST_CHECK(bg::get<1>(p) == 2); - bg::detail::assign::assign_value(p, 123); + bg::assign_value(p, 123); BOOST_CHECK(bg::get<0>(p) == 123); BOOST_CHECK(bg::get<1>(p) == 123); @@ -148,6 +208,10 @@ void test_assign_point_2d() BOOST_CHECK(bg::get<1>(p) == 0); } + + + + int test_main(int, char* []) { test_assign_point_3d(); @@ -165,6 +229,9 @@ int test_main(int, char* []) test_assign_point_2d >(); test_assign_point_2d >(); + test_assign_conversion >(); + + // Segment (currently) cannot handle array's because derived from std::pair test_assign_box_2d(); test_assign_box_2d(); diff --git a/test/algorithms/detail/convert.cpp b/test/algorithms/detail/convert.cpp index 2c6d227d3..fb1e704f3 100644 --- a/test/algorithms/detail/convert.cpp +++ b/test/algorithms/detail/convert.cpp @@ -32,7 +32,7 @@ void test_all() typedef bg::model::box

box_type; P p; - bg::assign(p, 1, 2); + bg::assign_values(p, 1, 2); box_type b; bg::detail::convert(p, b); From 3cf4b0e1fe0e4c373b4ce0f36fed75a8681c7c62 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Tue, 12 Apr 2011 18:41:53 +0000 Subject: [PATCH 18/70] Temporary solved mutual inclusion assign/convert [SVN r71210] --- include/boost/geometry/algorithms/assign.hpp | 8 +++++++- include/boost/geometry/algorithms/detail/convert.hpp | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/boost/geometry/algorithms/assign.hpp b/include/boost/geometry/algorithms/assign.hpp index 1823d8303..951f5e91f 100644 --- a/include/boost/geometry/algorithms/assign.hpp +++ b/include/boost/geometry/algorithms/assign.hpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -633,6 +632,13 @@ inline void assign_point_from_index(Geometry const& geometry, Point& point) } +}} // namespace boost::geometry + +#include + +namespace boost { namespace geometry +{ + /*! \brief Assigns one geometry to another geometry \details The assign algorithm assigns one geometry, e.g. a BOX, to another geometry, e.g. a RING. This only diff --git a/include/boost/geometry/algorithms/detail/convert.hpp b/include/boost/geometry/algorithms/detail/convert.hpp index ea4f4adeb..1a6457f3f 100644 --- a/include/boost/geometry/algorithms/detail/convert.hpp +++ b/include/boost/geometry/algorithms/detail/convert.hpp @@ -20,8 +20,9 @@ #include #include +#include #include -#include +#include #include #include From 7edfdba5dcabb2d2d9ac67a03b2497fc3aebdfb0 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Tue, 12 Apr 2011 18:44:44 +0000 Subject: [PATCH 19/70] Updates for assign->assign_values [SVN r71211] --- doc/src/examples/algorithms/assign_box_corners.cpp | 2 +- doc/src/examples/algorithms/equals.cpp | 2 +- doc/src/examples/geometries/register/point.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/examples/algorithms/assign_box_corners.cpp b/doc/src/examples/algorithms/assign_box_corners.cpp index 01ec6ae15..f6588194f 100644 --- a/doc/src/examples/algorithms/assign_box_corners.cpp +++ b/doc/src/examples/algorithms/assign_box_corners.cpp @@ -23,7 +23,7 @@ int main() typedef model::box box; box b; - assign(b, 2, 2, 5, 5); + assign_values(b, 2, 2, 5, 5); point ll, lr, ul, ur; assign_box_corners(b, ll, lr, ul, ur); diff --git a/doc/src/examples/algorithms/equals.cpp b/doc/src/examples/algorithms/equals.cpp index bdceebcb5..27b087125 100644 --- a/doc/src/examples/algorithms/equals.cpp +++ b/doc/src/examples/algorithms/equals.cpp @@ -34,7 +34,7 @@ int main() << std::endl; boost::geometry::model::box box; - boost::geometry::assign(box, 0, 0, 5, 5); + boost::geometry::assign_values(box, 0, 0, 5, 5); std::cout << "polygon and box are spatially " diff --git a/doc/src/examples/geometries/register/point.cpp b/doc/src/examples/geometries/register/point.cpp index d4a27c545..bfac67d88 100644 --- a/doc/src/examples/geometries/register/point.cpp +++ b/doc/src/examples/geometries/register/point.cpp @@ -29,8 +29,8 @@ int main() namespace bg = boost::geometry; /*< Any Boost.Geometry function can be used for legacy point now. Here: assign and distance >*/ - bg::assign(p1, 1, 1); - bg::assign(p2, 2, 2); + bg::assign_values(p1, 1, 1); + bg::assign_values(p2, 2, 2); double d = bg::distance(p1, p2); From be53ecf97b457814a5550a5add44a0a825896e87 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Tue, 12 Apr 2011 20:13:06 +0000 Subject: [PATCH 20/70] Splitted files assign/assign_values to avoid circularities [SVN r71212] --- include/boost/geometry/algorithms/assign.hpp | 406 +--------------- .../algorithms/detail/assign_values.hpp | 450 ++++++++++++++++++ .../geometry/algorithms/detail/convert.hpp | 1 + 3 files changed, 454 insertions(+), 403 deletions(-) create mode 100644 include/boost/geometry/algorithms/detail/assign_values.hpp diff --git a/include/boost/geometry/algorithms/assign.hpp b/include/boost/geometry/algorithms/assign.hpp index 951f5e91f..859e50ab9 100644 --- a/include/boost/geometry/algorithms/assign.hpp +++ b/include/boost/geometry/algorithms/assign.hpp @@ -25,6 +25,9 @@ #include #include +#include +#include + #include #include #include @@ -41,408 +44,6 @@ namespace boost { namespace geometry { -#ifndef DOXYGEN_NO_DETAIL -namespace detail { namespace assign -{ - - -template -< - typename Box, std::size_t Index, - std::size_t Dimension, std::size_t DimensionCount -> -struct initialize -{ - typedef typename coordinate_type::type coordinate_type; - - static inline void apply(Box& box, coordinate_type const& value) - { - geometry::set(box, value); - initialize::apply(box, value); - } -}; - - -template -struct initialize -{ - typedef typename coordinate_type::type coordinate_type; - - static inline void apply(Box&, coordinate_type const& ) - {} -}; - - -template -struct assign_zero_point -{ - static inline void apply(Point& point) - { - geometry::assign_value(point, 0); - } -}; - - -template -struct assign_inverse_box_or_segment -{ - typedef typename point_type::type point_type; - - static inline void apply(BoxOrSegment& geometry) - { - typedef typename coordinate_type::type coordinate_type; - - typedef typename boost::mpl::if_ - < - typename boost::is_arithmetic::type, - coordinate_type, - double - >::type bound_type; - - initialize - < - BoxOrSegment, 0, 0, dimension::type::value - >::apply( - geometry, boost::numeric::bounds::highest()); - initialize - < - BoxOrSegment, 1, 0, dimension::type::value - >::apply( - geometry, boost::numeric::bounds::lowest()); - } -}; - - -template -struct assign_zero_box_or_segment -{ - static inline void apply(BoxOrSegment& geometry) - { - typedef typename coordinate_type::type coordinate_type; - - initialize - < - BoxOrSegment, 0, 0, dimension::type::value - >::apply(geometry, coordinate_type()); - initialize - < - BoxOrSegment, 1, 0, dimension::type::value - >::apply(geometry, coordinate_type()); - } -}; - - -template -< - std::size_t Corner1, std::size_t Corner2, - typename Box, typename Point -> -inline void assign_box_2d_corner(Box const& box, Point& point) -{ - // Be sure both are 2-Dimensional - assert_dimension(); - assert_dimension(); - - // Copy coordinates - typedef typename coordinate_type::type coordinate_type; - - geometry::set<0>(point, boost::numeric_cast(get(box))); - geometry::set<1>(point, boost::numeric_cast(get(box))); -} - - - -template -< - typename Geometry, typename Point, - std::size_t Index, - std::size_t Dimension, std::size_t DimensionCount -> -struct assign_point_to_index -{ - - static inline void apply(Point const& point, Geometry& geometry) - { - geometry::set(geometry, boost::numeric_cast - < - typename coordinate_type::type - >(geometry::get(point))); - - assign_point_to_index - < - Geometry, Point, Index, Dimension + 1, DimensionCount - >::apply(point, geometry); - } -}; - -template -< - typename Geometry, typename Point, - std::size_t Index, - std::size_t DimensionCount -> -struct assign_point_to_index - < - Geometry, Point, - Index, - DimensionCount, DimensionCount - > -{ - static inline void apply(Point const& , Geometry& ) - { - } -}; - - -template -< - typename Geometry, typename Point, - std::size_t Index, - std::size_t Dimension, std::size_t DimensionCount -> -struct assign_point_from_index -{ - - static inline void apply(Geometry const& geometry, Point& point) - { - geometry::set( point, boost::numeric_cast - < - typename coordinate_type::type - >(geometry::get(geometry))); - - assign_point_from_index - < - Geometry, Point, Index, Dimension + 1, DimensionCount - >::apply(geometry, point); - } -}; - -template -< - typename Geometry, typename Point, - std::size_t Index, - std::size_t DimensionCount -> -struct assign_point_from_index - < - Geometry, Point, - Index, - DimensionCount, DimensionCount - > -{ - static inline void apply(Geometry const&, Point&) - { - } -}; - - -template -struct assign_2d_box_or_segment -{ - typedef typename coordinate_type::type coordinate_type; - - // Here we assign 4 coordinates to a box of segment - // -> Most logical is: x1,y1,x2,y2 - // In case the user reverses x1/x2 or y1/y2, for a box, we could reverse them (THAT IS NOT IMPLEMENTED) - - template - static inline void apply(Geometry& geometry, - Type const& x1, Type const& y1, Type const& x2, Type const& y2) - { - geometry::set<0, 0>(geometry, boost::numeric_cast(x1)); - geometry::set<0, 1>(geometry, boost::numeric_cast(y1)); - geometry::set<1, 0>(geometry, boost::numeric_cast(x2)); - geometry::set<1, 1>(geometry, boost::numeric_cast(y2)); - } -}; - - -}} // namespace detail::assign -#endif // DOXYGEN_NO_DETAIL - -#ifndef DOXYGEN_NO_DISPATCH -namespace dispatch -{ - -template -struct assign -{ - BOOST_MPL_ASSERT_MSG - ( - false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE - , (types) - ); -}; - -template -struct assign -{ - typedef typename coordinate_type::type coordinate_type; - - template - static inline void apply(Point& point, T const& c1, T const& c2) - { - set<0>(point, boost::numeric_cast(c1)); - set<1>(point, boost::numeric_cast(c2)); - } -}; - -template -struct assign -{ - typedef typename coordinate_type::type coordinate_type; - - template - static inline void apply(Point& point, T const& c1, T const& c2, T const& c3) - { - set<0>(point, boost::numeric_cast(c1)); - set<1>(point, boost::numeric_cast(c2)); - set<2>(point, boost::numeric_cast(c3)); - } -}; - -template -struct assign - : detail::assign::assign_2d_box_or_segment -{}; - -template -struct assign - : detail::assign::assign_2d_box_or_segment -{}; - - - -template -struct assign_zero {}; - - -template -struct assign_zero - : detail::assign::assign_zero_point -{}; - -template -struct assign_zero - : detail::assign::assign_zero_box_or_segment -{}; - -template -struct assign_zero - : detail::assign::assign_zero_box_or_segment -{}; - - -template -struct assign_inverse {}; - -template -struct assign_inverse - : detail::assign::assign_inverse_box_or_segment -{}; - -template -struct assign_inverse - : detail::assign::assign_inverse_box_or_segment -{}; - - -} // namespace dispatch -#endif // DOXYGEN_NO_DISPATCH - - -/*! -\brief Assign two coordinates to a geometry (usually a 2D point) -\ingroup assign -\tparam Geometry \tparam_geometry -\tparam Type \tparam_numeric to specify the coordinates -\param geometry \param_geometry -\param c1 \param_x -\param c2 \param_y - -\qbk{distinguish, 2 coordinate values} -\qbk{ -[heading Example] -[assign_2d_point] [assign_2d_point_output] - -[heading See also] -\* [link geometry.reference.algorithms.make.make_2_2_coordinate_values make] -} - */ -template -inline void assign_values(Geometry& geometry, Type const& c1, Type const& c2) -{ - concept::check(); - - dispatch::assign - < - typename tag::type, - Geometry, - geometry::dimension::type::value - >::apply(geometry, c1, c2); -} - -/*! -\brief Assign three values to a geometry (usually a 3D point) -\ingroup assign -\tparam Geometry \tparam_geometry -\tparam Type \tparam_numeric to specify the coordinates -\param geometry \param_geometry -\param c1 \param_x -\param c2 \param_y -\param c3 \param_z - -\qbk{distinguish, 3 coordinate values} -\qbk{ -[heading Example] -[assign_3d_point] [assign_3d_point_output] - -[heading See also] -\* [link geometry.reference.algorithms.make.make_3_3_coordinate_values make] -} - */ -template -inline void assign_values(Geometry& geometry, - Type const& c1, Type const& c2, Type const& c3) -{ - concept::check(); - - dispatch::assign - < - typename tag::type, - Geometry, - geometry::dimension::type::value - >::apply(geometry, c1, c2, c3); -} - -/*! -\brief Assign four values to a geometry (usually a box or segment) -\ingroup assign -\tparam Geometry \tparam_geometry -\tparam Type \tparam_numeric to specify the coordinates -\param geometry \param_geometry -\param c1 First coordinate (usually x1) -\param c2 Second coordinate (usually y1) -\param c3 Third coordinate (usually x2) -\param c4 Fourth coordinate (usually y2) - -\qbk{distinguish, 4 coordinate values} - */ -template -inline void assign_values(Geometry& geometry, - Type const& c1, Type const& c2, Type const& c3, Type const& c4) -{ - concept::check(); - - dispatch::assign - < - typename tag::type, - Geometry, - geometry::dimension::type::value - >::apply(geometry, c1, c2, c3, c4); -} - - /*! \brief Assign a range of points to a linestring, ring or polygon \note The point-type of the range might be different from the point-type of the geometry @@ -634,7 +235,6 @@ inline void assign_point_from_index(Geometry const& geometry, Point& point) }} // namespace boost::geometry -#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/assign_values.hpp b/include/boost/geometry/algorithms/detail/assign_values.hpp new file mode 100644 index 000000000..d9c6fc49d --- /dev/null +++ b/include/boost/geometry/algorithms/detail/assign_values.hpp @@ -0,0 +1,450 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2011 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-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_ASSIGN_VALUES_HPP +#define BOOST_GEOMETRY_ALGORITHMS_ASSIGN_VALUES_HPP + + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + + +#include + + +namespace boost { namespace geometry +{ + +#ifndef DOXYGEN_NO_DETAIL +namespace detail { namespace assign +{ + + +template +< + typename Box, std::size_t Index, + std::size_t Dimension, std::size_t DimensionCount +> +struct initialize +{ + typedef typename coordinate_type::type coordinate_type; + + static inline void apply(Box& box, coordinate_type const& value) + { + geometry::set(box, value); + initialize::apply(box, value); + } +}; + + +template +struct initialize +{ + typedef typename coordinate_type::type coordinate_type; + + static inline void apply(Box&, coordinate_type const& ) + {} +}; + + +template +struct assign_zero_point +{ + static inline void apply(Point& point) + { + geometry::assign_value(point, 0); + } +}; + + +template +struct assign_inverse_box_or_segment +{ + typedef typename point_type::type point_type; + + static inline void apply(BoxOrSegment& geometry) + { + typedef typename coordinate_type::type coordinate_type; + + typedef typename boost::mpl::if_ + < + typename boost::is_arithmetic::type, + coordinate_type, + double + >::type bound_type; + + initialize + < + BoxOrSegment, 0, 0, dimension::type::value + >::apply( + geometry, boost::numeric::bounds::highest()); + initialize + < + BoxOrSegment, 1, 0, dimension::type::value + >::apply( + geometry, boost::numeric::bounds::lowest()); + } +}; + + +template +struct assign_zero_box_or_segment +{ + static inline void apply(BoxOrSegment& geometry) + { + typedef typename coordinate_type::type coordinate_type; + + initialize + < + BoxOrSegment, 0, 0, dimension::type::value + >::apply(geometry, coordinate_type()); + initialize + < + BoxOrSegment, 1, 0, dimension::type::value + >::apply(geometry, coordinate_type()); + } +}; + + +template +< + std::size_t Corner1, std::size_t Corner2, + typename Box, typename Point +> +inline void assign_box_2d_corner(Box const& box, Point& point) +{ + // Be sure both are 2-Dimensional + assert_dimension(); + assert_dimension(); + + // Copy coordinates + typedef typename coordinate_type::type coordinate_type; + + geometry::set<0>(point, boost::numeric_cast(get(box))); + geometry::set<1>(point, boost::numeric_cast(get(box))); +} + + + +template +< + typename Geometry, typename Point, + std::size_t Index, + std::size_t Dimension, std::size_t DimensionCount +> +struct assign_point_to_index +{ + + static inline void apply(Point const& point, Geometry& geometry) + { + geometry::set(geometry, boost::numeric_cast + < + typename coordinate_type::type + >(geometry::get(point))); + + assign_point_to_index + < + Geometry, Point, Index, Dimension + 1, DimensionCount + >::apply(point, geometry); + } +}; + +template +< + typename Geometry, typename Point, + std::size_t Index, + std::size_t DimensionCount +> +struct assign_point_to_index + < + Geometry, Point, + Index, + DimensionCount, DimensionCount + > +{ + static inline void apply(Point const& , Geometry& ) + { + } +}; + + +template +< + typename Geometry, typename Point, + std::size_t Index, + std::size_t Dimension, std::size_t DimensionCount +> +struct assign_point_from_index +{ + + static inline void apply(Geometry const& geometry, Point& point) + { + geometry::set( point, boost::numeric_cast + < + typename coordinate_type::type + >(geometry::get(geometry))); + + assign_point_from_index + < + Geometry, Point, Index, Dimension + 1, DimensionCount + >::apply(geometry, point); + } +}; + +template +< + typename Geometry, typename Point, + std::size_t Index, + std::size_t DimensionCount +> +struct assign_point_from_index + < + Geometry, Point, + Index, + DimensionCount, DimensionCount + > +{ + static inline void apply(Geometry const&, Point&) + { + } +}; + + +template +struct assign_2d_box_or_segment +{ + typedef typename coordinate_type::type coordinate_type; + + // Here we assign 4 coordinates to a box of segment + // -> Most logical is: x1,y1,x2,y2 + // In case the user reverses x1/x2 or y1/y2, for a box, we could reverse them (THAT IS NOT IMPLEMENTED) + + template + static inline void apply(Geometry& geometry, + Type const& x1, Type const& y1, Type const& x2, Type const& y2) + { + geometry::set<0, 0>(geometry, boost::numeric_cast(x1)); + geometry::set<0, 1>(geometry, boost::numeric_cast(y1)); + geometry::set<1, 0>(geometry, boost::numeric_cast(x2)); + geometry::set<1, 1>(geometry, boost::numeric_cast(y2)); + } +}; + + +}} // namespace detail::assign +#endif // DOXYGEN_NO_DETAIL + +#ifndef DOXYGEN_NO_DISPATCH +namespace dispatch +{ + +template +struct assign +{ + BOOST_MPL_ASSERT_MSG + ( + false, NOT_OR_NOT_YET_IMPLEMENTED_FOR_THIS_GEOMETRY_TYPE + , (types) + ); +}; + +template +struct assign +{ + typedef typename coordinate_type::type coordinate_type; + + template + static inline void apply(Point& point, T const& c1, T const& c2) + { + set<0>(point, boost::numeric_cast(c1)); + set<1>(point, boost::numeric_cast(c2)); + } +}; + +template +struct assign +{ + typedef typename coordinate_type::type coordinate_type; + + template + static inline void apply(Point& point, T const& c1, T const& c2, T const& c3) + { + set<0>(point, boost::numeric_cast(c1)); + set<1>(point, boost::numeric_cast(c2)); + set<2>(point, boost::numeric_cast(c3)); + } +}; + +template +struct assign + : detail::assign::assign_2d_box_or_segment +{}; + +template +struct assign + : detail::assign::assign_2d_box_or_segment +{}; + + + +template +struct assign_zero {}; + + +template +struct assign_zero + : detail::assign::assign_zero_point +{}; + +template +struct assign_zero + : detail::assign::assign_zero_box_or_segment +{}; + +template +struct assign_zero + : detail::assign::assign_zero_box_or_segment +{}; + + +template +struct assign_inverse {}; + +template +struct assign_inverse + : detail::assign::assign_inverse_box_or_segment +{}; + +template +struct assign_inverse + : detail::assign::assign_inverse_box_or_segment +{}; + + +} // namespace dispatch +#endif // DOXYGEN_NO_DISPATCH + + +/*! +\brief Assign two coordinates to a geometry (usually a 2D point) +\ingroup assign +\tparam Geometry \tparam_geometry +\tparam Type \tparam_numeric to specify the coordinates +\param geometry \param_geometry +\param c1 \param_x +\param c2 \param_y + +\qbk{distinguish, 2 coordinate values} +\qbk{ +[heading Example] +[assign_2d_point] [assign_2d_point_output] + +[heading See also] +\* [link geometry.reference.algorithms.make.make_2_2_coordinate_values make] +} + */ +template +inline void assign_values(Geometry& geometry, Type const& c1, Type const& c2) +{ + concept::check(); + + dispatch::assign + < + typename tag::type, + Geometry, + geometry::dimension::type::value + >::apply(geometry, c1, c2); +} + +/*! +\brief Assign three values to a geometry (usually a 3D point) +\ingroup assign +\tparam Geometry \tparam_geometry +\tparam Type \tparam_numeric to specify the coordinates +\param geometry \param_geometry +\param c1 \param_x +\param c2 \param_y +\param c3 \param_z + +\qbk{distinguish, 3 coordinate values} +\qbk{ +[heading Example] +[assign_3d_point] [assign_3d_point_output] + +[heading See also] +\* [link geometry.reference.algorithms.make.make_3_3_coordinate_values make] +} + */ +template +inline void assign_values(Geometry& geometry, + Type const& c1, Type const& c2, Type const& c3) +{ + concept::check(); + + dispatch::assign + < + typename tag::type, + Geometry, + geometry::dimension::type::value + >::apply(geometry, c1, c2, c3); +} + +/*! +\brief Assign four values to a geometry (usually a box or segment) +\ingroup assign +\tparam Geometry \tparam_geometry +\tparam Type \tparam_numeric to specify the coordinates +\param geometry \param_geometry +\param c1 First coordinate (usually x1) +\param c2 Second coordinate (usually y1) +\param c3 Third coordinate (usually x2) +\param c4 Fourth coordinate (usually y2) + +\qbk{distinguish, 4 coordinate values} + */ +template +inline void assign_values(Geometry& geometry, + Type const& c1, Type const& c2, Type const& c3, Type const& c4) +{ + concept::check(); + + dispatch::assign + < + typename tag::type, + Geometry, + geometry::dimension::type::value + >::apply(geometry, c1, c2, c3, c4); +} + + + +}} // namespace boost::geometry + + +#endif // BOOST_GEOMETRY_ALGORITHMS_ASSIGN_VALUES_HPP diff --git a/include/boost/geometry/algorithms/detail/convert.hpp b/include/boost/geometry/algorithms/detail/convert.hpp index 1a6457f3f..999330304 100644 --- a/include/boost/geometry/algorithms/detail/convert.hpp +++ b/include/boost/geometry/algorithms/detail/convert.hpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include From 91f240188cbc8313834eac626e78d7738e5008e6 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Tue, 12 Apr 2011 20:14:55 +0000 Subject: [PATCH 21/70] Updated tests (assign -> assign_values) [SVN r71213] --- test/algorithms/intersection.cpp | 2 +- test/algorithms/transform.cpp | 4 +-- test/arithmetic/arithmetic.cpp | 18 ++++++------ test/arithmetic/dot_product.cpp | 4 +-- test/geometries/boost_polygon.cpp | 4 +-- test/geometries/box.cpp | 4 +-- test/strategies/cross_track.cpp | 6 ++-- test/strategies/haversine.cpp | 12 ++++---- test/strategies/projected_point.cpp | 6 ++-- test/strategies/pythagoras.cpp | 28 +++++++++---------- test/strategies/segment_intersection.cpp | 8 +++--- .../segment_intersection_collinear.cpp | 8 +++--- test/strategies/side_by_cross_track.cpp | 6 ++-- test/strategies/transformer.cpp | 2 +- test/util/for_each_coordinate.cpp | 2 +- 15 files changed, 57 insertions(+), 57 deletions(-) diff --git a/test/algorithms/intersection.cpp b/test/algorithms/intersection.cpp index 5a3bada28..5a7b2c647 100644 --- a/test/algorithms/intersection.cpp +++ b/test/algorithms/intersection.cpp @@ -324,7 +324,7 @@ void test_pointer_version() p = new test::test_point_xy; p->x = 10; p->y = 10; ln.push_back(p); bg::model::box > box; - bg::assign(box, 2, 2, 8, 8); + bg::assign_values(box, 2, 2, 8, 8); typedef bg::model::linestring > output_type; std::vector clip; diff --git a/test/algorithms/transform.cpp b/test/algorithms/transform.cpp index e4d5bc9a7..af8ba28c7 100644 --- a/test/algorithms/transform.cpp +++ b/test/algorithms/transform.cpp @@ -80,7 +80,7 @@ void test_transformations(double phi, double theta, double r) { typedef bg::model::point > spherical_type; spherical_type sph1; - assign(sph1, phi, theta, r); + assign_values(sph1, phi, theta, r); BOOST_CHECK(transform(sph1, p)); spherical_type sph2; @@ -97,7 +97,7 @@ void test_transformations(double phi, double theta, double r) { typedef bg::model::point > spherical_type; spherical_type sph1, sph2; - assign(sph1, phi, theta); + assign_values(sph1, phi, theta); BOOST_CHECK(transform(sph1, p)); BOOST_CHECK(transform(p, sph2)); diff --git a/test/arithmetic/arithmetic.cpp b/test/arithmetic/arithmetic.cpp index 396c5dc99..1ae1915f4 100644 --- a/test/arithmetic/arithmetic.cpp +++ b/test/arithmetic/arithmetic.cpp @@ -30,14 +30,14 @@ template void test_addition() { P p1; - bg::assign(p1, 1, 2, 3); + bg::assign_values(p1, 1, 2, 3); bg::add_value(p1, 10); BOOST_CHECK(bg::get<0>(p1) == 11); BOOST_CHECK(bg::get<1>(p1) == 12); BOOST_CHECK(bg::get<2>(p1) == 13); P p2; - bg::assign(p2, 4, 5, 6); + bg::assign_values(p2, 4, 5, 6); bg::add_point(p1, p2); BOOST_CHECK(bg::get<0>(p1) == 15); BOOST_CHECK(bg::get<1>(p1) == 17); @@ -48,14 +48,14 @@ template void test_subtraction() { P p1; - bg::assign(p1, 1, 2, 3); + bg::assign_values(p1, 1, 2, 3); bg::subtract_value(p1, 10); BOOST_CHECK(bg::get<0>(p1) == -9); BOOST_CHECK(bg::get<1>(p1) == -8); BOOST_CHECK(bg::get<2>(p1) == -7); P p2; - bg::assign(p2, 4, 6, 8); + bg::assign_values(p2, 4, 6, 8); bg::subtract_point(p1, p2); BOOST_CHECK(bg::get<0>(p1) == -13); BOOST_CHECK(bg::get<1>(p1) == -14); @@ -66,14 +66,14 @@ template void test_multiplication() { P p1; - bg::assign(p1, 1, 2, 3); + bg::assign_values(p1, 1, 2, 3); bg::multiply_value(p1, 5); BOOST_CHECK(bg::get<0>(p1) == 5); BOOST_CHECK(bg::get<1>(p1) == 10); BOOST_CHECK(bg::get<2>(p1) == 15); P p2; - bg::assign(p2, 4, 5, 6); + bg::assign_values(p2, 4, 5, 6); bg::multiply_point(p1, p2); BOOST_CHECK(bg::get<0>(p1) == 20); BOOST_CHECK(bg::get<1>(p1) == 50); @@ -84,14 +84,14 @@ template void test_division() { P p1; - bg::assign(p1, 50, 100, 150); + bg::assign_values(p1, 50, 100, 150); bg::divide_value(p1, 5); BOOST_CHECK(bg::get<0>(p1) == 10); BOOST_CHECK(bg::get<1>(p1) == 20); BOOST_CHECK(bg::get<2>(p1) == 30); P p2; - bg::assign(p2, 2, 4, 6); + bg::assign_values(p2, 2, 4, 6); bg::divide_point(p1, p2); BOOST_CHECK(bg::get<0>(p1) == 5); BOOST_CHECK(bg::get<1>(p1) == 5); @@ -103,7 +103,7 @@ void test_assign() { P p1; P p2; - bg::assign(p1, 12, 34, 56); + bg::assign_values(p1, 12, 34, 56); bg::assign_point(p2, p1); BOOST_CHECK(bg::get<0>(p2) == 12); BOOST_CHECK(bg::get<1>(p2) == 34); diff --git a/test/arithmetic/dot_product.cpp b/test/arithmetic/dot_product.cpp index 806b10424..777124ca2 100644 --- a/test/arithmetic/dot_product.cpp +++ b/test/arithmetic/dot_product.cpp @@ -30,9 +30,9 @@ template void test_all() { P p1; - bg::assign(p1, 1, 2, 3); + bg::assign_values(p1, 1, 2, 3); P p2; - bg::assign(p2, 4, 5, 6); + bg::assign_values(p2, 4, 5, 6); BOOST_CHECK(bg::dot_product(p1, p2) == 1*4 + 2*5 + 3*6); } diff --git a/test/geometries/boost_polygon.cpp b/test/geometries/boost_polygon.cpp index 95f72b3e5..b8c614b0e 100644 --- a/test/geometries/boost_polygon.cpp +++ b/test/geometries/boost_polygon.cpp @@ -77,8 +77,8 @@ void test_coordinate_type() boost::polygon::rectangle_data boost_polygon_box; bg::model::box boost_geometry_box; - bg::assign(boost_polygon_box, 0, 1, 5, 6); - bg::assign(boost_geometry_box, 0, 1, 5, 6); + bg::assign_values(boost_polygon_box, 0, 1, 5, 6); + bg::assign_values(boost_geometry_box, 0, 1, 5, 6); T boost_polygon_area = bg::area(boost_polygon_box); T boost_geometry_area = bg::area(boost_geometry_box); T boost_polygon_area_by_boost_polygon = boost::polygon::area(boost_polygon_box); diff --git a/test/geometries/box.cpp b/test/geometries/box.cpp index 17e89a9ba..44a9a012f 100644 --- a/test/geometries/box.cpp +++ b/test/geometries/box.cpp @@ -30,8 +30,8 @@ bg::model::box

create_box() { P p1; P p2; - bg::assign(p1, 1, 2, 5); - bg::assign(p2, 3, 4, 6); + bg::assign_values(p1, 1, 2, 5); + bg::assign_values(p2, 3, 4, 6); return bg::model::box

(p1, p2); } diff --git a/test/strategies/cross_track.cpp b/test/strategies/cross_track.cpp index ac43c1bb2..f53f6255b 100644 --- a/test/strategies/cross_track.cpp +++ b/test/strategies/cross_track.cpp @@ -60,9 +60,9 @@ void test_distance( Point p1, p2, p3; - bg::assign(p1, lon1, lat1); - bg::assign(p2, lon2, lat2); - bg::assign(p3, lon3, lat3); + bg::assign_values(p1, lon1, lat1); + bg::assign_values(p2, lon2, lat2); + bg::assign_values(p3, lon3, lat3); strategy_type strategy; diff --git a/test/strategies/haversine.cpp b/test/strategies/haversine.cpp index 432602cd8..3ad545878 100644 --- a/test/strategies/haversine.cpp +++ b/test/strategies/haversine.cpp @@ -60,8 +60,8 @@ struct test_distance haversine_type strategy(radius); Point p1, p2; - bg::assign(p1, lon1, lat1); - bg::assign(p2, lon2, lat2); + bg::assign_values(p1, lon1, lat1); + bg::assign_values(p2, lon2, lat2); return_type d = strategy.apply(p1, p2); BOOST_CHECK_CLOSE(d, expected, tolerance); @@ -102,10 +102,10 @@ void test_services() } P1 p1; - bg::assign(p1, 4, 52); + bg::assign_values(p1, 4, 52); P2 p2; - bg::assign(p2, 2, 48); + bg::assign_values(p2, 2, 48); // ~ Amsterdam/Paris, 467 kilometers double const km = 1000.0; @@ -177,8 +177,8 @@ void time_compare_s(int const n) { boost::timer t; P p1, p2; - bg::assign(p1, 1, 1); - bg::assign(p2, 2, 2); + bg::assign_values(p1, 1, 1); + bg::assign_values(p2, 2, 2); Strategy strategy; typename Strategy::return_type s = 0; for (int i = 0; i < n; i++) diff --git a/test/strategies/projected_point.cpp b/test/strategies/projected_point.cpp index 86fe16190..7ad1e91fb 100644 --- a/test/strategies/projected_point.cpp +++ b/test/strategies/projected_point.cpp @@ -36,11 +36,11 @@ template void test_services() { PS p1, p2; - bg::assign(p1, 0, 0); - bg::assign(p2, 0, 4); + bg::assign_values(p1, 0, 0); + bg::assign_values(p2, 0, 4); P p; - bg::assign(p, 2, 0); + bg::assign_values(p, 2, 0); CalculationType const sqr_expected = 4; CalculationType const expected = 2; diff --git a/test/strategies/pythagoras.cpp b/test/strategies/pythagoras.cpp index 2b022fdfa..204386422 100644 --- a/test/strategies/pythagoras.cpp +++ b/test/strategies/pythagoras.cpp @@ -45,9 +45,9 @@ template void test_null_distance_3d() { P1 p1; - bg::assign(p1, 1, 2, 3); + bg::assign_values(p1, 1, 2, 3); P2 p2; - bg::assign(p2, 1, 2, 3); + bg::assign_values(p2, 1, 2, 3); typedef bg::strategy::distance::pythagoras pythagoras_type; typedef typename bg::strategy::distance::services::return_type::type return_type; @@ -62,9 +62,9 @@ template void test_axis_3d() { P1 p1; - bg::assign(p1, 0, 0, 0); + bg::assign_values(p1, 0, 0, 0); P2 p2; - bg::assign(p2, 1, 0, 0); + bg::assign_values(p2, 1, 0, 0); typedef bg::strategy::distance::pythagoras pythagoras_type; typedef typename bg::strategy::distance::services::return_type::type return_type; @@ -74,11 +74,11 @@ void test_axis_3d() return_type result = pythagoras.apply(p1, p2); BOOST_CHECK_EQUAL(result, return_type(1)); - bg::assign(p2, 0, 1, 0); + bg::assign_values(p2, 0, 1, 0); result = pythagoras.apply(p1, p2); BOOST_CHECK_EQUAL(result, return_type(1)); - bg::assign(p2, 0, 0, 1); + bg::assign_values(p2, 0, 0, 1); result = pythagoras.apply(p1, p2); BOOST_CHECK_CLOSE(result, return_type(1), 0.001); } @@ -87,9 +87,9 @@ template void test_arbitrary_3d() { P1 p1; - bg::assign(p1, 1, 2, 3); + bg::assign_values(p1, 1, 2, 3); P2 p2; - bg::assign(p2, 9, 8, 7); + bg::assign_values(p2, 9, 8, 7); { typedef bg::strategy::distance::pythagoras strategy_type; @@ -125,10 +125,10 @@ void test_services() P1 p1; - bg::assign(p1, 1, 2, 3); + bg::assign_values(p1, 1, 2, 3); P2 p2; - bg::assign(p2, 4, 5, 6); + bg::assign_values(p2, 4, 5, 6); double const sqr_expected = 3*3 + 3*3 + 3*3; // 27 double const expected = sqrt(sqr_expected); // sqrt(27)=5.1961524227 @@ -201,8 +201,8 @@ void test_big_2d_with(AssignType const& x1, AssignType const& y1, point_type p1, p2; - bg::assign(p1, x1, y1); - bg::assign(p2, x2, y2); + bg::assign_values(p1, x1, y1); + bg::assign_values(p2, x2, y2); return_type d = pythagoras.apply(p1, p2); /*** @@ -258,8 +258,8 @@ void time_compare_s(int const n) { boost::timer t; P p1, p2; - bg::assign(p1, 1, 1); - bg::assign(p2, 2, 2); + bg::assign_values(p1, 1, 1); + bg::assign_values(p2, 2, 2); Strategy strategy; typename bg::strategy::distance::services::return_type::type s = 0; for (int i = 0; i < n; i++) diff --git a/test/strategies/segment_intersection.cpp b/test/strategies/segment_intersection.cpp index ddf096f0e..cbf40f278 100644 --- a/test/strategies/segment_intersection.cpp +++ b/test/strategies/segment_intersection.cpp @@ -93,10 +93,10 @@ static void test_segment_intersection(int caseno, typedef segment segment_type; P p1, p2, p3, p4; - bg::assign(p1, x1, y1); - bg::assign(p2, x2, y2); - bg::assign(p3, x3, y3); - bg::assign(p4, x4, y4); + bg::assign_values(p1, x1, y1); + bg::assign_values(p2, x2, y2); + bg::assign_values(p3, x3, y3); + bg::assign_values(p4, x4, y4); segment_type s12(p1,p2); segment_type s34(p3,p4); diff --git a/test/strategies/segment_intersection_collinear.cpp b/test/strategies/segment_intersection_collinear.cpp index e2bc08e18..3c02f39ad 100644 --- a/test/strategies/segment_intersection_collinear.cpp +++ b/test/strategies/segment_intersection_collinear.cpp @@ -67,10 +67,10 @@ static void test_segment_intersection(std::string const& case_id, typedef bg::segment segment_type; P p1, p2, p3, p4; - bg::assign(p1, x1, y1); - bg::assign(p2, x2, y2); - bg::assign(p3, x3, y3); - bg::assign(p4, x4, y4); + bg::assign_values(p1, x1, y1); + bg::assign_values(p2, x2, y2); + bg::assign_values(p3, x3, y3); + bg::assign_values(p4, x4, y4); segment_type s12(p1,p2); segment_type s34(p3,p4); diff --git a/test/strategies/side_by_cross_track.cpp b/test/strategies/side_by_cross_track.cpp index 68c8c2495..e02f3267d 100644 --- a/test/strategies/side_by_cross_track.cpp +++ b/test/strategies/side_by_cross_track.cpp @@ -29,9 +29,9 @@ void test_side(double lon1, double lat1, typedef bg::strategy::side::side_by_cross_track strategy; Point p1, p2, p3; - bg::assign(p1, lon1, lat1); - bg::assign(p2, lon2, lat2); - bg::assign(p3, lon3, lat3); + bg::assign_values(p1, lon1, lat1); + bg::assign_values(p2, lon2, lat2); + bg::assign_values(p3, lon3, lat3); int s = strategy::apply(p1, p2, p3); } diff --git a/test/strategies/transformer.cpp b/test/strategies/transformer.cpp index c8467817b..3826ce823 100644 --- a/test/strategies/transformer.cpp +++ b/test/strategies/transformer.cpp @@ -46,7 +46,7 @@ template void test_all() { P p; - bg::assign(p, 1, 1); + bg::assign_values(p, 1, 1); { bg::strategy::transform::translate_transformer trans(1, 1); diff --git a/test/util/for_each_coordinate.cpp b/test/util/for_each_coordinate.cpp index 3187d3de1..993c6a4d1 100644 --- a/test/util/for_each_coordinate.cpp +++ b/test/util/for_each_coordinate.cpp @@ -55,7 +55,7 @@ template void test_all() { P p; - bg::assign(p, 1, 2, 3); + bg::assign_values(p, 1, 2, 3); bg::for_each_coordinate(p, test_operation()); BOOST_CHECK(bg::get<0>(p) == 10); BOOST_CHECK(bg::get<1>(p) == 20); From de18eb88913768ca56f4e32b442ffd6c899c737e Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Tue, 12 Apr 2011 22:11:32 +0000 Subject: [PATCH 22/70] Updated examples (assign -> assign_values) [SVN r71220] --- example/01_point_example.cpp | 24 +++++++++---------- example/02_linestring_example.cpp | 4 ++-- example/03_polygon_example.cpp | 4 ++-- example/05_a_overlay_polygon_example.cpp | 4 ++-- ...5_b_overlay_linestring_polygon_example.cpp | 4 ++-- example/06_a_transformation_example.cpp | 2 +- example/c01_custom_point_example.cpp | 12 +++++----- .../x05_shapelib_example.cpp | 2 +- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/example/01_point_example.cpp b/example/01_point_example.cpp index ee5698de2..574831e46 100644 --- a/example/01_point_example.cpp +++ b/example/01_point_example.cpp @@ -53,13 +53,13 @@ int main() // All these types are handled the same way. We show here // assigning them and calculating distances. - assign(pt1, 1, 1); - assign(pt2, 2, 2); - assign(pt3, 3, 3); - assign(pt4, 4, 4); - assign(pt5, 5, 5); - assign(pt6, 6, 6); - assign(pt7, 7, 7); + assign_values(pt1, 1, 1); + assign_values(pt2, 2, 2); + assign_values(pt3, 3, 3); + assign_values(pt4, 4, 4); + assign_values(pt5, 5, 5); + assign_values(pt6, 6, 6); + assign_values(pt7, 7, 7); double d1 = distance(pt1, pt2); @@ -76,13 +76,13 @@ int main() // 1: default, empty constructor, causing no initialization at all model::d2::point_xy p1; - // 2: as shown above, assign + // 2: as shown above, assign_values model::d2::point_xy p2; - assign(p2, 1, 1); + assign_values(p2, 1, 1); // 3: using "set" function // set uses the concepts behind, such that it can be applied for - // every point-type (like assign) + // every point-type (like assign_values) model::d2::point_xy p3; set<0>(p3, 1); set<1>(p3, 1); @@ -118,8 +118,8 @@ int main() // There are 3-dimensional points too model::point d3a, d3b; - assign(d3a, 1, 2, 3); - assign(d3b, 4, 5, 6); + assign_values(d3a, 1, 2, 3); + assign_values(d3b, 4, 5, 6); d3 = distance(d3a, d3b); diff --git a/example/02_linestring_example.cpp b/example/02_linestring_example.cpp index 014aaa2a8..329993529 100644 --- a/example/02_linestring_example.cpp +++ b/example/02_linestring_example.cpp @@ -79,9 +79,9 @@ int main(void) // points can be created using "make" and added to a linestring using the std:: "push_back" ls.push_back(make(1.1, 1.1)); - // points can also be assigned using "assign" and added to a linestring using "append" + // points can also be assigned using "assign_values" and added to a linestring using "append" point_2d lp; - assign(lp, 2.5, 2.1); + assign_values(lp, 2.5, 2.1); append(ls, lp); // Lines can be streamed using DSV (delimiter separated values) diff --git a/example/03_polygon_example.cpp b/example/03_polygon_example.cpp index 0e36dd73d..780221a93 100644 --- a/example/03_polygon_example.cpp +++ b/example/03_polygon_example.cpp @@ -41,7 +41,7 @@ int main(void) {3.4, 2.0}, {4.1, 3.0}, {5.3, 2.6}, {5.4, 1.2}, {4.9, 0.8}, {2.9, 0.7}, {2.0, 1.3} // closing point is opening point }; - assign(poly, coor); + assign_points(poly, coor); } // Polygons should be closed, and directed clockwise. If you're not sure if that is the case, @@ -77,7 +77,7 @@ int main(void) model::ring& inner = poly.inners().back(); const double coor[][2] = { {4.0, 2.0}, {4.2, 1.4}, {4.8, 1.9}, {4.4, 2.2}, {4.0, 2.0} }; - assign(inner, coor); + assign_points(inner, coor); } correct(poly); diff --git a/example/05_a_overlay_polygon_example.cpp b/example/05_a_overlay_polygon_example.cpp index 9d74b8273..625b0f497 100644 --- a/example/05_a_overlay_polygon_example.cpp +++ b/example/05_a_overlay_polygon_example.cpp @@ -45,7 +45,7 @@ int main(void) const double c[][2] = { {160, 330}, {60, 260}, {20, 150}, {60, 40}, {190, 20}, {270, 130}, {260, 250}, {160, 330} }; - bg::assign(a, c); + bg::assign_points(a, c); } bg::correct(a); std::cout << "A: " << bg::dsv(a) << std::endl; @@ -55,7 +55,7 @@ int main(void) const double c[][2] = { {300, 330}, {190, 270}, {150, 170}, {150, 110}, {250, 30}, {380, 50}, {380, 250}, {300, 330} }; - bg::assign(b, c); + bg::assign_points(b, c); } bg::correct(b); std::cout << "B: " << bg::dsv(b) << std::endl; diff --git a/example/05_b_overlay_linestring_polygon_example.cpp b/example/05_b_overlay_linestring_polygon_example.cpp index 16eff548e..8e0dc7483 100644 --- a/example/05_b_overlay_linestring_polygon_example.cpp +++ b/example/05_b_overlay_linestring_polygon_example.cpp @@ -35,13 +35,13 @@ int main(void) bg::model::linestring ls; { const double c[][2] = { {0, 1}, {2, 5}, {5, 3} }; - bg::assign(ls, c); + bg::assign_points(ls, c); } bg::model::polygon p; { const double c[][2] = { {3, 0}, {0, 3}, {4, 5}, {3, 0} }; - bg::assign(p, c); + bg::assign_points(p, c); } bg::correct(p); diff --git a/example/06_a_transformation_example.cpp b/example/06_a_transformation_example.cpp index 2c13911e2..ef7d279d3 100644 --- a/example/06_a_transformation_example.cpp +++ b/example/06_a_transformation_example.cpp @@ -35,7 +35,7 @@ int main() const double coor[][2] = { {0, 0}, {0, 7}, {2, 2}, {2, 0}, {0, 0} }; // note that for this syntax you have to include the two // include files above (c_array_cartesian.hpp, std_as_linestring.hpp) - assign(poly, coor); + assign_points(poly, coor); //read_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly); transform(poly, poly2, translate); diff --git a/example/c01_custom_point_example.cpp b/example/c01_custom_point_example.cpp index 0534feb04..c6f3a6495 100644 --- a/example/c01_custom_point_example.cpp +++ b/example/c01_custom_point_example.cpp @@ -108,8 +108,8 @@ int main() my_array_point a1 = {{0}}; my_array_point a2 = {{0}}; - boost::geometry::assign(a1, 1, 2, 3); - boost::geometry::assign(a2, 3, 2, 1); + boost::geometry::assign_values(a1, 1, 2, 3); + boost::geometry::assign_values(a2, 3, 2, 1); std::cout << "color distance " << boost::geometry::dsv(a1) << " to " @@ -132,8 +132,8 @@ int main() my_class_rw crw1; my_class_rw crw2; - boost::geometry::assign(crw1, 1, 2); - boost::geometry::assign(crw2, 3, 4); + boost::geometry::assign_values(crw1, 1, 2); + boost::geometry::assign_values(crw2, 3, 4); std::cout << "class r/w distance " << boost::geometry::dsv(crw1) << " to " << boost::geometry::dsv(crw2) << " is " @@ -141,8 +141,8 @@ int main() my_class_gs cgs1; my_class_gs cgs2; - boost::geometry::assign(cgs1, 1, 2); - boost::geometry::assign(cgs2, 3, 4); + boost::geometry::assign_values(cgs1, 1, 2); + boost::geometry::assign_values(cgs2, 3, 4); std::cout << "class g/s distance " << boost::geometry::dsv(crw1) << " to " << boost::geometry::dsv(crw2) << " is " diff --git a/example/with_external_libs/x05_shapelib_example.cpp b/example/with_external_libs/x05_shapelib_example.cpp index c096c9b8b..a136240e1 100644 --- a/example/with_external_libs/x05_shapelib_example.cpp +++ b/example/with_external_libs/x05_shapelib_example.cpp @@ -73,7 +73,7 @@ void convert(SHPObject* psShape, T& polygon) for (int v = 0; v < psShape->nVertices; v++) { typename point_type::type point; - assign(point, x[v], y[v]); + assign_values(point, x[v], y[v]); append(polygon, point); } } From 9ac4cc29f30a234df67a3cd7f9890c8694d671de Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 15 Apr 2011 20:55:00 +0000 Subject: [PATCH 23/70] Moved make with range to detail, otherwise inconsistent with renaming of assign.hpp [SVN r71298] --- include/boost/geometry/algorithms/assign.hpp | 1 - include/boost/geometry/algorithms/make.hpp | 64 +++++++++++--------- 2 files changed, 36 insertions(+), 29 deletions(-) diff --git a/include/boost/geometry/algorithms/assign.hpp b/include/boost/geometry/algorithms/assign.hpp index 859e50ab9..f5cc0591c 100644 --- a/include/boost/geometry/algorithms/assign.hpp +++ b/include/boost/geometry/algorithms/assign.hpp @@ -61,7 +61,6 @@ namespace boost { namespace geometry [assign_with_range] [assign_with_range_output] [heading See also] -\* [link geometry.reference.algorithms.make.make_1_with_a_range make] \* [link geometry.reference.algorithms.append.append append] } */ diff --git a/include/boost/geometry/algorithms/make.hpp b/include/boost/geometry/algorithms/make.hpp index 06b962b1a..8693f5dcf 100644 --- a/include/boost/geometry/algorithms/make.hpp +++ b/include/boost/geometry/algorithms/make.hpp @@ -21,6 +21,40 @@ namespace boost { namespace geometry { +#ifndef DOXYGEN_NO_DETAIL +namespace detail { namespace make +{ + +/*! +\brief Construct a geometry +\ingroup make +\tparam Geometry \tparam_geometry +\tparam Range \tparam_range_point +\param range \param_range_point +\return The constructed geometry, here: a linestring or a ring + +\qbk{distinguish, with a range} +\qbk{ +[heading Example] +[make_with_range] [make_with_range_output] + +[heading See also] +\* [link geometry.reference.algorithms.assign.assign_points assign] +} + */ +template +inline Geometry make_points(Range const& range) +{ + concept::check(); + + Geometry geometry; + geometry::append(geometry, range); + return geometry; +} + +}} // namespace detail::make +#endif // DOXYGEN_NO_DETAIL + /*! \brief Construct a geometry \ingroup make @@ -38,7 +72,7 @@ namespace boost { namespace geometry [make_2d_point] [make_2d_point_output] [heading See also] -\* [link geometry.reference.algorithms.assign.assign_3_2_coordinate_values assign] +\* [link geometry.reference.algorithms.assign.assign_values_3_2_coordinate_values assign] } */ template @@ -72,7 +106,7 @@ inline Geometry make(Type const& c1, Type const& c2) [make_3d_point] [make_3d_point_output] [heading See also] -\* [link geometry.reference.algorithms.assign.assign_4_3_coordinate_values assign] +\* [link geometry.reference.algorithms.assign.assign_values_4_3_coordinate_values assign] } */ template @@ -107,32 +141,6 @@ inline Geometry make(Type const& c1, Type const& c2, Type const& c3, Type const& -/*! -\brief Construct a geometry -\ingroup make -\tparam Geometry \tparam_geometry -\tparam Range \tparam_range_point -\param range \param_range_point -\return The constructed geometry, here: a linestring or a ring - -\qbk{distinguish, with a range} -\qbk{ -[heading Example] -[make_with_range] [make_with_range_output] - -[heading See also] -\* [link geometry.reference.algorithms.assign.assign_2_with_a_range assign] -} - */ -template -inline Geometry make(Range const& range) -{ - concept::check(); - - Geometry geometry; - append(geometry, range); - return geometry; -} /*! From 7f1b59fa64ed20a67bfd6b5b6f18b23db9625dca Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 15 Apr 2011 20:57:08 +0000 Subject: [PATCH 24/70] Small doc update/fix [SVN r71299] --- doc/reference.qbk | 4 ++-- doc/reference/algorithms/append.qbk | 2 +- test/algorithms/make.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/reference.qbk b/doc/reference.qbk index a64061fb1..27f7f0134 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -52,9 +52,9 @@ [section:assign assign] [include generated/assign.qbk] [endsect] -[section:append append] +[/section:append append] [include generated/append.qbk] -[endsect] +[/endsect] [section:buffer buffer] diff --git a/doc/reference/algorithms/append.qbk b/doc/reference/algorithms/append.qbk index 51bd98273..1663ed65e 100644 --- a/doc/reference/algorithms/append.qbk +++ b/doc/reference/algorithms/append.qbk @@ -30,4 +30,4 @@ Linear [append_output] [heading See also] -* [link geometry.reference.algorithms.assign.assign_2_with_a_range assign] +* [link geometry.reference.algorithms.assign.assign_points assign] diff --git a/test/algorithms/make.cpp b/test/algorithms/make.cpp index 58a26c43f..65b63fe9e 100644 --- a/test/algorithms/make.cpp +++ b/test/algorithms/make.cpp @@ -62,7 +62,7 @@ void test_linestring_2d() T coors[][2] = {{1,2}, {3,4}}; - L line = bg::make(coors); + L line = bg::detail::make::make_points(coors); BOOST_CHECK_EQUAL(line.size(), 2u); } @@ -74,7 +74,7 @@ void test_linestring_3d() T coors[][3] = {{1,2,3}, {4,5,6}}; - L line = bg::make(coors); + L line = bg::detail::make::make_points(coors); BOOST_CHECK_EQUAL(line.size(), 2u); //std::cout << dsv(line) << std::endl; From 964f231e9bbae5aeaf58d43200da43865be2df3a Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 11:27:59 +0000 Subject: [PATCH 25/70] Reverted (manually) the move of convert to detail. It will stay. Reversed arguments of assign (phase 1, therefore temporarily called "assign_rev" to avoid left occurances) [SVN r71307] --- doc/src/examples/algorithms/Jamfile.v2 | 6 +++--- .../{assign_with_range.cpp => assign_points.cpp} | 4 ++-- test/algorithms/algorithms_tests.sln | 6 ++++++ test/algorithms/assign.cpp | 8 ++++---- test/algorithms/{detail => }/convert.cpp | 10 +++++----- test/algorithms/{detail => }/convert.vcproj | 8 ++++---- test/algorithms/detail/detail.sln | 6 ------ 7 files changed, 24 insertions(+), 24 deletions(-) rename doc/src/examples/algorithms/{assign_with_range.cpp => assign_points.cpp} (97%) rename test/algorithms/{detail => }/convert.cpp (93%) rename test/algorithms/{detail => }/convert.vcproj (92%) diff --git a/doc/src/examples/algorithms/Jamfile.v2 b/doc/src/examples/algorithms/Jamfile.v2 index 9731ce0f8..f50d32c1c 100644 --- a/doc/src/examples/algorithms/Jamfile.v2 +++ b/doc/src/examples/algorithms/Jamfile.v2 @@ -23,9 +23,9 @@ exe assign_2d_point : assign_2d_point.cpp ; exe assign_3d_point : assign_3d_point.cpp ; exe assign_inverse : assign_inverse.cpp ; exe assign_with_range : assign_with_range.cpp ; -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 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 centroid : centroid.cpp ; exe clear : clear.cpp ; diff --git a/doc/src/examples/algorithms/assign_with_range.cpp b/doc/src/examples/algorithms/assign_points.cpp similarity index 97% rename from doc/src/examples/algorithms/assign_with_range.cpp rename to doc/src/examples/algorithms/assign_points.cpp index 771ef233f..c74775963 100644 --- a/doc/src/examples/algorithms/assign_with_range.cpp +++ b/doc/src/examples/algorithms/assign_points.cpp @@ -7,7 +7,7 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -//[assign_with_range +//[assign_points //` Shows usage of Boost.Geometry's assign, Boost.Assign, and Boost.Range to assign ranges of a linestring #include @@ -59,7 +59,7 @@ int main() //] -//[assign_with_range_output +//[assign_points_output /*` Output: [pre diff --git a/test/algorithms/algorithms_tests.sln b/test/algorithms/algorithms_tests.sln index f929e0ba5..6880312aa 100644 --- a/test/algorithms/algorithms_tests.sln +++ b/test/algorithms/algorithms_tests.sln @@ -54,6 +54,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reverse", "reverse.vcproj", EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "comparable_distance", "comparable_distance.vcproj", "{F11970B5-BE16-4FF5-9780-4C15082B76A0}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "convert", "convert.vcproj", "{FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -168,6 +170,10 @@ Global {F11970B5-BE16-4FF5-9780-4C15082B76A0}.Debug|Win32.Build.0 = Debug|Win32 {F11970B5-BE16-4FF5-9780-4C15082B76A0}.Release|Win32.ActiveCfg = Release|Win32 {F11970B5-BE16-4FF5-9780-4C15082B76A0}.Release|Win32.Build.0 = Release|Win32 + {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Debug|Win32.ActiveCfg = Debug|Win32 + {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Debug|Win32.Build.0 = Debug|Win32 + {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Release|Win32.ActiveCfg = Release|Win32 + {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/test/algorithms/assign.cpp b/test/algorithms/assign.cpp index be7cc2d70..eef613c81 100644 --- a/test/algorithms/assign.cpp +++ b/test/algorithms/assign.cpp @@ -143,7 +143,7 @@ void test_assign_conversion() bg::assign_values(p, 1, 2); box_type b; - bg::assign(p, b); + bg::assign(b, p); BOOST_CHECK_CLOSE((bg::get<0, 0>(b)), 1.0, 0.001); BOOST_CHECK_CLOSE((bg::get<0, 1>(b)), 2.0, 0.001); @@ -157,7 +157,7 @@ void test_assign_conversion() bg::set(b, 4); ring_type ring; - bg::assign(b, ring); + bg::assign(ring, b); //std::cout << bg::wkt(b) << std::endl; //std::cout << bg::wkt(ring) << std::endl; @@ -183,10 +183,10 @@ void test_assign_conversion() polygon_type polygon; - bg::assign(ring, polygon); + bg::assign(polygon, ring); BOOST_CHECK_EQUAL(bg::num_points(polygon), 5u); - bg::assign(polygon, ring); + bg::assign_rev(ring, polygon); BOOST_CHECK_EQUAL(bg::num_points(ring), 5u); } diff --git a/test/algorithms/detail/convert.cpp b/test/algorithms/convert.cpp similarity index 93% rename from test/algorithms/detail/convert.cpp rename to test/algorithms/convert.cpp index fb1e704f3..185aceb11 100644 --- a/test/algorithms/detail/convert.cpp +++ b/test/algorithms/convert.cpp @@ -16,7 +16,7 @@ #include -#include +#include #include #include @@ -35,7 +35,7 @@ void test_all() bg::assign_values(p, 1, 2); box_type b; - bg::detail::convert(p, b); + bg::convert(p, b); BOOST_CHECK_CLOSE((bg::get<0, 0>(b)), 1.0, 0.001); BOOST_CHECK_CLOSE((bg::get<0, 1>(b)), 2.0, 0.001); @@ -59,7 +59,7 @@ void test_std() bg::set(b, 4); ring_type ring; - bg::detail::convert(b, ring); + bg::convert(b, ring); //std::cout << bg::wkt(b) << std::endl; //std::cout << bg::wkt(ring) << std::endl; @@ -85,10 +85,10 @@ void test_std() polygon_type polygon; - bg::detail::convert(ring, polygon); + bg::convert(ring, polygon); BOOST_CHECK_EQUAL(bg::num_points(polygon), 5u); - bg::detail::convert(polygon, ring); + bg::convert(polygon, ring); BOOST_CHECK_EQUAL(bg::num_points(ring), 5u); } diff --git a/test/algorithms/detail/convert.vcproj b/test/algorithms/convert.vcproj similarity index 92% rename from test/algorithms/detail/convert.vcproj rename to test/algorithms/convert.vcproj index b3a11404f..c75bf0ee5 100644 --- a/test/algorithms/detail/convert.vcproj +++ b/test/algorithms/convert.vcproj @@ -20,7 +20,7 @@ OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)\convert" ConfigurationType="1" - InheritedPropertySheets="..\..\boost.vsprops;..\..\ttmath.vsprops" + InheritedPropertySheets="..\boost.vsprops;..\ttmath.vsprops" CharacterSet="1" > @@ -114,7 +114,7 @@ /> Date: Sat, 16 Apr 2011 11:29:26 +0000 Subject: [PATCH 26/70] Added omitted _rev [SVN r71308] --- test/algorithms/assign.cpp | 6 +- test/algorithms/detail/partition.cpp | 258 ++++++++++++++++++++++++++- 2 files changed, 258 insertions(+), 6 deletions(-) diff --git a/test/algorithms/assign.cpp b/test/algorithms/assign.cpp index eef613c81..87bf76f30 100644 --- a/test/algorithms/assign.cpp +++ b/test/algorithms/assign.cpp @@ -143,7 +143,7 @@ void test_assign_conversion() bg::assign_values(p, 1, 2); box_type b; - bg::assign(b, p); + bg::assign_rev(b, p); BOOST_CHECK_CLOSE((bg::get<0, 0>(b)), 1.0, 0.001); BOOST_CHECK_CLOSE((bg::get<0, 1>(b)), 2.0, 0.001); @@ -157,7 +157,7 @@ void test_assign_conversion() bg::set(b, 4); ring_type ring; - bg::assign(ring, b); + bg::assign_rev(ring, b); //std::cout << bg::wkt(b) << std::endl; //std::cout << bg::wkt(ring) << std::endl; @@ -183,7 +183,7 @@ void test_assign_conversion() polygon_type polygon; - bg::assign(polygon, ring); + bg::assign_rev(polygon, ring); BOOST_CHECK_EQUAL(bg::num_points(polygon), 5u); bg::assign_rev(ring, polygon); diff --git a/test/algorithms/detail/partition.cpp b/test/algorithms/detail/partition.cpp index 37eb4ae34..5e9a4173e 100644 --- a/test/algorithms/detail/partition.cpp +++ b/test/algorithms/detail/partition.cpp @@ -9,18 +9,24 @@ #include -#include #include #include #include -#include -#include #include #include +#if defined(TEST_WITH_SVG) +# include +#endif + +#include +#include +#include +#include + template struct box_item @@ -214,6 +220,237 @@ void test_all() } +//------------------- higher volumes + +template +struct svg_visitor +{ + SvgMapper& m_mapper; + + svg_visitor(SvgMapper& mapper) + : m_mapper(mapper) + {} + + template + inline void apply(Box const& box, int level) + { + /* + std::string color("rgb(64,64,64)"); + switch(level) + { + case 0 : color = "rgb(255,0,0)"; break; + case 1 : color = "rgb(0,255,0)"; break; + case 2 : color = "rgb(0,0,255)"; break; + case 3 : color = "rgb(255,255,0)"; break; + case 4 : color = "rgb(255,0,255)"; break; + case 5 : color = "rgb(0,255,255)"; break; + case 6 : color = "rgb(255,128,0)"; break; + case 7 : color = "rgb(0,128,255)"; break; + } + std::ostringstream style; + style << "fill:none;stroke-width:" << (5.0 - level / 2.0) << ";stroke:" << color << ";"; + m_mapper.map(box, style.str()); + */ + m_mapper.map(box, "fill:none;stroke-width:2;stroke:rgb(0,0,0);"); + + } +}; + + + + +template +void fill_points(Collection& collection, int seed, int size, int count) +{ + typedef boost::minstd_rand base_generator_type; + + base_generator_type generator(seed); + + boost::uniform_int<> random_coordinate(0, size - 1); + boost::variate_generator > + coordinate_generator(generator, random_coordinate); + + std::set > included; + + int n = 0; + for (int i = 0; n < count && i < count*count; i++) + { + int x = coordinate_generator(); + int y = coordinate_generator(); + std::pair pair = std::make_pair(x, y); + if (included.find(pair) == included.end()) + { + included.insert(pair); + typename boost::range_value::type item; + item.x = x; + item.y = y; + collection.push_back(item); + n++; + } + } +} + +void test_many_points(int seed, int size, int count) +{ + bg::model::multi_point mp1, mp2; + + fill_points(mp1, seed, size, count); + fill_points(mp2, seed * 2, size, count); + + // Test equality in quadratic loop + int expected_count = 0; + BOOST_FOREACH(point_item const& item1, mp1) + { + BOOST_FOREACH(point_item const& item2, mp2) + { + if (bg::equals(item1, item2)) + { + expected_count++; + } + } + } + +#if defined(TEST_WITH_SVG) + std::ostringstream filename; + filename << "partition" << seed << ".svg"; + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper mapper(svg, 800, 800); + + { + point_item p; + p.x = -1; p.y = -1; mapper.add(p); + p.x = size + 1; p.y = size + 1; mapper.add(p); + } + + typedef svg_visitor > box_visitor_type; + box_visitor_type box_visitor(mapper); +#else + typedef visit_no_policy box_visitor_type; + visit_no_policy box_visitor; +#endif + + point_visitor visitor; + bg::partition + < + bg::model::box, get_point, ovelaps_point, + box_visitor_type + >::apply(mp1, mp2, visitor, 2, box_visitor); + + BOOST_CHECK_EQUAL(visitor.count, expected_count); + +#if defined(TEST_WITH_SVG) + BOOST_FOREACH(point_item const& item, mp1) + { + mapper.map(item, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1", 8); + } + BOOST_FOREACH(point_item const& item, mp2) + { + mapper.map(item, "fill:rgb(0,128,255);stroke:rgb(0,0,100);stroke-width:1", 4); + } +#endif +} + +template +void fill_boxes(Collection& collection, int seed, int size, int count) +{ + typedef boost::minstd_rand base_generator_type; + + base_generator_type generator(seed); + + boost::uniform_int<> random_coordinate(0, size * 10 - 1); + boost::variate_generator > + coordinate_generator(generator, random_coordinate); + + int n = 0; + for (int i = 0; n < count && i < count*count; i++) + { + int w = coordinate_generator() % 30; + int h = coordinate_generator() % 30; + if (w > 0 && h > 0) + { + int x = coordinate_generator(); + int y = coordinate_generator(); + if (x + w < size * 10 && y + h < size * 10) + { + typename boost::range_value::type item(n+1); + bg::assign_values(item.box, x / 10.0, y / 10.0, (x + w) / 10.0, (y + h) / 10.0); + collection.push_back(item); + n++; + } + } + } +} + + + +void test_many_boxes(int seed, int size, int count) +{ + typedef bg::model::box box_type; + std::vector > boxes; + + fill_boxes(boxes, seed, size, count); + + // Test equality in quadratic loop + int expected_count = 0; + double expected_area = 0.0; + BOOST_FOREACH(box_item const& item1, boxes) + { + BOOST_FOREACH(box_item const& item2, boxes) + { + if (item1.id < item2.id) + { + if (bg::intersects(item1.box, item2.box)) + { + box_type b; + bg::intersection(item1.box, item2.box, b); + expected_area += bg::area(b); + expected_count++; + } + } + } + } + + +#if defined(TEST_WITH_SVG) + std::ostringstream filename; + filename << "partition_box_" << seed << ".svg"; + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper mapper(svg, 800, 800); + + { + point_item p; + p.x = -1; p.y = -1; mapper.add(p); + p.x = size + 1; p.y = size + 1; mapper.add(p); + } + + BOOST_FOREACH(box_item const& item, boxes) + { + mapper.map(item.box, "opacity:0.6;fill:rgb(50,50,210);stroke:rgb(0,0,0);stroke-width:1"); + } + + typedef svg_visitor > partition_visitor_type; + partition_visitor_type partition_visitor(mapper); +#else + typedef visit_no_policy box_visitor_type; + visit_no_policy partition_visitor; +#endif + + + box_visitor visitor; + bg::partition + < + box_type, get_box, ovelaps_box, + partition_visitor_type + >::apply(boxes, visitor, 2, partition_visitor); + + BOOST_CHECK_EQUAL(visitor.count, expected_count); + BOOST_CHECK_CLOSE(visitor.area, expected_area, 0.001); + +} + + @@ -221,5 +458,20 @@ int test_main( int , char* [] ) { test_all >(); + test_many_points(12345, 20, 40); + test_many_points(54321, 20, 60); + test_many_points(67890, 20, 80); + test_many_points(98765, 20, 100); + for (int i = 1; i < 10; i++) + { + test_many_points(i, 30, i * 20); + } + + test_many_boxes(12345, 20, 40); + for (int i = 1; i < 10; i++) + { + test_many_boxes(i, 20, i * 10); + } + return 0; } From 726e26b9711611aee96d6a37c27343d04f83cd12 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 11:31:53 +0000 Subject: [PATCH 27/70] Moved assign-variants to detail, reverted (manually) move of convert to detail [SVN r71309] --- include/boost/geometry/algorithms/assign.hpp | 36 +++++++++---------- .../boost/geometry/algorithms/centroid.hpp | 6 ++-- .../algorithms/{detail => }/convert.hpp | 7 ---- .../detail/equals/collect_vectors.hpp | 2 +- .../detail/overlay/clip_linestring.hpp | 6 ++-- .../detail/overlay/convert_ring.hpp | 8 ++--- .../detail/overlay/copy_segment_point.hpp | 4 +-- .../overlay/get_intersection_points.hpp | 4 +-- .../detail/overlay/get_turn_info.hpp | 14 ++++---- .../detail/overlay/intersection_insert.hpp | 6 ++-- .../detail/sections/sectionalize.hpp | 4 ++- .../boost/geometry/algorithms/distance.hpp | 8 ++--- include/boost/geometry/algorithms/length.hpp | 4 +-- .../boost/geometry/algorithms/simplify.hpp | 4 +-- .../boost/geometry/algorithms/transform.hpp | 8 ++--- .../geometry/domains/gis/io/wkt/read_wkt.hpp | 8 ++--- .../geometry/domains/gis/io/wkt/write_wkt.hpp | 8 ++--- .../extensions/algorithms/dissolve.hpp | 4 +-- .../project_inverse_transformer.hpp | 2 +- .../gis/projections/project_transformer.hpp | 2 +- .../extensions/nsphere/geometries/nsphere.hpp | 4 +-- .../strategies/buffer_join_round.hpp | 6 ++-- include/boost/geometry/geometries/box.hpp | 6 ++-- .../boost/geometry/iterators/box_iterator.hpp | 4 +-- .../iterators/segment_range_iterator.hpp | 4 +-- .../cartesian/distance_projected_point.hpp | 8 ++--- .../strategies/strategy_transform.hpp | 4 +-- 27 files changed, 87 insertions(+), 94 deletions(-) rename include/boost/geometry/algorithms/{detail => }/convert.hpp (98%) diff --git a/include/boost/geometry/algorithms/assign.hpp b/include/boost/geometry/algorithms/assign.hpp index f5cc0591c..6d34e4591 100644 --- a/include/boost/geometry/algorithms/assign.hpp +++ b/include/boost/geometry/algorithms/assign.hpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include @@ -53,12 +53,11 @@ namespace boost { namespace geometry \param geometry \param_geometry \param range \param_range_point -\qbk{distinguish, with a range} \qbk{ [heading Notes] [note Assign automatically clears the geometry before assigning (use append if you don't want that)] [heading Example] -[assign_with_range] [assign_with_range_output] +[assign_points] [assign_points_output] [heading See also] \* [link geometry.reference.algorithms.append.append append] @@ -124,6 +123,12 @@ inline void assign_zero(Geometry& geometry) } +#ifndef DOXYGEN_NO_DETAIL +namespace detail +{ +// Note: this is moved to namespace detail because the names and parameter orders +// are not yet 100% clear. + /*! \brief Assign the four points of a 2D box \ingroup assign @@ -231,12 +236,9 @@ inline void assign_point_from_index(Geometry const& geometry, Point& point) >::apply(geometry, point); } +} // namespace detail +#endif // DOXYGEN_NO_DETAIL -}} // namespace boost::geometry - - -namespace boost { namespace geometry -{ /*! \brief Assigns one geometry to another geometry @@ -245,24 +247,22 @@ if it is possible and applicable. \ingroup assign \tparam Geometry1 \tparam_geometry \tparam Geometry2 \tparam_geometry -\param geometry1 \param_geometry (source) -\param geometry2 \param_geometry (target) -\note It is moved to namespace detail because it overlaps functionality - of assign. So assign will be changed such that it also can convert. +\param geometry1 \param_geometry (target) +\param geometry2 \param_geometry (source) */ template -inline void assign(Geometry1 const& geometry1, Geometry2& geometry2) +inline void assign_rev(Geometry1& geometry1, Geometry2 const& geometry2) { - concept::check_concepts_and_equal_dimensions(); + concept::check_concepts_and_equal_dimensions(); dispatch::convert < - typename tag::type, typename tag::type, + typename tag::type, dimension::type::value, - Geometry1, - Geometry2 - >::apply(geometry1, geometry2); + Geometry2, + Geometry1 + >::apply(geometry2, geometry1); } diff --git a/include/boost/geometry/algorithms/centroid.hpp b/include/boost/geometry/algorithms/centroid.hpp index 9b51ba07d..a400e2e0b 100644 --- a/include/boost/geometry/algorithms/centroid.hpp +++ b/include/boost/geometry/algorithms/centroid.hpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include @@ -83,7 +83,7 @@ struct centroid_point static inline void apply(Point const& point, PointCentroid& centroid, Strategy const&) { - geometry::detail::convert(point, centroid); + geometry::convert(point, centroid); } }; @@ -163,7 +163,7 @@ inline bool range_ok(Range const& range, Point& centroid) else // if (n == 1) { // Take over the first point in a "coordinate neutral way" - geometry::detail::convert(*boost::begin(range), centroid); + geometry::convert(*boost::begin(range), centroid); return false; } return true; diff --git a/include/boost/geometry/algorithms/detail/convert.hpp b/include/boost/geometry/algorithms/convert.hpp similarity index 98% rename from include/boost/geometry/algorithms/detail/convert.hpp rename to include/boost/geometry/algorithms/convert.hpp index 999330304..6c39ec763 100644 --- a/include/boost/geometry/algorithms/detail/convert.hpp +++ b/include/boost/geometry/algorithms/convert.hpp @@ -235,10 +235,6 @@ struct convert #endif // DOXYGEN_NO_DISPATCH -#ifndef DOXYGEN_NO_DETAIL -namespace detail -{ - /*! \brief Converts one geometry to another geometry \details The convert algorithm converts one geometry, e.g. a BOX, to another geometry, e.g. a RING. This only @@ -266,9 +262,6 @@ inline void convert(Geometry1 const& geometry1, Geometry2& geometry2) >::apply(geometry1, geometry2); } -} -#endif // DOXYGEN_NO_DETAIL - }} // namespace boost::geometry diff --git a/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp b/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp index 4c67dfe27..f38c50eff 100644 --- a/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp +++ b/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp @@ -162,7 +162,7 @@ struct box_collect_vectors { typename point_type::type lower_left, lower_right, upper_left, upper_right; - assign_box_corners(box, lower_left, lower_right, + geometry::detail::assign_box_corners(box, lower_left, lower_right, upper_left, upper_right); typedef typename boost::range_value::type item; diff --git a/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp b/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp index b5bbab84c..6e8a7f6c3 100644 --- a/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include @@ -181,8 +181,8 @@ OutputIterator clip_range_with_box(Box const& b, Range const& range, ++previous, ++vertex) { point_type p1, p2; - geometry::detail::convert(*previous, p1); - geometry::detail::convert(*vertex, p2); + geometry::convert(*previous, p1); + geometry::convert(*vertex, p2); // Clip the segment. Five situations: // 1. Segment is invisible, finish line if any (shouldn't occur) diff --git a/include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp b/include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp index 433908061..d81826f51 100644 --- a/include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/convert_ring.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include namespace boost { namespace geometry @@ -50,7 +50,7 @@ struct convert_ring { if (! append) { - geometry::detail::convert(source, destination); + geometry::convert(source, destination); if (reverse) { boost::reverse(destination); @@ -69,7 +69,7 @@ struct convert_ring { if (! append) { - geometry::detail::convert(source, exterior_ring(destination)); + geometry::convert(source, exterior_ring(destination)); if (reverse) { boost::reverse(exterior_ring(destination)); @@ -79,7 +79,7 @@ struct convert_ring { interior_rings(destination).resize( interior_rings(destination).size() + 1); - geometry::detail::convert(source, interior_rings(destination).back()); + geometry::convert(source, interior_rings(destination).back()); if (reverse) { boost::reverse(interior_rings(destination).back()); diff --git a/include/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp b/include/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp index 927cefb51..ead786280 100644 --- a/include/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include @@ -71,7 +71,7 @@ struct copy_segment_point_range rview_type view(cview); - geometry::detail::convert(*(boost::begin(view) + index), point); + geometry::convert(*(boost::begin(view) + index), point); return true; } }; diff --git a/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp b/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp index da7695e91..4a0fdc952 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp @@ -12,7 +12,7 @@ #include -#include +#include #include @@ -64,7 +64,7 @@ struct get_turn_without_info { TurnInfo tp; - geometry::detail::convert(result.template get<0>().intersections[i], tp.point); + geometry::convert(result.template get<0>().intersections[i], tp.point); *out++ = tp; } diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp index 74abdca0d..783a63bb1 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include @@ -94,7 +94,7 @@ struct touch_interior : public base_turn_handler DirInfo const& dir_info) { ti.method = method_touch_interior; - geometry::detail::convert(intersection_info.intersections[0], ti.point); + geometry::convert(intersection_info.intersections[0], ti.point); // Both segments of q touch segment p somewhere in its interior // 1) We know: if q comes from LEFT or RIGHT @@ -213,7 +213,7 @@ struct touch : public base_turn_handler DirInfo const& dir_info) { ti.method = method_touch; - geometry::detail::convert(intersection_info.intersections[0], ti.point); + geometry::convert(intersection_info.intersections[0], ti.point); int const side_qi_p1 = dir_info.sides.template get<1, 0>(); int const side_qk_p1 = SideStrategy::apply(pi, pj, qk); @@ -404,7 +404,7 @@ struct equal : public base_turn_handler { ti.method = method_equal; // Copy the SECOND intersection point - geometry::detail::convert(intersection_info.intersections[1], ti.point); + geometry::convert(intersection_info.intersections[1], ti.point); int const side_pk_q2 = SideStrategy::apply(qj, qk, pk); int const side_pk_p = SideStrategy::apply(pi, pj, pk); @@ -486,7 +486,7 @@ struct collinear : public base_turn_handler DirInfo const& dir_info) { ti.method = method_collinear; - geometry::detail::convert(intersection_info.intersections[1], ti.point); + geometry::convert(intersection_info.intersections[1], ti.point); int const arrival = dir_info.arrival[0]; // Should not be 0, this is checked before @@ -585,7 +585,7 @@ private : // If P arrives within Q, set info on P (which is done above, index=0), // this turn-info belongs to the second intersection point, index=1 // (see e.g. figure CLO1) - geometry::detail::convert(intersection_info.intersections[1 - Index], tp.point); + geometry::convert(intersection_info.intersections[1 - Index], tp.point); return true; } @@ -661,7 +661,7 @@ struct crosses : public base_turn_handler DirInfo const& dir_info) { ti.method = method_crosses; - geometry::detail::convert(intersection_info.intersections[0], ti.point); + geometry::convert(intersection_info.intersections[0], ti.point); // In all casees: // If Q crosses P from left to right diff --git a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp index 222e84fbc..75d240bc2 100644 --- a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -65,7 +65,7 @@ struct intersection_segment_segment_point for (std::size_t i = 0; i < is.count; i++) { PointOut p; - geometry::detail::convert(is.intersections[i], p); + geometry::convert(is.intersections[i], p); *out++ = p; } return out; @@ -95,7 +95,7 @@ struct intersection_linestring_linestring_point it = boost::begin(turns); it != boost::end(turns); ++it) { PointOut p; - geometry::detail::convert(it->point, p); + geometry::convert(it->point, p); *out++ = p; } return out; diff --git a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp index 775e8582e..52cf15866 100644 --- a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp +++ b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp @@ -461,8 +461,10 @@ struct sectionalize_box // (or polygon would be a helper-type). // Therefore we mimic a linestring/std::vector of 5 points + // TODO: might be replaced by assign_box_corners_oriented + // or just "convert" point_type ll, lr, ul, ur; - assign_box_corners(box, ll, lr, ul, ur); + geometry::detail::assign_box_corners(box, ll, lr, ul, ur); std::vector points; points.push_back(ll); diff --git a/include/boost/geometry/algorithms/distance.hpp b/include/boost/geometry/algorithms/distance.hpp index 9371772b0..c28d4a6c0 100644 --- a/include/boost/geometry/algorithms/distance.hpp +++ b/include/boost/geometry/algorithms/distance.hpp @@ -78,8 +78,8 @@ struct point_to_segment >::type segment_strategy; typename point_type::type p[2]; - geometry::assign_point_from_index<0>(segment, p[0]); - geometry::assign_point_from_index<1>(segment, p[1]); + geometry::detail::assign_point_from_index<0>(segment, p[0]); + geometry::detail::assign_point_from_index<1>(segment, p[1]); return segment_strategy.apply(point, p[0], p[1]); } }; @@ -419,8 +419,8 @@ struct distance { typename point_type::type p[2]; - geometry::assign_point_from_index<0>(segment, p[0]); - geometry::assign_point_from_index<1>(segment, p[1]); + geometry::detail::assign_point_from_index<0>(segment, p[0]); + geometry::detail::assign_point_from_index<1>(segment, p[1]); return strategy.apply(point, p[0], p[1]); } }; diff --git a/include/boost/geometry/algorithms/length.hpp b/include/boost/geometry/algorithms/length.hpp index 434ea865f..d01a1110d 100644 --- a/include/boost/geometry/algorithms/length.hpp +++ b/include/boost/geometry/algorithms/length.hpp @@ -50,8 +50,8 @@ struct segment_length { typedef typename point_type::type point_type; point_type p1, p2; - assign_point_from_index<0>(segment, p1); - assign_point_from_index<1>(segment, p2); + geometry::detail::assign_point_from_index<0>(segment, p1); + geometry::detail::assign_point_from_index<1>(segment, p2); return strategy.apply(p1, p2); } }; diff --git a/include/boost/geometry/algorithms/simplify.hpp b/include/boost/geometry/algorithms/simplify.hpp index 21ba86432..e6a75cc77 100644 --- a/include/boost/geometry/algorithms/simplify.hpp +++ b/include/boost/geometry/algorithms/simplify.hpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include @@ -181,7 +181,7 @@ struct simplify static inline void apply(Point const& point, Point& out, Distance const& max_distance, Strategy const& strategy) { - geometry::detail::convert(point, out); + geometry::convert(point, out); } }; diff --git a/include/boost/geometry/algorithms/transform.hpp b/include/boost/geometry/algorithms/transform.hpp index c5c8e985e..eaec16e32 100644 --- a/include/boost/geometry/algorithms/transform.hpp +++ b/include/boost/geometry/algorithms/transform.hpp @@ -101,15 +101,15 @@ struct transform_box_or_segment typedef typename point_type::type point_type2; point_type1 source_point[2]; - assign_point_from_index<0>(source, source_point[0]); - assign_point_from_index<1>(source, source_point[1]); + geometry::detail::assign_point_from_index<0>(source, source_point[0]); + geometry::detail::assign_point_from_index<1>(source, source_point[1]); point_type2 target_point[2]; if (strategy.apply(source_point[0], target_point[0]) && strategy.apply(source_point[1], target_point[1])) { - assign_point_to_index<0>(target_point[0], target); - assign_point_to_index<1>(target_point[1], target); + geometry::detail::assign_point_to_index<0>(target_point[0], target); + geometry::detail::assign_point_to_index<1>(target_point[1], target); return true; } return false; diff --git a/include/boost/geometry/domains/gis/io/wkt/read_wkt.hpp b/include/boost/geometry/domains/gis/io/wkt/read_wkt.hpp index 8b70c1a65..bc534a211 100644 --- a/include/boost/geometry/domains/gis/io/wkt/read_wkt.hpp +++ b/include/boost/geometry/domains/gis/io/wkt/read_wkt.hpp @@ -531,8 +531,8 @@ struct box_parser throw read_wkt_exception("Box should have 2,4 or 5 points", wkt); } - assign_point_to_index(points.front(), box); - assign_point_to_index(points[index], box); + geometry::detail::assign_point_to_index(points.front(), box); + geometry::detail::assign_point_to_index(points[index], box); } }; @@ -570,8 +570,8 @@ struct segment_parser if (boost::size(points) == 2) { - assign_point_to_index<0>(points.front(), segment); - assign_point_to_index<1>(points.back(), segment); + geometry::detail::assign_point_to_index<0>(points.front(), segment); + geometry::detail::assign_point_to_index<1>(points.back(), segment); } else { diff --git a/include/boost/geometry/domains/gis/io/wkt/write_wkt.hpp b/include/boost/geometry/domains/gis/io/wkt/write_wkt.hpp index fcf168aa7..7bf52c13c 100644 --- a/include/boost/geometry/domains/gis/io/wkt/write_wkt.hpp +++ b/include/boost/geometry/domains/gis/io/wkt/write_wkt.hpp @@ -24,7 +24,7 @@ #include -#include +#include #include #include #include @@ -199,7 +199,7 @@ struct wkt_box // Convert to ring, then stream typedef model::ring ring_type; ring_type ring; - geometry::detail::convert(box, ring); + geometry::convert(box, ring); os << "POLYGON("; wkt_sequence::apply(os, ring); os << ")"; @@ -228,8 +228,8 @@ struct wkt_segment typedef boost::array sequence; sequence points; - assign_point_from_index<0>(segment, points[0]); - assign_point_from_index<1>(segment, points[1]); + geometry::detail::assign_point_from_index<0>(segment, points[0]); + geometry::detail::assign_point_from_index<1>(segment, points[1]); // In Boost.Geometry a segment is represented // in WKT-format like (for 2D): LINESTRING(x y,x y) diff --git a/include/boost/geometry/extensions/algorithms/dissolve.hpp b/include/boost/geometry/extensions/algorithms/dissolve.hpp index f5aec42ff..d796b5c38 100644 --- a/include/boost/geometry/extensions/algorithms/dissolve.hpp +++ b/include/boost/geometry/extensions/algorithms/dissolve.hpp @@ -33,7 +33,7 @@ #include #include -#include +#include #include @@ -134,7 +134,7 @@ struct dissolve_ring_or_polygon else { GeometryOut g; - geometry::detail::convert(geometry, g); + geometry::convert(geometry, g); *out++ = g; return out; } diff --git a/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp b/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp index e2df255f3..697fb68c9 100644 --- a/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp +++ b/include/boost/geometry/extensions/gis/projections/project_inverse_transformer.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/include/boost/geometry/extensions/gis/projections/project_transformer.hpp b/include/boost/geometry/extensions/gis/projections/project_transformer.hpp index 8f02acd78..96f915cad 100644 --- a/include/boost/geometry/extensions/gis/projections/project_transformer.hpp +++ b/include/boost/geometry/extensions/gis/projections/project_transformer.hpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/include/boost/geometry/extensions/nsphere/geometries/nsphere.hpp b/include/boost/geometry/extensions/nsphere/geometries/nsphere.hpp index 506d1fa71..0966b5ff3 100644 --- a/include/boost/geometry/extensions/nsphere/geometries/nsphere.hpp +++ b/include/boost/geometry/extensions/nsphere/geometries/nsphere.hpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include @@ -63,7 +63,7 @@ public: nsphere(P const& center, T const& radius) : m_radius(radius) { - geometry::detail::convert(center, m_center); + geometry::convert(center, m_center); } inline P const& center() const { return m_center; } diff --git a/include/boost/geometry/extensions/strategies/buffer_join_round.hpp b/include/boost/geometry/extensions/strategies/buffer_join_round.hpp index 5b173b101..fb45d92a4 100644 --- a/include/boost/geometry/extensions/strategies/buffer_join_round.hpp +++ b/include/boost/geometry/extensions/strategies/buffer_join_round.hpp @@ -16,7 +16,7 @@ -#include +#include #include #include #include @@ -51,7 +51,7 @@ struct join_round2 static inline Vector create_vector(Point1 const& p1, Point2 const& p2) { Vector v; - geometry::detail::convert(p1, v); + geometry::convert(p1, v); subtract_point(v, p2); return v; } @@ -111,7 +111,7 @@ struct join_round2 PointOut projected_point; multiply_value(v, b); - geometry::detail::convert(vertex, projected_point); + geometry::convert(vertex, projected_point); add_point(projected_point, v); coordinate_type projected_distance = geometry::distance(projected_point, mid_point); diff --git a/include/boost/geometry/geometries/box.hpp b/include/boost/geometry/geometries/box.hpp index 6537f1298..a42e72c91 100644 --- a/include/boost/geometry/geometries/box.hpp +++ b/include/boost/geometry/geometries/box.hpp @@ -18,7 +18,7 @@ #include -#include +#include #include @@ -57,8 +57,8 @@ public: */ inline box(Point const& min_corner, Point const& max_corner) { - geometry::detail::convert(min_corner, m_min_corner); - geometry::detail::convert(max_corner, m_max_corner); + geometry::convert(min_corner, m_min_corner); + geometry::convert(max_corner, m_max_corner); } inline Point const& min_corner() const { return m_min_corner; } diff --git a/include/boost/geometry/iterators/box_iterator.hpp b/include/boost/geometry/iterators/box_iterator.hpp index d9fa8fae8..735e90db3 100644 --- a/include/boost/geometry/iterators/box_iterator.hpp +++ b/include/boost/geometry/iterators/box_iterator.hpp @@ -95,9 +95,7 @@ private: inline void init(Box const& box) { - // asb -> lower_left, lower_right, upper_left, upper_right - // we want: clockwise - assign_box_corners(box, m_points[0], m_points[3], m_points[1], m_points[2]); + detail::assign_box_corners_oriented(box, m_points); } // Copy points here - box might define them otherwise diff --git a/include/boost/geometry/iterators/segment_range_iterator.hpp b/include/boost/geometry/iterators/segment_range_iterator.hpp index 0eaa7300a..55c1f5046 100644 --- a/include/boost/geometry/iterators/segment_range_iterator.hpp +++ b/include/boost/geometry/iterators/segment_range_iterator.hpp @@ -115,8 +115,8 @@ private: inline void init(Segment const& segment) { - assign_point_from_index<0>(segment, m_points[0]); - assign_point_from_index<1>(segment, m_points[1]); + geometry::detail::assign_point_from_index<0>(segment, m_points[0]); + geometry::detail::assign_point_from_index<1>(segment, m_points[1]); } // We HAVE TO copy the points, because a segment does not need diff --git a/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp b/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp index d0293c4b6..52eb4bd69 100644 --- a/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -132,8 +132,8 @@ public : // For consistency we define w also in FP fp_vector_type v, w; - geometry::detail::convert(p2, v); - geometry::detail::convert(p, w); + geometry::convert(p2, v); + geometry::convert(p, w); subtract_point(v, p1); subtract_point(w, p1); @@ -163,7 +163,7 @@ public : >::apply(strategy); fp_point_type projected; - geometry::detail::convert(p1, projected); + geometry::convert(p1, projected); multiply_value(v, b); add_point(projected, v); diff --git a/include/boost/geometry/strategies/strategy_transform.hpp b/include/boost/geometry/strategies/strategy_transform.hpp index 3961ee276..35c6a4526 100644 --- a/include/boost/geometry/strategies/strategy_transform.hpp +++ b/include/boost/geometry/strategies/strategy_transform.hpp @@ -20,7 +20,7 @@ #include -#include +#include #include #include #include @@ -104,7 +104,7 @@ struct copy_per_coordinate // Defensive check, dimensions are equal, selected by specialization assert_dimension_equal(); - geometry::detail::convert(p1, p2); + geometry::convert(p1, p2); return true; } }; From a3c4ae751a316020033624715d1d98df38aa7285 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 11:32:52 +0000 Subject: [PATCH 28/70] Updated jam [SVN r71310] --- test/algorithms/Jamfile.v2 | 1 + 1 file changed, 1 insertion(+) diff --git a/test/algorithms/Jamfile.v2 b/test/algorithms/Jamfile.v2 index daf06b6d4..7058f6753 100644 --- a/test/algorithms/Jamfile.v2 +++ b/test/algorithms/Jamfile.v2 @@ -18,6 +18,7 @@ test-suite boost-geometry-algorithms [ run comparable_distance.cpp ] [ run convex_hull.cpp ] [ run correct.cpp ] + [ run convert.cpp ] [ run difference.cpp ] [ run disjoint.cpp ] [ run distance.cpp ] From ab1f3473bd0e6aeb304565773c4f931bcd612e70 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 11:55:43 +0000 Subject: [PATCH 29/70] Removed convert from jamfile [SVN r71312] --- test/algorithms/detail/Jamfile.v2 | 1 - 1 file changed, 1 deletion(-) diff --git a/test/algorithms/detail/Jamfile.v2 b/test/algorithms/detail/Jamfile.v2 index 70eadd997..e34d4986c 100644 --- a/test/algorithms/detail/Jamfile.v2 +++ b/test/algorithms/detail/Jamfile.v2 @@ -10,7 +10,6 @@ test-suite boost-geometry-algorithms-detail : - [ run convert.cpp ] [ run partition.cpp ] ; From 140e86d76d6d09deef7ef9968e2fc298c699b458 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 12:09:34 +0000 Subject: [PATCH 30/70] Fixed partition.cpp test for no-svg [SVN r71314] --- test/algorithms/detail/partition.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/algorithms/detail/partition.cpp b/test/algorithms/detail/partition.cpp index 5e9a4173e..11c689943 100644 --- a/test/algorithms/detail/partition.cpp +++ b/test/algorithms/detail/partition.cpp @@ -326,8 +326,8 @@ void test_many_points(int seed, int size, int count) typedef svg_visitor > box_visitor_type; box_visitor_type box_visitor(mapper); #else - typedef visit_no_policy box_visitor_type; - visit_no_policy box_visitor; + typedef bg::visit_no_policy box_visitor_type; + box_visitor_type box_visitor; #endif point_visitor visitor; @@ -432,10 +432,6 @@ void test_many_boxes(int seed, int size, int count) typedef svg_visitor > partition_visitor_type; partition_visitor_type partition_visitor(mapper); -#else - typedef visit_no_policy box_visitor_type; - visit_no_policy partition_visitor; -#endif box_visitor visitor; @@ -448,6 +444,7 @@ void test_many_boxes(int seed, int size, int count) BOOST_CHECK_EQUAL(visitor.count, expected_count); BOOST_CHECK_CLOSE(visitor.area, expected_area, 0.001); +#endif } From 48e1ef719d9af666dd333a6634072e35b884ebb0 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 12:19:41 +0000 Subject: [PATCH 31/70] Removed obsolete files [SVN r71316] --- test/compile_test.cpp | 220 ------- test/compile_test.sln | 29 - test/compile_test.vcproj | 300 --------- test/ggl_headers.sln | 20 - test/ggl_headers.vcproj | 1339 -------------------------------------- 5 files changed, 1908 deletions(-) delete mode 100644 test/compile_test.cpp delete mode 100644 test/compile_test.sln delete mode 100644 test/compile_test.vcproj delete mode 100644 test/ggl_headers.sln delete mode 100644 test/ggl_headers.vcproj diff --git a/test/compile_test.cpp b/test/compile_test.cpp deleted file mode 100644 index 31d02020e..000000000 --- a/test/compile_test.cpp +++ /dev/null @@ -1,220 +0,0 @@ -// TODO: OLD! - -// Boost.Geometry (aka GGL, Generic Geometry Library) -// -// Copyright (c) 2007-2011 Barend Gehrels, 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) - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -template -struct modifying_functor -{ - double sum; - modifying_functor() : sum(0) - {} - inline void operator()(P& p) - { - p.x(1); - } - - inline void operator()(bg::segment

& s) - { - s.first.x(1); - } -}; - -template -struct const_functor -{ - double sum; - const_functor() : sum(0) - {} - inline void operator()(P const& p) - { - sum += p.x(); - } - - inline void operator()(bg::segment

const& s) - { - sum += s.first.x() - s.second.x(); - } -}; - -template class V> -void check_linestring() -{ - typedef bg::model::d2::point_xy P; - typedef bg::model::linestring line_type; - line_type line; - line.push_back(P(0,0)); - line.push_back(P(1,1)); - - typedef bg::multi_linestring multi_line_type; - multi_line_type multi; - multi.push_back(line); - - double len = bg::length(line); - len = bg::length(multi); - double d = bg::distance(P(0,1), line); - //d = bg::distance(P(0,1), multi); not defined yet! - - line_type simp; - bg::simplify(line, simp, 3); - multi_line_type simpm; - bg::simplify(multi, simpm, 3); - - typedef bg::model::box

box_type; - box_type box1; - bg::envelope(line, box1); - box_type box2; - bg::envelope(multi, box2); - - // FIXME: Where is output stream op for line/multi --mloskot - //std::stringstream out; - // out << line << std::endl; - //out << multi << std::endl; - - // For each, const - /* TODO: Fix for_each/functor - const_functor

cf; - std::for_each(line.begin(), line.end(), cf); - - const line_type& cl = line; - const multi_line_type& cm = multi; - - bg::for_each_point(cl, cf); - bg::for_each_point(cm, cf); - bg::for_each_segment(cl, cf); - bg::for_each_segment(cm, cf); - - // For each, modifying - modifying_functor

mf; - line_type& ml = line; - multi_line_type& mm = multi; - std::for_each(line.begin(), line.end(), mf); - bg::for_each_point(ml, mf); - bg::for_each_point(mm, mf); - bg::for_each_segment(ml, mf); - bg::for_each_segment(mm, mf); - */ - -} - -template -< - typename T, - template class VP, - template class VR -> -void check_polygon() -{ - typedef bg::model::d2::point_xy P; - typedef bg::model::polygon Y; - Y poly; - poly.outer().push_back(P(0,0)); - poly.outer().push_back(P(2,0)); - poly.outer().push_back(P(2,2)); - poly.outer().push_back(P(0,2)); - - bg::correct(poly); - - // multi - typedef bg::multi_polygon MY; - MY multi; - multi.push_back(poly); - - double a = bg::area(poly); - a = bg::area(multi); - - //double d = bg::distance(P(0,1), poly); - - Y simp; - bg::simplify(poly, simp, 3); - MY msimp; - bg::simplify(multi, msimp, 3); - - typedef bg::model::box

box_type; - box_type box1; - bg::envelope(poly, box1); - box_type box2; - bg::envelope(multi, box2); - - P ctr; - bg::centroid(poly, ctr); - - // within - bg::model::d2::point_xy circ_centre(10,10); - - bool w = bg::within(P(1, 1), poly); - //w = bg::within(poly, b); tbd - w = bg::within(P(1, 1), multi); - - //bg::circle circ(circ_centre, 10); - //w = bg::within(poly, circ); - //w = bg::within(multi, circ); - //w = bg::within(multi, b); tbd - - // For each, const - /* TODO: Fix for_each/functor - const_functor

cf; - std::for_each(poly.outer().begin(), poly.outer().end(), cf); - - const Y& cp = poly; - const MY& cm = multi; - - bg::for_each_point(cp, cf); - bg::for_each_point(cm, cf); - bg::for_each_segment(cp, cf); - bg::for_each_segment(cm, cf); - - // For each, modifying - modifying_functor

mf; - Y& mp = poly; - MY& mm = multi; - std::for_each(poly.outer().begin(), poly.outer().end(), mf); - bg::for_each_point(mp, mf); - bg::for_each_point(mm, mf); - bg::for_each_segment(mp, mf); - bg::for_each_segment(mm, mf); - */ -} - - -int main() -{ - check_linestring(); - check_linestring(); - check_linestring(); - check_linestring(); - - //check_linestring(); - check_linestring(); - - check_polygon(); - check_polygon(); - check_polygon(); - check_polygon(); - - //check_polygon(); - check_polygon(); - //check_polygon(); - check_polygon(); - - return 0; -} - diff --git a/test/compile_test.sln b/test/compile_test.sln deleted file mode 100644 index 761a5e982..000000000 --- a/test/compile_test.sln +++ /dev/null @@ -1,29 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compile_test", "compile_test.vcproj", "{618D4B05-A06E-443B-87C0-94964CEA7164}" - ProjectSection(ProjectDependencies) = postProject - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A} = {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ggl_headers", "ggl_headers.vcproj", "{B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {618D4B05-A06E-443B-87C0-94964CEA7164}.Debug|Win32.ActiveCfg = Debug|Win32 - {618D4B05-A06E-443B-87C0-94964CEA7164}.Debug|Win32.Build.0 = Debug|Win32 - {618D4B05-A06E-443B-87C0-94964CEA7164}.Release|Win32.ActiveCfg = Release|Win32 - {618D4B05-A06E-443B-87C0-94964CEA7164}.Release|Win32.Build.0 = Release|Win32 - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Debug|Win32.ActiveCfg = Debug|Win32 - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Debug|Win32.Build.0 = Debug|Win32 - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Release|Win32.ActiveCfg = Release|Win32 - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/compile_test.vcproj b/test/compile_test.vcproj deleted file mode 100644 index 9686952a2..000000000 --- a/test/compile_test.vcproj +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/ggl_headers.sln b/test/ggl_headers.sln deleted file mode 100644 index efd7ebbc3..000000000 --- a/test/ggl_headers.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ggl_headers", "ggl_headers.vcproj", "{B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Debug|Win32.ActiveCfg = Debug|Win32 - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Debug|Win32.Build.0 = Debug|Win32 - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Release|Win32.ActiveCfg = Release|Win32 - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/ggl_headers.vcproj b/test/ggl_headers.vcproj deleted file mode 100644 index a13b94483..000000000 --- a/test/ggl_headers.vcproj +++ /dev/null @@ -1,1339 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 914608d19c0f10a59fd19c94804f1ed41ea03649 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 12:20:48 +0000 Subject: [PATCH 32/70] Corrected Jamfile for assign/convert [SVN r71317] --- doc/src/examples/algorithms/Jamfile.v2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/examples/algorithms/Jamfile.v2 b/doc/src/examples/algorithms/Jamfile.v2 index f50d32c1c..318fa7381 100644 --- a/doc/src/examples/algorithms/Jamfile.v2 +++ b/doc/src/examples/algorithms/Jamfile.v2 @@ -22,7 +22,7 @@ exe assign : assign.cpp ; exe assign_2d_point : assign_2d_point.cpp ; exe assign_3d_point : assign_3d_point.cpp ; exe assign_inverse : assign_inverse.cpp ; -exe assign_with_range : assign_with_range.cpp ; +exe assign_points : assign_points.cpp ; # 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 ; @@ -54,7 +54,7 @@ exe length_with_strategy : length_with_strategy.cpp ; exe make_2d_point : make_2d_point.cpp ; exe make_3d_point : make_3d_point.cpp ; exe make_inverse : make_inverse.cpp ; -exe make_with_range : make_with_range.cpp ; +# exe make_with_range : make_with_range.cpp ; exe num_geometries : num_geometries.cpp ; exe num_interior_rings : num_interior_rings.cpp ; From e0bf400266db60e8707911ecfee11d7dfcd2f72d Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 12:23:50 +0000 Subject: [PATCH 33/70] Doc fixes [SVN r71318] --- doc/imports.qbk | 5 +---- doc/quickref.xml | 3 --- doc/src/examples/algorithms/assign.cpp | 4 ++-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/doc/imports.qbk b/doc/imports.qbk index 4e318c20b..fd414886d 100644 --- a/doc/imports.qbk +++ b/doc/imports.qbk @@ -17,11 +17,8 @@ [import src/examples/algorithms/append.cpp] [import src/examples/algorithms/assign_2d_point.cpp] [import src/examples/algorithms/assign_3d_point.cpp] -[import src/examples/algorithms/assign_box_corners.cpp] [import src/examples/algorithms/assign_inverse.cpp] -[import src/examples/algorithms/assign_with_range.cpp] -[import src/examples/algorithms/assign_point_to_index.cpp] -[import src/examples/algorithms/assign_point_from_index.cpp] +[import src/examples/algorithms/assign_points.cpp] [import src/examples/algorithms/clear.cpp] [import src/examples/algorithms/centroid.cpp] [import src/examples/algorithms/comparable_distance.cpp] diff --git a/doc/quickref.xml b/doc/quickref.xml index 464817358..0ccd00af9 100644 --- a/doc/quickref.xml +++ b/doc/quickref.xml @@ -299,10 +299,7 @@ Assign assign - assign_box_corners assign_inverse - assign_point_from_index - assign_point_to_index assign_zero diff --git a/doc/src/examples/algorithms/assign.cpp b/doc/src/examples/algorithms/assign.cpp index d7871680c..8cf845b60 100644 --- a/doc/src/examples/algorithms/assign.cpp +++ b/doc/src/examples/algorithms/assign.cpp @@ -28,11 +28,11 @@ int main() // Assign a box to a polygon (conversion box->poly) polygon p; - boost::geometry::assign(b, p); + boost::geometry::assign_rev(p, b); // Assign a point to another point type (conversion of point-type) boost::tuple p2; - boost::geometry::assign(p1, p2); + boost::geometry::assign_rev(p2, p1); using boost::geometry::dsv; From 6cd0509ac0ddf191d75b21f40b52efccf172e811 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 12:24:09 +0000 Subject: [PATCH 34/70] Small doc fix [SVN r71319] --- include/boost/geometry/algorithms/assign.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/geometry/algorithms/assign.hpp b/include/boost/geometry/algorithms/assign.hpp index 6d34e4591..fe8db07ea 100644 --- a/include/boost/geometry/algorithms/assign.hpp +++ b/include/boost/geometry/algorithms/assign.hpp @@ -60,7 +60,7 @@ namespace boost { namespace geometry [assign_points] [assign_points_output] [heading See also] -\* [link geometry.reference.algorithms.append.append append] +\* [link geometry.reference.algorithms.append append] } */ template From 8c71260a06054d2900cde2975b1a80e3a02750e7 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 12:26:20 +0000 Subject: [PATCH 35/70] Removed obsolete solution [SVN r71320] --- test/custom_tests.sln | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 test/custom_tests.sln diff --git a/test/custom_tests.sln b/test/custom_tests.sln deleted file mode 100644 index b9262d093..000000000 --- a/test/custom_tests.sln +++ /dev/null @@ -1,37 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_well_formed_point", "point_concept\well_formed_point.vcproj", "{B63710DE-960E-4C00-B79A-7C8F80D6BC15}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_well_formed_point_traits", "point_concept\well_formed_point_traits.vcproj", "{4F767915-5FC0-4BEB-8948-F371896BBD59}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_array_point", "point_concept\array_point.vcproj", "{436E02F5-A4E6-40F8-8E41-57560875D67F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_point_with_incorrect_coord_count", "point_concept\point_with_incorrect_coord_count.vcproj", "{B696EDCA-4602-4962-8A1C-043B3F44B978}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B63710DE-960E-4C00-B79A-7C8F80D6BC15}.Debug|Win32.ActiveCfg = Debug|Win32 - {B63710DE-960E-4C00-B79A-7C8F80D6BC15}.Debug|Win32.Build.0 = Debug|Win32 - {B63710DE-960E-4C00-B79A-7C8F80D6BC15}.Release|Win32.ActiveCfg = Release|Win32 - {B63710DE-960E-4C00-B79A-7C8F80D6BC15}.Release|Win32.Build.0 = Release|Win32 - {4F767915-5FC0-4BEB-8948-F371896BBD59}.Debug|Win32.ActiveCfg = Debug|Win32 - {4F767915-5FC0-4BEB-8948-F371896BBD59}.Debug|Win32.Build.0 = Debug|Win32 - {4F767915-5FC0-4BEB-8948-F371896BBD59}.Release|Win32.ActiveCfg = Release|Win32 - {4F767915-5FC0-4BEB-8948-F371896BBD59}.Release|Win32.Build.0 = Release|Win32 - {436E02F5-A4E6-40F8-8E41-57560875D67F}.Debug|Win32.ActiveCfg = Debug|Win32 - {436E02F5-A4E6-40F8-8E41-57560875D67F}.Debug|Win32.Build.0 = Debug|Win32 - {436E02F5-A4E6-40F8-8E41-57560875D67F}.Release|Win32.ActiveCfg = Release|Win32 - {436E02F5-A4E6-40F8-8E41-57560875D67F}.Release|Win32.Build.0 = Release|Win32 - {B696EDCA-4602-4962-8A1C-043B3F44B978}.Debug|Win32.ActiveCfg = Debug|Win32 - {B696EDCA-4602-4962-8A1C-043B3F44B978}.Debug|Win32.Build.0 = Debug|Win32 - {B696EDCA-4602-4962-8A1C-043B3F44B978}.Release|Win32.ActiveCfg = Release|Win32 - {B696EDCA-4602-4962-8A1C-043B3F44B978}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal From 5580e6b62296d2a2bd2f259acd283a76a311d952 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 13:16:26 +0000 Subject: [PATCH 36/70] Added/updated doc/examples for assign/convert/convex_hull [SVN r71321] --- include/boost/geometry/algorithms/assign.hpp | 10 +++++++++- include/boost/geometry/algorithms/convert.hpp | 4 ++-- include/boost/geometry/algorithms/convex_hull.hpp | 6 +++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/boost/geometry/algorithms/assign.hpp b/include/boost/geometry/algorithms/assign.hpp index fe8db07ea..df5cd663d 100644 --- a/include/boost/geometry/algorithms/assign.hpp +++ b/include/boost/geometry/algorithms/assign.hpp @@ -249,9 +249,17 @@ if it is possible and applicable. \tparam Geometry2 \tparam_geometry \param geometry1 \param_geometry (target) \param geometry2 \param_geometry (source) + +\qbk{ +[heading Example] +[assign] [assign_output] + +[heading See also] +\* [link geometry.reference.algorithms.convert convert] +} */ template -inline void assign_rev(Geometry1& geometry1, Geometry2 const& geometry2) +inline void assign(Geometry1& geometry1, Geometry2 const& geometry2) { concept::check_concepts_and_equal_dimensions(); diff --git a/include/boost/geometry/algorithms/convert.hpp b/include/boost/geometry/algorithms/convert.hpp index 6c39ec763..b90e008c1 100644 --- a/include/boost/geometry/algorithms/convert.hpp +++ b/include/boost/geometry/algorithms/convert.hpp @@ -244,8 +244,8 @@ if it is possible and applicable. \tparam Geometry2 \tparam_geometry \param geometry1 \param_geometry (source) \param geometry2 \param_geometry (target) -\note It is moved to namespace detail because it overlaps functionality - of assign. + +\qbk{[include reference/algorithms/convert.qbk]} */ template inline void convert(Geometry1 const& geometry1, Geometry2& geometry2) diff --git a/include/boost/geometry/algorithms/convex_hull.hpp b/include/boost/geometry/algorithms/convex_hull.hpp index bde0f6fbd..32ed84b3e 100644 --- a/include/boost/geometry/algorithms/convex_hull.hpp +++ b/include/boost/geometry/algorithms/convex_hull.hpp @@ -152,8 +152,10 @@ inline void convex_hull(Geometry1 const& geometry, \details \details_calc{convex_hull,convex hull}. \tparam Geometry1 \tparam_geometry \tparam Geometry2 \tparam_geometry -\param geometry \param_geometry, used for input +\param geometry \param_geometry, input geometry \param hull \param_geometry \param_set{convex hull} + +\qbk{[include reference/algorithms/convex_hull.qbk]} */ template inline void convex_hull(Geometry1 const& geometry, @@ -241,8 +243,6 @@ inline OutputIterator convex_hull_insert(Geometry const& geometry, #endif // DOXYGEN_NO_DETAIL - - }} // namespace boost::geometry From 1e70d25b60c82849595e9ccab122848621718c78 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 13:17:50 +0000 Subject: [PATCH 37/70] Added/updated doc/examples for assign/convert/convex_hull [SVN r71322] --- doc/html/img/algorithms/convex_hull.png | Bin 0 -> 19017 bytes doc/imports.qbk | 3 + doc/quickref.xml | 13 ++++- doc/reference.qbk | 1 + doc/reference/algorithms/convert.qbk | 27 +++++++++ doc/reference/algorithms/convex_hull.qbk | 18 ++++++ doc/reference/algorithms/equals.qbk | 21 +++++++ doc/src/examples/algorithms/Jamfile.v2 | 2 + doc/src/examples/algorithms/assign.cpp | 16 +++--- doc/src/examples/algorithms/convert.cpp | 59 ++++++++++++++++++++ doc/src/examples/algorithms/convex_hull.cpp | 54 ++++++++++++++++++ test/algorithms/assign.cpp | 11 ++-- 12 files changed, 211 insertions(+), 14 deletions(-) create mode 100644 doc/html/img/algorithms/convex_hull.png create mode 100644 doc/reference/algorithms/convert.qbk create mode 100644 doc/reference/algorithms/convex_hull.qbk create mode 100644 doc/reference/algorithms/equals.qbk create mode 100644 doc/src/examples/algorithms/convert.cpp create mode 100644 doc/src/examples/algorithms/convex_hull.cpp diff --git a/doc/html/img/algorithms/convex_hull.png b/doc/html/img/algorithms/convex_hull.png new file mode 100644 index 0000000000000000000000000000000000000000..77f3213aa95f7214f6de5ef3b05abcac7b922ee1 GIT binary patch literal 19017 zcmeAS@N?(olHy`uVBq!ia0y~yV4Tdrz$nDQ#=yW}@xeldfq{Xg*vT`5gM)*kh9jke zfq{Xuz$3Dlfr0lr2s1iq%&uTyV2~_vjVKAuPb(=;EJ|f4FE7{2%*!rLPAo{(%P&fw z{mw>;fkA=6)5S5QV$Pep<#X#H}937dj9=*y4miVDUs^$rcNDKQf|JQF1{x1ScmhID(4V}e#U-*3xUg% zg;%N`e#y`xu=nt$tLa|ZJ66ZrUU}A_?bU65re|(y%ko)Elw9s;NY3P#sMMszZXq3! zAKNP(G5NC3#Zc{xF0DOL57{D2`O2n!6x<*Y@h0Ah^Md>h2Z!~AI&~ATsLbS;$kmi3 z^C5eI$b+Xlca-y{sBK8Qr?##4)_I+!Cs&_qURwOYC02x~$A+QU?D8Yt;Hfvgrm7!$ z&+#JO@`t&gr`NKbEgro8-E=0Jq#16gH+3%OT_RQSac}3A8;>KO_dUuwt01$xPQzg5 znn^bU#b=(4J2h+X6xWzPFLr(pof&5H^7~8vIloSKJW)RB(s3n#OQ2}-wfq~F+s)3sCotVTCdEBA!Rje5T!gUze0FzHx2B*?2dZgpwn^6@NLh zwkBB^s2U%+@vvPYdOmOO%qJ&JswnB{YapQE37qz+N z_8<2B+NynOf7@LdhIj1eGJdbuKDEJr&rx2kB9pX_b-xvUBB-iL z4|;REvrZ_N;-TTMZZsKjHz}t^% zQyF#U7nXdi+gQ(8-N-p(|KlvCPl;2`fD&{@(<+wFjnM+TpXW0DTGux{Vp|b&KGWyM z&>6-GoT*8c%4s=|ZI+(w-*KX@*y@eGn)m_fHt+CD5f?mib3Xplec(5f%{y*Wnv%<- zoio3=Fd0l;P*l3=%kNkprIjpkuTDSMm3_IOELZl>;=ijk*PLCrQE_%!QulY})id7l zPQLs`b@@&2ncAmbTz&i@XY*D4)Q@(So<@R7AK$z$`Tel3^T?*Fkq5pTJolK#=2R;Y z-QRN8<=gatn-AC79+-Da=H7>votCRk^zJ&@wd3TPbC1&=q@51C{b^RkzgOiNx*05I zLgu+TT(|rXE^t@nq)W$<&o;}t-s?PYWvVK?%{*;wQKP%T{@te=_xiC^EXyj&tf{rC zpSNl9%Xb>{YL}XXicIK^+#_#XDITBu)gjeR_nv`x_Key5^UJLAE}BLf3m(#RT-qSr zpluLcC9k$X+W(u#>9Ft2+mrS^wC7mzNdLoy&DRSnBSlklyT32wsiHpu2lVfvkzIr^v~JSZ8$KJSfT>o}nf8BkN);K zKDn`N*YWq4SI_CQjXh~HUBHi1i+hIb?oj4C9uDDiUId*E(@$D<*evnflqI^XF~6<0 z?^-0{dN(DrV7(-BG&}Q#vr8*q3Fl9WjB-}nAYIYWVD~2F%u5G1H7ASb_Kp4waSt|5 zR+&_PP-W7#c}khS%_PL*rzZ)&e{V4a~ z>CQJfCmwO0Ir*F4VC$Jrjk=pE+ zoijGQmD=3>dWTd0qc1T#o6bKoGu)B;abFF?9(%@yw+9}bzW?~d2WOE)t^hkHhxcVh z_fiy3x^z@0?%Q4Uj@YKfVs~WA;abs()#XjT{;pr2oV$7E zPLtcO>*Plxq0{AYQ?^v~gyoS%=$VK=#igKzpJ{M(QI{;swu-@pDJi_W*- zTV#J93SfFO_2}=iBBr>GA3Hd9u%2M?YP{|D+*K#KR%)`xtj7IHolErJ+TG|+U)05$ ztNwoWo)-RZ$p!`HAO3OcuipFhW)64i2cr!w3ue78IK$~I_Mo++zuWrmyN`;Nr^5~# z+!Z?brD(n7w8%Jx;wP?8RDe%Jo~HPV`QL;3(GvRtdQ=i-qrsl?mT9nG-AfZq@NQ zOX@Y>JWGDZA*__QX;IgiXFh2R@1wWf;?tS8zj5p3?ZIu9EB@zL$isoLLT(a`*v?b&e!|{|C8L5_aF8t?qr#KxvBhM)id$yhHGwiXCGCO;uAF# zI&nU$wLA9&*UY28&j_^JCg!Ou5MDXAXg#QO_h-4P@gV&`fzR~A(dSBDuSi`jIm5YA z?m_>7bH+VEU-l-p@}Ak3A$s}6hKl`#EbV4|&lPWpy=QD%#j(P7>(T1S2JuDd|70h7 zFmyGpKL6yXPIPMGsU;PScttq?yQyRt0wzt3B) z)DLDKlpISN4;vnzx@IQF#aPFwotkPlF8(sExhkJ5R?g3~eCyN*l|J$3pAY@G%X28>Is|0*_~TjyGrNYX_M&!wt^w|nevY0+>G^c`2VCN z{?w+cOJ`jED0twJNm)bZ6T@Qd=e@TN-|3jGb3nH6V0XHsMzidJM<1&z-u~g&U@mG5 zpOm}SbyBB5Ea$3^2OJ*cGFe@E_)oDxZNc}s@4Tb8X&roXL#oA7L;IXg#KadiiFdfo z4AKKwg`Fi+*2sHaewH|e@u%0}pYjf#cP}3O&E-EsU--g$YuWO0Pb0xcE={le9z46T zR+r^V`s1IUrmg+Q6vLgvEZ6xwyL*Z88PU{NrumPHUw%9Kd+*Ya^)p&pBlpzHH!LVh z-giRf&ZE65!irYht4_`^mS1&vues2L+mAnfnznWygAIpC(l*BL8PXd)e8q3iiH|yb zrK5XI$Luwsj|<-G829g7{ASNDS*h;V0rL#18}18Ts4q2n;FrP}*YTM5(G8bP%@%Jr zZOSo~`Vso(nUKoFjv3*#I`Z4wbB~san5P8p-`pdRcKG;{iR=`2V%$Cr-F@oNGGO{PVzk<|)kg6&Gxu^YU~QsBUNAZs2c7KmWzlwMt^^e9L09 z;=0?9Y!74`FIaRy=brf0&wqMPOY(>?ycfKX{maVDQ%z|vYpCL~{lDrS=rUQ|dAKoY zL6<{Kou^K8tvm-)=!}=TZAkW8F{b8Ma>xg10CwuVGmG-fx+}<*FGsn{F&wM}B3gM4siLf-kjKoN8z{46S4Q=iu;vm-)R@o37gU#0!PLv0eIb(hI|* zg{e#0nJ4Sl%E!kA|K8-9%lCEtuOGS}o?JZoJ5DWIO=<33ziK7M%Sq<%P9E75s+V>= zjO~NfB#$GRRtLlX7cJPMH{1E>R-K+5C%bl>SanLB|A*QK-_v2%=l(a?D)UX6EcuAz zgT%7tl$i1sPb0yXYd*hE%U_%Lhe?9{4RhS$AqIvvJrxctuVHnv$$8)_~d`)6Ff#wKyZd$< zhmn!sO63)74Dn1|4eFdP${9IcY;WBDTcfMmpmPaR#4Y#tnl5*ERwzxm>=ahU{rE%a z{^NZ;J}y}tt8yObA85E?yY)aS%PxB#``~G7&oNF*KDYjlT<{{-jwOc4(vOe7ds?;j z!xNLuI?G$Tckhmk6MNvgYDe2Q7p7&=v4!z_cc!j(df-3f{>tkUT$CnVSm5QR(ZRH1 zF%R>z((gMb`M9jQapUE;c#ap%wLkuSXHqt>PPzBy@OM$AJg2;_(os1*R7Bv%Bb!?P^7-n! zce)gDu3ByQb<2S{57x5&yWAO|6Rqj9agS00^CS-!u8dPl)@cei9GYk2zig+=rkxuv zznvo-ch!6!V@!i*#(8Urc7cyqWPWds_n)V7(nV!^`km2C@7DJ`(B3$SO%VRd6X|K($!E`v^VDq}xW zoKMl~t-@cOzNjt@3}2JbXU!!kn8qN#eD>3Jm6;t!L_(Ymc5hlH7?RIaE_^|eX_x48 z|7rg@W-!Sx#g$r!DLz_O&&z75`(#UngSJt_>z8Rp6EpQDuJ|WCqw%Mtt+>Vgiy28e z(XmW-SX&I$-zlGSQ*rrYQk|*#%~;m-xlc&>eC?AiDsskJGcUcoC#CN6^2DZ4!w&|} z#NWuznAj*~AJ?C>TkvSc< zxRJl1=7DCy-pzuX7hk_SG{<=6gYPeO?^ZUgnaS~-Pg=#q zJ@L}1RT8U`QeVW*s++O)=W-S94~z0yrn1lA&rw@&cG|6md+q_Td_K(AgfDP@PRzZj zC0=~WmihAhC3kLiw7igBD`~Rb^hDQO)0bkBGdu2yhcq|XGw)}ZCJ-`RruNL7toW%O zohr|sAF%K_ek7IexRT5KNaIWmwwDQm6?$0Hm<@3}}x_oI}I5%(qLl2R= z2{*G8md#L^VLG>Ka*UpfSJv4D4>!C_3%YRk`3aNhFSzRuylLZN_Gdb8C4J7*mg5V% z9n-yX3o*qxmqdPVzHRH9lA`oTdxaYF<;GO^(}&r=tY*1dq%ggqY|pWa4UzdfY$i^2cL$Y{s~d72 za3*ZtEXetAPWHWL#gc-@b}Tmey85vn)35K#tNMJ3JAZJjVmvV2>dxbXGT*!_rmeL( zpghARNx9Qy$;Ll!n~GwBZIPSo!Oy1KYwx8Z&R|Kw%QTRfuI z${niywV6#}RYB`rn|pJgpPbeCV&?)a7Q5!34{G}w?Cv}?3|E@!Vkvn#jP*eK0gp2W zkEBR?a$bC0H2dc^ZLhRgKIT7mwWo}}Y?|%;#V6ot!m1a1eRqxJcf5V^*mIIc(z~N7 zlWbK!+!R-wb76w3@&rzi%f0i|jLxc7y}GdwBen(25dQhMp?3yfms1Cy+BD;&SAJcKxr(BGa5;Wu zVT`Ta^xVTpFqV52ccVYU>xSc;FLvGFTicSo_BL}oyB^D{hUc<o@ zW8WchdDAZMNj^t9S+8!Lq1T+iCvP@6W$}b_I?=xDbsdrNmD9fca(3$Ao3+X3j_ppLwAAfLXe-kW%4V$-~D2*w!-e-n^11b!6_8 z9v_$RZ4Asw|L=0xJW0^`_(3^AE3NzSYEUk5%Kmie*Bz&OdN~hX-IBTY_tBn+@+*@k zq$utBB%HvW*8fwU<3%ms@#0&clCg%hBVik3``liSjw9lQ7ei+9J0zB`o1QZ1oloPj z{Di10cFqp7O9dy})V)kdDNMY%N}@s{;DCJtb03?E%cmEC{=$*Qp6QNHnd(?$S~6Ex zi#wVgy1C%dJG(QAr{^B9KG&w?^65hhr>|CfVYP&3z|*;}sw8JFF_$;kcDZ)>pM{=c z)7Iv(tvmk4<+paxso0LZ-8rh;Jjbi-X5Pzx2?`Rs+uj%`Qob|tFZsH zwQh|2`|j2-t|&E-QJmDJ-m`nb#3YMdravApuj=dZx#StJvr(flV&#j5Jf#(RYusT|-GIL4yf?a~acei&g*fqT& zj?2N}{er!Ip{suI6_^DyOHSobta4z!&6dn>e}rRg!PV5wJ06IfpIE2%Qej2SjMf)s zyE$LvZGGfpHf`-QrhMi+AKrDbpvvacr?wwm=01V7X2O5%YA=;t+mtp*ZrzKL-Hi*Z zuC6eB8L{ou!7oMU52%QEsyNMQ4CD9xdegyt8@soWC%>$J&2>h5yIpycqU!j1j?Ynz zd{&_2w4^C-zUjo2NnK4@E^l}`1uwj3y3X{UH^$vzeW})#dr3E6CC_-XYd%4q0aFuCE%0IEV=5QAaCZ-qd>|ufzF7kcnXWqk7;$>dHDd*`yk-RUAs~exs>GkNive+c}ll0DghTYHi zS@_T2vZQNHgTI^O*T@H}XH0zR*Yv85Pc^8_S~5!hm%oqFN~X9XGZDq0$zdkfo-y5h zk*Rb!=H#&+n|F);{@*?EfXVSkg$=2zT@P$G{Jhh@Ia6P&rDONA8}p0Ksj%`sy&;&& zy6k9P)P|hU2F*t=nC>xrvyh%Bu=2FE?P4@%RW1(mkOCKZ1>QZ!>rx6*@b_1$4&4}>EFQkkbSxHptr>u%v^ z(BgQp#qwqD%~xy>JkM;oR_m}76tB1JKJ({gel!qSu!Jr8;GY}kEVo1zDPmqc*Hg-r|PGVr%!ZIa#^2!)}rd#k)^R2qHlLaukr&k1omcpHn?|P;3}8a=gMCx#)?Kpo-sG)<}LricqI6T zRDs~LfJJlE1sCQo&bzt;Hw)$@-prC( zcFXXP~HQP+s&#oRhkye>YaHkigAyxgFEMoq67W`JNqIl{FSGz zHEMKk^hr?NaP?+Ki--5!SD8xLYJS|SvJJRT&u9F{KcoK4 z@879*QEhh2I~J|ZR-I{aQY8HkXWHu3ym#t0`K4t(u}k0x;M?;Qlu_6I(s>oK#xd-Q z%H(D1)=g#ou`h{F@gCO{Mt{Kz%ajuw_H*uenUKPHbko%YpUv70y%)YJYAU+Czh%-i zSD8O(>RqSATE4Tay*Br+ZVmEVs?Rc2xkMv9N@D*c5$)oPQgm*3W37AU;>^4IkT+8qoFF7f3%b;Mm=J5Ozr&o3v3e8zqK zkv{);KQN~=d)3s<&tqE0p4H%afC*G$*j66e;&+!ZxZI#&fz++5rJK@(@*PVhKUAJ6 zyLMmjLQ&Rlo``L~RG!W86xkdb;a1}GWuf-H$D7`W6(?+5GVT7#_phz}O6K$ttU!}|iQ zEg>m4Un%(i-Acv}GTe61%e0OiA(5p|1x-9?bt^_xDDp-h|9`mp|7&a8lsD-2Ox;{jjID zJCgGJrt^=|w~zo)#%`;-w^KhF3&z*YzjolcfvZA0({w9PIkSF^ z(DgaG2CtRH%1V1xCePz~k(ChJUVV=#u25svmM7m|dYxIZMAU+N#+w`$rzPtY-8C%J zd6V1ZTRfk}xCG2CUG!RI<{Ynp)cFbVU#A-c$Np!l(GBy8`=Yqte?NPTZP{n31xG*y zapY3dDLeXfo$GIQuA7`vWaL;X`@!ggkYnlhi@%w7&1|Tf*bq1GS#GK9)9)|uGx#TP zIo{)_0GGwVlfBnw*>8DqEX3BnPi68t(DYm08K?EqJGQN!JpWMOcE;HTp)=N79o_2G zA$KeCSYz|w8;eD+JT1A)8#c-F`ng9p>gRLqI&tEVW!?OB$LDnAGo&$W2DMbKY|c^3 z*PqF+fBqo@yIr_Z}_th7~mzil4TIocmGUYQB8@$%2FEdk83~E;IseY8VZ}p-TnbtGr zRByj`bJ($dQOzB+1{pHaH&;3_5bYA$%sIBPoeeQq7=Y6-E<#zM$ zQLJ+akPY8yeYo?0(3u^6+rz(olaAWW~Jhh%v1SG_Fr<@dT8kx@vVs^zxGZ_Vd_s<^+$~1f5+WE?bBg@4N@=bA5od0 zS@Pm!;!UmF?=Sxsd;i@xyl#G6(#==y2g(gtU%hiKd&F6IYnIW8#_LM+KJsedCxQmsa&wy>9+K zX+iO6YwsLbJ)>{Bb%Q-)=8eZJ{NY)*pyFIwUa9-Zyi-r^J&eCpUbauI zc9Lg6EGvtF{Hw$VQcS-BY~pTh3gs&>d#l`UIfLb*8qb@fH7nj8@!9K=)bD$wrn-#z z|J&~`-yc&}W1O~@jcIkG4F*|7bvYM{@d8-l;@=lM8UPV_wxZ@~HVzHW5uUprZgxjT+*{9{*p zVbj&+jr*COC;Y3w@hT_8NoDOavEU6aTBbT&Ql2?OWzyY;W!$zure)nc)$A#e+x?8& zaIep;j0E|#D;t?N8(f{t+$Y_*yfM4+ee|}jAGN>c$=Sr09DILyee||pdLNR{_}Ox= zC^XYjoOH>vde)N5CfCIcYYnm*{;Mvy|L)bL8#TXkZn?{KH{9Wyp5bHvXzkQZ)A23SP0_`iXU(Hag6t6sMD@?#Iwd-H z_0r{WMx3j3d^|t-JjmZT`Au$rs=$TgzUD{ma?&o?eX&w^{pj;+e4chSQDpR=+CRLA@@cx7^R37uMMKc!3OO`np%>^T%rmZfe&V?7P-3 z{IjP2o^|Ta+FiFcUHy9C_6*I_MG1R12Xao7`4t}grmNRFDY{vI$z}0PSG?5H&L-xx z-+s)wN{I=i+~StIoHzrswe9w{Z$~yVuXy{nVD}fsw3JVV50-BgFLQ5adiUk`m%V()CkyFB|7HAPQy{TJzWALxN1;&q`p1|4nd)Sm zT#$AnF-`cwZEL%EMkkMKy82*EnBLdiho@V4eQpMOo%#Ame44EwVh)Ql71x*NEU>&@QOb?^Q>wdtJf86cXyMHW6sGVUu1s<$MO|N+kCliByz2H5$om^x6E=&8?I>0HlQ;IY(&DJ?2Z^V$CszjdSUzA3QrJpcZ3cVm2#*`hlKHnIn{3dp9o6!_ow ztN7+#aFpxZyFV3|RE1B6Wj*G|%k@^dCor|0JJL62xnox~d+?qMtTq`pUlsEmpUkzd z)APz-gXh&P0_p|lq{Mn|H%nDAu!ViDZ8~-Na9%0=;75Lp6UT}CMJ+da`Y-Vu`m;}F zs>#VEx)T}7O{zKfnl-zN%|HG=ZuUXzz^O&SQOiHEZIB7h{NX=sZC;7loF~t|zqFlk zcx~XB#5IDT2G*mM=a&U#8Z(Q8rd)Wb6Zc4c@&YNRfV;mpmftY>#894aj>V=gGQ&T8 zed4KAyBpngqhp^J*m$0Of7!cHKA}#1-QyckIZjLVUQLd?JH>N#*oN&>%sE~pTj{Em z85!2L)yGah+&jd*R^_t zhyJ{>-(ddP^ZE_pwa4?9`oBmK3O%#(bYkG`r0Otj(Lhg?xqq2A_dQ~qwLQcGlr#Z|@hTz7RH>8L=&>eqV#Wd0N?xt)WL|wY^zv`qg!J zxS{o4n*+hq)~+kDn78EV_m|2CdS|@6;#zPgF+%ZDWc1cAPdwCeyWf^t{`qVj%pw2c z_^P$ek=tt2@~vc}nWDMY94M)&xwYwPD&O(RTmIPn-!fz31A3;@g$G-!6a5<@0lD+5@Tm{`(&l*m$1abT#SB zt&?_VI4d((s9p-I6OIgD^WfTs*+Tv^UL9iF=i^|1?_0&A9-pQxgAXCjV(VjfHr?JF zr8;rWvi*r!eyNP-qqgn3@UUXiP4PzE0|`Ew(u$YD{%8H#ndE*rIrYW)_dhBgsR;k@ zisj>uw)yhC<>KXS$;zEiO7=3WIrL?3{k=_BEBTI3p7O^owq5fg^D^eNWz7#c9&LFA9GIhF|%KBC$zF=U2^A?S2Zu2%G>6#hcR0o;GVYjT%pChCCN9l zo>8Mo{@wkDciNoD@vaQwJzym4l9&iq}It&hDo>wMy&`1+sS z?CT}J=H~R9v)0I5zQ0dy$C>w+^R13apl0eYUi2e%C1LDt#V<%DtmeR$4TlnTU<^FPyM-OvWrl;R0Uf^yXDQllTugj zJl8hm!@h1$72X3$Dib*_2HuX`pL}lCms%svRZ0)~zgn^!fA{#(O6v{=e}>!sAAJgc znS3zWAXl80v@%tD{$@p0wbNnZjE=YdpM3>tD;}9Bc+fOiy6T?VjttS`Z$#dHPFW;+ zy(A~c^o>FFM3+nAx9nuhnOqNOPg|R2DIJuwF~^i;bM@&~%_W-l)168-6xbFYe|OaQ zivf@AA#;vZi&+DIn}E{wYq!Gas+Qjd$2DkY@c~2|8Ffe z#u+V}B#I^0v;5edx_afgwkZO2J()eB%zs+1WdGJVBDwnP!;Y@CipTi$!nWF8Q{TPQ z>isRJYaT+4(mzC&O?asIfN8&feu0@vdc?M0DrsB>O*eOLJ$|vF#UsE{w?cgF(fOBs zJbmT5kH39*nWaRe%6cZtRe=Z9?7s^?{+ifx)5=B2v#F4IKI1V4_QubD?e?C$IpNo| z)YThjd@^o5;5{R0rc=kd*cX@P2#403e}DP^)w1+_|Kh)!^xCuU1|IXd+o-qdxuwcP zl}UZpFWH#>Z^$vdcXPt8zSPw^XQYA@H!ymtIF+~;U)j?8diL6b7pt$F*(Gx>H#+A$ zPoQM!#*9Noa83IZhx2R5uox!#9v`%zync0$i;GXNM1Bwqk7l3>Be5q4Y=51yZTazBQ zK94sqIw$|klWE(R3*3x8^*g%lV|ixI)DKPv7CTrPh)fP}vyu$R@62ug=lkXvw?e3R z%Zt7<0`orGrIh`bk|>+;@WAuia^3MpoLc^0Vo`QH@W#K zm#*E=n!Pl9&4X=so-Mwtw&}*any5y1gWJjONkXR#+?Bi5vm4%C$e$q9$*H(&<)VgL z8%|$&)>USeF0_8)$^BQJZdh>CxxQS)HrHBSp;Kk%R@EuB2Qtp+tyetPR`N_Ix|Vkb zU+{`|o@b&a3M`r(Wz%9Ob?lTF|CRK|Y;`xk-H@DbyfJ6#y85}FRwQX`Jo@eGRoINS*d1gz;=J&fzv{v0ZePRB^ z6H9V8*1lcw&829`gsstSo2=z7ave8iu0P_#*?YVv;M5%6mCtpezaH;#u{m(tLrL(F zk7=o0cF`^6$$qLqhko|j1YbCDaPLx?PUi(m8&jCglljc@4or#j?2-+bwl?O#=>tb+ z%+0EI_%)fMaM?SSuEx%~`S*C18yj)13X%c{+|Qlne2|a*u%MEv&W!_W z6x(;|yizh=-^m-fc8r)X@e5AC!)9I?+q4R8Mj{M7Z>O`;PKPGee#;R8fOtyKs=W;G(n$elb z81p2@<2Yz2QfJ3>hUi9fP?2^eaI!b+#yb0ro7JXXI14IF_EpI|f3K~$O7!>lX`k+O zot)%zDa2N7VF;6*kCSGJ*^=ZxA~X6kOTKP7ypdyKke$Towl1bDCA}NA4W$X64rpHY zv3h^&&=j5ND|HzI82%WiRX^Z*5VYU_x|QUF)Ya04&pnh5I3I{pe=MlvsvAcokR3?fAx9=A$#+Magf4n6cAJwsTDX(r#*VbKZ7yxCX5{_Qh{Ks~DsH5xYCT zFXcC`oG~};{P&O5+!Mo2X?>ixo9$fOah;}TXKogrJhEx(uggnomYOZEy?$+?)3uQ2 z7cV>)>`u94xNr`;&c>Xncg6E_Zl3C2sd%l+WS7vQ@SP^F?wHOAjbd)rmSDKUH+Pcf z?WF4N_S^Snc`d0?&^F_LKDGYLq_tBQMXxdljw?ODdZ2it-Rr%_HeJnm5WaD?K0|x; z=f5o;VnGL;`Q}tV3xPHB9(r&b(c`@&%K877hy=(sk%|AQo zba;`sBeP)2^=THyqBB}9F~qRhXX zyK-WBXa3y!#> zauttw=13guTUwk^mC9#R#M#ae(>pWf+M|Uc4w;MEe{Vd0)4-L>lI0I)2Fp6Oc|B9D zES0CNJ;z$tq51Md_?buh1s3JYZnnKK_3|NoF6kRjx-RY6%=3L6V@&0_sC@-Dz4T^o z?ET2crWJJ9(Z?y1$&Sw^@ut?}lK3;5t~#7C$zfY|@#?e+7R{Cy8<*XfuQpTQLjAXv z$OQ@8Z0F5Cf2ZwL{MiqC)Smg>J9_l9nc>}o39eZd4W1fj4{SYL|>YCict)f>+Ltlf1xTXx#of6_nr(w5(--Duw`P@8iuZCRhyfvJMxH+TBxoX&f? z=rNzJ*wxR6>%Oiz#ZxE|F!d)7Ti(GbpT!>eyg6*LGKu7o|Ik*>5|(nOlPC&N>tBWA9Qk3T695 zKMQ;2>%ZlEI=`XaZ)$)}bng+L$(jk08#ae4i#W{*akXooV#d4a*11_F%UNpeJ`^wA z`Ss1$fH2S1>MmaoCSB8=eN@`$yQ<&i0w1G~O#DpSf7KrUZ*YvyW*_I7gF4&n?@f2) zQtVr9@@mf3J0TYitaxP;H+xUFx1Z(F2j5>>?f1VQcHu-Rvo@!z=shw0zrVvD&)(E* zSSz^0!}IBZWCxBPN(J$66q3^SA5fW;b;c|~vE}d|4V%|rmeN}t`6RIbj$l}aVLxQ zm#;l|$Mr(2e2O)fRHfSbPF+z}ld1d*cs`%D)Bac3WwKFt^JZ9~_-w7zQk>_d5N8ot?{ zy8B=KGYJ>}WB2!YIug%1X>~bJ@n|S ze{J^A-lON6oyZ*B5Pq&=*6S4uPO+R@e=_x!arcfrM-RJhbidYTbKup6*}ML#hPcH% zThJ}w)Um`^_Q#A%DLy*se$<;;~@* zWY078Pq%z-9#lUi`ZmE}j<{pIyH=RUWdBG(d`?qzx>f6pwybeAkVx^+-$+~ z+@zl?{;pwrr@UbMmoGQEfSrlrhmA>bw)k6 zVvE4?hkN)VEEdk`{<ZTBNk5Zcc)F!L^xcLLLVuo(yy>&AoDT`Kr$|{vR`GlYP_9 z^o`*>gD9W7dW(SP(j9$!x^we5cWbhQxV1!;Pr3bR|H}D2$6u@G8NEEP>FUn|&IeBX zyV`R8mIv#G^w$E{@}$n`r7sqC>S%fXsb%M@PgBo)Yf)T1wYk!F4||Ne!||o*0f&5x z=XTs*KArh8L-sv2qdkdiX{|HNvbDqgbkbW6Kjc(&Q98|NCw~f5Uy1Rqe_~o_Ul6@V zh*Ra{i6x7d$*<&>GM>3aG|u6@+<~^K!WE}p?r0HE3amJ^BRwy*$gO2lukwtrx$brw zq<^&BUmpJTShd>G6H6Aq5!-ipeINf`MXfDPZ?zM-3WNh5l;k*ZOytmuKRI>r_u_*K zyu@^3{P$^}ntfo-Juj6BEy}_SO<5WS*+*55)mgOVGp0ItCo-RQms{{EK(PJ$^njNI zQ=B+1K0o$8@yD69cLd5NvrmwGwBeG@ncvgy-J1P=_8f3RP(84>(zoW<9)88$tz!8z zUd1v;{=62l^0R7-hjygu)|zK~_$B#X+(|1--~K^{u{J$_f8izd$!6akYZ-iE_`gt8 z(&38mva*{xa&{`IZ(9XkE)@B}6JWD(&aIpBAM@gb>)GF_E|9MNeKuHara*|YvfjKE z=hK`tnw1*DpM407H9OC+_aDDzi$JaJ`pz{kZ_m6l!S&^{#2>TvRxnEcSaN@P`S(+#5#C((K{)zLgr+O%~PWF`E@BhEDol-!_&40QlngoLS1hZ%!i`~n?wJ&?WHIOM zJcqaDshA!pK2X*UO0tu+R;tzqSqgs_zg+Jwxo-ux_y?VW$@iDPp3}#FNp&UzOQ@N_ z-Wr9)@v~0L9YsgjG>ktH6kHq)r^7#O zyrZ@(vz5JL*P=grf4u$`wEXcaou}7*{Eoc89Jt^Ae@y{v_phs$7KpwJ<5!)zwrBpP z$(?@3)msD%omYRFu}V~K`m&`f=J_5i{d42x0zVbq$)2-U-+Ov^QPsTjd5QW9l=F&K zf8Hq~@u(!nsbh<|@Q%vI9D715r-)zs{Jn?czVd?q?@AKXCr!H?bDU#U-GTik)t2d( z3zqG(Z#)?2DpDaG!RI2=>(4RKtW9QN$q`4lJozIX%tw8C@BZa}FuQKP-;47~o@%lY z+deVeXWchjP%-%*o78Eom8;G#t2wH2Z{4Zo_g+f03arfh#PmoF|>+jMz5IHqrdN&&`tt4(To{_;=s@{N|>OXyM6|m5MGkI~VU* zS2=rjOki7PYjmcQp!j~N52Anb{f=LY&D;yF6W2%Wn3tcvwTMCCjaq!>F|D%>%aetj zmdsm`6tubhVbsGi_ly_e=YKI?{d4Q(jw+`~p5iu%^G;9(5IoGwwb8@Joz(@dEbA2F2!F(;pCFzf9&oCgq_UimipgQeebwHA+@z@w3h z=1Ut+OD|isVqQ6${KL%UkGt4C)s{d1zen-k>J5$V*~Jn2%S7@XXgyF{aA0X_V;n~z z4}U?duUz*w9_Q-AIocTsotJ86Hslpr?WmYwI@w}FPN`_Y{wBxZ?ZWdS{9-klZC|@> zOnNQw%}RE@z@qn>y|Z@A7JSFyI=kJ_e#$|I1#Cao)N|@v-aN6&+{36-_;lD`uk4B+ zcT8iLA9P)sBe<~Wr_VgA0H3L#QsURORPCKR;$?-SZNIEOb$Dxz*zCss-?denFK_(H z=Bf5kBxLdIy*jxkl3K!27%qN4{yFNWLtMF)iQr@`dG88tB-Bo zm%MXHVYQ@HDtr1##EpolNwUpzlL)we~ z+smJAEWC4F_Wz%>_p$Fj?K@JO8K-Ekz~y<&OE_}G3k0?}G{tnxWb(YrkSUsZ0oJb(VJ9W^{L)l;?mXb(Y5>V-W}GTPsbElU_bPiMPUalHSGdc1UBQKgk0&zSd-w3jR4<_h=?^vqZSPKn zdM$NeI90&Bu~>JB&R=154bCNn31xd`Xg4pudrV$jNY0AuT$A0t>s=40?|pW%)Z&xe z&S{ovwUTjc|JqjU`F1dN<=o@{Qa(8*{J9+S+qmNOOT~{uA4)3bu~)1AnBlB`)#~)C zrEYbVt9rYwZ9}DJe{a@qU+km0Bg#eTu~PI3&dwL}7A;ls`#Nj-jhSJ3&t!g1t$)lE zTCHvoGi8a^W3_+R7q>%Tcam3$HW~@huT#xy);K!z~`B1!z0rg>Eh!B9IP3;oP>68tq5A6X4|6u zsHMe4SSYr*famc>(N)V9?7MsTAzYtCtGUA6z%y@zdoHtI819el4LJt9pPY0q51oroWGWqsqS6zJX%6iCU~<`=6#9wF5xR_F>Chjo^8HvnzUi< zfxYE(?#`Y5l2Lhzu#e&2)oIgoZH=6Eys~oTXtD0zls?J%eaZ7;wymc*VjFuhFWgS6 zDA=`NeVM`5%BS(G9_i27UHy6W#9fE1HZZJcnDr?@+ABy$Wfp_(>nBVfRxLfw{3dhe z<3z=aOA=JyK5{>h-S8{J<(Y(t?t$x#Tn{o%N}VsOk6V{Fr!ZhgV|7E(gS+SSPtEi_ z|EAA?>CY6#g?Bdem}`YMEZ_F`&vy~)^iPRK3VaOxI@1d7zy95M*i7@zg=KAF-5wEDuXVoe75>v$ zJ~t`0QCN14#QmdO%M9&nCZ1cy`ijA|X~r7WvQ5pQ-uwT{h)!L-ZFi-&6UyYT>JzGT(e{4VrfE%~PIb8~49w zdh7eSgzG|!%j~remR|o|aq*J9os0Knruc9bM@36!8^4f$S&w;`7fJl!31F3Bj=Pz5 zh24cWfU`$vYT4ndvPb@vnKI5su@=k(*8@8q94tn|9OtNY2xvU_t@ zs0f(0@BWcN@uTNsH(`s9PXqar0NI z<)x^KLghKB4tp4Obe!^?8phy~%2QEv`@DJo%=WXLm9ys_EK{>~sdw?SvsIB}kh^Vs z^1hejM818`EW3>TjF!KxIhEg{-@N;u)KyRYldDB_#Mk|iweoszA$#?D=7}91^YR{- zJUq3(a^9@kjIk4PP zpsR0F^{ja_Pt|D8{q!R(`ThovmpiBZDOBK%ay)Z?cb~LbYg38hL?#oJsB4}w7VV0@Ai1ofEX_r5%9D0F`P-4OF*9tpdZH~u`4XgyhWiM^8Q zhaqGvN>?pq0b>6 z0bM~I`waX3B*pJD*;2;3UP+Ku`+vKe)QuZ+!xrV0v56XXHCVmAv3XzR)BL*iQSp-E zj?3LHa51ayIm4tM{mW~@vRkQgX2J(vma6|}`_sPk{k&x&9ZX*j+%%fH{9RQ@+&znj z3kn$ObI!fY`Jw&kidZr~^P|cI909(E=c;QxKH#5MbKUINnWno!C!YO3R;IR{@tsWl z%ecoMTc+P#HUE}&s0njDqs@7~{S#v?Wxift;Z^COKc#T*1u4!2*&p8Jo;p{~NvP;MRx18l`KyoU zx<7w2ZGOAITpP92^0h+o!q&%=j~z2$e~>qCxuMY^+jTN^4l{2YefoH=PqNhSdz@0% z>jJuGGQ{aBeZN(g6qFOf{ByS0C+=x$gzL&!bkYm%SFSj9{n`S}507lkuLtKscf#pDL`6Dqo}I_Tqs-`Sg`0PeqEvXIqr6Yn41>;P+aG_qY2^^(7bIB`%!u zL%MqA(Gs@b$5!sjo+j{Y*@h+Jah43TnwTFvP|eV|v00mSPer-im*V%VEA%oFXBHoL zaJMo&;KT1-6EZaUXU>;@CbZ1(zO`TFb(6Q(>>45j7dN|CT)R}QrfF$##$47)FG2J9 zgZDP~r~OQ~=i%W0V5-2w!+c&ySL3hAv6jZPgc&RL{IbjI?(IFRyWw!mcE!JfGnx0< zf9p>=H}x^6@4@MXfr36lT&fv;tN{%EcZC?^*~(Ad_~QE6hF4trv-I9mphERgON`|! z-P-Ik_gCiTFnKd)o$Gvb;bU~^KTY#&OLx0x`$K#(EBe|+E=#Tv`?yQ*2fO$8wU5_y ze6)R_*CTUb^52QRoC%CIm#*luUfOd@UNhpZbmD^lM>Ke2i)zxnkM@6*={TNWX}GvZ zXvUteqT4ratlWR&+!M29rPH1-eK4_QdTplp)mhBvcNx!T(0jqHvNm>4r269-$6~$; zmZWEHKIFiuAHLad-o`Ia1scztt~ng@bG4-Sf0c)lmuE)K-t~_wgZWt3!}wpyM)7T# z62Ik{*B*%Ynp{*9%_Om}286kmOWx(W@cvF4a;V{E<2tf_48-Tbm!?( zmS$JZ6@E%oD12hOZ?(s*M$HHBw;%n=ex%t!-GFh=j Assign - assign + assign assign_inverse assign_zero + assign_points + assign_values ( + 2 + 3 + 4 + coordinate values) + @@ -312,6 +319,10 @@ clear + Convert + + convert + Convex Hull convex_hull diff --git a/doc/reference.qbk b/doc/reference.qbk index 27f7f0134..8bdd22ac2 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -66,6 +66,7 @@ [endsect] [include generated/clear.qbk] +[include generated/convert.qbk] [include generated/convex_hull.qbk] [include generated/correct.qbk] diff --git a/doc/reference/algorithms/convert.qbk b/doc/reference/algorithms/convert.qbk new file mode 100644 index 000000000..651d56d2c --- /dev/null +++ b/doc/reference/algorithms/convert.qbk @@ -0,0 +1,27 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[tip convert is not defined within OGC or ISO] +[tip convert is modelled as source -> target + (where assign is modelled as target := source)] + +[heading Complexity] +Linear + +[heading Example] +[convert] +[convert_output] + +[heading See also] +* [link geometry.reference.algorithms.assign.assign assign] + + diff --git a/doc/reference/algorithms/convex_hull.qbk b/doc/reference/algorithms/convex_hull.qbk new file mode 100644 index 000000000..2a1de1892 --- /dev/null +++ b/doc/reference/algorithms/convex_hull.qbk @@ -0,0 +1,18 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[heading Complexity] +Linear + +[heading Example] +[convex_hull] +[convex_hull_output] diff --git a/doc/reference/algorithms/equals.qbk b/doc/reference/algorithms/equals.qbk new file mode 100644 index 000000000..cc5dedcb7 --- /dev/null +++ b/doc/reference/algorithms/equals.qbk @@ -0,0 +1,21 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[include generated/equals_status.qbk] + +[heading Complexity] +Linear + +[heading Example] +[equals] +[equals_output] + diff --git a/doc/src/examples/algorithms/Jamfile.v2 b/doc/src/examples/algorithms/Jamfile.v2 index 318fa7381..ebc5081af 100644 --- a/doc/src/examples/algorithms/Jamfile.v2 +++ b/doc/src/examples/algorithms/Jamfile.v2 @@ -30,6 +30,8 @@ exe assign_points : assign_points.cpp ; exe centroid : centroid.cpp ; exe clear : clear.cpp ; exe comparable_distance : comparable_distance.cpp ; +exe convert : convert.cpp ; +exe convex_hull : convex_hull.cpp ; exe correct : correct.cpp ; exe difference : difference.cpp ; diff --git a/doc/src/examples/algorithms/assign.cpp b/doc/src/examples/algorithms/assign.cpp index 8cf845b60..bc5b4cdc5 100644 --- a/doc/src/examples/algorithms/assign.cpp +++ b/doc/src/examples/algorithms/assign.cpp @@ -8,7 +8,7 @@ // http://www.boost.org/LICENSE_1_0.txt) //[assign -//` Shows how to assign a geometry to another +//` Shows how to assign a geometry from another geometry #include @@ -26,20 +26,19 @@ int main() boost::geometry::assign_values(p1, 1, 1); boost::geometry::assign_values(b, 1, 1, 2, 2); - // Assign a box to a polygon (conversion box->poly) + // Assign a box to a polygon (target = source) polygon p; - boost::geometry::assign_rev(p, b); + boost::geometry::assign(p, b); // Assign a point to another point type (conversion of point-type) boost::tuple p2; - boost::geometry::assign_rev(p2, p1); + boost::geometry::assign(p2, p1); - using boost::geometry::dsv; std::cout << "box: " << dsv(b) << std::endl << "polygon: " << dsv(p) << std::endl - << "point: " << dsv(p) << std::endl + << "point: " << dsv(p1) << std::endl << "point tuples: " << dsv(p2) << std::endl ; @@ -54,8 +53,9 @@ int main() Output: [pre box: ((1, 1), (2, 2)) -first: (1, 1) -second: (2, 2) +polygon: (((1, 1), (1, 2), (2, 2), (2, 1), (1, 1))) +point: (1, 1) +point tuples: (1, 1) ] */ //] diff --git a/doc/src/examples/algorithms/convert.cpp b/doc/src/examples/algorithms/convert.cpp new file mode 100644 index 000000000..2617eeaa7 --- /dev/null +++ b/doc/src/examples/algorithms/convert.cpp @@ -0,0 +1,59 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[convert +//` Shows how to convert a geometry into another geometry + +#include + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point; + typedef boost::geometry::model::box box; + typedef boost::geometry::model::polygon polygon; + + point p1(1, 1); + box bx = boost::geometry::make(1, 1, 2, 2); + + // Assign a box to a polygon (conversion box->poly) + polygon poly; + boost::geometry::convert(bx, poly); + + // Convert a point to another point type (conversion of point-type) + boost::tuple p2; + boost::geometry::convert(p1, p2); // source -> target + + using boost::geometry::dsv; + std::cout + << "box: " << dsv(bx) << std::endl + << "polygon: " << dsv(poly) << std::endl + << "point: " << dsv(p1) << std::endl + << "point tuples: " << dsv(p2) << std::endl + ; + + return 0; +} + +//] + + +//[convert_output +/*` +Output: +[pre +box: ((1, 1), (2, 2)) +polygon: (((1, 1), (1, 2), (2, 2), (2, 1), (1, 1))) +point: (1, 1) +point tuples: (1, 1) +] +*/ +//] diff --git a/doc/src/examples/algorithms/convex_hull.cpp b/doc/src/examples/algorithms/convex_hull.cpp new file mode 100644 index 000000000..f6963f092 --- /dev/null +++ b/doc/src/examples/algorithms/convex_hull.cpp @@ -0,0 +1,54 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[convex_hull +//` Shows how to generate the convex_hull of a geometry + +#include + +#include +#include + +/*<-*/ #include "create_svg_two.hpp" /*->*/ +int main() +{ + typedef boost::tuple point; + typedef boost::geometry::model::polygon polygon; + + polygon poly; + boost::geometry::read_wkt("polygon((2.0 1.3, 2.4 1.7, 2.8 1.8, 3.4 1.2, 3.7 1.6,3.4 2.0, 4.1 3.0" + ", 5.3 2.6, 5.4 1.2, 4.9 0.8, 2.9 0.7,2.0 1.3))", poly); + + polygon hull; + boost::geometry::convex_hull(poly, hull); + + using boost::geometry::dsv; + std::cout + << "polygon: " << dsv(poly) << std::endl + << "hull: " << dsv(hull) << std::endl + ; + + /*<-*/ create_svg("envelope.svg", poly, hull); /*->*/ + return 0; +} + +//] + + +//[convex_hull_output +/*` +Output: +[pre +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, 3), (5.3, 2.6), (5.4, 1.2), (4.9, 0.8), (2.9, 0.7), (2, 1.3))) +hull: (((2, 1.3), (2.4, 1.7), (4.1, 3), (5.3, 2.6), (5.4, 1.2), (4.9, 0.8), (2.9, 0.7), (2, 1.3))) + +[$img/algorithms/convex_hull.png] +] +*/ +//] diff --git a/test/algorithms/assign.cpp b/test/algorithms/assign.cpp index 87bf76f30..ab4ee31b0 100644 --- a/test/algorithms/assign.cpp +++ b/test/algorithms/assign.cpp @@ -143,7 +143,7 @@ void test_assign_conversion() bg::assign_values(p, 1, 2); box_type b; - bg::assign_rev(b, p); + bg::assign(b, p); BOOST_CHECK_CLOSE((bg::get<0, 0>(b)), 1.0, 0.001); BOOST_CHECK_CLOSE((bg::get<0, 1>(b)), 2.0, 0.001); @@ -157,7 +157,7 @@ void test_assign_conversion() bg::set(b, 4); ring_type ring; - bg::assign_rev(ring, b); + bg::assign(ring, b); //std::cout << bg::wkt(b) << std::endl; //std::cout << bg::wkt(ring) << std::endl; @@ -183,11 +183,12 @@ void test_assign_conversion() polygon_type polygon; - bg::assign_rev(polygon, ring); + bg::assign(polygon, ring); BOOST_CHECK_EQUAL(bg::num_points(polygon), 5u); - bg::assign_rev(ring, polygon); - BOOST_CHECK_EQUAL(bg::num_points(ring), 5u); + ring_type ring2; + bg::assign(ring2, polygon); + BOOST_CHECK_EQUAL(bg::num_points(ring2), 5u); } From f4e8438ccb9fa408be42912937376916c2dfef85 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 17:58:34 +0000 Subject: [PATCH 38/70] Doc update (metafunctions coordinate type, system, dimensions, point_order, closure, tags degree/radian, constans min_corner, max_corner) [SVN r71324] --- doc/doxy/Doxyfile | 3 ++ doc/imports.qbk | 8 ++++ doc/make_qbk.py | 3 +- doc/quickref.xml | 13 ++--- doc/reference.qbk | 16 +++---- doc/reference/core/closure.qbk | 23 +++++++++ doc/reference/core/coordinate_dimension.qbk | 16 +++++++ doc/reference/core/coordinate_system.qbk | 16 +++++++ doc/reference/core/coordinate_type.qbk | 16 +++++++ doc/reference/core/degree_radian.qbk | 14 ++++++ doc/reference/core/max_corner.qbk | 26 ++++++++++ doc/reference/core/min_corner.qbk | 25 ++++++++++ doc/reference/core/min_max_corner.qbk | 31 ++++++++++++ doc/reference/core/point_order.qbk | 24 ++++++++++ doc/src/examples/algorithms/convert.cpp | 2 +- doc/src/examples/core/Jamfile.v2 | 7 +++ doc/src/examples/core/closure.cpp | 42 +++++++++++++++++ .../examples/core/coordinate_dimension.cpp | 43 +++++++++++++++++ doc/src/examples/core/coordinate_system.cpp | 38 +++++++++++++++ doc/src/examples/core/coordinate_type.cpp | 38 +++++++++++++++ doc/src/examples/core/degree_radian.cpp | 47 +++++++++++++++++++ doc/src/examples/core/point_order.cpp | 42 +++++++++++++++++ 22 files changed, 473 insertions(+), 20 deletions(-) create mode 100644 doc/reference/core/closure.qbk create mode 100644 doc/reference/core/coordinate_dimension.qbk create mode 100644 doc/reference/core/coordinate_system.qbk create mode 100644 doc/reference/core/coordinate_type.qbk create mode 100644 doc/reference/core/degree_radian.qbk create mode 100644 doc/reference/core/max_corner.qbk create mode 100644 doc/reference/core/min_corner.qbk create mode 100644 doc/reference/core/min_max_corner.qbk create mode 100644 doc/reference/core/point_order.qbk create mode 100644 doc/src/examples/core/closure.cpp create mode 100644 doc/src/examples/core/coordinate_dimension.cpp create mode 100644 doc/src/examples/core/coordinate_system.cpp create mode 100644 doc/src/examples/core/coordinate_type.cpp create mode 100644 doc/src/examples/core/degree_radian.cpp create mode 100644 doc/src/examples/core/point_order.cpp diff --git a/doc/doxy/Doxyfile b/doc/doxy/Doxyfile index 22d7a0a3b..7c34fb5e0 100644 --- a/doc/doxy/Doxyfile +++ b/doc/doxy/Doxyfile @@ -50,6 +50,7 @@ ALIASES = qbk{1}="\xmlonly \1 \endxmlonly" \ brief_macro{1}="Macro to register a \1" \ brief_macro_const=" (const version)" \ brief_macro_getset=" (having separate get/set methods)" \ + brief_meta{3}="Metafunction defining [*\1] as the specified \2 of the \3" \ tparam_allocator="container-allocator-type" \ tparam_box="Any type fulfilling a Box Concept" \ tparam_box_or_segment="Any type fulfilling a Box Concept or a Segment Concept" \ @@ -107,6 +108,8 @@ ALIASES = qbk{1}="\xmlonly \1 \endxmlonly" \ return_check{1}="Returns true if the geometry \1" \ return_check2{1}="Returns true if two geometries \1" \ return_out="The output iterator" \ + meta_geometry_type="specified geometry type" \ + meta_point_type="point type making up the specified geometry type" \ brf_for_each{1}="Applies function [*f] to each \1" \ det_envelope="envelope (also known as axis aligned bounding box, aabb, or minimum bounding rectangle, mbr)" \ det_buffer="buffer (a polygon being the spatial point set collection within a specified maximum distance from a geometry)" \ diff --git a/doc/imports.qbk b/doc/imports.qbk index 291fd788a..357a79055 100644 --- a/doc/imports.qbk +++ b/doc/imports.qbk @@ -57,9 +57,17 @@ [import src/examples/algorithms/unique.cpp] [import src/examples/algorithms/within.cpp] +[import src/examples/core/coordinate_type.cpp] +[import src/examples/core/coordinate_system.cpp] +[import src/examples/core/coordinate_dimension.cpp] +[import src/examples/core/point_order.cpp] +[import src/examples/core/closure.cpp] + [import src/examples/core/get_point.cpp] [import src/examples/core/get_box.cpp] [import src/examples/core/set_point.cpp] [import src/examples/core/set_box.cpp] +[import src/examples/core/degree_radian.cpp] + [import src/examples/geometries/point.cpp] [import src/examples/geometries/register/point.cpp] diff --git a/doc/make_qbk.py b/doc/make_qbk.py index 5401471b7..3442616b5 100755 --- a/doc/make_qbk.py +++ b/doc/make_qbk.py @@ -82,7 +82,8 @@ coordinate_systems = ["cartesian", "geographic", "polar", "spherical"] core = ["closure", "coordinate_system", "coordinate_type", "cs_tag" , "dimension", "exception", "geometry_id", "interior_type" - , "is_areal", "is_linear", "is_radian", "point_order" + , "degree", "radian" + , "is_radian", "point_order" , "point_type", "ring_type", "tag", "topological_dimension" ] exceptions = ["exception", "centroid_exception"]; diff --git a/doc/quickref.xml b/doc/quickref.xml index 366404959..676f0eaa5 100644 --- a/doc/quickref.xml +++ b/doc/quickref.xml @@ -138,16 +138,11 @@ dimension geometry_id interior_type - is_radian point_order point_type ring_type tag @@ -194,8 +189,8 @@ Numeric - max_corner - min_corner + max_corner + min_corner order_selector closure_selector @@ -203,8 +198,8 @@ Types - degree - radian + degree + radian diff --git a/doc/reference.qbk b/doc/reference.qbk index 8bdd22ac2..945a17ddc 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -129,7 +129,6 @@ [include generated/transform.qbk] [endsect] - [/section:union union] [include generated/union.qbk] [/endsect] @@ -142,13 +141,10 @@ [endsect] [/algorithms] - [section:arithmetic Arithmetic] [include generated/arithmetic.qbk] [endsect] - - [section:concepts Concepts] [include concept/point.qbk] [include concept/linestring.qbk] @@ -161,34 +157,36 @@ [include concept/segment.qbk] [endsect] [/concepts] +[section:constants Constants] +[include reference/core/min_corner.qbk] +[include reference/core/max_corner.qbk] +[endsect] + [section:cs Coordinate Systems] [include generated/cartesian.qbk] [include generated/spherical.qbk] [include generated/geographic.qbk] [endsect] [/coordinate systems] - - [section:core Core Metafunctions] [include generated/closure.qbk] [include generated/coordinate_system.qbk] [include generated/coordinate_type.qbk] [include generated/cs_tag.qbk] +[include generated/degree.qbk] [include generated/dimension.qbk] [include generated/exception.qbk] [include generated/geometry_id.qbk] [include generated/interior_type.qbk] -[include generated/is_areal.qbk] -[include generated/is_linear.qbk] [include generated/is_radian.qbk] [include generated/point_order.qbk] [include generated/point_type.qbk] +[include generated/radian.qbk] [include generated/ring_type.qbk] [include generated/tag.qbk] [include generated/topological_dimension.qbk] [endsect] [/core metafunctions] - [section:enumerations Enumerations] [include generated/enum.qbk] [endsect] diff --git a/doc/reference/core/closure.qbk b/doc/reference/core/closure.qbk new file mode 100644 index 000000000..76db82a75 --- /dev/null +++ b/doc/reference/core/closure.qbk @@ -0,0 +1,23 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, 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) +=============================================================================/] + +[note The closure is defined for any geometry type, but only has a real meaning + for areal geometry types (ring, polygon, multi_polygon) +] + +[heading Complexity] +Compile time + +[heading Example] +[closure] +[closure_output] + +[heading See also] +* [link geometry.reference.enumerations.closure_selector The closure_selector enumeration] diff --git a/doc/reference/core/coordinate_dimension.qbk b/doc/reference/core/coordinate_dimension.qbk new file mode 100644 index 000000000..4b599defe --- /dev/null +++ b/doc/reference/core/coordinate_dimension.qbk @@ -0,0 +1,16 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, 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) +=============================================================================/] + +[heading Complexity] +Compile time + +[heading Example] +[dimension] +[dimension_output] diff --git a/doc/reference/core/coordinate_system.qbk b/doc/reference/core/coordinate_system.qbk new file mode 100644 index 000000000..8d636c39f --- /dev/null +++ b/doc/reference/core/coordinate_system.qbk @@ -0,0 +1,16 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, 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) +=============================================================================/] + +[heading Complexity] +Compile time + +[heading Example] +[coordinate_system] +[coordinate_system_output] diff --git a/doc/reference/core/coordinate_type.qbk b/doc/reference/core/coordinate_type.qbk new file mode 100644 index 000000000..49df07d3d --- /dev/null +++ b/doc/reference/core/coordinate_type.qbk @@ -0,0 +1,16 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, 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) +=============================================================================/] + +[heading Complexity] +Compile time + +[heading Example] +[coordinate_type] +[coordinate_type_output] diff --git a/doc/reference/core/degree_radian.qbk b/doc/reference/core/degree_radian.qbk new file mode 100644 index 000000000..cf4990b35 --- /dev/null +++ b/doc/reference/core/degree_radian.qbk @@ -0,0 +1,14 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, 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) +=============================================================================/] + + +[heading example] +[degree_radian] +[degree_radian_output] \ No newline at end of file diff --git a/doc/reference/core/max_corner.qbk b/doc/reference/core/max_corner.qbk new file mode 100644 index 000000000..fabe2ab20 --- /dev/null +++ b/doc/reference/core/max_corner.qbk @@ -0,0 +1,26 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, 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) +=============================================================================/] + +[section:max_corner max_corner] + +Indicates the maximal corner (upper right) of a box to be get, set or processed + +[heading Synopsis] +`` int const max_corner = 1; `` + +[include reference/core/min_max_corner.qbk] + +[heading See also] +* [link geometry.reference.constants.min_corner min_corner] +* [link geometry.reference.access.get.get_2_with_index get with index] +* [link geometry.reference.access.set.set_3_with_index set with index] + +[endsect] + diff --git a/doc/reference/core/min_corner.qbk b/doc/reference/core/min_corner.qbk new file mode 100644 index 000000000..eacb918b3 --- /dev/null +++ b/doc/reference/core/min_corner.qbk @@ -0,0 +1,25 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, 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) +=============================================================================/] + +[section:min_corner min_corner] + +Indicates the minimal corner (lower left) of a box to be get, set or processed + +[heading Synopsis] +`` int const min_corner = 0; `` + +[include reference/core/min_max_corner.qbk] + +[heading See also] +* [link geometry.reference.constants.max_corner max_corner] +* [link geometry.reference.access.get.get_2_with_index get with index] +* [link geometry.reference.access.set.set_3_with_index set with index] + +[endsect] diff --git a/doc/reference/core/min_max_corner.qbk b/doc/reference/core/min_max_corner.qbk new file mode 100644 index 000000000..118b0fbca --- /dev/null +++ b/doc/reference/core/min_max_corner.qbk @@ -0,0 +1,31 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, 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) +=============================================================================/] + +[/File included by min_corner.qbk and max_corner.qbk] + +[heading Header] +Either + +`#include ` + +Or + +`#include ` + +[note min_corner and max_corner are only applicable for boxes and not for, + e.g., a segment] +[note min_corner should be the minimal corner of a box, but that is not + guaranteed. Use correct to make min_corner the minimal corner. + The same applies for max_corner.] + +[/Share sample with get_box] +[heading Example] +[get_box] +[get_box_output] diff --git a/doc/reference/core/point_order.qbk b/doc/reference/core/point_order.qbk new file mode 100644 index 000000000..775ede73c --- /dev/null +++ b/doc/reference/core/point_order.qbk @@ -0,0 +1,24 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, 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) +=============================================================================/] + +[note The point order is defined for any geometry type, but only has a real meaning + for areal geometry types (ring, polygon, multi_polygon) +] + +[heading Complexity] +Compile time + +[heading Example] +[point_order] +[point_order_output] + +[heading See also] +* [link geometry.reference.enumerations.order_selector The order_selector enumeration] + diff --git a/doc/src/examples/algorithms/convert.cpp b/doc/src/examples/algorithms/convert.cpp index 2617eeaa7..5b6e377e1 100644 --- a/doc/src/examples/algorithms/convert.cpp +++ b/doc/src/examples/algorithms/convert.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include int main() diff --git a/doc/src/examples/core/Jamfile.v2 b/doc/src/examples/core/Jamfile.v2 index 9575b21cc..9609b3820 100644 --- a/doc/src/examples/core/Jamfile.v2 +++ b/doc/src/examples/core/Jamfile.v2 @@ -17,3 +17,10 @@ exe get_point : get_point.cpp ; exe get_box : get_box.cpp ; exe set_point : set_point.cpp ; exe set_box : set_box.cpp ; +exe degree_radian : degree_radian.cpp ; + +exe coordinate_type : coordinate_type.cpp ; +exe coordinate_system : coordinate_system.cpp ; +exe coordinate_dimension : coordinate_dimension.cpp ; +exe point_order : point_order.cpp ; +exe closure : closure.cpp ; diff --git a/doc/src/examples/core/closure.cpp b/doc/src/examples/core/closure.cpp new file mode 100644 index 000000000..47c40adcc --- /dev/null +++ b/doc/src/examples/core/closure.cpp @@ -0,0 +1,42 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[closure +//` Examine if a polygon is defined as "should be closed" + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + + boost::geometry::closure_selector clos = boost::geometry::closure::value; + + std::cout << "closure: " << clos << std::endl + << "(open = " << boost::geometry::open + << ", closed = " << boost::geometry::closed + << ") "<< std::endl; + + return 0; +} + +//] + + +//[closure_output +/*` +Output: +[pre +closure: 1 +(open = 0, closed = 1) +] +*/ +//] diff --git a/doc/src/examples/core/coordinate_dimension.cpp b/doc/src/examples/core/coordinate_dimension.cpp new file mode 100644 index 000000000..5061c46ce --- /dev/null +++ b/doc/src/examples/core/coordinate_dimension.cpp @@ -0,0 +1,43 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[dimension +//` Examine the number of coordinates making up the points in a linestring type + +#include +#include +#include +#include + +int main() +{ + int dim = boost::geometry::dimension + < + std::vector + < + boost::tuple + > + >::value; + + std::cout << "dimensions: " << dim << std::endl; + + return 0; +} + +//] + + +//[dimension_output +/*` +Output: +[pre +dimensions: 3 +] +*/ +//] diff --git a/doc/src/examples/core/coordinate_system.cpp b/doc/src/examples/core/coordinate_system.cpp new file mode 100644 index 000000000..48375c364 --- /dev/null +++ b/doc/src/examples/core/coordinate_system.cpp @@ -0,0 +1,38 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[coordinate_system +//` Examine the coordinate system of a point + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + + typedef boost::geometry::coordinate_system::type system; + + std::cout << "system: " << typeid(system).name() << std::endl; + + return 0; +} + +//] + + +//[coordinate_system_output +/*` +Output (using MSVC): +[pre +system: struct boost::geometry::cs::cartesian +] +*/ +//] diff --git a/doc/src/examples/core/coordinate_type.cpp b/doc/src/examples/core/coordinate_type.cpp new file mode 100644 index 000000000..263398bea --- /dev/null +++ b/doc/src/examples/core/coordinate_type.cpp @@ -0,0 +1,38 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[coordinate_type +//` Examine the coordinate type of a point + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + + typedef boost::geometry::coordinate_type::type ctype; + + std::cout << "type: " << typeid(ctype).name() << std::endl; + + return 0; +} + +//] + + +//[coordinate_type_output +/*` +Output (using MSVC): +[pre +type: double +] +*/ +//] diff --git a/doc/src/examples/core/degree_radian.cpp b/doc/src/examples/core/degree_radian.cpp new file mode 100644 index 000000000..3b8411068 --- /dev/null +++ b/doc/src/examples/core/degree_radian.cpp @@ -0,0 +1,47 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[degree_radian +//` Specify two coordinate systems, one in degrees, one in radians. + +#include +#include + +using namespace boost::geometry; + +int main() +{ + typedef model::point > degree_point; + typedef model::point > radian_point; + + degree_point d(4.893, 52.373); + radian_point r(0.041, 0.8527); + + double dist = distance(d, r); + std::cout + << "distance:" << std::endl + << dist << " over unit sphere" << std::endl + << dist * 3959 << " over a spherical earth, in miles" << std::endl; + + return 0; +} + +//] + + +//[degree_radian_output +/*` +Output: +[pre +distance: +0.0675272 over unit sphere +267.34 over a spherical earth, in miles +] +*/ +//] diff --git a/doc/src/examples/core/point_order.cpp b/doc/src/examples/core/point_order.cpp new file mode 100644 index 000000000..34e371209 --- /dev/null +++ b/doc/src/examples/core/point_order.cpp @@ -0,0 +1,42 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[point_order +//` Examine the expected point order of a polygon type + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + + boost::geometry::order_selector order = boost::geometry::point_order::value; + + std::cout << "order: " << order << std::endl + << "(clockwise = " << boost::geometry::clockwise + << ", counterclockwise = " << boost::geometry::counterclockwise + << ") "<< std::endl; + + return 0; +} + +//] + + +//[point_order_output +/*` +Output: +[pre +order: 2 +(clockwise = 1, counterclockwise = 2) +] +*/ +//] From 68fd8869c57a6912ea45b8efd61bfc4ba5e6cf67 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 18:00:03 +0000 Subject: [PATCH 39/70] Added boost/geometry.hpp Doc update (metafunctions coordinate type, system, dimensions, point_order, closure, tags degree/radian, constans min_corner, max_corner) [SVN r71325] --- include/boost/geometry.hpp | 19 +++++++++ include/boost/geometry/core/closure.hpp | 9 ++--- .../geometry/core/coordinate_dimension.hpp | 39 ++++++++++--------- .../boost/geometry/core/coordinate_system.hpp | 13 ++++--- .../boost/geometry/core/coordinate_type.hpp | 7 +++- include/boost/geometry/core/cs.hpp | 12 ++++-- include/boost/geometry/core/point_order.hpp | 10 ++--- 7 files changed, 67 insertions(+), 42 deletions(-) create mode 100644 include/boost/geometry.hpp diff --git a/include/boost/geometry.hpp b/include/boost/geometry.hpp new file mode 100644 index 000000000..a4756e714 --- /dev/null +++ b/include/boost/geometry.hpp @@ -0,0 +1,19 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2011 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + +// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library +// (geolib/GGL), copyright (c) 1995-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_HPP +#define BOOST_GEOMETRY_HPP + +#include + +#endif // BOOST_GEOMETRY_HPP diff --git a/include/boost/geometry/core/closure.hpp b/include/boost/geometry/core/closure.hpp index 858ac906d..bb806b3aa 100644 --- a/include/boost/geometry/core/closure.hpp +++ b/include/boost/geometry/core/closure.hpp @@ -149,14 +149,11 @@ struct closure /*! -\brief Meta-function which defines closure of a geometry type +\brief \brief_meta{value, closure (clockwise\, counterclockwise), \meta_geometry_type} +\tparam Geometry \tparam_geometry \ingroup core -\details -\qbk{ -[heading See also] -[link geometry.reference.enumerations.order_selector The order_selector enumeration] -} +\qbk{[include reference/core/closure.qbk]} */ template struct closure diff --git a/include/boost/geometry/core/coordinate_dimension.hpp b/include/boost/geometry/core/coordinate_dimension.hpp index 8d7ebe3d0..73543eae9 100644 --- a/include/boost/geometry/core/coordinate_dimension.hpp +++ b/include/boost/geometry/core/coordinate_dimension.hpp @@ -65,53 +65,56 @@ struct dimension : traits::dimension

{}; #endif /*! - \brief Meta-function which defines coordinate dimensions, i.e. the number of axes of any geometry - \ingroup core +\brief \brief_meta{value, number of coordinates (the number of axes of any geometry), \meta_point_type} +\tparam Geometry \tparam_geometry +\ingroup core + +\qbk{[include reference/core/coordinate_dimension.qbk]} */ -template +template struct dimension : core_dispatch::dimension < - typename tag::type, - typename boost::remove_const::type + typename tag::type, + typename boost::remove_const::type > {}; /*! - \brief assert_dimension, enables compile-time checking if coordinate dimensions are as expected - \ingroup utility +\brief assert_dimension, enables compile-time checking if coordinate dimensions are as expected +\ingroup utility */ -template +template inline void assert_dimension() { BOOST_STATIC_ASSERT(( boost::mpl::equal_to < - geometry::dimension, - boost::mpl::int_ + geometry::dimension, + boost::mpl::int_ >::type::value )); } /*! - \brief assert_dimension, enables compile-time checking if coordinate dimensions are as expected - \ingroup utility +\brief assert_dimension, enables compile-time checking if coordinate dimensions are as expected +\ingroup utility */ -template +template inline void assert_dimension_less_equal() { - BOOST_STATIC_ASSERT(( dimension::type::value <= D )); + BOOST_STATIC_ASSERT(( dimension::type::value <= Dimensions )); } -template +template inline void assert_dimension_greater_equal() { - BOOST_STATIC_ASSERT(( dimension::type::value >= D )); + BOOST_STATIC_ASSERT(( dimension::type::value >= Dimensions )); } /*! - \brief assert_dimension_equal, enables compile-time checking if coordinate dimensions of two geometries are equal - \ingroup utility +\brief assert_dimension_equal, enables compile-time checking if coordinate dimensions of two geometries are equal +\ingroup utility */ template inline void assert_dimension_equal() diff --git a/include/boost/geometry/core/coordinate_system.hpp b/include/boost/geometry/core/coordinate_system.hpp index e3b5718a9..9c0920cd6 100644 --- a/include/boost/geometry/core/coordinate_system.hpp +++ b/include/boost/geometry/core/coordinate_system.hpp @@ -73,16 +73,19 @@ namespace core_dispatch /*! - \brief Meta-function which defines coordinate system for any geometry - \ingroup core +\brief \brief_meta{type, coordinate system (cartesian\, spherical\, etc), \meta_point_type} +\tparam Geometry \tparam_geometry +\ingroup core + +\qbk{[include reference/core/coordinate_system.qbk]} */ -template +template struct coordinate_system { - typedef typename boost::remove_const::type ncg; + typedef typename boost::remove_const::type ncg; typedef typename core_dispatch::coordinate_system < - typename tag::type, + typename tag::type, ncg >::type type; }; diff --git a/include/boost/geometry/core/coordinate_type.hpp b/include/boost/geometry/core/coordinate_type.hpp index 720ec9128..ae4300a65 100644 --- a/include/boost/geometry/core/coordinate_type.hpp +++ b/include/boost/geometry/core/coordinate_type.hpp @@ -70,8 +70,11 @@ struct coordinate_type #endif // DOXYGEN_NO_DISPATCH /*! - \brief Meta-function which defines coordinate type (int, float, double, etc) of any geometry - \ingroup core +\brief \brief_meta{type, coordinate type (int\, float\, double\, etc), \meta_point_type} +\tparam Geometry \tparam_geometry +\ingroup core + +\qbk{[include reference/core/coordinate_type.qbk]} */ template struct coordinate_type diff --git a/include/boost/geometry/core/cs.hpp b/include/boost/geometry/core/cs.hpp index fcbad5ae2..93e0eec77 100644 --- a/include/boost/geometry/core/cs.hpp +++ b/include/boost/geometry/core/cs.hpp @@ -27,16 +27,20 @@ namespace boost { namespace geometry /*! \brief Unit of plane angle: Degrees -\ingroup cs -\note Might be replaced by Boost.Units +\details Tag defining the unit of plane angle for spherical coordinate systems. + This tag specifies that coordinates are defined in degrees (-180 .. 180). + It has to be specified for some coordinate systems. +\qbk{[include reference/core/degree_radian.qbk]} */ struct degree {}; /*! \brief Unit of plane angle: Radians -\ingroup cs -\note Might be replaced by Boost.Units +\details Tag defining the unit of plane angle for spherical coordinate systems. + This tag specifies that coordinates are defined in radians (-PI .. PI). + It has to be specified for some coordinate systems. +\qbk{[include reference/core/degree_radian.qbk]} */ struct radian {}; diff --git a/include/boost/geometry/core/point_order.hpp b/include/boost/geometry/core/point_order.hpp index 7dd55634b..675fee802 100644 --- a/include/boost/geometry/core/point_order.hpp +++ b/include/boost/geometry/core/point_order.hpp @@ -138,19 +138,15 @@ struct point_order /*! -\brief Metafunction which defines point order of a geometry type +\brief \brief_meta{value, point order (clockwise\, counterclockwise), \meta_geometry_type} +\tparam Geometry \tparam_geometry \ingroup core -\details -\qbk{ -[heading See also] -[link geometry.reference.enumerations.closure_selector The closure_selector enumeration] -} +\qbk{[include reference/core/point_order.qbk]} */ template struct point_order { - /// metafunction implementation static const order_selector value = core_dispatch::point_order < typename tag::type, From 5be2736b4bbd0c6ccce2a4463b628b8106120906 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 18:05:13 +0000 Subject: [PATCH 40/70] Added headerfiles now missing for clang [SVN r71326] --- include/boost/geometry/algorithms/detail/partition.hpp | 1 + include/boost/geometry/algorithms/envelope.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/include/boost/geometry/algorithms/detail/partition.hpp b/include/boost/geometry/algorithms/detail/partition.hpp index 3fbd98b77..59bdad706 100644 --- a/include/boost/geometry/algorithms/detail/partition.hpp +++ b/include/boost/geometry/algorithms/detail/partition.hpp @@ -10,6 +10,7 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_PARTITION_HPP #include +#include #include #include diff --git a/include/boost/geometry/algorithms/envelope.hpp b/include/boost/geometry/algorithms/envelope.hpp index 370812f55..0964affd1 100644 --- a/include/boost/geometry/algorithms/envelope.hpp +++ b/include/boost/geometry/algorithms/envelope.hpp @@ -19,6 +19,7 @@ #include +#include #include #include #include From 8cca47c971d72a014b9dddd88f6bcf362589aaa7 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 20:42:57 +0000 Subject: [PATCH 41/70] Doc update (metafunctions tag, tag_cast, point_type) [SVN r71329] --- .../geometry/core/coordinate_dimension.hpp | 1 - include/boost/geometry/core/point_type.hpp | 7 ++++-- include/boost/geometry/core/tag.hpp | 8 +++---- include/boost/geometry/core/tag_cast.hpp | 24 ++++++++++++++++++- include/boost/geometry/geometry.hpp | 1 + 5 files changed, 33 insertions(+), 8 deletions(-) diff --git a/include/boost/geometry/core/coordinate_dimension.hpp b/include/boost/geometry/core/coordinate_dimension.hpp index 73543eae9..f9f9055ba 100644 --- a/include/boost/geometry/core/coordinate_dimension.hpp +++ b/include/boost/geometry/core/coordinate_dimension.hpp @@ -22,7 +22,6 @@ #include #include -#include #include namespace boost { namespace geometry diff --git a/include/boost/geometry/core/point_type.hpp b/include/boost/geometry/core/point_type.hpp index efaaead92..4217afdad 100644 --- a/include/boost/geometry/core/point_type.hpp +++ b/include/boost/geometry/core/point_type.hpp @@ -106,8 +106,11 @@ struct point_type /*! - \brief Meta-function which defines point type of any geometry - \ingroup core +\brief \brief_meta{type, point_type, \meta_geometry_type} +\tparam Geometry \tparam_geometry +\ingroup core + +\qbk{[include reference/core/point_type.qbk]} */ template struct point_type diff --git a/include/boost/geometry/core/tag.hpp b/include/boost/geometry/core/tag.hpp index 702ab3ec1..f8f622e74 100644 --- a/include/boost/geometry/core/tag.hpp +++ b/include/boost/geometry/core/tag.hpp @@ -48,11 +48,11 @@ struct tag /*! -\brief Meta-function to get the tag of any geometry type -\details All geometries tell their geometry type (point, linestring, polygon, etc) by implementing - a tag traits class. This meta-function uses that traits class to retrieve the tag. -\tparam Geometry geometry +\brief \brief_meta{type, tag, \meta_geometry_type} +\tparam Geometry \tparam_geometry \ingroup core + +\qbk{[include reference/core/tag.qbk]} */ template struct tag diff --git a/include/boost/geometry/core/tag_cast.hpp b/include/boost/geometry/core/tag_cast.hpp index 1318f265f..cf1bd0b6e 100644 --- a/include/boost/geometry/core/tag_cast.hpp +++ b/include/boost/geometry/core/tag_cast.hpp @@ -21,7 +21,25 @@ namespace boost { namespace geometry { -/// Generic tag_cast utility +/*! +\brief Metafunction defining a type being either the specified tag, or one + of the specified basetags if the type inherits from them. +\details Tags can inherit each other. A multi_point inherits, for example, + both the multi_tag and the pointlike tag. Often behaviour can be shared + between different geometry types. A tag, found by the metafunction tag, + can be casted to a more basic tag, and then dispatched by that tag. +\ingroup core +\tparam Tag The tag to be casted to one of the base tags +\tparam BaseTag First base tag +\tparam BaseTag2 Optional second base tag +\tparam BaseTag3 Optional third base tag +\tparam BaseTag4 Optional fourth base tag +\tparam BaseTag5 Optional fifth base tag +\tparam BaseTag6 Optional sixth base tag +\tparam BaseTag7 Optional seventh base tag + +\qbk{[include reference/core/tag_cast.qbk]} +*/ template < typename Tag, @@ -48,6 +66,8 @@ struct tag_cast >::type type; }; +#ifndef DOXYGEN_NO_SPECIALIZATIONS + // Specialization for last one template struct tag_cast @@ -56,6 +76,8 @@ struct tag_cast typedef Tag type; }; +#endif // DOXYGEN_NO_SPECIALIZATIONS + }} // namespace boost::geometry diff --git a/include/boost/geometry/geometry.hpp b/include/boost/geometry/geometry.hpp index 33b07f418..c5586eeaf 100644 --- a/include/boost/geometry/geometry.hpp +++ b/include/boost/geometry/geometry.hpp @@ -19,6 +19,7 @@ #include #include +#include #include // Core algorithms From 373f4dc5f4ba27e7292aa03a7be0594d91a7b9fe Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 20:43:54 +0000 Subject: [PATCH 42/70] Doc update (metafunctions tag, tag_cast, point_type) [SVN r71330] --- doc/imports.qbk | 4 ++ doc/make_qbk.py | 4 +- doc/quickref.xml | 7 +-- doc/reference.qbk | 3 +- doc/reference/core/point_type.qbk | 17 ++++++++ doc/reference/core/tag.qbk | 20 +++++++++ doc/reference/core/tag_cast.qbk | 26 +++++++++++ doc/src/examples/core/Jamfile.v2 | 4 ++ doc/src/examples/core/coordinate_system.cpp | 1 + doc/src/examples/core/coordinate_type.cpp | 1 + doc/src/examples/core/point_type.cpp | 40 +++++++++++++++++ doc/src/examples/core/tag.cpp | 48 +++++++++++++++++++++ doc/src/examples/core/tag_cast.cpp | 43 ++++++++++++++++++ 13 files changed, 209 insertions(+), 9 deletions(-) create mode 100644 doc/reference/core/point_type.qbk create mode 100644 doc/reference/core/tag.qbk create mode 100644 doc/reference/core/tag_cast.qbk create mode 100644 doc/src/examples/core/point_type.cpp create mode 100644 doc/src/examples/core/tag.cpp create mode 100644 doc/src/examples/core/tag_cast.cpp diff --git a/doc/imports.qbk b/doc/imports.qbk index 357a79055..208bb28d8 100644 --- a/doc/imports.qbk +++ b/doc/imports.qbk @@ -69,5 +69,9 @@ [import src/examples/core/set_box.cpp] [import src/examples/core/degree_radian.cpp] +[import src/examples/core/point_type.cpp] +[import src/examples/core/tag.cpp] +[import src/examples/core/tag_cast.cpp] + [import src/examples/geometries/point.cpp] [import src/examples/geometries/register/point.cpp] diff --git a/doc/make_qbk.py b/doc/make_qbk.py index 3442616b5..c57c66b40 100755 --- a/doc/make_qbk.py +++ b/doc/make_qbk.py @@ -81,10 +81,10 @@ access_functions = ["get", "set", "exterior_ring", "interior_rings" coordinate_systems = ["cartesian", "geographic", "polar", "spherical"] core = ["closure", "coordinate_system", "coordinate_type", "cs_tag" - , "dimension", "exception", "geometry_id", "interior_type" + , "dimension", "exception", "interior_type" , "degree", "radian" , "is_radian", "point_order" - , "point_type", "ring_type", "tag", "topological_dimension" ] + , "point_type", "ring_type", "tag", "tag_cast" ] exceptions = ["exception", "centroid_exception"]; diff --git a/doc/quickref.xml b/doc/quickref.xml index 676f0eaa5..3241aba28 100644 --- a/doc/quickref.xml +++ b/doc/quickref.xml @@ -133,20 +133,17 @@ Metafunctions cs_tag + closure coordinate_type coordinate_system dimension - geometry_id interior_type is_radian point_order point_type ring_type - tag - topological_dimension + tag_cast diff --git a/doc/reference.qbk b/doc/reference.qbk index 945a17ddc..54cb12783 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -176,7 +176,6 @@ [include generated/degree.qbk] [include generated/dimension.qbk] [include generated/exception.qbk] -[include generated/geometry_id.qbk] [include generated/interior_type.qbk] [include generated/is_radian.qbk] [include generated/point_order.qbk] @@ -184,7 +183,7 @@ [include generated/radian.qbk] [include generated/ring_type.qbk] [include generated/tag.qbk] -[include generated/topological_dimension.qbk] +[include generated/tag_cast.qbk] [endsect] [/core metafunctions] [section:enumerations Enumerations] diff --git a/doc/reference/core/point_type.qbk b/doc/reference/core/point_type.qbk new file mode 100644 index 000000000..2f568ab69 --- /dev/null +++ b/doc/reference/core/point_type.qbk @@ -0,0 +1,17 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, 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) +=============================================================================/] + + +[heading Complexity] +Compile time + +[heading Example] +[point_type] +[point_type_output] diff --git a/doc/reference/core/tag.qbk b/doc/reference/core/tag.qbk new file mode 100644 index 000000000..c7d7711ae --- /dev/null +++ b/doc/reference/core/tag.qbk @@ -0,0 +1,20 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, 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) +=============================================================================/] + +[note With Boost.Geometry, tags are the driving force of the tag dispatching + mechanism. The tag metafunction is therefore used in every free function. +] + +[heading Complexity] +Compile time + +[heading Example] +[tag] +[tag_output] diff --git a/doc/reference/core/tag_cast.qbk b/doc/reference/core/tag_cast.qbk new file mode 100644 index 000000000..cfe02dd6a --- /dev/null +++ b/doc/reference/core/tag_cast.qbk @@ -0,0 +1,26 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, 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) +=============================================================================/] + +[note The specified tag list is handled in the specified order: as soon as a tag + inheriting the specified tag is found, it is defined as the metafunction + typedef [*type]. +] + +[note If none of the specified possible base tags is a base class of the + specified tag, the tag itself is defined as the [*type] result of the + metafunction. +] +[heading Complexity] +Compile time + +[heading Example] +[tag_cast] +[tag_cast_output] + diff --git a/doc/src/examples/core/Jamfile.v2 b/doc/src/examples/core/Jamfile.v2 index 9609b3820..53d08c43a 100644 --- a/doc/src/examples/core/Jamfile.v2 +++ b/doc/src/examples/core/Jamfile.v2 @@ -24,3 +24,7 @@ exe coordinate_system : coordinate_system.cpp ; exe coordinate_dimension : coordinate_dimension.cpp ; exe point_order : point_order.cpp ; exe closure : closure.cpp ; + +exe point_type : point_type.cpp ; +exe tag : tag.cpp ; +exe tag_cast : tag_cast.cpp ; diff --git a/doc/src/examples/core/coordinate_system.cpp b/doc/src/examples/core/coordinate_system.cpp index 48375c364..0152aabf4 100644 --- a/doc/src/examples/core/coordinate_system.cpp +++ b/doc/src/examples/core/coordinate_system.cpp @@ -11,6 +11,7 @@ //` Examine the coordinate system of a point #include +#include #include int main() diff --git a/doc/src/examples/core/coordinate_type.cpp b/doc/src/examples/core/coordinate_type.cpp index 263398bea..ebeea7e3c 100644 --- a/doc/src/examples/core/coordinate_type.cpp +++ b/doc/src/examples/core/coordinate_type.cpp @@ -11,6 +11,7 @@ //` Examine the coordinate type of a point #include +#include #include int main() diff --git a/doc/src/examples/core/point_type.cpp b/doc/src/examples/core/point_type.cpp new file mode 100644 index 000000000..2f1b499b7 --- /dev/null +++ b/doc/src/examples/core/point_type.cpp @@ -0,0 +1,40 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[point_type +//` Examine the point type of a multi_polygon + +#include +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + typedef boost::geometry::model::multi_polygon mp_type; + + typedef boost::geometry::point_type::type ptype; + + std::cout << "point type: " << typeid(ptype).name() << std::endl; + + return 0; +} + +//] + + +//[point_type_output +/*` +Output (in MSVC): +[pre +point type: class boost::geometry::model::d2::point_xy +] +*/ +//] diff --git a/doc/src/examples/core/tag.cpp b/doc/src/examples/core/tag.cpp new file mode 100644 index 000000000..895c528bb --- /dev/null +++ b/doc/src/examples/core/tag.cpp @@ -0,0 +1,48 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[tag +//` Examine the tag of some geometry types + +#include +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + typedef boost::geometry::model::multi_polygon mp_type; + + typedef boost::geometry::tag::type tag1; + typedef boost::geometry::tag::type tag2; + typedef boost::geometry::tag::type tag3; + + std::cout + << "tag 1: " << typeid(tag1).name() << std::endl + << "tag 2: " << typeid(tag2).name() << std::endl + << "tag 3: " << typeid(tag3).name() << std::endl + ; + + return 0; +} + +//] + + +//[tag_output +/*` +Output (in MSVC): +[pre +tag 1: struct boost::geometry::point_tag +tag 2: struct boost::geometry::polygon_tag +tag 3: struct boost::geometry::multi_polygon_tag +] +*/ +//] diff --git a/doc/src/examples/core/tag_cast.cpp b/doc/src/examples/core/tag_cast.cpp new file mode 100644 index 000000000..7f4ab3e0e --- /dev/null +++ b/doc/src/examples/core/tag_cast.cpp @@ -0,0 +1,43 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[tag_cast +//` Check if the polygon_tag can be casted to the areal_tag + +#include +#include +#include + +namespace geo = boost::geometry; +int main() +{ + typedef geo::model::d2::point_xy point_type; + typedef geo::model::polygon polygon_type; + + typedef geo::tag::type tag; + typedef geo::tag_cast::type base_tag; + + std::cout << "tag: " << typeid(tag).name() << std::endl + << "base tag: " << typeid(base_tag).name() << std::endl; + + return 0; +} + +//] + + +//[tag_cast_output +/*` +Output (in MSVC): +[pre +tag: struct boost::geometry::polygon_tag +base tag: struct boost::geometry::areal_tag +] +*/ +//] From 6b023357d51892f660cefb96284edc2aaa15e97d Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 23:42:17 +0000 Subject: [PATCH 43/70] Added distance_status.qbk [SVN r71342] --- doc/generated/distance_status.qbk | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/generated/distance_status.qbk diff --git a/doc/generated/distance_status.qbk b/doc/generated/distance_status.qbk new file mode 100644 index 000000000..e9739e234 --- /dev/null +++ b/doc/generated/distance_status.qbk @@ -0,0 +1,13 @@ +[heading Supported geometries] +[table +[[ ][Point][Segment][Box][Linestring][Ring][Polygon][MultiPoint][MultiLinestring][MultiPolygon]] +[[Point][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/nyi.png] ][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/ok.png ] ]] +[[Segment][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]] +[[Box][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]] +[[Linestring][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/nyi.png] ]] +[[Ring][ [$img/ok.png ] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ]] +[[Polygon][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/nyi.png] ]] +[[MultiPoint][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/nyi.png] ][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/ok.png ] ]] +[[MultiLinestring][ [$img/ok.png ] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/nyi.png] ]] +[[MultiPolygon][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/nyi.png] ][ [$img/ok.png ] ][ [$img/ok.png ] ][ [$img/nyi.png] ]] +] From 0b9230931c2098822e87efe866c45785f0fb67c0 Mon Sep 17 00:00:00 2001 From: Bruno Lalande Date: Sun, 17 Apr 2011 09:55:12 +0000 Subject: [PATCH 44/70] Generalized Boost.Tuple adaptation to nD. [SVN r71349] --- .../geometry/geometries/adapted/tuple.hpp | 87 ++++++------------- .../geometries/adapted/tuple_cartesian.hpp | 12 +-- .../geometries/adapted/tuple_geographic.hpp | 12 +-- test/geometries/Jamfile.v2 | 3 + test/geometries/adapted.cpp | 9 +- 5 files changed, 47 insertions(+), 76 deletions(-) diff --git a/include/boost/geometry/geometries/adapted/tuple.hpp b/include/boost/geometry/geometries/adapted/tuple.hpp index f26b8e08b..97347b092 100644 --- a/include/boost/geometry/geometries/adapted/tuple.hpp +++ b/include/boost/geometry/geometries/adapted/tuple.hpp @@ -32,95 +32,60 @@ namespace boost { namespace geometry namespace traits { -// boost::tuple, 2D -template -struct coordinate_type > -{ - typedef CoordinateType type; -}; - -template -struct dimension > - : boost::mpl::int_<2> -{}; - - -template -struct access - < - boost::tuple, - Dimension - > -{ - static inline CoordinateType get( - boost::tuple const& point) - { - return point.template get(); - } - - static inline void set(boost::tuple& point, - CoordinateType const& value) - { - point.template get() = value; - } -}; - - -template -struct tag > +template +struct tag > { typedef point_tag type; }; -// boost::tuple, 3D -template -struct coordinate_type - < - boost::tuple - > +template +struct coordinate_type > { - typedef CoordinateType type; + typedef T1 type; }; -template -struct dimension > - : boost::mpl::int_<3> + +template +struct dimension > + : boost::mpl::int_ + < + boost::tuples::length + < + boost::tuple + >::value + > {}; -template +template struct access < - boost::tuple, + boost::tuple, Dimension > { - static inline CoordinateType get( - boost::tuple - < - CoordinateType, CoordinateType, CoordinateType - > const& point) + static inline T1 get( + boost::tuple const& point) { return point.template get(); } static inline void set( - boost::tuple& point, - CoordinateType const& value) + boost::tuple& point, + T1 const& value) { point.template get() = value; } }; -template -struct tag > -{ - typedef point_tag type; -}; - // The library user has // 1) either to specify the coordinate system using a traits class // 2) or include diff --git a/include/boost/geometry/geometries/adapted/tuple_cartesian.hpp b/include/boost/geometry/geometries/adapted/tuple_cartesian.hpp index b6e9cd682..f4969f7be 100644 --- a/include/boost/geometry/geometries/adapted/tuple_cartesian.hpp +++ b/include/boost/geometry/geometries/adapted/tuple_cartesian.hpp @@ -31,13 +31,13 @@ namespace boost { namespace geometry #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS namespace traits { - template - struct coordinate_system > - { typedef cs::cartesian type; }; - template - struct coordinate_system > - { typedef cs::cartesian type; }; + +template +struct coordinate_system > +{ typedef cs::cartesian type; }; + } #endif diff --git a/include/boost/geometry/geometries/adapted/tuple_geographic.hpp b/include/boost/geometry/geometries/adapted/tuple_geographic.hpp index da0c702ee..37cf4b14d 100644 --- a/include/boost/geometry/geometries/adapted/tuple_geographic.hpp +++ b/include/boost/geometry/geometries/adapted/tuple_geographic.hpp @@ -31,13 +31,13 @@ namespace boost { namespace geometry #ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS namespace traits { - template - struct coordinate_system > - { typedef cs::geographic type; }; - template - struct coordinate_system > - { typedef cs::geographic type; }; + +template +struct coordinate_system > +{ typedef cs::geographic type; }; + } #endif diff --git a/test/geometries/Jamfile.v2 b/test/geometries/Jamfile.v2 index 35c197764..266980536 100644 --- a/test/geometries/Jamfile.v2 +++ b/test/geometries/Jamfile.v2 @@ -10,10 +10,13 @@ test-suite boost-geometry-geometries : + [ run adapted.cpp ] [ run boost_array_as_point.cpp ] [ run boost_fusion.cpp ] [ run boost_polygon.cpp ] [ run boost_range.cpp ] + [ run boost_tuple_cartesian.cpp ] + [ run boost_tuple_geographic.cpp ] [ run box.cpp ] #[ compile-fail custom_linestring.cpp # : # requirements diff --git a/test/geometries/adapted.cpp b/test/geometries/adapted.cpp index 309324fc1..6ce4ddf98 100644 --- a/test/geometries/adapted.cpp +++ b/test/geometries/adapted.cpp @@ -93,15 +93,18 @@ void test_all() int test_main(int, char* []) { -/* test_all(); + test_all(); test_all >(); test_all >(); test_all >(); test_all >(); test_all >(); -*/ + + test_all >(); test_all >(); - //test_all >(); + test_all >(); + + test_all >(); return 0; } From 8a449c8bdb07d5012c6bf8f38595f9675189f688 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sun, 17 Apr 2011 20:55:57 +0000 Subject: [PATCH 45/70] Added check for valid input for all intersections. If not valid, it throws. [SVN r71357] --- .../detail/has_self_intersections.hpp | 121 ++++++++++++++++++ .../algorithms/detail/overlay/overlay.hpp | 5 + .../detail/overlay/self_turn_points.hpp | 27 +++- 3 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 include/boost/geometry/algorithms/detail/has_self_intersections.hpp diff --git a/include/boost/geometry/algorithms/detail/has_self_intersections.hpp b/include/boost/geometry/algorithms/detail/has_self_intersections.hpp new file mode 100644 index 000000000..c6144f4d1 --- /dev/null +++ b/include/boost/geometry/algorithms/detail/has_self_intersections.hpp @@ -0,0 +1,121 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2011 Barend Gehrels, 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_HAS_SELF_INTERSECTIONS_HPP +#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_HAS_SELF_INTERSECTIONS_HPP + +#include + +#include +#include +#include +#include +#include + +#include + +#ifdef BOOST_GEOMETRY_DEBUG_HAS_SELF_INTERSECTIONS +# include +# include +#endif + + +namespace boost { namespace geometry +{ + + +#if ! defined(BOOST_GEOMETRY_OVERLAY_NO_THROW) + +/*! +\brief Overlay Invalid Input Exception +\ingroup overlay +\details The overlay_invalid_input_exception is thrown at invalid input + */ +class overlay_invalid_input_exception : public geometry::exception +{ +public: + + inline overlay_invalid_input_exception() {} + + virtual char const* what() const throw() + { + return "Boost.Geometry Overlay invald input exception"; + } +}; + +#endif + + +#ifndef DOXYGEN_NO_DETAIL +namespace detail { namespace overlay +{ + + +template +inline bool has_self_intersections(Geometry const& geometry) +{ + using namespace boost::geometry; + typedef typename point_type::type point_type; + typedef detail::overlay::turn_info turn_info; + std::deque turns; + detail::get_turns::no_interrupt_policy policy; + geometry::self_turns(geometry, turns, policy); + +#ifdef BOOST_GEOMETRY_DEBUG_HAS_SELF_INTERSECTIONS + bool first = true; +#endif + for(typename std::deque::const_iterator it = boost::begin(turns); + it != boost::end(turns); ++it) + { + turn_info const& info = *it; + bool const both_union_turn = + info.operations[0].operation == detail::overlay::operation_union + && info.operations[1].operation == detail::overlay::operation_union; + bool const both_intersection_turn = + info.operations[0].operation == detail::overlay::operation_intersection + && info.operations[1].operation == detail::overlay::operation_intersection; + + bool const valid = (both_union_turn || both_intersection_turn) + && (info.method == detail::overlay::method_touch + || info.method == detail::overlay::method_touch_interior); + + if (! valid) + { +#ifdef BOOST_GEOMETRY_DEBUG_HAS_SELF_INTERSECTIONS + if (first) + { + std::cout << "turn points: " << std::endl; + first = false; + } + std::cout << method_char(info.method); + for (int i = 0; i < 2; i++) + { + std::cout << " " << operation_char(info.operations[i].operation); + } + std::cout << " " << geometry::dsv(info.point) << std::endl; +#endif + +#if ! defined(BOOST_GEOMETRY_OVERLAY_NO_THROW) + throw overlay_invalid_input_exception(); +#endif + } + + } + return false; +} + + +}} // namespace detail::overlay +#endif // DOXYGEN_NO_DETAIL + + +}} // namespace boost::geometry + + +#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_HAS_SELF_INTERSECTIONS_HPP + diff --git a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp index a469dd93a..459ccb1bd 100644 --- a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp @@ -25,6 +25,8 @@ #include #include +#include + #include #include @@ -168,6 +170,9 @@ struct overlay GeometryOut, Direction, ReverseOut >(geometry1, geometry2, out); } + + has_self_intersections(geometry1); + has_self_intersections(geometry2); container_type turn_points; diff --git a/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp b/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp index 3efe5c7d7..f996b60ea 100644 --- a/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp @@ -136,6 +136,31 @@ struct self_get_turn_points {}; +template +< + typename Box, + typename Turns, + typename TurnPolicy, + typename InterruptPolicy +> +struct self_get_turn_points + < + box_tag, Box, + Turns, + TurnPolicy, + InterruptPolicy + > +{ + static inline bool apply( + Box const& , + Turns& , + InterruptPolicy& ) + { + return true; + } +}; + + template < typename Polygon, @@ -182,7 +207,7 @@ template typename Turns, typename InterruptPolicy > -inline void get_turns(Geometry const& geometry, +inline void self_turns(Geometry const& geometry, Turns& turns, InterruptPolicy& interrupt_policy) { concept::check(); From ab5f5590e8c9902fb9e2c4e7a79582566242cbe4 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sun, 17 Apr 2011 20:57:18 +0000 Subject: [PATCH 46/70] Added test for exception on invalid input. Bugfix in one of the tests (77) which was indeed invalid [SVN r71358] --- test/algorithms/intersection.cpp | 21 +++++++++++++++++++ .../overlay/self_intersection_points.cpp | 2 +- .../overlay/multi_overlay_cases.hpp | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/test/algorithms/intersection.cpp b/test/algorithms/intersection.cpp index 5a7b2c647..1e8814d4d 100644 --- a/test/algorithms/intersection.cpp +++ b/test/algorithms/intersection.cpp @@ -350,10 +350,31 @@ void test_pointer_version() } +template +void test_exception() +{ + typedef bg::model::polygon

polygon; + try + { + // Define polygon with a spike (= invalid) + std::string spike = "POLYGON((0 0,0 4,2 4,2 6,2 4,4 4,4 0,0 0))"; + + test_one("with_spike", + simplex_normal[0], spike, + 0, 0, 0); + } + catch(bg::overlay_invalid_input_exception const& ) + { + return; + } + BOOST_CHECK_MESSAGE(false, "No exception thrown"); +} int test_main(int, char* []) { + test_exception >(); + test_all >(); #if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) diff --git a/test/algorithms/overlay/self_intersection_points.cpp b/test/algorithms/overlay/self_intersection_points.cpp index 763243a89..7425ec4ac 100644 --- a/test/algorithms/overlay/self_intersection_points.cpp +++ b/test/algorithms/overlay/self_intersection_points.cpp @@ -53,7 +53,7 @@ struct test_self_intersection_points ///bg::get_intersection_points(geometry, turns); bg::detail::get_turns::no_interrupt_policy policy; - bg::get_turns + bg::self_turns < bg::detail::overlay::assign_null_policy >(geometry, turns, policy); diff --git a/test/multi/algorithms/overlay/multi_overlay_cases.hpp b/test/multi/algorithms/overlay/multi_overlay_cases.hpp index 20da40441..544e79126 100644 --- a/test/multi/algorithms/overlay/multi_overlay_cases.hpp +++ b/test/multi/algorithms/overlay/multi_overlay_cases.hpp @@ -138,7 +138,7 @@ static std::string case_77_multi[2] = // -> went wrong in the assemble phase for intersection (traversal is OK) // -> fixed "MULTIPOLYGON(((3 3,3 4,4 4,4 3,3 3)),((5 3,5 4,4 4,4 5,3 5,3 6,5 6,5 5,7 5,7 6,8 6,8 5,9 5,9 2,8 2,8 1,7 1,7 2,5 2,5 3),(6 3,8 3,8 4,6 4,6 3)))", - "MULTIPOLYGON(((6 3,6 4,7 4,7 3,6 3)),((2 3,1 3,1 4,3 4,3 5,4 5,4 6,5 6,5 7,9 7,9 4,7 4,7 5,8 5,8 6,7 6,7 5,6 5,6 4,4 4,4 3,3 3,3 2,4 2,2 2,2 3)),((5 2,4 2,4 3,6 3,6 2,5 2)),((7 2,7 3,8 3,8 2,8 1,7 1,7 2)))" + "MULTIPOLYGON(((6 3,6 4,7 4,7 3,6 3)),((2 3,1 3,1 4,3 4,3 5,4 5,4 6,5 6,5 7,9 7,9 4,7 4,7 5,8 5,8 6,7 6,7 5,6 5,6 4,4 4,4 3,3 3,3 2,2 2,2 3)),((5 2,4 2,4 3,6 3,6 2,5 2)),((7 2,7 3,8 3,8 2,8 1,7 1,7 2)))" }; static std::string case_78_multi[2] = From b66c5d12bf7731fec7e6ffe00e37056b085a3b3d Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sun, 17 Apr 2011 20:58:41 +0000 Subject: [PATCH 47/70] Fixed doxygen file to omit samples not present in release branch [SVN r71359] --- doc/doxy/doxygen_input/pages/doxygen_examples.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/doxy/doxygen_input/pages/doxygen_examples.hpp b/doc/doxy/doxygen_input/pages/doxygen_examples.hpp index 665a6423e..0757e0544 100644 --- a/doc/doxy/doxygen_input/pages/doxygen_examples.hpp +++ b/doc/doxy/doxygen_input/pages/doxygen_examples.hpp @@ -157,7 +157,7 @@ Besides custom points, custom boxes are possible as shown in this example. */ //--------------------------------------------------------------------------------------------------- -/*! +/* \example c03_custom_linestring_example.cpp GPS tracks are shown in this example: a custom linestring with GPS points */ @@ -219,14 +219,14 @@ Second example showing how to get polygons from a database using SOCI and put th //--------------------------------------------------------------------------------------------------- - /*! + /* \example x03_c_soci_example.cpp Example showing how to get polygons from PostGIS using SOCI and use them in GGL through WKB */ //--------------------------------------------------------------------------------------------------- - /*! + /* \example x03_d_soci_example.cpp Example showing how to get polygons from PostGIS using SOCI and use them in GGL through WKB From 92b487587bf5ca5ee47b98b2c2e06bfb86406275 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sun, 17 Apr 2011 21:06:58 +0000 Subject: [PATCH 48/70] Commented tests not yet present [SVN r71361] --- test/geometries/Jamfile.v2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/geometries/Jamfile.v2 b/test/geometries/Jamfile.v2 index 266980536..04db92cd1 100644 --- a/test/geometries/Jamfile.v2 +++ b/test/geometries/Jamfile.v2 @@ -15,8 +15,8 @@ test-suite boost-geometry-geometries [ run boost_fusion.cpp ] [ run boost_polygon.cpp ] [ run boost_range.cpp ] - [ run boost_tuple_cartesian.cpp ] - [ run boost_tuple_geographic.cpp ] + #[ run boost_tuple_cartesian.cpp ] + #[ run boost_tuple_geographic.cpp ] [ run box.cpp ] #[ compile-fail custom_linestring.cpp # : # requirements From 0fd58eb5e320a538c589d68836e6bb3cad923cf4 Mon Sep 17 00:00:00 2001 From: Bruno Lalande Date: Mon, 18 Apr 2011 21:52:05 +0000 Subject: [PATCH 49/70] Added forgotten test files. [SVN r71374] --- test/geometries/Jamfile.v2 | 4 +-- test/geometries/boost_tuple_cartesian.cpp | 35 +++++++++++++++++++++ test/geometries/boost_tuple_geographic.cpp | 36 ++++++++++++++++++++++ 3 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 test/geometries/boost_tuple_cartesian.cpp create mode 100644 test/geometries/boost_tuple_geographic.cpp diff --git a/test/geometries/Jamfile.v2 b/test/geometries/Jamfile.v2 index 04db92cd1..266980536 100644 --- a/test/geometries/Jamfile.v2 +++ b/test/geometries/Jamfile.v2 @@ -15,8 +15,8 @@ test-suite boost-geometry-geometries [ run boost_fusion.cpp ] [ run boost_polygon.cpp ] [ run boost_range.cpp ] - #[ run boost_tuple_cartesian.cpp ] - #[ run boost_tuple_geographic.cpp ] + [ run boost_tuple_cartesian.cpp ] + [ run boost_tuple_geographic.cpp ] [ run box.cpp ] #[ compile-fail custom_linestring.cpp # : # requirements diff --git a/test/geometries/boost_tuple_cartesian.cpp b/test/geometries/boost_tuple_cartesian.cpp new file mode 100644 index 000000000..d72494b69 --- /dev/null +++ b/test/geometries/boost_tuple_cartesian.cpp @@ -0,0 +1,35 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + +// 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) + + +#include +#include +#include +#include +#include + +#include + +template +void test_all() +{ + P p1, p2; + bg::distance(p1, p2); +} + +int test_main(int, char* []) +{ + test_all >(); + test_all >(); + test_all >(); + test_all >(); + test_all >(); + + return 0; +} diff --git a/test/geometries/boost_tuple_geographic.cpp b/test/geometries/boost_tuple_geographic.cpp new file mode 100644 index 000000000..579c5d497 --- /dev/null +++ b/test/geometries/boost_tuple_geographic.cpp @@ -0,0 +1,36 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + +// 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) + + +#include +#include +#include +#include +#include + +#include + +template +void test_all() +{ + P p1, p2; +// TODO do something applicable for geographic point types +// bg::distance(p1, p2); +} + +int test_main(int, char* []) +{ + test_all >(); + test_all >(); + test_all >(); + test_all >(); + test_all >(); + + return 0; +} From c0c548769f432d065d544a57c5db95d9e48b737b Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 22 Apr 2011 11:01:31 +0000 Subject: [PATCH 50/70] Fix in interior_type [SVN r71416] --- include/boost/geometry/core/interior_type.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/geometry/core/interior_type.hpp b/include/boost/geometry/core/interior_type.hpp index 0b3aa5057..64a064ab2 100644 --- a/include/boost/geometry/core/interior_type.hpp +++ b/include/boost/geometry/core/interior_type.hpp @@ -114,7 +114,7 @@ struct interior_type typedef typename boost::remove_reference < typename interior_return_type::type - > type; + >::type type; }; From ce4539e364742a709e184ebeb1f13f51475eab1a Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 22 Apr 2011 11:03:31 +0000 Subject: [PATCH 51/70] Added / updated core examples [SVN r71417] --- doc/src/examples/core/Jamfile.v2 | 1 + doc/src/examples/core/get_box.cpp | 2 +- doc/src/examples/core/rings.cpp | 74 ++++++++++++++++++++++++ doc/src/examples/core/tag.cpp | 95 ++++++++++++++++++++++++------- 4 files changed, 152 insertions(+), 20 deletions(-) create mode 100644 doc/src/examples/core/rings.cpp diff --git a/doc/src/examples/core/Jamfile.v2 b/doc/src/examples/core/Jamfile.v2 index 53d08c43a..974039228 100644 --- a/doc/src/examples/core/Jamfile.v2 +++ b/doc/src/examples/core/Jamfile.v2 @@ -26,5 +26,6 @@ exe point_order : point_order.cpp ; exe closure : closure.cpp ; exe point_type : point_type.cpp ; +exe rings : rings.cpp ; exe tag : tag.cpp ; exe tag_cast : tag_cast.cpp ; diff --git a/doc/src/examples/core/get_box.cpp b/doc/src/examples/core/get_box.cpp index 379f8c99d..c7f6c1b3e 100644 --- a/doc/src/examples/core/get_box.cpp +++ b/doc/src/examples/core/get_box.cpp @@ -19,7 +19,7 @@ int main() { bg::model::box > box; - bg::assign(box, 1, 3, 5, 6); + bg::assign_values(box, 1, 3, 5, 6); std::cout << "Box:" << " " << bg::get(box) diff --git a/doc/src/examples/core/rings.cpp b/doc/src/examples/core/rings.cpp new file mode 100644 index 000000000..76eae12de --- /dev/null +++ b/doc/src/examples/core/rings.cpp @@ -0,0 +1,74 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[rings +/*` +Shows how to access the exterior ring (one) +and interior rings (zero or more) of a polygon. +Also shows the related ring_type and interior_type. +*/ + +#include +#include + + +int main() +{ + typedef boost::geometry::model::d2::point_xy point; + typedef boost::geometry::model::polygon polygon_type; + + polygon_type poly; + + typedef boost::geometry::ring_type::type ring_type; + ring_type& ring = boost::geometry::exterior_ring(poly); + + // For a ring of model::polygon, you can call "push_back". + // (internally, it is done using a traits::push_back class) + ring.push_back(point(0, 0)); + ring.push_back(point(0, 5)); + ring.push_back(point(5, 4)); + ring.push_back(point(0, 0)); + + ring_type inner; + inner.push_back(point(1, 1)); + inner.push_back(point(2, 1)); + inner.push_back(point(2, 2)); + inner.push_back(point(1, 1)); + + typedef boost::geometry::interior_type::type int_type; + int_type& interiors = boost::geometry::interior_rings(poly); + interiors.push_back(inner); + + std::cout << boost::geometry::dsv(poly) << std::endl; + + // So int_type defines a collection of rings, + // which is a Boost.Range compatible range + // The type of an element of the collection is the very same ring type again. + // We show that. + typedef boost::range_value::type int_ring_type; + + std::cout + //<< std::autoboolstring + << boost::is_same::value + << std::endl; + + return 0; +} + +//] + +//[rings_output +/*` +Output: +[pre +(((0, 0), (0, 5), (5, 4), (0, 0)), ((1, 1), (2, 1), (2, 2), (1, 1))) +true +] +*/ +//] diff --git a/doc/src/examples/core/tag.cpp b/doc/src/examples/core/tag.cpp index 895c528bb..281296215 100644 --- a/doc/src/examples/core/tag.cpp +++ b/doc/src/examples/core/tag.cpp @@ -8,41 +8,98 @@ // http://www.boost.org/LICENSE_1_0.txt) //[tag -//` Examine the tag of some geometry types +//` Shows how tag dispatching essentially works in Boost.Geometry #include -#include #include +#include + +#include + +template struct dispatch {}; + +// Specialization for points +template <> struct dispatch +{ + template + static inline void apply(Point const& p) + { + // Use the Boost.Geometry free function "get" + // working on all supported point types + std::cout << "Hello POINT " + << boost::geometry::get<0>(p) << ", " + << boost::geometry::get<1>(p) + << std::endl; + } +}; + +// Specialization for polygons +template <> struct dispatch +{ + template + static inline void apply(Polygon const& p) + { + // Use the Boost.Geometry manipulator "dsv" + // working on all supported geometries + std::cout << "Hello POLYGON, you look like: " + << boost::geometry::dsv(p) + << std::endl; + } +}; + +// Specialization for multipolygons +template <> struct dispatch +{ + template + static inline void apply(MultiPolygon const& m) + { + // Use the Boost.Range free function "size" because all + // multigeometries comply to Boost.Range + std::cout << "Hello MULTIPOLYGON, you contain: " + << boost::size(m) << " polygon(s)" + << std::endl; + } +}; + +template +inline void hello(Geometry const& geometry) +{ + // Call the meta-function "tag" to dispatch, and call method (here "apply") + dispatch + < + typename boost::geometry::tag::type + >::apply(geometry); +} int main() { - typedef boost::geometry::model::d2::point_xy point_type; - typedef boost::geometry::model::polygon polygon_type; - typedef boost::geometry::model::multi_polygon mp_type; + // Define polygon type (here: based on a Boost.Tuple) + typedef boost::geometry::model::polygon > polygon_type; - typedef boost::geometry::tag::type tag1; - typedef boost::geometry::tag::type tag2; - typedef boost::geometry::tag::type tag3; - - std::cout - << "tag 1: " << typeid(tag1).name() << std::endl - << "tag 2: " << typeid(tag2).name() << std::endl - << "tag 3: " << typeid(tag3).name() << std::endl - ; + // Declare and fill a polygon and a multipolygon + polygon_type poly; + boost::geometry::exterior_ring(poly) = boost::assign::tuple_list_of(0, 0)(0, 10)(10, 5)(0, 0); + + boost::geometry::model::multi_polygon multi; + multi.push_back(poly); + + // Call "hello" for point, polygon, multipolygon + hello(boost::make_tuple(2, 3)); + hello(poly); + hello(multi); return 0; } //] - //[tag_output /*` -Output (in MSVC): +Output: [pre -tag 1: struct boost::geometry::point_tag -tag 2: struct boost::geometry::polygon_tag -tag 3: struct boost::geometry::multi_polygon_tag +Hello POINT 2, 3 +Hello POLYGON, you look like: (((0, 0), (0, 10), (10, 5), (0, 0))) +Hello MULTIPOLYGON, you contain: 1 polygon(s) ] */ //] From 4a26af5fec611a1b5a4336ff2b1f5439c712ed73 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 22 Apr 2011 11:10:24 +0000 Subject: [PATCH 52/70] Changed header to boost/geometry.hpp [SVN r71418] --- doc/src/examples/algorithms/append.cpp | 2 +- doc/src/examples/algorithms/area.cpp | 2 +- doc/src/examples/algorithms/area_with_strategy.cpp | 2 +- doc/src/examples/algorithms/assign.cpp | 2 +- doc/src/examples/algorithms/assign_2d_point.cpp | 2 +- doc/src/examples/algorithms/assign_3d_point.cpp | 2 +- doc/src/examples/algorithms/assign_box_corners.cpp | 2 +- doc/src/examples/algorithms/assign_inverse.cpp | 2 +- doc/src/examples/algorithms/assign_point_from_index.cpp | 2 +- doc/src/examples/algorithms/assign_point_to_index.cpp | 2 +- doc/src/examples/algorithms/assign_points.cpp | 2 +- doc/src/examples/algorithms/centroid.cpp | 2 +- doc/src/examples/algorithms/clear.cpp | 2 +- doc/src/examples/algorithms/comparable_distance.cpp | 2 +- doc/src/examples/algorithms/convex_hull.cpp | 2 +- doc/src/examples/algorithms/correct.cpp | 2 +- doc/src/examples/algorithms/difference.cpp | 2 +- doc/src/examples/algorithms/difference_inserter.cpp | 2 +- doc/src/examples/algorithms/distance.cpp | 2 +- doc/src/examples/algorithms/envelope.cpp | 2 +- doc/src/examples/algorithms/equals.cpp | 2 +- doc/src/examples/algorithms/expand.cpp | 2 +- doc/src/examples/algorithms/for_each_point.cpp | 2 +- doc/src/examples/algorithms/for_each_point_const.cpp | 2 +- doc/src/examples/algorithms/for_each_segment_const.cpp | 2 +- doc/src/examples/algorithms/intersection_ls_ls_point.cpp | 2 +- doc/src/examples/algorithms/intersection_poly_poly.cpp | 2 +- doc/src/examples/algorithms/intersection_segment.cpp | 2 +- doc/src/examples/algorithms/intersects_linestring.cpp | 2 +- doc/src/examples/algorithms/intersects_segment.cpp | 2 +- doc/src/examples/algorithms/length.cpp | 2 +- doc/src/examples/algorithms/length_with_strategy.cpp | 2 +- doc/src/examples/algorithms/make_2d_point.cpp | 2 +- doc/src/examples/algorithms/make_3d_point.cpp | 2 +- doc/src/examples/algorithms/make_inverse.cpp | 2 +- doc/src/examples/algorithms/make_with_range.cpp | 2 +- doc/src/examples/algorithms/num_geometries.cpp | 2 +- doc/src/examples/algorithms/num_interior_rings.cpp | 2 +- doc/src/examples/algorithms/num_points.cpp | 2 +- doc/src/examples/algorithms/return_envelope.cpp | 2 +- doc/src/examples/algorithms/reverse.cpp | 2 +- doc/src/examples/algorithms/simplify.cpp | 2 +- doc/src/examples/algorithms/simplify_insert.cpp | 2 +- doc/src/examples/algorithms/simplify_insert_with_strategy.cpp | 2 +- doc/src/examples/algorithms/sym_difference.cpp | 2 +- doc/src/examples/algorithms/transform.cpp | 2 +- doc/src/examples/algorithms/transform_with_strategy.cpp | 2 +- doc/src/examples/algorithms/union.cpp | 2 +- doc/src/examples/algorithms/unique.cpp | 2 +- doc/src/examples/algorithms/within.cpp | 2 +- doc/src/examples/core/closure.cpp | 2 +- doc/src/examples/core/coordinate_dimension.cpp | 2 +- doc/src/examples/core/coordinate_system.cpp | 2 +- doc/src/examples/core/coordinate_type.cpp | 2 +- doc/src/examples/core/degree_radian.cpp | 2 +- doc/src/examples/core/get_box.cpp | 2 +- doc/src/examples/core/get_point.cpp | 2 +- doc/src/examples/core/point_order.cpp | 2 +- doc/src/examples/core/point_type.cpp | 2 +- doc/src/examples/core/rings.cpp | 2 +- doc/src/examples/core/set_box.cpp | 2 +- doc/src/examples/core/set_point.cpp | 2 +- doc/src/examples/core/tag.cpp | 2 +- doc/src/examples/core/tag_cast.cpp | 2 +- doc/src/examples/geometries/point.cpp | 2 +- doc/src/examples/geometries/register/point.cpp | 2 +- doc/src/examples/quick_start.cpp | 2 +- 67 files changed, 67 insertions(+), 67 deletions(-) diff --git a/doc/src/examples/algorithms/append.cpp b/doc/src/examples/algorithms/append.cpp index 692951433..ce7ad84f3 100644 --- a/doc/src/examples/algorithms/append.cpp +++ b/doc/src/examples/algorithms/append.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/area.cpp b/doc/src/examples/algorithms/area.cpp index d89d0012c..597bec3b4 100644 --- a/doc/src/examples/algorithms/area.cpp +++ b/doc/src/examples/algorithms/area.cpp @@ -11,7 +11,7 @@ //` Calculate the area of a polygon #include -#include +#include #include namespace bg = boost::geometry; /*< Convenient namespace alias >*/ diff --git a/doc/src/examples/algorithms/area_with_strategy.cpp b/doc/src/examples/algorithms/area_with_strategy.cpp index 808f102ff..cefbf39a2 100644 --- a/doc/src/examples/algorithms/area_with_strategy.cpp +++ b/doc/src/examples/algorithms/area_with_strategy.cpp @@ -11,7 +11,7 @@ //` Calculate the area of a polygon #include -#include +#include #include namespace bg = boost::geometry; /*< Convenient namespace alias >*/ diff --git a/doc/src/examples/algorithms/assign.cpp b/doc/src/examples/algorithms/assign.cpp index bc5b4cdc5..7309911ee 100644 --- a/doc/src/examples/algorithms/assign.cpp +++ b/doc/src/examples/algorithms/assign.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include int main() diff --git a/doc/src/examples/algorithms/assign_2d_point.cpp b/doc/src/examples/algorithms/assign_2d_point.cpp index e32f5b5c7..f21f47e0e 100644 --- a/doc/src/examples/algorithms/assign_2d_point.cpp +++ b/doc/src/examples/algorithms/assign_2d_point.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #if defined(HAVE_TTMATH) diff --git a/doc/src/examples/algorithms/assign_3d_point.cpp b/doc/src/examples/algorithms/assign_3d_point.cpp index aa3ddb683..094b8869b 100644 --- a/doc/src/examples/algorithms/assign_3d_point.cpp +++ b/doc/src/examples/algorithms/assign_3d_point.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include int main() diff --git a/doc/src/examples/algorithms/assign_box_corners.cpp b/doc/src/examples/algorithms/assign_box_corners.cpp index f6588194f..e74545bed 100644 --- a/doc/src/examples/algorithms/assign_box_corners.cpp +++ b/doc/src/examples/algorithms/assign_box_corners.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include using namespace boost::geometry; diff --git a/doc/src/examples/algorithms/assign_inverse.cpp b/doc/src/examples/algorithms/assign_inverse.cpp index 8685f1397..27d1fdf11 100644 --- a/doc/src/examples/algorithms/assign_inverse.cpp +++ b/doc/src/examples/algorithms/assign_inverse.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include using namespace boost::geometry; diff --git a/doc/src/examples/algorithms/assign_point_from_index.cpp b/doc/src/examples/algorithms/assign_point_from_index.cpp index 2f5284693..06a684afe 100644 --- a/doc/src/examples/algorithms/assign_point_from_index.cpp +++ b/doc/src/examples/algorithms/assign_point_from_index.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include using namespace boost::geometry; diff --git a/doc/src/examples/algorithms/assign_point_to_index.cpp b/doc/src/examples/algorithms/assign_point_to_index.cpp index 8cec40be8..db73730ef 100644 --- a/doc/src/examples/algorithms/assign_point_to_index.cpp +++ b/doc/src/examples/algorithms/assign_point_to_index.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include using namespace boost::geometry; diff --git a/doc/src/examples/algorithms/assign_points.cpp b/doc/src/examples/algorithms/assign_points.cpp index c74775963..30cdfd8cd 100644 --- a/doc/src/examples/algorithms/assign_points.cpp +++ b/doc/src/examples/algorithms/assign_points.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/centroid.cpp b/doc/src/examples/algorithms/centroid.cpp index e4004183a..49bb80cde 100644 --- a/doc/src/examples/algorithms/centroid.cpp +++ b/doc/src/examples/algorithms/centroid.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/clear.cpp b/doc/src/examples/algorithms/clear.cpp index f9932ed26..abe4dbdb3 100644 --- a/doc/src/examples/algorithms/clear.cpp +++ b/doc/src/examples/algorithms/clear.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/comparable_distance.cpp b/doc/src/examples/algorithms/comparable_distance.cpp index 0ed9a0490..64df6d56d 100644 --- a/doc/src/examples/algorithms/comparable_distance.cpp +++ b/doc/src/examples/algorithms/comparable_distance.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/convex_hull.cpp b/doc/src/examples/algorithms/convex_hull.cpp index f6963f092..ed290e2f4 100644 --- a/doc/src/examples/algorithms/convex_hull.cpp +++ b/doc/src/examples/algorithms/convex_hull.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include /*<-*/ #include "create_svg_two.hpp" /*->*/ diff --git a/doc/src/examples/algorithms/correct.cpp b/doc/src/examples/algorithms/correct.cpp index add730428..cacf6cf99 100644 --- a/doc/src/examples/algorithms/correct.cpp +++ b/doc/src/examples/algorithms/correct.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/difference.cpp b/doc/src/examples/algorithms/difference.cpp index 44bcf82b5..03f5cf954 100644 --- a/doc/src/examples/algorithms/difference.cpp +++ b/doc/src/examples/algorithms/difference.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/difference_inserter.cpp b/doc/src/examples/algorithms/difference_inserter.cpp index 3c54ccd5b..60d8883ac 100644 --- a/doc/src/examples/algorithms/difference_inserter.cpp +++ b/doc/src/examples/algorithms/difference_inserter.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/distance.cpp b/doc/src/examples/algorithms/distance.cpp index 3d4e71d5a..bc77e9f0e 100644 --- a/doc/src/examples/algorithms/distance.cpp +++ b/doc/src/examples/algorithms/distance.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/envelope.cpp b/doc/src/examples/algorithms/envelope.cpp index ec50f572c..fd310dae2 100644 --- a/doc/src/examples/algorithms/envelope.cpp +++ b/doc/src/examples/algorithms/envelope.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/equals.cpp b/doc/src/examples/algorithms/equals.cpp index 27b087125..e6f982d9b 100644 --- a/doc/src/examples/algorithms/equals.cpp +++ b/doc/src/examples/algorithms/equals.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/expand.cpp b/doc/src/examples/algorithms/expand.cpp index 449b48fd9..d2cb3fc4d 100644 --- a/doc/src/examples/algorithms/expand.cpp +++ b/doc/src/examples/algorithms/expand.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include int main() { diff --git a/doc/src/examples/algorithms/for_each_point.cpp b/doc/src/examples/algorithms/for_each_point.cpp index 23c3b5a37..f5a42ba55 100644 --- a/doc/src/examples/algorithms/for_each_point.cpp +++ b/doc/src/examples/algorithms/for_each_point.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/for_each_point_const.cpp b/doc/src/examples/algorithms/for_each_point_const.cpp index 51d5f7a5e..8b29ef1e9 100644 --- a/doc/src/examples/algorithms/for_each_point_const.cpp +++ b/doc/src/examples/algorithms/for_each_point_const.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/for_each_segment_const.cpp b/doc/src/examples/algorithms/for_each_segment_const.cpp index 3d0a6d914..c1ae26236 100644 --- a/doc/src/examples/algorithms/for_each_segment_const.cpp +++ b/doc/src/examples/algorithms/for_each_segment_const.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/intersection_ls_ls_point.cpp b/doc/src/examples/algorithms/intersection_ls_ls_point.cpp index 827f2b403..a4ef55ef6 100644 --- a/doc/src/examples/algorithms/intersection_ls_ls_point.cpp +++ b/doc/src/examples/algorithms/intersection_ls_ls_point.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include /*< Adapts std::vector to linestring concept >*/ diff --git a/doc/src/examples/algorithms/intersection_poly_poly.cpp b/doc/src/examples/algorithms/intersection_poly_poly.cpp index d863ca6b8..0966e1446 100644 --- a/doc/src/examples/algorithms/intersection_poly_poly.cpp +++ b/doc/src/examples/algorithms/intersection_poly_poly.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/intersection_segment.cpp b/doc/src/examples/algorithms/intersection_segment.cpp index bbbc1d497..d9a902436 100644 --- a/doc/src/examples/algorithms/intersection_segment.cpp +++ b/doc/src/examples/algorithms/intersection_segment.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include /*< Adapts std::vector to linestring concept >*/ diff --git a/doc/src/examples/algorithms/intersects_linestring.cpp b/doc/src/examples/algorithms/intersects_linestring.cpp index 3d98e0a6b..536c649e7 100644 --- a/doc/src/examples/algorithms/intersects_linestring.cpp +++ b/doc/src/examples/algorithms/intersects_linestring.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include int main() diff --git a/doc/src/examples/algorithms/intersects_segment.cpp b/doc/src/examples/algorithms/intersects_segment.cpp index fc96a3e88..9c98a3085 100644 --- a/doc/src/examples/algorithms/intersects_segment.cpp +++ b/doc/src/examples/algorithms/intersects_segment.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include int main() diff --git a/doc/src/examples/algorithms/length.cpp b/doc/src/examples/algorithms/length.cpp index 1eab5e117..506a3e6b5 100644 --- a/doc/src/examples/algorithms/length.cpp +++ b/doc/src/examples/algorithms/length.cpp @@ -11,7 +11,7 @@ //` The following simple example shows the calculation of the length of a linestring containing three points #include -#include +#include #include diff --git a/doc/src/examples/algorithms/length_with_strategy.cpp b/doc/src/examples/algorithms/length_with_strategy.cpp index 4f35ae41b..32eb6d39b 100644 --- a/doc/src/examples/algorithms/length_with_strategy.cpp +++ b/doc/src/examples/algorithms/length_with_strategy.cpp @@ -11,7 +11,7 @@ //`The following example shows the length measured over a sphere, expressed in kilometers. To do that the radius of the sphere must be specified in the constructor of the strategy. #include -#include +#include int main() { diff --git a/doc/src/examples/algorithms/make_2d_point.cpp b/doc/src/examples/algorithms/make_2d_point.cpp index be55eb553..1c374bf94 100644 --- a/doc/src/examples/algorithms/make_2d_point.cpp +++ b/doc/src/examples/algorithms/make_2d_point.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include #include diff --git a/doc/src/examples/algorithms/make_3d_point.cpp b/doc/src/examples/algorithms/make_3d_point.cpp index 254f0b281..4605bb81a 100644 --- a/doc/src/examples/algorithms/make_3d_point.cpp +++ b/doc/src/examples/algorithms/make_3d_point.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include int main() diff --git a/doc/src/examples/algorithms/make_inverse.cpp b/doc/src/examples/algorithms/make_inverse.cpp index cfcd718ee..20dd5fc37 100644 --- a/doc/src/examples/algorithms/make_inverse.cpp +++ b/doc/src/examples/algorithms/make_inverse.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include using namespace boost::geometry; diff --git a/doc/src/examples/algorithms/make_with_range.cpp b/doc/src/examples/algorithms/make_with_range.cpp index 3b996ac4a..26d55c633 100644 --- a/doc/src/examples/algorithms/make_with_range.cpp +++ b/doc/src/examples/algorithms/make_with_range.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include /*< Necessary to register a C array like {1,2} as a point >*/ diff --git a/doc/src/examples/algorithms/num_geometries.cpp b/doc/src/examples/algorithms/num_geometries.cpp index 87805761b..d66735de7 100644 --- a/doc/src/examples/algorithms/num_geometries.cpp +++ b/doc/src/examples/algorithms/num_geometries.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include #include diff --git a/doc/src/examples/algorithms/num_interior_rings.cpp b/doc/src/examples/algorithms/num_interior_rings.cpp index b4aa82940..b6edc4a67 100644 --- a/doc/src/examples/algorithms/num_interior_rings.cpp +++ b/doc/src/examples/algorithms/num_interior_rings.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include #include diff --git a/doc/src/examples/algorithms/num_points.cpp b/doc/src/examples/algorithms/num_points.cpp index b44c44c2a..be0c1492a 100644 --- a/doc/src/examples/algorithms/num_points.cpp +++ b/doc/src/examples/algorithms/num_points.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include #include diff --git a/doc/src/examples/algorithms/return_envelope.cpp b/doc/src/examples/algorithms/return_envelope.cpp index 5775d9f53..cb8914e5d 100644 --- a/doc/src/examples/algorithms/return_envelope.cpp +++ b/doc/src/examples/algorithms/return_envelope.cpp @@ -13,7 +13,7 @@ #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/reverse.cpp b/doc/src/examples/algorithms/reverse.cpp index 33fc690fc..26eb35f68 100644 --- a/doc/src/examples/algorithms/reverse.cpp +++ b/doc/src/examples/algorithms/reverse.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/simplify.cpp b/doc/src/examples/algorithms/simplify.cpp index f67a256b3..db4a97bfb 100644 --- a/doc/src/examples/algorithms/simplify.cpp +++ b/doc/src/examples/algorithms/simplify.cpp @@ -11,7 +11,7 @@ //` Example showing how to simplify a linestring #include -#include +#include /*< For this example we use Boost.Assign to add points >*/ #include diff --git a/doc/src/examples/algorithms/simplify_insert.cpp b/doc/src/examples/algorithms/simplify_insert.cpp index e3a2e7c05..d93034dfd 100644 --- a/doc/src/examples/algorithms/simplify_insert.cpp +++ b/doc/src/examples/algorithms/simplify_insert.cpp @@ -11,7 +11,7 @@ //` Simplify a linestring using a back inserter #include -#include +#include int main() { diff --git a/doc/src/examples/algorithms/simplify_insert_with_strategy.cpp b/doc/src/examples/algorithms/simplify_insert_with_strategy.cpp index a73cd0c68..3236fee0b 100644 --- a/doc/src/examples/algorithms/simplify_insert_with_strategy.cpp +++ b/doc/src/examples/algorithms/simplify_insert_with_strategy.cpp @@ -11,7 +11,7 @@ //` Simplify a linestring using an output iterator #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/sym_difference.cpp b/doc/src/examples/algorithms/sym_difference.cpp index 80d487819..7f0bf779f 100644 --- a/doc/src/examples/algorithms/sym_difference.cpp +++ b/doc/src/examples/algorithms/sym_difference.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include #include #include diff --git a/doc/src/examples/algorithms/transform.cpp b/doc/src/examples/algorithms/transform.cpp index 8eea3be30..feee4ab13 100644 --- a/doc/src/examples/algorithms/transform.cpp +++ b/doc/src/examples/algorithms/transform.cpp @@ -11,7 +11,7 @@ //` Shows how points can be transformed using the default strategy #include -#include +#include int main() diff --git a/doc/src/examples/algorithms/transform_with_strategy.cpp b/doc/src/examples/algorithms/transform_with_strategy.cpp index 2fcfc57f4..20e842635 100644 --- a/doc/src/examples/algorithms/transform_with_strategy.cpp +++ b/doc/src/examples/algorithms/transform_with_strategy.cpp @@ -11,7 +11,7 @@ //` Shows how points can be scaled, translated or rotated #include -#include +#include int main() diff --git a/doc/src/examples/algorithms/union.cpp b/doc/src/examples/algorithms/union.cpp index 865da72c2..79c35298a 100644 --- a/doc/src/examples/algorithms/union.cpp +++ b/doc/src/examples/algorithms/union.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/doc/src/examples/algorithms/unique.cpp b/doc/src/examples/algorithms/unique.cpp index 294e1cd98..d258361ef 100644 --- a/doc/src/examples/algorithms/unique.cpp +++ b/doc/src/examples/algorithms/unique.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include int main() diff --git a/doc/src/examples/algorithms/within.cpp b/doc/src/examples/algorithms/within.cpp index cb8e110fc..24d33bdcc 100644 --- a/doc/src/examples/algorithms/within.cpp +++ b/doc/src/examples/algorithms/within.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/doc/src/examples/core/closure.cpp b/doc/src/examples/core/closure.cpp index 47c40adcc..db4c5e406 100644 --- a/doc/src/examples/core/closure.cpp +++ b/doc/src/examples/core/closure.cpp @@ -11,7 +11,7 @@ //` Examine if a polygon is defined as "should be closed" #include -#include +#include int main() { diff --git a/doc/src/examples/core/coordinate_dimension.cpp b/doc/src/examples/core/coordinate_dimension.cpp index 5061c46ce..744d01910 100644 --- a/doc/src/examples/core/coordinate_dimension.cpp +++ b/doc/src/examples/core/coordinate_dimension.cpp @@ -11,7 +11,7 @@ //` Examine the number of coordinates making up the points in a linestring type #include -#include +#include #include #include diff --git a/doc/src/examples/core/coordinate_system.cpp b/doc/src/examples/core/coordinate_system.cpp index 0152aabf4..6969a27a2 100644 --- a/doc/src/examples/core/coordinate_system.cpp +++ b/doc/src/examples/core/coordinate_system.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include int main() { diff --git a/doc/src/examples/core/coordinate_type.cpp b/doc/src/examples/core/coordinate_type.cpp index ebeea7e3c..3fffafa5f 100644 --- a/doc/src/examples/core/coordinate_type.cpp +++ b/doc/src/examples/core/coordinate_type.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include int main() { diff --git a/doc/src/examples/core/degree_radian.cpp b/doc/src/examples/core/degree_radian.cpp index 3b8411068..3cd2d3dba 100644 --- a/doc/src/examples/core/degree_radian.cpp +++ b/doc/src/examples/core/degree_radian.cpp @@ -11,7 +11,7 @@ //` Specify two coordinate systems, one in degrees, one in radians. #include -#include +#include using namespace boost::geometry; diff --git a/doc/src/examples/core/get_box.cpp b/doc/src/examples/core/get_box.cpp index c7f6c1b3e..181721267 100644 --- a/doc/src/examples/core/get_box.cpp +++ b/doc/src/examples/core/get_box.cpp @@ -11,7 +11,7 @@ //` Get the coordinate of a box #include -#include +#include namespace bg = boost::geometry; diff --git a/doc/src/examples/core/get_point.cpp b/doc/src/examples/core/get_point.cpp index 126b25aac..cd0243e52 100644 --- a/doc/src/examples/core/get_point.cpp +++ b/doc/src/examples/core/get_point.cpp @@ -11,7 +11,7 @@ //` Get the coordinate of a point #include -#include +#include namespace bg = boost::geometry; diff --git a/doc/src/examples/core/point_order.cpp b/doc/src/examples/core/point_order.cpp index 34e371209..dede853cd 100644 --- a/doc/src/examples/core/point_order.cpp +++ b/doc/src/examples/core/point_order.cpp @@ -11,7 +11,7 @@ //` Examine the expected point order of a polygon type #include -#include +#include int main() { diff --git a/doc/src/examples/core/point_type.cpp b/doc/src/examples/core/point_type.cpp index 2f1b499b7..51508511c 100644 --- a/doc/src/examples/core/point_type.cpp +++ b/doc/src/examples/core/point_type.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include int main() { diff --git a/doc/src/examples/core/rings.cpp b/doc/src/examples/core/rings.cpp index 76eae12de..1487db4f4 100644 --- a/doc/src/examples/core/rings.cpp +++ b/doc/src/examples/core/rings.cpp @@ -15,7 +15,7 @@ Also shows the related ring_type and interior_type. */ #include -#include +#include int main() diff --git a/doc/src/examples/core/set_box.cpp b/doc/src/examples/core/set_box.cpp index e4b871330..1c56572b1 100644 --- a/doc/src/examples/core/set_box.cpp +++ b/doc/src/examples/core/set_box.cpp @@ -11,7 +11,7 @@ //` Set the coordinate of a box #include -#include +#include namespace bg = boost::geometry; diff --git a/doc/src/examples/core/set_point.cpp b/doc/src/examples/core/set_point.cpp index 14a3c5138..39520c921 100644 --- a/doc/src/examples/core/set_point.cpp +++ b/doc/src/examples/core/set_point.cpp @@ -11,7 +11,7 @@ //` Set the coordinate of a point #include -#include +#include namespace bg = boost::geometry; diff --git a/doc/src/examples/core/tag.cpp b/doc/src/examples/core/tag.cpp index 281296215..88530ca9d 100644 --- a/doc/src/examples/core/tag.cpp +++ b/doc/src/examples/core/tag.cpp @@ -11,7 +11,7 @@ //` Shows how tag dispatching essentially works in Boost.Geometry #include -#include +#include #include #include diff --git a/doc/src/examples/core/tag_cast.cpp b/doc/src/examples/core/tag_cast.cpp index 7f4ab3e0e..f33345706 100644 --- a/doc/src/examples/core/tag_cast.cpp +++ b/doc/src/examples/core/tag_cast.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include namespace geo = boost::geometry; int main() diff --git a/doc/src/examples/geometries/point.cpp b/doc/src/examples/geometries/point.cpp index 680ca4a5e..103642f4b 100644 --- a/doc/src/examples/geometries/point.cpp +++ b/doc/src/examples/geometries/point.cpp @@ -11,7 +11,7 @@ //` Declaration and use of the Boost.Geometry model::point, modelling the Point Concept #include -#include +#include namespace bg = boost::geometry; diff --git a/doc/src/examples/geometries/register/point.cpp b/doc/src/examples/geometries/register/point.cpp index bfac67d88..f523fc7c8 100644 --- a/doc/src/examples/geometries/register/point.cpp +++ b/doc/src/examples/geometries/register/point.cpp @@ -11,7 +11,7 @@ //` Show the use of the macro BOOST_GEOMETRY_REGISTER_POINT_2D #include -#include +#include #include /*< Somewhere, any legacy point struct is defined >*/ diff --git a/doc/src/examples/quick_start.cpp b/doc/src/examples/quick_start.cpp index 36567b3fa..669235191 100644 --- a/doc/src/examples/quick_start.cpp +++ b/doc/src/examples/quick_start.cpp @@ -20,7 +20,7 @@ //#pragma warning( disable : 4244 ) #endif // defined(_MSC_VER) -#include +#include #include #include #include From 0fa12693b66cb43aec580f9d92a544fdaad766f9 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 22 Apr 2011 12:07:01 +0000 Subject: [PATCH 53/70] Updated xml2qbk parser to distinguish structs/classes, updated tag doc [SVN r71419] --- doc/doxy/Doxyfile | 2 +- doc/reference/core/tag.qbk | 15 ++++++++++++--- .../tools/doxygen_xml2qbk/doxygen_elements.hpp | 1 + .../tools/doxygen_xml2qbk/doxygen_xml_parser.hpp | 9 ++++++++- .../tools/doxygen_xml2qbk/for_debugger.ini | 2 +- .../tools/doxygen_xml2qbk/quickbook_output.hpp | 3 ++- doc/src/examples/core/tag.cpp | 6 +++--- 7 files changed, 28 insertions(+), 10 deletions(-) diff --git a/doc/doxy/Doxyfile b/doc/doxy/Doxyfile index 7c34fb5e0..fe4ed73d3 100644 --- a/doc/doxy/Doxyfile +++ b/doc/doxy/Doxyfile @@ -50,7 +50,7 @@ ALIASES = qbk{1}="\xmlonly \1 \endxmlonly" \ brief_macro{1}="Macro to register a \1" \ brief_macro_const=" (const version)" \ brief_macro_getset=" (having separate get/set methods)" \ - brief_meta{3}="Metafunction defining [*\1] as the specified \2 of the \3" \ + brief_meta{3}="Metafunction defining [*\1] as the \2 of the \3" \ tparam_allocator="container-allocator-type" \ tparam_box="Any type fulfilling a Box Concept" \ tparam_box_or_segment="Any type fulfilling a Box Concept or a Segment Concept" \ diff --git a/doc/reference/core/tag.qbk b/doc/reference/core/tag.qbk index c7d7711ae..4ad2bba2d 100644 --- a/doc/reference/core/tag.qbk +++ b/doc/reference/core/tag.qbk @@ -8,9 +8,18 @@ http://www.boost.org/LICENSE_1_0.txt) =============================================================================/] -[note With Boost.Geometry, tags are the driving force of the tag dispatching - mechanism. The tag metafunction is therefore used in every free function. -] +[heading Metafunction result type] +The metafunction tag defines [*type] as one of the following tags: + +* point_tag +* linestring_tag +* polygon_tag +* multi_point_tag +* multi_linestring_tag +* multi_polygon_tag +* box_tag +* segment_tag +* ring_tag [heading Complexity] Compile time diff --git a/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp b/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp index cafb9b934..e2fe9bdd5 100644 --- a/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp +++ b/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp @@ -140,6 +140,7 @@ struct base_class struct class_or_struct : public element { + bool is_class; // true if class, false if struct std::string name, fullname; std::vector functions; diff --git a/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp b/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp index a3a999927..2667fe985 100644 --- a/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp +++ b/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp @@ -430,9 +430,16 @@ static void parse(rapidxml::xml_node<>* node, configuration const& config, docum { recurse = true; } - if (kind == "struct" || kind == "class") + else if (kind == "struct") { recurse = true; + doc.cos.is_class = false; + parse_element(node->first_node(), config, "", doc.cos); + } + else if (kind == "class") + { + recurse = true; + doc.cos.is_class = true; parse_element(node->first_node(), config, "", doc.cos); } } diff --git a/doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini b/doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini index e225e2e5c..2916bbe51 100644 --- a/doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini +++ b/doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini @@ -4,7 +4,7 @@ # xml=../../../../doxy/doxygen_output/xml/classboost_1_1geometry_1_1strategy_1_1distance_1_1pythagoras.xml # xml=../../../../doxy/doxygen_output/xml/group__get.xml -xml=../../../../doxy/doxygen_output/xml/group__num__points.xml +xml=../../../../doxy/doxygen_output/xml/structboost_1_1geometry_1_1tag.xml start_include=boost/geometry/ convenience_header_path=../../../../../../../boost/geometry/ diff --git a/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp b/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp index f1fb92869..e8d3f2570 100644 --- a/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp +++ b/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp @@ -474,7 +474,8 @@ void quickbook_output(class_or_struct const& cos, configuration const& config, s out << "[heading Synopsis]" << std::endl << "``"; quickbook_template_parameter_list(cos.template_parameters, out); - out << "class " << short_name << std::endl; + out << (cos.is_class ? "class" : "struct") + << " " << short_name << std::endl; if (! cos.base_classes.empty()) { diff --git a/doc/src/examples/core/tag.cpp b/doc/src/examples/core/tag.cpp index 88530ca9d..a72e5f8ae 100644 --- a/doc/src/examples/core/tag.cpp +++ b/doc/src/examples/core/tag.cpp @@ -26,7 +26,7 @@ template <> struct dispatch { // Use the Boost.Geometry free function "get" // working on all supported point types - std::cout << "Hello POINT " + std::cout << "Hello POINT, you are located at: " << boost::geometry::get<0>(p) << ", " << boost::geometry::get<1>(p) << std::endl; @@ -64,7 +64,7 @@ template <> struct dispatch template inline void hello(Geometry const& geometry) { - // Call the meta-function "tag" to dispatch, and call method (here "apply") + // Call the metafunction "tag" to dispatch, and call method (here "apply") dispatch < typename boost::geometry::tag::type @@ -97,7 +97,7 @@ int main() /*` Output: [pre -Hello POINT 2, 3 +Hello POINT, you are located at: 2, 3 Hello POLYGON, you look like: (((0, 0), (0, 10), (10, 5), (0, 0))) Hello MULTIPOLYGON, you contain: 1 polygon(s) ] From d601e255b3eff9aa41fe642b573a38e581505572 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 22 Apr 2011 22:26:38 +0000 Subject: [PATCH 54/70] Updated many docs, added many samples [SVN r71422] --- doc/concept/linestring.qbk | 2 +- doc/concept/multi_linestring.qbk | 2 +- doc/concept/multi_point.qbk | 2 +- doc/concept/multi_polygon.qbk | 2 +- doc/concept/point.qbk | 12 ++-- doc/concept/polygon.qbk | 3 +- doc/concept/ring.qbk | 2 +- doc/imports.qbk | 8 +++ doc/quickref.xml | 27 ++++++--- doc/reference.qbk | 11 ++-- doc/reference/core/interior_type.qbk | 17 ++++++ doc/reference/core/ring_type.qbk | 17 ++++++ .../geometries/adapted/boost_array.qbk | 38 ++++++++++++ .../geometries/adapted/boost_fusion.qbk | 35 +++++++++++ .../geometries/adapted/boost_polygon.qbk | 37 ++++++++++++ .../geometries/adapted/boost_tuple.qbk | 47 +++++++++++++++ doc/reference/geometries/adapted/c_array.qbk | 40 +++++++++++++ doc/src/examples/core/Jamfile.v2 | 2 + doc/src/examples/core/interior_type.cpp | 44 ++++++++++++++ doc/src/examples/core/ring_type.cpp | 53 +++++++++++++++++ doc/src/examples/core/rings.cpp | 2 +- .../examples/geometries/adapted/Jamfile.v2 | 21 +++++++ .../geometries/adapted/boost_array.cpp | 47 +++++++++++++++ .../geometries/adapted/boost_fusion.cpp | 59 +++++++++++++++++++ .../geometries/adapted/boost_polygon.cpp | 38 ++++++++++++ .../geometries/adapted/boost_tuple.cpp | 50 ++++++++++++++++ .../examples/geometries/adapted/c_array.cpp | 36 +++++++++++ .../examples/geometries/register/point.cpp | 2 +- 28 files changed, 628 insertions(+), 28 deletions(-) create mode 100644 doc/reference/core/interior_type.qbk create mode 100644 doc/reference/core/ring_type.qbk create mode 100644 doc/reference/geometries/adapted/boost_array.qbk create mode 100644 doc/reference/geometries/adapted/boost_fusion.qbk create mode 100644 doc/reference/geometries/adapted/boost_polygon.qbk create mode 100644 doc/reference/geometries/adapted/boost_tuple.qbk create mode 100644 doc/reference/geometries/adapted/c_array.qbk create mode 100644 doc/src/examples/core/interior_type.cpp create mode 100644 doc/src/examples/core/ring_type.cpp create mode 100644 doc/src/examples/geometries/adapted/Jamfile.v2 create mode 100644 doc/src/examples/geometries/adapted/boost_array.cpp create mode 100644 doc/src/examples/geometries/adapted/boost_fusion.cpp create mode 100644 doc/src/examples/geometries/adapted/boost_polygon.cpp create mode 100644 doc/src/examples/geometries/adapted/boost_tuple.cpp create mode 100644 doc/src/examples/geometries/adapted/c_array.cpp diff --git a/doc/concept/linestring.qbk b/doc/concept/linestring.qbk index dba503eb3..e6213f549 100644 --- a/doc/concept/linestring.qbk +++ b/doc/concept/linestring.qbk @@ -23,7 +23,7 @@ A linestring is ['a Curve with linear interpolation between Points]. The Linestring Concept is defined as following: * there must be a specialization of `traits::tag` defining `linestring_tag` as type -* it must behave like a Boost.Range +* it must behave like a Boost.Range Random Access Range * The type defined by the metafunction `range_value<...>::type` must fulfill the [link geometry.reference.concepts.concept_point Point Concept] diff --git a/doc/concept/multi_linestring.qbk b/doc/concept/multi_linestring.qbk index 3b7e0569b..516d009fb 100644 --- a/doc/concept/multi_linestring.qbk +++ b/doc/concept/multi_linestring.qbk @@ -20,7 +20,7 @@ The MultiLinestring Concept is defined as following: * There must be a specialization of the metafunction `traits::tag`, defining `multi_linestring_tag` as type -* It must behave like a Boost.Range +* It must behave like a Boost.Range Random Access Range * The type defined by the metafunction `range_value<...>::type` must fulfill the [link geometry.reference.concepts.concept_linestring Linestring Concept] diff --git a/doc/concept/multi_point.qbk b/doc/concept/multi_point.qbk index 4127c47aa..3880ade2c 100644 --- a/doc/concept/multi_point.qbk +++ b/doc/concept/multi_point.qbk @@ -21,7 +21,7 @@ The MultiPoint Concept is defined as following: * There must be a specialization of the metafunction `traits::tag`, defining `multi_point_tag` as type -* It must behave like a Boost.Range +* It must behave like a Boost.Range Random Access Range * The type defined by the metafunction `range_value<...>::type` must fulfill the [link geometry.reference.concepts.concept_point Point Concept] [heading Available Models] diff --git a/doc/concept/multi_polygon.qbk b/doc/concept/multi_polygon.qbk index 3dbae687b..0c4de61c1 100644 --- a/doc/concept/multi_polygon.qbk +++ b/doc/concept/multi_polygon.qbk @@ -20,7 +20,7 @@ The MultiPolygon Concept is defined as following: * There must be a specialization of the metafunction `traits::tag`, defining `multi_polygon_tag` as type -* It must behave like a Boost.Range +* It must behave like a Boost.Range Random Access Range * The type defined by the metafunction `range_value<...>::type` must fulfill the [link geometry.reference.concepts.concept_polygon Polygon Concept] diff --git a/doc/concept/point.qbk b/doc/concept/point.qbk index d44170444..f19dabd55 100644 --- a/doc/concept/point.qbk +++ b/doc/concept/point.qbk @@ -37,12 +37,12 @@ The Point Concept is defined as following: * [link geometry.reference.models.model_point model::point] * [link geometry.reference.models.model_d2_point_xy model::d2::point_xy] * a lat long point (currently in an extension) -* a C array (requires `#include boost/geometry/geometries/adapted/c_array.hpp>`) -* a Boost.Array (requires `#include `) -* a Boost.Polygon point (requires `#include boost/geometry/geometries/adapted/boost_polygon/point.hpp>`) -* a Boost.Fusion adapted structure (requires `#include boost/geometry/geometries/adapted/fusion.hpp>`) -* a Boost.Tuple (requires `#include boost/geometry/geometries/adapted/tuple.hpp>`) -* an adapted point using one of the [link geometry.reference.register registration macro's] +* [link geometry.reference.adapted.c_array C array] +* [link geometry.reference.adapted.boost_array Boost.Array] +* [link geometry.reference.adapted.boost_fusion Boost.Fusion] +* [link geometry.reference.adapted.boost_polygon Boost.Polygon] +* [link geometry.reference.adapted.boost_tuple Boost.Tuple] +* other point types, adapted e.g. using one of the [link geometry.reference.adapted registration macro's] [endsect] diff --git a/doc/concept/polygon.qbk b/doc/concept/polygon.qbk index cebdd1722..c577c33db 100644 --- a/doc/concept/polygon.qbk +++ b/doc/concept/polygon.qbk @@ -29,7 +29,8 @@ The Polygon Concept is defined as following: * there must be a specialization of `traits::tag` defining `polygon_tag` as type * there must be a specialization of `traits::ring_type` defining the type of its exterior ring and interior rings as type * this type defined by `ring_type` must fulfill the [link geometry.reference.concepts.concept_ring Ring Concept] -* there must be a specialization of `traits::interior_type` defining the type of the collection of its interior rings as type +* there must be a specialization of `traits::interior_type` defining the type of the collection of its interior rings as type; + this collection itself must fulfill a Boost.Range Random Access Range Concept * there must be a specialization of `traits::exterior_ring` with two functions named `get`, returning the exterior ring, one being const, the other being non const * there must be a specialization of `traits::interior_rings` with two functions named `get`, returning the interior rings, one being const, the other being non const diff --git a/doc/concept/ring.qbk b/doc/concept/ring.qbk index ea57f115e..6c693afe6 100644 --- a/doc/concept/ring.qbk +++ b/doc/concept/ring.qbk @@ -22,7 +22,7 @@ The Ring Concept is defined as following: * there must be a specialization of `traits::tag` defining `ring_tag` as type -* it must behave like a Boost.Range +* it must behave like a Boost.Range Random Access Range * The type defined by the metafunction `range_value<...>::type` must fulfill the [link geometry.reference.concepts.concept_point Point Concept] * there might be a specialization of `traits::point_order` defining the order or orientation of its points, `clockwise` or `counterclockwise` diff --git a/doc/imports.qbk b/doc/imports.qbk index 208bb28d8..bab48d065 100644 --- a/doc/imports.qbk +++ b/doc/imports.qbk @@ -69,9 +69,17 @@ [import src/examples/core/set_box.cpp] [import src/examples/core/degree_radian.cpp] +[import src/examples/core/interior_type.cpp] [import src/examples/core/point_type.cpp] +[import src/examples/core/ring_type.cpp] +[import src/examples/core/rings.cpp] [import src/examples/core/tag.cpp] [import src/examples/core/tag_cast.cpp] [import src/examples/geometries/point.cpp] +[import src/examples/geometries/adapted/c_array.cpp] +[import src/examples/geometries/adapted/boost_array.cpp] +[import src/examples/geometries/adapted/boost_fusion.cpp] +[import src/examples/geometries/adapted/boost_polygon.cpp] +[import src/examples/geometries/adapted/boost_tuple.cpp] [import src/examples/geometries/register/point.cpp] diff --git a/doc/quickref.xml b/doc/quickref.xml index 3241aba28..22d25f8a0 100644 --- a/doc/quickref.xml +++ b/doc/quickref.xml @@ -100,16 +100,25 @@ - - Macros + + Adapted point types - BOOST_GEOMETRY_REGISTER_POINT_2D - BOOST_GEOMETRY_REGISTER_POINT_2D_CONST - BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET - BOOST_GEOMETRY_REGISTER_POINT_3D - BOOST_GEOMETRY_REGISTER_POINT_3D_CONST - BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET - + Boost.Array + Boost.Fusion + Boost.Polygon + Boost.Tuple + C arrays + + + + Registration macro's + + BOOST_GEOMETRY_REGISTER_POINT_2D + BOOST_GEOMETRY_REGISTER_POINT_2D_CONST + BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET + BOOST_GEOMETRY_REGISTER_POINT_3D + BOOST_GEOMETRY_REGISTER_POINT_3D_CONST + BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET diff --git a/doc/reference.qbk b/doc/reference.qbk index 54cb12783..b2208ef82 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -34,12 +34,14 @@ [include generated/interior_rings.qbk] [endsect] - [endsect] [/access functions] - - -[section:register Adaption and adapted models] +[section:adapted Adapted models and registration] +[include reference/geometries/adapted/c_array.qbk] +[include reference/geometries/adapted/boost_array.qbk] +[include reference/geometries/adapted/boost_fusion.qbk] +[include reference/geometries/adapted/boost_polygon.qbk] +[include reference/geometries/adapted/boost_tuple.qbk] [include generated/register.qbk] [endsect] @@ -175,7 +177,6 @@ [include generated/cs_tag.qbk] [include generated/degree.qbk] [include generated/dimension.qbk] -[include generated/exception.qbk] [include generated/interior_type.qbk] [include generated/is_radian.qbk] [include generated/point_order.qbk] diff --git a/doc/reference/core/interior_type.qbk b/doc/reference/core/interior_type.qbk new file mode 100644 index 000000000..7eb883b82 --- /dev/null +++ b/doc/reference/core/interior_type.qbk @@ -0,0 +1,17 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, 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) +=============================================================================/] + + +[heading Complexity] +Compile time + +[heading Example] +[interior_type] +[interior_type_output] diff --git a/doc/reference/core/ring_type.qbk b/doc/reference/core/ring_type.qbk new file mode 100644 index 000000000..d0f399814 --- /dev/null +++ b/doc/reference/core/ring_type.qbk @@ -0,0 +1,17 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, 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) +=============================================================================/] + + +[heading Complexity] +Compile time + +[heading Example] +[ring_type] +[ring_type_output] diff --git a/doc/reference/geometries/adapted/boost_array.qbk b/doc/reference/geometries/adapted/boost_array.qbk new file mode 100644 index 000000000..6c1e96078 --- /dev/null +++ b/doc/reference/geometries/adapted/boost_array.qbk @@ -0,0 +1,38 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +[section:boost_array Boost.Array] + +Boost.Array arrays are adapted to the Boost.Geometry point concept + +[heading Description] + +A boost::array is (optionally) adapted to the Boost.Geometry +point concept. It can therefore be used in all Boost.Geometry algorithms. + +A boost::array can be the point type used by the models linestring, polygon, segment, +box, and ring + +[heading Model of] +[link geometry.reference.concepts.concept_point Point Concept] + +[heading Header] +`#include ` + +The standard header `` does not include this header. + +[heading Example] +[boost_array] +[boost_array_output] + +[endsect] + diff --git a/doc/reference/geometries/adapted/boost_fusion.qbk b/doc/reference/geometries/adapted/boost_fusion.qbk new file mode 100644 index 000000000..a55ae232b --- /dev/null +++ b/doc/reference/geometries/adapted/boost_fusion.qbk @@ -0,0 +1,35 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +[section:boost_fusion Boost.Fusion] + +Boost.Fusion adapted structs or classes are adapted to the Boost.Geometry point concept + +[heading Description] + +Boost.Fusion adapted structs are (optionally) adapted to the Boost.Geometry +point concept. They can therefore be used in many Boost.Geometry algorithms. + +[heading Model of] +[link geometry.reference.concepts.concept_point Point Concept] + +[heading Header] +`#include ` + +The standard header `` does not include this header. + +[heading Example] +[boost_fusion] +[boost_fusion_output] + +[endsect] + diff --git a/doc/reference/geometries/adapted/boost_polygon.qbk b/doc/reference/geometries/adapted/boost_polygon.qbk new file mode 100644 index 000000000..bc32c00c9 --- /dev/null +++ b/doc/reference/geometries/adapted/boost_polygon.qbk @@ -0,0 +1,37 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +[section:boost_polygon Boost.Polygon] + +The Boost.Polygon point type (point_data) is adapted to the Boost.Geometry Point Concept. +Boost.Polygon polygons are adapted to the Boost.Geometry Ring Concept and the Boost.Geometry Polygon Concept. + +[heading Description] + +Boost.Polygon's points (as well as polygons) can be used by Boost.Geometry. The +two libraries can therefore be used together. Using a boost::polygon::point_data<...>, +algorithms from both Boost.Polygon and Boost.Geometry can be called. + +[heading Model of] +[link geometry.reference.concepts.concept_point Point Concept] + +[heading Header] +`#include ` + +The standard header `` does not include this header. + +[heading Example] +[boost_polygon] +[boost_polygon_output] + +[endsect] + diff --git a/doc/reference/geometries/adapted/boost_tuple.qbk b/doc/reference/geometries/adapted/boost_tuple.qbk new file mode 100644 index 000000000..32b0ddbeb --- /dev/null +++ b/doc/reference/geometries/adapted/boost_tuple.qbk @@ -0,0 +1,47 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +[section:boost_tuple Boost.Tuple] + +Boost.Tuple tuples with arithmetic elements can be used as +points within Boost.Geometry + +[heading Description] + +Boost.Tuple fixed sized collections, such as boost::tuple, are +(optionally) adapted to the Boost.Geometry point concept. + +Boost.Tuple pairs or triples might have mutually different types, such as a +boost::tuple. Boost.Geometry reports the first type as its +[link geometry.reference.core.coordinate_type coordinate_type]. + +Boost.Geometry supports Boost.Tuple pairs, triples, quadruples, etc up to +tuples with 10 elements (though most algorithms do not support so many +dimensions). + +A tuple can be the point type used by the models linestring, polygon, segment, +box, and ring + +[heading Model of] +[link geometry.reference.concepts.concept_point Point Concept] + +[heading Header] +`#include ` + +The standard header `` does not include this header. + +[heading Example] +[boost_tuple] +[boost_tuple_output] + +[endsect] + diff --git a/doc/reference/geometries/adapted/c_array.qbk b/doc/reference/geometries/adapted/c_array.qbk new file mode 100644 index 000000000..be560a870 --- /dev/null +++ b/doc/reference/geometries/adapted/c_array.qbk @@ -0,0 +1,40 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +[section:c_array C array] + +C arrays are adapted to the Boost.Geometry point concept + +[heading Description] + +C arrays, such as double[2] or int[3], are (optionally) adapted to the Boost.Geometry +point concept. They can therefore be used in many Boost.Geometry algorithms. + +Note that a C array cannot be the point type of a linestring or a polygon. The reason +for that is that a std::vector does not allow containing C arrays +(this is not related to Boost.Geometry). The C array is therefore limited to +the point type. + +[heading Model of] +[link geometry.reference.concepts.concept_point Point Concept] + +[heading Header] +`#include ` + +The standard header `` does not include this header. + +[heading Example] +[c_array] +[c_array_output] + +[endsect] + diff --git a/doc/src/examples/core/Jamfile.v2 b/doc/src/examples/core/Jamfile.v2 index 974039228..26bab2bf5 100644 --- a/doc/src/examples/core/Jamfile.v2 +++ b/doc/src/examples/core/Jamfile.v2 @@ -25,7 +25,9 @@ exe coordinate_dimension : coordinate_dimension.cpp ; exe point_order : point_order.cpp ; exe closure : closure.cpp ; +exe interior_type : interior_type.cpp ; exe point_type : point_type.cpp ; +exe ring_type : ring_type.cpp ; exe rings : rings.cpp ; exe tag : tag.cpp ; exe tag_cast : tag_cast.cpp ; diff --git a/doc/src/examples/core/interior_type.cpp b/doc/src/examples/core/interior_type.cpp new file mode 100644 index 000000000..f30bc6c08 --- /dev/null +++ b/doc/src/examples/core/interior_type.cpp @@ -0,0 +1,44 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[interior_type +//`Shows how to use the interior_type metafunction + +#include +#include +#include +#include + +int main() +{ + // Define a polygon storing points in a deque and storing interior rings + // in a list (note that std::list is not supported by most algorithms + // because not supporting a random access iterator) + typedef boost::geometry::model::polygon + < + boost::array, + true, true, + std::deque, std::list + > polygon; + + std::cout << typeid(boost::geometry::interior_type::type).name() << std::endl; + + return 0; +} + +//] + +//[interior_type_output +/*` +Output (using MSVC) is a long story (part manually replaced with ellipsis): +[pre +class std::list,1,1,class std::deque,class std::allocator>,class std::allocator<...> > > +] +*/ +//] diff --git a/doc/src/examples/core/ring_type.cpp b/doc/src/examples/core/ring_type.cpp new file mode 100644 index 000000000..cae4dfd2b --- /dev/null +++ b/doc/src/examples/core/ring_type.cpp @@ -0,0 +1,53 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[ring_type +//`Shows how to use the ring_type metafunction, as well as interior_type + +#include +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point; + typedef boost::geometry::model::polygon polygon; + + typedef boost::geometry::ring_type::type ring_type; + typedef boost::geometry::interior_type::type int_type; + + std::cout << typeid(ring_type).name() << std::endl; + std::cout << typeid(int_type).name() << std::endl; + + // So int_type defines a collection of rings, + // which is a Boost.Range compatible range + // The type of an element of the collection is the very same ring type again. + // We show that. + typedef boost::range_value::type int_ring_type; + + std::cout + << std::boolalpha + << boost::is_same::value + << std::endl; + + return 0; +} + +//] + +//[ring_type_output +/*` +Output (using gcc): +[pre + N5boost8geometry5model4ringINS1_2d28point_xyIdNS0_2cs9cartesianEEELb1ELb1ESt6vectorSaEE +St6vectorIN5boost8geometry5model4ringINS2_2d28point_xyIdNS1_2cs9cartesianEEELb1ELb1ES_SaEESaIS9_EE +true +] +*/ +//] diff --git a/doc/src/examples/core/rings.cpp b/doc/src/examples/core/rings.cpp index 1487db4f4..30a32b86f 100644 --- a/doc/src/examples/core/rings.cpp +++ b/doc/src/examples/core/rings.cpp @@ -54,7 +54,7 @@ int main() typedef boost::range_value::type int_ring_type; std::cout - //<< std::autoboolstring + << std::boolalpha << boost::is_same::value << std::endl; diff --git a/doc/src/examples/geometries/adapted/Jamfile.v2 b/doc/src/examples/geometries/adapted/Jamfile.v2 new file mode 100644 index 000000000..9c497e4e7 --- /dev/null +++ b/doc/src/examples/geometries/adapted/Jamfile.v2 @@ -0,0 +1,21 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2011 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + +# 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) + + +project boost-geometry-doc-src-example-geometries-adapted + : # requirements + ; + +exe c_array : c_array.cpp ; +exe boost_array : boost_array.cpp ; +exe boost_fusion : boost_fusion.cpp ; +exe boost_polygon : boost_polygon.cpp ; +exe boost_tuple : boost_tuple.cpp ; + diff --git a/doc/src/examples/geometries/adapted/boost_array.cpp b/doc/src/examples/geometries/adapted/boost_array.cpp new file mode 100644 index 000000000..163ebc29f --- /dev/null +++ b/doc/src/examples/geometries/adapted/boost_array.cpp @@ -0,0 +1,47 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[boost_array +//` Shows how to use a Boost.Array using Boost.Geometry's distance, set and assign_values algorithms + +#include +#include +#include + +int main() +{ + boost::array a = {1, 2}; + boost::array b = {2, 3}; + std::cout << boost::geometry::distance(a, b) << std::endl; + + boost::geometry::set<0>(a, 1.1); + boost::geometry::set<1>(a, 2.2); + std::cout << boost::geometry::distance(a, b) << std::endl; + + boost::geometry::assign_values(b, 2.2, 3.3); + std::cout << boost::geometry::distance(a, b) << std::endl; + + boost::geometry::model::linestring > line; + line.push_back(b); + + return 0; +} + +//] + +//[boost_array_output +/*` +Output: +[pre +1.41421 +1.20416 +1.55563 +] +*/ +//] diff --git a/doc/src/examples/geometries/adapted/boost_fusion.cpp b/doc/src/examples/geometries/adapted/boost_fusion.cpp new file mode 100644 index 000000000..3670487e6 --- /dev/null +++ b/doc/src/examples/geometries/adapted/boost_fusion.cpp @@ -0,0 +1,59 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[boost_fusion +//` Shows how to combine Boost.Fusion with Boost.Geometry + +#include +#include +#include +#include +#include + +struct sample_point +{ + double x, y, z; +}; + +BOOST_FUSION_ADAPT_STRUCT(sample_point, (double, x) (double, y) (double, z)) + +int main() +{ + sample_point a, b, c; + + // Set coordinates the Boost.Geometry way (one of the ways) + boost::geometry::assign_values(a, 3, 2, 1); + + // Set coordinates the Boost.Fusion way + boost::fusion::at_c<0>(b) = 6; + boost::fusion::at_c<1>(b) = 5; + boost::fusion::at_c<2>(b) = 4; + + // Set coordinates the native way + c.x = 9; + c.y = 8; + c.z = 7; + + std::cout << "Distance a-b: " << boost::geometry::distance(a, b) << std::endl; + std::cout << "Distance a-c: " << boost::geometry::distance(a, c) << std::endl; + + return 0; +} + +//] + +//[boost_fusion_output +/*` +Output: +[pre +Distance a-b: 5.19615 +Distance a-c: 10.3923 +] +*/ +//] diff --git a/doc/src/examples/geometries/adapted/boost_polygon.cpp b/doc/src/examples/geometries/adapted/boost_polygon.cpp new file mode 100644 index 000000000..2cfd5a9d2 --- /dev/null +++ b/doc/src/examples/geometries/adapted/boost_polygon.cpp @@ -0,0 +1,38 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[boost_polygon +//`Shows how to use Boost.Polygon points within Boost.Geometry + +#include +#include +#include + +int main() +{ + boost::polygon::point_data a(1, 2), b(3, 4); + std::cout << "Distance (using Boost.Geometry): " + << boost::geometry::distance(a, b) << std::endl; + std::cout << "Distance (using Boost.Polygon): " + << boost::polygon::euclidean_distance(a, b) << std::endl; + + return 0; +} + +//] + +//[boost_polygon_output +/*` +Output: +[pre +Distance (using Boost.Geometry): 2.82843 +Distance (using Boost.Polygon): 2.82843 +] +*/ +//] diff --git a/doc/src/examples/geometries/adapted/boost_tuple.cpp b/doc/src/examples/geometries/adapted/boost_tuple.cpp new file mode 100644 index 000000000..8d9401ed6 --- /dev/null +++ b/doc/src/examples/geometries/adapted/boost_tuple.cpp @@ -0,0 +1,50 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[boost_tuple +/*` +Shows how to use Boost.Tuple points in Boost.Geometry + +Working with Boost.Tuples in Boost.Geometry is straightforward and shown in +various other examples as well. + +*/ +#include +#include +#include +#include + +int main() +{ + boost::geometry::model::polygon > poly; + poly.outer().push_back(boost::make_tuple(1.0, 2.0)); + poly.outer().push_back(boost::make_tuple(6.0, 4.0)); + poly.outer().push_back(boost::make_tuple(5.0, 1.0)); + poly.outer().push_back(boost::make_tuple(1.0, 2.0)); + + std::cout << "Area: " << boost::geometry::area(poly) << std::endl; + std::cout << "Contains (1.5, 2.5): " + << std::boolalpha + << boost::geometry::within(boost::make_tuple(1.5, 2.5), poly) + << std::endl; + + return 0; +} + +//] + +//[boost_tuple_output +/*` +Output: +[pre +Area: 6.5 +Contains (1.5, 2.5): false +] +*/ +//] diff --git a/doc/src/examples/geometries/adapted/c_array.cpp b/doc/src/examples/geometries/adapted/c_array.cpp new file mode 100644 index 000000000..e17f89d73 --- /dev/null +++ b/doc/src/examples/geometries/adapted/c_array.cpp @@ -0,0 +1,36 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[c_array +//` Small example showing the combination of an array with a Boost.Geometry algorithm + +#include +#include +#include + +int main() +{ + int a[3] = {1, 2, 3}; + int b[3] = {2, 3, 4}; + + std::cout << boost::geometry::distance(a, b) << std::endl; + + return 0; +} + +//] + +//[c_array_output +/*` +Output: +[pre +1.73205 +] +*/ +//] diff --git a/doc/src/examples/geometries/register/point.cpp b/doc/src/examples/geometries/register/point.cpp index f523fc7c8..085e03839 100644 --- a/doc/src/examples/geometries/register/point.cpp +++ b/doc/src/examples/geometries/register/point.cpp @@ -28,7 +28,7 @@ int main() namespace bg = boost::geometry; - /*< Any Boost.Geometry function can be used for legacy point now. Here: assign and distance >*/ + /*< Any Boost.Geometry function can be used for legacy point now. Here: assign_values and distance >*/ bg::assign_values(p1, 1, 1); bg::assign_values(p2, 2, 2); From 7949efd6d48eebc2e6f06c68fab91bc801abac29 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 22 Apr 2011 22:27:34 +0000 Subject: [PATCH 55/70] Doc update; Added boost_polygon.hpp header including the other adaption headers [SVN r71423] --- include/boost/geometry/core/closure.hpp | 24 ++++++++++++------- include/boost/geometry/core/interior_type.hpp | 17 +++++++------ include/boost/geometry/core/point_order.hpp | 19 ++++++++------- include/boost/geometry/core/ring_type.hpp | 11 +++++---- include/boost/geometry/core/tag.hpp | 2 ++ .../geometries/adapted/boost_polygon.hpp | 18 ++++++++++++++ 6 files changed, 64 insertions(+), 27 deletions(-) create mode 100644 include/boost/geometry/geometries/adapted/boost_polygon.hpp diff --git a/include/boost/geometry/core/closure.hpp b/include/boost/geometry/core/closure.hpp index bb806b3aa..c1d3a902c 100644 --- a/include/boost/geometry/core/closure.hpp +++ b/include/boost/geometry/core/closure.hpp @@ -32,11 +32,11 @@ namespace boost { namespace geometry \brief Enumerates options for defining if polygons are open or closed \ingroup enum \details The enumeration closure_selector describes options for if a polygon is - open or closed. In a closed polygon the very first point (per ring) should be - equal to the very last point. - The specific closing property of a polygon type is defined by the closure metafunction. - The closure metafunction defines a value, which is one of the values enumerated - in the closure_selector + open or closed. In a closed polygon the very first point (per ring) should + be equal to the very last point. + The specific closing property of a polygon type is defined by the closure + metafunction. The closure metafunction defines a value, which is one of the + values enumerated in the closure_selector \qbk{ [heading See also] @@ -45,8 +45,13 @@ namespace boost { namespace geometry */ enum closure_selector { + /// Rings are open: first point and last point are different, algorithms + /// close them explicitly on the fly open = 0, + /// Rings are closed: first point and last point must be the same closed = 1, + /// (Not yet implemented): algorithms first figure out if ring must be + /// closed on the fly closure_undertermined = -1 }; @@ -123,13 +128,15 @@ template struct closure : public core_detail::closure::closed {}; template -struct closure : public core_detail::closure::closed {}; +struct closure + : public core_detail::closure::closed {}; template struct closure { - static const closure_selector value = geometry::traits::closure::value; + static const closure_selector value + = geometry::traits::closure::value; }; // Specialization for polygon: the closure is the closure of its rings @@ -149,7 +156,8 @@ struct closure /*! -\brief \brief_meta{value, closure (clockwise\, counterclockwise), \meta_geometry_type} +\brief \brief_meta{value, closure (clockwise\, counterclockwise), + \meta_geometry_type} \tparam Geometry \tparam_geometry \ingroup core diff --git a/include/boost/geometry/core/interior_type.hpp b/include/boost/geometry/core/interior_type.hpp index 64a064ab2..805ca4b7b 100644 --- a/include/boost/geometry/core/interior_type.hpp +++ b/include/boost/geometry/core/interior_type.hpp @@ -123,13 +123,16 @@ struct interior_type /*! - \brief Meta-function defining container type - of inner rings of (multi)polygon geometriy - \details the interior rings should be organized as a container - (std::vector, std::deque, boost::array) with - boost range support. This meta function defines the type - of that container. - \ingroup core +\brief \brief_meta{type, interior_type (container type + of inner rings), \meta_geometry_type} +\details Interior rings should be organized as a container + (std::vector, std::deque, boost::array) with + Boost.Range support. This metafunction defines the type + of the container. +\tparam Geometry A type fullfilling the Polygon or MultiPolygon concept. +\ingroup core + +\qbk{[include reference/core/interior_type.qbk]} */ template struct interior_type diff --git a/include/boost/geometry/core/point_order.hpp b/include/boost/geometry/core/point_order.hpp index 675fee802..fa956e259 100644 --- a/include/boost/geometry/core/point_order.hpp +++ b/include/boost/geometry/core/point_order.hpp @@ -29,11 +29,11 @@ namespace boost { namespace geometry /*! \brief Enumerates options for the order of points within polygons \ingroup enum -\details The enumeration order_selector describes options for the order of points - within a polygon. Polygons can be ordered either clockwise or counterclockwise. - The specific order of a polygon type is defined by the point_order metafunction. - The point_order metafunction defines a value, which is one of the values enumerated - in the order_selector +\details The enumeration order_selector describes options for the order of + points within a polygon. Polygons can be ordered either clockwise or + counterclockwise. The specific order of a polygon type is defined by the + point_order metafunction. The point_order metafunction defines a value, + which is one of the values enumerated in the order_selector \qbk{ [heading See also] @@ -46,7 +46,8 @@ enum order_selector clockwise = 1, /// Points are ordered counter clockwise counterclockwise = 2, - /// Points might be stored in any order, the algorithm will find out (not yet supported) + /// Points might be stored in any order, algorithms will determine it on the + /// fly (not yet supported) order_undetermined = 0 }; @@ -119,7 +120,8 @@ struct point_order template struct point_order { - static const order_selector value = geometry::traits::point_order::value; + static const order_selector value + = geometry::traits::point_order::value; }; // Specialization for polygon: the order is the order of its rings @@ -138,7 +140,8 @@ struct point_order /*! -\brief \brief_meta{value, point order (clockwise\, counterclockwise), \meta_geometry_type} +\brief \brief_meta{value, point order (clockwise\, counterclockwise), + \meta_geometry_type} \tparam Geometry \tparam_geometry \ingroup core diff --git a/include/boost/geometry/core/ring_type.hpp b/include/boost/geometry/core/ring_type.hpp index cf79fc65e..a53b95c96 100644 --- a/include/boost/geometry/core/ring_type.hpp +++ b/include/boost/geometry/core/ring_type.hpp @@ -132,12 +132,15 @@ struct ring_type /*! -\brief Meta-function which defines ring type of (multi)polygon geometry -\details a polygon contains one exterior ring +\brief \brief_meta{type, ring_type, \meta_geometry_type} +\details A polygon contains one exterior ring and zero or more interior rings (holes). - This meta function retrieves the type of the rings -\note Exterior ring and interior rings must have the same ring-type. + This metafunction retrieves the type of the rings. + Exterior ring and each of the interior rings all have the same ring_type. +\tparam Geometry A type fullfilling the Ring, Polygon or MultiPolygon concept. \ingroup core + +\qbk{[include reference/core/ring_type.qbk]} */ template struct ring_type diff --git a/include/boost/geometry/core/tag.hpp b/include/boost/geometry/core/tag.hpp index f8f622e74..b5e44958e 100644 --- a/include/boost/geometry/core/tag.hpp +++ b/include/boost/geometry/core/tag.hpp @@ -49,6 +49,8 @@ struct tag /*! \brief \brief_meta{type, tag, \meta_geometry_type} +\details With Boost.Geometry, tags are the driving force of the tag dispatching + mechanism. The tag metafunction is therefore used in every free function. \tparam Geometry \tparam_geometry \ingroup core diff --git a/include/boost/geometry/geometries/adapted/boost_polygon.hpp b/include/boost/geometry/geometries/adapted/boost_polygon.hpp new file mode 100644 index 000000000..9fe982b04 --- /dev/null +++ b/include/boost/geometry/geometries/adapted/boost_polygon.hpp @@ -0,0 +1,18 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2010-2011 Barend Gehrels, 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_GEOMETRIES_ADAPTED_BOOST_POLYGON_HPP +#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_HPP + +#include +#include +#include +#include + +#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_HPP + From c218a43c577833793f393b5ccab97469f0b2201e Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Fri, 22 Apr 2011 22:34:43 +0000 Subject: [PATCH 56/70] Added adapted to jam, fixed boost_array sample for gcc [SVN r71424] --- doc/src/examples/geometries/Jamfile.v2 | 1 + doc/src/examples/geometries/adapted/boost_array.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/examples/geometries/Jamfile.v2 b/doc/src/examples/geometries/Jamfile.v2 index 49465b344..a7b953f86 100644 --- a/doc/src/examples/geometries/Jamfile.v2 +++ b/doc/src/examples/geometries/Jamfile.v2 @@ -15,4 +15,5 @@ project boost-geometry-doc-src-example-geometries exe point : point.cpp ; +build-project adapted ; build-project register ; diff --git a/doc/src/examples/geometries/adapted/boost_array.cpp b/doc/src/examples/geometries/adapted/boost_array.cpp index 163ebc29f..e25e9d510 100644 --- a/doc/src/examples/geometries/adapted/boost_array.cpp +++ b/doc/src/examples/geometries/adapted/boost_array.cpp @@ -16,8 +16,8 @@ int main() { - boost::array a = {1, 2}; - boost::array b = {2, 3}; + boost::array a = { {1, 2} }; + boost::array b = { {2, 3} }; std::cout << boost::geometry::distance(a, b) << std::endl; boost::geometry::set<0>(a, 1.1); From fc68031c90b9db0513a61fb8c10fb20ae4cf63c8 Mon Sep 17 00:00:00 2001 From: Bruno Lalande Date: Sat, 23 Apr 2011 22:26:50 +0000 Subject: [PATCH 57/70] Removed adapted/tuple_.hpp files and added a macro to use instead. [SVN r71448] --- example/01_point_example.cpp | 4 +- example/04_boost_example.cpp | 5 +- example/c04_b_custom_triangle_example.cpp | 4 +- .../with_external_libs/x03_a_soci_example.cpp | 3 +- .../adapted/{tuple.hpp => boost_tuple.hpp} | 24 ++++++--- .../geometries/adapted/tuple_cartesian.hpp | 49 ------------------- .../geometries/adapted/tuple_geographic.hpp | 49 ------------------- .../boost/geometry/geometries/geometries.hpp | 2 +- test/algorithms/assign.cpp | 4 +- test/algorithms/convert.cpp | 4 +- test/algorithms/distance.cpp | 4 +- test/algorithms/envelope.cpp | 4 +- test/algorithms/expand.cpp | 4 +- test/algorithms/make.cpp | 4 +- test/algorithms/overlay/overlay_common.hpp | 4 +- test/arithmetic/arithmetic.cpp | 4 +- test/arithmetic/dot_product.cpp | 4 +- test/core/access.cpp | 3 +- test/core/coordinate_dimension.cpp | 4 +- test/core/coordinate_system.cpp | 4 +- test/core/coordinate_type.cpp | 4 +- test/core/geometry_id.cpp | 4 +- test/core/point_type.cpp | 4 +- test/core/tag.cpp | 4 +- test/core/topological_dimension.cpp | 4 +- test/geometries/Jamfile.v2 | 3 +- test/geometries/adapted.cpp | 5 +- test/geometries/boost_array_as_point.cpp | 4 +- test/geometries/boost_fusion.cpp | 5 +- ...st_tuple_cartesian.cpp => boost_tuple.cpp} | 6 ++- test/geometries/boost_tuple_geographic.cpp | 36 -------------- test/geometries/box.cpp | 4 +- test/geometries/custom_linestring.cpp | 4 +- test/geometries/segment.cpp | 4 +- test/multi/algorithms/multi_distance.cpp | 4 +- test/multi/algorithms/multi_envelope.cpp | 4 +- test/policies/compare.cpp | 4 +- test/strategies/projected_point.cpp | 3 +- test/strategies/pythagoras.cpp | 3 +- test/strategies/segment_intersection.cpp | 3 +- test/strategies/transformer.cpp | 4 +- test/util/for_each_coordinate.cpp | 4 +- test/views/closeable_view.cpp | 3 +- test/views/reversible_closeable.cpp | 4 +- test/views/reversible_view.cpp | 5 +- 45 files changed, 131 insertions(+), 188 deletions(-) rename include/boost/geometry/geometries/adapted/{tuple.hpp => boost_tuple.hpp} (81%) delete mode 100644 include/boost/geometry/geometries/adapted/tuple_cartesian.hpp delete mode 100644 include/boost/geometry/geometries/adapted/tuple_geographic.hpp rename test/geometries/{boost_tuple_cartesian.cpp => boost_tuple.cpp} (88%) delete mode 100644 test/geometries/boost_tuple_geographic.cpp diff --git a/example/01_point_example.cpp b/example/01_point_example.cpp index 574831e46..80157016c 100644 --- a/example/01_point_example.cpp +++ b/example/01_point_example.cpp @@ -13,11 +13,13 @@ #include #include -#include +#include #include #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + int main() { diff --git a/example/04_boost_example.cpp b/example/04_boost_example.cpp index 288ea6690..f6d56cdfe 100644 --- a/example/04_boost_example.cpp +++ b/example/04_boost_example.cpp @@ -13,10 +13,11 @@ #include #include -#include +#include -#include +#include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); int main(void) diff --git a/example/c04_b_custom_triangle_example.cpp b/example/c04_b_custom_triangle_example.cpp index 99acaa34e..af06b3068 100644 --- a/example/c04_b_custom_triangle_example.cpp +++ b/example/c04_b_custom_triangle_example.cpp @@ -17,12 +17,12 @@ #include #include -#include -#include +#include #include #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); template diff --git a/example/with_external_libs/x03_a_soci_example.cpp b/example/with_external_libs/x03_a_soci_example.cpp index 9177d15c4..de75b1831 100644 --- a/example/with_external_libs/x03_a_soci_example.cpp +++ b/example/with_external_libs/x03_a_soci_example.cpp @@ -35,9 +35,10 @@ #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); int main() diff --git a/include/boost/geometry/geometries/adapted/tuple.hpp b/include/boost/geometry/geometries/adapted/boost_tuple.hpp similarity index 81% rename from include/boost/geometry/geometries/adapted/tuple.hpp rename to include/boost/geometry/geometries/adapted/boost_tuple.hpp index 97347b092..b2e18771f 100644 --- a/include/boost/geometry/geometries/adapted/tuple.hpp +++ b/include/boost/geometry/geometries/adapted/boost_tuple.hpp @@ -11,8 +11,8 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_TUPLE_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_TUPLE_HPP +#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_TUPLE_HPP +#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_TUPLE_HPP #include @@ -24,6 +24,7 @@ #include #include + namespace boost { namespace geometry { @@ -86,16 +87,23 @@ struct access }; -// The library user has -// 1) either to specify the coordinate system using a traits class -// 2) or include -// where @=cartesian,geographic,... - } // namespace traits #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS }} // namespace boost::geometry -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_TUPLE_HPP +// Convenience registration macro to bind boost::tuple to a CS +#define BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(CoordinateSystem) \ + namespace boost { namespace geometry { namespace traits { \ + template \ + struct coordinate_system > \ + { \ + typedef CoordinateSystem type; \ + }; \ + }}} + + +#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_TUPLE_HPP diff --git a/include/boost/geometry/geometries/adapted/tuple_cartesian.hpp b/include/boost/geometry/geometries/adapted/tuple_cartesian.hpp deleted file mode 100644 index f4969f7be..000000000 --- a/include/boost/geometry/geometries/adapted/tuple_cartesian.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) - -// Copyright (c) 2008-2011 Bruno Lalande, Paris, France. -// Copyright (c) 2008-2011 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2009-2011 Mateusz Loskot, London, UK. - -// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library -// (geolib/GGL), copyright (c) 1995-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_GEOMETRIES_ADAPTED_TUPLE_CARTESIAN_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_TUPLE_CARTESIAN_HPP - -#ifdef BOOST_GEOMETRY_ADAPTED_TUPLE_COORDINATE_SYSTEM_DEFINED -#error Include only one headerfile to register coordinate coordinate_system for adapted tuple -#endif - -#define BOOST_GEOMETRY_ADAPTED_TUPLE_COORDINATE_SYSTEM_DEFINED - - -#include - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - - -template -struct coordinate_system > -{ typedef cs::cartesian type; }; - - -} -#endif - - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_TUPLE_CARTESIAN_HPP diff --git a/include/boost/geometry/geometries/adapted/tuple_geographic.hpp b/include/boost/geometry/geometries/adapted/tuple_geographic.hpp deleted file mode 100644 index 37cf4b14d..000000000 --- a/include/boost/geometry/geometries/adapted/tuple_geographic.hpp +++ /dev/null @@ -1,49 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) - -// Copyright (c) 2008-2011 Bruno Lalande, Paris, France. -// Copyright (c) 2008-2011 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2009-2011 Mateusz Loskot, London, UK. - -// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library -// (geolib/GGL), copyright (c) 1995-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_GEOMETRIES_ADAPTED_TUPLE_GEOGRAPHIC_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_TUPLE_GEOGRAPHIC_HPP - -#ifdef BOOST_GEOMETRY_ADAPTED_TUPLE_COORDINATE_SYSTEM_DEFINED -#error Include only one headerfile to register coordinate coordinate_system for adapted tuple -#endif - -#define BOOST_GEOMETRY_ADAPTED_TUPLE_COORDINATE_SYSTEM_DEFINED - - -#include - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - - -template -struct coordinate_system > -{ typedef cs::geographic type; }; - - -} -#endif - - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_TUPLE_GEOGRAPHIC_HPP diff --git a/include/boost/geometry/geometries/geometries.hpp b/include/boost/geometry/geometries/geometries.hpp index cef9f6bf1..fd766ff26 100644 --- a/include/boost/geometry/geometries/geometries.hpp +++ b/include/boost/geometry/geometries/geometries.hpp @@ -15,7 +15,7 @@ #define BOOST_GEOMETRY_GEOMETRIES_HPP #include -#include +#include #include #include diff --git a/test/algorithms/assign.cpp b/test/algorithms/assign.cpp index ab4ee31b0..1db48ea38 100644 --- a/test/algorithms/assign.cpp +++ b/test/algorithms/assign.cpp @@ -20,9 +20,11 @@ #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void check_linestring_2d(Linestring const& line) diff --git a/test/algorithms/convert.cpp b/test/algorithms/convert.cpp index 185aceb11..8af86681b 100644 --- a/test/algorithms/convert.cpp +++ b/test/algorithms/convert.cpp @@ -22,9 +22,11 @@ #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_all() diff --git a/test/algorithms/distance.cpp b/test/algorithms/distance.cpp index aed42dbf2..1fe6c436a 100644 --- a/test/algorithms/distance.cpp +++ b/test/algorithms/distance.cpp @@ -23,12 +23,14 @@ #include #include #include -#include +#include #include #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_distance_point() diff --git a/test/algorithms/envelope.cpp b/test/algorithms/envelope.cpp index c790c0579..5eaa6c42b 100644 --- a/test/algorithms/envelope.cpp +++ b/test/algorithms/envelope.cpp @@ -17,10 +17,12 @@ #include #include -#include +#include #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_2d() diff --git a/test/algorithms/expand.cpp b/test/algorithms/expand.cpp index 040f2c3c5..0b8dafa3a 100644 --- a/test/algorithms/expand.cpp +++ b/test/algorithms/expand.cpp @@ -19,10 +19,12 @@ #include #include -#include +#include #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_point_3d() diff --git a/test/algorithms/make.cpp b/test/algorithms/make.cpp index 65b63fe9e..21587d26b 100644 --- a/test/algorithms/make.cpp +++ b/test/algorithms/make.cpp @@ -21,9 +21,11 @@ #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_point_2d() diff --git a/test/algorithms/overlay/overlay_common.hpp b/test/algorithms/overlay/overlay_common.hpp index de991806b..d821df85c 100644 --- a/test/algorithms/overlay/overlay_common.hpp +++ b/test/algorithms/overlay/overlay_common.hpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include @@ -33,6 +33,8 @@ # include #endif +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template diff --git a/test/arithmetic/arithmetic.cpp b/test/arithmetic/arithmetic.cpp index 1ae1915f4..1c5736424 100644 --- a/test/arithmetic/arithmetic.cpp +++ b/test/arithmetic/arithmetic.cpp @@ -22,9 +22,11 @@ #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_addition() diff --git a/test/arithmetic/dot_product.cpp b/test/arithmetic/dot_product.cpp index 777124ca2..da639ff43 100644 --- a/test/arithmetic/dot_product.cpp +++ b/test/arithmetic/dot_product.cpp @@ -22,9 +22,11 @@ #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_all() diff --git a/test/core/access.cpp b/test/core/access.cpp index f5e2cb033..880e29681 100644 --- a/test/core/access.cpp +++ b/test/core/access.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include @@ -31,6 +31,7 @@ #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); template diff --git a/test/core/coordinate_dimension.cpp b/test/core/coordinate_dimension.cpp index 7013b3155..d76fd8159 100644 --- a/test/core/coordinate_dimension.cpp +++ b/test/core/coordinate_dimension.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -25,6 +25,8 @@ #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_geometry() diff --git a/test/core/coordinate_system.cpp b/test/core/coordinate_system.cpp index d3aa6cdd6..cfa66f8cf 100644 --- a/test/core/coordinate_system.cpp +++ b/test/core/coordinate_system.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -25,6 +25,8 @@ #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_geometry() diff --git a/test/core/coordinate_type.cpp b/test/core/coordinate_type.cpp index 71dbc4ae6..81c14a5be 100644 --- a/test/core/coordinate_type.cpp +++ b/test/core/coordinate_type.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -25,6 +25,8 @@ #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_geometry() diff --git a/test/core/geometry_id.cpp b/test/core/geometry_id.cpp index d80b4f8fb..9cdf9a397 100644 --- a/test/core/geometry_id.cpp +++ b/test/core/geometry_id.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -24,6 +24,8 @@ #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_geometry() diff --git a/test/core/point_type.cpp b/test/core/point_type.cpp index 957b8ebc6..96e7ce9b4 100644 --- a/test/core/point_type.cpp +++ b/test/core/point_type.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -24,6 +24,8 @@ #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_geometry() diff --git a/test/core/tag.cpp b/test/core/tag.cpp index 21361d42c..ea2b3bbe9 100644 --- a/test/core/tag.cpp +++ b/test/core/tag.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include @@ -23,6 +23,8 @@ #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_geometry() diff --git a/test/core/topological_dimension.cpp b/test/core/topological_dimension.cpp index c2edfa47a..4fb36705c 100644 --- a/test/core/topological_dimension.cpp +++ b/test/core/topological_dimension.cpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include @@ -23,6 +23,8 @@ #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_geometry() diff --git a/test/geometries/Jamfile.v2 b/test/geometries/Jamfile.v2 index 266980536..de76d1bef 100644 --- a/test/geometries/Jamfile.v2 +++ b/test/geometries/Jamfile.v2 @@ -15,8 +15,7 @@ test-suite boost-geometry-geometries [ run boost_fusion.cpp ] [ run boost_polygon.cpp ] [ run boost_range.cpp ] - [ run boost_tuple_cartesian.cpp ] - [ run boost_tuple_geographic.cpp ] + [ run boost_tuple.cpp ] [ run box.cpp ] #[ compile-fail custom_linestring.cpp # : # requirements diff --git a/test/geometries/adapted.cpp b/test/geometries/adapted.cpp index 6ce4ddf98..973257ee9 100644 --- a/test/geometries/adapted.cpp +++ b/test/geometries/adapted.cpp @@ -46,11 +46,14 @@ #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + // ---------------------------------------------------------------------------- template diff --git a/test/geometries/boost_array_as_point.cpp b/test/geometries/boost_array_as_point.cpp index a74e4815c..ac2eb0840 100644 --- a/test/geometries/boost_array_as_point.cpp +++ b/test/geometries/boost_array_as_point.cpp @@ -14,9 +14,11 @@ #include #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + int test_main(int, char* []) { diff --git a/test/geometries/boost_fusion.cpp b/test/geometries/boost_fusion.cpp index 6ed8fd056..9035599ba 100644 --- a/test/geometries/boost_fusion.cpp +++ b/test/geometries/boost_fusion.cpp @@ -16,9 +16,12 @@ #include #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + + struct for_fusion_2d { float x,y; diff --git a/test/geometries/boost_tuple_cartesian.cpp b/test/geometries/boost_tuple.cpp similarity index 88% rename from test/geometries/boost_tuple_cartesian.cpp rename to test/geometries/boost_tuple.cpp index d72494b69..281d73b56 100644 --- a/test/geometries/boost_tuple_cartesian.cpp +++ b/test/geometries/boost_tuple.cpp @@ -10,12 +10,16 @@ #include #include -#include +#include #include #include #include + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + + template void test_all() { diff --git a/test/geometries/boost_tuple_geographic.cpp b/test/geometries/boost_tuple_geographic.cpp deleted file mode 100644 index 579c5d497..000000000 --- a/test/geometries/boost_tuple_geographic.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) -// Unit Test - -// Copyright (c) 2008-2011 Bruno Lalande, Paris, France. - -// 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) - - -#include -#include -#include -#include -#include - -#include - -template -void test_all() -{ - P p1, p2; -// TODO do something applicable for geographic point types -// bg::distance(p1, p2); -} - -int test_main(int, char* []) -{ - test_all >(); - test_all >(); - test_all >(); - test_all >(); - test_all >(); - - return 0; -} diff --git a/test/geometries/box.cpp b/test/geometries/box.cpp index 44a9a012f..f640592b2 100644 --- a/test/geometries/box.cpp +++ b/test/geometries/box.cpp @@ -21,9 +21,11 @@ #include #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template bg::model::box

create_box() diff --git a/test/geometries/custom_linestring.cpp b/test/geometries/custom_linestring.cpp index 7596a7d9f..2bdf70c77 100644 --- a/test/geometries/custom_linestring.cpp +++ b/test/geometries/custom_linestring.cpp @@ -28,9 +28,11 @@ #include #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + //#define TEST_FAIL_CLEAR //#define TEST_FAIL_APPEND diff --git a/test/geometries/segment.cpp b/test/geometries/segment.cpp index 9845021d4..0b2ff245f 100644 --- a/test/geometries/segment.cpp +++ b/test/geometries/segment.cpp @@ -23,7 +23,7 @@ #include -#include +#include #include @@ -31,6 +31,8 @@ #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_all() diff --git a/test/multi/algorithms/multi_distance.cpp b/test/multi/algorithms/multi_distance.cpp index 2eedc5690..51edb8dcc 100644 --- a/test/multi/algorithms/multi_distance.cpp +++ b/test/multi/algorithms/multi_distance.cpp @@ -24,9 +24,11 @@ #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_distance(std::string const& wkt1, std::string const& wkt2, double expected) diff --git a/test/multi/algorithms/multi_envelope.cpp b/test/multi/algorithms/multi_envelope.cpp index 0d033b7d6..2ebec5fed 100644 --- a/test/multi/algorithms/multi_envelope.cpp +++ b/test/multi/algorithms/multi_envelope.cpp @@ -25,10 +25,10 @@ #include #include -#include +#include #include - +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); template diff --git a/test/policies/compare.cpp b/test/policies/compare.cpp index a1e406173..57ed8ab41 100644 --- a/test/policies/compare.cpp +++ b/test/policies/compare.cpp @@ -20,10 +20,12 @@ #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template inline std::string coordinates(Container const& points) diff --git a/test/strategies/projected_point.cpp b/test/strategies/projected_point.cpp index 7ad1e91fb..bfbe5f6e1 100644 --- a/test/strategies/projected_point.cpp +++ b/test/strategies/projected_point.cpp @@ -23,13 +23,14 @@ #include #include -#include +#include #include #ifdef HAVE_TTMATH # include #endif +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); template diff --git a/test/strategies/pythagoras.cpp b/test/strategies/pythagoras.cpp index 204386422..b3d39c363 100644 --- a/test/strategies/pythagoras.cpp +++ b/test/strategies/pythagoras.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include @@ -39,6 +39,7 @@ # include #endif +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); template diff --git a/test/strategies/segment_intersection.cpp b/test/strategies/segment_intersection.cpp index cbf40f278..d68b6ee5c 100644 --- a/test/strategies/segment_intersection.cpp +++ b/test/strategies/segment_intersection.cpp @@ -38,8 +38,9 @@ #include #include -#include +#include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); template diff --git a/test/strategies/transformer.cpp b/test/strategies/transformer.cpp index 3826ce823..7efec562c 100644 --- a/test/strategies/transformer.cpp +++ b/test/strategies/transformer.cpp @@ -25,9 +25,9 @@ #include #include -#include - +#include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); template diff --git a/test/util/for_each_coordinate.cpp b/test/util/for_each_coordinate.cpp index 993c6a4d1..07c85736f 100644 --- a/test/util/for_each_coordinate.cpp +++ b/test/util/for_each_coordinate.cpp @@ -24,9 +24,11 @@ #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + struct test_operation { diff --git a/test/views/closeable_view.cpp b/test/views/closeable_view.cpp index 29b626349..991836eac 100644 --- a/test/views/closeable_view.cpp +++ b/test/views/closeable_view.cpp @@ -19,8 +19,9 @@ #include #include #include -#include +#include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); diff --git a/test/views/reversible_closeable.cpp b/test/views/reversible_closeable.cpp index 4dedb4cd5..87e0dc38d 100644 --- a/test/views/reversible_closeable.cpp +++ b/test/views/reversible_closeable.cpp @@ -21,7 +21,9 @@ #include #include #include -#include +#include + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); template diff --git a/test/views/reversible_view.cpp b/test/views/reversible_view.cpp index 865c3063f..42ae5c339 100644 --- a/test/views/reversible_view.cpp +++ b/test/views/reversible_view.cpp @@ -19,7 +19,10 @@ #include #include #include -#include +#include + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + template void test_forward_or_reverse(Range const& range, std::string const& expected) From 9f301828e8457232f122591ce110ebf394584221 Mon Sep 17 00:00:00 2001 From: Bruno Lalande Date: Sat, 23 Apr 2011 22:33:06 +0000 Subject: [PATCH 58/70] Added a test for 5D linestring centroid. [SVN r71451] --- test/algorithms/centroid.cpp | 18 ++++++++++++++-- test/algorithms/test_centroid.hpp | 34 +++++++++++-------------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/test/algorithms/centroid.cpp b/test/algorithms/centroid.cpp index e2b5d5205..41c55711f 100644 --- a/test/algorithms/centroid.cpp +++ b/test/algorithms/centroid.cpp @@ -16,10 +16,13 @@ #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + + template void test_polygon() { @@ -78,12 +81,21 @@ void test_2d() template void test_3d() { - test_centroid >("LINESTRING(1 2 3,4 5 -6,7 -8 9,-10 11 12,13 -14 -15, 16 17 18)", 5.6748865168734692, 0.31974938587214002, 1.9915270387763671); + test_centroid >("LINESTRING(1 2 3,4 5 -6,7 -8 9,-10 11 12,13 -14 -15, 16 17 18)", + 5.6748865168734692, 0.31974938587214002, 1.9915270387763671); test_centroid >("POLYGON((1 2 3,5 6 7))", 3, 4, 5); test_centroid

("POINT(1 2 3)", 1, 2, 3); } +template +void test_5d() +{ + test_centroid >("LINESTRING(1 2 3 4 95,4 5 -6 24 40,7 -8 9 -5 -7,-10 11 12 -5 5,13 -14 -15 4 3, 16 17 18 5 12)", + 4.9202312983547678, 0.69590937869808345, 1.2632138719797417, 6.0468332057401986, 23.082402715244868); +} + + int test_main(int, char* []) { test_2d >(); @@ -92,6 +104,8 @@ int test_main(int, char* []) test_3d >(); + test_5d >(); + #if defined(HAVE_TTMATH) test_2d >(); test_3d >(); diff --git a/test/algorithms/test_centroid.hpp b/test/algorithms/test_centroid.hpp index c9467251e..918932ef0 100644 --- a/test/algorithms/test_centroid.hpp +++ b/test/algorithms/test_centroid.hpp @@ -16,41 +16,31 @@ #include #include #include +#include #include -template +template struct check_result { -}; - -template <> -struct check_result<2> -{ - template - static void apply(Point const& p, T const& x, T const& y, T const&) + template + static void apply(Point1 const& actual, Point2 const& expected) { - BOOST_CHECK_CLOSE(bg::get<0>(p), x, 0.001); - BOOST_CHECK_CLOSE(bg::get<1>(p), y, 0.001); + check_result::apply(actual, expected); + BOOST_CHECK_CLOSE(bg::get(actual), bg::get(expected), 0.001); } }; - template <> -struct check_result<3> +struct check_result<0> { - template - static void apply(Point const& p, T const& x, T const& y, T const& z) - { - BOOST_CHECK_CLOSE(bg::get<0>(p), x, 0.001); - BOOST_CHECK_CLOSE(bg::get<1>(p), y, 0.001); - BOOST_CHECK_CLOSE(bg::get<2>(p), z, 0.001); - } + template + static void apply(Point1 const&, Point2 const&) + {} }; - template void test_with_other_calculation_type(Geometry const& geometry, Point& c1) { @@ -67,14 +57,14 @@ void test_with_other_calculation_type(Geometry const& geometry, Point& c1) } template -void test_centroid(std::string const& wkt, T const& x, T const& y, T const& z = T()) +void test_centroid(std::string const& wkt, T const& d1, T const& d2, T const& d3 = T(), T const& d4 = T(), T const& d5 = T()) { Geometry geometry; bg::read_wkt(wkt, geometry); typedef typename bg::point_type::type point_type; point_type c1; bg::centroid(geometry, c1); - check_result::type::value>::apply(c1, x, y, z); + check_result::type::value>::apply(c1, boost::make_tuple(d1, d2, d3, d4, d5)); #ifdef REPORT_RESULTS std::cout << "normal: " << std::setprecision(20) << bg::get<0>(c1) << " " << bg::get<1>(c1) << std::endl; From 5c8365befb3afdd81c9007f5e91704d4d1712a68 Mon Sep 17 00:00:00 2001 From: Bruno Lalande Date: Mon, 25 Apr 2011 08:32:51 +0000 Subject: [PATCH 59/70] Removed adapted/fusion_.hpp files and added a macro to use instead. [SVN r71475] --- example/c09_custom_fusion_example.cpp | 5 ++- .../adapted/{fusion.hpp => boost_fusion.hpp} | 23 +++++++--- .../geometries/adapted/fusion_cartesian.hpp | 44 ------------------- .../geometries/adapted/fusion_geographic.hpp | 44 ------------------- test/geometries/boost_fusion.cpp | 6 +-- 5 files changed, 24 insertions(+), 98 deletions(-) rename include/boost/geometry/geometries/adapted/{fusion.hpp => boost_fusion.hpp} (87%) delete mode 100644 include/boost/geometry/geometries/adapted/fusion_cartesian.hpp delete mode 100644 include/boost/geometry/geometries/adapted/fusion_geographic.hpp diff --git a/example/c09_custom_fusion_example.cpp b/example/c09_custom_fusion_example.cpp index 6bc3779b7..ef8828c59 100644 --- a/example/c09_custom_fusion_example.cpp +++ b/example/c09_custom_fusion_example.cpp @@ -15,12 +15,13 @@ #include -#include -#include +#include #include #include +BOOST_GEOMETRY_REGISTER_BOOST_FUSION_CS(cs::cartesian); + // Sample point, having x/y struct my_2d diff --git a/include/boost/geometry/geometries/adapted/fusion.hpp b/include/boost/geometry/geometries/adapted/boost_fusion.hpp similarity index 87% rename from include/boost/geometry/geometries/adapted/fusion.hpp rename to include/boost/geometry/geometries/adapted/boost_fusion.hpp index 81d89230a..3c81672f8 100644 --- a/include/boost/geometry/geometries/adapted/fusion.hpp +++ b/include/boost/geometry/geometries/adapted/boost_fusion.hpp @@ -130,10 +130,6 @@ struct access } }; -// The library user has -// 1) either to specify the coordinate system using a traits class -// 2) or include -// where @=cartesian,geographic,... template struct tag @@ -148,6 +144,7 @@ struct tag typedef point_tag type; }; + } // namespace traits #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS @@ -155,5 +152,21 @@ struct tag }} // namespace boost::geometry -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_FUSION_HPP +// Convenience registration macro to bind a Fusion sequence to a CS +#define BOOST_GEOMETRY_REGISTER_BOOST_FUSION_CS(CoordinateSystem) \ + namespace boost { namespace geometry { namespace traits { \ + template \ + struct coordinate_system \ + < \ + Sequence, \ + typename boost::enable_if \ + < \ + fusion_adapt_detail::is_fusion_sequence \ + >::type \ + > \ + { typedef cs::cartesian type; }; \ + }}} + + +#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_FUSION_HPP diff --git a/include/boost/geometry/geometries/adapted/fusion_cartesian.hpp b/include/boost/geometry/geometries/adapted/fusion_cartesian.hpp deleted file mode 100644 index 2aa17a712..000000000 --- a/include/boost/geometry/geometries/adapted/fusion_cartesian.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) - -// Copyright (c) 2011 Akira Takahashi -// Copyright (c) 2011 Barend Gehrels, 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_GEOMETRIES_ADAPTED_FUSION_CARTESIAN_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_FUSION_CARTESIAN_HPP - -#ifdef BOOST_GEOMETRY_ADAPTED_FUSION_COORDINATE_SYSTEM_DEFINED -#error Include only one headerfile to register coordinate coordinate_system for adapted fusion -#endif - -#define BOOST_GEOMETRY_ADAPTED_FUSION_COORDINATE_SYSTEM_DEFINED - - -#include - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - template - struct coordinate_system< - Sequence, - typename boost::enable_if< - fusion_adapt_detail::is_fusion_sequence >::type> - { typedef cs::cartesian type; }; - -} // namespace traits -#endif - - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_FUSION_CARTESIAN_HPP diff --git a/include/boost/geometry/geometries/adapted/fusion_geographic.hpp b/include/boost/geometry/geometries/adapted/fusion_geographic.hpp deleted file mode 100644 index 4e693af4e..000000000 --- a/include/boost/geometry/geometries/adapted/fusion_geographic.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) - -// Copyright (c) 2011 Akira Takahashi -// Copyright (c) 2011 Barend Gehrels, 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_GEOMETRIES_ADAPTED_FUSION_GEOGRAPHIC_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_FUSION_GEOGRAPHIC_HPP - -#ifdef BOOST_GEOMETRY_ADAPTED_FUSION_COORDINATE_SYSTEM_DEFINED -#error Include only one headerfile to register coordinate coordinate_system for adapted fusion -#endif - -#define BOOST_GEOMETRY_ADAPTED_FUSION_COORDINATE_SYSTEM_DEFINED - - -#include - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - template - struct coordinate_system< - Sequence, - typename boost::enable_if< - fusion_adapt_detail::is_fusion_sequence >::type> - { typedef cs::geographic type; }; - -} // namespace traits -#endif - - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_FUSION_GEOGRAPHIC_HPP diff --git a/test/geometries/boost_fusion.cpp b/test/geometries/boost_fusion.cpp index 9035599ba..1188fdd2b 100644 --- a/test/geometries/boost_fusion.cpp +++ b/test/geometries/boost_fusion.cpp @@ -13,12 +13,12 @@ #include #include -#include -#include -#include +#include +#include #include #include +BOOST_GEOMETRY_REGISTER_BOOST_FUSION_CS(cs::cartesian); BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); From 49804f1291b3e31338aa0a8247f9674848bffa85 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Mon, 25 Apr 2011 21:19:26 +0000 Subject: [PATCH 60/70] Documented box, renamed TEMPLATIZED TEMPLATED Removed registration of linestring/ring as it will be replaced by view or view_as [SVN r71490] --- .../geometry/geometries/register/box.hpp | 72 ++++++++++++++++--- .../geometries/register/linestring.hpp | 30 -------- .../geometry/geometries/register/ring.hpp | 33 --------- 3 files changed, 61 insertions(+), 74 deletions(-) delete mode 100644 include/boost/geometry/geometries/register/linestring.hpp delete mode 100644 include/boost/geometry/geometries/register/ring.hpp diff --git a/include/boost/geometry/geometries/register/box.hpp b/include/boost/geometry/geometries/register/box.hpp index 4761384a9..cac2af7a7 100644 --- a/include/boost/geometry/geometries/register/box.hpp +++ b/include/boost/geometry/geometries/register/box.hpp @@ -40,7 +40,7 @@ struct indexed_access \ }; -#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_TEMPLATIZED(Box, MinCorner, MaxCorner) \ +#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_TEMPLATED(Box, MinCorner, MaxCorner) \ template \ struct indexed_access, min_corner, D> \ { \ @@ -94,7 +94,7 @@ template <> struct indexed_access \ template<> struct tag { typedef box_tag type; }; \ template<> struct point_type { typedef PointType type; }; -#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS_TEMPLATIZED(Box) \ +#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS_TEMPLATED(Box) \ template struct tag > { typedef box_tag type; }; \ template struct point_type > { typedef P type; }; @@ -102,23 +102,73 @@ template <> struct indexed_access \ -#define BOOST_GEOMETRY_REGISTER_BOX(Box, PointType, MinCorner, MaxCorner) \ +/*! +\brief \brief_macro{box} +\ingroup register +\details \details_macro{BOOST_GEOMETRY_REGISTER_BOX, box} The + box may contain template parameters, which must be specified then. +\param Box \param_macro_type{Box} +\param Point Point type on which box is based. Might be two or three-dimensional +\param MinCorner minimum corner (should be public member or method) +\param MaxCorner maximum corner (should be public member or method) + +\qbk{ +[heading Example] +[register_box] +[register_box_output] +} +*/ +#define BOOST_GEOMETRY_REGISTER_BOX(Box, Point, MinCorner, MaxCorner) \ namespace boost { namespace geometry { namespace traits { \ - BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS(Box, PointType) \ - BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS(Box, PointType, MinCorner, MaxCorner) \ + BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS(Box, Point) \ + BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS(Box, Point, MinCorner, MaxCorner) \ }}} -#define BOOST_GEOMETRY_REGISTER_BOX_TEMPLATIZED(Box, MinCorner, MaxCorner) \ +/*! +\brief \brief_macro{box} +\ingroup register +\details \details_macro{BOOST_GEOMETRY_REGISTER_BOX_TEMPLATED, box} + \details_macro_templated{box} +\param Box \param_macro_type{Box} +\param MinCorner minimum corner (should be public member or method) +\param MaxCorner maximum corner (should be public member or method) + +\qbk{ +[heading Example] +[register_box_templated] +[register_box_templated_output] +} +*/ +#define BOOST_GEOMETRY_REGISTER_BOX_TEMPLATED(Box, MinCorner, MaxCorner) \ namespace boost { namespace geometry { namespace traits { \ - BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS_TEMPLATIZED(Box) \ - BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_TEMPLATIZED(Box, MinCorner, MaxCorner) \ + BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS_TEMPLATED(Box) \ + BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_TEMPLATED(Box, MinCorner, MaxCorner) \ }}} -#define BOOST_GEOMETRY_REGISTER_BOX_2D_4VALUES(Box, PointType, Left, Bottom, Right, Top) \ +/*! +\brief \brief_macro{box} +\ingroup register +\details \details_macro{BOOST_GEOMETRY_REGISTER_BOX_2D_4VALUES, box} +\param Box \param_macro_type{Box} +\param Point Point type reported as point_type by box. Must be two dimensional. + Note that these box tyeps do not contain points, but they must have a + related point_type +\param Left Left side (must be public member or method) +\param Bottom Bottom side (must be public member or method) +\param Right Right side (must be public member or method) +\param Top Top side (must be public member or method) + +\qbk{ +[heading Example] +[register_box_2d_4values] +[register_box_2d_4values_output] +} +*/ +#define BOOST_GEOMETRY_REGISTER_BOX_2D_4VALUES(Box, Point, Left, Bottom, Right, Top) \ namespace boost { namespace geometry { namespace traits { \ - BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS(Box, PointType) \ - BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_4VALUES(Box, PointType, Left, Bottom, Right, Top) \ + BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS(Box, Point) \ + BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_4VALUES(Box, Point, Left, Bottom, Right, Top) \ }}} diff --git a/include/boost/geometry/geometries/register/linestring.hpp b/include/boost/geometry/geometries/register/linestring.hpp deleted file mode 100644 index c8d17195a..000000000 --- a/include/boost/geometry/geometries/register/linestring.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) - -// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2011 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2011 Mateusz Loskot, London, UK. - -// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library -// (geolib/GGL), copyright (c) 1995-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_GEOMETRIES_REGISTER_LINESTRING_HPP -#define BOOST_GEOMETRY_GEOMETRIES_REGISTER_LINESTRING_HPP - - -#include -#include - - -#define BOOST_GEOMETRY_REGISTER_LINESTRING(Linestring) \ -namespace boost { namespace geometry { namespace traits { \ - template<> struct tag { typedef linestring_tag type; }; \ -}}} - - - -#endif // BOOST_GEOMETRY_GEOMETRIES_REGISTER_LINESTRING_HPP diff --git a/include/boost/geometry/geometries/register/ring.hpp b/include/boost/geometry/geometries/register/ring.hpp deleted file mode 100644 index 61f2e08d3..000000000 --- a/include/boost/geometry/geometries/register/ring.hpp +++ /dev/null @@ -1,33 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) - -// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2011 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2011 Mateusz Loskot, London, UK. - -// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library -// (geolib/GGL), copyright (c) 1995-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_GEOMETRIES_REGISTER_RING_HPP -#define BOOST_GEOMETRY_GEOMETRIES_REGISTER_RING_HPP - -#include -#include - -#define BOOST_GEOMETRY_REGISTER_RING(Ring) \ -namespace boost { namespace geometry { namespace traits { \ - template<> struct tag { typedef ring_tag type; }; \ -}}} - - -#define BOOST_GEOMETRY_REGISTER_RING_TEMPLATIZED(Ring) \ -namespace boost { namespace geometry { namespace traits { \ - template struct tag< Ring

> { typedef ring_tag type; }; \ -}}} - - -#endif // BOOST_GEOMETRY_GEOMETRIES_REGISTER_RING_HPP From b2eec50965e5d0b525a03867153446e410dac5ec Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Mon, 25 Apr 2011 21:22:58 +0000 Subject: [PATCH 61/70] Added many docs/samples Updated for tuple/registration macro [SVN r71491] --- doc/doxy/Doxyfile | 3 +- doc/geometry.qbk | 7 ++- doc/imports.qbk | 12 +++++ doc/quickref.xml | 46 +++++++++++++---- doc/reference.qbk | 22 ++++++-- .../point_data.qbk} | 7 ++- .../adapted/boost_polygon/polygon_data.qbk | 36 +++++++++++++ .../boost_polygon/polygon_with_holes_data.qbk | 37 ++++++++++++++ .../adapted/boost_polygon/rectangle_data.qbk | 36 +++++++++++++ .../adapted/boost_range/adapts_model.qbk | 19 +++++++ .../adapted/boost_range/filtered.qbk | 36 +++++++++++++ .../adapted/boost_range/reversed.qbk | 36 +++++++++++++ .../geometries/adapted/boost_range/sliced.qbk | 36 +++++++++++++ .../adapted/boost_range/strided.qbk | 37 ++++++++++++++ .../adapted/boost_range/uniqued.qbk | 36 +++++++++++++ doc/src/examples/algorithms/append.cpp | 6 ++- doc/src/examples/algorithms/assign.cpp | 4 +- doc/src/examples/algorithms/assign_points.cpp | 4 +- doc/src/examples/algorithms/clear.cpp | 4 +- doc/src/examples/algorithms/convert.cpp | 4 +- doc/src/examples/algorithms/convex_hull.cpp | 4 +- doc/src/examples/algorithms/correct.cpp | 4 +- doc/src/examples/algorithms/equals.cpp | 4 +- doc/src/examples/algorithms/make_2d_point.cpp | 4 +- doc/src/examples/algorithms/reverse.cpp | 4 +- doc/src/examples/algorithms/unique.cpp | 4 +- .../examples/core/coordinate_dimension.cpp | 7 +-- doc/src/examples/core/tag.cpp | 7 ++- .../examples/geometries/adapted/Jamfile.v2 | 1 + .../geometries/adapted/boost_fusion.cpp | 7 ++- .../geometries/adapted/boost_tuple.cpp | 3 +- .../examples/geometries/register/Jamfile.v2 | 3 +- doc/src/examples/geometries/register/box.cpp | 51 +++++++++++++++++++ .../geometries/register/box_templated.cpp | 44 ++++++++++++++++ doc/src/examples/quick_start.cpp | 3 +- example/c02_custom_box_example.cpp | 2 +- example/c04_b_custom_triangle_example.cpp | 6 ++- test/test_geometries/custom_segment.hpp | 2 +- 38 files changed, 541 insertions(+), 47 deletions(-) rename doc/reference/geometries/adapted/{boost_polygon.qbk => boost_polygon/point_data.qbk} (77%) create mode 100644 doc/reference/geometries/adapted/boost_polygon/polygon_data.qbk create mode 100644 doc/reference/geometries/adapted/boost_polygon/polygon_with_holes_data.qbk create mode 100644 doc/reference/geometries/adapted/boost_polygon/rectangle_data.qbk create mode 100644 doc/reference/geometries/adapted/boost_range/adapts_model.qbk create mode 100644 doc/reference/geometries/adapted/boost_range/filtered.qbk create mode 100644 doc/reference/geometries/adapted/boost_range/reversed.qbk create mode 100644 doc/reference/geometries/adapted/boost_range/sliced.qbk create mode 100644 doc/reference/geometries/adapted/boost_range/strided.qbk create mode 100644 doc/reference/geometries/adapted/boost_range/uniqued.qbk create mode 100644 doc/src/examples/geometries/register/box.cpp create mode 100644 doc/src/examples/geometries/register/box_templated.cpp diff --git a/doc/doxy/Doxyfile b/doc/doxy/Doxyfile index fe4ed73d3..f1183a74e 100644 --- a/doc/doxy/Doxyfile +++ b/doc/doxy/Doxyfile @@ -95,9 +95,10 @@ ALIASES = qbk{1}="\xmlonly \1 \endxmlonly" \ details_calc2{2}="The free function \1 calculates the \2 of two geometries" \ details_calc2{1}="The free function \1 calculates the \1 of two geometries" \ details_check12{2}="The free function \1 checks if the first geometry \2 the second geometry" \ - details_macro{2}="The macro \1 registers a \2 such that it is recognized by Boost.Geometry and that Boost.Geometry functionality can used with the specified point type" \ + details_macro{2}="The macro \1 registers a \2 such that it is recognized by Boost.Geometry and that Boost.Geometry functionality can used with the specified type." \ details_macro_const="The const version registers only read access to the fields, the point type is therefore read-only" \ details_macro_getset="The get/set version registers get and set methods separately and can be used for classes with protected member variables and get/set methods to change coordinates" \ + details_macro_templated{1}="The type must have one template parameter, which should be a point type, and should not be specified. Boost.Geometry takes care of inserting the template parameter. Hence all types of this templated \1 are registered, regardless of their point type." \ details_default_strategy="It uses the default strategy, based on the coordinate system of the geometry." \ details_strategy_reasons="Reasons to specify a strategy include: use another coordinate system for calculations; construct the strategy beforehand (e.g. with the radius of the Earth); select a strategy when there are more than one available for a calculation." \ details_return{1}="This version with the return_ prefix returns the \1, and a template parameter must therefore be specified in the call." \ diff --git a/doc/geometry.qbk b/doc/geometry.qbk index 3519723ef..4e2d304c0 100644 --- a/doc/geometry.qbk +++ b/doc/geometry.qbk @@ -49,6 +49,9 @@ [def __other__ Other geometries] [def __nyiversion__ Not yet supported in this version] +[def __not_in_boost_geometry_hpp__ The standard header `boost/geometry.hpp` does not include this header.] + + [/Parts] [def __ret_zero__ Returns zero] [def __ret_one__ Returns 1] @@ -62,8 +65,8 @@ All algorithms in Boost.Geometry will check any geometry arguments against the concept requirements.] -[def __boost_geometry__ Boost.Geometry] -[def __boost_gil__ [@http://www.boost.org/libs/gil/ Boost.GIL]] +[def __boost_geometry__ Boost.Geometry] +[def __boost_gil__ [@http://www.boost.org/libs/gil/ Boost.GIL]] [heading Contributions] diff --git a/doc/imports.qbk b/doc/imports.qbk index bab48d065..675dd4be2 100644 --- a/doc/imports.qbk +++ b/doc/imports.qbk @@ -82,4 +82,16 @@ [import src/examples/geometries/adapted/boost_fusion.cpp] [import src/examples/geometries/adapted/boost_polygon.cpp] [import src/examples/geometries/adapted/boost_tuple.cpp] + +[import src/examples/geometries/adapted/boost_range/filtered.cpp] +[import src/examples/geometries/adapted/boost_range/reversed.cpp] +[import src/examples/geometries/adapted/boost_range/sliced.cpp] +[import src/examples/geometries/adapted/boost_range/strided.cpp] +[import src/examples/geometries/adapted/boost_range/uniqued.cpp] + +[import src/examples/geometries/register/box.cpp] +[import src/examples/geometries/register/box_templated.cpp] +[import src/examples/geometries/register/box_2d_4values.cpp] [import src/examples/geometries/register/point.cpp] + + diff --git a/doc/quickref.xml b/doc/quickref.xml index 22d25f8a0..3c0a1cf00 100644 --- a/doc/quickref.xml +++ b/doc/quickref.xml @@ -101,24 +101,52 @@ - Adapted point types + 0-dimensional (adapted) Boost.Array Boost.Fusion - Boost.Polygon + Boost.Polygon's point_data Boost.Tuple C arrays - Registration macro's + 1-dimensional (adapted) - BOOST_GEOMETRY_REGISTER_POINT_2D - BOOST_GEOMETRY_REGISTER_POINT_2D_CONST - BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET - BOOST_GEOMETRY_REGISTER_POINT_3D - BOOST_GEOMETRY_REGISTER_POINT_3D_CONST - BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET + + + + 2-dimensional (adapted) + + Boost.Polygon's rectangle_data + Boost.Polygon's polygon_data + Boost.Polygon's polygon_with_holes_data + + + + + + 0-dimensional (macro's for adaption) + + BOOST_GEOMETRY_REGISTER_POINT_2D + BOOST_GEOMETRY_REGISTER_POINT_2D_CONST + BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET + BOOST_GEOMETRY_REGISTER_POINT_3D + BOOST_GEOMETRY_REGISTER_POINT_3D_CONST + BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET + + + + 1-dimensionial (macro's for adaption) + + + + + 2-dimensional (macro's for adaption) + + BOOST_GEOMETRY_REGISTER_BOX + BOOST_GEOMETRY_REGISTER_BOX_2D_4VALUES + BOOST_GEOMETRY_REGISTER_BOX_TEMPLATED diff --git a/doc/reference.qbk b/doc/reference.qbk index b2208ef82..335b78614 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -36,14 +36,28 @@ [endsect] [/access functions] -[section:adapted Adapted models and registration] +[section:adapted Adapted models] [include reference/geometries/adapted/c_array.qbk] [include reference/geometries/adapted/boost_array.qbk] [include reference/geometries/adapted/boost_fusion.qbk] -[include reference/geometries/adapted/boost_polygon.qbk] [include reference/geometries/adapted/boost_tuple.qbk] +[section:boost_polygon Boost.Polygon] +[include reference/geometries/adapted/boost_polygon/point_data.qbk] +[include reference/geometries/adapted/boost_polygon/rectangle_data.qbk] +[include reference/geometries/adapted/boost_polygon/polygon_data.qbk] +[include reference/geometries/adapted/boost_polygon/polygon_with_holes_data.qbk] +[endsect] +[section:boost_range Boost.Range] +[include reference/geometries/adapted/boost_range/filtered.qbk] +[include reference/geometries/adapted/boost_range/reversed.qbk] +[include reference/geometries/adapted/boost_range/sliced.qbk] +[include reference/geometries/adapted/boost_range/strided.qbk] +[/ include reference/geometries/adapted/boost_range/uniqued.qbk] +[endsect] +[section:register Macro's for adaption] [include generated/register.qbk] [endsect] +[endsect] [section:algorithms Algorithms] @@ -54,10 +68,8 @@ [section:assign assign] [include generated/assign.qbk] [endsect] -[/section:append append] -[include generated/append.qbk] -[/endsect] +[include generated/append.qbk] [section:buffer buffer] [include generated/buffer.qbk] diff --git a/doc/reference/geometries/adapted/boost_polygon.qbk b/doc/reference/geometries/adapted/boost_polygon/point_data.qbk similarity index 77% rename from doc/reference/geometries/adapted/boost_polygon.qbk rename to doc/reference/geometries/adapted/boost_polygon/point_data.qbk index bc32c00c9..7aea17d2a 100644 --- a/doc/reference/geometries/adapted/boost_polygon.qbk +++ b/doc/reference/geometries/adapted/boost_polygon/point_data.qbk @@ -10,10 +10,9 @@ http://www.boost.org/LICENSE_1_0.txt) =============================================================================/] -[section:boost_polygon Boost.Polygon] +[section:point_data Boost.Polygon's point_data] -The Boost.Polygon point type (point_data) is adapted to the Boost.Geometry Point Concept. -Boost.Polygon polygons are adapted to the Boost.Geometry Ring Concept and the Boost.Geometry Polygon Concept. +The Boost.Polygon point type (boost::polygon::point_data) is adapted to the Boost.Geometry Point Concept. [heading Description] @@ -27,7 +26,7 @@ algorithms from both Boost.Polygon and Boost.Geometry can be called. [heading Header] `#include ` -The standard header `` does not include this header. +__not_in_boost_geometry_hpp__ [heading Example] [boost_polygon] diff --git a/doc/reference/geometries/adapted/boost_polygon/polygon_data.qbk b/doc/reference/geometries/adapted/boost_polygon/polygon_data.qbk new file mode 100644 index 000000000..8254fdda8 --- /dev/null +++ b/doc/reference/geometries/adapted/boost_polygon/polygon_data.qbk @@ -0,0 +1,36 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +[section:polygon_data Boost.Polygon's polygon_data] + +Boost.Polygon's polygon type (boost::polygon::polygon_data) is adapted to the Boost.Geometry Ring Concept. + +[heading Description] + +Boost.Polygon's points (as well as polygons) can be used by Boost.Geometry. The +two libraries can therefore be used together. Using a boost::polygon::point_data<...>, +algorithms from both Boost.Polygon and Boost.Geometry can be called. + +[heading Model of] +[link geometry.reference.concepts.concept_ring Ring Concept] + +[heading Header] +`#include ` + +__not_in_boost_geometry_hpp__ + +[heading Example] +[boost_polygon] +[boost_polygon_output] + +[endsect] + diff --git a/doc/reference/geometries/adapted/boost_polygon/polygon_with_holes_data.qbk b/doc/reference/geometries/adapted/boost_polygon/polygon_with_holes_data.qbk new file mode 100644 index 000000000..00979a3d9 --- /dev/null +++ b/doc/reference/geometries/adapted/boost_polygon/polygon_with_holes_data.qbk @@ -0,0 +1,37 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +[section:polygon_with_holes_data Boost.Polygon's polygon_with_holes_data] + +Boost.Polygon's polygon type supporting holes (boost::polygon::polygon_with_holes_data) +is adapted to the Boost.Geometry Polygon Concept. + +[heading Description] + +Boost.Polygon's points (as well as polygons) can be used by Boost.Geometry. The +two libraries can therefore be used together. Using a boost::polygon::point_data<...>, +algorithms from both Boost.Polygon and Boost.Geometry can be called. + +[heading Model of] +[link geometry.reference.concepts.concept_polygon Polygon Concept] + +[heading Header] +`#include ` + +__not_in_boost_geometry_hpp__ + +[heading Example] +[boost_polygon] +[boost_polygon_output] + +[endsect] + diff --git a/doc/reference/geometries/adapted/boost_polygon/rectangle_data.qbk b/doc/reference/geometries/adapted/boost_polygon/rectangle_data.qbk new file mode 100644 index 000000000..a94db7808 --- /dev/null +++ b/doc/reference/geometries/adapted/boost_polygon/rectangle_data.qbk @@ -0,0 +1,36 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +[section:rectangle_data Boost.Polygon's rectangle_data] + +Boost.Polygon's rectangle type (boost::polygon::rectangle_data) is adapted to the Boost.Geometry Point Concept. + +[heading Description] + +Boost.Polygon's points (as well as polygons) can be used by Boost.Geometry. The +two libraries can therefore be used together. Using a boost::polygon::point_data<...>, +algorithms from both Boost.Polygon and Boost.Geometry can be called. + +[heading Model of] +[link geometry.reference.concepts.concept_box Box Concept] + +[heading Header] +`#include ` + +__not_in_boost_geometry_hpp__ + +[heading Example] +[boost_polygon] +[boost_polygon_output] + +[endsect] + diff --git a/doc/reference/geometries/adapted/boost_range/adapts_model.qbk b/doc/reference/geometries/adapted/boost_range/adapts_model.qbk new file mode 100644 index 000000000..f46803562 --- /dev/null +++ b/doc/reference/geometries/adapted/boost_range/adapts_model.qbk @@ -0,0 +1,19 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +The __adaptor__ takes over the model of the original geometry, which might be: + +* a linestring +* a ring +* a multi_point +* a multi_linestring +* a multi_polygon diff --git a/doc/reference/geometries/adapted/boost_range/filtered.qbk b/doc/reference/geometries/adapted/boost_range/filtered.qbk new file mode 100644 index 000000000..e0f88cedf --- /dev/null +++ b/doc/reference/geometries/adapted/boost_range/filtered.qbk @@ -0,0 +1,36 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +[section:filtered Boost.Range filtered] + +[def __adaptor__ Boost.Range filtered range adaptor] + +__adaptor__ is adapted to Boost.Geometry + +[heading Description] + +__adaptor__ filters a range. + +[heading Model of] +[include adapts_model.qbk] + +[heading Header] +`#include ` + +__not_in_boost_geometry_hpp__ + +[heading Example] +[boost_range_filtered] +[boost_range_filtered_output] + +[endsect] + diff --git a/doc/reference/geometries/adapted/boost_range/reversed.qbk b/doc/reference/geometries/adapted/boost_range/reversed.qbk new file mode 100644 index 000000000..b8b291466 --- /dev/null +++ b/doc/reference/geometries/adapted/boost_range/reversed.qbk @@ -0,0 +1,36 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +[section:reversed Boost.Range reversed] + +[def __adaptor__ Boost.Range reversed range adaptor] + +__adaptor__ is adapted to Boost.Geometry + +[heading Description] + +__adaptor__ reverses a range. + +[heading Model of] +[include adapts_model.qbk] + +[heading Header] +`#include ` + +__not_in_boost_geometry_hpp__ + +[heading Example] +[boost_range_reversed] +[boost_range_reversed_output] + +[endsect] + diff --git a/doc/reference/geometries/adapted/boost_range/sliced.qbk b/doc/reference/geometries/adapted/boost_range/sliced.qbk new file mode 100644 index 000000000..bf89f9cd4 --- /dev/null +++ b/doc/reference/geometries/adapted/boost_range/sliced.qbk @@ -0,0 +1,36 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +[section:sliced Boost.Range sliced] + +[def __adaptor__ Boost.Range sliced range adaptor] + +__adaptor__ is adapted to Boost.Geometry + +[heading Description] + +__adaptor__ creates a slice of a range (usually a linestring) + +[heading Model of] +[include adapts_model.qbk] + +[heading Header] +`#include ` + +__not_in_boost_geometry_hpp__ + +[heading Example] +[boost_range_sliced] +[boost_range_sliced_output] + +[endsect] + diff --git a/doc/reference/geometries/adapted/boost_range/strided.qbk b/doc/reference/geometries/adapted/boost_range/strided.qbk new file mode 100644 index 000000000..f67e0989d --- /dev/null +++ b/doc/reference/geometries/adapted/boost_range/strided.qbk @@ -0,0 +1,37 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +[section:strided Boost.Range strided] + +[def __adaptor__ Boost.Range strided range adaptor] + +__adaptor__ is adapted to Boost.Geometry + +[heading Description] + +__adaptor__ makes a strided range (usually begin a linestring or ring) such that +traversal is performed in steps of n. + +[heading Model of] +[include adapts_model.qbk] + +[heading Header] +`#include ` + +__not_in_boost_geometry_hpp__ + +[heading Example] +[boost_range_strided] +[boost_range_strided_output] + +[endsect] + diff --git a/doc/reference/geometries/adapted/boost_range/uniqued.qbk b/doc/reference/geometries/adapted/boost_range/uniqued.qbk new file mode 100644 index 000000000..ed809f7d4 --- /dev/null +++ b/doc/reference/geometries/adapted/boost_range/uniqued.qbk @@ -0,0 +1,36 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2008-2011 Bruno Lalande, Paris, France. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + + 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) +=============================================================================/] + +[section:uniqued Boost.Range uniqued] + +[def __adaptor__ Boost.Range uniqued range adaptor] + +__adaptor__ is adapted to Boost.Geometry + +[heading Description] + +__adaptor__ makes a range unique + +[heading Model of] +[include adapts_model.qbk] + +[heading Header] +`#include ` + +__not_in_boost_geometry_hpp__ + +[heading Example] +[boost_range_uniqued] +[boost_range_uniqued_output] + +[endsect] + diff --git a/doc/src/examples/algorithms/append.cpp b/doc/src/examples/algorithms/append.cpp index ce7ad84f3..f4392d645 100644 --- a/doc/src/examples/algorithms/append.cpp +++ b/doc/src/examples/algorithms/append.cpp @@ -12,11 +12,13 @@ #include +#include + #include #include -#include +#include -#include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) int main() { diff --git a/doc/src/examples/algorithms/assign.cpp b/doc/src/examples/algorithms/assign.cpp index 7309911ee..94482adb4 100644 --- a/doc/src/examples/algorithms/assign.cpp +++ b/doc/src/examples/algorithms/assign.cpp @@ -13,7 +13,9 @@ #include #include -#include +#include + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) int main() { diff --git a/doc/src/examples/algorithms/assign_points.cpp b/doc/src/examples/algorithms/assign_points.cpp index 30cdfd8cd..d43321da2 100644 --- a/doc/src/examples/algorithms/assign_points.cpp +++ b/doc/src/examples/algorithms/assign_points.cpp @@ -14,11 +14,13 @@ #include #include -#include +#include #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + template struct x_between { diff --git a/doc/src/examples/algorithms/clear.cpp b/doc/src/examples/algorithms/clear.cpp index abe4dbdb3..20f9deba1 100644 --- a/doc/src/examples/algorithms/clear.cpp +++ b/doc/src/examples/algorithms/clear.cpp @@ -14,7 +14,9 @@ #include #include -#include +#include + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) #include diff --git a/doc/src/examples/algorithms/convert.cpp b/doc/src/examples/algorithms/convert.cpp index 5b6e377e1..6baf27c5a 100644 --- a/doc/src/examples/algorithms/convert.cpp +++ b/doc/src/examples/algorithms/convert.cpp @@ -13,7 +13,9 @@ #include #include -#include +#include + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) int main() { diff --git a/doc/src/examples/algorithms/convex_hull.cpp b/doc/src/examples/algorithms/convex_hull.cpp index ed290e2f4..2f826e148 100644 --- a/doc/src/examples/algorithms/convex_hull.cpp +++ b/doc/src/examples/algorithms/convex_hull.cpp @@ -13,7 +13,9 @@ #include #include -#include +#include + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) /*<-*/ #include "create_svg_two.hpp" /*->*/ int main() diff --git a/doc/src/examples/algorithms/correct.cpp b/doc/src/examples/algorithms/correct.cpp index cacf6cf99..ec8753dd7 100644 --- a/doc/src/examples/algorithms/correct.cpp +++ b/doc/src/examples/algorithms/correct.cpp @@ -13,7 +13,9 @@ #include #include -#include +#include + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) #include diff --git a/doc/src/examples/algorithms/equals.cpp b/doc/src/examples/algorithms/equals.cpp index e6f982d9b..4b8df5f34 100644 --- a/doc/src/examples/algorithms/equals.cpp +++ b/doc/src/examples/algorithms/equals.cpp @@ -14,7 +14,9 @@ #include #include -#include +#include + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) #include diff --git a/doc/src/examples/algorithms/make_2d_point.cpp b/doc/src/examples/algorithms/make_2d_point.cpp index 1c374bf94..8c6189b3b 100644 --- a/doc/src/examples/algorithms/make_2d_point.cpp +++ b/doc/src/examples/algorithms/make_2d_point.cpp @@ -15,9 +15,11 @@ #include #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + struct mypoint { float _x, _y; }; BOOST_GEOMETRY_REGISTER_POINT_2D(mypoint, float, cs::cartesian, _x, _y) diff --git a/doc/src/examples/algorithms/reverse.cpp b/doc/src/examples/algorithms/reverse.cpp index 26eb35f68..f12c72281 100644 --- a/doc/src/examples/algorithms/reverse.cpp +++ b/doc/src/examples/algorithms/reverse.cpp @@ -14,7 +14,9 @@ #include #include -#include +#include + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) #include diff --git a/doc/src/examples/algorithms/unique.cpp b/doc/src/examples/algorithms/unique.cpp index d258361ef..1c3511272 100644 --- a/doc/src/examples/algorithms/unique.cpp +++ b/doc/src/examples/algorithms/unique.cpp @@ -13,7 +13,9 @@ #include #include -#include +#include + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) int main() { diff --git a/doc/src/examples/core/coordinate_dimension.cpp b/doc/src/examples/core/coordinate_dimension.cpp index 744d01910..47fda0163 100644 --- a/doc/src/examples/core/coordinate_dimension.cpp +++ b/doc/src/examples/core/coordinate_dimension.cpp @@ -12,14 +12,15 @@ #include #include -#include -#include +#include + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); int main() { int dim = boost::geometry::dimension < - std::vector + boost::geometry::model::linestring < boost::tuple > diff --git a/doc/src/examples/core/tag.cpp b/doc/src/examples/core/tag.cpp index a72e5f8ae..215e77f23 100644 --- a/doc/src/examples/core/tag.cpp +++ b/doc/src/examples/core/tag.cpp @@ -11,11 +11,14 @@ //` Shows how tag dispatching essentially works in Boost.Geometry #include -#include -#include #include +#include +#include + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) + template struct dispatch {}; // Specialization for points diff --git a/doc/src/examples/geometries/adapted/Jamfile.v2 b/doc/src/examples/geometries/adapted/Jamfile.v2 index 9c497e4e7..8a0013f1c 100644 --- a/doc/src/examples/geometries/adapted/Jamfile.v2 +++ b/doc/src/examples/geometries/adapted/Jamfile.v2 @@ -19,3 +19,4 @@ exe boost_fusion : boost_fusion.cpp ; exe boost_polygon : boost_polygon.cpp ; exe boost_tuple : boost_tuple.cpp ; +build-project boost_range ; diff --git a/doc/src/examples/geometries/adapted/boost_fusion.cpp b/doc/src/examples/geometries/adapted/boost_fusion.cpp index 3670487e6..f13c6bad6 100644 --- a/doc/src/examples/geometries/adapted/boost_fusion.cpp +++ b/doc/src/examples/geometries/adapted/boost_fusion.cpp @@ -11,10 +11,12 @@ //` Shows how to combine Boost.Fusion with Boost.Geometry #include + #include + #include -#include -#include +#include + struct sample_point { @@ -22,6 +24,7 @@ struct sample_point }; BOOST_FUSION_ADAPT_STRUCT(sample_point, (double, x) (double, y) (double, z)) +BOOST_GEOMETRY_REGISTER_BOOST_FUSION_CS(sample_point) int main() { diff --git a/doc/src/examples/geometries/adapted/boost_tuple.cpp b/doc/src/examples/geometries/adapted/boost_tuple.cpp index 8d9401ed6..ed9514693 100644 --- a/doc/src/examples/geometries/adapted/boost_tuple.cpp +++ b/doc/src/examples/geometries/adapted/boost_tuple.cpp @@ -18,7 +18,8 @@ various other examples as well. #include #include #include -#include + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); int main() { diff --git a/doc/src/examples/geometries/register/Jamfile.v2 b/doc/src/examples/geometries/register/Jamfile.v2 index b22d5f7a0..95f956a39 100644 --- a/doc/src/examples/geometries/register/Jamfile.v2 +++ b/doc/src/examples/geometries/register/Jamfile.v2 @@ -13,5 +13,6 @@ project boost-geometry-doc-src-example-geometries-register : # requirements ; +exe box : box.cpp ; +exe box_templated : box_templated.cpp ; exe point : point.cpp ; - diff --git a/doc/src/examples/geometries/register/box.cpp b/doc/src/examples/geometries/register/box.cpp new file mode 100644 index 000000000..55dc00551 --- /dev/null +++ b/doc/src/examples/geometries/register/box.cpp @@ -0,0 +1,51 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[register_box +//` Show the use of the macro BOOST_GEOMETRY_REGISTER_BOX + +#include +#include +#include +#include + +struct my_point +{ + double x, y; +}; + +struct my_box +{ + my_point ll, ur; +}; + +// Register the point type +BOOST_GEOMETRY_REGISTER_POINT_2D(my_point, double, cs::cartesian, x, y) + +// Register the box type, also notifying that it is based on "my_point" +BOOST_GEOMETRY_REGISTER_BOX(my_box, my_point, ll, ur) + +int main() +{ + my_box b = boost::geometry::make(0, 0, 2, 2); + std::cout << "Area: " << boost::geometry::area(b) << std::endl; + return 0; +} + +//] + + +//[register_box_output +/*` +Output: +[pre +Area: 4 +] +*/ +//] diff --git a/doc/src/examples/geometries/register/box_templated.cpp b/doc/src/examples/geometries/register/box_templated.cpp new file mode 100644 index 000000000..72e0a589f --- /dev/null +++ b/doc/src/examples/geometries/register/box_templated.cpp @@ -0,0 +1,44 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[register_box_templated +//` Show the use of the macro BOOST_GEOMETRY_REGISTER_BOX_TEMPLATED + +#include +#include +#include + +template +struct my_box +{ + P ll, ur; +}; + +// Register the box type +BOOST_GEOMETRY_REGISTER_BOX_TEMPLATED(my_box, ll, ur) + +int main() +{ + typedef my_box > box; + box b = boost::geometry::make(0, 0, 2, 2); + std::cout << "Area: " << boost::geometry::area(b) << std::endl; + return 0; +} + +//] + + +//[register_box_templated_output +/*` +Output: +[pre +Area: 4 +] +*/ +//] diff --git a/doc/src/examples/quick_start.cpp b/doc/src/examples/quick_start.cpp index 669235191..d495cc8d2 100644 --- a/doc/src/examples/quick_start.cpp +++ b/doc/src/examples/quick_start.cpp @@ -24,10 +24,11 @@ #include #include #include -#include #include #include +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + // Small QRect simulations following http://doc.trolltech.com/4.4/qrect.html // Todo: once work the traits out further, would be nice if there is a real example of this. diff --git a/example/c02_custom_box_example.cpp b/example/c02_custom_box_example.cpp index 5d6d74e6b..a335781d4 100644 --- a/example/c02_custom_box_example.cpp +++ b/example/c02_custom_box_example.cpp @@ -53,7 +53,7 @@ struct my_box_t BOOST_GEOMETRY_REGISTER_POINT_2D(my_point, double, cs::cartesian, x, y) BOOST_GEOMETRY_REGISTER_POINT_2D(my_int_point, int, cs::cartesian, x, y) BOOST_GEOMETRY_REGISTER_BOX(my_box, my_point, ll, ur) -BOOST_GEOMETRY_REGISTER_BOX_TEMPLATIZED(my_box_t, ll, ur) +BOOST_GEOMETRY_REGISTER_BOX_TEMPLATED(my_box_t, ll, ur) BOOST_GEOMETRY_REGISTER_BOX_2D_4VALUES(my_box_ltrb, my_int_point, left, top, right, bottom) BOOST_GEOMETRY_REGISTER_BOX_2D_4VALUES(my_box_4, my_point, coors[0], coors[1], coors[2], coors[3]) diff --git a/example/c04_b_custom_triangle_example.cpp b/example/c04_b_custom_triangle_example.cpp index af06b3068..6721593d4 100644 --- a/example/c04_b_custom_triangle_example.cpp +++ b/example/c04_b_custom_triangle_example.cpp @@ -30,9 +30,11 @@ struct triangle : public boost::array { }; -// Register triangle

-BOOST_GEOMETRY_REGISTER_RING_TEMPLATIZED(triangle) +// Register triangle

as a ring +namespace boost { namespace geometry { +template struct tag > { typedef ring_tag type; } +}} namespace boost { namespace geometry { namespace dispatch { diff --git a/test/test_geometries/custom_segment.hpp b/test/test_geometries/custom_segment.hpp index 413138a63..a0d43ed53 100644 --- a/test/test_geometries/custom_segment.hpp +++ b/test/test_geometries/custom_segment.hpp @@ -51,7 +51,7 @@ struct custom_segment_4 BOOST_GEOMETRY_REGISTER_POINT_2D(test::custom_point_for_segment, double, cs::cartesian, x, y) BOOST_GEOMETRY_REGISTER_SEGMENT(test::custom_segment, test::custom_point_for_segment, one, two) -BOOST_GEOMETRY_REGISTER_SEGMENT_TEMPLATIZED(test::custom_segment_of, p1, p2) +BOOST_GEOMETRY_REGISTER_SEGMENT_TEMPLATED(test::custom_segment_of, p1, p2) BOOST_GEOMETRY_REGISTER_SEGMENT_2D_4VALUES(test::custom_segment_4, test::custom_point_for_segment, a, b, c, d) From 3c2f5d980b6c5c55361f9d499d891b84e74434a6 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Mon, 25 Apr 2011 21:25:16 +0000 Subject: [PATCH 62/70] Added Boost.Range adaptors samples [SVN r71492] --- .../geometries/adapted/boost_range/Jamfile.v2 | 22 +++++++ .../adapted/boost_range/filtered.cpp | 61 ++++++++++++++++++ .../adapted/boost_range/reversed.cpp | 40 ++++++++++++ .../geometries/adapted/boost_range/sliced.cpp | 48 ++++++++++++++ .../adapted/boost_range/strided.cpp | 54 ++++++++++++++++ .../adapted/boost_range/uniqued.cpp | 62 +++++++++++++++++++ 6 files changed, 287 insertions(+) create mode 100644 doc/src/examples/geometries/adapted/boost_range/Jamfile.v2 create mode 100644 doc/src/examples/geometries/adapted/boost_range/filtered.cpp create mode 100644 doc/src/examples/geometries/adapted/boost_range/reversed.cpp create mode 100644 doc/src/examples/geometries/adapted/boost_range/sliced.cpp create mode 100644 doc/src/examples/geometries/adapted/boost_range/strided.cpp create mode 100644 doc/src/examples/geometries/adapted/boost_range/uniqued.cpp diff --git a/doc/src/examples/geometries/adapted/boost_range/Jamfile.v2 b/doc/src/examples/geometries/adapted/boost_range/Jamfile.v2 new file mode 100644 index 000000000..5dfaf8662 --- /dev/null +++ b/doc/src/examples/geometries/adapted/boost_range/Jamfile.v2 @@ -0,0 +1,22 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2011 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + +# 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) + + +project boost-geometry-doc-src-example-geometries-adapted-boost_range + : # requirements + ; + +exe filtered : filtered.cpp ; +exe reversed : reversed.cpp ; +exe sliced : sliced.cpp ; +exe strided : strided.cpp ; +# exe uniqued : uniqued.cpp ; + + diff --git a/doc/src/examples/geometries/adapted/boost_range/filtered.cpp b/doc/src/examples/geometries/adapted/boost_range/filtered.cpp new file mode 100644 index 000000000..e215594d0 --- /dev/null +++ b/doc/src/examples/geometries/adapted/boost_range/filtered.cpp @@ -0,0 +1,61 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[boost_range_filtered +//` Shows how to use a Boost.Geometry linestring, filtered by Boost.Range adaptor + +#include +#include +#include + +struct not_two +{ + template + bool operator()(P const& p) const + { + return boost::geometry::get<1>(p) != 2; + } +}; + + +int main() +{ + typedef boost::geometry::model::d2::point_xy xy; + boost::geometry::model::linestring line; + line.push_back(xy(0, 0)); + line.push_back(xy(1, 1)); + line.push_back(xy(2, 2)); + line.push_back(xy(3, 1)); + line.push_back(xy(4, 0)); + line.push_back(xy(5, 1)); + line.push_back(xy(6, 2)); + line.push_back(xy(7, 1)); + line.push_back(xy(8, 0)); + + using boost::adaptors::filtered; + std::cout + << boost::geometry::length(line) << std::endl + << boost::geometry::length(line | filtered(not_two())) << std::endl + << boost::geometry::dsv(line | filtered(not_two())) << std::endl; + + return 0; +} + +//] + +//[boost_range_filtered_output +/*` +Output: +[pre +11.3137 +9.65685 +((0, 0), (1, 1), (3, 1), (4, 0), (5, 1), (7, 1), (8, 0)) +] +*/ +//] diff --git a/doc/src/examples/geometries/adapted/boost_range/reversed.cpp b/doc/src/examples/geometries/adapted/boost_range/reversed.cpp new file mode 100644 index 000000000..5bdf5e2ce --- /dev/null +++ b/doc/src/examples/geometries/adapted/boost_range/reversed.cpp @@ -0,0 +1,40 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[boost_range_reversed +//` Shows how to use a Boost.Geometry linestring, reversed by Boost.Range adaptor + +#include +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy xy; + boost::geometry::model::linestring line; + line.push_back(xy(0, 0)); + line.push_back(xy(1, 1)); + + std::cout + << boost::geometry::dsv(line | boost::adaptors::reversed) + << std::endl; + + return 0; +} + +//] + +//[boost_range_reversed_output +/*` +Output: +[pre +((1, 1), (0, 0)) +] +*/ +//] diff --git a/doc/src/examples/geometries/adapted/boost_range/sliced.cpp b/doc/src/examples/geometries/adapted/boost_range/sliced.cpp new file mode 100644 index 000000000..eb65621f2 --- /dev/null +++ b/doc/src/examples/geometries/adapted/boost_range/sliced.cpp @@ -0,0 +1,48 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[boost_range_sliced +//` Shows how to use a Boost.Geometry linestring, sliced by Boost.Range adaptor + +#include + +#include + +#include +#include + + +int main() +{ + using namespace boost::assign; + + typedef boost::geometry::model::d2::point_xy xy; + boost::geometry::model::linestring line; + line += xy(0, 0); + line += xy(1, 1); + line += xy(2, 2); + line += xy(3, 3); + line += xy(4, 4); + + std::cout + << boost::geometry::dsv(line | boost::adaptors::sliced(1, 3)) << std::endl; + + return 0; +} + +//] + +//[boost_range_sliced_output +/*` +Output: +[pre +((1, 1), (2, 2)) +] +*/ +//] diff --git a/doc/src/examples/geometries/adapted/boost_range/strided.cpp b/doc/src/examples/geometries/adapted/boost_range/strided.cpp new file mode 100644 index 000000000..08ae880f6 --- /dev/null +++ b/doc/src/examples/geometries/adapted/boost_range/strided.cpp @@ -0,0 +1,54 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[boost_range_strided +//` Shows how to use a Boost.Geometry ring, strided by Boost.Range adaptor + +#include + +#include + +#include +#include + + +int main() +{ + using namespace boost::assign; + using boost::adaptors::strided; + + typedef boost::geometry::model::d2::point_xy xy; + boost::geometry::model::ring ring; + ring += xy(0, 0); + ring += xy(0, 1); + ring += xy(0, 2); + ring += xy(1, 2); + ring += xy(2, 2); + ring += xy(2, 0); + + boost::geometry::correct(ring); + + std::cout + << "Normal : " << boost::geometry::dsv(ring) << std::endl + << "Strided: " << boost::geometry::dsv(ring | strided(2)) << std::endl; + + return 0; +} + +//] + +//[boost_range_strided_output +/*` +Output: +[pre +Normal : ((0, 0), (0, 1), (0, 2), (1, 2), (2, 2), (2, 0), (0, 0)) +Strided: ((0, 0), (0, 2), (2, 2), (0, 0)) +] +*/ +//] diff --git a/doc/src/examples/geometries/adapted/boost_range/uniqued.cpp b/doc/src/examples/geometries/adapted/boost_range/uniqued.cpp new file mode 100644 index 000000000..1d75c6980 --- /dev/null +++ b/doc/src/examples/geometries/adapted/boost_range/uniqued.cpp @@ -0,0 +1,62 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[boost_range_uniqued +//` Shows how to use a Boost.Geometry ring, made unique by Boost.Range adaptor + +#include + +#include + +#include +#include + +typedef boost::geometry::model::d2::point_xy xy; + +inline bool operator==(xy const& left, xy const& right) +{ + boost::geometry::equal_to eq; + return eq(left, right); +} + + +int main() +{ + using namespace boost::assign; + using boost::adaptors::uniqued; + + boost::geometry::model::ring ring; + ring += xy(0, 0); + ring += xy(0, 1); + ring += xy(0, 2); + ring += xy(1, 2); + ring += xy(2, 2); + ring += xy(2, 2); + ring += xy(2, 2); + ring += xy(2, 0); + ring += xy(0, 0); + + std::cout + << "Normal: " << boost::geometry::dsv(ring) << std::endl + << "Unique: " << boost::geometry::dsv(ring | uniqued) << std::endl; + + return 0; +} + +//] + +//[boost_range_uniqued_output +/*` +Output: +[pre +Normal : ((0, 0), (0, 1), (0, 2), (1, 2), (2, 2), (2, 0), (0, 0)) +uniqued: ((0, 0), (0, 2), (2, 2), (0, 0)) +] +*/ +//] From 89e711e77976e0da498c3b9d5613b61464551206 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Mon, 25 Apr 2011 21:30:56 +0000 Subject: [PATCH 63/70] Fix renamed headerfile [SVN r71493] --- doc/src/examples/geometries/adapted/boost_tuple.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/src/examples/geometries/adapted/boost_tuple.cpp b/doc/src/examples/geometries/adapted/boost_tuple.cpp index ed9514693..67a51836d 100644 --- a/doc/src/examples/geometries/adapted/boost_tuple.cpp +++ b/doc/src/examples/geometries/adapted/boost_tuple.cpp @@ -15,11 +15,12 @@ Working with Boost.Tuples in Boost.Geometry is straightforward and shown in various other examples as well. */ + #include #include -#include +#include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) int main() { From 8f752a8d50030ef82965b7058d890f9846d7d02c Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Mon, 25 Apr 2011 22:06:17 +0000 Subject: [PATCH 64/70] Fixed not-yet-renamed macro name [SVN r71494] --- test/test_geometries/custom_segment.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_geometries/custom_segment.hpp b/test/test_geometries/custom_segment.hpp index a0d43ed53..413138a63 100644 --- a/test/test_geometries/custom_segment.hpp +++ b/test/test_geometries/custom_segment.hpp @@ -51,7 +51,7 @@ struct custom_segment_4 BOOST_GEOMETRY_REGISTER_POINT_2D(test::custom_point_for_segment, double, cs::cartesian, x, y) BOOST_GEOMETRY_REGISTER_SEGMENT(test::custom_segment, test::custom_point_for_segment, one, two) -BOOST_GEOMETRY_REGISTER_SEGMENT_TEMPLATED(test::custom_segment_of, p1, p2) +BOOST_GEOMETRY_REGISTER_SEGMENT_TEMPLATIZED(test::custom_segment_of, p1, p2) BOOST_GEOMETRY_REGISTER_SEGMENT_2D_4VALUES(test::custom_segment_4, test::custom_point_for_segment, a, b, c, d) From d92dbecb6a35aa259729877bc33f80dab68a55c4 Mon Sep 17 00:00:00 2001 From: Bruno Lalande Date: Thu, 28 Apr 2011 21:26:54 +0000 Subject: [PATCH 65/70] Aligned adapted C array and Boost Array to the recent changes. [SVN r71575] --- example/01_point_example.cpp | 8 ++-- example/02_linestring_example.cpp | 4 +- example/03_polygon_example.cpp | 5 ++- example/05_a_overlay_polygon_example.cpp | 4 +- ...5_b_overlay_linestring_polygon_example.cpp | 4 +- example/06_a_transformation_example.cpp | 7 ++- .../geometries/adapted/boost_array.hpp | 14 ++++-- .../adapted/boost_array_cartesian.hpp | 42 ----------------- .../adapted/boost_array_geographic.hpp | 40 ----------------- .../geometry/geometries/adapted/c_array.hpp | 14 ++++-- .../geometries/adapted/c_array_cartesian.hpp | 45 ------------------- .../geometries/adapted/c_array_geographic.hpp | 43 ------------------ test/algorithms/assign.cpp | 5 ++- test/algorithms/centroid.cpp | 5 ++- test/algorithms/convert.cpp | 5 ++- test/algorithms/distance.cpp | 5 ++- test/algorithms/envelope.cpp | 5 ++- test/algorithms/expand.cpp | 5 ++- test/algorithms/make.cpp | 5 ++- test/algorithms/overlay/get_turn_info.cpp | 3 +- test/arithmetic/arithmetic.cpp | 5 ++- test/arithmetic/dot_product.cpp | 5 ++- test/core/access.cpp | 5 ++- test/core/coordinate_dimension.cpp | 5 ++- test/core/coordinate_system.cpp | 5 ++- test/core/coordinate_type.cpp | 5 ++- test/core/geometry_id.cpp | 5 ++- test/core/point_type.cpp | 5 ++- test/core/tag.cpp | 5 ++- test/core/topological_dimension.cpp | 5 ++- test/geometries/adapted.cpp | 4 +- test/geometries/boost_array_as_point.cpp | 8 ++-- test/geometries/boost_fusion.cpp | 7 +-- test/geometries/box.cpp | 5 ++- test/geometries/custom_linestring.cpp | 3 +- test/geometries/segment.cpp | 5 ++- test/multi/algorithms/multi_distance.cpp | 5 ++- test/multi/algorithms/multi_envelope.cpp | 5 ++- test/point_concept/array_point.cpp | 5 ++- test/policies/compare.cpp | 5 ++- test/strategies/projected_point.cpp | 5 ++- test/strategies/pythagoras.cpp | 5 ++- test/strategies/transformer.cpp | 5 ++- test/util/for_each_coordinate.cpp | 5 ++- 44 files changed, 141 insertions(+), 249 deletions(-) delete mode 100644 include/boost/geometry/geometries/adapted/boost_array_cartesian.hpp delete mode 100644 include/boost/geometry/geometries/adapted/boost_array_geographic.hpp delete mode 100644 include/boost/geometry/geometries/adapted/c_array_cartesian.hpp delete mode 100644 include/boost/geometry/geometries/adapted/c_array_geographic.hpp diff --git a/example/01_point_example.cpp b/example/01_point_example.cpp index 80157016c..6d5e782b4 100644 --- a/example/01_point_example.cpp +++ b/example/01_point_example.cpp @@ -14,11 +14,13 @@ #include #include -#include -#include +#include +#include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) int main() diff --git a/example/02_linestring_example.cpp b/example/02_linestring_example.cpp index 329993529..8315d1761 100644 --- a/example/02_linestring_example.cpp +++ b/example/02_linestring_example.cpp @@ -18,9 +18,9 @@ #include // Optional includes to handle c-arrays as points, std::vectors as linestrings -#include +#include #include - +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) template diff --git a/example/03_polygon_example.cpp b/example/03_polygon_example.cpp index 780221a93..e817fa261 100644 --- a/example/03_polygon_example.cpp +++ b/example/03_polygon_example.cpp @@ -15,10 +15,13 @@ #include #include -#include +#include #include #include +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) + + std::string boolstr(bool v) { return v ? "true" : "false"; diff --git a/example/05_a_overlay_polygon_example.cpp b/example/05_a_overlay_polygon_example.cpp index 625b0f497..6a81221b1 100644 --- a/example/05_a_overlay_polygon_example.cpp +++ b/example/05_a_overlay_polygon_example.cpp @@ -19,12 +19,14 @@ #include -#include +#include #if defined(HAVE_SVG) # include #endif +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) + int main(void) { diff --git a/example/05_b_overlay_linestring_polygon_example.cpp b/example/05_b_overlay_linestring_polygon_example.cpp index 8e0dc7483..118026603 100644 --- a/example/05_b_overlay_linestring_polygon_example.cpp +++ b/example/05_b_overlay_linestring_polygon_example.cpp @@ -19,12 +19,14 @@ #include -#include +#include #if defined(HAVE_SVG) # include #endif +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian); + int main(void) { diff --git a/example/06_a_transformation_example.cpp b/example/06_a_transformation_example.cpp index ef7d279d3..3c5f6f9b0 100644 --- a/example/06_a_transformation_example.cpp +++ b/example/06_a_transformation_example.cpp @@ -13,9 +13,12 @@ #include #include -#include +#include #include +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) + + int main() { using namespace boost::geometry; @@ -34,7 +37,7 @@ int main() model::polygon poly, poly2; const double coor[][2] = { {0, 0}, {0, 7}, {2, 2}, {2, 0}, {0, 0} }; // note that for this syntax you have to include the two - // include files above (c_array_cartesian.hpp, std_as_linestring.hpp) + // include files above (c_array.hpp, std_as_linestring.hpp) assign_points(poly, coor); //read_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly); transform(poly, poly2, translate); diff --git a/include/boost/geometry/geometries/adapted/boost_array.hpp b/include/boost/geometry/geometries/adapted/boost_array.hpp index db5efb244..bd2b88df2 100644 --- a/include/boost/geometry/geometries/adapted/boost_array.hpp +++ b/include/boost/geometry/geometries/adapted/boost_array.hpp @@ -98,9 +98,6 @@ struct access, Dimension> } }; -// The library user has -// 1) either to specify the coordinate system -// 2) or include where @=cartesian,geographic,... } // namespace traits #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS @@ -108,5 +105,16 @@ struct access, Dimension> }} // namespace boost::geometry + +#define BOOST_GEOMETRY_REGISTER_BOOST_ARRAY_CS(CoordinateSystem) \ + namespace boost { namespace geometry { namespace traits { \ + template \ + struct coordinate_system > \ + { \ + typedef CoordinateSystem type; \ + }; \ + }}} + + #endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ARRAY_HPP diff --git a/include/boost/geometry/geometries/adapted/boost_array_cartesian.hpp b/include/boost/geometry/geometries/adapted/boost_array_cartesian.hpp deleted file mode 100644 index a11c9e2bb..000000000 --- a/include/boost/geometry/geometries/adapted/boost_array_cartesian.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) - -// Copyright (c) 2010 Alfredo Correa -// Copyright (c) 2010-2011 Barend Gehrels, 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_GEOMETRIES_ADAPTED_BOOST_ARRAY_CARTESIAN_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ARRAY_CARTESIAN_HPP - -#ifdef BOOST_GEOMETRY_ADAPTED_BOOST_ARRAY_COORDINATE_SYSTEM_DEFINED -#error Include only one headerfile to register coordinate coordinate_system for adapted boost array -#endif - -#define BOOST_GEOMETRY_ADAPTED_BOOST_ARRAY_COORDINATE_SYSTEM_DEFINED - - -#include - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - template - struct coordinate_system > - { typedef cs::cartesian type; }; - -} -#endif - - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ARRAY_CARTESIAN_HPP - diff --git a/include/boost/geometry/geometries/adapted/boost_array_geographic.hpp b/include/boost/geometry/geometries/adapted/boost_array_geographic.hpp deleted file mode 100644 index ca103520e..000000000 --- a/include/boost/geometry/geometries/adapted/boost_array_geographic.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) - -// Copyright (c) 2010 Alfredo Correa -// Copyright (c) 2010-2011 Barend Gehrels, 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_GEOMETRIES_ADAPTED_BOOST_ARRAY_GEOGRAPHIC_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ARRAY_GEOGRAPHIC_HPP - -#ifdef BOOST_GEOMETRY_ADAPTED_BOOST_ARRAY_COORDINATE_SYSTEM_DEFINED -#error Include only one headerfile to register coordinate coordinate_system for adapted boost array -#endif - -#define BOOST_GEOMETRY_ADAPTED_BOOST_ARRAY_COORDINATE_SYSTEM_DEFINED - - -#include - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - template - struct coordinate_system > - { typedef cs::geographic type; }; - -} -#endif - - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ARRAY_GEOGRAPHIC_HPP diff --git a/include/boost/geometry/geometries/adapted/c_array.hpp b/include/boost/geometry/geometries/adapted/c_array.hpp index 0e2209b43..ebbfbd469 100644 --- a/include/boost/geometry/geometries/adapted/c_array.hpp +++ b/include/boost/geometry/geometries/adapted/c_array.hpp @@ -90,9 +90,6 @@ struct access } }; -// The library user has -// 1) either to specify the coordinate system -// 2) or include where @=cartesian,geographic,... } // namespace traits #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS @@ -100,4 +97,15 @@ struct access }} // namespace boost::geometry + +#define BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(CoordinateSystem) \ + namespace boost { namespace geometry { namespace traits { \ + template \ + struct coordinate_system \ + { \ + typedef CoordinateSystem type; \ + }; \ + }}} + + #endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_HPP diff --git a/include/boost/geometry/geometries/adapted/c_array_cartesian.hpp b/include/boost/geometry/geometries/adapted/c_array_cartesian.hpp deleted file mode 100644 index dc1efcaca..000000000 --- a/include/boost/geometry/geometries/adapted/c_array_cartesian.hpp +++ /dev/null @@ -1,45 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) - -// Copyright (c) 2008-2011 Bruno Lalande, Paris, France. -// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2009-2011 Mateusz Loskot, London, UK. - -// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library -// (geolib/GGL), copyright (c) 1995-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_GEOMETRIES_ADAPTED_C_ARRAY_CARTESIAN_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_CARTESIAN_HPP - -#ifdef BOOST_GEOMETRY_ADAPTED_C_ARRAY_COORDINATE_SYSTEM_DEFINED -#error Include only one headerfile to register coordinate coordinate_system for adapted c array -#endif - -#define BOOST_GEOMETRY_ADAPTED_C_ARRAY_COORDINATE_SYSTEM_DEFINED - - -#include - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - template - struct coordinate_system - { typedef cs::cartesian type; }; - -} -#endif - - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_CARTESIAN_HPP diff --git a/include/boost/geometry/geometries/adapted/c_array_geographic.hpp b/include/boost/geometry/geometries/adapted/c_array_geographic.hpp deleted file mode 100644 index f9003acf3..000000000 --- a/include/boost/geometry/geometries/adapted/c_array_geographic.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) - -// Copyright (c) 2008-2011 Bruno Lalande, Paris, France. -// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2009-2011 Mateusz Loskot, London, UK. - -// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library -// (geolib/GGL), copyright (c) 1995-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_GEOMETRIES_ADAPTED_C_ARRAY_GEOGRAPHIC_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_GEOGRAPHIC_HPP - -#ifdef BOOST_GEOMETRY_ADAPTED_C_ARRAY_COORDINATE_SYSTEM_DEFINED -#error Include only one headerfile to register coordinate coordinate_system for adapted c array -#endif - -#define BOOST_GEOMETRY_ADAPTED_C_ARRAY_COORDINATE_SYSTEM_DEFINED - -#include - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - template - struct coordinate_system - { typedef cs::geographic type; }; - -} -#endif - - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_GEOGRAPHIC_HPP diff --git a/test/algorithms/assign.cpp b/test/algorithms/assign.cpp index 1db48ea38..ad3bef97b 100644 --- a/test/algorithms/assign.cpp +++ b/test/algorithms/assign.cpp @@ -19,11 +19,12 @@ #include #include -#include +#include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/algorithms/centroid.cpp b/test/algorithms/centroid.cpp index 41c55711f..fab082b06 100644 --- a/test/algorithms/centroid.cpp +++ b/test/algorithms/centroid.cpp @@ -15,12 +15,13 @@ #include #include -#include +#include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/algorithms/convert.cpp b/test/algorithms/convert.cpp index 8af86681b..039922b3b 100644 --- a/test/algorithms/convert.cpp +++ b/test/algorithms/convert.cpp @@ -21,11 +21,12 @@ #include #include -#include +#include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/algorithms/distance.cpp b/test/algorithms/distance.cpp index 1fe6c436a..bce602e41 100644 --- a/test/algorithms/distance.cpp +++ b/test/algorithms/distance.cpp @@ -22,14 +22,15 @@ #include #include -#include +#include #include #include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/algorithms/envelope.cpp b/test/algorithms/envelope.cpp index 5eaa6c42b..3896b34b3 100644 --- a/test/algorithms/envelope.cpp +++ b/test/algorithms/envelope.cpp @@ -16,12 +16,13 @@ #include #include -#include +#include #include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/algorithms/expand.cpp b/test/algorithms/expand.cpp index 0b8dafa3a..5e1147ff2 100644 --- a/test/algorithms/expand.cpp +++ b/test/algorithms/expand.cpp @@ -18,12 +18,13 @@ #include #include -#include +#include #include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/algorithms/make.cpp b/test/algorithms/make.cpp index 21587d26b..6acee35b1 100644 --- a/test/algorithms/make.cpp +++ b/test/algorithms/make.cpp @@ -20,11 +20,12 @@ #include #include -#include +#include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/algorithms/overlay/get_turn_info.cpp b/test/algorithms/overlay/get_turn_info.cpp index 62f68c748..757bbcc0b 100644 --- a/test/algorithms/overlay/get_turn_info.cpp +++ b/test/algorithms/overlay/get_turn_info.cpp @@ -818,7 +818,8 @@ void test_all() /*** #include #include -#include +#include +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) template void test2(G const& geometry) diff --git a/test/arithmetic/arithmetic.cpp b/test/arithmetic/arithmetic.cpp index 1c5736424..e513804e9 100644 --- a/test/arithmetic/arithmetic.cpp +++ b/test/arithmetic/arithmetic.cpp @@ -21,11 +21,12 @@ #include #include -#include +#include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/arithmetic/dot_product.cpp b/test/arithmetic/dot_product.cpp index da639ff43..d2bff94bc 100644 --- a/test/arithmetic/dot_product.cpp +++ b/test/arithmetic/dot_product.cpp @@ -21,11 +21,12 @@ #include #include -#include +#include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/core/access.cpp b/test/core/access.cpp index 880e29681..bac9d7fba 100644 --- a/test/core/access.cpp +++ b/test/core/access.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include @@ -31,7 +31,8 @@ #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/core/coordinate_dimension.cpp b/test/core/coordinate_dimension.cpp index d76fd8159..70e819ccf 100644 --- a/test/core/coordinate_dimension.cpp +++ b/test/core/coordinate_dimension.cpp @@ -16,7 +16,7 @@ #include -#include +#include #include #include @@ -25,7 +25,8 @@ #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/core/coordinate_system.cpp b/test/core/coordinate_system.cpp index cfa66f8cf..fd2afd490 100644 --- a/test/core/coordinate_system.cpp +++ b/test/core/coordinate_system.cpp @@ -16,7 +16,7 @@ #include -#include +#include #include #include @@ -25,7 +25,8 @@ #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/core/coordinate_type.cpp b/test/core/coordinate_type.cpp index 81c14a5be..aa9fb752a 100644 --- a/test/core/coordinate_type.cpp +++ b/test/core/coordinate_type.cpp @@ -16,7 +16,7 @@ #include -#include +#include #include #include @@ -25,7 +25,8 @@ #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/core/geometry_id.cpp b/test/core/geometry_id.cpp index 9cdf9a397..bfb65d967 100644 --- a/test/core/geometry_id.cpp +++ b/test/core/geometry_id.cpp @@ -15,7 +15,7 @@ #include -#include +#include #include #include @@ -24,7 +24,8 @@ #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/core/point_type.cpp b/test/core/point_type.cpp index 96e7ce9b4..1a4dd9855 100644 --- a/test/core/point_type.cpp +++ b/test/core/point_type.cpp @@ -15,7 +15,7 @@ #include -#include +#include #include #include @@ -24,7 +24,8 @@ #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/core/tag.cpp b/test/core/tag.cpp index ea2b3bbe9..1a6759238 100644 --- a/test/core/tag.cpp +++ b/test/core/tag.cpp @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -23,7 +23,8 @@ #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/core/topological_dimension.cpp b/test/core/topological_dimension.cpp index 4fb36705c..53b0ac4e8 100644 --- a/test/core/topological_dimension.cpp +++ b/test/core/topological_dimension.cpp @@ -14,7 +14,7 @@ #include -#include +#include #include #include @@ -23,7 +23,8 @@ #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/geometries/adapted.cpp b/test/geometries/adapted.cpp index 973257ee9..c5392cce6 100644 --- a/test/geometries/adapted.cpp +++ b/test/geometries/adapted.cpp @@ -45,12 +45,12 @@ #endif -#include +#include #include #include - +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) diff --git a/test/geometries/boost_array_as_point.cpp b/test/geometries/boost_array_as_point.cpp index ac2eb0840..7b451b34d 100644 --- a/test/geometries/boost_array_as_point.cpp +++ b/test/geometries/boost_array_as_point.cpp @@ -12,12 +12,14 @@ #include -#include -#include +#include +#include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) int test_main(int, char* []) diff --git a/test/geometries/boost_fusion.cpp b/test/geometries/boost_fusion.cpp index 1188fdd2b..47c64778a 100644 --- a/test/geometries/boost_fusion.cpp +++ b/test/geometries/boost_fusion.cpp @@ -14,12 +14,13 @@ #include #include -#include +#include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_FUSION_CS(cs::cartesian); -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_FUSION_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) struct for_fusion_2d diff --git a/test/geometries/box.cpp b/test/geometries/box.cpp index f640592b2..a7c06eecc 100644 --- a/test/geometries/box.cpp +++ b/test/geometries/box.cpp @@ -20,11 +20,12 @@ #include #include -#include +#include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/geometries/custom_linestring.cpp b/test/geometries/custom_linestring.cpp index 2bdf70c77..fbd4ab072 100644 --- a/test/geometries/custom_linestring.cpp +++ b/test/geometries/custom_linestring.cpp @@ -27,10 +27,11 @@ #include #include #include -#include +#include #include #include +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) //#define TEST_FAIL_CLEAR diff --git a/test/geometries/segment.cpp b/test/geometries/segment.cpp index 0b2ff245f..f9035fa7f 100644 --- a/test/geometries/segment.cpp +++ b/test/geometries/segment.cpp @@ -22,7 +22,7 @@ #include -#include +#include #include #include @@ -31,7 +31,8 @@ #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/multi/algorithms/multi_distance.cpp b/test/multi/algorithms/multi_distance.cpp index 51edb8dcc..702f0347f 100644 --- a/test/multi/algorithms/multi_distance.cpp +++ b/test/multi/algorithms/multi_distance.cpp @@ -23,11 +23,12 @@ #include #include -#include +#include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/multi/algorithms/multi_envelope.cpp b/test/multi/algorithms/multi_envelope.cpp index 2ebec5fed..c84ea9e82 100644 --- a/test/multi/algorithms/multi_envelope.cpp +++ b/test/multi/algorithms/multi_envelope.cpp @@ -24,11 +24,12 @@ #include #include -#include +#include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/point_concept/array_point.cpp b/test/point_concept/array_point.cpp index 61ae34a9c..ea8b1ebbf 100644 --- a/test/point_concept/array_point.cpp +++ b/test/point_concept/array_point.cpp @@ -14,9 +14,12 @@ #include -#include +#include #include "function_requiring_a_point.hpp" +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) + + int main() { float p1[3] = { 0, 0, 0 }; diff --git a/test/policies/compare.cpp b/test/policies/compare.cpp index 57ed8ab41..331ec8209 100644 --- a/test/policies/compare.cpp +++ b/test/policies/compare.cpp @@ -19,12 +19,13 @@ #include #include -#include +#include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/strategies/projected_point.cpp b/test/strategies/projected_point.cpp index bfbe5f6e1..187f3d77b 100644 --- a/test/strategies/projected_point.cpp +++ b/test/strategies/projected_point.cpp @@ -22,7 +22,7 @@ #include -#include +#include #include #include @@ -30,7 +30,8 @@ # include #endif -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/strategies/pythagoras.cpp b/test/strategies/pythagoras.cpp index b3d39c363..015370e1b 100644 --- a/test/strategies/pythagoras.cpp +++ b/test/strategies/pythagoras.cpp @@ -30,7 +30,7 @@ #include -#include +#include #include #include @@ -39,7 +39,8 @@ # include #endif -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/strategies/transformer.cpp b/test/strategies/transformer.cpp index 7efec562c..e3116f87a 100644 --- a/test/strategies/transformer.cpp +++ b/test/strategies/transformer.cpp @@ -24,10 +24,11 @@ #include #include -#include +#include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template diff --git a/test/util/for_each_coordinate.cpp b/test/util/for_each_coordinate.cpp index 07c85736f..0b183a209 100644 --- a/test/util/for_each_coordinate.cpp +++ b/test/util/for_each_coordinate.cpp @@ -23,11 +23,12 @@ #include -#include +#include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) struct test_operation From d667803da41d0818c9b824c1676fd612e8afbb4a Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 30 Apr 2011 14:58:29 +0000 Subject: [PATCH 66/70] Fixed for removal of registration macro [SVN r71625] --- example/c03_custom_linestring_example.cpp | 5 +++-- example/c04_a_custom_triangle_example.cpp | 6 ++++-- example/c04_b_custom_triangle_example.cpp | 12 ++++++------ example/c06_custom_polygon_example.cpp | 7 +++++-- example/c08_custom_non_std_example.cpp | 6 ++++-- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/example/c03_custom_linestring_example.cpp b/example/c03_custom_linestring_example.cpp index 118bbaced..e0722c4a5 100644 --- a/example/c03_custom_linestring_example.cpp +++ b/example/c03_custom_linestring_example.cpp @@ -16,7 +16,6 @@ #include #include -#include // To register the 'geographic' distance function to calculate distance over the earth: #include @@ -61,7 +60,9 @@ BOOST_GEOMETRY_REGISTER_POINT_2D(gps_point, double, cs::geographic, long // Register the track as well, as being a "linestring" -BOOST_GEOMETRY_REGISTER_LINESTRING(gps_track) +namespace boost { namespace geometry { namespace traits { +template <> struct tag { typedef ring_tag type; }; +}}} int main() diff --git a/example/c04_a_custom_triangle_example.cpp b/example/c04_a_custom_triangle_example.cpp index a8084a98c..8c4b7d6d8 100644 --- a/example/c04_a_custom_triangle_example.cpp +++ b/example/c04_a_custom_triangle_example.cpp @@ -16,7 +16,6 @@ #include #include -#include #include #include @@ -30,7 +29,10 @@ struct triangle : public boost::array struct tag { typedef ring_tag type; }; +}}} // Specializations of algorithms, where useful. If not specialized the default ones diff --git a/example/c04_b_custom_triangle_example.cpp b/example/c04_b_custom_triangle_example.cpp index 6721593d4..1e41c5f9b 100644 --- a/example/c04_b_custom_triangle_example.cpp +++ b/example/c04_b_custom_triangle_example.cpp @@ -18,11 +18,10 @@ #include #include #include -#include #include #include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template @@ -30,11 +29,12 @@ struct triangle : public boost::array { }; -// Register triangle

as a ring -namespace boost { namespace geometry { -template struct tag > { typedef ring_tag type; } -}} +// Register triangle

as a ring +namespace boost { namespace geometry { namespace traits { +template struct tag > { typedef ring_tag type; }; +}}} + namespace boost { namespace geometry { namespace dispatch { diff --git a/example/c06_custom_polygon_example.cpp b/example/c06_custom_polygon_example.cpp index 6067a7358..da4a978de 100644 --- a/example/c06_custom_polygon_example.cpp +++ b/example/c06_custom_polygon_example.cpp @@ -14,7 +14,6 @@ #include #include -#include struct my_point @@ -49,7 +48,11 @@ struct my_polygon // We can conveniently use macro's to register point and ring BOOST_GEOMETRY_REGISTER_POINT_2D(my_point, double, cs::cartesian, x, y) -BOOST_GEOMETRY_REGISTER_RING(my_ring) + +// Register my_ring as a ring +namespace boost { namespace geometry { namespace traits { +template <> struct tag { typedef ring_tag type; }; +}}} diff --git a/example/c08_custom_non_std_example.cpp b/example/c08_custom_non_std_example.cpp index 2a8460ecf..874917d8e 100644 --- a/example/c08_custom_non_std_example.cpp +++ b/example/c08_custom_non_std_example.cpp @@ -20,7 +20,6 @@ #include #include -#include #include // Sample point, having x/y @@ -215,7 +214,10 @@ template<> struct resize // 4) register with Boost.Geometry BOOST_GEOMETRY_REGISTER_POINT_2D(my_point, double, cs::cartesian, x, y) -BOOST_GEOMETRY_REGISTER_RING(my_polygon) + +namespace boost { namespace geometry { namespace traits { +template <> struct tag { typedef ring_tag type; }; +}}} // end adaption From d5e1b4f7a28fd1b88e7c26142c40f6874a701200 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 30 Apr 2011 15:13:49 +0000 Subject: [PATCH 67/70] Fixed for changing c/boost array registration [SVN r71626] --- doc/src/examples/algorithms/make_with_range.cpp | 9 +++++---- doc/src/examples/core/interior_type.cpp | 4 +++- doc/src/examples/geometries/adapted/boost_array.cpp | 4 +++- doc/src/examples/geometries/adapted/c_array.cpp | 4 +++- doc/src/examples/quick_start.cpp | 11 ++++++----- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/doc/src/examples/algorithms/make_with_range.cpp b/doc/src/examples/algorithms/make_with_range.cpp index 26d55c633..faf97f707 100644 --- a/doc/src/examples/algorithms/make_with_range.cpp +++ b/doc/src/examples/algorithms/make_with_range.cpp @@ -13,23 +13,24 @@ #include #include -#include -#include /*< Necessary to register a C array like {1,2} as a point >*/ +#include +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) /*< Necessary to register a C array like {1,2} as a point >*/ int main() { using boost::geometry::make; + using boost::geometry::detail::make::make_points; typedef boost::geometry::model::d2::point_xy point; typedef boost::geometry::model::linestring linestring; double coordinates[][2] = {{1,2}, {3,4}, {5, 6}}; /*< Initialize with C array points >*/ - linestring ls = make(coordinates); + linestring ls = make_points(coordinates); std::cout << boost::geometry::dsv(ls) << std::endl; point points[3] = { make(9,8), make(7,6), make(5,4) }; /*< Construct array with points, using make which should work for any point type >*/ - std::cout << boost::geometry::dsv(make(points)) << std::endl; /*< Construct linestring with point-array and output it as Delimiter Separated Values >*/ + std::cout << boost::geometry::dsv(make_points(points)) << std::endl; /*< Construct linestring with point-array and output it as Delimiter Separated Values >*/ return 0; } diff --git a/doc/src/examples/core/interior_type.cpp b/doc/src/examples/core/interior_type.cpp index f30bc6c08..79b22a914 100644 --- a/doc/src/examples/core/interior_type.cpp +++ b/doc/src/examples/core/interior_type.cpp @@ -13,7 +13,9 @@ #include #include #include -#include +#include + +BOOST_GEOMETRY_REGISTER_BOOST_ARRAY_CS(cs::cartesian) int main() { diff --git a/doc/src/examples/geometries/adapted/boost_array.cpp b/doc/src/examples/geometries/adapted/boost_array.cpp index e25e9d510..99aa8a3d7 100644 --- a/doc/src/examples/geometries/adapted/boost_array.cpp +++ b/doc/src/examples/geometries/adapted/boost_array.cpp @@ -12,7 +12,9 @@ #include #include -#include +#include + +BOOST_GEOMETRY_REGISTER_BOOST_ARRAY_CS(cs::cartesian) int main() { diff --git a/doc/src/examples/geometries/adapted/c_array.cpp b/doc/src/examples/geometries/adapted/c_array.cpp index e17f89d73..ef0956b0a 100644 --- a/doc/src/examples/geometries/adapted/c_array.cpp +++ b/doc/src/examples/geometries/adapted/c_array.cpp @@ -12,7 +12,9 @@ #include #include -#include +#include + +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) int main() { diff --git a/doc/src/examples/quick_start.cpp b/doc/src/examples/quick_start.cpp index d495cc8d2..8b2beb4d2 100644 --- a/doc/src/examples/quick_start.cpp +++ b/doc/src/examples/quick_start.cpp @@ -24,10 +24,11 @@ #include #include #include -#include -#include +#include -BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); + +BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) // Small QRect simulations following http://doc.trolltech.com/4.4/qrect.html @@ -130,7 +131,7 @@ void example_for_main_page() QRect r2(110, 210, 20, 20); if (overlaps(r1, r2)) { - assign(r2, 200, 300, 220, 320); + assign_values(r2, 200, 300, 220, 320); } //] } @@ -145,7 +146,7 @@ void example_for_transform() XYZ p; SPH sph1, sph2; - assign(sph1, 12.5, 41.90, 1.0); + assign_values(sph1, 12.5, 41.90, 1.0); // Go from spherical to Cartesian-3D: transform(sph1, p); // Go back from Cartesian 3D to spherical: From 6cb19c253cf9468cd10afb1b84bdc34a32e60a15 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 30 Apr 2011 16:29:21 +0000 Subject: [PATCH 68/70] Fixed box_iterator behaviour to support Boost.Range concept checking [SVN r71628] --- .../gis/io/shapelib/shp_read_object.hpp | 2 -- .../boost/geometry/iterators/box_iterator.hpp | 17 ++++++++++++++++- .../iterators/segment_range_iterator.hpp | 19 +++++++++---------- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/include/boost/geometry/extensions/gis/io/shapelib/shp_read_object.hpp b/include/boost/geometry/extensions/gis/io/shapelib/shp_read_object.hpp index beb5024da..12824f756 100644 --- a/include/boost/geometry/extensions/gis/io/shapelib/shp_read_object.hpp +++ b/include/boost/geometry/extensions/gis/io/shapelib/shp_read_object.hpp @@ -18,8 +18,6 @@ #include #include #include -#include -#include // Should be somewhere in your include path diff --git a/include/boost/geometry/iterators/box_iterator.hpp b/include/boost/geometry/iterators/box_iterator.hpp index 735e90db3..ce1241dcf 100644 --- a/include/boost/geometry/iterators/box_iterator.hpp +++ b/include/boost/geometry/iterators/box_iterator.hpp @@ -41,6 +41,13 @@ struct box_iterator boost::random_access_traversal_tag > { + // Default constructor is required to check concept of Range + inline box_iterator() + : m_index(-1) + , m_box_address(NULL) + { + } + explicit inline box_iterator(Box const& box) : m_index(0) , m_box_address(&box) @@ -56,6 +63,14 @@ struct box_iterator init(box); } + // Operator= is required to check concept of Range + inline box_iterator& operator=(box_iterator const& source) + { + m_index = source.m_index; + m_box_address = source.m_box_address; + return *this; + } + typedef std::ptrdiff_t difference_type; private: @@ -101,7 +116,7 @@ private: // Copy points here - box might define them otherwise point_type m_points[4]; int m_index; - Box const* const m_box_address; + Box const* m_box_address; }; diff --git a/include/boost/geometry/iterators/segment_range_iterator.hpp b/include/boost/geometry/iterators/segment_range_iterator.hpp index 55c1f5046..cedb9310d 100644 --- a/include/boost/geometry/iterators/segment_range_iterator.hpp +++ b/include/boost/geometry/iterators/segment_range_iterator.hpp @@ -51,15 +51,6 @@ struct segment_range_iterator { } - // Operator= is required to check concept of Range - inline segment_range_iterator& operator=(segment_range_iterator const& source) - { - m_index = source.m_index; - m_segment_address = source.m_segment_address; - return *this; - } - - explicit inline segment_range_iterator(Segment const& segment) : m_index(0) , m_segment_address(&segment) @@ -74,7 +65,15 @@ struct segment_range_iterator { init(segment); } - + + // Operator= is required to check concept of Range + inline segment_range_iterator& operator=(segment_range_iterator const& source) + { + m_index = source.m_index; + m_segment_address = source.m_segment_address; + return *this; + } + typedef std::ptrdiff_t difference_type; private: From d68474fd1a1d026f0c37c60d82b72187376a755b Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 30 Apr 2011 16:30:35 +0000 Subject: [PATCH 69/70] Unit tests now check Boost.Range concept checking [SVN r71629] --- test/ranges/box_range.cpp | 3 +++ test/ranges/segment_range.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/test/ranges/box_range.cpp b/test/ranges/box_range.cpp index 0deb4f266..6acfccda8 100644 --- a/test/ranges/box_range.cpp +++ b/test/ranges/box_range.cpp @@ -54,6 +54,9 @@ void test_geometry(std::string const& wkt, std::string const& expected) int const n = boost::size(range); BOOST_CHECK_EQUAL(n, 5); } + + // Check Boost.Range concept + BOOST_CONCEPT_ASSERT( (boost::ForwardRangeConcept) ); } diff --git a/test/ranges/segment_range.cpp b/test/ranges/segment_range.cpp index 1c9520190..1d48199c6 100644 --- a/test/ranges/segment_range.cpp +++ b/test/ranges/segment_range.cpp @@ -58,6 +58,10 @@ void test_geometry(std::string const& wkt, std::string const& expected) int const n = boost::size(range); BOOST_CHECK_EQUAL(n, 2); } + + // Check Boost.Range concept + BOOST_CONCEPT_ASSERT( (boost::ForwardRangeConcept) ); + } From 8e1c6442f78133d23e31d93007af151281763aa4 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 30 Apr 2011 18:16:08 +0000 Subject: [PATCH 70/70] Added box_2d_4values.cpp sample [SVN r71632] --- .../examples/geometries/register/Jamfile.v2 | 1 + .../geometries/register/box_2d_4values.cpp | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 doc/src/examples/geometries/register/box_2d_4values.cpp diff --git a/doc/src/examples/geometries/register/Jamfile.v2 b/doc/src/examples/geometries/register/Jamfile.v2 index 95f956a39..cb87e3a0e 100644 --- a/doc/src/examples/geometries/register/Jamfile.v2 +++ b/doc/src/examples/geometries/register/Jamfile.v2 @@ -15,4 +15,5 @@ project boost-geometry-doc-src-example-geometries-register exe box : box.cpp ; exe box_templated : box_templated.cpp ; +exe box_2d_4values : box_2d_4values.cpp ; exe point : point.cpp ; diff --git a/doc/src/examples/geometries/register/box_2d_4values.cpp b/doc/src/examples/geometries/register/box_2d_4values.cpp new file mode 100644 index 000000000..4cec35101 --- /dev/null +++ b/doc/src/examples/geometries/register/box_2d_4values.cpp @@ -0,0 +1,51 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, 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) + +//[register_box_2d_4values +//` Show the use of the macro BOOST_GEOMETRY_REGISTER_BOX_2D_4VALUES + +#include +#include +#include +#include + +struct my_point +{ + int x, y; +}; + +struct my_box +{ + int left, top, right, bottom; +}; + +BOOST_GEOMETRY_REGISTER_POINT_2D(my_point, int, cs::cartesian, x, y) + +// Register the box type, also notifying that it is based on "my_point" +// (even if it does not contain it) +BOOST_GEOMETRY_REGISTER_BOX_2D_4VALUES(my_box, my_point, left, top, right, bottom) + +int main() +{ + my_box b = boost::geometry::make(0, 0, 2, 2); + std::cout << "Area: " << boost::geometry::area(b) << std::endl; + return 0; +} + +//] + + +//[register_box_2d_4values_output +/*` +Output: +[pre +Area: 4 +] +*/ +//]