Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69126 - in trunk/libs/geometry/doc: . doxy reference src/examples/algorithms
From: barend.gehrels_at_[hidden]
Date: 2011-02-21 14:28:17


Author: barendgehrels
Date: 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
New Revision: 69126
URL: http://svn.boost.org/trac/boost/changeset/69126

Log:
Added several samples for make and assign
Added:
   trunk/libs/geometry/doc/src/examples/algorithms/assign_2d_point.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/algorithms/assign_3d_point.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/algorithms/assign_inverse.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/algorithms/assign_with_range.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/algorithms/intersects_segment.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/algorithms/make_2d_point.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/algorithms/make_3d_point.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/algorithms/make_inverse.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/algorithms/make_with_range.cpp (contents, props changed)
   trunk/libs/geometry/doc/src/examples/algorithms/simplify_inserter_with_strategy.cpp (contents, props changed)
Text files modified:
   trunk/libs/geometry/doc/doxy/Doxyfile | 10 +++
   trunk/libs/geometry/doc/geometry.qbk | 8 +++
   trunk/libs/geometry/doc/reference/assign.qbk | 80 +++++++++++++++++++----------
   trunk/libs/geometry/doc/reference/make.qbk | 106 +++++++++++++++++++++++++++++----------
   trunk/libs/geometry/doc/src/examples/algorithms/Jamfile.v2 | 10 +++
   5 files changed, 157 insertions(+), 57 deletions(-)

Modified: trunk/libs/geometry/doc/doxy/Doxyfile
==============================================================================
--- trunk/libs/geometry/doc/doxy/Doxyfile (original)
+++ trunk/libs/geometry/doc/doxy/Doxyfile 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -15,8 +15,8 @@
 ALWAYS_DETAILED_SEC = YES
 INLINE_INHERITED_MEMB = NO
 FULL_PATH_NAMES = YES
-STRIP_FROM_PATH = c:/_svn/boost/sandbox/geometry \
- c:/_svn/boost/sandbox/geometry/libs/geometry/doc/doxygen_input/pages
+STRIP_FROM_PATH = c:/_svn/boost/trunk/boost/geometry \
+ c:/_svn/boost/trunk/libs/geometry/doc/doxygen_input/pages
 STRIP_FROM_INC_PATH =
 SHORT_NAMES = NO
 JAVADOC_AUTOBRIEF = NO
@@ -65,6 +65,7 @@
                         tparam_out{1}="A valid output iterator type, accepting geometries of \1 Concept" \
                         tparam_point="Any type fulfilling a Point Concept" \
                         tparam_point="point type" \
+ tparam_range_point="Any type fulfilling a Range Concept where it range_value type fulfills the Point Concept" \
                         tparam_second_point="second point type" \
                         tparam_segment_point="segment point type" \
                         tparam_strategy{1}="Any type fulfilling a \1 Strategy Concept" \
@@ -79,6 +80,10 @@
                         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" \
+ param_range_point="A range containg points fulfilling range and point concepts" \
+ param_x="First coordinate (usually x-coordinate)" \
+ param_y="Second coordinate (usually y-coordinate)" \
+ param_z="Third coordinate (usually z-coordinate)" \
                         constructor_default{1}="Default constructor, creating an empty \1" \
                         constructor_begin_end{1}="Constructor with begin and end, filling the \1" \
                         details_calc{2}="The free function \1 calculates the \2 of a geometry" \
@@ -94,6 +99,7 @@
                         details_make{1}="This version with the make_ prefix returns the \1, and a template parameter must therefore be specified in the call." \
                         details_inserter{1}="This version with the _inserter suffix outputs the \1 to an output iterator, and a template parameter must therefore be specified in the call." \
                         details_get_set="The free functions [*get] and [*set] are two of the most important functions of Boost.Geometry, both within the library, as also for the library user. With these two functions you normally get and set coordinate values from and for a point, box, segment or sphere." \
+ details_make="Boost.Geometry uses concepts for all its geometries. It does not rely on constructors. The "make" functions are object generators creating geometries. There are overloads, currently with two or three coordinate values or ranges, to construct geometry instances" \
                         return_calc{1}="The calculated \1" \
                         return_check{1}="Returns true if the geometry \1" \
                         return_check2{1}="Returns true if two geometries \1" \

Modified: trunk/libs/geometry/doc/geometry.qbk
==============================================================================
--- trunk/libs/geometry/doc/geometry.qbk (original)
+++ trunk/libs/geometry/doc/geometry.qbk 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -71,11 +71,19 @@
 [import src/examples/quick_start.cpp]
 [import src/examples/algorithms/area.cpp]
 [import src/examples/algorithms/area_with_strategy.cpp]
+[import src/examples/algorithms/assign_2d_point.cpp]
+[import src/examples/algorithms/assign_3d_point.cpp]
+[import src/examples/algorithms/assign_inverse.cpp]
+[import src/examples/algorithms/assign_with_range.cpp]
 [import src/examples/algorithms/for_each_point.cpp]
 [import src/examples/algorithms/for_each_point_const.cpp]
 [import src/examples/algorithms/for_each_segment_const.cpp]
 [import src/examples/algorithms/length.cpp]
 [import src/examples/algorithms/length_with_strategy.cpp]
+[import src/examples/algorithms/make_2d_point.cpp]
+[import src/examples/algorithms/make_3d_point.cpp]
+[import src/examples/algorithms/make_inverse.cpp]
+[import src/examples/algorithms/make_with_range.cpp]
 [import src/examples/algorithms/intersection_ls_ls_point.cpp]
 [import src/examples/algorithms/intersection_segment.cpp]
 [import src/examples/algorithms/intersects_linestring.cpp]

Modified: trunk/libs/geometry/doc/reference/assign.qbk
==============================================================================
--- trunk/libs/geometry/doc/reference/assign.qbk (original)
+++ trunk/libs/geometry/doc/reference/assign.qbk 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -13,9 +13,9 @@
 
 [/ Generated by doxygen_xml2qbk, don't change, will be overwritten automatically]
 [/ Generated from doxy/doxygen_output/xml/group__assign.xml]
-[section:assign_2 assign]
+[section:assign_2_with_a_range assign (with a range)]
 
-assign a range of points to a linestring, ring or polygon
+Assign a range of points to a linestring, ring or polygon.
 
 [heading Synopsis]
 ``template<typename Geometry, typename Range>
@@ -25,8 +25,8 @@
 
 [table
 [[Type] [Concept] [Name] [Description] ]
-[[Geometry &] [] [geometry] []]
-[[Range const &] [] [range] []]
+[[Geometry &] [Any type fulfilling a Geometry Concept ] [geometry] [A model of the specified concept ]]
+[[Range const &] [Any type fulfilling a Range Concept where it range_value type fulfills the Point Concept ] [range] [A range containg points fulfilling range and point concepts]]
 ]
 
 
@@ -39,12 +39,18 @@
 
 `#include <boost/geometry/algorithms/assign.hpp>`
 
+[heading Example]
+[assign_with_range] [assign_with_range_output]
+
+[heading See also]
+* [link geometry.reference.algorithms.make.make_1_with_a_range make]
+
 
 [endsect]
 
-[section:assign_5 assign]
+[section:assign_5_4_coordinate_values assign (4 coordinate values)]
 
-assign center + radius to a sphere [for extension]
+Assign four values to a geometry (usually a box or segment).
 
 [heading Synopsis]
 ``template<typename Geometry, typename Type>
@@ -54,11 +60,11 @@
 
 [table
 [[Type] [Concept] [Name] [Description] ]
-[[Geometry &] [] [geometry] []]
-[[Type const &] [] [c1] []]
-[[Type const &] [] [c2] []]
-[[Type const &] [] [c3] []]
-[[Type const &] [] [c4] []]
+[[Geometry &] [Any type fulfilling a Geometry Concept ] [geometry] [A model of the specified concept ]]
+[[Type const &] [numerical type (int, double, ttmath, ...) to specify the coordinates ] [c1] [First coordinate (usually x1) ]]
+[[Type const &] [numerical type (int, double, ttmath, ...) to specify the coordinates ] [c2] [Second coordinate (usually y1) ]]
+[[Type const &] [numerical type (int, double, ttmath, ...) to specify the coordinates ] [c3] [Third coordinate (usually x2) ]]
+[[Type const &] [numerical type (int, double, ttmath, ...) to specify the coordinates ] [c4] [Fourth coordinate (usually y2)]]
 ]
 
 
@@ -74,9 +80,9 @@
 
 [endsect]
 
-[section:assign_4 assign]
+[section:assign_4_3_coordinate_values assign (3 coordinate values)]
 
-assign three values to a 3D point [or the center + radius to a circle]
+Assign three values to a geometry (usually a 3D point).
 
 [heading Synopsis]
 ``template<typename Geometry, typename Type>
@@ -86,10 +92,10 @@
 
 [table
 [[Type] [Concept] [Name] [Description] ]
-[[Geometry &] [] [geometry] []]
-[[Type const &] [] [c1] []]
-[[Type const &] [] [c2] []]
-[[Type const &] [] [c3] []]
+[[Geometry &] [Any type fulfilling a Geometry Concept ] [geometry] [A model of the specified concept ]]
+[[Type const &] [numerical type (int, double, ttmath, ...) to specify the coordinates ] [c1] [First coordinate (usually x-coordinate) ]]
+[[Type const &] [numerical type (int, double, ttmath, ...) to specify the coordinates ] [c2] [Second coordinate (usually y-coordinate) ]]
+[[Type const &] [numerical type (int, double, ttmath, ...) to specify the coordinates ] [c3] [Third coordinate (usually z-coordinate)]]
 ]
 
 
@@ -102,12 +108,18 @@
 
 `#include <boost/geometry/algorithms/assign.hpp>`
 
+[heading Example]
+[assign_3d_point] [assign_3d_point_output]
+
+[heading See also]
+* [link geometry.reference.algorithms.make.make_3_3_coordinate_values make]
+
 
 [endsect]
 
-[section:assign_3 assign]
+[section:assign_3_2_coordinate_values assign (2 coordinate values)]
 
-assign two values to a 2D point
+Assign two coordinates to a geometry (usually a 2D point).
 
 [heading Synopsis]
 ``template<typename Geometry, typename Type>
@@ -117,9 +129,9 @@
 
 [table
 [[Type] [Concept] [Name] [Description] ]
-[[Geometry &] [] [geometry] []]
-[[Type const &] [] [c1] []]
-[[Type const &] [] [c2] []]
+[[Geometry &] [Any type fulfilling a Geometry Concept ] [geometry] [A model of the specified concept ]]
+[[Type const &] [numerical type (int, double, ttmath, ...) to specify the coordinates ] [c1] [First coordinate (usually x-coordinate) ]]
+[[Type const &] [numerical type (int, double, ttmath, ...) to specify the coordinates ] [c2] [Second coordinate (usually y-coordinate)]]
 ]
 
 
@@ -132,6 +144,12 @@
 
 `#include <boost/geometry/algorithms/assign.hpp>`
 
+[heading Example]
+[assign_2d_point] [assign_2d_point_output]
+
+[heading See also]
+* [link geometry.reference.algorithms.make.make_2_2_coordinate_values make]
+
 
 [endsect]
 
@@ -147,7 +165,7 @@
 
 [table
 [[Type] [Concept] [Name] [Description] ]
-[[Box const &] [] [box] []]
+[[Box const &] [Any type fulfilling a Box Concept ] [box] []]
 [[Point &] [] [lower_left] []]
 [[Point &] [] [lower_right] []]
 [[Point &] [] [upper_left] []]
@@ -172,7 +190,7 @@
 assign to a box inverse infinite
 
 [heading Description]
-The assign_inverse function initialize a 2D or 3D box with large coordinates, the min corner is very large, the max corner is very small. This is a convenient starting point to collect the minimum bounding box of a geometry.
+The assign_inverse function initialize a 2D or 3D box with large coordinates, the min corner is very large, the max corner is very small. This is a convenient starting point to collect the minimum bounding box of a geometry.
 
 [heading Synopsis]
 ``template<typename Geometry>
@@ -182,7 +200,7 @@
 
 [table
 [[Type] [Concept] [Name] [Description] ]
-[[Geometry &] [] [geometry] []]
+[[Geometry &] [Any type fulfilling a Geometry Concept] [geometry] []]
 ]
 
 
@@ -195,6 +213,12 @@
 
 `#include <boost/geometry/algorithms/assign.hpp>`
 
+[heading Example]
+[assign_inverse] [assign_inverse_output]
+
+[heading See also]
+* [link geometry.reference.algorithms.make.make_inverse make]
+
 
 [endsect]
 
@@ -211,7 +235,7 @@
 [table
 [[Type] [Concept] [Name] [Description] ]
 [[Index] [indicates which box-corner, min_corner (0) or max_corner (1) or which point of segment (0/1) ] [ - ] [Must be specified]]
-[[Geometry const &] [] [geometry] []]
+[[Geometry const &] [Any type fulfilling a Box Concept or a Segment Concept ] [geometry] []]
 [[Point &] [] [point] []]
 ]
 
@@ -242,7 +266,7 @@
 [[Type] [Concept] [Name] [Description] ]
 [[Index] [indicates which box-corner, min_corner (0) or max_corner (1) or which point of segment (0/1) ] [ - ] [Must be specified]]
 [[Point const &] [] [point] []]
-[[Geometry &] [] [geometry] []]
+[[Geometry &] [Any type fulfilling a Box Concept or a Segment Concept ] [geometry] []]
 ]
 
 
@@ -273,7 +297,7 @@
 
 [table
 [[Type] [Concept] [Name] [Description] ]
-[[Geometry &] [the geometry type ] [geometry] []]
+[[Geometry &] [Any type fulfilling a Geometry Concept ] [geometry] []]
 ]
 
 

Modified: trunk/libs/geometry/doc/reference/make.qbk
==============================================================================
--- trunk/libs/geometry/doc/reference/make.qbk (original)
+++ trunk/libs/geometry/doc/reference/make.qbk 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -13,27 +13,25 @@
 
 [/ Generated by doxygen_xml2qbk, don't change, will be overwritten automatically]
 [/ Generated from doxy/doxygen_output/xml/group__make.xml]
-[section:make_3 make]
+[section:make_1_with_a_range make (with a range)]
 
-Make a geometry.
+Construct a geometry.
 
 [heading Synopsis]
-``template<typename Geometry, typename T>
-Geometry make(T const & c1, T const & c2, T const & c3)``
+``template<typename Geometry, typename Range>
+Geometry make(Range const & range)``
 
 [heading Parameters]
 
 [table
 [[Type] [Concept] [Name] [Description] ]
-[[Geometry] [] [ - ] [Must be specified]]
-[[T const &] [] [c1] []]
-[[T const &] [] [c2] []]
-[[T const &] [] [c3] []]
+[[Geometry] [Any type fulfilling a Geometry Concept ] [ - ] [Must be specified]]
+[[Range const &] [Any type fulfilling a Range Concept where it range_value type fulfills the Point Concept ] [range] [A range containg points fulfilling range and point concepts ]]
 ]
 
 
 [heading Returns]
-a 3D point
+The constructed geometry, here: a linestring or a linear ring
 
 [heading Header]
 Either
@@ -44,33 +42,75 @@
 
 `#include <boost/geometry/algorithms/make.hpp>`
 
+[heading Example]
+[make_with_range] [make_with_range_output]
+
+[heading See also]
+* [link geometry.reference.algorithms.assign.assign_2_with_a_range assign]
+
 
 [endsect]
 
-[section:make_2 make]
+[section:make_3_3_coordinate_values make (3 coordinate values)]
 
-Make a geometry.
+Construct a geometry.
 
-[heading Description]
-the Generic Geometry Library uses concepts for all its geometries. Therefore it does not rely on constructors. The "make" functions are object generators creating geometries. There are overloads with two, three, four or six values, which are implemented depending on the geometry specified.
+[heading Synopsis]
+``template<typename Geometry, typename Type>
+Geometry make(Type const & c1, Type const & c2, Type const & c3)``
+
+[heading Parameters]
+
+[table
+[[Type] [Concept] [Name] [Description] ]
+[[Geometry] [Any type fulfilling a Geometry Concept ] [ - ] [Must be specified]]
+[[Type const &] [numerical type (int, double, ttmath, ...) to specify the coordinates ] [c1] [First coordinate (usually x-coordinate) ]]
+[[Type const &] [numerical type (int, double, ttmath, ...) to specify the coordinates ] [c2] [Second coordinate (usually y-coordinate) ]]
+[[Type const &] [numerical type (int, double, ttmath, ...) to specify the coordinates ] [c3] [Third coordinate (usually z-coordinate) ]]
+]
+
+
+[heading Returns]
+The constructed geometry, here: a 3D point
+
+[heading Header]
+Either
+
+`#include <boost/geometry/geometry.hpp>`
+
+Or
+
+`#include <boost/geometry/algorithms/make.hpp>`
+
+[heading Example]
+[make_3d_point] [make_3d_point_output]
+
+[heading See also]
+* [link geometry.reference.algorithms.assign.assign_4_3_coordinate_values assign]
+
+
+[endsect]
+
+[section:make_2_2_coordinate_values make (2 coordinate values)]
+
+Construct a geometry.
 
 [heading Synopsis]
-``template<typename Geometry, typename T, >
-Geometry make(T const & c1, T const & c2)``
+``template<typename Geometry, typename Type>
+Geometry make(Type const & c1, Type const & c2)``
 
 [heading Parameters]
 
 [table
 [[Type] [Concept] [Name] [Description] ]
-[[Geometry] [] [ - ] [Must be specified]]
-[[G] [the geometry type ] [ - ] [Must be specified]]
-[[T const &] [the coordinate type ] [c1] []]
-[[T const &] [the coordinate type ] [c2] []]
+[[Geometry] [Any type fulfilling a Geometry Concept ] [ - ] [Must be specified]]
+[[Type const &] [numerical type (int, double, ttmath, ...) to specify the coordinates ] [c1] [First coordinate (usually x-coordinate) ]]
+[[Type const &] [numerical type (int, double, ttmath, ...) to specify the coordinates ] [c2] [Second coordinate (usually y-coordinate) ]]
 ]
 
 
 [heading Returns]
-the geometry
+The constructed geometry, here: a 2D point
 
 [heading Header]
 Either
@@ -81,15 +121,21 @@
 
 `#include <boost/geometry/algorithms/make.hpp>`
 
+[heading Example]
+[make_2d_point] [make_2d_point_output]
+
+[heading See also]
+* [link geometry.reference.algorithms.assign.assign_3_2_coordinate_values assign]
+
 
 [endsect]
 
 [section:make_inverse make_inverse]
 
-Create a box with inverse infinite coordinates.
+Construct a box with inverse infinite coordinates.
 
 [heading Description]
-The make_inverse function initialize a 2D or 3D box with large coordinates, the min corner is very large, the max corner is very small
+The make_inverse function initializes a 2D or 3D box with large coordinates, the min corner is very large, the max corner is very small. This is useful e.g. in combination with the combine function, to determine the bounding box of a series of geometries.
 
 [heading Synopsis]
 ``template<typename Geometry>
@@ -99,12 +145,12 @@
 
 [table
 [[Type] [Concept] [Name] [Description] ]
-[[Geometry] [the geometry type ] [ - ] [Must be specified]]
+[[Geometry] [Any type fulfilling a Geometry Concept ] [ - ] [Must be specified]]
 ]
 
 
 [heading Returns]
-the box
+The constructed geometry, here: a box
 
 [heading Header]
 Either
@@ -115,12 +161,18 @@
 
 `#include <boost/geometry/algorithms/make.hpp>`
 
+[heading Example]
+[make_inverse] [make_inverse_output]
+
+[heading See also]
+* [link geometry.reference.algorithms.assign.assign_inverse assign]
+
 
 [endsect]
 
 [section:make_zero make_zero]
 
-Create a geometry with "zero" coordinates.
+Construct a geometry with its coordinates initialized to zero.
 
 [heading Description]
 The make_zero function initializes a 2D or 3D point or box with coordinates of zero
@@ -133,12 +185,12 @@
 
 [table
 [[Type] [Concept] [Name] [Description] ]
-[[Geometry] [the geometry type ] [ - ] [Must be specified]]
+[[Geometry] [Any type fulfilling a Geometry Concept ] [ - ] [Must be specified]]
 ]
 
 
 [heading Returns]
-the geometry
+The constructed and zero-initialized geometry
 
 [heading Header]
 Either

Modified: trunk/libs/geometry/doc/src/examples/algorithms/Jamfile.v2
==============================================================================
--- trunk/libs/geometry/doc/src/examples/algorithms/Jamfile.v2 (original)
+++ trunk/libs/geometry/doc/src/examples/algorithms/Jamfile.v2 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -14,6 +14,11 @@
 exe area : area.cpp ;
 exe area_with_strategy : area_with_strategy.cpp ;
 
+exe assign_2d_point : assign_2d_point.cpp ;
+exe assign_3d_point : assign_3d_point.cpp ;
+exe assign_inverse : assign_inverse.cpp ;
+exe assign_with_range : assign_with_range.cpp ;
+
 exe for_each_point : for_each_point.cpp ;
 exe for_each_point_const : for_each_point_const.cpp ;
 exe for_each_segment_const : for_each_segment_const.cpp ;
@@ -23,6 +28,11 @@
 
 exe intersects_linestring : intersects_linestring.cpp ;
 
+exe make_2d_point : make_2d_point.cpp ;
+exe make_3d_point : make_3d_point.cpp ;
+exe make_inverse : make_inverse.cpp ;
+exe make_with_range : make_with_range.cpp ;
+
 exe num_geometries : num_geometries.cpp ;
 exe num_interior_rings : num_interior_rings.cpp ;
 exe num_points : num_points.cpp ;

Added: trunk/libs/geometry/doc/src/examples/algorithms/assign_2d_point.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/algorithms/assign_2d_point.cpp 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -0,0 +1,54 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2011, Geodan, Amsterdam, the Netherlands
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Quickbook Example
+
+//[assign_2d_point
+//` Shows the usage of assign to set point coordinates, and, besides that, shows how you can initialize ttmath points with high precision
+
+#include <iostream>
+#include <iomanip>
+
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/extensions/contrib/ttmath_stub.hpp>
+
+
+int main()
+{
+ using boost::geometry::assign;
+
+
+ boost::geometry::model::d2::point_xy<double> p1;
+ assign(p1, 1.2345, 2.3456);
+
+ boost::geometry::model::d2::point_xy<ttmath::Big<1,4> > p2;
+ assign(p2, "1.2345", "2.3456"); /*< It is possible to assign coordinates with other types than the coordinate type.
+ For ttmath, you can e.g. conveniently use strings. The advantage is that it then has higher precision, because
+ if doubles are used for assignments the double-precision is used.
+ >*/
+
+ std::cout
+ << std::setprecision(20)
+ << boost::geometry::dsv(p1) << std::endl
+ << boost::geometry::dsv(p2) << std::endl;
+
+ return 0;
+}
+
+//]
+
+
+//[assign_2d_point_output
+/*`
+Output:
+[pre
+(1.2344999999999999, 2.3456000000000001)
+(1.2345, 2.3456)
+]
+*/
+//]

Added: trunk/libs/geometry/doc/src/examples/algorithms/assign_3d_point.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/algorithms/assign_3d_point.cpp 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -0,0 +1,39 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2011, Geodan, Amsterdam, the Netherlands
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Quickbook Example
+
+//[assign_3d_point
+//` Use assign to set three coordinates of a 3D point
+
+#include <iostream>
+#include <iomanip>
+
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+
+int main()
+{
+ boost::geometry::model::point<double, 3, boost::geometry::cs::cartesian> p;
+ boost::geometry::assign(p, 1.2345, 2.3456, 3.4567);
+
+ std::cout << boost::geometry::dsv(p) << std::endl;
+
+ return 0;
+}
+
+//]
+
+
+//[assign_3d_point_output
+/*`
+Output:
+[pre
+(1.2345, 2.3456, 3.4567)
+]
+*/
+//]

Added: trunk/libs/geometry/doc/src/examples/algorithms/assign_inverse.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/algorithms/assign_inverse.cpp 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -0,0 +1,45 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2011, Geodan, Amsterdam, the Netherlands
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Quickbook Example
+
+//[assign_inverse
+//` Usage of assign_inverse and combine to conveniently determine bounding 3D box of two points
+
+#include <iostream>
+
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+
+using namespace boost::geometry;
+
+int main()
+{
+ typedef model::point<float, 3, cs::cartesian> point;
+ typedef model::box<point> box;
+
+ box all;
+ assign_inverse(all);
+ std::cout << dsv(all) << std::endl;
+ combine(all, point(0, 0, 0));
+ combine(all, point(1, 2, 3));
+ std::cout << dsv(all) << std::endl;
+
+ return 0;
+}
+
+//]
+
+
+//[assign_inverse_output
+/*`
+Output:
+[pre
+((3.40282e+038, 3.40282e+038, 3.40282e+038), (-3.40282e+038, -3.40282e+038, -3.40282e+038))
+((0, 0, 0), (1, 2, 3))]
+*/
+//]

Added: trunk/libs/geometry/doc/src/examples/algorithms/assign_with_range.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/algorithms/assign_with_range.cpp 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -0,0 +1,71 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2011, Geodan, Amsterdam, the Netherlands
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Quickbook Example
+
+//[assign_with_range
+//` Shows usage of Boost.Geometry's assign, Boost.Assign, and Boost.Range to assign ranges of a linestring
+
+#include <iostream>
+
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+
+#include <boost/assign.hpp>
+#include <boost/geometry/geometries/adapted/boost_range/filtered.hpp>
+
+template <typename T>
+struct x_between
+{
+ x_between(T a, T b)
+ : fa(a), fb(b)
+ {}
+
+ template <typename P>
+ bool operator()(P const& p) const
+ {
+ return boost::geometry::get<0>(p) >= fa
+ && boost::geometry::get<0>(p) <= fb;
+ }
+private :
+ T fa, fb;
+};
+
+
+int main()
+{
+ using namespace boost::assign;
+
+ typedef boost::geometry::model::linestring<boost::tuple<int, int> > ls;
+
+ ls line1, line2, line3;
+
+ line1 = tuple_list_of(0, 0)(2, 3)(4, 0)(6, 3)(8, 0)(10, 3)(12, 0); /*< tuple_list_of is part of Boost.Assign and can be used for Boost.Geometry if points are tuples >*/
+ boost::geometry::assign(line2, tuple_list_of(0, 0)(2, 2)(4, 0)(6, 2)(8, 0)); /*< tuple_list_of delivers a range and can therefore be used in boost::geometry::assign >*/
+ boost::geometry::assign(line3, line1 | boost::adaptors::filtered(x_between<int>(4, 8))); /*< Boost.Range adaptors can also be used in boost::geometry::assign >*/
+
+ std::cout << "line 1: " << boost::geometry::dsv(line1) << std::endl;
+ std::cout << "line 2: " << boost::geometry::dsv(line2) << std::endl;
+ std::cout << "line 3: " << boost::geometry::dsv(line3) << std::endl;
+
+ return 0;
+}
+
+//]
+
+
+//[assign_with_range_output
+/*`
+Output:
+[pre
+line 1: ((0, 0), (2, 3), (4, 0), (6, 3), (8, 0), (10, 3), (12, 0))
+line 2: ((0, 0), (2, 2), (4, 0), (6, 2), (8, 0))
+line 3: ((4, 0), (6, 3), (8, 0))
+]
+*/
+//]

Added: trunk/libs/geometry/doc/src/examples/algorithms/intersects_segment.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/algorithms/intersects_segment.cpp 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -0,0 +1,44 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2011, Geodan, Amsterdam, the Netherlands
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Quickbook Example
+
+//[intersects
+//` Check if two linestrings intersect each other
+
+#include <iostream>
+
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+
+int main()
+{
+ // Calculate the intersects of a cartesian polygon
+ typedef boost::geometry::model::d2::point_xy<double> P;
+ bg::model::linestring<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);
+
+ std::cout << "Intersects: " << (b ? "YES" : "NO") << std::endl;
+
+ return 0;
+}
+
+//]
+
+
+//[intersects_output
+/*`
+Output:
+[pre
+Intersects: YES
+]
+*/
+//]

Added: trunk/libs/geometry/doc/src/examples/algorithms/make_2d_point.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/algorithms/make_2d_point.cpp 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -0,0 +1,61 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2011, Geodan, Amsterdam, the Netherlands
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Quickbook Example
+
+//[make_2d_point
+//` Shows the usage of make as a generic constructor for different point types
+
+#include <iostream>
+
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/register/point.hpp>
+#include <boost/geometry/geometries/adapted/tuple_cartesian.hpp>
+#include <boost/geometry/geometries/adapted/boost_polygon/point.hpp>
+
+struct mypoint { float _x, _y; };
+
+BOOST_GEOMETRY_REGISTER_POINT_2D(mypoint, float, cs::cartesian, _x, _y)
+
+template <typename Point>
+void construct_and_display()
+{
+ using boost::geometry::make;
+ using boost::geometry::get;
+
+ Point p = make<Point>(1, 2);
+
+ std::cout << "x=" << get<0>(p) << " y=" << get<1>(p)
+ << " (" << typeid(Point).name() << ")"
+ << std::endl;
+}
+
+int main()
+{
+ construct_and_display<boost::geometry::model::d2::point_xy<double> >();
+ construct_and_display<boost::geometry::model::d2::point_xy<int> >();
+ construct_and_display<boost::tuple<double, double> >();
+ construct_and_display<boost::polygon::point_data<int> >();
+ construct_and_display<mypoint>();
+ return 0;
+}
+
+//]
+
+//[make_2d_point_output
+/*`
+Output (compiled using gcc):
+[pre
+x=1 y=2 (N5boost8geometry5model2d28point_xyIdNS0_2cs9cartesianEEE)
+x=1 y=2 (N5boost8geometry5model2d28point_xyIiNS0_2cs9cartesianEEE)
+x=1 y=2 (N5boost6tuples5tupleIddNS0_9null_typeES2_S2_S2_S2_S2_S2_S2_EE)
+x=1 y=2 (N5boost7polygon10point_dataIiEE)
+x=1 y=2 (7mypoint)
+]
+*/
+//]

Added: trunk/libs/geometry/doc/src/examples/algorithms/make_3d_point.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/algorithms/make_3d_point.cpp 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -0,0 +1,36 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2011, Geodan, Amsterdam, the Netherlands
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Quickbook Example
+
+//[make_3d_point
+//` Using make to construct a three dimensional point
+
+#include <iostream>
+
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+
+int main()
+{
+ typedef boost::geometry::model::point<double, 3, boost::geometry::cs::cartesian> point_type;
+ point_type p = boost::geometry::make<point_type>(1, 2, 3);
+ std::cout << boost::geometry::dsv(p) << std::endl;
+ return 0;
+}
+
+//]
+
+
+//[make_3d_point_output
+/*`
+Output:
+[pre
+(1, 2, 3)
+]
+*/
+//]

Added: trunk/libs/geometry/doc/src/examples/algorithms/make_inverse.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/algorithms/make_inverse.cpp 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -0,0 +1,46 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2011, Geodan, Amsterdam, the Netherlands
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Quickbook Example
+
+//[make_inverse
+//` Usage of make_inverse and combine to conveniently determine bounding box of several objects
+
+#include <iostream>
+
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+
+using namespace boost::geometry;
+
+int main()
+{
+
+ typedef model::d2::point_xy<double> point;
+ typedef model::box<point> box;
+
+ box all = make_inverse<box>();
+ std::cout << dsv(all) << std::endl;
+ combine(all, make<box>(0, 0, 3, 4));
+ combine(all, make<box>(2, 2, 5, 6));
+ std::cout << dsv(all) << std::endl;
+
+ return 0;
+}
+
+//]
+
+
+//[make_inverse_output
+/*`
+Output:
+[pre
+((1.79769e+308, 1.79769e+308), (-1.79769e+308, -1.79769e+308))
+((0, 0), (5, 6))
+]
+*/
+//]

Added: trunk/libs/geometry/doc/src/examples/algorithms/make_with_range.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/algorithms/make_with_range.cpp 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -0,0 +1,48 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2011, Geodan, Amsterdam, the Netherlands
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Quickbook Example
+
+//[make_with_range
+//` Using make to construct a linestring with two different range types
+
+#include <iostream>
+
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
+#include <boost/geometry/geometries/adapted/c_array_cartesian.hpp> /*< Necessary to register a C array like {1,2} as a point >*/
+
+
+int main()
+{
+ using boost::geometry::make;
+
+ typedef boost::geometry::model::d2::point_xy<double> point;
+ typedef boost::geometry::model::linestring<point> linestring;
+
+ double coordinates[][2] = {{1,2}, {3,4}, {5, 6}}; /*< Initialize with C array points >*/
+ linestring ls = make<linestring>(coordinates);
+ std::cout << boost::geometry::dsv(ls) << std::endl;
+
+ point points[3] = { make<point>(9,8), make<point>(7,6), make<point>(5,4) }; /*< Construct array with points, using make which should work for any point type >*/
+ std::cout << boost::geometry::dsv(make<linestring>(points)) << std::endl; /*< Construct linestring with point-array and output it as Delimiter Separated Values >*/
+
+ return 0;
+}
+
+//]
+
+
+//[make_with_range_output
+/*`
+Output:
+[pre
+((1, 2), (3, 4), (5, 6))
+((9, 8), (7, 6), (5, 4))
+]
+*/
+//]

Added: trunk/libs/geometry/doc/src/examples/algorithms/simplify_inserter_with_strategy.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/geometry/doc/src/examples/algorithms/simplify_inserter_with_strategy.cpp 2011-02-21 14:28:12 EST (Mon, 21 Feb 2011)
@@ -0,0 +1,72 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+//
+// Copyright Barend Gehrels 2011, Geodan, Amsterdam, the Netherlands
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Quickbook Example
+
+//[simplify_inserter
+//` Simplify a linestring using an output iterator
+
+#include <iostream>
+#include <boost/geometry/geometry.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
+#include <boost/geometry/extensions/gis/io/wkt/stream_wkt.hpp>
+
+
+
+int main()
+{
+ typedef boost::geometry::model::d2::point_xy<double> P;
+ typedef boost::geometry::model::linestring<P> L;
+
+ L line;
+ boost::geometry::read_wkt("linestring(1.1 1.1, 2.5 2.1, 3.1 3.1, 4.9 1.1, 3.1 1.9)", line);
+
+ typedef boost::geometry::strategy::distance::projected_point<P, P> DS;
+ typedef boost::geometry::strategy::simplify::douglas_peucker<P, DS> simplification;
+
+ L simplified;
+ boost::geometry::simplify_inserter(line, std::back_inserter(simplified), 0.5, simplification()); //std::ostream_iterator<P>(std::cout, "\n"), 0.5);//);
+ //std::cout << simplified[0];
+ //boost::geometry::simplify_inserter(line, std::ostream_iterator<P>(std::cout, "\n"), 0.5);//, simplification());
+
+ std::ostream_iterator<P> out(std::cout, "\n");
+ std::copy(simplified.begin(), simplified.end(), out);
+
+ std::cout
+ << " original: " << boost::geometry::dsv(line) << std::endl
+ << "simplified: " << boost::geometry::dsv(simplified) << std::endl;
+
+ return 0;
+}
+
+//]
+
+
+//[simplify_inserter_output
+/*`
+Output:
+[pre
+simplify_inserter: 16
+simplify_inserter: 0.339837
+]
+*/
+//]
+/*
+OUTPUT
+POINT(1.1 1.1) original: ((1.1, 1.1), (2.5, 2.1), (3.1, 3.1), (4.9, 1.1), (3.1, 1.9))
+simplified: ((1.1, 1.1), (3.1, 3.1), (4.9, 1.1), (3.1, 1.9))
+*/
+/*
+OUTPUT
+POINT(1.1 1.1) original: ((1.1, 1.1), (2.5, 2.1), (3.1, 3.1), (4.9, 1.1), (3.1, 1.9))
+simplified: ((1.1, 1.1), (3.1, 3.1), (4.9, 1.1), (3.1, 1.9))
+*/
+/*
+OUTPUT
+POINT(1.1 1.1) original: ((1.1, 1.1), (2.5, 2.1), (3.1, 3.1), (4.9, 1.1), (3.1, 1.9))
+simplified: ((1.1, 1.1), (3.1, 3.1), (4.9, 1.1), (3.1, 1.9))
+*/


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