From f4e8438ccb9fa408be42912937376916c2dfef85 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sat, 16 Apr 2011 17:58:34 +0000 Subject: [PATCH] Doc update (metafunctions coordinate type, system, dimensions, point_order, closure, tags degree/radian, constans min_corner, max_corner) [SVN r71324] --- doc/doxy/Doxyfile | 3 ++ doc/imports.qbk | 8 ++++ doc/make_qbk.py | 3 +- doc/quickref.xml | 13 ++--- doc/reference.qbk | 16 +++---- doc/reference/core/closure.qbk | 23 +++++++++ doc/reference/core/coordinate_dimension.qbk | 16 +++++++ doc/reference/core/coordinate_system.qbk | 16 +++++++ doc/reference/core/coordinate_type.qbk | 16 +++++++ doc/reference/core/degree_radian.qbk | 14 ++++++ doc/reference/core/max_corner.qbk | 26 ++++++++++ doc/reference/core/min_corner.qbk | 25 ++++++++++ doc/reference/core/min_max_corner.qbk | 31 ++++++++++++ doc/reference/core/point_order.qbk | 24 ++++++++++ doc/src/examples/algorithms/convert.cpp | 2 +- doc/src/examples/core/Jamfile.v2 | 7 +++ doc/src/examples/core/closure.cpp | 42 +++++++++++++++++ .../examples/core/coordinate_dimension.cpp | 43 +++++++++++++++++ doc/src/examples/core/coordinate_system.cpp | 38 +++++++++++++++ doc/src/examples/core/coordinate_type.cpp | 38 +++++++++++++++ doc/src/examples/core/degree_radian.cpp | 47 +++++++++++++++++++ doc/src/examples/core/point_order.cpp | 42 +++++++++++++++++ 22 files changed, 473 insertions(+), 20 deletions(-) create mode 100644 doc/reference/core/closure.qbk create mode 100644 doc/reference/core/coordinate_dimension.qbk create mode 100644 doc/reference/core/coordinate_system.qbk create mode 100644 doc/reference/core/coordinate_type.qbk create mode 100644 doc/reference/core/degree_radian.qbk create mode 100644 doc/reference/core/max_corner.qbk create mode 100644 doc/reference/core/min_corner.qbk create mode 100644 doc/reference/core/min_max_corner.qbk create mode 100644 doc/reference/core/point_order.qbk create mode 100644 doc/src/examples/core/closure.cpp create mode 100644 doc/src/examples/core/coordinate_dimension.cpp create mode 100644 doc/src/examples/core/coordinate_system.cpp create mode 100644 doc/src/examples/core/coordinate_type.cpp create mode 100644 doc/src/examples/core/degree_radian.cpp create mode 100644 doc/src/examples/core/point_order.cpp diff --git a/doc/doxy/Doxyfile b/doc/doxy/Doxyfile index 22d7a0a3b..7c34fb5e0 100644 --- a/doc/doxy/Doxyfile +++ b/doc/doxy/Doxyfile @@ -50,6 +50,7 @@ ALIASES = qbk{1}="\xmlonly \1 \endxmlonly" \ brief_macro{1}="Macro to register a \1" \ brief_macro_const=" (const version)" \ brief_macro_getset=" (having separate get/set methods)" \ + brief_meta{3}="Metafunction defining [*\1] as the specified \2 of the \3" \ tparam_allocator="container-allocator-type" \ tparam_box="Any type fulfilling a Box Concept" \ tparam_box_or_segment="Any type fulfilling a Box Concept or a Segment Concept" \ @@ -107,6 +108,8 @@ ALIASES = qbk{1}="\xmlonly \1 \endxmlonly" \ return_check{1}="Returns true if the geometry \1" \ return_check2{1}="Returns true if two geometries \1" \ return_out="The output iterator" \ + meta_geometry_type="specified geometry type" \ + meta_point_type="point type making up the specified geometry type" \ brf_for_each{1}="Applies function [*f] to each \1" \ det_envelope="envelope (also known as axis aligned bounding box, aabb, or minimum bounding rectangle, mbr)" \ det_buffer="buffer (a polygon being the spatial point set collection within a specified maximum distance from a geometry)" \ diff --git a/doc/imports.qbk b/doc/imports.qbk index 291fd788a..357a79055 100644 --- a/doc/imports.qbk +++ b/doc/imports.qbk @@ -57,9 +57,17 @@ [import src/examples/algorithms/unique.cpp] [import src/examples/algorithms/within.cpp] +[import src/examples/core/coordinate_type.cpp] +[import src/examples/core/coordinate_system.cpp] +[import src/examples/core/coordinate_dimension.cpp] +[import src/examples/core/point_order.cpp] +[import src/examples/core/closure.cpp] + [import src/examples/core/get_point.cpp] [import src/examples/core/get_box.cpp] [import src/examples/core/set_point.cpp] [import src/examples/core/set_box.cpp] +[import src/examples/core/degree_radian.cpp] + [import src/examples/geometries/point.cpp] [import src/examples/geometries/register/point.cpp] diff --git a/doc/make_qbk.py b/doc/make_qbk.py index 5401471b7..3442616b5 100755 --- a/doc/make_qbk.py +++ b/doc/make_qbk.py @@ -82,7 +82,8 @@ coordinate_systems = ["cartesian", "geographic", "polar", "spherical"] core = ["closure", "coordinate_system", "coordinate_type", "cs_tag" , "dimension", "exception", "geometry_id", "interior_type" - , "is_areal", "is_linear", "is_radian", "point_order" + , "degree", "radian" + , "is_radian", "point_order" , "point_type", "ring_type", "tag", "topological_dimension" ] exceptions = ["exception", "centroid_exception"]; diff --git a/doc/quickref.xml b/doc/quickref.xml index 366404959..676f0eaa5 100644 --- a/doc/quickref.xml +++ b/doc/quickref.xml @@ -138,16 +138,11 @@ dimension geometry_id interior_type - is_radian point_order point_type ring_type tag @@ -194,8 +189,8 @@ Numeric - max_corner - min_corner + max_corner + min_corner order_selector closure_selector @@ -203,8 +198,8 @@ Types - degree - radian + degree + radian diff --git a/doc/reference.qbk b/doc/reference.qbk index 8bdd22ac2..945a17ddc 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -129,7 +129,6 @@ [include generated/transform.qbk] [endsect] - [/section:union union] [include generated/union.qbk] [/endsect] @@ -142,13 +141,10 @@ [endsect] [/algorithms] - [section:arithmetic Arithmetic] [include generated/arithmetic.qbk] [endsect] - - [section:concepts Concepts] [include concept/point.qbk] [include concept/linestring.qbk] @@ -161,34 +157,36 @@ [include concept/segment.qbk] [endsect] [/concepts] +[section:constants Constants] +[include reference/core/min_corner.qbk] +[include reference/core/max_corner.qbk] +[endsect] + [section:cs Coordinate Systems] [include generated/cartesian.qbk] [include generated/spherical.qbk] [include generated/geographic.qbk] [endsect] [/coordinate systems] - - [section:core Core Metafunctions] [include generated/closure.qbk] [include generated/coordinate_system.qbk] [include generated/coordinate_type.qbk] [include generated/cs_tag.qbk] +[include generated/degree.qbk] [include generated/dimension.qbk] [include generated/exception.qbk] [include generated/geometry_id.qbk] [include generated/interior_type.qbk] -[include generated/is_areal.qbk] -[include generated/is_linear.qbk] [include generated/is_radian.qbk] [include generated/point_order.qbk] [include generated/point_type.qbk] +[include generated/radian.qbk] [include generated/ring_type.qbk] [include generated/tag.qbk] [include generated/topological_dimension.qbk] [endsect] [/core metafunctions] - [section:enumerations Enumerations] [include generated/enum.qbk] [endsect] diff --git a/doc/reference/core/closure.qbk b/doc/reference/core/closure.qbk new file mode 100644 index 000000000..76db82a75 --- /dev/null +++ b/doc/reference/core/closure.qbk @@ -0,0 +1,23 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[note The closure is defined for any geometry type, but only has a real meaning + for areal geometry types (ring, polygon, multi_polygon) +] + +[heading Complexity] +Compile time + +[heading Example] +[closure] +[closure_output] + +[heading See also] +* [link geometry.reference.enumerations.closure_selector The closure_selector enumeration] diff --git a/doc/reference/core/coordinate_dimension.qbk b/doc/reference/core/coordinate_dimension.qbk new file mode 100644 index 000000000..4b599defe --- /dev/null +++ b/doc/reference/core/coordinate_dimension.qbk @@ -0,0 +1,16 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[heading Complexity] +Compile time + +[heading Example] +[dimension] +[dimension_output] diff --git a/doc/reference/core/coordinate_system.qbk b/doc/reference/core/coordinate_system.qbk new file mode 100644 index 000000000..8d636c39f --- /dev/null +++ b/doc/reference/core/coordinate_system.qbk @@ -0,0 +1,16 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[heading Complexity] +Compile time + +[heading Example] +[coordinate_system] +[coordinate_system_output] diff --git a/doc/reference/core/coordinate_type.qbk b/doc/reference/core/coordinate_type.qbk new file mode 100644 index 000000000..49df07d3d --- /dev/null +++ b/doc/reference/core/coordinate_type.qbk @@ -0,0 +1,16 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[heading Complexity] +Compile time + +[heading Example] +[coordinate_type] +[coordinate_type_output] diff --git a/doc/reference/core/degree_radian.qbk b/doc/reference/core/degree_radian.qbk new file mode 100644 index 000000000..cf4990b35 --- /dev/null +++ b/doc/reference/core/degree_radian.qbk @@ -0,0 +1,14 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + + +[heading example] +[degree_radian] +[degree_radian_output] \ No newline at end of file diff --git a/doc/reference/core/max_corner.qbk b/doc/reference/core/max_corner.qbk new file mode 100644 index 000000000..fabe2ab20 --- /dev/null +++ b/doc/reference/core/max_corner.qbk @@ -0,0 +1,26 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[section:max_corner max_corner] + +Indicates the maximal corner (upper right) of a box to be get, set or processed + +[heading Synopsis] +`` int const max_corner = 1; `` + +[include reference/core/min_max_corner.qbk] + +[heading See also] +* [link geometry.reference.constants.min_corner min_corner] +* [link geometry.reference.access.get.get_2_with_index get with index] +* [link geometry.reference.access.set.set_3_with_index set with index] + +[endsect] + diff --git a/doc/reference/core/min_corner.qbk b/doc/reference/core/min_corner.qbk new file mode 100644 index 000000000..eacb918b3 --- /dev/null +++ b/doc/reference/core/min_corner.qbk @@ -0,0 +1,25 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[section:min_corner min_corner] + +Indicates the minimal corner (lower left) of a box to be get, set or processed + +[heading Synopsis] +`` int const min_corner = 0; `` + +[include reference/core/min_max_corner.qbk] + +[heading See also] +* [link geometry.reference.constants.max_corner max_corner] +* [link geometry.reference.access.get.get_2_with_index get with index] +* [link geometry.reference.access.set.set_3_with_index set with index] + +[endsect] diff --git a/doc/reference/core/min_max_corner.qbk b/doc/reference/core/min_max_corner.qbk new file mode 100644 index 000000000..118b0fbca --- /dev/null +++ b/doc/reference/core/min_max_corner.qbk @@ -0,0 +1,31 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[/File included by min_corner.qbk and max_corner.qbk] + +[heading Header] +Either + +`#include ` + +Or + +`#include ` + +[note min_corner and max_corner are only applicable for boxes and not for, + e.g., a segment] +[note min_corner should be the minimal corner of a box, but that is not + guaranteed. Use correct to make min_corner the minimal corner. + The same applies for max_corner.] + +[/Share sample with get_box] +[heading Example] +[get_box] +[get_box_output] diff --git a/doc/reference/core/point_order.qbk b/doc/reference/core/point_order.qbk new file mode 100644 index 000000000..775ede73c --- /dev/null +++ b/doc/reference/core/point_order.qbk @@ -0,0 +1,24 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[note The point order is defined for any geometry type, but only has a real meaning + for areal geometry types (ring, polygon, multi_polygon) +] + +[heading Complexity] +Compile time + +[heading Example] +[point_order] +[point_order_output] + +[heading See also] +* [link geometry.reference.enumerations.order_selector The order_selector enumeration] + diff --git a/doc/src/examples/algorithms/convert.cpp b/doc/src/examples/algorithms/convert.cpp index 2617eeaa7..5b6e377e1 100644 --- a/doc/src/examples/algorithms/convert.cpp +++ b/doc/src/examples/algorithms/convert.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include int main() diff --git a/doc/src/examples/core/Jamfile.v2 b/doc/src/examples/core/Jamfile.v2 index 9575b21cc..9609b3820 100644 --- a/doc/src/examples/core/Jamfile.v2 +++ b/doc/src/examples/core/Jamfile.v2 @@ -17,3 +17,10 @@ exe get_point : get_point.cpp ; exe get_box : get_box.cpp ; exe set_point : set_point.cpp ; exe set_box : set_box.cpp ; +exe degree_radian : degree_radian.cpp ; + +exe coordinate_type : coordinate_type.cpp ; +exe coordinate_system : coordinate_system.cpp ; +exe coordinate_dimension : coordinate_dimension.cpp ; +exe point_order : point_order.cpp ; +exe closure : closure.cpp ; diff --git a/doc/src/examples/core/closure.cpp b/doc/src/examples/core/closure.cpp new file mode 100644 index 000000000..47c40adcc --- /dev/null +++ b/doc/src/examples/core/closure.cpp @@ -0,0 +1,42 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//[closure +//` Examine if a polygon is defined as "should be closed" + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + + boost::geometry::closure_selector clos = boost::geometry::closure::value; + + std::cout << "closure: " << clos << std::endl + << "(open = " << boost::geometry::open + << ", closed = " << boost::geometry::closed + << ") "<< std::endl; + + return 0; +} + +//] + + +//[closure_output +/*` +Output: +[pre +closure: 1 +(open = 0, closed = 1) +] +*/ +//] diff --git a/doc/src/examples/core/coordinate_dimension.cpp b/doc/src/examples/core/coordinate_dimension.cpp new file mode 100644 index 000000000..5061c46ce --- /dev/null +++ b/doc/src/examples/core/coordinate_dimension.cpp @@ -0,0 +1,43 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//[dimension +//` Examine the number of coordinates making up the points in a linestring type + +#include +#include +#include +#include + +int main() +{ + int dim = boost::geometry::dimension + < + std::vector + < + boost::tuple + > + >::value; + + std::cout << "dimensions: " << dim << std::endl; + + return 0; +} + +//] + + +//[dimension_output +/*` +Output: +[pre +dimensions: 3 +] +*/ +//] diff --git a/doc/src/examples/core/coordinate_system.cpp b/doc/src/examples/core/coordinate_system.cpp new file mode 100644 index 000000000..48375c364 --- /dev/null +++ b/doc/src/examples/core/coordinate_system.cpp @@ -0,0 +1,38 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//[coordinate_system +//` Examine the coordinate system of a point + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + + typedef boost::geometry::coordinate_system::type system; + + std::cout << "system: " << typeid(system).name() << std::endl; + + return 0; +} + +//] + + +//[coordinate_system_output +/*` +Output (using MSVC): +[pre +system: struct boost::geometry::cs::cartesian +] +*/ +//] diff --git a/doc/src/examples/core/coordinate_type.cpp b/doc/src/examples/core/coordinate_type.cpp new file mode 100644 index 000000000..263398bea --- /dev/null +++ b/doc/src/examples/core/coordinate_type.cpp @@ -0,0 +1,38 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//[coordinate_type +//` Examine the coordinate type of a point + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + + typedef boost::geometry::coordinate_type::type ctype; + + std::cout << "type: " << typeid(ctype).name() << std::endl; + + return 0; +} + +//] + + +//[coordinate_type_output +/*` +Output (using MSVC): +[pre +type: double +] +*/ +//] diff --git a/doc/src/examples/core/degree_radian.cpp b/doc/src/examples/core/degree_radian.cpp new file mode 100644 index 000000000..3b8411068 --- /dev/null +++ b/doc/src/examples/core/degree_radian.cpp @@ -0,0 +1,47 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//[degree_radian +//` Specify two coordinate systems, one in degrees, one in radians. + +#include +#include + +using namespace boost::geometry; + +int main() +{ + typedef model::point > degree_point; + typedef model::point > radian_point; + + degree_point d(4.893, 52.373); + radian_point r(0.041, 0.8527); + + double dist = distance(d, r); + std::cout + << "distance:" << std::endl + << dist << " over unit sphere" << std::endl + << dist * 3959 << " over a spherical earth, in miles" << std::endl; + + return 0; +} + +//] + + +//[degree_radian_output +/*` +Output: +[pre +distance: +0.0675272 over unit sphere +267.34 over a spherical earth, in miles +] +*/ +//] diff --git a/doc/src/examples/core/point_order.cpp b/doc/src/examples/core/point_order.cpp new file mode 100644 index 000000000..34e371209 --- /dev/null +++ b/doc/src/examples/core/point_order.cpp @@ -0,0 +1,42 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//[point_order +//` Examine the expected point order of a polygon type + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + + boost::geometry::order_selector order = boost::geometry::point_order::value; + + std::cout << "order: " << order << std::endl + << "(clockwise = " << boost::geometry::clockwise + << ", counterclockwise = " << boost::geometry::counterclockwise + << ") "<< std::endl; + + return 0; +} + +//] + + +//[point_order_output +/*` +Output: +[pre +order: 2 +(clockwise = 1, counterclockwise = 2) +] +*/ +//]