Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65334 - in sandbox/geometry: boost/geometry/algorithms boost/geometry/geometries/register libs/geometry/doc libs/geometry/doc/qbk libs/geometry/doc/qbk/reference libs/geometry/doc/qbk/snippets other/programs/doxygen_xml2qbk
From: barend.gehrels_at_[hidden]
Date: 2010-09-07 12:28:30


Author: barendgehrels
Date: 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
New Revision: 65334
URL: http://svn.boost.org/trac/boost/changeset/65334

Log:
Doc update
Converter update (now convenience headers)
Text files modified:
   sandbox/geometry/boost/geometry/algorithms/intersection.hpp | 1
   sandbox/geometry/boost/geometry/algorithms/intersects.hpp | 2
   sandbox/geometry/boost/geometry/algorithms/length.hpp | 26 ----
   sandbox/geometry/boost/geometry/geometries/register/point.hpp | 61 +++++++++++--
   sandbox/geometry/libs/geometry/doc/Doxyfile | 14 +++
   sandbox/geometry/libs/geometry/doc/qbk/make_qbk.bat | 73 ++++++++-------
   sandbox/geometry/libs/geometry/doc/qbk/reference/closing_iterator.qbk | 6 -
   sandbox/geometry/libs/geometry/doc/qbk/reference/concept_point.qbk | 6 -
   sandbox/geometry/libs/geometry/doc/qbk/reference/distance.qbk | 6 -
   sandbox/geometry/libs/geometry/doc/qbk/reference/intersection.qbk | 1
   sandbox/geometry/libs/geometry/doc/qbk/reference/intersects.qbk | 4
   sandbox/geometry/libs/geometry/doc/qbk/reference/length.qbk | 11 ++
   sandbox/geometry/libs/geometry/doc/qbk/reference/point.qbk | 2
   sandbox/geometry/libs/geometry/doc/qbk/reference/point_xy.qbk | 2
   sandbox/geometry/libs/geometry/doc/qbk/reference/register.qbk | 134 ++++++++++++----------------
   sandbox/geometry/libs/geometry/doc/qbk/reference/reverse.qbk | 6 -
   sandbox/geometry/libs/geometry/doc/qbk/snippets/qbk_1.cpp | 179 ++++++++++++++++++++-------------------
   sandbox/geometry/other/programs/doxygen_xml2qbk/doxygen_xml2qbk.cpp | 97 +++++++++++++++++----
   18 files changed, 352 insertions(+), 279 deletions(-)

Modified: sandbox/geometry/boost/geometry/algorithms/intersection.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/intersection.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/intersection.hpp 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -364,6 +364,7 @@
 \param output_collection The collection being filled or extended by the algorithm
 
 \qbk{example,intersection_linestring}
+\qbk{example,intersection_segment}
 */
 template
 <

Modified: sandbox/geometry/boost/geometry/algorithms/intersects.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/intersects.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/intersects.hpp 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -81,6 +81,8 @@
 \return \return_check2{intersect each other}
 
 \qbk{distinguish,two geometries}
+\qbk{example,intersects_linestring}
+\qbk{example,intersects_segment}
  */
 template <typename Geometry1, typename Geometry2>
 inline bool intersects(Geometry1 const& geometry1, Geometry2 const& geometry2)

Modified: sandbox/geometry/boost/geometry/algorithms/length.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/length.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/length.hpp 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -131,26 +131,17 @@
 /*!
 \brief \brief_calc{length}
 \ingroup length
-\details The version without a strategy takes the default
- distance-calculation-strategy to calculate distances between
- consecutive points of a geometry, summing them to the length
- of the geometry
+\details \details_calc{length, length (the sum of distances between consecutive points)}. \details_default_strategy
 \tparam Geometry \tparam_geometry
 \param geometry \param_geometry
 \return \return_calc{length}
 
-\par Example:
-Example showing length calculation on a vector
-\dontinclude doxygen_1.cpp
-\skip example_length_linestring_iterators2
-\line {
-\until }
-
 \qbk{behavior,__0dim__:[qbk_ret 0]}
 \qbk{behavior,__1dim__:[qbk_ret the length]}
 \qbk{behavior,__2dim__:[qbk_ret 0]}
 \qbk{complexity,Linear}
 \qbk{compliance,__ogc__}
+\qbk{example,length}
  */
 template<typename Geometry>
 inline typename length_result<Geometry>::type length(
@@ -175,9 +166,7 @@
 /*!
 \brief \brief_calc{length} \brief_strategy
 \ingroup length
-\details The version with a specified strategy uses that strategy
- to calculate distances between consecutive points, summing them
- to the length of the geometry. \details_strategy_reasons
+\details \details_calc{length, length (the sum of distances between consecutive points)} \brief_strategy. \details_strategy_reasons
 \tparam Geometry \tparam_geometry
 \tparam Strategy \tparam_strategy{distance}
 \param geometry \param_geometry
@@ -185,14 +174,7 @@
 \return \return_calc{length}
 
 \qbk{distinguish,with strategy}
-
-\par Example:
-Example showing length calculation using iterators
- and the Vincenty strategy
-\dontinclude doxygen_1.cpp
-\skip example_length_linestring_iterators3
-\line {
-\until }
+\qbk{example,length_strategy}
  */
 template<typename Geometry, typename Strategy>
 inline typename length_result<Geometry>::type length(

Modified: sandbox/geometry/boost/geometry/geometries/register/point.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/geometries/register/point.hpp (original)
+++ sandbox/geometry/boost/geometry/geometries/register/point.hpp 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -51,13 +51,14 @@
 
 
 /*!
-\brief Macro to register a custom 2D point
+\brief \brief_macro{2D point type}
 \ingroup register
-\param Point Point type to be registered
-\param CoordinateType Type of the coordinates of the point
-\param CoordinateSystem Coordinate system (e.g. cs::cartesian)
-\param Field0 Member containing first (usually x) coordinate
-\param Field1 Member containing second (usually y) coordinate
+\details \details_macro{BOOST_GEOMETRY_REGISTER_POINT_2D, two-dimensional point type}
+\param Point \param_macro_type{Point}
+\param CoordinateType \param_macro_coortype{point}
+\param CoordinateSystem \param_macro_coorsystem
+\param Field0 \param_macro_member{\macro_x}
+\param Field1 \param_macro_member{\macro_y}
 
 \qbk{example, boost_geometry_register_point_2d}
 \qbk{admonition, [caution Use the macro outside any namespace]}
@@ -71,8 +72,15 @@
 }}}
 
 /*!
-\brief Macro to register a custom 3D point
+\brief \brief_macro{3D point type}
 \ingroup register
+\details \details_macro{BOOST_GEOMETRY_REGISTER_POINT_3D, three-dimensional point type}
+\param Point \param_macro_type{Point}
+\param CoordinateType \param_macro_coortype{point}
+\param CoordinateSystem \param_macro_coorsystem
+\param Field0 \param_macro_member{\macro_x}
+\param Field1 \param_macro_member{\macro_y}
+\param Field2 \param_macro_member{\macro_z}
 */
 #define BOOST_GEOMETRY_REGISTER_POINT_3D(Point, CoordinateType, CoordinateSystem, Field0, Field1, Field2) \
 namespace boost { namespace geometry { namespace traits { \
@@ -83,8 +91,14 @@
 }}}
 
 /*!
-\brief Macro to register a custom 2D point (CONST version)
+\brief \brief_macro{2D point type} \brief_macro_const
 \ingroup register
+\details \details_macro{BOOST_GEOMETRY_REGISTER_POINT_2D_CONST, two-dimensional point type}. \details_macro_const
+\param Point \param_macro_type{Point}
+\param CoordinateType \param_macro_coortype{point}
+\param CoordinateSystem \param_macro_coorsystem
+\param Field0 \param_macro_member{\macro_x}
+\param Field1 \param_macro_member{\macro_y}
 */
 #define BOOST_GEOMETRY_REGISTER_POINT_2D_CONST(Point, CoordinateType, CoordinateSystem, Field0, Field1) \
 namespace boost { namespace geometry { namespace traits { \
@@ -94,8 +108,15 @@
 }}}
 
 /*!
-\brief Macro to register a custom 3D point (CONST version)
+\brief \brief_macro{3D point type} \brief_macro_const
 \ingroup register
+\details \details_macro{BOOST_GEOMETRY_REGISTER_POINT_3D_CONST, three-dimensional point type}. \details_macro_const
+\param Point \param_macro_type{Point}
+\param CoordinateType \param_macro_coortype{point}
+\param CoordinateSystem \param_macro_coorsystem
+\param Field0 \param_macro_member{\macro_x}
+\param Field1 \param_macro_member{\macro_y}
+\param Field2 \param_macro_member{\macro_z}
 */
 #define BOOST_GEOMETRY_REGISTER_POINT_3D_CONST(Point, CoordinateType, CoordinateSystem, Field0, Field1, Field2) \
 namespace boost { namespace geometry { namespace traits { \
@@ -106,8 +127,16 @@
 }}}
 
 /*!
-\brief Macro to register a custom 2D point (having separate get/set methods)
+\brief \brief_macro{2D point type} \brief_macro_getset
 \ingroup register
+\details \details_macro{BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET, two-dimensional point type}. \details_macro_getset
+\param Point \param_macro_type{Point}
+\param CoordinateType \param_macro_coortype{point}
+\param CoordinateSystem \param_macro_coorsystem
+\param Get0 \param_macro_getset{get, \macro_x}
+\param Get1 \param_macro_getset{get, \macro_y}
+\param Set0 \param_macro_getset{set, \macro_x}
+\param Set1 \param_macro_getset{set, \macro_y}
 */
 #define BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET(Point, CoordinateType, CoordinateSystem, Get0, Get1, Set0, Set1) \
 namespace boost { namespace geometry { namespace traits { \
@@ -117,8 +146,18 @@
 }}}
 
 /*!
-\brief Macro to register a custom 3D point (having separate get/set methods)
+\brief \brief_macro{3D point type} \brief_macro_getset
 \ingroup register
+\details \details_macro{BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET, three-dimensional point type}. \details_macro_getset
+\param Point \param_macro_type{Point}
+\param CoordinateType \param_macro_coortype{point}
+\param CoordinateSystem \param_macro_coorsystem
+\param Get0 \param_macro_getset{get, \macro_x}
+\param Get1 \param_macro_getset{get, \macro_y}
+\param Get2 \param_macro_getset{get, \macro_z}
+\param Set0 \param_macro_getset{set, \macro_x}
+\param Set1 \param_macro_getset{set, \macro_y}
+\param Set2 \param_macro_getset{set, \macro_z}
 */
 #define BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET(Point, CoordinateType, CoordinateSystem, Get0, Get1, Get2, Set0, Set1, Set2) \
 namespace boost { namespace geometry { namespace traits { \

Modified: sandbox/geometry/libs/geometry/doc/Doxyfile
==============================================================================
--- sandbox/geometry/libs/geometry/doc/Doxyfile (original)
+++ sandbox/geometry/libs/geometry/doc/Doxyfile 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -45,6 +45,9 @@
                         brief_check2{1}="Checks if two geometries \1" \
                         brief_check12{1}="Checks if the first geometry \1 the second geometry" \
                         brief_strategy="using the specified strategy" \
+ brief_macro{1}="Macro to register a \1" \
+ brief_macro_const=" (const version)" \
+ brief_macro_getset=" (having separate get/set methods)" \
                         tparam_geometry="Any type fulfilling a Geometry Concept" \
                         tparam_geometry{1}="A type fulfilling a \1 Concept" \
                         tparam_point="Any type fulfilling a Point Concept" \
@@ -58,10 +61,18 @@
                         param_strategy{1}="The strategy which will be used for \1 calculations" \
                         param_set{1}="which is set to the \1" \
                         param_out{1}="The output iterator, to which \1 geometries are feeded" \
+ param_macro_type{1}="\1 type to be registered" \
+ param_macro_coortype{1}="Type of the coordinates of the \1 (e.g. double)" \
+ param_macro_coorsystem="Coordinate system (e.g. cs::cartesian)" \
+ param_macro_member{1}="Member containing \1 coordinate" \
+ param_macro_getset{2}="Method to \1 the \2 coordinate" \
                         details_calc{2}="The free function \1 calculates the \2 of a geometry" \
                         details_calc{1}="The free function \1 calculates the \1 of a geometry" \
                         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_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_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_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 (e.g. distance over the Earth)" \
                         details_make{1}="This version with the make_ prefix returns the \1, and a template parameter must therefore be specified in the call." \
@@ -72,6 +83,9 @@
                         return_out="The output iterator" \
                         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)" \
+ macro_x="first (usually x)" \
+ macro_y="second (usually y)" \
+ macro_z="third (usually z)" \
                         p_l_or_c="Point, LineString or Polygon"
 OPTIMIZE_OUTPUT_FOR_C = NO
 OPTIMIZE_OUTPUT_JAVA = NO

Modified: sandbox/geometry/libs/geometry/doc/qbk/make_qbk.bat
==============================================================================
--- sandbox/geometry/libs/geometry/doc/qbk/make_qbk.bat (original)
+++ sandbox/geometry/libs/geometry/doc/qbk/make_qbk.bat 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -24,47 +24,48 @@
 
 set xml2qbk=..\..\..\..\other\programs\doxygen_xml2qbk\Release\doxygen_xml2qbk.exe
 set out=..\doxygen_output\xml
+set config=../../../../ boost/geometry/geometry.hpp boost/geometry/geometries/geometries.hpp boost/geometry/multi/multi.hpp
 
 :: Algorithms
-%xml2qbk% %out%\group__area.xml > reference\area.qbk
-%xml2qbk% %out%\group__buffer.xml > reference\buffer.qbk
-%xml2qbk% %out%\group__centroid.xml > reference\centroid.qbk
-%xml2qbk% %out%\group__convex__hull.xml > reference\convex_hull.qbk
-%xml2qbk% %out%\group__dissolve.xml > reference\dissolve.qbk
-%xml2qbk% %out%\group__envelope.xml > reference\envelope.qbk
-%xml2qbk% %out%\group__length.xml > reference\length.qbk
-%xml2qbk% %out%\group__num__geometries.xml > reference\num_geometries.qbk
-%xml2qbk% %out%\group__num__interior__rings.xml > reference\num_interior_rings.qbk
-%xml2qbk% %out%\group__num__points.xml > reference\num_points.qbk
-%xml2qbk% %out%\group__perimeter.xml > reference\perimeter.qbk
-%xml2qbk% %out%\group__reverse.xml > reference\reverse.qbk
-%xml2qbk% %out%\group__simplify.xml > reference\simplify.qbk
-%xml2qbk% %out%\group__unique.xml > reference\unique.qbk
-:: %xml2qbk% %out%\group__access.xml > reference\access.qbk
-:: %xml2qbk% %out%\group__combine.xml > reference\combine.qbk
-:: %xml2qbk% %out%\group__convert.xml > reference\convert.qbk
-:: %xml2qbk% %out%\group__difference.xml > reference\difference.qbk
-:: %xml2qbk% %out%\group__disjoint.xml > reference\disjoint.qbk
-%xml2qbk% %out%\group__distance.xml > reference\distance.qbk
-:: %xml2qbk% %out%\group__equals.xml > reference\equals.qbk
-:: %xml2qbk% %out%\group__for__each.xml > reference\for_each.qbk
-%xml2qbk% %out%\group__intersection.xml > reference\intersection.qbk
-%xml2qbk% %out%\group__intersects.xml > reference\intersects.qbk
-:: %xml2qbk% %out%\group__overlaps.xml > reference\overlaps.qbk
-:: %xml2qbk% %out%\group__sym__difference.xml > reference\sym_difference.qbk
-:: %xml2qbk% %out%\group__transform.xml > reference\transform.qbk
-:: %xml2qbk% %out%\group__union.xml > reference\union.qbk
-%xml2qbk% %out%\group__within.xml > reference\within.qbk
-
-%xml2qbk% %out%\group__register.xml > reference\register.qbk
+%xml2qbk% %out%\group__area.xml %config% > reference\area.qbk
+%xml2qbk% %out%\group__buffer.xml %config% > reference\buffer.qbk
+%xml2qbk% %out%\group__centroid.xml %config% > reference\centroid.qbk
+%xml2qbk% %out%\group__convex__hull.xml %config% > reference\convex_hull.qbk
+%xml2qbk% %out%\group__dissolve.xml %config% > reference\dissolve.qbk
+%xml2qbk% %out%\group__envelope.xml %config% > reference\envelope.qbk
+%xml2qbk% %out%\group__length.xml %config% > reference\length.qbk
+%xml2qbk% %out%\group__num__geometries.xml %config% > reference\num_geometries.qbk
+%xml2qbk% %out%\group__num__interior__rings.xml %config% > reference\num_interior_rings.qbk
+%xml2qbk% %out%\group__num__points.xml %config% > reference\num_points.qbk
+%xml2qbk% %out%\group__perimeter.xml %config% > reference\perimeter.qbk
+%xml2qbk% %out%\group__reverse.xml %config% > reference\reverse.qbk
+%xml2qbk% %out%\group__simplify.xml %config% > reference\simplify.qbk
+%xml2qbk% %out%\group__unique.xml %config% > reference\unique.qbk
+:: %xml2qbk% %out%\group__access.xml %config% > reference\access.qbk
+:: %xml2qbk% %out%\group__combine.xml %config% > reference\combine.qbk
+:: %xml2qbk% %out%\group__convert.xml %config% > reference\convert.qbk
+:: %xml2qbk% %out%\group__difference.xml %config% > reference\difference.qbk
+:: %xml2qbk% %out%\group__disjoint.xml %config% > reference\disjoint.qbk
+%xml2qbk% %out%\group__distance.xml %config% > reference\distance.qbk
+:: %xml2qbk% %out%\group__equals.xml %config% > reference\equals.qbk
+:: %xml2qbk% %out%\group__for__each.xml %config% > reference\for_each.qbk
+%xml2qbk% %out%\group__intersection.xml %config% > reference\intersection.qbk
+%xml2qbk% %out%\group__intersects.xml %config% > reference\intersects.qbk
+:: %xml2qbk% %out%\group__overlaps.xml %config% > reference\overlaps.qbk
+:: %xml2qbk% %out%\group__sym__difference.xml %config% > reference\sym_difference.qbk
+:: %xml2qbk% %out%\group__transform.xml %config% > reference\transform.qbk
+:: %xml2qbk% %out%\group__union.xml %config% > reference\union.qbk
+%xml2qbk% %out%\group__within.xml %config% > reference\within.qbk
+
+%xml2qbk% %out%\group__register.xml %config% > reference\register.qbk
 
 
-%xml2qbk% %out%\classboost_1_1geometry_1_1point.xml > reference\point.qbk
-%xml2qbk% %out%\classboost_1_1geometry_1_1point__xy.xml > reference\point_xy.qbk
+%xml2qbk% %out%\classboost_1_1geometry_1_1point.xml %config% > reference\point.qbk
+%xml2qbk% %out%\classboost_1_1geometry_1_1point__xy.xml %config% > reference\point_xy.qbk
 
-%xml2qbk% %out%\classboost_1_1geometry_1_1concept_1_1_point.xml > reference\concept_point.qbk
+%xml2qbk% %out%\classboost_1_1geometry_1_1concept_1_1_point.xml %config% > reference\concept_point.qbk
 
-%xml2qbk% %out%\structboost_1_1geometry_1_1closing__iterator.xml > reference\closing_iterator.qbk
+%xml2qbk% %out%\structboost_1_1geometry_1_1closing__iterator.xml %config% > reference\closing_iterator.qbk
 
 :: set xslt=c:\software\xsltproc\xml\bin\xsltproc.exe
 :: %xslt% reference.xsl doxygen_output\xml\classboost_1_1geometry_1_1point.xml > point.qbk
@@ -72,3 +73,5 @@
 :: %xslt% reference.xsl doxygen_output\xml\area_8hpp.xml > area2.qbk
 
 bjam --toolset=msvc --without-python
+
+:end

Modified: sandbox/geometry/libs/geometry/doc/qbk/reference/closing_iterator.qbk
==============================================================================
--- sandbox/geometry/libs/geometry/doc/qbk/reference/closing_iterator.qbk (original)
+++ sandbox/geometry/libs/geometry/doc/qbk/reference/closing_iterator.qbk 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -40,12 +40,6 @@
 ]
 
 [heading Header]
-Either
-
-`#include <boost/geometry/geometry.hpp>`
-
-Or
-
 `#include <boost/geometry/iterators/closing_iterator.hpp>`
 
 [endsect]

Modified: sandbox/geometry/libs/geometry/doc/qbk/reference/concept_point.qbk
==============================================================================
--- sandbox/geometry/libs/geometry/doc/qbk/reference/concept_point.qbk (original)
+++ sandbox/geometry/libs/geometry/doc/qbk/reference/concept_point.qbk 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -20,12 +20,6 @@
 ]
 
 [heading Header]
-Either
-
-`#include <boost/geometry/geometry.hpp>`
-
-Or
-
 `#include <boost/geometry/geometries/concepts/point_concept.hpp>`
 
 [endsect]

Modified: sandbox/geometry/libs/geometry/doc/qbk/reference/distance.qbk
==============================================================================
--- sandbox/geometry/libs/geometry/doc/qbk/reference/distance.qbk (original)
+++ sandbox/geometry/libs/geometry/doc/qbk/reference/distance.qbk 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -24,12 +24,6 @@
 The calculated comparable distance
 
 [heading Header]
-Either
-
-`#include <boost/geometry/geometry.hpp>`
-
-Or
-
 `#include <boost/geometry/algorithms/comparable_distance.hpp>`
 
 

Modified: sandbox/geometry/libs/geometry/doc/qbk/reference/intersection.qbk
==============================================================================
--- sandbox/geometry/libs/geometry/doc/qbk/reference/intersection.qbk (original)
+++ sandbox/geometry/libs/geometry/doc/qbk/reference/intersection.qbk 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -41,6 +41,7 @@
 
 [heading Examples]
 [intersection_linestring]
+[intersection_segment]
 
 
 [endsect]

Modified: sandbox/geometry/libs/geometry/doc/qbk/reference/intersects.qbk
==============================================================================
--- sandbox/geometry/libs/geometry/doc/qbk/reference/intersects.qbk (original)
+++ sandbox/geometry/libs/geometry/doc/qbk/reference/intersects.qbk 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -60,6 +60,10 @@
 
 `#include <boost/geometry/algorithms/intersects.hpp>`
 
+[heading Examples]
+[intersects_linestring]
+[intersects_segment]
+
 
 [endsect]
 

Modified: sandbox/geometry/libs/geometry/doc/qbk/reference/length.qbk
==============================================================================
--- sandbox/geometry/libs/geometry/doc/qbk/reference/length.qbk (original)
+++ sandbox/geometry/libs/geometry/doc/qbk/reference/length.qbk 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -5,7 +5,7 @@
 Calculates the length of a geometry.
 
 [heading Description]
-The version without a strategy takes the default distance-calculation-strategy to calculate distances between consecutive points of a geometry, summing them to the length of the geometry
+The free function length calculates the length (the sum of distances between consecutive points) of a geometry. It uses the default strategy, based on the coordinate system of the geometry.
 
 [heading Synopsis]
 ``template<typename Geometry>
@@ -43,6 +43,9 @@
 [heading Complexity]
 Linear
 
+[heading Examples]
+[length]
+
 
 [endsect]
 
@@ -50,6 +53,9 @@
 
 Calculates the length of a geometry using the specified strategy.
 
+[heading Description]
+The free function length calculates the length (the sum of distances between consecutive points) of a geometry using the specified strategy. 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 (e.g. distance over the Earth)
+
 [heading Synopsis]
 ``template<typename Geometry, typename Strategy>
 length_result<Geometry>::type length (Geometry const &geometry, Strategy const &strategy)``
@@ -75,6 +81,9 @@
 
 `#include <boost/geometry/algorithms/length.hpp>`
 
+[heading Examples]
+[length_strategy]
+
 
 [endsect]
 

Modified: sandbox/geometry/libs/geometry/doc/qbk/reference/point.qbk
==============================================================================
--- sandbox/geometry/libs/geometry/doc/qbk/reference/point.qbk (original)
+++ sandbox/geometry/libs/geometry/doc/qbk/reference/point.qbk 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -71,7 +71,7 @@
 [heading Header]
 Either
 
-`#include <boost/geometry/geometry.hpp>`
+`#include <boost/geometry/geometries/geometries.hpp>`
 
 Or
 

Modified: sandbox/geometry/libs/geometry/doc/qbk/reference/point_xy.qbk
==============================================================================
--- sandbox/geometry/libs/geometry/doc/qbk/reference/point_xy.qbk (original)
+++ sandbox/geometry/libs/geometry/doc/qbk/reference/point_xy.qbk 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -74,7 +74,7 @@
 [heading Header]
 Either
 
-`#include <boost/geometry/geometry.hpp>`
+`#include <boost/geometry/geometries/geometries.hpp>`
 
 Or
 

Modified: sandbox/geometry/libs/geometry/doc/qbk/reference/register.qbk
==============================================================================
--- sandbox/geometry/libs/geometry/doc/qbk/reference/register.qbk (original)
+++ sandbox/geometry/libs/geometry/doc/qbk/reference/register.qbk 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -2,7 +2,10 @@
 [/ Generated from ..\doxygen_output\xml\group__register.xml]
 [section:BOOST_GEOMETRY_REGISTER_POINT_2D BOOST_GEOMETRY_REGISTER_POINT_2D]
 
-Macro to register a custom 2D point.
+Macro to register a 2D point type.
+
+[heading Description]
+The macro BOOST_GEOMETRY_REGISTER_POINT_2D registers a two-dimensional point type such that it is recognized by Boost.Geometry and that Boost.Geometry functionality can used with the specified point type
 
 [heading Synopsis]
 ``#define BOOST_GEOMETRY_REGISTER_POINT_2D(Point, CoordinateType, CoordinateSystem, Field0, Field1)``
@@ -12,7 +15,7 @@
 [table
 [[Name] [Description] ]
 [[Point] [Point type to be registered ]]
-[[CoordinateType] [Type of the coordinates of the point ]]
+[[CoordinateType] [Type of the coordinates of the point (e.g. double) ]]
 [[CoordinateSystem] [Coordinate system (e.g. cs::cartesian) ]]
 [[Field0] [Member containing first (usually x) coordinate ]]
 [[Field1] [Member containing second (usually y) coordinate]]
@@ -20,12 +23,6 @@
 
 
 [heading Header]
-Either
-
-`#include <boost/geometry/geometry.hpp>`
-
-Or
-
 `#include <boost/geometry/geometries/register/point.hpp>`
 
 [caution Use the macro outside any namespace]
@@ -38,7 +35,10 @@
 
 [section:BOOST_GEOMETRY_REGISTER_POINT_2D_CONST BOOST_GEOMETRY_REGISTER_POINT_2D_CONST]
 
-Macro to register a custom 2D point (CONST version).
+Macro to register a 2D point type (const version).
+
+[heading Description]
+The macro BOOST_GEOMETRY_REGISTER_POINT_2D_CONST registers a two-dimensional point type such that it is recognized by Boost.Geometry and that Boost.Geometry functionality can used with the specified point type. The const version registers only read access to the fields, the point type is therefore read-only
 
 [heading Synopsis]
 ``#define BOOST_GEOMETRY_REGISTER_POINT_2D_CONST(Point, CoordinateType, CoordinateSystem, Field0, Field1)``
@@ -47,21 +47,15 @@
 
 [table
 [[Name] [Description] ]
-[[Point] []]
-[[CoordinateType] []]
-[[CoordinateSystem] []]
-[[Field0] []]
-[[Field1] []]
+[[Point] [Point type to be registered ]]
+[[CoordinateType] [Type of the coordinates of the point (e.g. double) ]]
+[[CoordinateSystem] [Coordinate system (e.g. cs::cartesian) ]]
+[[Field0] [Member containing first (usually x) coordinate ]]
+[[Field1] [Member containing second (usually y) coordinate ]]
 ]
 
 
 [heading Header]
-Either
-
-`#include <boost/geometry/geometry.hpp>`
-
-Or
-
 `#include <boost/geometry/geometries/register/point.hpp>`
 
 
@@ -69,7 +63,10 @@
 
 [section:BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET]
 
-Macro to register a custom 2D point (having separate get/set methods).
+Macro to register a 2D point type (having separate get/set methods).
+
+[heading Description]
+The macro BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET registers a two-dimensional point type such that it is recognized by Boost.Geometry and that Boost.Geometry functionality can used with the specified point type. 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
 
 [heading Synopsis]
 ``#define BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET(Point, CoordinateType, CoordinateSystem, Get0, Get1, Set0, Set1)``
@@ -78,23 +75,17 @@
 
 [table
 [[Name] [Description] ]
-[[Point] []]
-[[CoordinateType] []]
-[[CoordinateSystem] []]
-[[Get0] []]
-[[Get1] []]
-[[Set0] []]
-[[Set1] []]
+[[Point] [Point type to be registered ]]
+[[CoordinateType] [Type of the coordinates of the point (e.g. double) ]]
+[[CoordinateSystem] [Coordinate system (e.g. cs::cartesian) ]]
+[[Get0] [Method to get the first (usually x) coordinate ]]
+[[Get1] [Method to get the second (usually y) coordinate ]]
+[[Set0] [Method to set the first (usually x) coordinate ]]
+[[Set1] [Method to set the second (usually y) coordinate ]]
 ]
 
 
 [heading Header]
-Either
-
-`#include <boost/geometry/geometry.hpp>`
-
-Or
-
 `#include <boost/geometry/geometries/register/point.hpp>`
 
 
@@ -102,7 +93,10 @@
 
 [section:BOOST_GEOMETRY_REGISTER_POINT_3D BOOST_GEOMETRY_REGISTER_POINT_3D]
 
-Macro to register a custom 3D point.
+Macro to register a 3D point type.
+
+[heading Description]
+The macro BOOST_GEOMETRY_REGISTER_POINT_3D registers a three-dimensional point type such that it is recognized by Boost.Geometry and that Boost.Geometry functionality can used with the specified point type
 
 [heading Synopsis]
 ``#define BOOST_GEOMETRY_REGISTER_POINT_3D(Point, CoordinateType, CoordinateSystem, Field0, Field1, Field2)``
@@ -111,22 +105,16 @@
 
 [table
 [[Name] [Description] ]
-[[Point] []]
-[[CoordinateType] []]
-[[CoordinateSystem] []]
-[[Field0] []]
-[[Field1] []]
-[[Field2] []]
+[[Point] [Point type to be registered ]]
+[[CoordinateType] [Type of the coordinates of the point (e.g. double) ]]
+[[CoordinateSystem] [Coordinate system (e.g. cs::cartesian) ]]
+[[Field0] [Member containing first (usually x) coordinate ]]
+[[Field1] [Member containing second (usually y) coordinate ]]
+[[Field2] [Member containing third (usually z) coordinate ]]
 ]
 
 
 [heading Header]
-Either
-
-`#include <boost/geometry/geometry.hpp>`
-
-Or
-
 `#include <boost/geometry/geometries/register/point.hpp>`
 
 
@@ -134,7 +122,10 @@
 
 [section:BOOST_GEOMETRY_REGISTER_POINT_3D_CONST BOOST_GEOMETRY_REGISTER_POINT_3D_CONST]
 
-Macro to register a custom 3D point (CONST version).
+Macro to register a 3D point type (const version).
+
+[heading Description]
+The macro BOOST_GEOMETRY_REGISTER_POINT_3D_CONST registers a three-dimensional point type such that it is recognized by Boost.Geometry and that Boost.Geometry functionality can used with the specified point type. The const version registers only read access to the fields, the point type is therefore read-only
 
 [heading Synopsis]
 ``#define BOOST_GEOMETRY_REGISTER_POINT_3D_CONST(Point, CoordinateType, CoordinateSystem, Field0, Field1, Field2)``
@@ -143,22 +134,16 @@
 
 [table
 [[Name] [Description] ]
-[[Point] []]
-[[CoordinateType] []]
-[[CoordinateSystem] []]
-[[Field0] []]
-[[Field1] []]
-[[Field2] []]
+[[Point] [Point type to be registered ]]
+[[CoordinateType] [Type of the coordinates of the point (e.g. double) ]]
+[[CoordinateSystem] [Coordinate system (e.g. cs::cartesian) ]]
+[[Field0] [Member containing first (usually x) coordinate ]]
+[[Field1] [Member containing second (usually y) coordinate ]]
+[[Field2] [Member containing third (usually z) coordinate ]]
 ]
 
 
 [heading Header]
-Either
-
-`#include <boost/geometry/geometry.hpp>`
-
-Or
-
 `#include <boost/geometry/geometries/register/point.hpp>`
 
 
@@ -166,7 +151,10 @@
 
 [section:BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET]
 
-Macro to register a custom 3D point (having separate get/set methods).
+Macro to register a 3D point type (having separate get/set methods).
+
+[heading Description]
+The macro BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET registers a three-dimensional point type such that it is recognized by Boost.Geometry and that Boost.Geometry functionality can used with the specified point type. 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
 
 [heading Synopsis]
 ``#define BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET(Point, CoordinateType, CoordinateSystem, Get0, Get1, Get2, Set0, Set1, Set2)``
@@ -175,25 +163,19 @@
 
 [table
 [[Name] [Description] ]
-[[Point] []]
-[[CoordinateType] []]
-[[CoordinateSystem] []]
-[[Get0] []]
-[[Get1] []]
-[[Get2] []]
-[[Set0] []]
-[[Set1] []]
-[[Set2] []]
+[[Point] [Point type to be registered ]]
+[[CoordinateType] [Type of the coordinates of the point (e.g. double) ]]
+[[CoordinateSystem] [Coordinate system (e.g. cs::cartesian) ]]
+[[Get0] [Method to get the first (usually x) coordinate ]]
+[[Get1] [Method to get the second (usually y) coordinate ]]
+[[Get2] [Method to get the third (usually z) coordinate ]]
+[[Set0] [Method to set the first (usually x) coordinate ]]
+[[Set1] [Method to set the second (usually y) coordinate ]]
+[[Set2] [Method to set the third (usually z) coordinate ]]
 ]
 
 
 [heading Header]
-Either
-
-`#include <boost/geometry/geometry.hpp>`
-
-Or
-
 `#include <boost/geometry/geometries/register/point.hpp>`
 
 

Modified: sandbox/geometry/libs/geometry/doc/qbk/reference/reverse.qbk
==============================================================================
--- sandbox/geometry/libs/geometry/doc/qbk/reference/reverse.qbk (original)
+++ sandbox/geometry/libs/geometry/doc/qbk/reference/reverse.qbk 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -17,12 +17,6 @@
 
 
 [heading Header]
-Either
-
-`#include <boost/geometry/geometry.hpp>`
-
-Or
-
 `#include <boost/geometry/algorithms/reverse.hpp>`
 
 

Modified: sandbox/geometry/libs/geometry/doc/qbk/snippets/qbk_1.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/doc/qbk/snippets/qbk_1.cpp (original)
+++ sandbox/geometry/libs/geometry/doc/qbk/snippets/qbk_1.cpp 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -24,7 +24,7 @@
 #include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
 
 
-void snippet_point()
+void example_point()
 {
     struct custom_cs {};
 
@@ -65,7 +65,7 @@
 } // namespace
 
 
-void snippet_area_polygon()
+void example_area_polygon()
 {
     //[area_polygon
     //` Calculate the area of a polygon
@@ -76,7 +76,7 @@
     //]
 }
 
-void snippet_area_polygon_spherical()
+void example_area_polygon_spherical()
 {
     //[area_polygon_spherical
     //` Calculate the area of a [*spherical] polygon
@@ -87,7 +87,7 @@
     //]
 }
 
-void snippet_area_polygon_strategy()
+void example_area_polygon_strategy()
 {
     //[area_polygon_strategy
     //` Calculate the area of a polygon specifying a strategy
@@ -105,7 +105,7 @@
 
 
 
-void snippet_as_wkt_point()
+void example_as_wkt_point()
 {
     typedef boost::geometry::point_xy<double> P;
     P p(5.12, 6.34);
@@ -119,7 +119,7 @@
     std::cout << boost::geometry::wkt(p) << std::endl;
 }
 
-void snippet_as_wkt_vector()
+void example_as_wkt_vector()
 {
     std::vector<boost::geometry::point_xy<int> > v;
     boost::geometry::read_wkt<boost::geometry::point_xy<int> >("linestring(1 1,2 2,3 3,4 4)", std::back_inserter(v));
@@ -128,7 +128,7 @@
 }
 
 
-void snippet_centroid_polygon()
+void example_centroid_polygon()
 {
     boost::geometry::polygon<boost::geometry::point_xy<double> > poly;
     boost::geometry::read_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly);
@@ -139,7 +139,7 @@
 }
 
 
-void snippet_distance_point_point()
+void example_distance_point_point()
 {
     boost::geometry::point_xy<double> p1(1, 1);
     boost::geometry::point_xy<double> p2(2, 3);
@@ -160,7 +160,7 @@
     */
 }
 
-void snippet_distance_point_point_strategy()
+void example_distance_point_point_strategy()
 {
     /*
     Extension, other coordinate system:
@@ -177,35 +177,35 @@
     */
 }
 
-void snippet_from_wkt_point()
+void example_from_wkt_point()
 {
     boost::geometry::point_xy<int> point;
     boost::geometry::read_wkt("Point(1 2)", point);
     std::cout << point.x() << "," << point.y() << std::endl;
 }
 
-void snippet_from_wkt_output_iterator()
+void example_from_wkt_output_iterator()
 {
     std::vector<boost::geometry::point_xy<int> > v;
     boost::geometry::read_wkt<boost::geometry::point_xy<int> >("linestring(1 1,2 2,3 3,4 4)", std::back_inserter(v));
     std::cout << "vector has " << v.size() << " coordinates" << std::endl;
 }
 
-void snippet_from_wkt_linestring()
+void example_from_wkt_linestring()
 {
     boost::geometry::linestring<boost::geometry::point_xy<double> > line;
     boost::geometry::read_wkt("linestring(1 1,2 2,3 3,4 4)", line);
     std::cout << "linestring has " << line.size() << " coordinates" << std::endl;
 }
 
-void snippet_from_wkt_polygon()
+void example_from_wkt_polygon()
 {
     boost::geometry::polygon<boost::geometry::point_xy<double> > poly;
     boost::geometry::read_wkt("POLYGON((0 0,0 1,1 1,1 0,0 0))", poly);
     std::cout << "Polygon has " << poly.outer().size() << " coordinates in outer ring" << std::endl;
 }
 
-void snippet_point_ll_convert()
+void example_point_ll_convert()
 {
     /*
     Extension, other coordinate system:
@@ -217,7 +217,7 @@
     */
 }
 
-void snippet_intersection_linestring()
+void example_intersection_linestring()
 {
     //[intersection_linestring
     typedef boost::geometry::point_xy<double> P;
@@ -230,20 +230,24 @@
     //]
 }
 
-void snippet_intersects_linestring()
+void example_intersects_linestring()
 {
+ //[intersects_linestring
+ //` Check if two linestrings (here: vectors) intersect each other
     typedef boost::geometry::point_xy<double> P;
     std::vector<P> line1, line2;
     boost::geometry::read_wkt("linestring(1 1,2 2)", line1);
     boost::geometry::read_wkt("linestring(2 1,1 2)", line2);
 
     bool b = boost::geometry::intersects(line1, line2);
+ //]
 }
 
 
 
-void snippet_intersection_segment()
+void example_intersection_segment()
 {
+ //[intersection_segment
     typedef boost::geometry::point_xy<double> P;
     boost::geometry::model::segment<P> segment1, segment2;
     boost::geometry::read_wkt("linestring(1 1,2 2)", segment1);
@@ -251,9 +255,10 @@
 
     std::vector<P> intersections;
     boost::geometry::intersection(segment1, segment2, intersections);
+ //]
 }
 
-void snippet_intersection_inserter_segment()
+void example_intersection_inserter_segment()
 {
     //[intersection_segment_inserter
 
@@ -271,18 +276,21 @@
     //]
 }
 
-void snippet_intersects_segment()
+void example_intersects_segment()
 {
+ //[intersects_segment
+ //` Check if two segments intersect each other
     typedef boost::geometry::point_xy<double> P;
- custom_segment<P> line1, line2;
+ boost::geometry::model::segment<P> line1, line2;
     boost::geometry::read_wkt("linestring(1 1,2 2)", line1);
     boost::geometry::read_wkt("linestring(2 1,1 2)", line2);
 
     bool b = boost::geometry::intersects(line1, line2);
+ //]
 }
 
 
-void snippet_clip_linestring1()
+void example_clip_linestring1()
 {
     typedef boost::geometry::point_xy<double> P;
     boost::geometry::linestring<P> line;
@@ -294,7 +302,7 @@
     boost::geometry::intersection_inserter<boost::geometry::linestring<P> >(cb, line, std::back_inserter(intersection));
 }
 
-void snippet_clip_linestring2()
+void example_clip_linestring2()
 {
     typedef boost::geometry::point_xy<double> P;
     std::vector<P> vector_in;
@@ -318,7 +326,7 @@
 
 
 
-void snippet_intersection_polygon1()
+void example_intersection_polygon1()
 {
     typedef boost::geometry::point_xy<double> P;
     typedef std::vector<boost::geometry::polygon<P> > PV;
@@ -338,7 +346,7 @@
     }
 }
 
-void snippet_simplify_linestring1()
+void example_simplify_linestring1()
 {
     //[simplify
     //` Simplify a linestring
@@ -351,7 +359,7 @@
     //]
 }
 
-void snippet_simplify_linestring2()
+void example_simplify_linestring2()
 {
     //[simplify_inserter
     //` Simplify a linestring using an output iterator
@@ -369,7 +377,7 @@
 
 
 
-void snippet_within()
+void example_within()
 {
     boost::geometry::polygon<boost::geometry::point_xy<double> > poly;
     boost::geometry::read_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly);
@@ -381,7 +389,7 @@
 }
 
 /*
-void snippet_within_strategy()
+void example_within_strategy()
 {
     // TO BE UPDATED/FINISHED
     typedef boost::geometry::point_xy<double> P;
@@ -391,20 +399,23 @@
 }
 */
 
-void snippet_length_linestring()
+void example_length_linestring()
 {
+ //[length
+ //` The following simple example shows the calculation of the length of a linestring containing three points
     using namespace boost::geometry;
     linestring<point_xy<double> > line;
     read_wkt("linestring(0 0,1 1,4 8,3 2)", line);
     std::cout << "linestring length is "
         << length(line)
         << " units" << std::endl;
+ //]
 
     /*
     Extension, other coordinate system:
     // Linestring in latlong, filled with
     // explicit degree-minute-second values
- typedef point_ll<float, boost::geometry::cs::geographic<boost::geometry::degree> > LL;
+ typedef point_ll<float, 2, boost::geometry::cs::geographic<boost::geometry::degree> > LL;
     linestring<LL> line_ll;
     line_ll.push_back(LL(
         latitude<float>(dms<north, float>(52, 22, 23)),
@@ -421,16 +432,7 @@
         */
 }
 
-void snippet_length_linestring_iterators1()
-{
- boost::geometry::linestring<boost::geometry::point_xy<double> > line;
- boost::geometry::read_wkt("linestring(0 0,1 1,4 8,3 2)", line);
- std::cout << "linestring length is "
- << boost::geometry::length(line)
- << " units" << std::endl;
-}
-
-void snippet_length_linestring_iterators2()
+void example_length_linestring_iterators2()
 {
     std::vector<boost::geometry::point_xy<double> > line;
     boost::geometry::read_wkt<boost::geometry::point_xy<double> >("linestring(0 0,1 1,4 8,3 2)", std::back_inserter(line));
@@ -439,7 +441,7 @@
         << " units" << std::endl;
 }
 
-void snippet_length_linestring_iterators3()
+void example_length_linestring_iterators3()
 {
     /*
     Extension, other coordinate system:
@@ -454,24 +456,26 @@
 }
 
 
-void snippet_length_linestring_strategy()
+void example_length_linestring_strategy()
 {
- /*
- Extension, other coordinate system:
+ //[length_strategy
+ //`The following example shows the length measured over a sphere, expressed in kilometers. To do that the radius of the sphere must be specified in the constructor of the strategy.
+
     using namespace boost::geometry;
- typedef point_ll<float, boost::geometry::cs::geographic<boost::geometry::degree> > LL;
- linestring<LL> line_ll;
- line_ll.push_back(LL(latitude<float>(dms<north, float>(52, 22, 23)), longitude<float>(dms<east, float>(4, 53, 32))));
- line_ll.push_back(LL(latitude<float>(dms<north, float>(51, 55, 51)), longitude<float>(dms<east, float>(4, 28, 45))));
- line_ll.push_back(LL(latitude<float>(dms<north, float>(52, 4, 48)), longitude<float>(dms<east, float>(4, 18, 0))));
- std::cout << "linestring length is "
- << length(line_ll, strategy::distance::vincenty<LL, LL>() )/(1000)
+ typedef point<float, 2, boost::geometry::cs::spherical<boost::geometry::degree> > P;
+ linestring<P> line;
+ line.push_back(P(2, 41));
+ line.push_back(P(2, 48));
+ line.push_back(P(5, 52));
+ double const mean_radius = 6371.0; /*< [@http://en.wikipedia.org/wiki/Earth_radius Wiki] >*/
+ std::cout << "length is "
+ << length(line, strategy::distance::haversine<P>(mean_radius) )
         << " kilometers " << std::endl;
- */
+ //]
 }
 
 
-void snippet_envelope_linestring()
+void example_envelope_linestring()
 {
     boost::geometry::linestring<boost::geometry::point_xy<double> > line;
     boost::geometry::read_wkt("linestring(0 0,1 1,4 8,3 2)", line);
@@ -481,7 +485,7 @@
     std::cout << "envelope is " << boost::geometry::dsv(box) << std::endl;
 }
 
-void snippet_envelope_polygon()
+void example_envelope_polygon()
 {
     /*
     Extension, other coordinate system:
@@ -512,7 +516,7 @@
 }
 
 
-void snippet_dms()
+void example_dms()
 {
     /*
     Extension, other coordinate system:
@@ -536,7 +540,7 @@
     */
 }
 
-void snippet_point_ll_construct()
+void example_point_ll_construct()
 {
     /*
     Extension, other coordinate system:
@@ -558,52 +562,51 @@
 
 int main(void)
 {
- snippet_point();
+ example_point();
 
- snippet_area_polygon();
- snippet_area_polygon_spherical();
- snippet_area_polygon_strategy();
+ example_area_polygon();
+ example_area_polygon_spherical();
+ example_area_polygon_strategy();
 
- snippet_centroid_polygon();
+ example_centroid_polygon();
 
- snippet_intersection_linestring();
- snippet_intersects_linestring();
- snippet_intersection_segment();
- snippet_intersection_inserter_segment();
- snippet_intersects_segment();
+ example_intersection_linestring();
+ example_intersects_linestring();
+ example_intersection_segment();
+ example_intersection_inserter_segment();
+ example_intersects_segment();
 
 
- snippet_distance_point_point();
- snippet_distance_point_point_strategy();
+ example_distance_point_point();
+ example_distance_point_point_strategy();
 
- snippet_from_wkt_point();
- snippet_from_wkt_output_iterator();
- snippet_from_wkt_linestring();
- snippet_from_wkt_polygon();
+ example_from_wkt_point();
+ example_from_wkt_output_iterator();
+ example_from_wkt_linestring();
+ example_from_wkt_polygon();
 
- snippet_as_wkt_point();
+ example_as_wkt_point();
 
- snippet_clip_linestring1();
- snippet_clip_linestring2();
- snippet_intersection_polygon1();
+ example_clip_linestring1();
+ example_clip_linestring2();
+ example_intersection_polygon1();
 
- snippet_simplify_linestring1();
- snippet_simplify_linestring2();
+ example_simplify_linestring1();
+ example_simplify_linestring2();
 
- snippet_length_linestring();
- snippet_length_linestring_iterators1();
- snippet_length_linestring_iterators2();
- snippet_length_linestring_iterators3();
- snippet_length_linestring_strategy();
+ example_length_linestring();
+ example_length_linestring_iterators2();
+ example_length_linestring_iterators3();
+ example_length_linestring_strategy();
 
- snippet_envelope_linestring();
- snippet_envelope_polygon();
+ example_envelope_linestring();
+ example_envelope_polygon();
 
- snippet_within();
+ example_within();
 
- snippet_point_ll_convert();
- snippet_point_ll_construct();
- snippet_dms();
+ example_point_ll_convert();
+ example_point_ll_construct();
+ example_dms();
 
 
     boost_geometry_register_point_2d::foo();

Modified: sandbox/geometry/other/programs/doxygen_xml2qbk/doxygen_xml2qbk.cpp
==============================================================================
--- sandbox/geometry/other/programs/doxygen_xml2qbk/doxygen_xml2qbk.cpp (original)
+++ sandbox/geometry/other/programs/doxygen_xml2qbk/doxygen_xml2qbk.cpp 2010-09-07 12:28:21 EDT (Tue, 07 Sep 2010)
@@ -16,9 +16,6 @@
 // using /xmlonly
 // currently this is the element <qbk.example> which will make a reference
 // to an example.
-// - earlier generations of QBK was done by XSLT, I'm not so into the XSLT and
-// think this is more flexible. The XSLT only did point-structure, not yet
-// functions as area, so there is not (yet) an overlap
 // - currently still in draft
 
 // Aug 14/15: added classes, defines, various enhancements.
@@ -166,6 +163,14 @@
     std::vector<function> defines;
 };
 
+struct configuration
+{
+ // Prefix to find headerfiles (will not be outputted)
+ std::string prefix;
+ std::vector<std::string> headerfiles;
+};
+
+
 
 // Predicate for std::find_if
 struct par_by_name
@@ -584,24 +589,65 @@
         << std::endl;
 }
 
-void quickbook_header(std::string const& location, std::ostream& out)
+inline bool includes(std::string const& filename, std::string const& header)
+{
+ std::string result;
+
+ std::ifstream cpp_file(filename.c_str());
+ if (cpp_file.is_open())
+ {
+ while (! cpp_file.eof() )
+ {
+ std::string line;
+ std::getline(cpp_file, line);
+ boost::trim(line);
+ if (boost::starts_with(line, "#include")
+ && boost::contains(line, header))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+
+void quickbook_header(std::string const& location,
+ configuration const& config,
+ std::ostream& out)
 {
     if (! location.empty())
     {
+ std::vector<std::string> including_headers;
+
+ // Check all headerfiles to see if this specific headerfile is found
+ BOOST_FOREACH(std::string const& headerfile, config.headerfiles)
+ {
+ if (includes(config.prefix + headerfile, location))
+ {
+ including_headers.push_back(headerfile);
+ }
+ }
+
         out << "[heading Header]" << std::endl;
- if (true)
+ if (! including_headers.empty())
         {
- // TODO: get the alternative headerfiles from somewhere
- out << "Either" << std::endl << std::endl;
- out << "`#include <boost/geometry/geometry.hpp>`" << std::endl << std::endl;
- out << "Or" << std::endl << std::endl;
+ out << "Either"
+ << (including_headers.size() > 1 ? " one of" : "")
+ << std::endl << std::endl;
+ BOOST_FOREACH(std::string const& headerfile, including_headers)
+ {
+ out << "`#include <" << headerfile << ">`" << std::endl;
+ }
+
+ out << std::endl << "Or" << std::endl << std::endl;
         }
         out << "`#include <" << location << ">`" << std::endl;
         out << std::endl;
     }
 }
 
-void quickbook_snippets(std::vector<std::string> const& examples, std::ostream& out)
+void quickbook_examples(std::vector<std::string> const& examples, std::ostream& out)
 {
     if (! examples.empty())
     {
@@ -650,7 +696,7 @@
 }
 
 
-void quickbook_output(function const& f, std::ostream& out)
+void quickbook_output(function const& f, configuration const& headerfiles, std::ostream& out)
 {
     // Write the parsed function
     int arity = (int)f.parameters.size();
@@ -728,7 +774,7 @@
     quickbook_heading_string("Returns", f.return_description, out);
     //quickbook_heading_string("Model of", f.model_of, out);
 
- quickbook_header(f.location, out);
+ quickbook_header(f.location, headerfiles, out);
     quickbook_behaviors(f.behaviors, out);
 
     quickbook_heading_string("Complexity", f.complexity, out);
@@ -738,7 +784,7 @@
         out << admonition << std::endl;
     }
 
- quickbook_snippets(f.examples, out);
+ quickbook_examples(f.examples, out);
 
     if (! f.images.empty())
     {
@@ -783,8 +829,9 @@
     out << std::endl;
 }
 
-void quickbook_output(class_or_struct const& cos, std::ostream& out)
+void quickbook_output(class_or_struct const& cos, configuration const& headerfiles, std::ostream& out)
 {
+ // Boost.Geometry specific, to make generic: make this namespace-to-be-skipped configurable
     std::string short_name = boost::replace_all_copy(cos.fullname, "boost::geometry::", "");
     
 
@@ -866,8 +913,8 @@
             << std::endl;
     }
 
- quickbook_header(cos.location, out);
- quickbook_snippets(cos.examples, out);
+ quickbook_header(cos.location, headerfiles, out);
+ quickbook_examples(cos.examples, out);
 
     out << "[endsect]" << std::endl
         << std::endl;
@@ -885,7 +932,7 @@
     if (argc < 2)
     {
         std::cerr
- << "Usage: doxygen_xml2qbk [XML-filename]" << std::endl
+ << "Usage: doxygen_xml2qbk [XML-filename] {prefix CH} {convenience header (CH) 1} {CH 2} ..." << std::endl
             << " where the XML refers to an XML written by Doxygen" << std::endl;
         return 1;
     }
@@ -930,23 +977,33 @@
         }
     }
 
+ configuration config;
+ if (argc > 2)
+ {
+ config.prefix = argv[2];
+ for (int i = 3; i < argc; i++)
+ {
+ config.headerfiles.push_back(argv[i]);
+ }
+ }
+
     std::cout
         << "[/ Generated by doxygen_xml2qbk, don't change, it will be overwritten automatically]" << std::endl
         << "[/ Generated from " << filename << "]" << std::endl;
 
     BOOST_FOREACH(function const& f, doc.functions)
     {
- quickbook_output(f, std::cout);
+ quickbook_output(f, config, std::cout);
     }
     BOOST_FOREACH(function const& f, doc.defines)
     {
- quickbook_output(f, std::cout);
+ quickbook_output(f, config, std::cout);
     }
 
     if (! doc.cos.name.empty())
     {
         std::sort(doc.cos.functions.begin(), doc.cos.functions.end(), sort_on_line<function>());
- quickbook_output(doc.cos, std::cout);
+ quickbook_output(doc.cos, config, std::cout);
     }
 
     return 0;


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