diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index 006ea7920..cb4690a52 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -11,21 +11,29 @@ project geometry/doc ; +using auto-index ; + import boostbook ; import quickbook ; boostbook geometry - : geometry.qbk - : Jamfile.v2 - quickref.xml - generated/point.qbk + : geometry.qbk + : Jamfile.v2 + quickref.xml + generated/point.qbk : chunk.section.depth=4 - chunk.first.sections=1 - toc.section.depth=3 - toc.max.depth=2 - generate.section.toc.level=4 - boost.root=../../../.. - ; + off + on + off + index.on.type=1 + html + chunk.first.sections=1 + toc.section.depth=3 + toc.max.depth=2 + generate.section.toc.level=4 + boost.root=../../../.. + enable_index + ; diff --git a/doc/concept/linestring.qbk b/doc/concept/linestring.qbk index e6213f549..d264e2449 100644 --- a/doc/concept/linestring.qbk +++ b/doc/concept/linestring.qbk @@ -29,8 +29,7 @@ The Linestring Concept is defined as following: [heading Available Models] * [link geometry.reference.models.model_linestring model::linestring] -* a std::vector (requires `#include boost/geometry/geometries/adapted/std_as_linestring.hpp>`) -* a std::deque (requires `#include boost/geometry/geometries/adapted/std_as_linestring.hpp>`) - +* a std::vector (requires registration) +* a std::deque (requires registration) [endsect] diff --git a/doc/doxy/Doxyfile b/doc/doxy/Doxyfile index f6eda4d2c..50a390a58 100644 --- a/doc/doxy/Doxyfile +++ b/doc/doxy/Doxyfile @@ -61,7 +61,7 @@ ALIASES = qbk{1}="\xmlonly \1 \endxmlonly" \ tparam_functor="Function or class with operator()" \ tparam_output_collection="output collection, either a multi-geometry, or a std::vector / std::deque etc" \ tparam_geometry="Any type fulfilling a Geometry Concept" \ - tparam_geometry{1}="A type fulfilling a \1 Concept" \ + tparam_geometry{1}="A type fulfilling the \1 Concept" \ tparam_index_required="Index, this template parameter is required. For a Box: either min_corner or max_corner. For a Segment: either 0 or 1 for first or last point." \ tparam_numeric="numerical type (int, double, ttmath, ...)" \ tparam_out{1}="A valid output iterator type, accepting geometries of \1 Concept" \ @@ -192,7 +192,6 @@ INPUT = . .. ../../../../boost/geometry/core \ ../../../../boost/geometry/multi/geometries \ ../../../../boost/geometry/multi/geometries/register \ ../../../../boost/geometry/multi/geometries/concepts \ - ../../../../boost/geometry/multi/iterators \ ../../../../boost/geometry/multi/strategies/cartesian \ ../../../../boost/geometry/policies \ ../../../../boost/geometry/policies/relate \ @@ -204,7 +203,6 @@ INPUT = . .. ../../../../boost/geometry/core \ ../../../../boost/geometry/strategies/transform \ ../../../../boost/geometry/util \ ../../../../boost/geometry/views \ - ../../../../boost/geometry/extensions/io/svg \ ./doxygen_input/pages \ ./doxygen_input/groups INPUT_ENCODING = UTF-8 diff --git a/doc/doxy/doxygen_input/pages/doxygen_pages.hpp b/doc/doxy/doxygen_input/pages/doxygen_pages.hpp index c48a13788..d3a6cc0b0 100644 --- a/doc/doxy/doxygen_input/pages/doxygen_pages.hpp +++ b/doc/doxy/doxygen_input/pages/doxygen_pages.hpp @@ -131,12 +131,6 @@ If you want to use your own points it makes sense to use the registration macro' - \#include macro's for box registration -If you are using standard containers containing points and want to handle them as a linestring -- \#include allows you to use things like \c std::vector - and put them as parameters into algorithms. - -If you are using boost tuples and want to handle them as Cartesian points -- \#include \section extension_includes Extensions diff --git a/doc/doxy/doxygen_input/sourcecode/doxygen_1.cpp b/doc/doxy/doxygen_input/sourcecode/doxygen_1.cpp index ccfcd994f..f4e9c52b1 100644 --- a/doc/doxy/doxygen_input/sourcecode/doxygen_1.cpp +++ b/doc/doxy/doxygen_input/sourcecode/doxygen_1.cpp @@ -20,7 +20,6 @@ OBSOLETE #include #include #include -#include #include diff --git a/doc/doxy/doxygen_input/sourcecode/doxygen_2.cpp b/doc/doxy/doxygen_input/sourcecode/doxygen_2.cpp index dd3594c7e..bb820ffec 100644 --- a/doc/doxy/doxygen_input/sourcecode/doxygen_2.cpp +++ b/doc/doxy/doxygen_input/sourcecode/doxygen_2.cpp @@ -20,11 +20,8 @@ OBSOLETE #include #include #include -#include +#include #include -#include -#include -#include // Small QRect simulations following http://doc.trolltech.com/4.4/qrect.html diff --git a/doc/doxy/doxygen_input/sourcecode/doxygen_3.cpp b/doc/doxy/doxygen_input/sourcecode/doxygen_3.cpp index 1b6de0e60..845b650b3 100644 --- a/doc/doxy/doxygen_input/sourcecode/doxygen_3.cpp +++ b/doc/doxy/doxygen_input/sourcecode/doxygen_3.cpp @@ -13,9 +13,6 @@ OBSOLETE #include #include -#include -#include -#include diff --git a/doc/doxy/doxygen_input/sourcecode/doxygen_4.cpp b/doc/doxy/doxygen_input/sourcecode/doxygen_4.cpp index c78f99745..b837b1dce 100644 --- a/doc/doxy/doxygen_input/sourcecode/doxygen_4.cpp +++ b/doc/doxy/doxygen_input/sourcecode/doxygen_4.cpp @@ -13,6 +13,7 @@ OBSOLETE #include #include +#include #include diff --git a/doc/geometry.qbk b/doc/geometry.qbk index b42891feb..bbcf49e1f 100644 --- a/doc/geometry.qbk +++ b/doc/geometry.qbk @@ -72,6 +72,7 @@ All algorithms in Boost.Geometry will check any geometry arguments against the c [def __boost_range__ Boost.Range] [def __boost_tuple__ Boost.Tuple] [def __boost_gil__ [@http://www.boost.org/libs/gil/ Boost.GIL]] +[def __boost_bb__ Boost.Build] [def __ttmath__ [@http://www.ttmath.org/ ttmath]] [def __ogc__ [@http://www.opengeospatial.org OGC]] @@ -91,7 +92,17 @@ Boost.Geometry contains contributions by: [include quickstart.qbk] [include design_rationale.qbk] +[include compiling.qbk] + +[section Indexes] [include matrix.qbk] +[section Alphabetical Index] +'''</index>''' +[endsect] +[endsect] + [include reference.qbk] + + [include about_documentation.qbk] [include acknowledgments.qbk] diff --git a/doc/imports.qbk b/doc/imports.qbk index 7f44713fd..1b18d2719 100644 --- a/doc/imports.qbk +++ b/doc/imports.qbk @@ -103,3 +103,6 @@ [import src/examples/geometries/register/multi_linestring.cpp] [import src/examples/geometries/register/multi_polygon.cpp] + +[import src/examples/views/box_view.cpp] +[import src/examples/views/segment_view.cpp] diff --git a/doc/reference/views/box_view.qbk b/doc/reference/views/box_view.qbk new file mode 100644 index 000000000..ca6c315dc --- /dev/null +++ b/doc/reference/views/box_view.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] +[box_view] +[box_view_output] diff --git a/doc/reference/views/segment_view.qbk b/doc/reference/views/segment_view.qbk new file mode 100644 index 000000000..5ec3155ca --- /dev/null +++ b/doc/reference/views/segment_view.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] +[segment_view] +[segment_view_output] 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 2667fe985..562a65ddb 100644 --- a/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp +++ b/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp @@ -108,12 +108,13 @@ static void parse_parameter(rapidxml::xml_node<>* node, parameter& p) // #define: <param><defname>Point</defname></param> // template: <param><type>typename</type><declname>CoordinateType</declname><defname>CoordinateType</defname></param> // template with default: <param><type>typename</type><declname>CoordinateSystem</declname><defname>CoordinateSystem</defname><defval><ref ....>cs::cartesian</ref></defval></param> + // with enum: <type><ref refid="group__enum_1ga7d33eca9a5389952bdf719972eb802b6" kindref="member">closure_selector</ref></type> if (node != NULL) { std::string name = node->name(); if (name == "type") { - p.fulltype = node->value(); + get_contents(node->first_node(), p.fulltype); p.type = p.fulltype; boost::replace_all(p.type, " const", ""); boost::trim(p.type); diff --git a/doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini b/doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini index 2916bbe51..7849e8f66 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/structboost_1_1geometry_1_1tag.xml +xml=../../../../doxy/doxygen_output/xml/structboost_1_1geometry_1_1closeable__view.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 e8d3f2570..2d2cbf24c 100644 --- a/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp +++ b/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp @@ -118,6 +118,10 @@ void quickbook_synopsis(function const& f, std::ostream& out) { out << ")"; } + else if (f.type != function_define) + { + out << "()"; + } } out << "``" @@ -285,6 +289,33 @@ inline std::string output_if_different(std::string const& s, std::string const& ; } +inline void quickbook_output_indexterm(std::string const& term, std::ostream& out + //, std::string const& secondary = "" + ) +{ + out << "'''"; + if (boost::contains(term, "::")) + { + // "Unnamespace" it and add all terms (also namespaces) + std::vector<std::string> splitted; + boost::split(splitted, boost::replace_all_copy(term, "::", ":") + , boost::is_any_of(":"), boost::token_compress_on); + BOOST_FOREACH(std::string const& part, splitted) + { + out << "<indexterm><primary>" << part << "</primary></indexterm>"; + } + } + else + { + out << "<indexterm><primary>" << term; + /*if (! secondary.empty()) + { + out << "<secondary>" << secondary << "</secondary>"; + }*/ + out << "</primary></indexterm>"; + } + out << "'''" << std::endl; +} void quickbook_output(function const& f, configuration const& config, std::ostream& out) { @@ -315,6 +346,8 @@ void quickbook_output(function const& f, configuration const& config, std::ostre << "]" << std::endl << std::endl; + quickbook_output_indexterm(f.name, out); + out << qbk_escaped(f.brief_description) << std::endl; out << std::endl; @@ -393,6 +426,12 @@ void quickbook_output(enumeration const& e, configuration const& config, std::os << "]" << std::endl << std::endl; + quickbook_output_indexterm(e.name, out); + BOOST_FOREACH(enumeration_value const& value, e.enumeration_values) + { + quickbook_output_indexterm(value.name, out); + } + out << e.brief_description << std::endl; out << std::endl; @@ -465,6 +504,8 @@ void quickbook_output(class_or_struct const& cos, configuration const& config, s out << "[section:" << to_section_name(short_name) << " " << short_name << "]" << std::endl << std::endl; + quickbook_output_indexterm(short_name, out); + out << cos.brief_description << std::endl; out << std::endl; diff --git a/doc/src/examples/algorithms/append.cpp b/doc/src/examples/algorithms/append.cpp index f4392d645..e3ccd1425 100644 --- a/doc/src/examples/algorithms/append.cpp +++ b/doc/src/examples/algorithms/append.cpp @@ -15,7 +15,7 @@ #include <boost/assign.hpp> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) diff --git a/doc/src/examples/algorithms/area.cpp b/doc/src/examples/algorithms/area.cpp index 597bec3b4..5b5ef9179 100644 --- a/doc/src/examples/algorithms/area.cpp +++ b/doc/src/examples/algorithms/area.cpp @@ -11,7 +11,10 @@ //` Calculate the area of a polygon #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> 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 cefbf39a2..d47120889 100644 --- a/doc/src/examples/algorithms/area_with_strategy.cpp +++ b/doc/src/examples/algorithms/area_with_strategy.cpp @@ -11,7 +11,10 @@ //` Calculate the area of a polygon #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> namespace bg = boost::geometry; /*< Convenient namespace alias >*/ diff --git a/doc/src/examples/algorithms/assign.cpp b/doc/src/examples/algorithms/assign.cpp index 94482adb4..aa45a3c58 100644 --- a/doc/src/examples/algorithms/assign.cpp +++ b/doc/src/examples/algorithms/assign.cpp @@ -13,6 +13,9 @@ #include <iostream> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/box.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) diff --git a/doc/src/examples/algorithms/assign_2d_point.cpp b/doc/src/examples/algorithms/assign_2d_point.cpp index f21f47e0e..84dbbe690 100644 --- a/doc/src/examples/algorithms/assign_2d_point.cpp +++ b/doc/src/examples/algorithms/assign_2d_point.cpp @@ -14,7 +14,7 @@ #include <iomanip> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #if defined(HAVE_TTMATH) # include <boost/geometry/extensions/contrib/ttmath_stub.hpp> diff --git a/doc/src/examples/algorithms/assign_3d_point.cpp b/doc/src/examples/algorithms/assign_3d_point.cpp index 094b8869b..d7863ad7d 100644 --- a/doc/src/examples/algorithms/assign_3d_point.cpp +++ b/doc/src/examples/algorithms/assign_3d_point.cpp @@ -14,7 +14,7 @@ #include <iomanip> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point.hpp> int main() { diff --git a/doc/src/examples/algorithms/assign_box_corners.cpp b/doc/src/examples/algorithms/assign_box_corners.cpp index e74545bed..1cb8d40db 100644 --- a/doc/src/examples/algorithms/assign_box_corners.cpp +++ b/doc/src/examples/algorithms/assign_box_corners.cpp @@ -13,7 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/box.hpp> +#include <boost/geometry/geometries/point_xy.hpp> using namespace boost::geometry; diff --git a/doc/src/examples/algorithms/assign_inverse.cpp b/doc/src/examples/algorithms/assign_inverse.cpp index 27d1fdf11..06284fed5 100644 --- a/doc/src/examples/algorithms/assign_inverse.cpp +++ b/doc/src/examples/algorithms/assign_inverse.cpp @@ -13,7 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/box.hpp> +#include <boost/geometry/geometries/point.hpp> 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 06a684afe..fb609cba5 100644 --- a/doc/src/examples/algorithms/assign_point_from_index.cpp +++ b/doc/src/examples/algorithms/assign_point_from_index.cpp @@ -13,7 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/segment.hpp> 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 db73730ef..19ec66faa 100644 --- a/doc/src/examples/algorithms/assign_point_to_index.cpp +++ b/doc/src/examples/algorithms/assign_point_to_index.cpp @@ -13,7 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/box.hpp> +#include <boost/geometry/geometries/point_xy.hpp> using namespace boost::geometry; diff --git a/doc/src/examples/algorithms/assign_points.cpp b/doc/src/examples/algorithms/assign_points.cpp index d43321da2..aea224a62 100644 --- a/doc/src/examples/algorithms/assign_points.cpp +++ b/doc/src/examples/algorithms/assign_points.cpp @@ -13,7 +13,7 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/linestring.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> #include <boost/assign.hpp> diff --git a/doc/src/examples/algorithms/centroid.cpp b/doc/src/examples/algorithms/centroid.cpp index 49bb80cde..ce4380072 100644 --- a/doc/src/examples/algorithms/centroid.cpp +++ b/doc/src/examples/algorithms/centroid.cpp @@ -14,7 +14,8 @@ #include <list> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> /*<-*/ #include "create_svg_two.hpp" /*->*/ diff --git a/doc/src/examples/algorithms/clear.cpp b/doc/src/examples/algorithms/clear.cpp index 20f9deba1..5a6de8694 100644 --- a/doc/src/examples/algorithms/clear.cpp +++ b/doc/src/examples/algorithms/clear.cpp @@ -13,7 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/geometries/ring.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) diff --git a/doc/src/examples/algorithms/comparable_distance.cpp b/doc/src/examples/algorithms/comparable_distance.cpp index 64df6d56d..e4d6f7035 100644 --- a/doc/src/examples/algorithms/comparable_distance.cpp +++ b/doc/src/examples/algorithms/comparable_distance.cpp @@ -13,6 +13,7 @@ #include <iostream> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/numeric/conversion/bounds.hpp> #include <boost/foreach.hpp> diff --git a/doc/src/examples/algorithms/convert.cpp b/doc/src/examples/algorithms/convert.cpp index 6baf27c5a..6ca97d9ad 100644 --- a/doc/src/examples/algorithms/convert.cpp +++ b/doc/src/examples/algorithms/convert.cpp @@ -13,6 +13,9 @@ #include <iostream> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/box.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) diff --git a/doc/src/examples/algorithms/convex_hull.cpp b/doc/src/examples/algorithms/convex_hull.cpp index 2f826e148..df4d35f7f 100644 --- a/doc/src/examples/algorithms/convex_hull.cpp +++ b/doc/src/examples/algorithms/convex_hull.cpp @@ -13,6 +13,7 @@ #include <iostream> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) diff --git a/doc/src/examples/algorithms/correct.cpp b/doc/src/examples/algorithms/correct.cpp index ec8753dd7..2fac51225 100644 --- a/doc/src/examples/algorithms/correct.cpp +++ b/doc/src/examples/algorithms/correct.cpp @@ -13,6 +13,7 @@ #include <iostream> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) diff --git a/doc/src/examples/algorithms/difference.cpp b/doc/src/examples/algorithms/difference.cpp index 03f5cf954..2ec6ce5d4 100644 --- a/doc/src/examples/algorithms/difference.cpp +++ b/doc/src/examples/algorithms/difference.cpp @@ -14,7 +14,8 @@ #include <list> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> #include <boost/foreach.hpp> diff --git a/doc/src/examples/algorithms/difference_inserter.cpp b/doc/src/examples/algorithms/difference_inserter.cpp index 60d8883ac..17d4f339b 100644 --- a/doc/src/examples/algorithms/difference_inserter.cpp +++ b/doc/src/examples/algorithms/difference_inserter.cpp @@ -14,7 +14,8 @@ #include <vector> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> #include <boost/foreach.hpp> diff --git a/doc/src/examples/algorithms/distance.cpp b/doc/src/examples/algorithms/distance.cpp index bc77e9f0e..e2067772d 100644 --- a/doc/src/examples/algorithms/distance.cpp +++ b/doc/src/examples/algorithms/distance.cpp @@ -14,8 +14,11 @@ #include <list> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/multi/geometries/multi_point.hpp> +#include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> diff --git a/doc/src/examples/algorithms/envelope.cpp b/doc/src/examples/algorithms/envelope.cpp index fd310dae2..89f72a612 100644 --- a/doc/src/examples/algorithms/envelope.cpp +++ b/doc/src/examples/algorithms/envelope.cpp @@ -13,7 +13,9 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/box.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> /*<-*/ #include "create_svg_two.hpp" /*->*/ diff --git a/doc/src/examples/algorithms/equals.cpp b/doc/src/examples/algorithms/equals.cpp index 4b8df5f34..414aa38d3 100644 --- a/doc/src/examples/algorithms/equals.cpp +++ b/doc/src/examples/algorithms/equals.cpp @@ -13,7 +13,7 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) diff --git a/doc/src/examples/algorithms/for_each_point.cpp b/doc/src/examples/algorithms/for_each_point.cpp index f5a42ba55..138086413 100644 --- a/doc/src/examples/algorithms/for_each_point.cpp +++ b/doc/src/examples/algorithms/for_each_point.cpp @@ -13,7 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> diff --git a/doc/src/examples/algorithms/for_each_point_const.cpp b/doc/src/examples/algorithms/for_each_point_const.cpp index 8b29ef1e9..2654e519e 100644 --- a/doc/src/examples/algorithms/for_each_point_const.cpp +++ b/doc/src/examples/algorithms/for_each_point_const.cpp @@ -13,7 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> diff --git a/doc/src/examples/algorithms/for_each_segment_const.cpp b/doc/src/examples/algorithms/for_each_segment_const.cpp index c1ae26236..b17d7417c 100644 --- a/doc/src/examples/algorithms/for_each_segment_const.cpp +++ b/doc/src/examples/algorithms/for_each_segment_const.cpp @@ -13,7 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/assign.hpp> diff --git a/doc/src/examples/algorithms/intersection_ls_ls_point.cpp b/doc/src/examples/algorithms/intersection_ls_ls_point.cpp index a4ef55ef6..336dde1aa 100644 --- a/doc/src/examples/algorithms/intersection_ls_ls_point.cpp +++ b/doc/src/examples/algorithms/intersection_ls_ls_point.cpp @@ -15,10 +15,13 @@ #include <boost/geometry.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> /*< Adapts std::vector to linestring concept >*/ +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/register/linestring.hpp> #include <boost/foreach.hpp> +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) + int main() { diff --git a/doc/src/examples/algorithms/intersection_poly_poly.cpp b/doc/src/examples/algorithms/intersection_poly_poly.cpp index 0966e1446..2274205fe 100644 --- a/doc/src/examples/algorithms/intersection_poly_poly.cpp +++ b/doc/src/examples/algorithms/intersection_poly_poly.cpp @@ -14,7 +14,8 @@ #include <deque> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> #include <boost/foreach.hpp> diff --git a/doc/src/examples/algorithms/intersection_segment.cpp b/doc/src/examples/algorithms/intersection_segment.cpp index d9a902436..c54834c9d 100644 --- a/doc/src/examples/algorithms/intersection_segment.cpp +++ b/doc/src/examples/algorithms/intersection_segment.cpp @@ -13,8 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> /*< Adapts std::vector to linestring concept >*/ #include <boost/foreach.hpp> diff --git a/doc/src/examples/algorithms/intersects_linestring.cpp b/doc/src/examples/algorithms/intersects_linestring.cpp index 536c649e7..4c72fcda5 100644 --- a/doc/src/examples/algorithms/intersects_linestring.cpp +++ b/doc/src/examples/algorithms/intersects_linestring.cpp @@ -13,6 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> int main() diff --git a/doc/src/examples/algorithms/intersects_segment.cpp b/doc/src/examples/algorithms/intersects_segment.cpp index 9c98a3085..428b34c3f 100644 --- a/doc/src/examples/algorithms/intersects_segment.cpp +++ b/doc/src/examples/algorithms/intersects_segment.cpp @@ -13,6 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> int main() diff --git a/doc/src/examples/algorithms/length.cpp b/doc/src/examples/algorithms/length.cpp index 506a3e6b5..0c6ec9140 100644 --- a/doc/src/examples/algorithms/length.cpp +++ b/doc/src/examples/algorithms/length.cpp @@ -12,6 +12,8 @@ #include <iostream> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> diff --git a/doc/src/examples/algorithms/length_with_strategy.cpp b/doc/src/examples/algorithms/length_with_strategy.cpp index 32eb6d39b..2c68f3ae8 100644 --- a/doc/src/examples/algorithms/length_with_strategy.cpp +++ b/doc/src/examples/algorithms/length_with_strategy.cpp @@ -12,6 +12,7 @@ #include <iostream> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> int main() { diff --git a/doc/src/examples/algorithms/make_2d_point.cpp b/doc/src/examples/algorithms/make_2d_point.cpp index 8c6189b3b..7e776ae77 100644 --- a/doc/src/examples/algorithms/make_2d_point.cpp +++ b/doc/src/examples/algorithms/make_2d_point.cpp @@ -13,7 +13,7 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/register/point.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> #include <boost/geometry/geometries/adapted/boost_polygon/point.hpp> diff --git a/doc/src/examples/algorithms/make_3d_point.cpp b/doc/src/examples/algorithms/make_3d_point.cpp index 4605bb81a..88349894b 100644 --- a/doc/src/examples/algorithms/make_3d_point.cpp +++ b/doc/src/examples/algorithms/make_3d_point.cpp @@ -13,7 +13,7 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point.hpp> int main() { diff --git a/doc/src/examples/algorithms/make_inverse.cpp b/doc/src/examples/algorithms/make_inverse.cpp index 20dd5fc37..660013655 100644 --- a/doc/src/examples/algorithms/make_inverse.cpp +++ b/doc/src/examples/algorithms/make_inverse.cpp @@ -13,7 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/box.hpp> +#include <boost/geometry/geometries/point_xy.hpp> 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 faf97f707..19939f85c 100644 --- a/doc/src/examples/algorithms/make_with_range.cpp +++ b/doc/src/examples/algorithms/make_with_range.cpp @@ -13,6 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) /*< 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 d66735de7..43aa29c8e 100644 --- a/doc/src/examples/algorithms/num_geometries.cpp +++ b/doc/src/examples/algorithms/num_geometries.cpp @@ -13,8 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/multi/multi.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> diff --git a/doc/src/examples/algorithms/num_interior_rings.cpp b/doc/src/examples/algorithms/num_interior_rings.cpp index b6edc4a67..9d8a54108 100644 --- a/doc/src/examples/algorithms/num_interior_rings.cpp +++ b/doc/src/examples/algorithms/num_interior_rings.cpp @@ -13,8 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/multi/multi.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> diff --git a/doc/src/examples/algorithms/num_points.cpp b/doc/src/examples/algorithms/num_points.cpp index be0c1492a..20a0df0e5 100644 --- a/doc/src/examples/algorithms/num_points.cpp +++ b/doc/src/examples/algorithms/num_points.cpp @@ -14,7 +14,8 @@ #include <boost/geometry.hpp> #include <boost/geometry/multi/multi.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> diff --git a/doc/src/examples/algorithms/return_envelope.cpp b/doc/src/examples/algorithms/return_envelope.cpp index cb8914e5d..27701150c 100644 --- a/doc/src/examples/algorithms/return_envelope.cpp +++ b/doc/src/examples/algorithms/return_envelope.cpp @@ -14,7 +14,9 @@ #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/box.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/ring.hpp> #include <boost/assign.hpp> diff --git a/doc/src/examples/algorithms/reverse.cpp b/doc/src/examples/algorithms/reverse.cpp index f12c72281..ef45f9adf 100644 --- a/doc/src/examples/algorithms/reverse.cpp +++ b/doc/src/examples/algorithms/reverse.cpp @@ -13,7 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/geometries/ring.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) diff --git a/doc/src/examples/algorithms/simplify.cpp b/doc/src/examples/algorithms/simplify.cpp index db4a97bfb..e44c11d0a 100644 --- a/doc/src/examples/algorithms/simplify.cpp +++ b/doc/src/examples/algorithms/simplify.cpp @@ -11,7 +11,10 @@ //` Example showing how to simplify a linestring #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> /*< For this example we use Boost.Assign to add points >*/ #include <boost/assign.hpp> diff --git a/doc/src/examples/algorithms/simplify_insert.cpp b/doc/src/examples/algorithms/simplify_insert.cpp index d93034dfd..d3cb0f2a4 100644 --- a/doc/src/examples/algorithms/simplify_insert.cpp +++ b/doc/src/examples/algorithms/simplify_insert.cpp @@ -11,7 +11,10 @@ //` Simplify a linestring using a back inserter #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> 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 3236fee0b..a662e27ff 100644 --- a/doc/src/examples/algorithms/simplify_insert_with_strategy.cpp +++ b/doc/src/examples/algorithms/simplify_insert_with_strategy.cpp @@ -11,7 +11,10 @@ //` Simplify a linestring using an output iterator #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> #include <boost/geometry/domains/gis/io/wkt/stream_wkt.hpp> diff --git a/doc/src/examples/algorithms/sym_difference.cpp b/doc/src/examples/algorithms/sym_difference.cpp index 7f0bf779f..7d122c42f 100644 --- a/doc/src/examples/algorithms/sym_difference.cpp +++ b/doc/src/examples/algorithms/sym_difference.cpp @@ -13,7 +13,8 @@ #include <iostream> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> diff --git a/doc/src/examples/algorithms/union.cpp b/doc/src/examples/algorithms/union.cpp index 79c35298a..84ab620c6 100644 --- a/doc/src/examples/algorithms/union.cpp +++ b/doc/src/examples/algorithms/union.cpp @@ -14,7 +14,8 @@ #include <vector> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> #include <boost/foreach.hpp> diff --git a/doc/src/examples/algorithms/unique.cpp b/doc/src/examples/algorithms/unique.cpp index 1c3511272..6c3455cea 100644 --- a/doc/src/examples/algorithms/unique.cpp +++ b/doc/src/examples/algorithms/unique.cpp @@ -13,6 +13,7 @@ #include <iostream> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) diff --git a/doc/src/examples/algorithms/within.cpp b/doc/src/examples/algorithms/within.cpp index 24d33bdcc..27217f748 100644 --- a/doc/src/examples/algorithms/within.cpp +++ b/doc/src/examples/algorithms/within.cpp @@ -14,7 +14,8 @@ #include <list> #include <boost/geometry.hpp> -#include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> /*<-*/ #include "create_svg_two.hpp" /*->*/ diff --git a/doc/src/examples/core/closure.cpp b/doc/src/examples/core/closure.cpp index db4c5e406..e254f978c 100644 --- a/doc/src/examples/core/closure.cpp +++ b/doc/src/examples/core/closure.cpp @@ -11,7 +11,10 @@ //` Examine if a polygon is defined as "should be closed" #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/geometries/point_xy.hpp> int main() { diff --git a/doc/src/examples/core/coordinate_dimension.cpp b/doc/src/examples/core/coordinate_dimension.cpp index 47fda0163..1ba7db439 100644 --- a/doc/src/examples/core/coordinate_dimension.cpp +++ b/doc/src/examples/core/coordinate_dimension.cpp @@ -11,7 +11,9 @@ //` Examine the number of coordinates making up the points in a linestring type #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); diff --git a/doc/src/examples/core/coordinate_system.cpp b/doc/src/examples/core/coordinate_system.cpp index 6969a27a2..cbae9e05e 100644 --- a/doc/src/examples/core/coordinate_system.cpp +++ b/doc/src/examples/core/coordinate_system.cpp @@ -12,7 +12,10 @@ #include <iostream> #include <typeinfo> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/geometries/point_xy.hpp> int main() { diff --git a/doc/src/examples/core/coordinate_type.cpp b/doc/src/examples/core/coordinate_type.cpp index 3fffafa5f..ed7260478 100644 --- a/doc/src/examples/core/coordinate_type.cpp +++ b/doc/src/examples/core/coordinate_type.cpp @@ -12,7 +12,10 @@ #include <iostream> #include <typeinfo> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/geometries/point_xy.hpp> int main() { diff --git a/doc/src/examples/core/get_box.cpp b/doc/src/examples/core/get_box.cpp index 181721267..b0d179a7a 100644 --- a/doc/src/examples/core/get_box.cpp +++ b/doc/src/examples/core/get_box.cpp @@ -11,7 +11,9 @@ //` Get the coordinate of a box #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> namespace bg = boost::geometry; diff --git a/doc/src/examples/core/get_point.cpp b/doc/src/examples/core/get_point.cpp index cd0243e52..4af8c0e3c 100644 --- a/doc/src/examples/core/get_point.cpp +++ b/doc/src/examples/core/get_point.cpp @@ -11,7 +11,9 @@ //` Get the coordinate of a point #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> namespace bg = boost::geometry; diff --git a/doc/src/examples/core/interior_type.cpp b/doc/src/examples/core/interior_type.cpp index 79b22a914..b9f577903 100644 --- a/doc/src/examples/core/interior_type.cpp +++ b/doc/src/examples/core/interior_type.cpp @@ -12,7 +12,10 @@ #include <iostream> #include <typeinfo> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/geometries/ring.hpp> #include <boost/geometry/geometries/adapted/boost_array.hpp> BOOST_GEOMETRY_REGISTER_BOOST_ARRAY_CS(cs::cartesian) diff --git a/doc/src/examples/core/point_order.cpp b/doc/src/examples/core/point_order.cpp index dede853cd..ff0922354 100644 --- a/doc/src/examples/core/point_order.cpp +++ b/doc/src/examples/core/point_order.cpp @@ -11,7 +11,10 @@ //` Examine the expected point order of a polygon type #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/geometries/point_xy.hpp> int main() { diff --git a/doc/src/examples/core/point_type.cpp b/doc/src/examples/core/point_type.cpp index 51508511c..357749655 100644 --- a/doc/src/examples/core/point_type.cpp +++ b/doc/src/examples/core/point_type.cpp @@ -12,7 +12,11 @@ #include <iostream> #include <typeinfo> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/multi/geometries/multi_polygon.hpp> int main() { diff --git a/doc/src/examples/core/ring_type.cpp b/doc/src/examples/core/ring_type.cpp index cae4dfd2b..01446df01 100644 --- a/doc/src/examples/core/ring_type.cpp +++ b/doc/src/examples/core/ring_type.cpp @@ -12,7 +12,10 @@ #include <iostream> #include <typeinfo> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/geometries/point_xy.hpp> int main() { diff --git a/doc/src/examples/core/rings.cpp b/doc/src/examples/core/rings.cpp index 30a32b86f..555370d88 100644 --- a/doc/src/examples/core/rings.cpp +++ b/doc/src/examples/core/rings.cpp @@ -15,7 +15,10 @@ Also shows the related ring_type and interior_type. */ #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/geometries/point_xy.hpp> int main() diff --git a/doc/src/examples/core/set_box.cpp b/doc/src/examples/core/set_box.cpp index 1c56572b1..ae1db4877 100644 --- a/doc/src/examples/core/set_box.cpp +++ b/doc/src/examples/core/set_box.cpp @@ -11,7 +11,9 @@ //` Set the coordinate of a box #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> namespace bg = boost::geometry; diff --git a/doc/src/examples/core/set_point.cpp b/doc/src/examples/core/set_point.cpp index 39520c921..d4a627d63 100644 --- a/doc/src/examples/core/set_point.cpp +++ b/doc/src/examples/core/set_point.cpp @@ -11,7 +11,9 @@ //` Set the coordinate of a point #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> namespace bg = boost::geometry; diff --git a/doc/src/examples/core/tag.cpp b/doc/src/examples/core/tag.cpp index 215e77f23..86e8f5a83 100644 --- a/doc/src/examples/core/tag.cpp +++ b/doc/src/examples/core/tag.cpp @@ -15,6 +15,8 @@ #include <boost/assign.hpp> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) diff --git a/doc/src/examples/core/tag_cast.cpp b/doc/src/examples/core/tag_cast.cpp index f33345706..019e1edd1 100644 --- a/doc/src/examples/core/tag_cast.cpp +++ b/doc/src/examples/core/tag_cast.cpp @@ -12,7 +12,10 @@ #include <iostream> #include <typeinfo> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/geometries/point_xy.hpp> namespace geo = boost::geometry; int main() diff --git a/doc/src/examples/geometries/adapted/boost_array.cpp b/doc/src/examples/geometries/adapted/boost_array.cpp index 99aa8a3d7..b1237318f 100644 --- a/doc/src/examples/geometries/adapted/boost_array.cpp +++ b/doc/src/examples/geometries/adapted/boost_array.cpp @@ -11,7 +11,9 @@ //` Shows how to use a Boost.Array using Boost.Geometry's distance, set and assign_values algorithms #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> #include <boost/geometry/geometries/adapted/boost_array.hpp> BOOST_GEOMETRY_REGISTER_BOOST_ARRAY_CS(cs::cartesian) diff --git a/doc/src/examples/geometries/adapted/boost_range/filtered.cpp b/doc/src/examples/geometries/adapted/boost_range/filtered.cpp index e215594d0..bdf05ef0c 100644 --- a/doc/src/examples/geometries/adapted/boost_range/filtered.cpp +++ b/doc/src/examples/geometries/adapted/boost_range/filtered.cpp @@ -11,7 +11,10 @@ //` Shows how to use a Boost.Geometry linestring, filtered by Boost.Range adaptor #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/boost_range/filtered.hpp> struct not_two diff --git a/doc/src/examples/geometries/adapted/boost_range/reversed.cpp b/doc/src/examples/geometries/adapted/boost_range/reversed.cpp index 5bdf5e2ce..6ba3a6b79 100644 --- a/doc/src/examples/geometries/adapted/boost_range/reversed.cpp +++ b/doc/src/examples/geometries/adapted/boost_range/reversed.cpp @@ -11,7 +11,10 @@ //` Shows how to use a Boost.Geometry linestring, reversed by Boost.Range adaptor #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/boost_range/reversed.hpp> int main() diff --git a/doc/src/examples/geometries/adapted/boost_range/sliced.cpp b/doc/src/examples/geometries/adapted/boost_range/sliced.cpp index eb65621f2..d4fe398af 100644 --- a/doc/src/examples/geometries/adapted/boost_range/sliced.cpp +++ b/doc/src/examples/geometries/adapted/boost_range/sliced.cpp @@ -15,6 +15,8 @@ #include <boost/assign.hpp> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/boost_range/sliced.hpp> diff --git a/doc/src/examples/geometries/adapted/boost_range/strided.cpp b/doc/src/examples/geometries/adapted/boost_range/strided.cpp index 08ae880f6..2472337f5 100644 --- a/doc/src/examples/geometries/adapted/boost_range/strided.cpp +++ b/doc/src/examples/geometries/adapted/boost_range/strided.cpp @@ -15,6 +15,8 @@ #include <boost/assign.hpp> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/ring.hpp> #include <boost/geometry/geometries/adapted/boost_range/strided.hpp> diff --git a/doc/src/examples/geometries/adapted/boost_range/uniqued.cpp b/doc/src/examples/geometries/adapted/boost_range/uniqued.cpp index 1d75c6980..f0cd9b01e 100644 --- a/doc/src/examples/geometries/adapted/boost_range/uniqued.cpp +++ b/doc/src/examples/geometries/adapted/boost_range/uniqued.cpp @@ -15,6 +15,8 @@ #include <boost/assign.hpp> #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/ring.hpp> #include <boost/geometry/geometries/adapted/boost_range/uniqued.hpp> typedef boost::geometry::model::d2::point_xy<int> xy; diff --git a/doc/src/examples/geometries/adapted/boost_tuple.cpp b/doc/src/examples/geometries/adapted/boost_tuple.cpp index 67a51836d..1ff67be3f 100644 --- a/doc/src/examples/geometries/adapted/boost_tuple.cpp +++ b/doc/src/examples/geometries/adapted/boost_tuple.cpp @@ -17,7 +17,9 @@ various other examples as well. */ #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) diff --git a/doc/src/examples/geometries/register/box_templated.cpp b/doc/src/examples/geometries/register/box_templated.cpp index 72e0a589f..1b0378f74 100644 --- a/doc/src/examples/geometries/register/box_templated.cpp +++ b/doc/src/examples/geometries/register/box_templated.cpp @@ -11,7 +11,9 @@ //` Show the use of the macro BOOST_GEOMETRY_REGISTER_BOX_TEMPLATED #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/register/box.hpp> template <typename P> diff --git a/doc/src/examples/geometries/register/linestring.cpp b/doc/src/examples/geometries/register/linestring.cpp index bbbbe0b48..f810d3eb2 100644 --- a/doc/src/examples/geometries/register/linestring.cpp +++ b/doc/src/examples/geometries/register/linestring.cpp @@ -11,7 +11,9 @@ //` Show the use of BOOST_GEOMETRY_REGISTER_LINESTRING #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/register/linestring.hpp> typedef boost::geometry::model::d2::point_xy<double> point_2d; diff --git a/doc/src/examples/geometries/register/linestring_templated.cpp b/doc/src/examples/geometries/register/linestring_templated.cpp index 221c61a58..188df627b 100644 --- a/doc/src/examples/geometries/register/linestring_templated.cpp +++ b/doc/src/examples/geometries/register/linestring_templated.cpp @@ -12,7 +12,9 @@ #include <iostream> #include <deque> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/register/linestring.hpp> // Adapt any deque to Boost.Geometry Linestring Concept diff --git a/doc/src/examples/geometries/register/multi_linestring.cpp b/doc/src/examples/geometries/register/multi_linestring.cpp index ab72a92cf..56b71dddb 100644 --- a/doc/src/examples/geometries/register/multi_linestring.cpp +++ b/doc/src/examples/geometries/register/multi_linestring.cpp @@ -11,7 +11,9 @@ //` Show the use of the macro BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> #include <boost/geometry/multi/geometries/register/multi_linestring.hpp> diff --git a/doc/src/examples/geometries/register/multi_polygon.cpp b/doc/src/examples/geometries/register/multi_polygon.cpp index db6a3130d..aa89e73e1 100644 --- a/doc/src/examples/geometries/register/multi_polygon.cpp +++ b/doc/src/examples/geometries/register/multi_polygon.cpp @@ -11,7 +11,9 @@ //` Show the use of the macro BOOST_GEOMETRY_REGISTER_MULTI_POLYGON #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> #include <boost/geometry/multi/geometries/register/multi_polygon.hpp> diff --git a/doc/src/examples/geometries/register/ring.cpp b/doc/src/examples/geometries/register/ring.cpp index bad0e3a54..0b550521d 100644 --- a/doc/src/examples/geometries/register/ring.cpp +++ b/doc/src/examples/geometries/register/ring.cpp @@ -11,7 +11,9 @@ //` Show the use of the macro BOOST_GEOMETRY_REGISTER_RING #include <iostream> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/register/ring.hpp> typedef boost::geometry::model::d2::point_xy<double> point_2d; diff --git a/doc/src/examples/geometries/register/ring_templated.cpp b/doc/src/examples/geometries/register/ring_templated.cpp index 13308ef3d..28a4d5d2f 100644 --- a/doc/src/examples/geometries/register/ring_templated.cpp +++ b/doc/src/examples/geometries/register/ring_templated.cpp @@ -12,7 +12,9 @@ #include <iostream> #include <deque> + #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/register/ring.hpp> // Adapt any deque to Boost.Geometry Ring Concept diff --git a/doc/src/examples/quick_start.cpp b/doc/src/examples/quick_start.cpp index b246afad0..ff96b19c7 100644 --- a/doc/src/examples/quick_start.cpp +++ b/doc/src/examples/quick_start.cpp @@ -22,6 +22,8 @@ //[quickstart_include #include <boost/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> using namespace boost::geometry; //] diff --git a/example/01_point_example.cpp b/example/01_point_example.cpp index 6d5e782b4..b9e9c6342 100644 --- a/example/01_point_example.cpp +++ b/example/01_point_example.cpp @@ -13,6 +13,7 @@ #include <iostream> #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> #include <boost/geometry/geometries/adapted/boost_array.hpp> diff --git a/example/02_linestring_example.cpp b/example/02_linestring_example.cpp index 8315d1761..53e806389 100644 --- a/example/02_linestring_example.cpp +++ b/example/02_linestring_example.cpp @@ -17,11 +17,19 @@ #include <vector> #include <boost/geometry/geometry.hpp> -// Optional includes to handle c-arrays as points, std::vectors as linestrings +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> + +// Optional includes and defines to handle c-arrays as points, std::vectors as linestrings +#include <boost/geometry/geometries/register/linestring.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> + BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + template<typename P> inline void translate_function(P& p) @@ -130,11 +138,6 @@ int main(void) << "as vector: " << dsv(v) << std::endl; - - std::cout - << "as it-pair: " - << dsv(std::make_pair(v.begin(), v.end())) - << std::endl; } // All algorithms from std can be used: a linestring is a vector diff --git a/example/03_polygon_example.cpp b/example/03_polygon_example.cpp index e817fa261..cc379d390 100644 --- a/example/03_polygon_example.cpp +++ b/example/03_polygon_example.cpp @@ -15,9 +15,10 @@ #include <string> #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> -#include <boost/geometry/multi/multi.hpp> +#include <boost/geometry/multi/geometries/multi_polygon.hpp> BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) diff --git a/example/04_boost_example.cpp b/example/04_boost_example.cpp index f6d56cdfe..a92295552 100644 --- a/example/04_boost_example.cpp +++ b/example/04_boost_example.cpp @@ -13,6 +13,9 @@ #include <iostream> #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> #include <boost/assign.hpp> diff --git a/example/05_a_overlay_polygon_example.cpp b/example/05_a_overlay_polygon_example.cpp index 6a81221b1..a5a4c5b43 100644 --- a/example/05_a_overlay_polygon_example.cpp +++ b/example/05_a_overlay_polygon_example.cpp @@ -19,6 +19,8 @@ #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> #if defined(HAVE_SVG) diff --git a/example/05_b_overlay_linestring_polygon_example.cpp b/example/05_b_overlay_linestring_polygon_example.cpp index 118026603..3f90c8f71 100644 --- a/example/05_b_overlay_linestring_polygon_example.cpp +++ b/example/05_b_overlay_linestring_polygon_example.cpp @@ -19,6 +19,9 @@ #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> #if defined(HAVE_SVG) diff --git a/example/06_a_transformation_example.cpp b/example/06_a_transformation_example.cpp index 3c5f6f9b0..75440f42e 100644 --- a/example/06_a_transformation_example.cpp +++ b/example/06_a_transformation_example.cpp @@ -13,8 +13,9 @@ #include <iostream> #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) @@ -37,7 +38,7 @@ int main() model::polygon<point_2d> 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.hpp, std_as_linestring.hpp) + // include files above (c_array.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/example/06_b_transformation_example.cpp b/example/06_b_transformation_example.cpp index 0b6a0542b..6580f65a5 100644 --- a/example/06_b_transformation_example.cpp +++ b/example/06_b_transformation_example.cpp @@ -16,6 +16,8 @@ #include <sstream> #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/algorithms/centroid.hpp> #include <boost/geometry/strategies/transform.hpp> #include <boost/geometry/strategies/transform/matrix_transformers.hpp> diff --git a/example/07_a_graph_route_example.cpp b/example/07_a_graph_route_example.cpp index 4ea9c5ae8..929af00a1 100644 --- a/example/07_a_graph_route_example.cpp +++ b/example/07_a_graph_route_example.cpp @@ -24,6 +24,7 @@ #include <boost/graph/dijkstra_shortest_paths.hpp> #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp> diff --git a/example/07_b_graph_route_example.cpp b/example/07_b_graph_route_example.cpp index 64f4844c9..17dbea3a6 100644 --- a/example/07_b_graph_route_example.cpp +++ b/example/07_b_graph_route_example.cpp @@ -28,6 +28,7 @@ #include <boost/graph/dijkstra_shortest_paths.hpp> #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/linestring.hpp> #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp> diff --git a/example/c04_a_custom_triangle_example.cpp b/example/c04_a_custom_triangle_example.cpp index ce2a53e15..be1e0ac49 100644 --- a/example/c04_a_custom_triangle_example.cpp +++ b/example/c04_a_custom_triangle_example.cpp @@ -16,6 +16,7 @@ #include <boost/geometry/algorithms/area.hpp> #include <boost/geometry/algorithms/centroid.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/register/ring.hpp> #include <boost/geometry/strategies/strategies.hpp> #include <boost/geometry/util/write_dsv.hpp> diff --git a/example/c05_custom_point_pointer_example.cpp b/example/c05_custom_point_pointer_example.cpp index d3787df7e..65ce0df14 100644 --- a/example/c05_custom_point_pointer_example.cpp +++ b/example/c05_custom_point_pointer_example.cpp @@ -19,9 +19,13 @@ #include <boost/geometry/algorithms/make.hpp> #include <boost/geometry/algorithms/intersection.hpp> #include <boost/geometry/geometries/geometries.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/register/linestring.hpp> #include <boost/geometry/strategies/strategies.hpp> +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + // Sample point, having x/y struct my_point { @@ -112,7 +116,5 @@ int main() delete p; } - - return 0; } diff --git a/example/c07_custom_ring_pointer_example.cpp b/example/c07_custom_ring_pointer_example.cpp index 8168dc0d9..6dc1a6f46 100644 --- a/example/c07_custom_ring_pointer_example.cpp +++ b/example/c07_custom_ring_pointer_example.cpp @@ -15,8 +15,10 @@ #include <boost/foreach.hpp> #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/register/ring.hpp> + +BOOST_GEOMETRY_REGISTER_RING_TEMPLATED(std::vector) -#include <boost/geometry/geometries/adapted/std_as_ring.hpp> // Sample point, having x/y struct my_point diff --git a/example/with_external_libs/x04_wxwidgets_world_mapper.cpp b/example/with_external_libs/x04_wxwidgets_world_mapper.cpp index b09f3f3b7..dab9d99a7 100644 --- a/example/with_external_libs/x04_wxwidgets_world_mapper.cpp +++ b/example/with_external_libs/x04_wxwidgets_world_mapper.cpp @@ -18,6 +18,7 @@ #include <boost/scoped_array.hpp> #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/register/point.hpp> #include <boost/geometry/geometries/register/ring.hpp> #include <boost/geometry/multi/multi.hpp> diff --git a/example/with_external_libs/x05_shapelib_example.cpp b/example/with_external_libs/x05_shapelib_example.cpp index a136240e1..8fbfe5e0d 100644 --- a/example/with_external_libs/x05_shapelib_example.cpp +++ b/example/with_external_libs/x05_shapelib_example.cpp @@ -20,6 +20,7 @@ #include "shapefil.h" #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/domains/gis/io/wkt/stream_wkt.hpp> using namespace boost::geometry; diff --git a/example/with_external_libs/x06_qt_world_mapper.cpp b/example/with_external_libs/x06_qt_world_mapper.cpp index ebf788c95..0f8e45281 100644 --- a/example/with_external_libs/x06_qt_world_mapper.cpp +++ b/example/with_external_libs/x06_qt_world_mapper.cpp @@ -23,6 +23,7 @@ #include <boost/foreach.hpp> #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/register/point.hpp> #include <boost/geometry/geometries/register/ring.hpp> diff --git a/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp b/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp index f38c50eff..2bfec728b 100644 --- a/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp +++ b/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp @@ -14,8 +14,6 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_EQUALS_COLLECT_VECTORS_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_EQUALS_COLLECT_VECTORS_HPP -#include <algorithm> -#include <deque> #include <boost/numeric/conversion/cast.hpp> #include <boost/range.hpp> @@ -26,9 +24,8 @@ #include <boost/geometry/core/cs.hpp> #include <boost/geometry/core/interior_rings.hpp> #include <boost/geometry/geometries/concepts/check.hpp> -#include <boost/geometry/strategies/side.hpp> -#include <boost/geometry/util/select_most_precise.hpp> +#include <boost/geometry/util/math.hpp> @@ -41,10 +38,10 @@ struct collected_vector { typedef T type; - collected_vector() + inline collected_vector() {} - collected_vector(T const& px, T const& py, + inline collected_vector(T const& px, T const& py, T const& pdx, T const& pdy) : x(px) , y(py) @@ -58,7 +55,8 @@ struct collected_vector T dx, dy; T dx_0, dy_0; - bool operator<(collected_vector<T> const& other) const + // For sorting + inline bool operator<(collected_vector<T> const& other) const { if (math::equals(x, other.x)) { @@ -77,10 +75,15 @@ struct collected_vector inline bool same_direction(collected_vector<T> const& other) const { - return math::equals(dx, other.dx) - && math::equals(dy, other.dy); + // For high precision arithmetic, we have to be + // more relaxed then using == + // Because 2/sqrt( (0,0)<->(2,2) ) == 1/sqrt( (0,0)<->(1,1) ) + // is not always true (at least, it is not for ttmath) + return math::equals_with_epsilon(dx, other.dx) + && math::equals_with_epsilon(dy, other.dy); } + // For std::equals inline bool operator==(collected_vector<T> const& other) const { return math::equals(x, other.x) @@ -145,7 +148,13 @@ struct range_collect_vectors first = false; } } - // TODO: if first one has same direction as last one, remove first one... + + // If first one has same direction as last one, remove first one + if (boost::size(collection) > 1 + && collection.front().same_direction(collection.back())) + { + collection.erase(collection.begin()); + } } }; diff --git a/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp b/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp index 90ba4164b..423e051f9 100644 --- a/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp @@ -16,6 +16,8 @@ #include <boost/geometry/algorithms/detail/overlay/get_ring.hpp> #include <boost/geometry/algorithms/detail/overlay/within_util.hpp> +#include <boost/geometry/geometries/box.hpp> + namespace boost { namespace geometry { 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..a752773ab 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp @@ -15,6 +15,8 @@ #include <boost/geometry/algorithms/convert.hpp> #include <boost/geometry/algorithms/detail/overlay/get_turns.hpp> +#include <boost/geometry/geometries/segment.hpp> + namespace boost { namespace geometry { 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 783a63bb1..93bf368bc 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -17,6 +17,8 @@ #include <boost/geometry/algorithms/convert.hpp> #include <boost/geometry/algorithms/detail/overlay/turn_info.hpp> +#include <boost/geometry/geometries/segment.hpp> + namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp index 55d062f42..6b7fbe19d 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp @@ -36,6 +36,7 @@ #include <boost/geometry/views/detail/range_type.hpp> #include <boost/geometry/geometries/box.hpp> +#include <boost/geometry/geometries/segment.hpp> #include <boost/geometry/iterators/ever_circling_iterator.hpp> diff --git a/include/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp b/include/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp index 6c1ac0a4e..61e737847 100644 --- a/include/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp @@ -11,11 +11,12 @@ #include <algorithm> - #include <boost/geometry/algorithms/detail/ring_identifier.hpp> #include <boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp> #include <boost/geometry/algorithms/detail/overlay/turn_info.hpp> +#include <boost/geometry/geometries/segment.hpp> + namespace boost { namespace geometry { 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 f996b60ea..62b8ef484 100644 --- a/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp @@ -21,6 +21,8 @@ #include <boost/geometry/algorithms/detail/disjoint.hpp> #include <boost/geometry/algorithms/detail/overlay/get_turns.hpp> +#include <boost/geometry/geometries/box.hpp> + namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/partition.hpp b/include/boost/geometry/algorithms/detail/partition.hpp index 59bdad706..3e0e778d3 100644 --- a/include/boost/geometry/algorithms/detail/partition.hpp +++ b/include/boost/geometry/algorithms/detail/partition.hpp @@ -79,7 +79,7 @@ static inline void divide_into_subsets(Box const& lower_box, Box const& upper_bo } -// Match collection 1 with collection 2 +// Match collection with itself template <typename InputCollection, typename Policy> static inline void handle_one(InputCollection const& collection, index_vector_type const& input, diff --git a/include/boost/geometry/algorithms/equals.hpp b/include/boost/geometry/algorithms/equals.hpp index b42dbcf04..80af39121 100644 --- a/include/boost/geometry/algorithms/equals.hpp +++ b/include/boost/geometry/algorithms/equals.hpp @@ -15,9 +15,7 @@ #define BOOST_GEOMETRY_ALGORITHMS_EQUALS_HPP - #include <cstddef> -#include <deque> #include <vector> #include <boost/mpl/if.hpp> @@ -88,7 +86,7 @@ struct area_check { return geometry::math::equals( geometry::area(geometry1), - geometry::area(geometry1)); + geometry::area(geometry2)); } }; @@ -100,7 +98,7 @@ struct length_check { return geometry::math::equals( geometry::length(geometry1), - geometry::length(geometry1)); + geometry::length(geometry2)); } }; @@ -135,15 +133,11 @@ struct equals_by_collection return false; } - // Check where direction is NOT changing - std::sort(c1.begin(), c1.end()); std::sort(c2.begin(), c2.end()); // Just check if these vectors are equal. - return c1.size() == c2.size() - && std::equal(c1.begin(), c1.end(), c2.begin()); - + return std::equal(c1.begin(), c1.end(), c2.begin()); } }; diff --git a/include/boost/geometry/geometries/adapted/boost_array_as_linestring.hpp b/include/boost/geometry/geometries/adapted/boost_array_as_linestring.hpp deleted file mode 100644 index 7e6396fa0..000000000 --- a/include/boost/geometry/geometries/adapted/boost_array_as_linestring.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_GEOMETRIES_ADAPTED_BOOST_ARRAY_AS_LINESTRING_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ARRAY_AS_LINESTRING_HPP - - -#ifdef BOOST_GEOMETRY_ADAPTED_BOOST_ARRAY_TAG_DEFINED -#error Include either "boost_array_as_point" or \ - "boost_array_as_linestring" or "boost_array_as_ring" \ - or "boost_array_as_multi_point" to adapt a boost_array -#endif - -#define BOOST_GEOMETRY_ADAPTED_BOOST_ARRAY_TAG_DEFINED - - -#include <cstddef> -#include <boost/mpl/assert.hpp> - -#include <boost/array.hpp> - -#include <boost/geometry/core/mutable_range.hpp> -#include <boost/geometry/core/tag.hpp> -#include <boost/geometry/core/tags.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - -template <typename Point, std::size_t PointCount> -struct tag< boost::array<Point, PointCount> > -{ - typedef linestring_tag type; -}; - -// boost::array is immutable with respect to size -// Therefore, prohibit compilation -template <typename Point, std::size_t PointCount> -struct clear< boost::array<Point, PointCount> > -{ - BOOST_MPL_ASSERT_MSG - ( - false, NOT_IMPLEMENTED_FOR_BOOST_ARRAY_OF, (types<Point>) - ); -}; - -template <typename Point, std::size_t PointCount> -struct resize< boost::array<Point, PointCount> > -{ - BOOST_MPL_ASSERT_MSG - ( - false, NOT_IMPLEMENTED_FOR_BOOST_ARRAY_OF, (types<Point>) - ); -}; - -template <typename Point, std::size_t PointCount> -struct push_back< boost::array<Point, PointCount> > -{ - BOOST_MPL_ASSERT_MSG - ( - false, NOT_IMPLEMENTED_FOR_BOOST_ARRAY_OF, (types<Point>) - ); -}; - -} -#endif - - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ARRAY_AS_LINESTRING_HPP diff --git a/include/boost/geometry/geometries/adapted/boost_array_as_ring.hpp b/include/boost/geometry/geometries/adapted/boost_array_as_ring.hpp deleted file mode 100644 index c71019672..000000000 --- a/include/boost/geometry/geometries/adapted/boost_array_as_ring.hpp +++ /dev/null @@ -1,56 +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_ADAPTED_BOOST_ARRAY_AS_RING_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ARRAY_AS_RING_HPP - - -#ifdef BOOST_GEOMETRY_ADAPTED_BOOST_ARRAY_TAG_DEFINED -#error Include either "boost_array_as_point" or \ - "boost_array_as_linestring" or "boost_array_as_ring" \ - or "boost_array_as_multi_point" to adapt a boost_array -#endif - -#define BOOST_GEOMETRY_ADAPTED_BOOST_ARRAY_TAG_DEFINED - - -#include <cstddef> - -#include <boost/array.hpp> - -#include <boost/geometry/core/tag.hpp> -#include <boost/geometry/core/tags.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - - template <typename PointType, std::size_t DimensionCount> - struct tag< boost::array<PointType, DimensionCount> > - { - typedef ring_tag type; - }; - -} -#endif - - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ARRAY_AS_RING_HPP diff --git a/include/boost/geometry/geometries/adapted/c_array_as_linestring.hpp b/include/boost/geometry/geometries/adapted/c_array_as_linestring.hpp deleted file mode 100644 index 41b4319c6..000000000 --- a/include/boost/geometry/geometries/adapted/c_array_as_linestring.hpp +++ /dev/null @@ -1,51 +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_AS_LINESTRING_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_AS_LINESTRING_HPP - - -#ifdef BOOST_GEOMETRY_ADAPTED_C_ARRAY_AS_POINT_COLLECTION_TAG_DEFINED -#error Include either "c_array_as_linestring" or "c_array_as_ring" \ - or "c_array_as_multi_point" to adapt a c array -#endif - -#define BOOST_GEOMETRY_ADAPTED_C_ARRAY_AS_POINT_COLLECTION_TAG_DEFINED - - -#include <cstddef> - -#include <boost/geometry/core/tag.hpp> -#include <boost/geometry/core/tags.hpp> - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - - template <typename T, std::size_t PointCount, std::size_t DimensionCount> - struct tag< T[PointCount][DimensionCount] > - { - typedef linestring_tag type; - }; - -} // namespace traits -#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS - - -}} // namespace boost::geometry - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_AS_LINESTRING_HPP diff --git a/include/boost/geometry/geometries/adapted/c_array_as_ring.hpp b/include/boost/geometry/geometries/adapted/c_array_as_ring.hpp deleted file mode 100644 index 604da8e39..000000000 --- a/include/boost/geometry/geometries/adapted/c_array_as_ring.hpp +++ /dev/null @@ -1,51 +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_AS_RING_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_AS_RING_HPP - - -#ifdef BOOST_GEOMETRY_ADAPTED_C_ARRAY_AS_POINT_COLLECTION_TAG_DEFINED -#error Include either "c_array_as_linestring" or "c_array_as_ring" \ - or "c_array_as_multi_point" to adapt a c array -#endif - -#define BOOST_GEOMETRY_ADAPTED_C_ARRAY_AS_POINT_COLLECTION_TAG_DEFINED - - -#include <cstddef> - -#include <boost/geometry/core/tag.hpp> -#include <boost/geometry/core/tags.hpp> - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - - template <typename T, std::size_t PointCount, std::size_t DimensionCount> - struct tag< T[PointCount][DimensionCount] > - { - typedef ring_tag type; - }; - -} // namespace traits -#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS - - -}} // namespace boost::geometry - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_AS_RING_HPP diff --git a/include/boost/geometry/geometries/adapted/std_as_linestring.hpp b/include/boost/geometry/geometries/adapted/std_as_linestring.hpp deleted file mode 100644 index 8abf0a8bd..000000000 --- a/include/boost/geometry/geometries/adapted/std_as_linestring.hpp +++ /dev/null @@ -1,72 +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_STD_AS_LINESTRING_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_AS_LINESTRING_HPP - - -#ifdef BOOST_GEOMETRY_ADAPTED_STD_AS_POINT_COLLECTION_TAG_DEFINED -#error Include either "std_as_linestring" or "std_as_ring" \ - or "std_as_multi_point" to adapt the std:: containers -#endif - -#define BOOST_GEOMETRY_ADAPTED_STD_AS_POINT_COLLECTION_TAG_DEFINED - - -#include <vector> -#include <deque> -#include <list> -#include <utility> - - -#include <boost/geometry/core/access.hpp> -#include <boost/geometry/core/mutable_range.hpp> -#include <boost/geometry/core/tag.hpp> -#include <boost/geometry/core/tags.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace util -{ - struct std_as_linestring - { - typedef linestring_tag type; - }; - -} -#endif - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - // specialization for an iterator pair (read only) - template <typename P> struct tag< std::pair<P, P> > : util::std_as_linestring {}; - - // specializations for the std:: containers: vector, deque, list - template <typename P> struct tag< std::vector<P> > : util::std_as_linestring {}; - template <typename P> struct tag< std::deque<P> > : util::std_as_linestring {}; - template <typename P> struct tag< std::list<P> > : util::std_as_linestring {}; - -} -#endif - - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_AS_LINESTRING_HPP diff --git a/include/boost/geometry/geometries/adapted/std_as_ring.hpp b/include/boost/geometry/geometries/adapted/std_as_ring.hpp deleted file mode 100644 index 30b802430..000000000 --- a/include/boost/geometry/geometries/adapted/std_as_ring.hpp +++ /dev/null @@ -1,54 +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_STD_AS_RING_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_AS_RING_HPP - - -#ifdef BOOST_GEOMETRY_ADAPTED_STD_AS_POINT_COLLECTION_TAG_DEFINED -#error Include either "std_as_linestring" or "std_as_ring" \ - or "std_as_multi_point" to adapt the std:: containers -#endif - -#define BOOST_GEOMETRY_ADAPTED_STD_AS_POINT_COLLECTION_TAG_DEFINED - - -#include <vector> -#include <deque> -#include <list> -#include <utility> - -#include <boost/geometry/core/tags.hpp> - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - // specialization for an iterator pair - template <typename T> struct tag< std::pair<T, T> > { typedef ring_tag type; }; - - // specialization for the std:: containers: vector, deque, list - template <typename T> struct tag< std::vector<T> > { typedef ring_tag type; }; - template <typename T> struct tag< std::deque<T> > { typedef ring_tag type; }; - template <typename T> struct tag< std::list<T> > { typedef ring_tag type; }; -} -#endif - - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_AS_RING_HPP diff --git a/include/boost/geometry/geometries/geometries.hpp b/include/boost/geometry/geometries/geometries.hpp index fd766ff26..7488c29d8 100644 --- a/include/boost/geometry/geometries/geometries.hpp +++ b/include/boost/geometry/geometries/geometries.hpp @@ -14,16 +14,12 @@ #ifndef BOOST_GEOMETRY_GEOMETRIES_HPP #define BOOST_GEOMETRY_GEOMETRIES_HPP -#include <boost/geometry/geometries/adapted/c_array.hpp> -#include <boost/geometry/geometries/adapted/boost_tuple.hpp> - #include <boost/geometry/geometries/point.hpp> -#include <boost/geometry/geometries/point_xy.hpp> -#include <boost/geometry/geometries/ring.hpp> #include <boost/geometry/geometries/linestring.hpp> #include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/box.hpp> +#include <boost/geometry/geometries/ring.hpp> #include <boost/geometry/geometries/segment.hpp> #endif // BOOST_GEOMETRY_GEOMETRIES_HPP diff --git a/include/boost/geometry/geometry.hpp b/include/boost/geometry/geometry.hpp index c98be8904..694659785 100644 --- a/include/boost/geometry/geometry.hpp +++ b/include/boost/geometry/geometry.hpp @@ -65,14 +65,6 @@ #include <boost/geometry/algorithms/unique.hpp> #include <boost/geometry/algorithms/within.hpp> -// Include provided geometries -#include <boost/geometry/geometries/point.hpp> -#include <boost/geometry/geometries/linestring.hpp> -#include <boost/geometry/geometries/ring.hpp> -#include <boost/geometry/geometries/polygon.hpp> -#include <boost/geometry/geometries/segment.hpp> -#include <boost/geometry/geometries/box.hpp> - // Include multi a.o. because it can give weird effects // if you don't (e.g. area=0 of a multipolygon) #include <boost/geometry/multi/multi.hpp> diff --git a/include/boost/geometry/multi/geometries/adapted/boost_array_as_multi_point.hpp b/include/boost/geometry/multi/geometries/adapted/boost_array_as_multi_point.hpp deleted file mode 100644 index c840c9918..000000000 --- a/include/boost/geometry/multi/geometries/adapted/boost_array_as_multi_point.hpp +++ /dev/null @@ -1,56 +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_ADAPTED_BOOST_ARRAY_AS_MULTI_POINT_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ARRAY_AS_MULTI_POINT_HPP - - -#ifdef BOOST_GEOMETRY_ADAPTED_BOOST_ARRAY_TAG_DEFINED -#error Include either "boost_array_as_point" or \ - "boost_array_as_linestring" or "boost_array_as_ring" \ - or "boost_array_as_multi_point" to adapt a boost_array -#endif - -#define BOOST_GEOMETRY_ADAPTED_BOOST_ARRAY_TAG_DEFINED - - -#include <cstddef> - -#include <boost/array.hpp> - -#include <boost/geometry/core/tag.hpp> -#include <boost/geometry/multi/core/tags.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - - template <typename PointType, std::size_t DimensionCount> - struct tag< boost::array<PointType, DimensionCount> > - { - typedef multi_point_tag type; - }; - -} -#endif - - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ARRAY_AS_MULTI_POINT_HPP diff --git a/include/boost/geometry/multi/geometries/adapted/c_array_as_multi_point.hpp b/include/boost/geometry/multi/geometries/adapted/c_array_as_multi_point.hpp deleted file mode 100644 index 6cc5e2c22..000000000 --- a/include/boost/geometry/multi/geometries/adapted/c_array_as_multi_point.hpp +++ /dev/null @@ -1,51 +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_ADAPTED_C_ARRAY_AS_MULTI_POINT_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_AS_MULTI_POINT_HPP - - -#ifdef BOOST_GEOMETRY_ADAPTED_C_ARRAY_AS_POINT_COLLECTION_TAG_DEFINED -#error Include either "c_array_as_linestring" or "c_array_as_ring" \ - or "c_array_as_multi_point" to adapt a c array -#endif - -#define BOOST_GEOMETRY_ADAPTED_C_ARRAY_AS_POINT_COLLECTION_TAG_DEFINED - - -#include <cstddef> - -#include <boost/geometry/core/tag.hpp> -#include <boost/geometry/multi/core/tags.hpp> - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - - template <typename T, std::size_t PointCount, std::size_t DimensionCount> - struct tag< T[PointCount][DimensionCount] > - { - typedef multi_point_tag type; - }; - -} // namespace traits -#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS - - -}} // namespace boost::geometry - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_AS_MULTI_POINT_HPP diff --git a/include/boost/geometry/multi/geometries/adapted/std_as_multi_point.hpp b/include/boost/geometry/multi/geometries/adapted/std_as_multi_point.hpp deleted file mode 100644 index 171489f2a..000000000 --- a/include/boost/geometry/multi/geometries/adapted/std_as_multi_point.hpp +++ /dev/null @@ -1,71 +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_ADAPTED_STD_AS_MULTI_POINT_HPP -#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_AS_MULTI_POINT_HPP - - -#ifdef BOOST_GEOMETRY_ADAPTED_STD_AS_POINT_COLLECTION_TAG_DEFINED -#error Include either "std_as_linestring" or "std_as_ring" \ - or "std_as_multi_point" to adapt the std:: containers -#endif - -#define BOOST_GEOMETRY_ADAPTED_STD_AS_POINT_COLLECTION_TAG_DEFINED - - -#include <vector> -#include <deque> -#include <list> -#include <utility> - - -#include <boost/geometry/core/access.hpp> -#include <boost/geometry/core/tag.hpp> -#include <boost/geometry/core/tags.hpp> - - -namespace boost { namespace geometry -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace util -{ - struct std_as_multi_point - { - typedef multi_point_tag type; - }; - -} -#endif - - -#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS -namespace traits -{ - // specialization for an iterator pair (read only) - template <typename P> struct tag< std::pair<P, P> > : util::std_as_multi_point {}; - - // specializations for the std:: containers: vector, deque, list - template <typename P> struct tag< std::vector<P> > : util::std_as_multi_point {}; - template <typename P> struct tag< std::deque<P> > : util::std_as_multi_point {}; - template <typename P> struct tag< std::list<P> > : util::std_as_multi_point {}; - -} -#endif - - -}} // namespace boost::geometry - - -#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_AS_MULTI_POINT_HPP diff --git a/include/boost/geometry/multi/multi.hpp b/include/boost/geometry/multi/multi.hpp index 87373cf10..b80a15112 100644 --- a/include/boost/geometry/multi/multi.hpp +++ b/include/boost/geometry/multi/multi.hpp @@ -58,9 +58,6 @@ #include <boost/geometry/multi/algorithms/detail/overlay/get_turns.hpp> #include <boost/geometry/multi/algorithms/detail/overlay/self_turn_points.hpp> -#include <boost/geometry/multi/geometries/multi_point.hpp> -#include <boost/geometry/multi/geometries/multi_linestring.hpp> -#include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <boost/geometry/multi/geometries/concepts/check.hpp> #include <boost/geometry/multi/geometries/concepts/multi_point_concept.hpp> #include <boost/geometry/multi/geometries/concepts/multi_linestring_concept.hpp> diff --git a/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp b/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp index 0d89c735f..bf1e7716e 100644 --- a/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp +++ b/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp @@ -15,18 +15,17 @@ #include <boost/geometry/algorithms/distance.hpp> #include <boost/geometry/arithmetic/arithmetic.hpp> -#include <boost/geometry/geometries/point.hpp> #include <boost/geometry/util/select_most_precise.hpp> #include <boost/geometry/strategies/centroid.hpp> #include <boost/geometry/strategies/default_distance_result.hpp> +// Helper geometry +#include <boost/geometry/geometries/point.hpp> + namespace boost { namespace geometry { -// Note: when calling the namespace "centroid", it sometimes, -// somehow, in gcc, gives compilation problems (confusion with function centroid). - namespace strategy { namespace centroid { diff --git a/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp b/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp index 52eb4bd69..4378949ea 100644 --- a/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp @@ -33,11 +33,8 @@ #include <boost/geometry/util/select_coordinate_type.hpp> - - -// Helper geometries +// Helper geometry (projected point on line) #include <boost/geometry/geometries/point.hpp> -#include <boost/geometry/geometries/segment.hpp> namespace boost { namespace geometry diff --git a/include/boost/geometry/util/math.hpp b/include/boost/geometry/util/math.hpp index 20f304bbc..edd9ab0d3 100644 --- a/include/boost/geometry/util/math.hpp +++ b/include/boost/geometry/util/math.hpp @@ -32,27 +32,31 @@ namespace detail { -template <typename T, bool Floating> +template <typename Type, bool IsFloatingPoint> struct equals { - static inline bool apply(T const& a, T const& b) + static inline bool apply(Type const& a, Type const& b) { return a == b; } }; -template <typename T> -struct equals<T, true> +template <typename Type> +struct equals<Type, true> { - static inline bool apply(T const& a, T const& b) + static inline bool apply(Type const& a, Type const& b) { // See http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.17, // FUTURE: replace by some boost tool or boost::test::close_at_tolerance - return std::abs(a - b) <= std::numeric_limits<T>::epsilon() * std::abs(a); + return std::abs(a - b) <= std::numeric_limits<Type>::epsilon() * std::abs(a); } }; +template <typename Type, bool IsFloatingPoint> +struct equals_with_epsilon : public equals<Type, IsFloatingPoint> {}; + + /*! \brief Short construct to enable partial specialization for PI, currently not possible in Math. */ @@ -101,6 +105,18 @@ inline bool equals(T1 const& a, T2 const& b) >::apply(a, b); } +template <typename T1, typename T2> +inline bool equals_with_epsilon(T1 const& a, T2 const& b) +{ + typedef typename select_most_precise<T1, T2>::type select_type; + return detail::equals_with_epsilon + < + select_type, + boost::is_floating_point<select_type>::type::value + >::apply(a, b); +} + + double const d2r = geometry::math::pi<double>() / 180.0; double const r2d = 1.0 / d2r; diff --git a/include/boost/geometry/views/box_view.hpp b/include/boost/geometry/views/box_view.hpp index da5e03ac7..15cc8f9c8 100644 --- a/include/boost/geometry/views/box_view.hpp +++ b/include/boost/geometry/views/box_view.hpp @@ -27,9 +27,20 @@ namespace boost { namespace geometry /*! -\brief Range, walking over the four points of a box -\tparam Box box type +\brief Makes a box behave like a ring or a range +\details Adapts a box to the Boost.Range concept, enabling the user to iterating + box corners. The box_view is registered as a Ring Concept +\tparam Box \tparam_geometry{Box} +\tparam Clockwise If true, walks in clockwise direction, otherwise + it walks in counterclockwise direction \ingroup views + +\qbk{before.synopsis, +[heading Model of] +[link geometry.reference.concepts.concept_ring Ring Concept] +} + +\qbk{[include reference/views/box_view.qbk]} */ template <typename Box, bool Clockwise = true> struct box_view @@ -41,6 +52,7 @@ struct box_view { typedef typename geometry::point_type<Box>::type point_type; + /// Constructor accepting the box to adapt explicit box_view(Box const& box) : detail::points_view<point_type, 5>(copy_policy(box)) {} @@ -60,7 +72,7 @@ private : points[4] = points[0]; } private : - Box m_box; + Box const& m_box; }; }; @@ -71,11 +83,26 @@ private : // All views on boxes are handled as rings namespace traits { - template<typename Box, bool Clockwise> - struct tag<box_view<Box, Clockwise> > - { - typedef ring_tag type; - }; + +template<typename Box, bool Clockwise> +struct tag<box_view<Box, Clockwise> > +{ + typedef ring_tag type; +}; + +template<typename Box> +struct point_order<box_view<Box, false> > +{ + static order_selector const value = counterclockwise; +}; + + +template<typename Box> +struct point_order<box_view<Box, true> > +{ + static order_selector const value = clockwise; +}; + } #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS diff --git a/include/boost/geometry/views/closeable_view.hpp b/include/boost/geometry/views/closeable_view.hpp index 407f93485..00ff06e67 100644 --- a/include/boost/geometry/views/closeable_view.hpp +++ b/include/boost/geometry/views/closeable_view.hpp @@ -41,7 +41,6 @@ struct closing_view : m_range(r) {} - typedef closing_iterator<Range> iterator; typedef closing_iterator<Range const> const_iterator; @@ -60,9 +59,16 @@ private : /*! -\brief View on a range, either closing or not closing -\tparam Range original range -\tparam Close specifying if it should be closed or not +\brief View on a range, either closing it or leaving it as it is +\details The closeable_view is used internally by the library to handle all rings, + either closed or open, the same way. The default method is closed, all + algorithms process rings as if they are closed. Therefore, if they are opened, + a view is created which closes them. + The closeable_view might be used by library users, but its main purpose is + internally. +\tparam Range Original range +\tparam Close Specifies if it the range is closed, if so, nothing will happen. + If it is open, it will iterate the first point after the last point. \ingroup views */ template <typename Range, closure_selector Close> diff --git a/include/boost/geometry/views/segment_view.hpp b/include/boost/geometry/views/segment_view.hpp index be1f6b92f..11984d4d9 100644 --- a/include/boost/geometry/views/segment_view.hpp +++ b/include/boost/geometry/views/segment_view.hpp @@ -27,9 +27,19 @@ namespace boost { namespace geometry /*! -\brief Range, walking over the two points of a segment -\tparam Segment segment type +\brief Makes a segment behave like a linestring or a range +\details Adapts a segment to the Boost.Range concept, enabling the user to + iterate the two segment points. The segment_view is registered as a LineString Concept +\tparam Segment \tparam_geometry{Segment} \ingroup views + +\qbk{before.synopsis, +[heading Model of] +[link geometry.reference.concepts.concept_linestring LineString Concept] +} + +\qbk{[include reference/views/segment_view.qbk]} + */ template <typename Segment> struct segment_view @@ -41,6 +51,7 @@ struct segment_view { typedef typename geometry::point_type<Segment>::type point_type; + /// Constructor accepting the segment to adapt explicit segment_view(Segment const& segment) : detail::points_view<point_type, 2>(copy_policy(segment)) {} @@ -60,7 +71,7 @@ private : geometry::detail::assign_point_from_index<1>(m_segment, points[1]); } private : - Segment m_segment; + Segment const& m_segment; }; }; @@ -71,11 +82,13 @@ private : // All segment ranges can be handled as linestrings namespace traits { - template<typename Segment> - struct tag<segment_view<Segment> > - { - typedef linestring_tag type; - }; + +template<typename Segment> +struct tag<segment_view<Segment> > +{ + typedef linestring_tag type; +}; + } #endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS diff --git a/test/algorithms/append.cpp b/test/algorithms/append.cpp index f16d8a3c3..bed436076 100644 --- a/test/algorithms/append.cpp +++ b/test/algorithms/append.cpp @@ -24,12 +24,14 @@ #include <boost/geometry/algorithms/append.hpp> #include <boost/geometry/algorithms/num_points.hpp> #include <boost/geometry/geometries/geometries.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> -#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp> +#include <boost/geometry/geometries/register/linestring.hpp> #include <test_common/test_point.hpp> #include <test_geometries/wrapped_boost_array.hpp> +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + template <typename G> void test_geometry(bool check = true) @@ -77,8 +79,6 @@ void test_all() test_geometry<std::vector<P> >(); test_geometry<std::deque<P> >(); //test_geometry<std::list<P> >(); - - test_geometry<test::wrapped_boost_array<P, 3> >(); } int test_main(int, char* []) diff --git a/test/algorithms/area.cpp b/test/algorithms/area.cpp index c3d56a63e..4ed4e7009 100644 --- a/test/algorithms/area.cpp +++ b/test/algorithms/area.cpp @@ -17,6 +17,7 @@ #include <algorithms/test_area.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/point.hpp> #include <boost/geometry/geometries/box.hpp> #include <boost/geometry/geometries/ring.hpp> diff --git a/test/algorithms/centroid.cpp b/test/algorithms/centroid.cpp index fab082b06..4781c6c6a 100644 --- a/test/algorithms/centroid.cpp +++ b/test/algorithms/centroid.cpp @@ -15,6 +15,7 @@ #include <algorithms/test_centroid.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> diff --git a/test/algorithms/convex_hull.cpp b/test/algorithms/convex_hull.cpp index d520a9afc..f36e15391 100644 --- a/test/algorithms/convex_hull.cpp +++ b/test/algorithms/convex_hull.cpp @@ -18,6 +18,7 @@ #include <algorithms/test_convex_hull.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> template <typename P> diff --git a/test/algorithms/detail/partition.cpp b/test/algorithms/detail/partition.cpp index 11c689943..339e93605 100644 --- a/test/algorithms/detail/partition.cpp +++ b/test/algorithms/detail/partition.cpp @@ -12,6 +12,7 @@ #include <boost/geometry/geometry.hpp> #include <boost/geometry/multi/geometries/multi_point.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/register/point.hpp> #include <boost/geometry/algorithms/detail/partition.hpp> diff --git a/test/algorithms/detail/sections/range_by_section.cpp b/test/algorithms/detail/sections/range_by_section.cpp index 920e95e82..f0643f929 100644 --- a/test/algorithms/detail/sections/range_by_section.cpp +++ b/test/algorithms/detail/sections/range_by_section.cpp @@ -17,6 +17,7 @@ #include <boost/geometry/algorithms/detail/sections/range_by_section.hpp> #include <boost/geometry/views/detail/range_type.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> diff --git a/test/algorithms/detail/sections/sectionalize.cpp b/test/algorithms/detail/sections/sectionalize.cpp index 7071e051e..a52d5b2ef 100644 --- a/test/algorithms/detail/sections/sectionalize.cpp +++ b/test/algorithms/detail/sections/sectionalize.cpp @@ -22,9 +22,11 @@ #include <boost/geometry/algorithms/num_points.hpp> #include <boost/geometry/algorithms/detail/sections/sectionalize.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp> #include <boost/geometry/domains/gis/io/wkt/write_wkt.hpp> + #include <test_common/test_point.hpp> #if defined(TEST_WITH_SVG) diff --git a/test/algorithms/difference.cpp b/test/algorithms/difference.cpp index c1564d20b..7787dea3d 100644 --- a/test/algorithms/difference.cpp +++ b/test/algorithms/difference.cpp @@ -23,6 +23,8 @@ #include <boost/geometry/multi/algorithms/intersection.hpp> #include <boost/geometry/multi/algorithms/within.hpp> +#include <boost/geometry/geometries/point_xy.hpp> + //#include <boost/geometry/extensions/gis/io/wkb/read_wkb.hpp> //#include <boost/geometry/extensions/gis/io/wkb/utility.hpp> diff --git a/test/algorithms/disjoint.cpp b/test/algorithms/disjoint.cpp index 4e326236b..08084eca9 100644 --- a/test/algorithms/disjoint.cpp +++ b/test/algorithms/disjoint.cpp @@ -20,6 +20,7 @@ #include <boost/geometry/algorithms/disjoint.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp> #include <boost/geometry/strategies/strategies.hpp> diff --git a/test/algorithms/distance.cpp b/test/algorithms/distance.cpp index bce602e41..53dc4a7a2 100644 --- a/test/algorithms/distance.cpp +++ b/test/algorithms/distance.cpp @@ -19,9 +19,10 @@ #include <algorithms/test_distance.hpp> #include <boost/mpl/if.hpp> +#include <boost/array.hpp> #include <boost/geometry/geometries/geometries.hpp> -#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> @@ -32,6 +33,16 @@ BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) +// Register boost array as a linestring +namespace boost { namespace geometry { namespace traits +{ +template <typename Point, std::size_t PointCount> +struct tag< boost::array<Point, PointCount> > +{ + typedef linestring_tag type; +}; + +}}} template <typename P> void test_distance_point() diff --git a/test/algorithms/envelope.cpp b/test/algorithms/envelope.cpp index 3896b34b3..27d5f578a 100644 --- a/test/algorithms/envelope.cpp +++ b/test/algorithms/envelope.cpp @@ -16,6 +16,7 @@ #include <algorithms/test_envelope.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> #include <boost/geometry/geometries/adapted/std_pair_as_segment.hpp> diff --git a/test/algorithms/equals.cpp b/test/algorithms/equals.cpp index 989489a74..7faedb766 100644 --- a/test/algorithms/equals.cpp +++ b/test/algorithms/equals.cpp @@ -8,6 +8,7 @@ #include <algorithms/test_equals.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> @@ -20,15 +21,13 @@ void test_all() typedef bg::model::polygon<P> polygon; typedef bg::model::linestring<P> linestring; + std::string case_p1 = "POLYGON((0 0,0 2,2 2,0 0))"; test_geometry<P, P>("p1", "POINT(1 1)", "POINT(1 1)", true); test_geometry<P, P>("p2", "POINT(1 1)", "POINT(1 2)", false); test_geometry<box, box>("b1", "BOX(1 1,2 2)", "BOX(1 2,2 2)", false); test_geometry<box, box>("b1", "BOX(1 2,3 4)", "BOX(1 2,3 4)", true); - - std::string case_p1 = "POLYGON((0 0,0 2,2 2,0 0))"; - // Completely equal test_geometry<ring, ring>("poly_eq", case_p1, case_p1, true); @@ -38,7 +37,14 @@ void test_all() // Extra coordinate test_geometry<ring, ring>("poly_extra", case_p1, "POLYGON((0 0,0 2,2 2,1 1,0 0))", true); - // Degenerate points + + // Shifted + extra (redundant) coordinate + test_geometry<ring, ring>("poly_shifted_extra1", "POLYGON((2 2,1 1,0 0,0 2,2 2))", case_p1, true); + + // Shifted + extra (redundant) coordinate being first/last point + test_geometry<ring, ring>("poly_shifted_extra2", "POLYGON((1 1,0 0,0 2,2 2,1 1))", case_p1, true); + + // Degenerate (duplicate) points test_geometry<ring, ring>("poly_degenerate", "POLYGON((0 0,0 2,2 2,2 2,0 0))", "POLYGON((0 0,0 2,0 2,2 2,0 0))", true); // Two different bends, same area, unequal @@ -95,10 +101,56 @@ void test_all() } +template <typename T> +void verify() +{ + T dxn1, dyn1, dxn2, dyn2; + + { + T x1 = "0", y1 = "0", x2 = "3", y2 = "3"; + T dx = x2 - x1, dy = y2 - y1; + T mag = sqrt(dx * dx + dy * dy); + dxn1 = dx / mag; + dyn1 = dy / mag; + } + + { + T x1 = "0", y1 = "0", x2 = "1", y2 = "1"; + T dx = x2 - x1, dy = y2 - y1; + T mag = sqrt(dx * dx + dy * dy); + dxn2 = dx / mag; + dyn2 = dy / mag; + } + + if (dxn1 == dxn2 && dyn1 == dyn2) + { + //std::cout << "vectors are equal, using ==" << std::endl; + } + if (boost::geometry::math::equals(dxn1, dxn2) + && boost::geometry::math::equals(dyn1, dyn2)) + { + //std::cout << "vectors are equal, using bg::math::equals" << std::endl; + } + + bool equals = boost::geometry::math::equals_with_epsilon(dxn1, dxn2) + && boost::geometry::math::equals_with_epsilon(dyn1, dyn2); + + if (equals) + { + //std::cout << "vectors are equal, using bg::math::equals_with_epsilon" << std::endl; + } + + BOOST_CHECK_EQUAL(equals, true); +} int test_main( int , char* [] ) { + //verify<double>(); +#if defined(HAVE_TTMATH) + verify<ttmath_big>(); +#endif + test_all<bg::model::d2::point_xy<int> >(); test_all<bg::model::d2::point_xy<double> >(); diff --git a/test/algorithms/intersection.cpp b/test/algorithms/intersection.cpp index 1e8814d4d..c4d9ec5c3 100644 --- a/test/algorithms/intersection.cpp +++ b/test/algorithms/intersection.cpp @@ -23,12 +23,16 @@ #include <algorithms/test_intersection.hpp> #include <algorithms/test_overlay.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/register/linestring.hpp> #include <test_common/test_point.hpp> #include <test_common/with_pointer.hpp> #include <test_geometries/custom_segment.hpp> +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) + + static std::string pie_2_3_23_0[2] = { "POLYGON((2500 2500,2855 3828,2500 3875,2500 2500))", diff --git a/test/algorithms/intersects.cpp b/test/algorithms/intersects.cpp index 769827c46..4e71452f2 100644 --- a/test/algorithms/intersects.cpp +++ b/test/algorithms/intersects.cpp @@ -9,6 +9,7 @@ #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> template <typename P> diff --git a/test/algorithms/length.cpp b/test/algorithms/length.cpp index 1700881e4..151703758 100644 --- a/test/algorithms/length.cpp +++ b/test/algorithms/length.cpp @@ -10,6 +10,7 @@ #include <algorithms/test_length.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/std_pair_as_segment.hpp> #include <test_geometries/all_custom_linestring.hpp> diff --git a/test/algorithms/overlaps.cpp b/test/algorithms/overlaps.cpp index d49404e99..5eff2e12b 100644 --- a/test/algorithms/overlaps.cpp +++ b/test/algorithms/overlaps.cpp @@ -9,6 +9,7 @@ #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> template <typename P> diff --git a/test/algorithms/overlay/assemble.cpp b/test/algorithms/overlay/assemble.cpp index a566bfc95..638b7e571 100644 --- a/test/algorithms/overlay/assemble.cpp +++ b/test/algorithms/overlay/assemble.cpp @@ -24,6 +24,7 @@ #include <boost/geometry/algorithms/within.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/strategies/strategies.hpp> diff --git a/test/algorithms/overlay/ccw_traverse.cpp b/test/algorithms/overlay/ccw_traverse.cpp index ffd74e39f..82f9d3b1e 100644 --- a/test/algorithms/overlay/ccw_traverse.cpp +++ b/test/algorithms/overlay/ccw_traverse.cpp @@ -16,6 +16,7 @@ #include <geometry_test_common.hpp> #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> #if defined(TEST_WITH_SVG) diff --git a/test/algorithms/overlay/dissolver.cpp b/test/algorithms/overlay/dissolver.cpp index 2c298dc59..00b9ac87f 100644 --- a/test/algorithms/overlay/dissolver.cpp +++ b/test/algorithms/overlay/dissolver.cpp @@ -16,6 +16,7 @@ #include <boost/geometry/algorithms/detail/overlay/dissolver.hpp> #include <boost/geometry/strategies/strategies.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/multi.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/read_wkt_multi.hpp> diff --git a/test/algorithms/overlay/get_turn_info.cpp b/test/algorithms/overlay/get_turn_info.cpp index 757bbcc0b..c2c5baa18 100644 --- a/test/algorithms/overlay/get_turn_info.cpp +++ b/test/algorithms/overlay/get_turn_info.cpp @@ -816,8 +816,6 @@ void test_all() /*** -#include <boost/geometry/geometries/adapted/c_array_as_linestring.hpp> -#include <boost/geometry/geometries/adapted/c_array_as_ring.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) diff --git a/test/algorithms/overlay/relative_order.cpp b/test/algorithms/overlay/relative_order.cpp index 5101347d6..b8b7ec798 100644 --- a/test/algorithms/overlay/relative_order.cpp +++ b/test/algorithms/overlay/relative_order.cpp @@ -20,6 +20,8 @@ #include <boost/geometry/algorithms/detail/overlay/get_turn_info.hpp> #include <boost/geometry/algorithms/detail/overlay/get_relative_order.hpp> +#include <boost/geometry/geometries/point_xy.hpp> + #if defined(TEST_WITH_SVG) # include <boost/geometry/extensions/io/svg/svg_mapper.hpp> #endif diff --git a/test/algorithms/overlay/robustness/random_ellipses_stars.cpp b/test/algorithms/overlay/robustness/random_ellipses_stars.cpp index 40d7f7a55..94ce0239b 100644 --- a/test/algorithms/overlay/robustness/random_ellipses_stars.cpp +++ b/test/algorithms/overlay/robustness/random_ellipses_stars.cpp @@ -29,6 +29,8 @@ #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> + struct star_params { diff --git a/test/algorithms/overlay/robustness/recursive_polygons.cpp b/test/algorithms/overlay/robustness/recursive_polygons.cpp index 9153170d2..e861ceb7f 100644 --- a/test/algorithms/overlay/robustness/recursive_polygons.cpp +++ b/test/algorithms/overlay/robustness/recursive_polygons.cpp @@ -28,6 +28,7 @@ #include <boost/geometry/geometry.hpp> #include <boost/geometry/multi/multi.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> #include <boost/geometry/extensions/io/svg/svg_mapper.hpp> diff --git a/test/algorithms/overlay/robustness/star_comb.cpp b/test/algorithms/overlay/robustness/star_comb.cpp index 445270997..bef2284fb 100644 --- a/test/algorithms/overlay/robustness/star_comb.cpp +++ b/test/algorithms/overlay/robustness/star_comb.cpp @@ -30,6 +30,7 @@ #include <boost/geometry/geometry.hpp> #include <boost/geometry/multi/multi.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> #include <boost/geometry/extensions/io/svg/svg_mapper.hpp> diff --git a/test/algorithms/overlay/robustness/test_overlay_p_q.hpp b/test/algorithms/overlay/robustness/test_overlay_p_q.hpp index 2607113f5..5252506c0 100644 --- a/test/algorithms/overlay/robustness/test_overlay_p_q.hpp +++ b/test/algorithms/overlay/robustness/test_overlay_p_q.hpp @@ -25,6 +25,8 @@ #include <boost/geometry/geometry.hpp> #include <boost/geometry/multi/multi.hpp> +#include <boost/geometry/multi/geometries/multi_polygon.hpp> + #include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> diff --git a/test/algorithms/overlay/select_rings.cpp b/test/algorithms/overlay/select_rings.cpp index e547b8a1a..e9dcad5e7 100644 --- a/test/algorithms/overlay/select_rings.cpp +++ b/test/algorithms/overlay/select_rings.cpp @@ -15,6 +15,9 @@ #include <boost/geometry/algorithms/detail/overlay/select_rings.hpp> #include <boost/geometry/algorithms/detail/overlay/assign_parents.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/geometries/polygon.hpp> + #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp> #include <boost/assign/list_of.hpp> diff --git a/test/algorithms/overlay/self_intersection_points.cpp b/test/algorithms/overlay/self_intersection_points.cpp index 7425ec4ac..abdcdea8f 100644 --- a/test/algorithms/overlay/self_intersection_points.cpp +++ b/test/algorithms/overlay/self_intersection_points.cpp @@ -24,6 +24,8 @@ //#include <boost/geometry/algorithms/detail/overlay/self_intersection_points.hpp> #include <boost/geometry/algorithms/detail/overlay/self_turn_points.hpp> +#include <boost/geometry/geometries/point_xy.hpp> + #include <boost/geometry/strategies/strategies.hpp> #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp> diff --git a/test/algorithms/overlay/split_rings.cpp b/test/algorithms/overlay/split_rings.cpp index 9495a9b35..229649fbb 100644 --- a/test/algorithms/overlay/split_rings.cpp +++ b/test/algorithms/overlay/split_rings.cpp @@ -21,6 +21,8 @@ #include <boost/geometry/algorithms/detail/overlay/split_rings.hpp> #include <boost/geometry/algorithms/area.hpp> +#include <boost/geometry/geometries/point_xy.hpp> + #include <boost/geometry/strategies/strategies.hpp> #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp> diff --git a/test/algorithms/overlay/traverse_gmp.cpp b/test/algorithms/overlay/traverse_gmp.cpp index 58cbd4ef3..b8d6a4272 100644 --- a/test/algorithms/overlay/traverse_gmp.cpp +++ b/test/algorithms/overlay/traverse_gmp.cpp @@ -30,6 +30,7 @@ #include <boost/geometry/geometry.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/algorithms/detail/overlay/turn_info.hpp> #include <boost/geometry/algorithms/detail/overlay/enrichment_info.hpp> diff --git a/test/algorithms/perimeter.cpp b/test/algorithms/perimeter.cpp index 66fdbfcb4..c564d9765 100644 --- a/test/algorithms/perimeter.cpp +++ b/test/algorithms/perimeter.cpp @@ -9,6 +9,7 @@ #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <algorithms/test_perimeter.hpp> diff --git a/test/algorithms/reverse.cpp b/test/algorithms/reverse.cpp index 509ecbd81..777401461 100644 --- a/test/algorithms/reverse.cpp +++ b/test/algorithms/reverse.cpp @@ -10,6 +10,7 @@ #include <algorithms/test_reverse.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <test_common/test_point.hpp> #include <test_geometries/all_custom_linestring.hpp> diff --git a/test/algorithms/simplify.cpp b/test/algorithms/simplify.cpp index bebdd6d9d..2555a638e 100644 --- a/test/algorithms/simplify.cpp +++ b/test/algorithms/simplify.cpp @@ -17,7 +17,7 @@ #include <algorithms/test_simplify.hpp> #include <boost/geometry/geometries/geometries.hpp> - +#include <boost/geometry/geometries/point_xy.hpp> #include <test_geometries/wrapped_boost_array.hpp> #include <test_common/test_point.hpp> diff --git a/test/algorithms/transform.cpp b/test/algorithms/transform.cpp index af8ba28c7..c8b02e394 100644 --- a/test/algorithms/transform.cpp +++ b/test/algorithms/transform.cpp @@ -22,6 +22,7 @@ #include <boost/geometry/algorithms/transform.hpp> #include <boost/geometry/strategies/strategies.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/util/write_dsv.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> diff --git a/test/algorithms/union.cpp b/test/algorithms/union.cpp index 6f150232c..95d079f1b 100644 --- a/test/algorithms/union.cpp +++ b/test/algorithms/union.cpp @@ -23,6 +23,7 @@ #include <algorithms/test_overlay.hpp> #include <algorithms/overlay/overlay_cases.hpp> +#include <boost/geometry/geometries/point_xy.hpp> static std::string javier4[2] = { diff --git a/test/algorithms/unique.cpp b/test/algorithms/unique.cpp index 1446bc713..02900f8a5 100644 --- a/test/algorithms/unique.cpp +++ b/test/algorithms/unique.cpp @@ -10,6 +10,7 @@ #include <algorithms/test_unique.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> diff --git a/test/algorithms/within.cpp b/test/algorithms/within.cpp index 9020c364d..ad59f4d78 100644 --- a/test/algorithms/within.cpp +++ b/test/algorithms/within.cpp @@ -9,6 +9,7 @@ #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> template <typename P> diff --git a/test/core/coordinate_dimension.cpp b/test/core/coordinate_dimension.cpp index 70e819ccf..b27eda624 100644 --- a/test/core/coordinate_dimension.cpp +++ b/test/core/coordinate_dimension.cpp @@ -19,8 +19,7 @@ #include <boost/geometry/geometries/adapted/c_array.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> -#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> +#include <boost/geometry/geometries/register/linestring.hpp> #include <vector> #include <deque> @@ -28,6 +27,9 @@ BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + template <typename G, int Expected> void test_geometry() @@ -49,8 +51,6 @@ void test_all() test_geometry<std::vector<P>, D>(); test_geometry<std::deque<P>, D>(); - - test_geometry<boost::array<P, 5>, D>(); } int test_main(int, char* []) diff --git a/test/core/coordinate_system.cpp b/test/core/coordinate_system.cpp index fd2afd490..161fa525e 100644 --- a/test/core/coordinate_system.cpp +++ b/test/core/coordinate_system.cpp @@ -19,8 +19,7 @@ #include <boost/geometry/geometries/adapted/c_array.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> -#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> +#include <boost/geometry/geometries/register/linestring.hpp> #include <vector> #include <deque> @@ -28,6 +27,9 @@ BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + template <typename G, typename Expected> void test_geometry() @@ -50,8 +52,6 @@ void test_all() test_geometry<std::vector<P>, Expected>(); test_geometry<std::deque<P>, Expected>(); - - test_geometry<boost::array<P, 5>, Expected>(); } int test_main(int, char* []) diff --git a/test/core/coordinate_type.cpp b/test/core/coordinate_type.cpp index aa9fb752a..e35f829d6 100644 --- a/test/core/coordinate_type.cpp +++ b/test/core/coordinate_type.cpp @@ -19,8 +19,7 @@ #include <boost/geometry/geometries/adapted/c_array.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> -#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> +#include <boost/geometry/geometries/register/linestring.hpp> #include <vector> #include <deque> @@ -28,6 +27,9 @@ BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + template <typename G, typename Expected> void test_geometry() @@ -50,8 +52,6 @@ void test_all() test_geometry<std::vector<P>, Expected>(); test_geometry<std::deque<P>, Expected>(); - - test_geometry<boost::array<P, 5>, Expected>(); } int test_main(int, char* []) diff --git a/test/core/geometry_id.cpp b/test/core/geometry_id.cpp index bfb65d967..ac93d3f84 100644 --- a/test/core/geometry_id.cpp +++ b/test/core/geometry_id.cpp @@ -18,8 +18,7 @@ #include <boost/geometry/geometries/adapted/c_array.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> -#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> +#include <boost/geometry/geometries/register/linestring.hpp> #include <vector> #include <deque> @@ -27,6 +26,9 @@ BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + template <typename G, int Expected> void test_geometry() @@ -48,8 +50,6 @@ void test_all() test_geometry<std::vector<P>, 2>(); test_geometry<std::deque<P>, 2>(); - - test_geometry<boost::array<P, 5>, 2>(); } int test_main(int, char* []) diff --git a/test/core/point_type.cpp b/test/core/point_type.cpp index 1a4dd9855..93b269383 100644 --- a/test/core/point_type.cpp +++ b/test/core/point_type.cpp @@ -18,8 +18,7 @@ #include <boost/geometry/geometries/adapted/c_array.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> -#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> +#include <boost/geometry/geometries/register/linestring.hpp> #include <vector> #include <deque> @@ -27,6 +26,9 @@ BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + template <typename G, typename Expected> void test_geometry() @@ -49,8 +51,6 @@ void test_all() test_geometry<std::vector<P>, P>(); test_geometry<std::deque<P>, P>(); - - test_geometry<boost::array<P, 5>, P>(); } int test_main(int, char* []) diff --git a/test/core/tag.cpp b/test/core/tag.cpp index 1a6759238..c33eefa9f 100644 --- a/test/core/tag.cpp +++ b/test/core/tag.cpp @@ -17,8 +17,7 @@ #include <boost/geometry/geometries/adapted/c_array.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> -#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> +#include <boost/geometry/geometries/register/linestring.hpp> #include <vector> #include <deque> @@ -26,6 +25,9 @@ BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + template <typename G, typename Expected> void test_geometry() @@ -49,7 +51,6 @@ void test_all() test_geometry<std::vector<P>, bg::linestring_tag>(); test_geometry<std::deque<P>, bg::linestring_tag>(); - test_geometry<boost::array<P, 5>, bg::linestring_tag>(); } int test_main(int, char* []) diff --git a/test/core/topological_dimension.cpp b/test/core/topological_dimension.cpp index 53b0ac4e8..40cd06d4e 100644 --- a/test/core/topological_dimension.cpp +++ b/test/core/topological_dimension.cpp @@ -14,11 +14,10 @@ #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/register/linestring.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> -#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> #include <vector> #include <deque> @@ -26,6 +25,9 @@ BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + template <typename G, int Expected> void test_geometry() @@ -48,7 +50,6 @@ void test_all() test_geometry<std::vector<P>, 1>(); test_geometry<std::deque<P>, 1>(); - test_geometry<boost::array<P, 5>, 1>(); } int test_main(int, char* []) diff --git a/test/geometries/adapted.cpp b/test/geometries/adapted.cpp index 4bf8158e6..2b5099e9b 100644 --- a/test/geometries/adapted.cpp +++ b/test/geometries/adapted.cpp @@ -15,41 +15,42 @@ #include <boost/geometry/geometries/geometries.hpp> #include <boost/geometry/multi/multi.hpp> +#include <boost/geometry/geometries/adapted/c_array.hpp> +#include <boost/geometry/geometries/adapted/boost_tuple.hpp> + +#include <test_common/test_point.hpp> + #define BOOST_GEOMETRY_TEST_RING #if defined(BOOST_GEOMETRY_TEST_RING) - #include <boost/geometry/geometries/concepts/ring_concept.hpp> - - #include <boost/geometry/geometries/adapted/boost_array_as_ring.hpp> - #include <boost/geometry/geometries/adapted/c_array_as_ring.hpp> - #include <boost/geometry/geometries/adapted/std_as_ring.hpp> + #include <boost/geometry/geometries/register/ring.hpp> + #include <boost/geometry/geometries/concepts/ring_concept.hpp> + BOOST_GEOMETRY_REGISTER_RING_TEMPLATED(std::vector) + BOOST_GEOMETRY_REGISTER_RING_TEMPLATED(std::deque) + #elif defined(BOOST_GEOMETRY_TEST_MULTI_POINT) - #include <boost/geometry/multi/geometries/concepts/multi_point_concept.hpp> - - #include <boost/geometry/multi/geometries/adapted/boost_array_as_multi_point.hpp> - #include <boost/geometry/multi/geometries/adapted/c_array_as_multi_point.hpp> - #include <boost/geometry/multi/geometries/adapted/std_as_multi_point.hpp> - + #include <boost/geometry/multi/geometries/register/multi_point.hpp> + #include <boost/geometry/multi/geometries/concepts/multi_point_concept.hpp> + BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED(std::vector) + BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED(std::deque) + #else - #include <boost/geometry/geometries/concepts/linestring_concept.hpp> - #include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp> - #include <boost/geometry/geometries/adapted/c_array_as_linestring.hpp> - #include <boost/geometry/geometries/adapted/std_as_linestring.hpp> + #include <boost/geometry/geometries/register/linestring.hpp> + #include <boost/geometry/geometries/concepts/linestring_concept.hpp> + + BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) + BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + #endif -#include <boost/geometry/geometries/adapted/c_array.hpp> -#include <boost/geometry/geometries/adapted/boost_tuple.hpp> - -#include <test_common/test_point.hpp> - BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) @@ -82,16 +83,14 @@ void test_all() test_geometry(std::deque<P>()); //test_geometry(std::list<P>()); - - test_geometry(boost::array<P, 5>(), 5); - - + /*** double vertices[][3] = { {-1, -1, 1}, {1, -1, 1}, {1, 1, 1}, {-1, 1, 1}, {-1, -1, -1}, {1, -1, -1}, {1, 1, -1}, {-1, 1, -1} }; test_geometry(vertices, 8); + ***/ } int test_main(int, char* []) diff --git a/test/geometries/boost_polygon.cpp b/test/geometries/boost_polygon.cpp index b8c614b0e..7be6452aa 100644 --- a/test/geometries/boost_polygon.cpp +++ b/test/geometries/boost_polygon.cpp @@ -11,11 +11,19 @@ #include <boost/geometry/geometry.hpp> + +#include <boost/geometry/geometries/box.hpp> +#include <boost/geometry/geometries/point.hpp> +#include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/geometries/ring.hpp> + #include <boost/geometry/geometries/adapted/boost_polygon/point.hpp> #include <boost/geometry/geometries/adapted/boost_polygon/box.hpp> #include <boost/geometry/geometries/adapted/boost_polygon/ring.hpp> #include <boost/geometry/geometries/adapted/boost_polygon/polygon.hpp> + #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> + #include <iostream> template <typename T> diff --git a/test/geometries/boost_polygon_overlay.cpp b/test/geometries/boost_polygon_overlay.cpp index d18e2a472..1d15a0a9b 100644 --- a/test/geometries/boost_polygon_overlay.cpp +++ b/test/geometries/boost_polygon_overlay.cpp @@ -11,6 +11,7 @@ #include <boost/geometry/geometry.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/boost_polygon/point.hpp> #include <boost/geometry/geometries/adapted/boost_polygon/box.hpp> #include <boost/geometry/geometries/adapted/boost_polygon/ring.hpp> diff --git a/test/geometries/boost_range.cpp b/test/geometries/boost_range.cpp index 50cc43c88..541b81ef4 100644 --- a/test/geometries/boost_range.cpp +++ b/test/geometries/boost_range.cpp @@ -13,6 +13,7 @@ #include <boost/geometry/geometry.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/boost_range/adjacent_filtered.hpp> #include <boost/geometry/geometries/adapted/boost_range/filtered.hpp> #include <boost/geometry/geometries/adapted/boost_range/reversed.hpp> diff --git a/test/geometries/custom_linestring.cpp b/test/geometries/custom_linestring.cpp index fbd4ab072..9b222e39b 100644 --- a/test/geometries/custom_linestring.cpp +++ b/test/geometries/custom_linestring.cpp @@ -25,8 +25,7 @@ #include <boost/geometry/geometries/geometries.hpp> -#include <boost/geometry/geometries/adapted/boost_array_as_linestring.hpp> -#include <boost/geometry/geometries/adapted/std_as_linestring.hpp> +#include <boost/geometry/geometries/register/linestring.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> #include <test_common/test_point.hpp> @@ -34,6 +33,9 @@ BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) +BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) + //#define TEST_FAIL_CLEAR //#define TEST_FAIL_APPEND diff --git a/test/iterators/closing_iterator.cpp b/test/iterators/closing_iterator.cpp index 9b3db2b5a..da4ed95c5 100644 --- a/test/iterators/closing_iterator.cpp +++ b/test/iterators/closing_iterator.cpp @@ -24,6 +24,7 @@ #include <boost/geometry/core/coordinate_type.hpp> #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> // The closing iterator should also work on normal std:: containers diff --git a/test/iterators/ever_circling_iterator.cpp b/test/iterators/ever_circling_iterator.cpp index b68d35a64..6bbb49c28 100644 --- a/test/iterators/ever_circling_iterator.cpp +++ b/test/iterators/ever_circling_iterator.cpp @@ -22,6 +22,7 @@ #include <boost/geometry/core/coordinate_type.hpp> #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> template <typename G> void test_geometry(std::string const& wkt) diff --git a/test/multi/algorithms/multi_area.cpp b/test/multi/algorithms/multi_area.cpp index bf5b13c1e..1dd13b283 100644 --- a/test/multi/algorithms/multi_area.cpp +++ b/test/multi/algorithms/multi_area.cpp @@ -11,6 +11,8 @@ #include <boost/geometry/multi/multi.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> diff --git a/test/multi/algorithms/multi_centroid.cpp b/test/multi/algorithms/multi_centroid.cpp index dc58bef3c..2606f687f 100644 --- a/test/multi/algorithms/multi_centroid.cpp +++ b/test/multi/algorithms/multi_centroid.cpp @@ -20,6 +20,7 @@ #include <boost/geometry/multi/strategies/cartesian/centroid_average.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/geometries/multi_point.hpp> #include <boost/geometry/multi/geometries/multi_linestring.hpp> diff --git a/test/multi/algorithms/multi_convex_hull.cpp b/test/multi/algorithms/multi_convex_hull.cpp index c649c0b90..e0e669bf9 100644 --- a/test/multi/algorithms/multi_convex_hull.cpp +++ b/test/multi/algorithms/multi_convex_hull.cpp @@ -19,6 +19,7 @@ #include <algorithms/test_convex_hull.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp> diff --git a/test/multi/algorithms/multi_difference.cpp b/test/multi/algorithms/multi_difference.cpp index e93a9f4af..fe6a8fcd7 100644 --- a/test/multi/algorithms/multi_difference.cpp +++ b/test/multi/algorithms/multi_difference.cpp @@ -21,6 +21,7 @@ #include <boost/geometry/multi/algorithms/intersection.hpp> #include <boost/geometry/multi/algorithms/within.hpp> // only for testing #77 +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/geometries/multi_point.hpp> #include <boost/geometry/multi/geometries/multi_linestring.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> diff --git a/test/multi/algorithms/multi_distance.cpp b/test/multi/algorithms/multi_distance.cpp index 702f0347f..e47168496 100644 --- a/test/multi/algorithms/multi_distance.cpp +++ b/test/multi/algorithms/multi_distance.cpp @@ -23,6 +23,7 @@ #include <boost/geometry/domains/gis/io/wkt/read_wkt_multi.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> #include <test_common/test_point.hpp> diff --git a/test/multi/algorithms/multi_envelope.cpp b/test/multi/algorithms/multi_envelope.cpp index c84ea9e82..31f69a3d4 100644 --- a/test/multi/algorithms/multi_envelope.cpp +++ b/test/multi/algorithms/multi_envelope.cpp @@ -24,6 +24,7 @@ #include <boost/geometry/domains/gis/io/wkt/read_wkt_multi.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/c_array.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> #include <test_common/test_point.hpp> diff --git a/test/multi/algorithms/multi_equals.cpp b/test/multi/algorithms/multi_equals.cpp index 95eb3a05b..f84451dce 100644 --- a/test/multi/algorithms/multi_equals.cpp +++ b/test/multi/algorithms/multi_equals.cpp @@ -8,9 +8,11 @@ #include <algorithms/test_equals.hpp> +#include <boost/geometry/multi/algorithms/area.hpp> #include <boost/geometry/multi/algorithms/equals.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <boost/geometry/domains/gis/io/wkt/read_wkt_multi.hpp> diff --git a/test/multi/algorithms/multi_for_each.cpp b/test/multi/algorithms/multi_for_each.cpp index b5fd7d566..c47f6d23b 100644 --- a/test/multi/algorithms/multi_for_each.cpp +++ b/test/multi/algorithms/multi_for_each.cpp @@ -16,6 +16,7 @@ #include <boost/geometry/geometries/ring.hpp> #include <boost/geometry/geometries/linestring.hpp> #include <boost/geometry/geometries/point.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/multi/geometries/multi_point.hpp> diff --git a/test/multi/algorithms/multi_intersection.cpp b/test/multi/algorithms/multi_intersection.cpp index 087b9f791..be8821cd5 100644 --- a/test/multi/algorithms/multi_intersection.cpp +++ b/test/multi/algorithms/multi_intersection.cpp @@ -20,6 +20,7 @@ #include <boost/geometry/multi/algorithms/intersection.hpp> #include <boost/geometry/multi/algorithms/within.hpp> // only for testing #77 +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/geometries/multi_point.hpp> #include <boost/geometry/multi/geometries/multi_linestring.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> diff --git a/test/multi/algorithms/multi_length.cpp b/test/multi/algorithms/multi_length.cpp index 65ee8621e..5618cfff2 100644 --- a/test/multi/algorithms/multi_length.cpp +++ b/test/multi/algorithms/multi_length.cpp @@ -11,6 +11,8 @@ #include <boost/geometry/multi/multi.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> +#include <boost/geometry/multi/geometries/multi_linestring.hpp> #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> diff --git a/test/multi/algorithms/multi_num_geometries.cpp b/test/multi/algorithms/multi_num_geometries.cpp index e2bd8798e..54dacb648 100644 --- a/test/multi/algorithms/multi_num_geometries.cpp +++ b/test/multi/algorithms/multi_num_geometries.cpp @@ -13,6 +13,7 @@ #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/geometries/multi_point.hpp> #include <boost/geometry/multi/geometries/multi_linestring.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> diff --git a/test/multi/algorithms/multi_num_interior_rings.cpp b/test/multi/algorithms/multi_num_interior_rings.cpp index eb56e6c9e..4350fafbf 100644 --- a/test/multi/algorithms/multi_num_interior_rings.cpp +++ b/test/multi/algorithms/multi_num_interior_rings.cpp @@ -13,6 +13,7 @@ #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/geometries/multi_point.hpp> #include <boost/geometry/multi/geometries/multi_linestring.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> diff --git a/test/multi/algorithms/multi_num_points.cpp b/test/multi/algorithms/multi_num_points.cpp index 6bc95d01d..6109cd80e 100644 --- a/test/multi/algorithms/multi_num_points.cpp +++ b/test/multi/algorithms/multi_num_points.cpp @@ -13,6 +13,7 @@ #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/geometries/multi_point.hpp> #include <boost/geometry/multi/geometries/multi_linestring.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> diff --git a/test/multi/algorithms/multi_perimeter.cpp b/test/multi/algorithms/multi_perimeter.cpp index 1cc823f32..a075a90ba 100644 --- a/test/multi/algorithms/multi_perimeter.cpp +++ b/test/multi/algorithms/multi_perimeter.cpp @@ -12,6 +12,7 @@ #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> diff --git a/test/multi/algorithms/multi_reverse.cpp b/test/multi/algorithms/multi_reverse.cpp index 301be3fdb..82ec7d55e 100644 --- a/test/multi/algorithms/multi_reverse.cpp +++ b/test/multi/algorithms/multi_reverse.cpp @@ -13,6 +13,7 @@ #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/geometries/multi_point.hpp> #include <boost/geometry/multi/geometries/multi_linestring.hpp> diff --git a/test/multi/algorithms/multi_simplify.cpp b/test/multi/algorithms/multi_simplify.cpp index 816fe3faa..09a836178 100644 --- a/test/multi/algorithms/multi_simplify.cpp +++ b/test/multi/algorithms/multi_simplify.cpp @@ -17,6 +17,8 @@ #include <boost/geometry/geometries/point.hpp> #include <boost/geometry/geometries/polygon.hpp> +#include <boost/geometry/geometries/point_xy.hpp> + #include <boost/geometry/multi/geometries/multi_point.hpp> #include <boost/geometry/multi/geometries/multi_linestring.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> diff --git a/test/multi/algorithms/multi_transform.cpp b/test/multi/algorithms/multi_transform.cpp index ebc58cb0d..5f79f9606 100644 --- a/test/multi/algorithms/multi_transform.cpp +++ b/test/multi/algorithms/multi_transform.cpp @@ -20,6 +20,7 @@ #include <boost/geometry/algorithms/transform.hpp> #include <boost/geometry/strategies/strategies.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/algorithms/transform.hpp> diff --git a/test/multi/algorithms/multi_union.cpp b/test/multi/algorithms/multi_union.cpp index 498602346..0a8a2fd9a 100644 --- a/test/multi/algorithms/multi_union.cpp +++ b/test/multi/algorithms/multi_union.cpp @@ -19,6 +19,7 @@ #include <boost/geometry/multi/algorithms/intersection.hpp> #include <boost/geometry/multi/algorithms/within.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/geometries/multi_linestring.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> diff --git a/test/multi/algorithms/multi_unique.cpp b/test/multi/algorithms/multi_unique.cpp index a6a127adf..a0aee93d2 100644 --- a/test/multi/algorithms/multi_unique.cpp +++ b/test/multi/algorithms/multi_unique.cpp @@ -13,6 +13,7 @@ #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/geometries/multi_point.hpp> #include <boost/geometry/multi/geometries/multi_linestring.hpp> diff --git a/test/multi/algorithms/multi_within.cpp b/test/multi/algorithms/multi_within.cpp index 9c02145bd..a3815b686 100644 --- a/test/multi/algorithms/multi_within.cpp +++ b/test/multi/algorithms/multi_within.cpp @@ -18,6 +18,7 @@ #include <boost/geometry/multi/core/point_order.hpp> #include <boost/geometry/multi/algorithms/within.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/multi/geometries/multi_polygon.hpp> #include <algorithms/test_within.hpp> diff --git a/test/ttmath.vsprops b/test/ttmath.vsprops index 2ff29bfdd..e01e29698 100644 --- a/test/ttmath.vsprops +++ b/test/ttmath.vsprops @@ -7,7 +7,6 @@ <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories=""$(TTMATH_ROOT)";"../$(TTMATH_ROOT)";"../../$(TTMATH_ROOT)"" - PreprocessorDefinitions="HAVE_TTMATH" /> <UserMacro Name="TTMATH_ROOT" diff --git a/test/views/box_view.cpp b/test/views/box_view.cpp index 610804f4d..2efe01442 100644 --- a/test/views/box_view.cpp +++ b/test/views/box_view.cpp @@ -22,18 +22,19 @@ template <typename Box, bool Reverse> -void test_geometry(std::string const& wkt, std::string const& expected) +void test_geometry(std::string const& wkt, std::string const& expected, + bg::order_selector expected_order) { Box box; bg::read_wkt(wkt, box); - typedef bg::box_view<Box, Reverse> range_type; - range_type range(box); + typedef bg::box_view<Box, Reverse> view_type; + view_type range(box); { std::ostringstream out; - for (typename boost::range_iterator<range_type>::type it = boost::begin(range); + for (typename boost::range_iterator<view_type>::type it = boost::begin(range); it != boost::end(range); ++it) { out << " " << bg::get<0>(*it) << bg::get<1>(*it); @@ -43,7 +44,7 @@ void test_geometry(std::string const& wkt, std::string const& expected) { // Check forward/backward behaviour - typename boost::range_iterator<range_type>::type it = boost::begin(range); + typename boost::range_iterator<view_type>::type it = boost::begin(range); it++; it--; // Not verified further, same as segment @@ -56,16 +57,20 @@ void test_geometry(std::string const& wkt, std::string const& expected) } // Check Boost.Range concept - BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<range_type>) ); + BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<view_type>) ); + + // Check order + bg::order_selector order = bg::point_order<view_type>::value; + BOOST_CHECK_EQUAL(order, expected_order); } template <typename P> void test_all() { - test_geometry<bg::model::box<P>, true> ("polygon((1 1,2 2))", " 11 12 22 21 11"); - test_geometry<bg::model::box<P>, false>("polygon((1 1,2 2))", " 11 21 22 12 11"); - test_geometry<bg::model::box<P>, true> ("polygon((3 3,5 5))", " 33 35 55 53 33"); + test_geometry<bg::model::box<P>, true> ("polygon((1 1,2 2))", " 11 12 22 21 11", bg::clockwise); + test_geometry<bg::model::box<P>, false>("polygon((1 1,2 2))", " 11 21 22 12 11", bg::counterclockwise); + test_geometry<bg::model::box<P>, true> ("polygon((3 3,5 5))", " 33 35 55 53 33", bg::clockwise); } diff --git a/test/views/closeable_view.cpp b/test/views/closeable_view.cpp index 991836eac..96849f7e4 100644 --- a/test/views/closeable_view.cpp +++ b/test/views/closeable_view.cpp @@ -19,6 +19,7 @@ #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp> #include <boost/geometry/util/write_dsv.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); diff --git a/test/views/reversible_closeable.cpp b/test/views/reversible_closeable.cpp index 87e0dc38d..6d4b11880 100644 --- a/test/views/reversible_closeable.cpp +++ b/test/views/reversible_closeable.cpp @@ -21,6 +21,7 @@ #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp> #include <boost/geometry/util/write_dsv.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); diff --git a/test/views/reversible_view.cpp b/test/views/reversible_view.cpp index 42ae5c339..ea124781b 100644 --- a/test/views/reversible_view.cpp +++ b/test/views/reversible_view.cpp @@ -19,6 +19,7 @@ #include <boost/geometry/domains/gis/io/wkt/wkt.hpp> #include <boost/geometry/util/write_dsv.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/geometries/adapted/boost_tuple.hpp> BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian); diff --git a/test/views/segment_view.cpp b/test/views/segment_view.cpp index a56188771..5761da996 100644 --- a/test/views/segment_view.cpp +++ b/test/views/segment_view.cpp @@ -15,6 +15,7 @@ #include <geometry_test_common.hpp> #include <boost/geometry/geometries/geometries.hpp> +#include <boost/geometry/geometries/point_xy.hpp> #include <boost/geometry/views/segment_view.hpp> #include <boost/geometry/domains/gis/io/wkt/read_wkt.hpp>