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

-BOOST_GEOMETRY_REGISTER_RING_TEMPLATIZED(triangle) +// Register triangle

as a ring +namespace boost { namespace geometry { +template struct tag > { typedef ring_tag type; } +}} namespace boost { namespace geometry { namespace dispatch { diff --git a/test/test_geometries/custom_segment.hpp b/test/test_geometries/custom_segment.hpp index 413138a63..a0d43ed53 100644 --- a/test/test_geometries/custom_segment.hpp +++ b/test/test_geometries/custom_segment.hpp @@ -51,7 +51,7 @@ struct custom_segment_4 BOOST_GEOMETRY_REGISTER_POINT_2D(test::custom_point_for_segment, double, cs::cartesian, x, y) BOOST_GEOMETRY_REGISTER_SEGMENT(test::custom_segment, test::custom_point_for_segment, one, two) -BOOST_GEOMETRY_REGISTER_SEGMENT_TEMPLATIZED(test::custom_segment_of, p1, p2) +BOOST_GEOMETRY_REGISTER_SEGMENT_TEMPLATED(test::custom_segment_of, p1, p2) BOOST_GEOMETRY_REGISTER_SEGMENT_2D_4VALUES(test::custom_segment_4, test::custom_point_for_segment, a, b, c, d)