Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71422 - in trunk/libs/geometry/doc: . concept reference/core reference/geometries/adapted src/examples/core src/examples/geometries/adapted src/examples/geometries/register
From: barend.gehrels_at_[hidden]
Date: 2011-04-22 18:26:41


Author: barendgehrels
Date: 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
New Revision: 71422
URL: http://svn.boost.org/trac/boost/changeset/71422

Log:
Updated many docs, added many samples
Added:
   trunk/libs/geometry/doc/reference/core/interior_type.qbk (contents, props changed)
   trunk/libs/geometry/doc/reference/core/ring_type.qbk (contents, props changed)
   trunk/libs/geometry/doc/reference/geometries/adapted/
   trunk/libs/geometry/doc/reference/geometries/adapted/boost_array.qbk (contents, props changed)
   trunk/libs/geometry/doc/reference/geometries/adapted/boost_fusion.qbk (contents, props changed)
   trunk/libs/geometry/doc/reference/geometries/adapted/boost_polygon.qbk (contents, props changed)
   trunk/libs/geometry/doc/reference/geometries/adapted/boost_tuple.qbk (contents, props changed)
   trunk/libs/geometry/doc/reference/geometries/adapted/c_array.qbk (contents, props changed)
   trunk/libs/geometry/doc/src/examples/core/interior_type.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/core/ring_type.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/geometries/adapted/
   trunk/libs/geometry/doc/src/examples/geometries/adapted/Jamfile.v2 (contents, props changed)
   trunk/libs/geometry/doc/src/examples/geometries/adapted/boost_array.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/geometries/adapted/boost_fusion.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/geometries/adapted/boost_polygon.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/geometries/adapted/boost_tuple.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/geometries/adapted/c_array.cpp (contents, props changed)
Text files modified:
   trunk/libs/geometry/doc/concept/linestring.qbk | 2 +-
   trunk/libs/geometry/doc/concept/multi_linestring.qbk | 2 +-
   trunk/libs/geometry/doc/concept/multi_point.qbk | 2 +-
   trunk/libs/geometry/doc/concept/multi_polygon.qbk | 2 +-
   trunk/libs/geometry/doc/concept/point.qbk | 12 ++++++------
   trunk/libs/geometry/doc/concept/polygon.qbk | 3 ++-
   trunk/libs/geometry/doc/concept/ring.qbk | 2 +-
   trunk/libs/geometry/doc/imports.qbk | 8 ++++++++
   trunk/libs/geometry/doc/quickref.xml | 27 ++++++++++++++++++---------
   trunk/libs/geometry/doc/reference.qbk | 11 ++++++-----
   trunk/libs/geometry/doc/src/examples/core/Jamfile.v2 | 2 ++
   trunk/libs/geometry/doc/src/examples/core/rings.cpp | 2 +-
   trunk/libs/geometry/doc/src/examples/geometries/register/point.cpp | 2 +-
   13 files changed, 49 insertions(+), 28 deletions(-)

Modified: trunk/libs/geometry/doc/concept/linestring.qbk
==============================================================================
--- trunk/libs/geometry/doc/concept/linestring.qbk (original)
+++ trunk/libs/geometry/doc/concept/linestring.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -23,7 +23,7 @@
 The Linestring Concept is defined as following:
 
 * there must be a specialization of `traits::tag` defining `linestring_tag` as type
-* it must behave like a Boost.Range
+* it must behave like a Boost.Range Random Access Range
 * The type defined by the metafunction `range_value<...>::type` must fulfill
         the [link geometry.reference.concepts.concept_point Point Concept]
 

Modified: trunk/libs/geometry/doc/concept/multi_linestring.qbk
==============================================================================
--- trunk/libs/geometry/doc/concept/multi_linestring.qbk (original)
+++ trunk/libs/geometry/doc/concept/multi_linestring.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -20,7 +20,7 @@
 The MultiLinestring Concept is defined as following:
 
 * There must be a specialization of the metafunction `traits::tag`, defining `multi_linestring_tag` as type
-* It must behave like a Boost.Range
+* It must behave like a Boost.Range Random Access Range
 * The type defined by the metafunction `range_value<...>::type` must fulfill
         the [link geometry.reference.concepts.concept_linestring Linestring Concept]
 

Modified: trunk/libs/geometry/doc/concept/multi_point.qbk
==============================================================================
--- trunk/libs/geometry/doc/concept/multi_point.qbk (original)
+++ trunk/libs/geometry/doc/concept/multi_point.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -21,7 +21,7 @@
 The MultiPoint Concept is defined as following:
 
 * There must be a specialization of the metafunction `traits::tag`, defining `multi_point_tag` as type
-* It must behave like a Boost.Range
+* It must behave like a Boost.Range Random Access Range
 * The type defined by the metafunction `range_value<...>::type` must fulfill the [link geometry.reference.concepts.concept_point Point Concept]
 
 [heading Available Models]

Modified: trunk/libs/geometry/doc/concept/multi_polygon.qbk
==============================================================================
--- trunk/libs/geometry/doc/concept/multi_polygon.qbk (original)
+++ trunk/libs/geometry/doc/concept/multi_polygon.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -20,7 +20,7 @@
 The MultiPolygon Concept is defined as following:
 
 * There must be a specialization of the metafunction `traits::tag`, defining `multi_polygon_tag` as type
-* It must behave like a Boost.Range
+* It must behave like a Boost.Range Random Access Range
 * The type defined by the metafunction `range_value<...>::type` must fulfill
         the [link geometry.reference.concepts.concept_polygon Polygon Concept]
 

Modified: trunk/libs/geometry/doc/concept/point.qbk
==============================================================================
--- trunk/libs/geometry/doc/concept/point.qbk (original)
+++ trunk/libs/geometry/doc/concept/point.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -37,12 +37,12 @@
 * [link geometry.reference.models.model_point model::point]
 * [link geometry.reference.models.model_d2_point_xy model::d2::point_xy]
 * a lat long point (currently in an extension)
-* a C array (requires `#include boost/geometry/geometries/adapted/c_array.hpp>`)
-* a Boost.Array (requires `#include <boost/geometry/geometries/adapted/boost_array.hpp>`)
-* a Boost.Polygon point (requires `#include boost/geometry/geometries/adapted/boost_polygon/point.hpp>`)
-* a Boost.Fusion adapted structure (requires `#include boost/geometry/geometries/adapted/fusion.hpp>`)
-* a Boost.Tuple (requires `#include boost/geometry/geometries/adapted/tuple.hpp>`)
-* an adapted point using one of the [link geometry.reference.register registration macro's]
+* [link geometry.reference.adapted.c_array C array]
+* [link geometry.reference.adapted.boost_array Boost.Array]
+* [link geometry.reference.adapted.boost_fusion Boost.Fusion]
+* [link geometry.reference.adapted.boost_polygon Boost.Polygon]
+* [link geometry.reference.adapted.boost_tuple Boost.Tuple]
+* other point types, adapted e.g. using one of the [link geometry.reference.adapted registration macro's]
 
 [endsect]
 

Modified: trunk/libs/geometry/doc/concept/polygon.qbk
==============================================================================
--- trunk/libs/geometry/doc/concept/polygon.qbk (original)
+++ trunk/libs/geometry/doc/concept/polygon.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -29,7 +29,8 @@
 * there must be a specialization of `traits::tag` defining `polygon_tag` as type
 * there must be a specialization of `traits::ring_type` defining the type of its exterior ring and interior rings as type
 * this type defined by `ring_type` must fulfill the [link geometry.reference.concepts.concept_ring Ring Concept]
-* there must be a specialization of `traits::interior_type` defining the type of the collection of its interior rings as type
+* there must be a specialization of `traits::interior_type` defining the type of the collection of its interior rings as type;
+ this collection itself must fulfill a Boost.Range Random Access Range Concept
 * there must be a specialization of `traits::exterior_ring` with two functions named `get`, returning the exterior ring, one being const, the other being non const
 * there must be a specialization of `traits::interior_rings` with two functions named `get`, returning the interior rings, one being const, the other being non const
 

Modified: trunk/libs/geometry/doc/concept/ring.qbk
==============================================================================
--- trunk/libs/geometry/doc/concept/ring.qbk (original)
+++ trunk/libs/geometry/doc/concept/ring.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -22,7 +22,7 @@
 The Ring Concept is defined as following:
 
 * there must be a specialization of `traits::tag` defining `ring_tag` as type
-* it must behave like a Boost.Range
+* it must behave like a Boost.Range Random Access Range
 * The type defined by the metafunction `range_value<...>::type` must fulfill
         the [link geometry.reference.concepts.concept_point Point Concept]
 * there might be a specialization of `traits::point_order` defining the order or orientation of its points, `clockwise` or `counterclockwise`

Modified: trunk/libs/geometry/doc/imports.qbk
==============================================================================
--- trunk/libs/geometry/doc/imports.qbk (original)
+++ trunk/libs/geometry/doc/imports.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -69,9 +69,17 @@
 [import src/examples/core/set_box.cpp]
 [import src/examples/core/degree_radian.cpp]
 
+[import src/examples/core/interior_type.cpp]
 [import src/examples/core/point_type.cpp]
+[import src/examples/core/ring_type.cpp]
+[import src/examples/core/rings.cpp]
 [import src/examples/core/tag.cpp]
 [import src/examples/core/tag_cast.cpp]
 
 [import src/examples/geometries/point.cpp]
+[import src/examples/geometries/adapted/c_array.cpp]
+[import src/examples/geometries/adapted/boost_array.cpp]
+[import src/examples/geometries/adapted/boost_fusion.cpp]
+[import src/examples/geometries/adapted/boost_polygon.cpp]
+[import src/examples/geometries/adapted/boost_tuple.cpp]
 [import src/examples/geometries/register/point.cpp]

Modified: trunk/libs/geometry/doc/quickref.xml
==============================================================================
--- trunk/libs/geometry/doc/quickref.xml (original)
+++ trunk/libs/geometry/doc/quickref.xml 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -100,16 +100,25 @@
    </entry>
   </row>
   <row>
- <entry valign="top" namest="a" nameend="c">
- <bridgehead renderas="sect3">Macros</bridgehead>
+ <entry valign="top">
+ <bridgehead renderas="sect3">Adapted point types</bridgehead>
     <simplelist type="vert" columns="1">
- <member><link linkend="geometry.reference.register.boost_geometry_register_point_2d">BOOST_GEOMETRY_REGISTER_POINT_2D</link></member>
- <member><link linkend="geometry.reference.register.boost_geometry_register_point_2d_const">BOOST_GEOMETRY_REGISTER_POINT_2D_CONST</link></member>
- <member><link linkend="geometry.reference.register.boost_geometry_register_point_2d_get_set">BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET</link></member>
- <member><link linkend="geometry.reference.register.boost_geometry_register_point_3d">BOOST_GEOMETRY_REGISTER_POINT_3D</link></member>
- <member><link linkend="geometry.reference.register.boost_geometry_register_point_3d_const">BOOST_GEOMETRY_REGISTER_POINT_3D_CONST</link></member>
- <member><link linkend="geometry.reference.register.boost_geometry_register_point_3d_get_set">BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET</link></member>
-
+ <member><link linkend="geometry.reference.adapted.boost_array">Boost.Array</link></member>
+ <member><link linkend="geometry.reference.adapted.boost_fusion">Boost.Fusion</link></member>
+ <member><link linkend="geometry.reference.adapted.boost_polygon">Boost.Polygon</link></member>
+ <member><link linkend="geometry.reference.adapted.boost_tuple">Boost.Tuple</link></member>
+ <member><link linkend="geometry.reference.adapted.c_array">C arrays</link></member>
+ </simplelist>
+ </entry>
+ <entry valign="top">
+ <bridgehead renderas="sect3">Registration macro's</bridgehead>
+ <simplelist type="vert" columns="1">
+ <member><link linkend="geometry.reference.adapted.boost_geometry_register_point_2d">BOOST_GEOMETRY_REGISTER_POINT_2D</link></member>
+ <member><link linkend="geometry.reference.adapted.boost_geometry_register_point_2d_const">BOOST_GEOMETRY_REGISTER_POINT_2D_CONST</link></member>
+ <member><link linkend="geometry.reference.adapted.boost_geometry_register_point_2d_get_set">BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET</link></member>
+ <member><link linkend="geometry.reference.adapted.boost_geometry_register_point_3d">BOOST_GEOMETRY_REGISTER_POINT_3D</link></member>
+ <member><link linkend="geometry.reference.adapted.boost_geometry_register_point_3d_const">BOOST_GEOMETRY_REGISTER_POINT_3D_CONST</link></member>
+ <member><link linkend="geometry.reference.adapted.boost_geometry_register_point_3d_get_set">BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET</link></member>
     </simplelist>
    </entry>
   </row>

Modified: trunk/libs/geometry/doc/reference.qbk
==============================================================================
--- trunk/libs/geometry/doc/reference.qbk (original)
+++ trunk/libs/geometry/doc/reference.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -34,12 +34,14 @@
 [include generated/interior_rings.qbk]
 [endsect]
 
-
 [endsect] [/access functions]
 
-
-
-[section:register Adaption and adapted models]
+[section:adapted Adapted models and registration]
+[include reference/geometries/adapted/c_array.qbk]
+[include reference/geometries/adapted/boost_array.qbk]
+[include reference/geometries/adapted/boost_fusion.qbk]
+[include reference/geometries/adapted/boost_polygon.qbk]
+[include reference/geometries/adapted/boost_tuple.qbk]
 [include generated/register.qbk]
 [endsect]
 
@@ -175,7 +177,6 @@
 [include generated/cs_tag.qbk]
 [include generated/degree.qbk]
 [include generated/dimension.qbk]
-[include generated/exception.qbk]
 [include generated/interior_type.qbk]
 [include generated/is_radian.qbk]
 [include generated/point_order.qbk]

Added: trunk/libs/geometry/doc/reference/core/interior_type.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/reference/core/interior_type.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,17 @@
+[/============================================================================
+ Boost.Geometry (aka GGL, Generic Geometry Library)
+
+ Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands.
+
+ Use, modification and distribution is subject to the Boost Software License,
+ Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================/]
+
+
+[heading Complexity]
+Compile time
+
+[heading Example]
+[interior_type]
+[interior_type_output]

Added: trunk/libs/geometry/doc/reference/core/ring_type.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/reference/core/ring_type.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,17 @@
+[/============================================================================
+ Boost.Geometry (aka GGL, Generic Geometry Library)
+
+ Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands.
+
+ Use, modification and distribution is subject to the Boost Software License,
+ Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================/]
+
+
+[heading Complexity]
+Compile time
+
+[heading Example]
+[ring_type]
+[ring_type_output]

Added: trunk/libs/geometry/doc/reference/geometries/adapted/boost_array.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/reference/geometries/adapted/boost_array.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,38 @@
+[/============================================================================
+ Boost.Geometry (aka GGL, Generic Geometry Library)
+
+ Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
+ Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
+ Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
+
+ Use, modification and distribution is subject to the Boost Software License,
+ Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================/]
+
+[section:boost_array Boost.Array]
+
+Boost.Array arrays are adapted to the Boost.Geometry point concept
+
+[heading Description]
+
+A boost::array is (optionally) adapted to the Boost.Geometry
+point concept. It can therefore be used in all Boost.Geometry algorithms.
+
+A boost::array can be the point type used by the models linestring, polygon, segment,
+box, and ring
+
+[heading Model of]
+[link geometry.reference.concepts.concept_point Point Concept]
+
+[heading Header]
+`#include <boost/geometry/geometries/adapted/boost_array.hpp>`
+
+The standard header `<boost/geometry.hpp>` does not include this header.
+
+[heading Example]
+[boost_array]
+[boost_array_output]
+
+[endsect]
+

Added: trunk/libs/geometry/doc/reference/geometries/adapted/boost_fusion.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/reference/geometries/adapted/boost_fusion.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,35 @@
+[/============================================================================
+ Boost.Geometry (aka GGL, Generic Geometry Library)
+
+ Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
+ Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
+ Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
+
+ Use, modification and distribution is subject to the Boost Software License,
+ Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================/]
+
+[section:boost_fusion Boost.Fusion]
+
+Boost.Fusion adapted structs or classes are adapted to the Boost.Geometry point concept
+
+[heading Description]
+
+Boost.Fusion adapted structs are (optionally) adapted to the Boost.Geometry
+point concept. They can therefore be used in many Boost.Geometry algorithms.
+
+[heading Model of]
+[link geometry.reference.concepts.concept_point Point Concept]
+
+[heading Header]
+`#include <boost/geometry/geometries/adapted/boost_fusion.hpp>`
+
+The standard header `<boost/geometry.hpp>` does not include this header.
+
+[heading Example]
+[boost_fusion]
+[boost_fusion_output]
+
+[endsect]
+

Added: trunk/libs/geometry/doc/reference/geometries/adapted/boost_polygon.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/reference/geometries/adapted/boost_polygon.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,37 @@
+[/============================================================================
+ Boost.Geometry (aka GGL, Generic Geometry Library)
+
+ Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
+ Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
+ Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
+
+ Use, modification and distribution is subject to the Boost Software License,
+ Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================/]
+
+[section:boost_polygon Boost.Polygon]
+
+The Boost.Polygon point type (point_data) is adapted to the Boost.Geometry Point Concept.
+Boost.Polygon polygons are adapted to the Boost.Geometry Ring Concept and the Boost.Geometry Polygon Concept.
+
+[heading Description]
+
+Boost.Polygon's points (as well as polygons) can be used by Boost.Geometry. The
+two libraries can therefore be used together. Using a boost::polygon::point_data<...>,
+algorithms from both Boost.Polygon and Boost.Geometry can be called.
+
+[heading Model of]
+[link geometry.reference.concepts.concept_point Point Concept]
+
+[heading Header]
+`#include <boost/geometry/geometries/adapted/boost_polygon.hpp>`
+
+The standard header `<boost/geometry.hpp>` does not include this header.
+
+[heading Example]
+[boost_polygon]
+[boost_polygon_output]
+
+[endsect]
+

Added: trunk/libs/geometry/doc/reference/geometries/adapted/boost_tuple.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/reference/geometries/adapted/boost_tuple.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,47 @@
+[/============================================================================
+ Boost.Geometry (aka GGL, Generic Geometry Library)
+
+ Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
+ Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
+ Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
+
+ Use, modification and distribution is subject to the Boost Software License,
+ Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================/]
+
+[section:boost_tuple Boost.Tuple]
+
+Boost.Tuple tuples with arithmetic elements can be used as
+points within Boost.Geometry
+
+[heading Description]
+
+Boost.Tuple fixed sized collections, such as boost::tuple<double, double>, are
+(optionally) adapted to the Boost.Geometry point concept.
+
+Boost.Tuple pairs or triples might have mutually different types, such as a
+boost::tuple<float, double>. Boost.Geometry reports the first type as its
+[link geometry.reference.core.coordinate_type coordinate_type].
+
+Boost.Geometry supports Boost.Tuple pairs, triples, quadruples, etc up to
+tuples with 10 elements (though most algorithms do not support so many
+dimensions).
+
+A tuple can be the point type used by the models linestring, polygon, segment,
+box, and ring
+
+[heading Model of]
+[link geometry.reference.concepts.concept_point Point Concept]
+
+[heading Header]
+`#include <boost/geometry/geometries/adapted/boost_tuple.hpp>`
+
+The standard header `<boost/geometry.hpp>` does not include this header.
+
+[heading Example]
+[boost_tuple]
+[boost_tuple_output]
+
+[endsect]
+

Added: trunk/libs/geometry/doc/reference/geometries/adapted/c_array.qbk
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/reference/geometries/adapted/c_array.qbk 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,40 @@
+[/============================================================================
+ Boost.Geometry (aka GGL, Generic Geometry Library)
+
+ Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
+ Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
+ Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
+
+ Use, modification and distribution is subject to the Boost Software License,
+ Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================/]
+
+[section:c_array C array]
+
+C arrays are adapted to the Boost.Geometry point concept
+
+[heading Description]
+
+C arrays, such as double[2] or int[3], are (optionally) adapted to the Boost.Geometry
+point concept. They can therefore be used in many Boost.Geometry algorithms.
+
+Note that a C array cannot be the point type of a linestring or a polygon. The reason
+for that is that a std::vector does not allow containing C arrays
+(this is not related to Boost.Geometry). The C array is therefore limited to
+the point type.
+
+[heading Model of]
+[link geometry.reference.concepts.concept_point Point Concept]
+
+[heading Header]
+`#include <boost/geometry/geometries/adapted/c_array.hpp>`
+
+The standard header `<boost/geometry.hpp>` does not include this header.
+
+[heading Example]
+[c_array]
+[c_array_output]
+
+[endsect]
+

Modified: trunk/libs/geometry/doc/src/examples/core/Jamfile.v2
==============================================================================
--- trunk/libs/geometry/doc/src/examples/core/Jamfile.v2 (original)
+++ trunk/libs/geometry/doc/src/examples/core/Jamfile.v2 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -25,7 +25,9 @@
 exe point_order : point_order.cpp ;
 exe closure : closure.cpp ;
 
+exe interior_type : interior_type.cpp ;
 exe point_type : point_type.cpp ;
+exe ring_type : ring_type.cpp ;
 exe rings : rings.cpp ;
 exe tag : tag.cpp ;
 exe tag_cast : tag_cast.cpp ;

Added: trunk/libs/geometry/doc/src/examples/core/interior_type.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/core/interior_type.cpp 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,44 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+// QuickBook Example
+
+// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//[interior_type
+//`Shows how to use the interior_type metafunction
+
+#include <iostream>
+#include <typeinfo>
+#include <boost/geometry.hpp>
+#include <boost/geometry/geometries/adapted/boost_array_cartesian.hpp>
+
+int main()
+{
+ // Define a polygon storing points in a deque and storing interior rings
+ // in a list (note that std::list is not supported by most algorithms
+ // because not supporting a random access iterator)
+ typedef boost::geometry::model::polygon
+ <
+ boost::array<short, 3>,
+ true, true,
+ std::deque, std::list
+ > polygon;
+
+ std::cout << typeid(boost::geometry::interior_type<polygon>::type).name() << std::endl;
+
+ return 0;
+}
+
+//]
+
+//[interior_type_output
+/*`
+Output (using MSVC) is a long story (part manually replaced with ellipsis):
+[pre
+class std::list<class boost::geometry::model::ring<class boost::array<short,3>,1,1,class std::deque,class std::allocator>,class std::allocator<...> > >
+]
+*/
+//]

Added: trunk/libs/geometry/doc/src/examples/core/ring_type.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/core/ring_type.cpp 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,53 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+// QuickBook Example
+
+// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//[ring_type
+//`Shows how to use the ring_type metafunction, as well as interior_type
+
+#include <iostream>
+#include <typeinfo>
+#include <boost/geometry.hpp>
+
+int main()
+{
+ typedef boost::geometry::model::d2::point_xy<double> point;
+ typedef boost::geometry::model::polygon<point> polygon;
+
+ typedef boost::geometry::ring_type<polygon>::type ring_type;
+ typedef boost::geometry::interior_type<polygon>::type int_type;
+
+ std::cout << typeid(ring_type).name() << std::endl;
+ std::cout << typeid(int_type).name() << std::endl;
+
+ // So int_type defines a collection of rings,
+ // which is a Boost.Range compatible range
+ // The type of an element of the collection is the very same ring type again.
+ // We show that.
+ typedef boost::range_value<int_type>::type int_ring_type;
+
+ std::cout
+ << std::boolalpha
+ << boost::is_same<ring_type, int_ring_type>::value
+ << std::endl;
+
+ return 0;
+}
+
+//]
+
+//[ring_type_output
+/*`
+Output (using gcc):
+[pre
+ N5boost8geometry5model4ringINS1_2d28point_xyIdNS0_2cs9cartesianEEELb1ELb1ESt6vectorSaEE
+St6vectorIN5boost8geometry5model4ringINS2_2d28point_xyIdNS1_2cs9cartesianEEELb1ELb1ES_SaEESaIS9_EE
+true
+]
+*/
+//]

Modified: trunk/libs/geometry/doc/src/examples/core/rings.cpp
==============================================================================
--- trunk/libs/geometry/doc/src/examples/core/rings.cpp (original)
+++ trunk/libs/geometry/doc/src/examples/core/rings.cpp 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -54,7 +54,7 @@
     typedef boost::range_value<int_type>::type int_ring_type;
     
     std::cout
- //<< std::autoboolstring
+ << std::boolalpha
         << boost::is_same<ring_type, int_ring_type>::value
         << std::endl;
 

Added: trunk/libs/geometry/doc/src/examples/geometries/adapted/Jamfile.v2
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/geometries/adapted/Jamfile.v2 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,21 @@
+# Boost.Geometry (aka GGL, Generic Geometry Library)
+#
+# Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
+# Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
+# Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
+
+# Use, modification and distribution is subject to the Boost Software License,
+# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+
+
+project boost-geometry-doc-src-example-geometries-adapted
+ : # requirements
+ ;
+
+exe c_array : c_array.cpp ;
+exe boost_array : boost_array.cpp ;
+exe boost_fusion : boost_fusion.cpp ;
+exe boost_polygon : boost_polygon.cpp ;
+exe boost_tuple : boost_tuple.cpp ;
+

Added: trunk/libs/geometry/doc/src/examples/geometries/adapted/boost_array.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/geometries/adapted/boost_array.cpp 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,47 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+// QuickBook Example
+
+// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//[boost_array
+//` Shows how to use a Boost.Array using Boost.Geometry's distance, set and assign_values algorithms
+
+#include <iostream>
+#include <boost/geometry.hpp>
+#include <boost/geometry/geometries/adapted/boost_array_cartesian.hpp>
+
+int main()
+{
+ boost::array<float, 2> a = {1, 2};
+ boost::array<double, 2> b = {2, 3};
+ std::cout << boost::geometry::distance(a, b) << std::endl;
+
+ boost::geometry::set<0>(a, 1.1);
+ boost::geometry::set<1>(a, 2.2);
+ std::cout << boost::geometry::distance(a, b) << std::endl;
+
+ boost::geometry::assign_values(b, 2.2, 3.3);
+ std::cout << boost::geometry::distance(a, b) << std::endl;
+
+ boost::geometry::model::linestring<boost::array<double, 2> > line;
+ line.push_back(b);
+
+ return 0;
+}
+
+//]
+
+//[boost_array_output
+/*`
+Output:
+[pre
+1.41421
+1.20416
+1.55563
+]
+*/
+//]

Added: trunk/libs/geometry/doc/src/examples/geometries/adapted/boost_fusion.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/geometries/adapted/boost_fusion.cpp 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,59 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+// QuickBook Example
+
+// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//[boost_fusion
+//` Shows how to combine Boost.Fusion with Boost.Geometry
+
+#include <iostream>
+#include <boost/fusion/include/adapt_struct_named.hpp>
+#include <boost/geometry.hpp>
+#include <boost/geometry/geometries/adapted/fusion.hpp>
+#include <boost/geometry/geometries/adapted/fusion_cartesian.hpp>
+
+struct sample_point
+{
+ double x, y, z;
+};
+
+BOOST_FUSION_ADAPT_STRUCT(sample_point, (double, x) (double, y) (double, z))
+
+int main()
+{
+ sample_point a, b, c;
+
+ // Set coordinates the Boost.Geometry way (one of the ways)
+ boost::geometry::assign_values(a, 3, 2, 1);
+
+ // Set coordinates the Boost.Fusion way
+ boost::fusion::at_c<0>(b) = 6;
+ boost::fusion::at_c<1>(b) = 5;
+ boost::fusion::at_c<2>(b) = 4;
+
+ // Set coordinates the native way
+ c.x = 9;
+ c.y = 8;
+ c.z = 7;
+
+ std::cout << "Distance a-b: " << boost::geometry::distance(a, b) << std::endl;
+ std::cout << "Distance a-c: " << boost::geometry::distance(a, c) << std::endl;
+
+ return 0;
+}
+
+//]
+
+//[boost_fusion_output
+/*`
+Output:
+[pre
+Distance a-b: 5.19615
+Distance a-c: 10.3923
+]
+*/
+//]

Added: trunk/libs/geometry/doc/src/examples/geometries/adapted/boost_polygon.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/geometries/adapted/boost_polygon.cpp 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,38 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+// QuickBook Example
+
+// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//[boost_polygon
+//`Shows how to use Boost.Polygon points within Boost.Geometry
+
+#include <iostream>
+#include <boost/geometry.hpp>
+#include <boost/geometry/geometries/adapted/boost_polygon.hpp>
+
+int main()
+{
+ boost::polygon::point_data<int> a(1, 2), b(3, 4);
+ std::cout << "Distance (using Boost.Geometry): "
+ << boost::geometry::distance(a, b) << std::endl;
+ std::cout << "Distance (using Boost.Polygon): "
+ << boost::polygon::euclidean_distance(a, b) << std::endl;
+
+ return 0;
+}
+
+//]
+
+//[boost_polygon_output
+/*`
+Output:
+[pre
+Distance (using Boost.Geometry): 2.82843
+Distance (using Boost.Polygon): 2.82843
+]
+*/
+//]

Added: trunk/libs/geometry/doc/src/examples/geometries/adapted/boost_tuple.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/geometries/adapted/boost_tuple.cpp 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,50 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+// QuickBook Example
+
+// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//[boost_tuple
+/*`
+Shows how to use Boost.Tuple points in Boost.Geometry
+
+Working with Boost.Tuples in Boost.Geometry is straightforward and shown in
+various other examples as well.
+
+*/
+#include <iostream>
+#include <boost/geometry.hpp>
+#include <boost/geometry/geometries/adapted/tuple.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+int main()
+{
+ boost::geometry::model::polygon<boost::tuple<double, double> > poly;
+ poly.outer().push_back(boost::make_tuple(1.0, 2.0));
+ poly.outer().push_back(boost::make_tuple(6.0, 4.0));
+ poly.outer().push_back(boost::make_tuple(5.0, 1.0));
+ poly.outer().push_back(boost::make_tuple(1.0, 2.0));
+
+ std::cout << "Area: " << boost::geometry::area(poly) << std::endl;
+ std::cout << "Contains (1.5, 2.5): "
+ << std::boolalpha
+ << boost::geometry::within(boost::make_tuple(1.5, 2.5), poly)
+ << std::endl;
+
+ return 0;
+}
+
+//]
+
+//[boost_tuple_output
+/*`
+Output:
+[pre
+Area: 6.5
+Contains (1.5, 2.5): false
+]
+*/
+//]

Added: trunk/libs/geometry/doc/src/examples/geometries/adapted/c_array.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/geometries/adapted/c_array.cpp 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -0,0 +1,36 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+// QuickBook Example
+
+// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//[c_array
+//` Small example showing the combination of an array with a Boost.Geometry algorithm
+
+#include <iostream>
+#include <boost/geometry.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp>
+
+int main()
+{
+ int a[3] = {1, 2, 3};
+ int b[3] = {2, 3, 4};
+
+ std::cout << boost::geometry::distance(a, b) << std::endl;
+
+ return 0;
+}
+
+//]
+
+//[c_array_output
+/*`
+Output:
+[pre
+1.73205
+]
+*/
+//]

Modified: trunk/libs/geometry/doc/src/examples/geometries/register/point.cpp
==============================================================================
--- trunk/libs/geometry/doc/src/examples/geometries/register/point.cpp (original)
+++ trunk/libs/geometry/doc/src/examples/geometries/register/point.cpp 2011-04-22 18:26:38 EDT (Fri, 22 Apr 2011)
@@ -28,7 +28,7 @@
 
     namespace bg = boost::geometry;
 
- /*< Any Boost.Geometry function can be used for legacy point now. Here: assign and distance >*/
+ /*< Any Boost.Geometry function can be used for legacy point now. Here: assign_values and distance >*/
     bg::assign_values(p1, 1, 1);
     bg::assign_values(p2, 2, 2);
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk