diff --git a/doc/doxy/Doxyfile b/doc/doxy/Doxyfile index 22d7a0a3b..7c34fb5e0 100644 --- a/doc/doxy/Doxyfile +++ b/doc/doxy/Doxyfile @@ -50,6 +50,7 @@ ALIASES = qbk{1}="\xmlonly \1 \endxmlonly" \ brief_macro{1}="Macro to register a \1" \ brief_macro_const=" (const version)" \ brief_macro_getset=" (having separate get/set methods)" \ + brief_meta{3}="Metafunction defining [*\1] as the specified \2 of the \3" \ tparam_allocator="container-allocator-type" \ tparam_box="Any type fulfilling a Box Concept" \ tparam_box_or_segment="Any type fulfilling a Box Concept or a Segment Concept" \ @@ -107,6 +108,8 @@ ALIASES = qbk{1}="\xmlonly \1 \endxmlonly" \ return_check{1}="Returns true if the geometry \1" \ return_check2{1}="Returns true if two geometries \1" \ return_out="The output iterator" \ + meta_geometry_type="specified geometry type" \ + meta_point_type="point type making up the specified geometry type" \ brf_for_each{1}="Applies function [*f] to each \1" \ det_envelope="envelope (also known as axis aligned bounding box, aabb, or minimum bounding rectangle, mbr)" \ det_buffer="buffer (a polygon being the spatial point set collection within a specified maximum distance from a geometry)" \ diff --git a/doc/doxy/doxygen_output/html/doxygen.css b/doc/doxy/doxygen_output/html/doxygen.css index 74445fe1f..d6aaf2804 100644 --- a/doc/doxy/doxygen_output/html/doxygen.css +++ b/doc/doxy/doxygen_output/html/doxygen.css @@ -8,15 +8,10 @@ body, table, div, p, dl { /* @group Heading Levels */ h1 { + text-align: center; font-size: 150%; } -.title { - font-size: 150%; - font-weight: bold; - margin: 10px 2px; -} - h2 { font-size: 120%; } @@ -69,8 +64,8 @@ h3.version { } div.qindex, div.navtab{ - background-color: #EBEFF6; - border: 1px solid #A3B4D7; + background-color: #e8eef2; + border: 1px solid #84b0c7; text-align: center; margin: 2px; padding: 2px; @@ -88,13 +83,13 @@ div.navtab { /* @group Link Styling */ a { - color: #3D578C; + color: #153788; font-weight: normal; text-decoration: none; } .contents a:visited { - color: #4665A2; + color: #1b77c5; } a:hover { @@ -107,9 +102,9 @@ a.qindex { a.qindexHL { font-weight: bold; - background-color: #9CAFD4; + background-color: #6666cc; color: #ffffff; - border: 1px double #869DCA; + border: 1px double #9295C2; } .contents a.qindexHL:visited { @@ -124,11 +119,11 @@ a.elRef { } a.code { - color: #4665A2; + color: #3030f0; } a.codeRef { - color: #4665A2; + color: #3030f0; } /* @end */ @@ -143,8 +138,8 @@ dl.el { } pre.fragment { - border: 1px solid #C4CFE5; - background-color: #FBFCFD; + border: 1px solid #CCCCCC; + background-color: #f5f5f5; padding: 4px 6px; margin: 4px 8px 4px 2px; overflow: auto; @@ -158,22 +153,13 @@ div.ah { font-weight: bold; color: #ffffff; margin-bottom: 3px; - margin-top: 3px; - padding: 0.2em; - border: solid thin #333; - border-radius: 0.5em; - -webkit-border-radius: .5em; - -moz-border-radius: .5em; - box-shadow: 2px 2px 3px #999; - -webkit-box-shadow: 2px 2px 3px #999; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); - background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); + margin-top: 3px } div.groupHeader { margin-left: 16px; margin-top: 12px; + margin-bottom: 6px; font-weight: bold; } @@ -185,32 +171,27 @@ div.groupText { body { background: white; color: black; - margin: 0; -} - -div.contents { - margin-top: 10px; - margin-left: 10px; - margin-right: 5px; + margin-right: 20px; + margin-left: 20px; } td.indexkey { - background-color: #EBEFF6; + background-color: #e8eef2; font-weight: bold; - border: 1px solid #C4CFE5; + border: 1px solid #CCCCCC; margin: 2px 0px 2px 0; padding: 2px 10px; } td.indexvalue { - background-color: #EBEFF6; - border: 1px solid #C4CFE5; + background-color: #e8eef2; + border: 1px solid #CCCCCC; padding: 2px 10px; margin: 2px 0px; } tr.memlist { - background-color: #EEF1F7; + background-color: #f0f0f0; } p.formulaDsp { @@ -236,11 +217,6 @@ div.center img { border: 0px; } -address.footer { - text-align: right; - padding-right: 12px; -} - img.footer { border: 0px; vertical-align: middle; @@ -294,7 +270,6 @@ span.vhdllogic { /* @end */ -/* .search { color: #003399; font-weight: bold; @@ -311,7 +286,6 @@ input.search { font-weight: normal; background-color: #e8eef2; } -*/ td.tiny { font-size: 75%; @@ -320,18 +294,18 @@ td.tiny { .dirtab { padding: 4px; border-collapse: collapse; - border: 1px solid #A3B4D7; + border: 1px solid #84b0c7; } th.dirtab { - background: #EBEFF6; + background: #e8eef2; font-weight: bold; } hr { height: 0px; border: none; - border-top: 1px solid #4A6AAA; + border-top: 1px solid #666; } hr.footer { @@ -340,15 +314,10 @@ hr.footer { /* @group Member Descriptions */ -table.memberdecls { - border-spacing: 0px; - padding: 0px; -} - .mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams { - background-color: #F9FAFC; + background-color: #FAFAFA; border: none; margin: 4px; padding: 1px 0 0 8px; @@ -360,19 +329,15 @@ table.memberdecls { } .memItemLeft, .memItemRight, .memTemplParams { - border-top: 1px solid #C4CFE5; + border-top: 1px solid #ccc; } .memItemLeft, .memTemplItemLeft { white-space: nowrap; } -.memItemRight { - width: 100%; -} - .memTemplParams { - color: #4665A2; + color: #606060; white-space: nowrap; } @@ -384,28 +349,23 @@ table.memberdecls { .memtemplate { font-size: 80%; - color: #4665A2; + color: #606060; font-weight: normal; - margin-left: 9px; + margin-left: 3px; } .memnav { - background-color: #EBEFF6; - border: 1px solid #A3B4D7; + background-color: #e8eef2; + border: 1px solid #84b0c7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } -.mempage { - width: 100%; -} - .memitem { padding: 0; margin-bottom: 10px; - margin-right: 5px; } .memname { @@ -415,52 +375,40 @@ table.memberdecls { } .memproto { - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; - padding: 6px 0px 6px 0px; - color: #253555; + border-top: 1px solid #84b0c7; + border-left: 1px solid #84b0c7; + border-right: 1px solid #84b0c7; + padding: 0; + background-color: #d5e1e8; font-weight: bold; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - /* opera specific markup */ - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - border-top-right-radius: 8px; - border-top-left-radius: 8px; /* firefox specific markup */ + background-image: -moz-linear-gradient(rgba(228, 233, 245, 1.0) 0%, rgba(193, 205, 232, 1.0) 100%); -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; -moz-border-radius-topright: 8px; -moz-border-radius-topleft: 8px; /* webkit specific markup */ + background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(228, 233, 245, 1.0)), to(rgba(193, 205, 232, 1.0))); -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -webkit-border-top-right-radius: 8px; -webkit-border-top-left-radius: 8px; - background-image:url('nav_f.png'); - background-repeat:repeat-x; - background-color: #E2E8F2; } .memdoc { - border-bottom: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #84b0c7; + border-left: 1px solid #84b0c7; + border-right: 1px solid #84b0c7; padding: 2px 5px; - background-color: #FBFCFD; + background-color: #eef3f5; border-top-width: 0; - /* opera specific markup */ - border-bottom-left-radius: 8px; - border-bottom-right-radius: 8px; - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); /* firefox specific markup */ -moz-border-radius-bottomleft: 8px; -moz-border-radius-bottomright: 8px; -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7); /* webkit specific markup */ -webkit-border-bottom-left-radius: 8px; -webkit-border-bottom-right-radius: 8px; -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7)); } .paramkey { @@ -479,28 +427,6 @@ table.memberdecls { font-style: normal; } -.params, .retval, .exception, .tparams { - border-spacing: 6px 2px; -} - -.params .paramname, .retval .paramname { - font-weight: bold; - vertical-align: top; -} - -.params .paramtype { - font-style: italic; - vertical-align: top; -} - -.params .paramdir { - font-family: "courier new",courier,monospace; - vertical-align: top; -} - - - - /* @end */ /* @group Directory (tree) */ @@ -509,7 +435,7 @@ table.memberdecls { .ftvtree { font-family: sans-serif; - margin: 0px; + margin: 0.5em; } /* these are for tree view when used as main index */ @@ -517,7 +443,6 @@ table.memberdecls { .directory { font-size: 9pt; font-weight: bold; - margin: 5px; } .directory h3 { @@ -595,13 +520,9 @@ proper pixel height of your image. /* @end */ -div.dynheader { - margin-top: 8px; -} - address { font-style: normal; - color: #2A3D61; + color: #333; } table.doxtable { @@ -609,12 +530,12 @@ table.doxtable { } table.doxtable td, table.doxtable th { - border: 1px solid #2D4068; + border: 1px solid #153788; padding: 3px 7px 2px; } table.doxtable th { - background-color: #374F7F; + background-color: #254798; color: #FFFFFF; font-size: 110%; padding-bottom: 4px; @@ -622,214 +543,3 @@ table.doxtable th { text-align:left; } -.tabsearch { - top: 0px; - left: 10px; - height: 36px; - background-image: url('tab_b.png'); - z-index: 101; - overflow: hidden; - font-size: 13px; -} - -.navpath ul -{ - font-size: 11px; - background-image:url('tab_b.png'); - background-repeat:repeat-x; - height:30px; - line-height:30px; - color:#8AA0CC; - border:solid 1px #C2CDE4; - overflow:hidden; - margin:0px; - padding:0px; -} - -.navpath li -{ - list-style-type:none; - float:left; - padding-left:10px; - padding-right:15px; - background-image:url('bc_s.png'); - background-repeat:no-repeat; - background-position:right; - color:#364D7C; -} - -.navpath li.navelem a -{ - height:32px; - display:block; - text-decoration: none; - outline: none; -} - -.navpath li.navelem a:hover -{ - color:#6884BD; -} - -.navpath li.footer -{ - list-style-type:none; - float:right; - padding-left:10px; - padding-right:15px; - background-image:none; - background-repeat:no-repeat; - background-position:right; - color:#364D7C; - font-size: 8pt; -} - - -div.summary -{ - float: right; - font-size: 8pt; - padding-right: 5px; - width: 50%; - text-align: right; -} - -div.summary a -{ - white-space: nowrap; -} - -div.ingroups -{ - font-size: 8pt; - padding-left: 5px; - width: 50%; - text-align: left; -} - -div.ingroups a -{ - white-space: nowrap; -} - -div.header -{ - background-image:url('nav_h.png'); - background-repeat:repeat-x; - background-color: #F9FAFC; - margin: 0px; - border-bottom: 1px solid #C4CFE5; -} - -div.headertitle -{ - padding: 5px 5px 5px 10px; -} - -dl -{ - padding: 0 0 0 10px; -} - -dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug -{ - border-left:4px solid; - padding: 0 0 0 6px; -} - -dl.note -{ - border-color: #D0C000; -} - -dl.warning, dl.attention -{ - border-color: #FF0000; -} - -dl.pre, dl.post, dl.invariant -{ - border-color: #00D000; -} - -dl.deprecated -{ - border-color: #505050; -} - -dl.todo -{ - border-color: #00C0E0; -} - -dl.test -{ - border-color: #3030E0; -} - -dl.bug -{ - border-color: #C08050; -} - -#projectlogo -{ - text-align: center; - vertical-align: bottom; - border-collapse: separate; -} - -#projectlogo img -{ - border: 0px none; -} - -#projectname -{ - font: 300% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 2px 0px; -} - -#projectbrief -{ - font: 120% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 0px; -} - -#projectnumber -{ - font: 50% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 0px; -} - -#titlearea -{ - padding: 0px; - margin: 0px; - width: 100%; - border-bottom: 1px solid #5373B4; -} - -.image -{ - text-align: center; -} - -.dotgraph -{ - text-align: center; -} - -.mscgraph -{ - text-align: center; -} - -.caption -{ - font-weight: bold; -} - diff --git a/doc/doxy/doxygen_output/html/doxygen.png b/doc/doxy/doxygen_output/html/doxygen.png index 635ed52fc..f0a274bba 100644 Binary files a/doc/doxy/doxygen_output/html/doxygen.png and b/doc/doxy/doxygen_output/html/doxygen.png differ diff --git a/doc/doxy/doxygen_output/html/tabs.css b/doc/doxy/doxygen_output/html/tabs.css index 21920562a..a44416341 100644 --- a/doc/doxy/doxygen_output/html/tabs.css +++ b/doc/doxy/doxygen_output/html/tabs.css @@ -1,59 +1,105 @@ -.tabs, .tabs2, .tabs3 { - background-image: url('tab_b.png'); - width: 100%; - z-index: 101; - font-size: 13px; +/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */ + +DIV.tabs +{ + float : left; + width : 100%; + background : url("tab_b.gif") repeat-x bottom; + margin-bottom : 4px; } -.tabs2 { - font-size: 10px; -} -.tabs3 { - font-size: 9px; +DIV.tabs UL +{ + margin : 0px; + padding-left : 10px; + list-style : none; } -.tablist { - margin: 0; - padding: 0; - display: table; +DIV.tabs LI, DIV.tabs FORM +{ + display : inline; + margin : 0px; + padding : 0px; } -.tablist li { - float: left; - display: table-cell; - background-image: url('tab_b.png'); - line-height: 36px; - list-style: none; +DIV.tabs FORM +{ + float : right; } -.tablist a { - display: block; - padding: 0 20px; - font-weight: bold; - background-image:url('tab_s.png'); - background-repeat:no-repeat; - background-position:right; - color: #283A5D; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - text-decoration: none; - outline: none; +DIV.tabs A +{ + float : left; + background : url("tab_r.gif") no-repeat right top; + border-bottom : 1px solid #84B0C7; + font-size : 80%; + font-weight : bold; + text-decoration : none; } -.tabs3 .tablist a { - padding: 0 10px; +DIV.tabs A:hover +{ + background-position: 100% -150px; } -.tablist a:hover { - background-image: url('tab_h.png'); - background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); - text-decoration: none; +DIV.tabs A:link, DIV.tabs A:visited, +DIV.tabs A:active, DIV.tabs A:hover +{ + color: #1A419D; } -.tablist li.current a { - background-image: url('tab_a.png'); - background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +DIV.tabs SPAN +{ + float : left; + display : block; + background : url("tab_l.gif") no-repeat left top; + padding : 5px 9px; + white-space : nowrap; +} + +DIV.tabs #MSearchBox +{ + float : right; + display : inline; + font-size : 1em; +} + +DIV.tabs TD +{ + font-size : 80%; + font-weight : bold; + text-decoration : none; +} + + + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +DIV.tabs SPAN {float : none;} +/* End IE5-Mac hack */ + +DIV.tabs A:hover SPAN +{ + background-position: 0% -150px; +} + +DIV.tabs LI.current A +{ + background-position: 100% -150px; + border-width : 0px; +} + +DIV.tabs LI.current SPAN +{ + background-position: 0% -150px; + padding-bottom : 6px; +} + +DIV.navpath +{ + background : none; + border : none; + border-bottom : 1px solid #84B0C7; + text-align : center; + margin : 2px; + padding : 2px; } diff --git a/doc/generated/equals_status.qbk b/doc/generated/equals_status.qbk new file mode 100644 index 000000000..6dc8bc0b2 --- /dev/null +++ b/doc/generated/equals_status.qbk @@ -0,0 +1,10 @@ +[heading Supported geometries] +[table +[[ ][Point][Box][Linestring][Ring][Polygon][MultiPolygon]] +[[Point][[$img/ok.png]][[$img/nyi.png]][[$img/nyi.png]][[$img/nyi.png]][[$img/nyi.png]][[$img/nyi.png]]] +[[Box][[$img/nyi.png]][[$img/ok.png]][[$img/nyi.png]][[$img/ok.png]][[$img/ok.png]][[$img/nyi.png]]] +[[Linestring][[$img/nyi.png]][[$img/nyi.png]][[$img/ok.png]][[$img/nyi.png]][[$img/nyi.png]][[$img/nyi.png]]] +[[Ring][[$img/nyi.png]][[$img/ok.png]][[$img/nyi.png]][[$img/ok.png]][[$img/ok.png]][[$img/nyi.png]]] +[[Polygon][[$img/nyi.png]][[$img/ok.png]][[$img/nyi.png]][[$img/ok.png]][[$img/ok.png]][[$img/ok.png]]] +[[MultiPolygon][[$img/nyi.png]][[$img/nyi.png]][[$img/nyi.png]][[$img/nyi.png]][[$img/ok.png]][[$img/ok.png]]] +] diff --git a/doc/geometry.qbk b/doc/geometry.qbk index 52ef199eb..3519723ef 100644 --- a/doc/geometry.qbk +++ b/doc/geometry.qbk @@ -42,7 +42,8 @@ [def __linestring__ Linestring] [def __polygon__ Polygon] [def __ring__ Ring] -[def __multi_point__ Multi point] +[def __multi_point__ Multi Point] +[def __multi_linestring__ Multi Linestring] [def __multi_polygon__ Multi Polygon] [def __range__ Rangelike (linestring, ring)] [def __other__ Other geometries] @@ -51,6 +52,7 @@ [/Parts] [def __ret_zero__ Returns zero] [def __ret_one__ Returns 1] +[def __does_nothing__ Nothing happens, geometry is unchanged] [def __cs_units__ in the same units as the input coordinates] [def __sph1__ on a unit sphere (or another sphere, if specified as such in the constructor of the strategy)] [template qbk_ret[what] Returns [what]] diff --git a/doc/html/img/algorithms/convex_hull.png b/doc/html/img/algorithms/convex_hull.png new file mode 100644 index 000000000..77f3213aa Binary files /dev/null and b/doc/html/img/algorithms/convex_hull.png differ diff --git a/doc/html/img/algorithms/make_envelope.png b/doc/html/img/algorithms/return_envelope.png similarity index 100% rename from doc/html/img/algorithms/make_envelope.png rename to doc/html/img/algorithms/return_envelope.png diff --git a/doc/imports.qbk b/doc/imports.qbk index 708d276c4..788bc68d3 100644 --- a/doc/imports.qbk +++ b/doc/imports.qbk @@ -21,10 +21,12 @@ [import src/examples/algorithms/assign_with_range.cpp] [import src/examples/algorithms/assign_point_to_index.cpp] [import src/examples/algorithms/assign_point_from_index.cpp] +[import src/examples/algorithms/clear.cpp] [import src/examples/algorithms/centroid.cpp] [import src/examples/algorithms/distance.cpp] [import src/examples/algorithms/difference.cpp] [import src/examples/algorithms/envelope.cpp] +[import src/examples/algorithms/expand.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] @@ -41,10 +43,12 @@ [import src/examples/algorithms/num_geometries.cpp] [import src/examples/algorithms/num_interior_rings.cpp] [import src/examples/algorithms/num_points.cpp] +[import src/examples/algorithms/reverse.cpp] [import src/examples/algorithms/return_envelope.cpp] [import src/examples/algorithms/simplify.cpp] [import src/examples/algorithms/sym_difference.cpp] [import src/examples/algorithms/union.cpp] +[import src/examples/algorithms/unique.cpp] [import src/examples/algorithms/within.cpp] [import src/examples/core/get_point.cpp] [import src/examples/core/get_box.cpp] diff --git a/doc/quickref.xml b/doc/quickref.xml index 1da360c6f..268fcfaa5 100644 --- a/doc/quickref.xml +++ b/doc/quickref.xml @@ -315,10 +315,6 @@ clear - Convert - - convert - Convex Hull convex_hull diff --git a/doc/reference.qbk b/doc/reference.qbk index d5a045365..40d5ca87d 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -69,10 +69,6 @@ [include generated/clear.qbk] [endsect] -[section:convert convert] -[include generated/convert.qbk] -[endsect] - [section:convex_hull convex_hull] [include generated/convex_hull.qbk] [endsect] diff --git a/doc/reference/algorithms/append.qbk b/doc/reference/algorithms/append.qbk index 51bd98273..1663ed65e 100644 --- a/doc/reference/algorithms/append.qbk +++ b/doc/reference/algorithms/append.qbk @@ -30,4 +30,4 @@ Linear [append_output] [heading See also] -* [link geometry.reference.algorithms.assign.assign_2_with_a_range assign] +* [link geometry.reference.algorithms.assign.assign_points assign] diff --git a/doc/reference/algorithms/comparable_distance.qbk b/doc/reference/algorithms/comparable_distance.qbk new file mode 100644 index 000000000..304b97ad6 --- /dev/null +++ b/doc/reference/algorithms/comparable_distance.qbk @@ -0,0 +1,25 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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 Behaviour] +There is no (not yet) version with a strategy. + +It depends on the coordinate system of the geometry's point type if there is +a strategy available which can determine (more efficient than the standard +strategy) a measure of comparable distance. + +[heading Complexity] +Linear + +[heading Example] +[comparable_distance] +[comparable_distance_output] diff --git a/doc/reference/algorithms/convert.qbk b/doc/reference/algorithms/convert.qbk new file mode 100644 index 000000000..651d56d2c --- /dev/null +++ b/doc/reference/algorithms/convert.qbk @@ -0,0 +1,27 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[tip convert is not defined within OGC or ISO] +[tip convert is modelled as source -> target + (where assign is modelled as target := source)] + +[heading Complexity] +Linear + +[heading Example] +[convert] +[convert_output] + +[heading See also] +* [link geometry.reference.algorithms.assign.assign assign] + + diff --git a/doc/reference/algorithms/convex_hull.qbk b/doc/reference/algorithms/convex_hull.qbk new file mode 100644 index 000000000..2a1de1892 --- /dev/null +++ b/doc/reference/algorithms/convex_hull.qbk @@ -0,0 +1,18 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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] +Linear + +[heading Example] +[convex_hull] +[convex_hull_output] diff --git a/doc/reference/algorithms/correct.qbk b/doc/reference/algorithms/correct.qbk new file mode 100644 index 000000000..6af7f74dc --- /dev/null +++ b/doc/reference/algorithms/correct.qbk @@ -0,0 +1,33 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[def __corrected__ is corrected] + +[heading Behavior] +[table +[[Case] [Behavior] ] +[[__ring__][__ring__ __corrected__]] +[[__polygon__][__polygon__ __corrected__]] +[[__multi_polygon__][__multi_polygon__ __corrected__]] +[[__box__][__box__ __corrected__ with respect to minimal and maximal corners]] +[[__other__][__does_nothing__]] +] + +[tip Correct is not defined within OGC or ISO] + +[heading Complexity] +Linear + +[heading Example] +[correct] +[correct_output] + diff --git a/doc/reference/algorithms/difference.qbk b/doc/reference/algorithms/difference.qbk index 6552d3abb..2a2869a66 100644 --- a/doc/reference/algorithms/difference.qbk +++ b/doc/reference/algorithms/difference.qbk @@ -14,7 +14,7 @@ [difference] [difference_output] [heading See also] -* [link geometry.reference.algorithms.sym_difference.sym_difference sym_difference (symmetric difference)] -* [link geometry.reference.algorithms.intersection.intersection intersection] -* [link geometry.reference.algorithms.union.union_ union] +* [link geometry.reference.algorithms.sym_difference sym_difference (symmetric difference)] +* [link geometry.reference.algorithms.intersection intersection] +* [link geometry.reference.algorithms.union_ union] diff --git a/doc/reference/algorithms/distance.qbk b/doc/reference/algorithms/distance.qbk new file mode 100644 index 000000000..f92a385ee --- /dev/null +++ b/doc/reference/algorithms/distance.qbk @@ -0,0 +1,21 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[include generated/distance_status.qbk] + +[heading Complexity] +Linear +For multi-geometry to multi-geometry: currently quadratic + +[heading Example] +[distance] +[distance_output] diff --git a/doc/reference/algorithms/equals.qbk b/doc/reference/algorithms/equals.qbk new file mode 100644 index 000000000..cc5dedcb7 --- /dev/null +++ b/doc/reference/algorithms/equals.qbk @@ -0,0 +1,21 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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) +=============================================================================/] + +[include generated/equals_status.qbk] + +[heading Complexity] +Linear + +[heading Example] +[equals] +[equals_output] + diff --git a/doc/reference/algorithms/intersection.qbk b/doc/reference/algorithms/intersection.qbk index e51377874..cb688c839 100644 --- a/doc/reference/algorithms/intersection.qbk +++ b/doc/reference/algorithms/intersection.qbk @@ -23,6 +23,6 @@ [intersection_output] [heading See also] -* [link geometry.reference.algorithms.union.union_ union] -* [link geometry.reference.algorithms.difference.difference difference] -* [link geometry.reference.algorithms.sym_difference.sym_difference sym_difference (symmetric difference)] +* [link geometry.reference.algorithms.union_ union] +* [link geometry.reference.algorithms.difference difference] +* [link geometry.reference.algorithms.sym_difference sym_difference (symmetric difference)] diff --git a/doc/reference/algorithms/sym_difference.qbk b/doc/reference/algorithms/sym_difference.qbk index 2058ca2d9..89915a256 100644 --- a/doc/reference/algorithms/sym_difference.qbk +++ b/doc/reference/algorithms/sym_difference.qbk @@ -23,7 +23,7 @@ [sym_difference_output] [heading See also] -* [link geometry.reference.algorithms.difference.difference difference] -* [link geometry.reference.algorithms.intersection.intersection intersection] -* [link geometry.reference.algorithms.union.union_ union] +* [link geometry.reference.algorithms.difference difference] +* [link geometry.reference.algorithms.intersection intersection] +* [link geometry.reference.algorithms.union_ union] diff --git a/doc/reference/algorithms/transform.qbk b/doc/reference/algorithms/transform.qbk new file mode 100644 index 000000000..5028f9a67 --- /dev/null +++ b/doc/reference/algorithms/transform.qbk @@ -0,0 +1,28 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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 Behavior] +[table +[[Case] [Behavior] ] +[[__sph__ (degree) / __sph__ (radian)][Transforms coordinates from degree to radian, or vice versa]] +[[__sph__ / __cart__ (3D)][Transforms coordinates from spherical coordinates to X,Y,Z, or vice versa, on a unit sphere]] +[[__sph__ (degree, with radius) / __sph__ (radian, with radius)][Transforms coordinates from degree to radian, or vice versa. Third coordinate (radius) is untouched]] +[[__sph__ (with radius) / __cart__ (3D)][Transforms coordinates from spherical coordinates to X,Y,Z, or vice versa, on a unit sphere. Third coordinate (radius) is taken into account]] +] + +[heading Complexity] +Linear + +[heading Example] +[transform] +[transform_output] + diff --git a/doc/reference/algorithms/transform_with_strategy.qbk b/doc/reference/algorithms/transform_with_strategy.qbk new file mode 100644 index 000000000..b1045823d --- /dev/null +++ b/doc/reference/algorithms/transform_with_strategy.qbk @@ -0,0 +1,19 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + Copyright (c) 2009-2011 Mateusz Loskot, London, UK. + Copyright (c) 2009-2011 Bruno Lalande, Paris, France. + + 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] +Linear + +[heading Example] +[transform_with_strategy] +[transform_with_strategy_output] + diff --git a/doc/reference/algorithms/union.qbk b/doc/reference/algorithms/union.qbk index 8c86a6110..d620b24d4 100644 --- a/doc/reference/algorithms/union.qbk +++ b/doc/reference/algorithms/union.qbk @@ -20,6 +20,6 @@ [union_output] [heading See also] -* [link geometry.reference.algorithms.intersection.intersection intersection] -* [link geometry.reference.algorithms.difference.difference difference] -* [link geometry.reference.algorithms.sym_difference.sym_difference sym_difference (symmetric difference)] +* [link geometry.reference.algorithms.intersection intersection] +* [link geometry.reference.algorithms.difference difference] +* [link geometry.reference.algorithms.sym_difference sym_difference (symmetric difference)] diff --git a/doc/reference/core/closure.qbk b/doc/reference/core/closure.qbk new file mode 100644 index 000000000..76db82a75 --- /dev/null +++ b/doc/reference/core/closure.qbk @@ -0,0 +1,23 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[note The closure is defined for any geometry type, but only has a real meaning + for areal geometry types (ring, polygon, multi_polygon) +] + +[heading Complexity] +Compile time + +[heading Example] +[closure] +[closure_output] + +[heading See also] +* [link geometry.reference.enumerations.closure_selector The closure_selector enumeration] diff --git a/doc/reference/core/coordinate_dimension.qbk b/doc/reference/core/coordinate_dimension.qbk new file mode 100644 index 000000000..4b599defe --- /dev/null +++ b/doc/reference/core/coordinate_dimension.qbk @@ -0,0 +1,16 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[heading Complexity] +Compile time + +[heading Example] +[dimension] +[dimension_output] diff --git a/doc/reference/core/coordinate_system.qbk b/doc/reference/core/coordinate_system.qbk new file mode 100644 index 000000000..8d636c39f --- /dev/null +++ b/doc/reference/core/coordinate_system.qbk @@ -0,0 +1,16 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[heading Complexity] +Compile time + +[heading Example] +[coordinate_system] +[coordinate_system_output] diff --git a/doc/reference/core/coordinate_type.qbk b/doc/reference/core/coordinate_type.qbk new file mode 100644 index 000000000..49df07d3d --- /dev/null +++ b/doc/reference/core/coordinate_type.qbk @@ -0,0 +1,16 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[heading Complexity] +Compile time + +[heading Example] +[coordinate_type] +[coordinate_type_output] diff --git a/doc/reference/core/degree_radian.qbk b/doc/reference/core/degree_radian.qbk new file mode 100644 index 000000000..cf4990b35 --- /dev/null +++ b/doc/reference/core/degree_radian.qbk @@ -0,0 +1,14 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + + +[heading example] +[degree_radian] +[degree_radian_output] \ No newline at end of file diff --git a/doc/reference/core/max_corner.qbk b/doc/reference/core/max_corner.qbk new file mode 100644 index 000000000..fabe2ab20 --- /dev/null +++ b/doc/reference/core/max_corner.qbk @@ -0,0 +1,26 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[section:max_corner max_corner] + +Indicates the maximal corner (upper right) of a box to be get, set or processed + +[heading Synopsis] +`` int const max_corner = 1; `` + +[include reference/core/min_max_corner.qbk] + +[heading See also] +* [link geometry.reference.constants.min_corner min_corner] +* [link geometry.reference.access.get.get_2_with_index get with index] +* [link geometry.reference.access.set.set_3_with_index set with index] + +[endsect] + diff --git a/doc/reference/core/min_corner.qbk b/doc/reference/core/min_corner.qbk new file mode 100644 index 000000000..eacb918b3 --- /dev/null +++ b/doc/reference/core/min_corner.qbk @@ -0,0 +1,25 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[section:min_corner min_corner] + +Indicates the minimal corner (lower left) of a box to be get, set or processed + +[heading Synopsis] +`` int const min_corner = 0; `` + +[include reference/core/min_max_corner.qbk] + +[heading See also] +* [link geometry.reference.constants.max_corner max_corner] +* [link geometry.reference.access.get.get_2_with_index get with index] +* [link geometry.reference.access.set.set_3_with_index set with index] + +[endsect] diff --git a/doc/reference/core/min_max_corner.qbk b/doc/reference/core/min_max_corner.qbk new file mode 100644 index 000000000..118b0fbca --- /dev/null +++ b/doc/reference/core/min_max_corner.qbk @@ -0,0 +1,31 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[/File included by min_corner.qbk and max_corner.qbk] + +[heading Header] +Either + +`#include ` + +Or + +`#include ` + +[note min_corner and max_corner are only applicable for boxes and not for, + e.g., a segment] +[note min_corner should be the minimal corner of a box, but that is not + guaranteed. Use correct to make min_corner the minimal corner. + The same applies for max_corner.] + +[/Share sample with get_box] +[heading Example] +[get_box] +[get_box_output] diff --git a/doc/reference/core/point_order.qbk b/doc/reference/core/point_order.qbk new file mode 100644 index 000000000..775ede73c --- /dev/null +++ b/doc/reference/core/point_order.qbk @@ -0,0 +1,24 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[note The point order is defined for any geometry type, but only has a real meaning + for areal geometry types (ring, polygon, multi_polygon) +] + +[heading Complexity] +Compile time + +[heading Example] +[point_order] +[point_order_output] + +[heading See also] +* [link geometry.reference.enumerations.order_selector The order_selector enumeration] + diff --git a/doc/reference/core/point_type.qbk b/doc/reference/core/point_type.qbk new file mode 100644 index 000000000..2f568ab69 --- /dev/null +++ b/doc/reference/core/point_type.qbk @@ -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] +[point_type] +[point_type_output] diff --git a/doc/reference/core/tag.qbk b/doc/reference/core/tag.qbk new file mode 100644 index 000000000..c7d7711ae --- /dev/null +++ b/doc/reference/core/tag.qbk @@ -0,0 +1,20 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[note With Boost.Geometry, tags are the driving force of the tag dispatching + mechanism. The tag metafunction is therefore used in every free function. +] + +[heading Complexity] +Compile time + +[heading Example] +[tag] +[tag_output] diff --git a/doc/reference/core/tag_cast.qbk b/doc/reference/core/tag_cast.qbk new file mode 100644 index 000000000..cfe02dd6a --- /dev/null +++ b/doc/reference/core/tag_cast.qbk @@ -0,0 +1,26 @@ +[/============================================================================ + Boost.Geometry (aka GGL, Generic Geometry Library) + + Copyright (c) 2009-2011 Barend Gehrels, Amsterdam, the Netherlands. + + Use, modification and distribution is subject to the Boost Software License, + Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +=============================================================================/] + +[note The specified tag list is handled in the specified order: as soon as a tag + inheriting the specified tag is found, it is defined as the metafunction + typedef [*type]. +] + +[note If none of the specified possible base tags is a base class of the + specified tag, the tag itself is defined as the [*type] result of the + metafunction. +] +[heading Complexity] +Compile time + +[heading Example] +[tag_cast] +[tag_cast_output] + diff --git a/doc/src/docutils/tools/implementation_status/implementation_status.cpp b/doc/src/docutils/tools/implementation_status/implementation_status.cpp index 3ce54c289..6f59fc3d7 100644 --- a/doc/src/docutils/tools/implementation_status/implementation_status.cpp +++ b/doc/src/docutils/tools/implementation_status/implementation_status.cpp @@ -71,8 +71,9 @@ struct compile_msvc command << "u"; } - command << "implementation_status.hpp tmp/t.cpp > tmp/t.out"; - // For debugging: << type1 << "_" << type2 << ".out"; + command << "implementation_status.hpp tmp/t.cpp > tmp/t" //.out"; + // For debugging: + << type1 << "_" << type2 << ".out"; int failed = system(command.str().c_str()); return failed == 0; @@ -300,7 +301,9 @@ int main(int argc, char** argv) algorithms.push_back(algorithm("correct")); algorithms.push_back(algorithm("distance", 2)); algorithms.push_back(algorithm("centroid", 2)); - //algorithms.push_back(algorithm("within", 2)); + algorithms.push_back(algorithm("intersects", 2)); + algorithms.push_back(algorithm("within", 2)); + algorithms.push_back(algorithm("equals", 2)); typedef std::vector cs_type; cs_type css; diff --git a/doc/src/examples/algorithms/Jamfile.v2 b/doc/src/examples/algorithms/Jamfile.v2 index d1be69fb9..ebc5081af 100644 --- a/doc/src/examples/algorithms/Jamfile.v2 +++ b/doc/src/examples/algorithms/Jamfile.v2 @@ -13,22 +13,34 @@ project boost-geometry-doc-example-algorithms : # requirements ; +exe append : append.cpp ; + exe area : area.cpp ; exe area_with_strategy : area_with_strategy.cpp ; +exe assign : assign.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 assign_box_corners : assign_box_corners.cpp ; -exe assign_point_from_index : assign_point_from_index.cpp ; -exe assign_point_to_index : assign_point_to_index.cpp ; +exe assign_points : assign_points.cpp ; +# exe assign_box_corners : assign_box_corners.cpp ; +# exe assign_point_from_index : assign_point_from_index.cpp ; +# exe assign_point_to_index : assign_point_to_index.cpp ; exe centroid : centroid.cpp ; exe clear : clear.cpp ; +exe comparable_distance : comparable_distance.cpp ; +exe convert : convert.cpp ; +exe convex_hull : convex_hull.cpp ; +exe correct : correct.cpp ; +exe difference : difference.cpp ; exe distance : distance.cpp ; +exe envelope : envelope.cpp ; +exe equals : equals.cpp ; +exe expand : expand.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 ; @@ -38,19 +50,29 @@ exe intersection_segment : intersection_segment.cpp ; exe intersects_linestring : intersects_linestring.cpp ; +exe length : length.cpp ; +exe length_with_strategy : length_with_strategy.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 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 ; +exe return_envelope : return_envelope.cpp ; -exe length : length.cpp ; -exe length_with_strategy : length_with_strategy.cpp ; +exe reverse : reverse.cpp ; exe simplify : length.cpp ; +exe sym_difference : sym_difference.cpp ; + +exe transform : transform.cpp ; +exe transform_with_strategy : transform_with_strategy.cpp ; + +exe union : union.cpp ; +exe unique : unique.cpp ; exe within : within.cpp ; diff --git a/doc/src/examples/algorithms/assign.cpp b/doc/src/examples/algorithms/assign.cpp new file mode 100644 index 000000000..bc5b4cdc5 --- /dev/null +++ b/doc/src/examples/algorithms/assign.cpp @@ -0,0 +1,61 @@ +// 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) + +//[assign +//` Shows how to assign a geometry from another geometry + +#include + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point; + typedef boost::geometry::model::box box; + typedef boost::geometry::model::polygon polygon; + + point p1; + box b; + boost::geometry::assign_values(p1, 1, 1); + boost::geometry::assign_values(b, 1, 1, 2, 2); + + // Assign a box to a polygon (target = source) + polygon p; + boost::geometry::assign(p, b); + + // Assign a point to another point type (conversion of point-type) + boost::tuple p2; + boost::geometry::assign(p2, p1); + + using boost::geometry::dsv; + std::cout + << "box: " << dsv(b) << std::endl + << "polygon: " << dsv(p) << std::endl + << "point: " << dsv(p1) << std::endl + << "point tuples: " << dsv(p2) << std::endl + ; + + return 0; +} + +//] + + +//[assign_output +/*` +Output: +[pre +box: ((1, 1), (2, 2)) +polygon: (((1, 1), (1, 2), (2, 2), (2, 1), (1, 1))) +point: (1, 1) +point tuples: (1, 1) +] +*/ +//] diff --git a/doc/src/examples/algorithms/assign_2d_point.cpp b/doc/src/examples/algorithms/assign_2d_point.cpp index e01da8d7a..e32f5b5c7 100644 --- a/doc/src/examples/algorithms/assign_2d_point.cpp +++ b/doc/src/examples/algorithms/assign_2d_point.cpp @@ -23,15 +23,15 @@ int main() { - using boost::geometry::assign; + using boost::geometry::assign_values; boost::geometry::model::d2::point_xy p1; - assign(p1, 1.2345, 2.3456); + assign_values(p1, 1.2345, 2.3456); #if defined(HAVE_TTMATH) boost::geometry::model::d2::point_xy > p2; - assign(p2, "1.2345", "2.3456"); /*< It is possible to assign coordinates with other types than the coordinate type. + assign_values(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. >*/ diff --git a/doc/src/examples/algorithms/assign_3d_point.cpp b/doc/src/examples/algorithms/assign_3d_point.cpp index 51e91ff31..aa3ddb683 100644 --- a/doc/src/examples/algorithms/assign_3d_point.cpp +++ b/doc/src/examples/algorithms/assign_3d_point.cpp @@ -19,7 +19,7 @@ int main() { boost::geometry::model::point p; - boost::geometry::assign(p, 1.2345, 2.3456, 3.4567); + boost::geometry::assign_values(p, 1.2345, 2.3456, 3.4567); std::cout << boost::geometry::dsv(p) << std::endl; diff --git a/doc/src/examples/algorithms/assign_box_corners.cpp b/doc/src/examples/algorithms/assign_box_corners.cpp index 01ec6ae15..f6588194f 100644 --- a/doc/src/examples/algorithms/assign_box_corners.cpp +++ b/doc/src/examples/algorithms/assign_box_corners.cpp @@ -23,7 +23,7 @@ int main() typedef model::box box; box b; - assign(b, 2, 2, 5, 5); + assign_values(b, 2, 2, 5, 5); point ll, lr, ul, ur; assign_box_corners(b, ll, lr, ul, ur); diff --git a/doc/src/examples/algorithms/assign_point_from_index.cpp b/doc/src/examples/algorithms/assign_point_from_index.cpp index 9b2da934b..2f5284693 100644 --- a/doc/src/examples/algorithms/assign_point_from_index.cpp +++ b/doc/src/examples/algorithms/assign_point_from_index.cpp @@ -23,7 +23,7 @@ int main() typedef model::segment segment; segment s; - assign(s, 1, 1, 2, 2); + assign_values(s, 1, 1, 2, 2); point first, second; assign_point_from_index<0>(s, first); diff --git a/doc/src/examples/algorithms/assign_with_range.cpp b/doc/src/examples/algorithms/assign_points.cpp similarity index 81% rename from doc/src/examples/algorithms/assign_with_range.cpp rename to doc/src/examples/algorithms/assign_points.cpp index 1a212245f..c74775963 100644 --- a/doc/src/examples/algorithms/assign_with_range.cpp +++ b/doc/src/examples/algorithms/assign_points.cpp @@ -7,7 +7,7 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -//[assign_with_range +//[assign_points //` Shows usage of Boost.Geometry's assign, Boost.Assign, and Boost.Range to assign ranges of a linestring #include @@ -46,8 +46,8 @@ int main() 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(4, 8))); /*< Boost.Range adaptors can also be used in boost::geometry::assign >*/ + boost::geometry::assign_points(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_points(line3, line1 | boost::adaptors::filtered(x_between(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; @@ -59,7 +59,7 @@ int main() //] -//[assign_with_range_output +//[assign_points_output /*` Output: [pre diff --git a/doc/src/examples/algorithms/clear.cpp b/doc/src/examples/algorithms/clear.cpp index 1bca324f4..f9932ed26 100644 --- a/doc/src/examples/algorithms/clear.cpp +++ b/doc/src/examples/algorithms/clear.cpp @@ -29,8 +29,8 @@ int main() polygon poly; // Fill the polygon (using its own methods + Boost.Assign) - poly.outer() = tuple_list_of(0, 0)(0, 10)(11, 11)(0, 0); - poly.inners().push_back(tuple_list_of(0, 0)(0, 10)(11, 11)(0, 0)); + poly.outer() = tuple_list_of(0, 0)(0, 9)(10, 10)(0, 0); + poly.inners().push_back(tuple_list_of(1, 2)(4, 6)(2, 8)(1, 2)); std::cout << boost::geometry::dsv(poly) << std::endl; boost::geometry::clear(poly); diff --git a/doc/src/examples/algorithms/comparable_distance.cpp b/doc/src/examples/algorithms/comparable_distance.cpp new file mode 100644 index 000000000..0ed9a0490 --- /dev/null +++ b/doc/src/examples/algorithms/comparable_distance.cpp @@ -0,0 +1,66 @@ +// 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) + +//[comparable_distance +//` Shows how to efficiently get the closest point + +#include + +#include + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + + point_type p(1.4, 2.6); + + std::vector v; + for (double x = 0.0; x <= 4.0; x++) + { + for (double y = 0.0; y <= 4.0; y++) + { + v.push_back(point_type(x, y)); + } + } + + point_type min_p; + double min_d = boost::numeric::bounds::highest(); + BOOST_FOREACH(point_type const& pv, v) + { + double d = boost::geometry::comparable_distance(p, pv); + if (d < min_d) + { + min_d = d; + min_p = pv; + } + } + + std::cout + << "Closest: " << boost::geometry::dsv(min_p) << std::endl + << "At: " << boost::geometry::distance(p, min_p) << std::endl; + + return 0; +} + +//] + + +//[comparable_distance_output +/*` +Output: +[pre +Closest: (1, 3) +At: 0.565685 +] +*/ +//] + diff --git a/doc/src/examples/algorithms/convert.cpp b/doc/src/examples/algorithms/convert.cpp new file mode 100644 index 000000000..5b6e377e1 --- /dev/null +++ b/doc/src/examples/algorithms/convert.cpp @@ -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) + +//[convert +//` Shows how to convert a geometry into another geometry + +#include + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point; + typedef boost::geometry::model::box box; + typedef boost::geometry::model::polygon polygon; + + point p1(1, 1); + box bx = boost::geometry::make(1, 1, 2, 2); + + // Assign a box to a polygon (conversion box->poly) + polygon poly; + boost::geometry::convert(bx, poly); + + // Convert a point to another point type (conversion of point-type) + boost::tuple p2; + boost::geometry::convert(p1, p2); // source -> target + + using boost::geometry::dsv; + std::cout + << "box: " << dsv(bx) << std::endl + << "polygon: " << dsv(poly) << std::endl + << "point: " << dsv(p1) << std::endl + << "point tuples: " << dsv(p2) << std::endl + ; + + return 0; +} + +//] + + +//[convert_output +/*` +Output: +[pre +box: ((1, 1), (2, 2)) +polygon: (((1, 1), (1, 2), (2, 2), (2, 1), (1, 1))) +point: (1, 1) +point tuples: (1, 1) +] +*/ +//] diff --git a/doc/src/examples/algorithms/convex_hull.cpp b/doc/src/examples/algorithms/convex_hull.cpp new file mode 100644 index 000000000..f6963f092 --- /dev/null +++ b/doc/src/examples/algorithms/convex_hull.cpp @@ -0,0 +1,54 @@ +// 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) + +//[convex_hull +//` Shows how to generate the convex_hull of a geometry + +#include + +#include +#include + +/*<-*/ #include "create_svg_two.hpp" /*->*/ +int main() +{ + typedef boost::tuple point; + typedef boost::geometry::model::polygon polygon; + + polygon poly; + boost::geometry::read_wkt("polygon((2.0 1.3, 2.4 1.7, 2.8 1.8, 3.4 1.2, 3.7 1.6,3.4 2.0, 4.1 3.0" + ", 5.3 2.6, 5.4 1.2, 4.9 0.8, 2.9 0.7,2.0 1.3))", poly); + + polygon hull; + boost::geometry::convex_hull(poly, hull); + + using boost::geometry::dsv; + std::cout + << "polygon: " << dsv(poly) << std::endl + << "hull: " << dsv(hull) << std::endl + ; + + /*<-*/ create_svg("envelope.svg", poly, hull); /*->*/ + return 0; +} + +//] + + +//[convex_hull_output +/*` +Output: +[pre +polygon: (((2, 1.3), (2.4, 1.7), (2.8, 1.8), (3.4, 1.2), (3.7, 1.6), (3.4, 2), (4.1, 3), (5.3, 2.6), (5.4, 1.2), (4.9, 0.8), (2.9, 0.7), (2, 1.3))) +hull: (((2, 1.3), (2.4, 1.7), (4.1, 3), (5.3, 2.6), (5.4, 1.2), (4.9, 0.8), (2.9, 0.7), (2, 1.3))) + +[$img/algorithms/convex_hull.png] +] +*/ +//] diff --git a/doc/src/examples/algorithms/correct.cpp b/doc/src/examples/algorithms/correct.cpp new file mode 100644 index 000000000..add730428 --- /dev/null +++ b/doc/src/examples/algorithms/correct.cpp @@ -0,0 +1,65 @@ +// 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) + +//[correct +//` Shows how to correct a polygon with respect to its orientation and closure + +#include + +#include +#include + +#include + +int main() +{ + using boost::assign::tuple_list_of; + + typedef boost::geometry::model::polygon + < + boost::tuple + > clockwise_closed_polygon; + + clockwise_closed_polygon cwcp; + + // Fill it counterclockwise (so wrongly), forgetting the closing point + boost::geometry::exterior_ring(cwcp) = tuple_list_of(0, 0)(10, 10)(0, 9); + + // Add a counterclockwise closed inner ring (this is correct) + boost::geometry::interior_rings(cwcp).push_back(tuple_list_of(1, 2)(4, 6)(2, 8)(1, 2)); + + // Its area should be negative (because of wrong orientation) + // and wrong (because of omitted closing point) + double area_before = boost::geometry::area(cwcp); + + // Correct it! + boost::geometry::correct(cwcp); + + // Check its new area + double area_after = boost::geometry::area(cwcp); + + // And output it + std::cout << boost::geometry::dsv(cwcp) << std::endl; + std::cout << area_before << " -> " << area_after << std::endl; + + return 0; +} + +//] + + +//[correct_output +/*` +Output: +[pre +(((0, 0), (0, 9), (10, 10), (0, 0)), ((1, 2), (4, 6), (2, 8), (1, 2))) +-7 -> 38 +] +*/ +//] diff --git a/doc/src/examples/algorithms/distance.cpp b/doc/src/examples/algorithms/distance.cpp index 2676af350..3d4e71d5a 100644 --- a/doc/src/examples/algorithms/distance.cpp +++ b/doc/src/examples/algorithms/distance.cpp @@ -41,9 +41,10 @@ int main() mp.push_back(point_type(0,0)); mp.push_back(point_type(3,3)); - std::cout << "distance: " << boost::geometry::distance(p, poly) << std::endl; - std::cout << "distance: " << boost::geometry::distance(p, line) << std::endl; - std::cout << "distance: " << boost::geometry::distance(p, mp) << std::endl; + std::cout + << "Point-Poly: " << boost::geometry::distance(p, poly) << std::endl + << "Point-Line: " << boost::geometry::distance(p, line) << std::endl + << "Point-MultiPoint: " << boost::geometry::distance(p, mp) << std::endl; return 0; } @@ -55,9 +56,9 @@ int main() /*` Output: [pre -distance: 1.22066 -distance: 1 -distance: 2.23607 +Point-Poly: 1.22066 +Point-Line: 1 +Point-MultiPoint: 2.23607 ] */ //] diff --git a/doc/src/examples/algorithms/equals.cpp b/doc/src/examples/algorithms/equals.cpp new file mode 100644 index 000000000..27b087125 --- /dev/null +++ b/doc/src/examples/algorithms/equals.cpp @@ -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) + +//[equals +//` Shows the predicate equals, which returns true if two geometries are spatially equal + +#include + +#include +#include +#include + +#include + +int main() +{ + using boost::assign::tuple_list_of; + + typedef boost::tuple point; + + boost::geometry::model::polygon poly1, poly2; + boost::geometry::exterior_ring(poly1) = tuple_list_of(0, 0)(0, 5)(5, 5)(5, 0)(0, 0); + boost::geometry::exterior_ring(poly2) = tuple_list_of(5, 0)(0, 0)(0, 5)(5, 5)(5, 0); + + std::cout + << "polygons are spatially " + << (boost::geometry::equals(poly1, poly2) ? "equal" : "not equal") + << std::endl; + + boost::geometry::model::box box; + boost::geometry::assign_values(box, 0, 0, 5, 5); + + std::cout + << "polygon and box are spatially " + << (boost::geometry::equals(box, poly2) ? "equal" : "not equal") + << std::endl; + + + return 0; +} + +//] + + +//[equals_output +/*` +Output: +[pre +polygons are spatially equal +polygon and box are spatially equal +] +*/ +//] diff --git a/doc/src/examples/algorithms/expand.cpp b/doc/src/examples/algorithms/expand.cpp new file mode 100644 index 000000000..449b48fd9 --- /dev/null +++ b/doc/src/examples/algorithms/expand.cpp @@ -0,0 +1,46 @@ +// 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) + +//[expand +//` Shows the usage of expand + +#include +#include + +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::box box_type; + + using boost::geometry::expand; + + box_type box = boost::geometry::make_inverse(); /*< expand is usually preceded by a call to assign_inverse or make_inverse >*/ + + expand(box, point_type(0, 0)); + expand(box, point_type(1, 2)); + expand(box, point_type(5, 4)); + expand(box, boost::geometry::make(3, 3, 5, 5)); + + std::cout << boost::geometry::dsv(box) << std::endl; + + return 0; +} + +//] + +//[expand_output +/*` +Output: +[pre +((0, 0), (5, 5)) +] +*/ +//] diff --git a/doc/src/examples/algorithms/num_interior_rings.cpp b/doc/src/examples/algorithms/num_interior_rings.cpp index ca09fb57a..b4aa82940 100644 --- a/doc/src/examples/algorithms/num_interior_rings.cpp +++ b/doc/src/examples/algorithms/num_interior_rings.cpp @@ -8,7 +8,7 @@ // http://www.boost.org/LICENSE_1_0.txt) //[num_interior_rings -//` Get the number of interior rings in a polygon or multi-polygon +//` Get the number of interior rings in a multi-polygon #include diff --git a/doc/src/examples/algorithms/transform.cpp b/doc/src/examples/algorithms/transform.cpp new file mode 100644 index 000000000..8eea3be30 --- /dev/null +++ b/doc/src/examples/algorithms/transform.cpp @@ -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) + +//[transform +//` Shows how points can be transformed using the default strategy + +#include +#include + + +int main() +{ + namespace bg = boost::geometry; + + bg::model::point > p1(5.0, 52.0); + + // Transform from degree to radian. Default strategy is automatically selected, + // it will convert from degree to radian + bg::model::point > p2; + bg::transform(p1, p2); + + // Transform from degree (lon-lat) to 3D (x,y,z). Default strategy is automatically selected, + // it will consider points on a unit sphere + bg::model::point p3; + bg::transform(p1, p3); + + std::cout + << "p1: " << bg::dsv(p1) << std::endl + << "p2: " << bg::dsv(p2) << std::endl + << "p3: " << bg::dsv(p3) << std::endl; + + return 0; +} + +//] + + +//[transform_output +/*` +Output: +[pre +p1: (5, 52) +p2: (0.0872665, 0.907571) +p3: (0.785012, 0.0686797, 0.615661) +] +*/ +//] diff --git a/doc/src/examples/algorithms/transform_with_strategy.cpp b/doc/src/examples/algorithms/transform_with_strategy.cpp new file mode 100644 index 000000000..2fcfc57f4 --- /dev/null +++ b/doc/src/examples/algorithms/transform_with_strategy.cpp @@ -0,0 +1,63 @@ +// 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) + +//[transform_with_strategy +//` Shows how points can be scaled, translated or rotated + +#include +#include + + +int main() +{ + namespace trans = boost::geometry::strategy::transform; + using boost::geometry::dsv; + + typedef boost::geometry::model::point point_type; + + point_type p1(1.0, 1.0); + + // Translate over (1.5, 1.5) + point_type p2; + trans::translate_transformer translate(1.5, 1.5); + boost::geometry::transform(p1, p2, translate); + + // Scale with factor 3.0 + point_type p3; + trans::scale_transformer scale(3.0); + boost::geometry::transform(p1, p3, scale); + + // Rotate with respect to the origin (0,0) over 90 degrees (clockwise) + point_type p4; + trans::rotate_transformer rotate(90.0); + boost::geometry::transform(p1, p4, rotate); + + std::cout + << "p1: " << dsv(p1) << std::endl + << "p2: " << dsv(p2) << std::endl + << "p3: " << dsv(p3) << std::endl + << "p4: " << dsv(p4) << std::endl; + + return 0; +} + +//] + + +//[transform_with_strategy_output +/*` +Output: +[pre +p1: (1, 1) +p2: (2.5, 2.5) +p3: (3, 3) +p4: (1, -1) +] +*/ +//] diff --git a/doc/src/examples/core/Jamfile.v2 b/doc/src/examples/core/Jamfile.v2 index 9575b21cc..53d08c43a 100644 --- a/doc/src/examples/core/Jamfile.v2 +++ b/doc/src/examples/core/Jamfile.v2 @@ -17,3 +17,14 @@ exe get_point : get_point.cpp ; exe get_box : get_box.cpp ; exe set_point : set_point.cpp ; exe set_box : set_box.cpp ; +exe degree_radian : degree_radian.cpp ; + +exe coordinate_type : coordinate_type.cpp ; +exe coordinate_system : coordinate_system.cpp ; +exe coordinate_dimension : coordinate_dimension.cpp ; +exe point_order : point_order.cpp ; +exe closure : closure.cpp ; + +exe point_type : point_type.cpp ; +exe tag : tag.cpp ; +exe tag_cast : tag_cast.cpp ; diff --git a/doc/src/examples/core/closure.cpp b/doc/src/examples/core/closure.cpp new file mode 100644 index 000000000..47c40adcc --- /dev/null +++ b/doc/src/examples/core/closure.cpp @@ -0,0 +1,42 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//[closure +//` Examine if a polygon is defined as "should be closed" + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + + boost::geometry::closure_selector clos = boost::geometry::closure::value; + + std::cout << "closure: " << clos << std::endl + << "(open = " << boost::geometry::open + << ", closed = " << boost::geometry::closed + << ") "<< std::endl; + + return 0; +} + +//] + + +//[closure_output +/*` +Output: +[pre +closure: 1 +(open = 0, closed = 1) +] +*/ +//] diff --git a/doc/src/examples/core/coordinate_dimension.cpp b/doc/src/examples/core/coordinate_dimension.cpp new file mode 100644 index 000000000..5061c46ce --- /dev/null +++ b/doc/src/examples/core/coordinate_dimension.cpp @@ -0,0 +1,43 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//[dimension +//` Examine the number of coordinates making up the points in a linestring type + +#include +#include +#include +#include + +int main() +{ + int dim = boost::geometry::dimension + < + std::vector + < + boost::tuple + > + >::value; + + std::cout << "dimensions: " << dim << std::endl; + + return 0; +} + +//] + + +//[dimension_output +/*` +Output: +[pre +dimensions: 3 +] +*/ +//] diff --git a/doc/src/examples/core/coordinate_system.cpp b/doc/src/examples/core/coordinate_system.cpp new file mode 100644 index 000000000..0152aabf4 --- /dev/null +++ b/doc/src/examples/core/coordinate_system.cpp @@ -0,0 +1,39 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//[coordinate_system +//` Examine the coordinate system of a point + +#include +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + + typedef boost::geometry::coordinate_system::type system; + + std::cout << "system: " << typeid(system).name() << std::endl; + + return 0; +} + +//] + + +//[coordinate_system_output +/*` +Output (using MSVC): +[pre +system: struct boost::geometry::cs::cartesian +] +*/ +//] diff --git a/doc/src/examples/core/coordinate_type.cpp b/doc/src/examples/core/coordinate_type.cpp new file mode 100644 index 000000000..ebeea7e3c --- /dev/null +++ b/doc/src/examples/core/coordinate_type.cpp @@ -0,0 +1,39 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//[coordinate_type +//` Examine the coordinate type of a point + +#include +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + + typedef boost::geometry::coordinate_type::type ctype; + + std::cout << "type: " << typeid(ctype).name() << std::endl; + + return 0; +} + +//] + + +//[coordinate_type_output +/*` +Output (using MSVC): +[pre +type: double +] +*/ +//] diff --git a/doc/src/examples/core/degree_radian.cpp b/doc/src/examples/core/degree_radian.cpp new file mode 100644 index 000000000..3b8411068 --- /dev/null +++ b/doc/src/examples/core/degree_radian.cpp @@ -0,0 +1,47 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//[degree_radian +//` Specify two coordinate systems, one in degrees, one in radians. + +#include +#include + +using namespace boost::geometry; + +int main() +{ + typedef model::point > degree_point; + typedef model::point > radian_point; + + degree_point d(4.893, 52.373); + radian_point r(0.041, 0.8527); + + double dist = distance(d, r); + std::cout + << "distance:" << std::endl + << dist << " over unit sphere" << std::endl + << dist * 3959 << " over a spherical earth, in miles" << std::endl; + + return 0; +} + +//] + + +//[degree_radian_output +/*` +Output: +[pre +distance: +0.0675272 over unit sphere +267.34 over a spherical earth, in miles +] +*/ +//] diff --git a/doc/src/examples/core/point_order.cpp b/doc/src/examples/core/point_order.cpp new file mode 100644 index 000000000..34e371209 --- /dev/null +++ b/doc/src/examples/core/point_order.cpp @@ -0,0 +1,42 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//[point_order +//` Examine the expected point order of a polygon type + +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + + boost::geometry::order_selector order = boost::geometry::point_order::value; + + std::cout << "order: " << order << std::endl + << "(clockwise = " << boost::geometry::clockwise + << ", counterclockwise = " << boost::geometry::counterclockwise + << ") "<< std::endl; + + return 0; +} + +//] + + +//[point_order_output +/*` +Output: +[pre +order: 2 +(clockwise = 1, counterclockwise = 2) +] +*/ +//] diff --git a/doc/src/examples/core/point_type.cpp b/doc/src/examples/core/point_type.cpp new file mode 100644 index 000000000..2f1b499b7 --- /dev/null +++ b/doc/src/examples/core/point_type.cpp @@ -0,0 +1,40 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//[point_type +//` Examine the point type of a multi_polygon + +#include +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + typedef boost::geometry::model::multi_polygon mp_type; + + typedef boost::geometry::point_type::type ptype; + + std::cout << "point type: " << typeid(ptype).name() << std::endl; + + return 0; +} + +//] + + +//[point_type_output +/*` +Output (in MSVC): +[pre +point type: class boost::geometry::model::d2::point_xy +] +*/ +//] diff --git a/doc/src/examples/core/tag.cpp b/doc/src/examples/core/tag.cpp new file mode 100644 index 000000000..895c528bb --- /dev/null +++ b/doc/src/examples/core/tag.cpp @@ -0,0 +1,48 @@ +// 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) + +//[tag +//` Examine the tag of some geometry types + +#include +#include +#include + +int main() +{ + typedef boost::geometry::model::d2::point_xy point_type; + typedef boost::geometry::model::polygon polygon_type; + typedef boost::geometry::model::multi_polygon mp_type; + + typedef boost::geometry::tag::type tag1; + typedef boost::geometry::tag::type tag2; + typedef boost::geometry::tag::type tag3; + + std::cout + << "tag 1: " << typeid(tag1).name() << std::endl + << "tag 2: " << typeid(tag2).name() << std::endl + << "tag 3: " << typeid(tag3).name() << std::endl + ; + + return 0; +} + +//] + + +//[tag_output +/*` +Output (in MSVC): +[pre +tag 1: struct boost::geometry::point_tag +tag 2: struct boost::geometry::polygon_tag +tag 3: struct boost::geometry::multi_polygon_tag +] +*/ +//] diff --git a/doc/src/examples/core/tag_cast.cpp b/doc/src/examples/core/tag_cast.cpp new file mode 100644 index 000000000..7f4ab3e0e --- /dev/null +++ b/doc/src/examples/core/tag_cast.cpp @@ -0,0 +1,43 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// QuickBook Example + +// Copyright (c) 2011 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//[tag_cast +//` Check if the polygon_tag can be casted to the areal_tag + +#include +#include +#include + +namespace geo = boost::geometry; +int main() +{ + typedef geo::model::d2::point_xy point_type; + typedef geo::model::polygon polygon_type; + + typedef geo::tag::type tag; + typedef geo::tag_cast::type base_tag; + + std::cout << "tag: " << typeid(tag).name() << std::endl + << "base tag: " << typeid(base_tag).name() << std::endl; + + return 0; +} + +//] + + +//[tag_cast_output +/*` +Output (in MSVC): +[pre +tag: struct boost::geometry::polygon_tag +base tag: struct boost::geometry::areal_tag +] +*/ +//] diff --git a/doc/src/examples/geometries/register/point.cpp b/doc/src/examples/geometries/register/point.cpp index d4a27c545..bfac67d88 100644 --- a/doc/src/examples/geometries/register/point.cpp +++ b/doc/src/examples/geometries/register/point.cpp @@ -29,8 +29,8 @@ int main() namespace bg = boost::geometry; /*< Any Boost.Geometry function can be used for legacy point now. Here: assign and distance >*/ - bg::assign(p1, 1, 1); - bg::assign(p2, 2, 2); + bg::assign_values(p1, 1, 1); + bg::assign_values(p2, 2, 2); double d = bg::distance(p1, p2); diff --git a/example/01_point_example.cpp b/example/01_point_example.cpp index ee5698de2..574831e46 100644 --- a/example/01_point_example.cpp +++ b/example/01_point_example.cpp @@ -53,13 +53,13 @@ int main() // All these types are handled the same way. We show here // assigning them and calculating distances. - assign(pt1, 1, 1); - assign(pt2, 2, 2); - assign(pt3, 3, 3); - assign(pt4, 4, 4); - assign(pt5, 5, 5); - assign(pt6, 6, 6); - assign(pt7, 7, 7); + assign_values(pt1, 1, 1); + assign_values(pt2, 2, 2); + assign_values(pt3, 3, 3); + assign_values(pt4, 4, 4); + assign_values(pt5, 5, 5); + assign_values(pt6, 6, 6); + assign_values(pt7, 7, 7); double d1 = distance(pt1, pt2); @@ -76,13 +76,13 @@ int main() // 1: default, empty constructor, causing no initialization at all model::d2::point_xy p1; - // 2: as shown above, assign + // 2: as shown above, assign_values model::d2::point_xy p2; - assign(p2, 1, 1); + assign_values(p2, 1, 1); // 3: using "set" function // set uses the concepts behind, such that it can be applied for - // every point-type (like assign) + // every point-type (like assign_values) model::d2::point_xy p3; set<0>(p3, 1); set<1>(p3, 1); @@ -118,8 +118,8 @@ int main() // There are 3-dimensional points too model::point d3a, d3b; - assign(d3a, 1, 2, 3); - assign(d3b, 4, 5, 6); + assign_values(d3a, 1, 2, 3); + assign_values(d3b, 4, 5, 6); d3 = distance(d3a, d3b); diff --git a/example/02_linestring_example.cpp b/example/02_linestring_example.cpp index 014aaa2a8..329993529 100644 --- a/example/02_linestring_example.cpp +++ b/example/02_linestring_example.cpp @@ -79,9 +79,9 @@ int main(void) // points can be created using "make" and added to a linestring using the std:: "push_back" ls.push_back(make(1.1, 1.1)); - // points can also be assigned using "assign" and added to a linestring using "append" + // points can also be assigned using "assign_values" and added to a linestring using "append" point_2d lp; - assign(lp, 2.5, 2.1); + assign_values(lp, 2.5, 2.1); append(ls, lp); // Lines can be streamed using DSV (delimiter separated values) diff --git a/example/03_polygon_example.cpp b/example/03_polygon_example.cpp index 0e36dd73d..780221a93 100644 --- a/example/03_polygon_example.cpp +++ b/example/03_polygon_example.cpp @@ -41,7 +41,7 @@ int main(void) {3.4, 2.0}, {4.1, 3.0}, {5.3, 2.6}, {5.4, 1.2}, {4.9, 0.8}, {2.9, 0.7}, {2.0, 1.3} // closing point is opening point }; - assign(poly, coor); + assign_points(poly, coor); } // Polygons should be closed, and directed clockwise. If you're not sure if that is the case, @@ -77,7 +77,7 @@ int main(void) model::ring& inner = poly.inners().back(); const double coor[][2] = { {4.0, 2.0}, {4.2, 1.4}, {4.8, 1.9}, {4.4, 2.2}, {4.0, 2.0} }; - assign(inner, coor); + assign_points(inner, coor); } correct(poly); diff --git a/example/05_a_overlay_polygon_example.cpp b/example/05_a_overlay_polygon_example.cpp index 9d74b8273..625b0f497 100644 --- a/example/05_a_overlay_polygon_example.cpp +++ b/example/05_a_overlay_polygon_example.cpp @@ -45,7 +45,7 @@ int main(void) const double c[][2] = { {160, 330}, {60, 260}, {20, 150}, {60, 40}, {190, 20}, {270, 130}, {260, 250}, {160, 330} }; - bg::assign(a, c); + bg::assign_points(a, c); } bg::correct(a); std::cout << "A: " << bg::dsv(a) << std::endl; @@ -55,7 +55,7 @@ int main(void) const double c[][2] = { {300, 330}, {190, 270}, {150, 170}, {150, 110}, {250, 30}, {380, 50}, {380, 250}, {300, 330} }; - bg::assign(b, c); + bg::assign_points(b, c); } bg::correct(b); std::cout << "B: " << bg::dsv(b) << std::endl; diff --git a/example/05_b_overlay_linestring_polygon_example.cpp b/example/05_b_overlay_linestring_polygon_example.cpp index 16eff548e..8e0dc7483 100644 --- a/example/05_b_overlay_linestring_polygon_example.cpp +++ b/example/05_b_overlay_linestring_polygon_example.cpp @@ -35,13 +35,13 @@ int main(void) bg::model::linestring ls; { const double c[][2] = { {0, 1}, {2, 5}, {5, 3} }; - bg::assign(ls, c); + bg::assign_points(ls, c); } bg::model::polygon p; { const double c[][2] = { {3, 0}, {0, 3}, {4, 5}, {3, 0} }; - bg::assign(p, c); + bg::assign_points(p, c); } bg::correct(p); diff --git a/example/06_a_transformation_example.cpp b/example/06_a_transformation_example.cpp index 2c13911e2..ef7d279d3 100644 --- a/example/06_a_transformation_example.cpp +++ b/example/06_a_transformation_example.cpp @@ -35,7 +35,7 @@ int main() const double coor[][2] = { {0, 0}, {0, 7}, {2, 2}, {2, 0}, {0, 0} }; // note that for this syntax you have to include the two // include files above (c_array_cartesian.hpp, std_as_linestring.hpp) - assign(poly, coor); + assign_points(poly, coor); //read_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", poly); transform(poly, poly2, translate); diff --git a/example/c01_custom_point_example.cpp b/example/c01_custom_point_example.cpp index 0534feb04..c6f3a6495 100644 --- a/example/c01_custom_point_example.cpp +++ b/example/c01_custom_point_example.cpp @@ -108,8 +108,8 @@ int main() my_array_point a1 = {{0}}; my_array_point a2 = {{0}}; - boost::geometry::assign(a1, 1, 2, 3); - boost::geometry::assign(a2, 3, 2, 1); + boost::geometry::assign_values(a1, 1, 2, 3); + boost::geometry::assign_values(a2, 3, 2, 1); std::cout << "color distance " << boost::geometry::dsv(a1) << " to " @@ -132,8 +132,8 @@ int main() my_class_rw crw1; my_class_rw crw2; - boost::geometry::assign(crw1, 1, 2); - boost::geometry::assign(crw2, 3, 4); + boost::geometry::assign_values(crw1, 1, 2); + boost::geometry::assign_values(crw2, 3, 4); std::cout << "class r/w distance " << boost::geometry::dsv(crw1) << " to " << boost::geometry::dsv(crw2) << " is " @@ -141,8 +141,8 @@ int main() my_class_gs cgs1; my_class_gs cgs2; - boost::geometry::assign(cgs1, 1, 2); - boost::geometry::assign(cgs2, 3, 4); + boost::geometry::assign_values(cgs1, 1, 2); + boost::geometry::assign_values(cgs2, 3, 4); std::cout << "class g/s distance " << boost::geometry::dsv(crw1) << " to " << boost::geometry::dsv(crw2) << " is " diff --git a/example/with_external_libs/x05_shapelib_example.cpp b/example/with_external_libs/x05_shapelib_example.cpp index c096c9b8b..a136240e1 100644 --- a/example/with_external_libs/x05_shapelib_example.cpp +++ b/example/with_external_libs/x05_shapelib_example.cpp @@ -73,7 +73,7 @@ void convert(SHPObject* psShape, T& polygon) for (int v = 0; v < psShape->nVertices; v++) { typename point_type::type point; - assign(point, x[v], y[v]); + assign_values(point, x[v], y[v]); append(polygon, point); } } diff --git a/test/algorithms/Jamfile.v2 b/test/algorithms/Jamfile.v2 index daf06b6d4..7058f6753 100644 --- a/test/algorithms/Jamfile.v2 +++ b/test/algorithms/Jamfile.v2 @@ -18,6 +18,7 @@ test-suite boost-geometry-algorithms [ run comparable_distance.cpp ] [ run convex_hull.cpp ] [ run correct.cpp ] + [ run convert.cpp ] [ run difference.cpp ] [ run disjoint.cpp ] [ run distance.cpp ] diff --git a/test/algorithms/algorithms_tests.sln b/test/algorithms/algorithms_tests.sln index f929e0ba5..6880312aa 100644 --- a/test/algorithms/algorithms_tests.sln +++ b/test/algorithms/algorithms_tests.sln @@ -54,6 +54,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reverse", "reverse.vcproj", EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "comparable_distance", "comparable_distance.vcproj", "{F11970B5-BE16-4FF5-9780-4C15082B76A0}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "convert", "convert.vcproj", "{FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -168,6 +170,10 @@ Global {F11970B5-BE16-4FF5-9780-4C15082B76A0}.Debug|Win32.Build.0 = Debug|Win32 {F11970B5-BE16-4FF5-9780-4C15082B76A0}.Release|Win32.ActiveCfg = Release|Win32 {F11970B5-BE16-4FF5-9780-4C15082B76A0}.Release|Win32.Build.0 = Release|Win32 + {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Debug|Win32.ActiveCfg = Debug|Win32 + {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Debug|Win32.Build.0 = Debug|Win32 + {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Release|Win32.ActiveCfg = Release|Win32 + {FABF1AA7-F695-49F8-92F6-AB6C4B0C088A}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/test/algorithms/assign.cpp b/test/algorithms/assign.cpp index 96bd35e0a..ab4ee31b0 100644 --- a/test/algorithms/assign.cpp +++ b/test/algorithms/assign.cpp @@ -14,6 +14,7 @@ #include +#include #include #include @@ -48,25 +49,25 @@ void test_assign_linestring_2d() { bg::model::linestring line; - // Test assignment of plain array (note that this is only possible if adapted c-array is included! + // Test assignment of plain array (note that this is only possible if adapted c-array is included!) const double coors[3][2] = { {1, 2}, {3, 4}, {5, 6} }; - bg::assign(line, coors); + bg::assign_points(line, coors); check_linestring_2d(line); // Test assignment of point array Point points[3]; - bg::assign(points[0], 1, 2); - bg::assign(points[1], 3, 4); - bg::assign(points[2], 5, 6); - bg::assign(line, points); + bg::assign_values(points[0], 1, 2); + bg::assign_values(points[1], 3, 4); + bg::assign_values(points[2], 5, 6); + bg::assign_points(line, points); check_linestring_2d(line); - // Test assignment of array with different point-type + // Test assignment of array with different point-type (tuple adaption should be included) boost::tuple tuples[3]; tuples[0] = boost::make_tuple(1, 2); tuples[1] = boost::make_tuple(3, 4); tuples[2] = boost::make_tuple(5, 6); - bg::assign(line, tuples); + bg::assign_points(line, tuples); check_linestring_2d(line); } @@ -76,7 +77,7 @@ namespace detail void test_assign_box_or_segment_2d() { BoxOrSegment geometry; - bg::assign(geometry, 1, 2, 3, 4); + bg::assign_values(geometry, 1, 2, 3, 4); BOOST_CHECK((bg::get(geometry) == 1)); BOOST_CHECK((bg::get(geometry) == 2)); BOOST_CHECK((bg::get(geometry) == 3)); @@ -114,12 +115,12 @@ template void test_assign_point_3d() { Point p; - bg::assign(p, 1, 2, 3); + bg::assign_values(p, 1, 2, 3); BOOST_CHECK(bg::get<0>(p) == 1); BOOST_CHECK(bg::get<1>(p) == 2); BOOST_CHECK(bg::get<2>(p) == 3); - bg::detail::assign::assign_value(p, 123); + bg::assign_value(p, 123); BOOST_CHECK(bg::get<0>(p) == 123); BOOST_CHECK(bg::get<1>(p) == 123); BOOST_CHECK(bg::get<2>(p) == 123); @@ -131,15 +132,75 @@ void test_assign_point_3d() } +template +void test_assign_conversion() +{ + typedef bg::model::box

box_type; + typedef bg::model::ring

ring_type; + typedef bg::model::polygon

polygon_type; + + P p; + bg::assign_values(p, 1, 2); + + box_type b; + bg::assign(b, p); + + BOOST_CHECK_CLOSE((bg::get<0, 0>(b)), 1.0, 0.001); + BOOST_CHECK_CLOSE((bg::get<0, 1>(b)), 2.0, 0.001); + BOOST_CHECK_CLOSE((bg::get<1, 0>(b)), 1.0, 0.001); + BOOST_CHECK_CLOSE((bg::get<1, 1>(b)), 2.0, 0.001); + + + bg::set(b, 1); + bg::set(b, 2); + bg::set(b, 3); + bg::set(b, 4); + + ring_type ring; + bg::assign(ring, b); + + //std::cout << bg::wkt(b) << std::endl; + //std::cout << bg::wkt(ring) << std::endl; + + typename boost::range_const_iterator::type it = ring.begin(); + BOOST_CHECK_CLOSE(bg::get<0>(*it), 1.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 2.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 1.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 4.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 3.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 4.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 3.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 2.0, 0.001); + it++; + BOOST_CHECK_CLOSE(bg::get<0>(*it), 1.0, 0.001); + BOOST_CHECK_CLOSE(bg::get<1>(*it), 2.0, 0.001); + + BOOST_CHECK_EQUAL(ring.size(), 5u); + + + polygon_type polygon; + + bg::assign(polygon, ring); + BOOST_CHECK_EQUAL(bg::num_points(polygon), 5u); + + ring_type ring2; + bg::assign(ring2, polygon); + BOOST_CHECK_EQUAL(bg::num_points(ring2), 5u); +} + + template void test_assign_point_2d() { Point p; - bg::assign(p, 1, 2); + bg::assign_values(p, 1, 2); BOOST_CHECK(bg::get<0>(p) == 1); BOOST_CHECK(bg::get<1>(p) == 2); - bg::detail::assign::assign_value(p, 123); + bg::assign_value(p, 123); BOOST_CHECK(bg::get<0>(p) == 123); BOOST_CHECK(bg::get<1>(p) == 123); @@ -148,6 +209,10 @@ void test_assign_point_2d() BOOST_CHECK(bg::get<1>(p) == 0); } + + + + int test_main(int, char* []) { test_assign_point_3d(); @@ -165,6 +230,9 @@ int test_main(int, char* []) test_assign_point_2d >(); test_assign_point_2d >(); + test_assign_conversion >(); + + // Segment (currently) cannot handle array's because derived from std::pair test_assign_box_2d(); test_assign_box_2d(); diff --git a/test/algorithms/detail/convert.cpp b/test/algorithms/convert.cpp similarity index 92% rename from test/algorithms/detail/convert.cpp rename to test/algorithms/convert.cpp index 2c6d227d3..185aceb11 100644 --- a/test/algorithms/detail/convert.cpp +++ b/test/algorithms/convert.cpp @@ -16,7 +16,7 @@ #include -#include +#include #include #include @@ -32,10 +32,10 @@ void test_all() typedef bg::model::box

box_type; P p; - bg::assign(p, 1, 2); + bg::assign_values(p, 1, 2); box_type b; - bg::detail::convert(p, b); + bg::convert(p, b); BOOST_CHECK_CLOSE((bg::get<0, 0>(b)), 1.0, 0.001); BOOST_CHECK_CLOSE((bg::get<0, 1>(b)), 2.0, 0.001); @@ -59,7 +59,7 @@ void test_std() bg::set(b, 4); ring_type ring; - bg::detail::convert(b, ring); + bg::convert(b, ring); //std::cout << bg::wkt(b) << std::endl; //std::cout << bg::wkt(ring) << std::endl; @@ -85,10 +85,10 @@ void test_std() polygon_type polygon; - bg::detail::convert(ring, polygon); + bg::convert(ring, polygon); BOOST_CHECK_EQUAL(bg::num_points(polygon), 5u); - bg::detail::convert(polygon, ring); + bg::convert(polygon, ring); BOOST_CHECK_EQUAL(bg::num_points(ring), 5u); } diff --git a/test/algorithms/detail/convert.vcproj b/test/algorithms/convert.vcproj similarity index 92% rename from test/algorithms/detail/convert.vcproj rename to test/algorithms/convert.vcproj index b3a11404f..c75bf0ee5 100644 --- a/test/algorithms/detail/convert.vcproj +++ b/test/algorithms/convert.vcproj @@ -20,7 +20,7 @@ OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)\convert" ConfigurationType="1" - InheritedPropertySheets="..\..\boost.vsprops;..\..\ttmath.vsprops" + InheritedPropertySheets="..\boost.vsprops;..\ttmath.vsprops" CharacterSet="1" > @@ -114,7 +114,7 @@ /> -#include #include #include #include -#include -#include #include #include +#if defined(TEST_WITH_SVG) +# include +#endif + +#include +#include +#include +#include + template struct box_item @@ -214,6 +220,234 @@ void test_all() } +//------------------- higher volumes + +template +struct svg_visitor +{ + SvgMapper& m_mapper; + + svg_visitor(SvgMapper& mapper) + : m_mapper(mapper) + {} + + template + inline void apply(Box const& box, int level) + { + /* + std::string color("rgb(64,64,64)"); + switch(level) + { + case 0 : color = "rgb(255,0,0)"; break; + case 1 : color = "rgb(0,255,0)"; break; + case 2 : color = "rgb(0,0,255)"; break; + case 3 : color = "rgb(255,255,0)"; break; + case 4 : color = "rgb(255,0,255)"; break; + case 5 : color = "rgb(0,255,255)"; break; + case 6 : color = "rgb(255,128,0)"; break; + case 7 : color = "rgb(0,128,255)"; break; + } + std::ostringstream style; + style << "fill:none;stroke-width:" << (5.0 - level / 2.0) << ";stroke:" << color << ";"; + m_mapper.map(box, style.str()); + */ + m_mapper.map(box, "fill:none;stroke-width:2;stroke:rgb(0,0,0);"); + + } +}; + + + + +template +void fill_points(Collection& collection, int seed, int size, int count) +{ + typedef boost::minstd_rand base_generator_type; + + base_generator_type generator(seed); + + boost::uniform_int<> random_coordinate(0, size - 1); + boost::variate_generator > + coordinate_generator(generator, random_coordinate); + + std::set > included; + + int n = 0; + for (int i = 0; n < count && i < count*count; i++) + { + int x = coordinate_generator(); + int y = coordinate_generator(); + std::pair pair = std::make_pair(x, y); + if (included.find(pair) == included.end()) + { + included.insert(pair); + typename boost::range_value::type item; + item.x = x; + item.y = y; + collection.push_back(item); + n++; + } + } +} + +void test_many_points(int seed, int size, int count) +{ + bg::model::multi_point mp1, mp2; + + fill_points(mp1, seed, size, count); + fill_points(mp2, seed * 2, size, count); + + // Test equality in quadratic loop + int expected_count = 0; + BOOST_FOREACH(point_item const& item1, mp1) + { + BOOST_FOREACH(point_item const& item2, mp2) + { + if (bg::equals(item1, item2)) + { + expected_count++; + } + } + } + +#if defined(TEST_WITH_SVG) + std::ostringstream filename; + filename << "partition" << seed << ".svg"; + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper mapper(svg, 800, 800); + + { + point_item p; + p.x = -1; p.y = -1; mapper.add(p); + p.x = size + 1; p.y = size + 1; mapper.add(p); + } + + typedef svg_visitor > box_visitor_type; + box_visitor_type box_visitor(mapper); +#else + typedef bg::visit_no_policy box_visitor_type; + box_visitor_type box_visitor; +#endif + + point_visitor visitor; + bg::partition + < + bg::model::box, get_point, ovelaps_point, + box_visitor_type + >::apply(mp1, mp2, visitor, 2, box_visitor); + + BOOST_CHECK_EQUAL(visitor.count, expected_count); + +#if defined(TEST_WITH_SVG) + BOOST_FOREACH(point_item const& item, mp1) + { + mapper.map(item, "fill:rgb(255,128,0);stroke:rgb(0,0,100);stroke-width:1", 8); + } + BOOST_FOREACH(point_item const& item, mp2) + { + mapper.map(item, "fill:rgb(0,128,255);stroke:rgb(0,0,100);stroke-width:1", 4); + } +#endif +} + +template +void fill_boxes(Collection& collection, int seed, int size, int count) +{ + typedef boost::minstd_rand base_generator_type; + + base_generator_type generator(seed); + + boost::uniform_int<> random_coordinate(0, size * 10 - 1); + boost::variate_generator > + coordinate_generator(generator, random_coordinate); + + int n = 0; + for (int i = 0; n < count && i < count*count; i++) + { + int w = coordinate_generator() % 30; + int h = coordinate_generator() % 30; + if (w > 0 && h > 0) + { + int x = coordinate_generator(); + int y = coordinate_generator(); + if (x + w < size * 10 && y + h < size * 10) + { + typename boost::range_value::type item(n+1); + bg::assign_values(item.box, x / 10.0, y / 10.0, (x + w) / 10.0, (y + h) / 10.0); + collection.push_back(item); + n++; + } + } + } +} + + + +void test_many_boxes(int seed, int size, int count) +{ + typedef bg::model::box box_type; + std::vector > boxes; + + fill_boxes(boxes, seed, size, count); + + // Test equality in quadratic loop + int expected_count = 0; + double expected_area = 0.0; + BOOST_FOREACH(box_item const& item1, boxes) + { + BOOST_FOREACH(box_item const& item2, boxes) + { + if (item1.id < item2.id) + { + if (bg::intersects(item1.box, item2.box)) + { + box_type b; + bg::intersection(item1.box, item2.box, b); + expected_area += bg::area(b); + expected_count++; + } + } + } + } + + +#if defined(TEST_WITH_SVG) + std::ostringstream filename; + filename << "partition_box_" << seed << ".svg"; + std::ofstream svg(filename.str().c_str()); + + bg::svg_mapper mapper(svg, 800, 800); + + { + point_item p; + p.x = -1; p.y = -1; mapper.add(p); + p.x = size + 1; p.y = size + 1; mapper.add(p); + } + + BOOST_FOREACH(box_item const& item, boxes) + { + mapper.map(item.box, "opacity:0.6;fill:rgb(50,50,210);stroke:rgb(0,0,0);stroke-width:1"); + } + + typedef svg_visitor > partition_visitor_type; + partition_visitor_type partition_visitor(mapper); + + + box_visitor visitor; + bg::partition + < + box_type, get_box, ovelaps_box, + partition_visitor_type + >::apply(boxes, visitor, 2, partition_visitor); + + BOOST_CHECK_EQUAL(visitor.count, expected_count); + BOOST_CHECK_CLOSE(visitor.area, expected_area, 0.001); + +#endif +} + + @@ -221,5 +455,20 @@ int test_main( int , char* [] ) { test_all >(); + test_many_points(12345, 20, 40); + test_many_points(54321, 20, 60); + test_many_points(67890, 20, 80); + test_many_points(98765, 20, 100); + for (int i = 1; i < 10; i++) + { + test_many_points(i, 30, i * 20); + } + + test_many_boxes(12345, 20, 40); + for (int i = 1; i < 10; i++) + { + test_many_boxes(i, 20, i * 10); + } + return 0; } diff --git a/test/algorithms/intersection.cpp b/test/algorithms/intersection.cpp index 5a3bada28..5a7b2c647 100644 --- a/test/algorithms/intersection.cpp +++ b/test/algorithms/intersection.cpp @@ -324,7 +324,7 @@ void test_pointer_version() p = new test::test_point_xy; p->x = 10; p->y = 10; ln.push_back(p); bg::model::box > box; - bg::assign(box, 2, 2, 8, 8); + bg::assign_values(box, 2, 2, 8, 8); typedef bg::model::linestring > output_type; std::vector clip; diff --git a/test/algorithms/make.cpp b/test/algorithms/make.cpp index 58a26c43f..65b63fe9e 100644 --- a/test/algorithms/make.cpp +++ b/test/algorithms/make.cpp @@ -62,7 +62,7 @@ void test_linestring_2d() T coors[][2] = {{1,2}, {3,4}}; - L line = bg::make(coors); + L line = bg::detail::make::make_points(coors); BOOST_CHECK_EQUAL(line.size(), 2u); } @@ -74,7 +74,7 @@ void test_linestring_3d() T coors[][3] = {{1,2,3}, {4,5,6}}; - L line = bg::make(coors); + L line = bg::detail::make::make_points(coors); BOOST_CHECK_EQUAL(line.size(), 2u); //std::cout << dsv(line) << std::endl; diff --git a/test/algorithms/transform.cpp b/test/algorithms/transform.cpp index e4d5bc9a7..af8ba28c7 100644 --- a/test/algorithms/transform.cpp +++ b/test/algorithms/transform.cpp @@ -80,7 +80,7 @@ void test_transformations(double phi, double theta, double r) { typedef bg::model::point > spherical_type; spherical_type sph1; - assign(sph1, phi, theta, r); + assign_values(sph1, phi, theta, r); BOOST_CHECK(transform(sph1, p)); spherical_type sph2; @@ -97,7 +97,7 @@ void test_transformations(double phi, double theta, double r) { typedef bg::model::point > spherical_type; spherical_type sph1, sph2; - assign(sph1, phi, theta); + assign_values(sph1, phi, theta); BOOST_CHECK(transform(sph1, p)); BOOST_CHECK(transform(p, sph2)); diff --git a/test/arithmetic/arithmetic.cpp b/test/arithmetic/arithmetic.cpp index 8ed3cd8d1..1ae1915f4 100644 --- a/test/arithmetic/arithmetic.cpp +++ b/test/arithmetic/arithmetic.cpp @@ -30,14 +30,14 @@ template void test_addition() { P p1; - bg::assign(p1, 1, 2, 3); + bg::assign_values(p1, 1, 2, 3); bg::add_value(p1, 10); BOOST_CHECK(bg::get<0>(p1) == 11); BOOST_CHECK(bg::get<1>(p1) == 12); BOOST_CHECK(bg::get<2>(p1) == 13); P p2; - bg::assign(p2, 4, 5, 6); + bg::assign_values(p2, 4, 5, 6); bg::add_point(p1, p2); BOOST_CHECK(bg::get<0>(p1) == 15); BOOST_CHECK(bg::get<1>(p1) == 17); @@ -48,14 +48,14 @@ template void test_subtraction() { P p1; - bg::assign(p1, 1, 2, 3); + bg::assign_values(p1, 1, 2, 3); bg::subtract_value(p1, 10); BOOST_CHECK(bg::get<0>(p1) == -9); BOOST_CHECK(bg::get<1>(p1) == -8); BOOST_CHECK(bg::get<2>(p1) == -7); P p2; - bg::assign(p2, 4, 6, 8); + bg::assign_values(p2, 4, 6, 8); bg::subtract_point(p1, p2); BOOST_CHECK(bg::get<0>(p1) == -13); BOOST_CHECK(bg::get<1>(p1) == -14); @@ -66,14 +66,14 @@ template void test_multiplication() { P p1; - bg::assign(p1, 1, 2, 3); + bg::assign_values(p1, 1, 2, 3); bg::multiply_value(p1, 5); BOOST_CHECK(bg::get<0>(p1) == 5); BOOST_CHECK(bg::get<1>(p1) == 10); BOOST_CHECK(bg::get<2>(p1) == 15); P p2; - bg::assign(p2, 4, 5, 6); + bg::assign_values(p2, 4, 5, 6); bg::multiply_point(p1, p2); BOOST_CHECK(bg::get<0>(p1) == 20); BOOST_CHECK(bg::get<1>(p1) == 50); @@ -84,20 +84,37 @@ template void test_division() { P p1; - bg::assign(p1, 50, 100, 150); + bg::assign_values(p1, 50, 100, 150); bg::divide_value(p1, 5); BOOST_CHECK(bg::get<0>(p1) == 10); BOOST_CHECK(bg::get<1>(p1) == 20); BOOST_CHECK(bg::get<2>(p1) == 30); P p2; - bg::assign(p2, 2, 4, 6); + bg::assign_values(p2, 2, 4, 6); bg::divide_point(p1, p2); BOOST_CHECK(bg::get<0>(p1) == 5); BOOST_CHECK(bg::get<1>(p1) == 5); BOOST_CHECK(bg::get<2>(p1) == 5); } +template +void test_assign() +{ + P p1; + P p2; + bg::assign_values(p1, 12, 34, 56); + bg::assign_point(p2, p1); + BOOST_CHECK(bg::get<0>(p2) == 12); + BOOST_CHECK(bg::get<1>(p2) == 34); + BOOST_CHECK(bg::get<2>(p2) == 56); + + bg::assign_value(p2, 78); + BOOST_CHECK(bg::get<0>(p2) == 78); + BOOST_CHECK(bg::get<1>(p2) == 78); + BOOST_CHECK(bg::get<2>(p2) == 78); +} + template void test_all() @@ -106,6 +123,7 @@ void test_all() test_subtraction

(); test_multiplication

(); test_division

(); + test_assign

(); } diff --git a/test/arithmetic/dot_product.cpp b/test/arithmetic/dot_product.cpp index 806b10424..777124ca2 100644 --- a/test/arithmetic/dot_product.cpp +++ b/test/arithmetic/dot_product.cpp @@ -30,9 +30,9 @@ template void test_all() { P p1; - bg::assign(p1, 1, 2, 3); + bg::assign_values(p1, 1, 2, 3); P p2; - bg::assign(p2, 4, 5, 6); + bg::assign_values(p2, 4, 5, 6); BOOST_CHECK(bg::dot_product(p1, p2) == 1*4 + 2*5 + 3*6); } diff --git a/test/compile_test.cpp b/test/compile_test.cpp deleted file mode 100644 index 31d02020e..000000000 --- a/test/compile_test.cpp +++ /dev/null @@ -1,220 +0,0 @@ -// TODO: OLD! - -// Boost.Geometry (aka GGL, Generic Geometry Library) -// -// Copyright (c) 2007-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) - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -template -struct modifying_functor -{ - double sum; - modifying_functor() : sum(0) - {} - inline void operator()(P& p) - { - p.x(1); - } - - inline void operator()(bg::segment

& s) - { - s.first.x(1); - } -}; - -template -struct const_functor -{ - double sum; - const_functor() : sum(0) - {} - inline void operator()(P const& p) - { - sum += p.x(); - } - - inline void operator()(bg::segment

const& s) - { - sum += s.first.x() - s.second.x(); - } -}; - -template class V> -void check_linestring() -{ - typedef bg::model::d2::point_xy P; - typedef bg::model::linestring line_type; - line_type line; - line.push_back(P(0,0)); - line.push_back(P(1,1)); - - typedef bg::multi_linestring multi_line_type; - multi_line_type multi; - multi.push_back(line); - - double len = bg::length(line); - len = bg::length(multi); - double d = bg::distance(P(0,1), line); - //d = bg::distance(P(0,1), multi); not defined yet! - - line_type simp; - bg::simplify(line, simp, 3); - multi_line_type simpm; - bg::simplify(multi, simpm, 3); - - typedef bg::model::box

box_type; - box_type box1; - bg::envelope(line, box1); - box_type box2; - bg::envelope(multi, box2); - - // FIXME: Where is output stream op for line/multi --mloskot - //std::stringstream out; - // out << line << std::endl; - //out << multi << std::endl; - - // For each, const - /* TODO: Fix for_each/functor - const_functor

cf; - std::for_each(line.begin(), line.end(), cf); - - const line_type& cl = line; - const multi_line_type& cm = multi; - - bg::for_each_point(cl, cf); - bg::for_each_point(cm, cf); - bg::for_each_segment(cl, cf); - bg::for_each_segment(cm, cf); - - // For each, modifying - modifying_functor

mf; - line_type& ml = line; - multi_line_type& mm = multi; - std::for_each(line.begin(), line.end(), mf); - bg::for_each_point(ml, mf); - bg::for_each_point(mm, mf); - bg::for_each_segment(ml, mf); - bg::for_each_segment(mm, mf); - */ - -} - -template -< - typename T, - template class VP, - template class VR -> -void check_polygon() -{ - typedef bg::model::d2::point_xy P; - typedef bg::model::polygon Y; - Y poly; - poly.outer().push_back(P(0,0)); - poly.outer().push_back(P(2,0)); - poly.outer().push_back(P(2,2)); - poly.outer().push_back(P(0,2)); - - bg::correct(poly); - - // multi - typedef bg::multi_polygon MY; - MY multi; - multi.push_back(poly); - - double a = bg::area(poly); - a = bg::area(multi); - - //double d = bg::distance(P(0,1), poly); - - Y simp; - bg::simplify(poly, simp, 3); - MY msimp; - bg::simplify(multi, msimp, 3); - - typedef bg::model::box

box_type; - box_type box1; - bg::envelope(poly, box1); - box_type box2; - bg::envelope(multi, box2); - - P ctr; - bg::centroid(poly, ctr); - - // within - bg::model::d2::point_xy circ_centre(10,10); - - bool w = bg::within(P(1, 1), poly); - //w = bg::within(poly, b); tbd - w = bg::within(P(1, 1), multi); - - //bg::circle circ(circ_centre, 10); - //w = bg::within(poly, circ); - //w = bg::within(multi, circ); - //w = bg::within(multi, b); tbd - - // For each, const - /* TODO: Fix for_each/functor - const_functor

cf; - std::for_each(poly.outer().begin(), poly.outer().end(), cf); - - const Y& cp = poly; - const MY& cm = multi; - - bg::for_each_point(cp, cf); - bg::for_each_point(cm, cf); - bg::for_each_segment(cp, cf); - bg::for_each_segment(cm, cf); - - // For each, modifying - modifying_functor

mf; - Y& mp = poly; - MY& mm = multi; - std::for_each(poly.outer().begin(), poly.outer().end(), mf); - bg::for_each_point(mp, mf); - bg::for_each_point(mm, mf); - bg::for_each_segment(mp, mf); - bg::for_each_segment(mm, mf); - */ -} - - -int main() -{ - check_linestring(); - check_linestring(); - check_linestring(); - check_linestring(); - - //check_linestring(); - check_linestring(); - - check_polygon(); - check_polygon(); - check_polygon(); - check_polygon(); - - //check_polygon(); - check_polygon(); - //check_polygon(); - check_polygon(); - - return 0; -} - diff --git a/test/compile_test.sln b/test/compile_test.sln deleted file mode 100644 index 761a5e982..000000000 --- a/test/compile_test.sln +++ /dev/null @@ -1,29 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compile_test", "compile_test.vcproj", "{618D4B05-A06E-443B-87C0-94964CEA7164}" - ProjectSection(ProjectDependencies) = postProject - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A} = {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ggl_headers", "ggl_headers.vcproj", "{B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {618D4B05-A06E-443B-87C0-94964CEA7164}.Debug|Win32.ActiveCfg = Debug|Win32 - {618D4B05-A06E-443B-87C0-94964CEA7164}.Debug|Win32.Build.0 = Debug|Win32 - {618D4B05-A06E-443B-87C0-94964CEA7164}.Release|Win32.ActiveCfg = Release|Win32 - {618D4B05-A06E-443B-87C0-94964CEA7164}.Release|Win32.Build.0 = Release|Win32 - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Debug|Win32.ActiveCfg = Debug|Win32 - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Debug|Win32.Build.0 = Debug|Win32 - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Release|Win32.ActiveCfg = Release|Win32 - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/compile_test.vcproj b/test/compile_test.vcproj deleted file mode 100644 index 9686952a2..000000000 --- a/test/compile_test.vcproj +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/custom_tests.sln b/test/custom_tests.sln deleted file mode 100644 index b9262d093..000000000 --- a/test/custom_tests.sln +++ /dev/null @@ -1,37 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_well_formed_point", "point_concept\well_formed_point.vcproj", "{B63710DE-960E-4C00-B79A-7C8F80D6BC15}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_well_formed_point_traits", "point_concept\well_formed_point_traits.vcproj", "{4F767915-5FC0-4BEB-8948-F371896BBD59}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_array_point", "point_concept\array_point.vcproj", "{436E02F5-A4E6-40F8-8E41-57560875D67F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "point_concept_point_with_incorrect_coord_count", "point_concept\point_with_incorrect_coord_count.vcproj", "{B696EDCA-4602-4962-8A1C-043B3F44B978}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B63710DE-960E-4C00-B79A-7C8F80D6BC15}.Debug|Win32.ActiveCfg = Debug|Win32 - {B63710DE-960E-4C00-B79A-7C8F80D6BC15}.Debug|Win32.Build.0 = Debug|Win32 - {B63710DE-960E-4C00-B79A-7C8F80D6BC15}.Release|Win32.ActiveCfg = Release|Win32 - {B63710DE-960E-4C00-B79A-7C8F80D6BC15}.Release|Win32.Build.0 = Release|Win32 - {4F767915-5FC0-4BEB-8948-F371896BBD59}.Debug|Win32.ActiveCfg = Debug|Win32 - {4F767915-5FC0-4BEB-8948-F371896BBD59}.Debug|Win32.Build.0 = Debug|Win32 - {4F767915-5FC0-4BEB-8948-F371896BBD59}.Release|Win32.ActiveCfg = Release|Win32 - {4F767915-5FC0-4BEB-8948-F371896BBD59}.Release|Win32.Build.0 = Release|Win32 - {436E02F5-A4E6-40F8-8E41-57560875D67F}.Debug|Win32.ActiveCfg = Debug|Win32 - {436E02F5-A4E6-40F8-8E41-57560875D67F}.Debug|Win32.Build.0 = Debug|Win32 - {436E02F5-A4E6-40F8-8E41-57560875D67F}.Release|Win32.ActiveCfg = Release|Win32 - {436E02F5-A4E6-40F8-8E41-57560875D67F}.Release|Win32.Build.0 = Release|Win32 - {B696EDCA-4602-4962-8A1C-043B3F44B978}.Debug|Win32.ActiveCfg = Debug|Win32 - {B696EDCA-4602-4962-8A1C-043B3F44B978}.Debug|Win32.Build.0 = Debug|Win32 - {B696EDCA-4602-4962-8A1C-043B3F44B978}.Release|Win32.ActiveCfg = Release|Win32 - {B696EDCA-4602-4962-8A1C-043B3F44B978}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/geometries/boost_polygon.cpp b/test/geometries/boost_polygon.cpp index 95f72b3e5..b8c614b0e 100644 --- a/test/geometries/boost_polygon.cpp +++ b/test/geometries/boost_polygon.cpp @@ -77,8 +77,8 @@ void test_coordinate_type() boost::polygon::rectangle_data boost_polygon_box; bg::model::box boost_geometry_box; - bg::assign(boost_polygon_box, 0, 1, 5, 6); - bg::assign(boost_geometry_box, 0, 1, 5, 6); + bg::assign_values(boost_polygon_box, 0, 1, 5, 6); + bg::assign_values(boost_geometry_box, 0, 1, 5, 6); T boost_polygon_area = bg::area(boost_polygon_box); T boost_geometry_area = bg::area(boost_geometry_box); T boost_polygon_area_by_boost_polygon = boost::polygon::area(boost_polygon_box); diff --git a/test/geometries/box.cpp b/test/geometries/box.cpp index 17e89a9ba..44a9a012f 100644 --- a/test/geometries/box.cpp +++ b/test/geometries/box.cpp @@ -30,8 +30,8 @@ bg::model::box

create_box() { P p1; P p2; - bg::assign(p1, 1, 2, 5); - bg::assign(p2, 3, 4, 6); + bg::assign_values(p1, 1, 2, 5); + bg::assign_values(p2, 3, 4, 6); return bg::model::box

(p1, p2); } diff --git a/test/ggl_headers.sln b/test/ggl_headers.sln deleted file mode 100644 index efd7ebbc3..000000000 --- a/test/ggl_headers.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ggl_headers", "ggl_headers.vcproj", "{B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Debug|Win32.ActiveCfg = Debug|Win32 - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Debug|Win32.Build.0 = Debug|Win32 - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Release|Win32.ActiveCfg = Release|Win32 - {B3B37654-5AB4-49F3-A1D3-DFDE73EA5E1A}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/ggl_headers.vcproj b/test/ggl_headers.vcproj deleted file mode 100644 index a13b94483..000000000 --- a/test/ggl_headers.vcproj +++ /dev/null @@ -1,1339 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/strategies/cross_track.cpp b/test/strategies/cross_track.cpp index ac43c1bb2..f53f6255b 100644 --- a/test/strategies/cross_track.cpp +++ b/test/strategies/cross_track.cpp @@ -60,9 +60,9 @@ void test_distance( Point p1, p2, p3; - bg::assign(p1, lon1, lat1); - bg::assign(p2, lon2, lat2); - bg::assign(p3, lon3, lat3); + bg::assign_values(p1, lon1, lat1); + bg::assign_values(p2, lon2, lat2); + bg::assign_values(p3, lon3, lat3); strategy_type strategy; diff --git a/test/strategies/haversine.cpp b/test/strategies/haversine.cpp index 432602cd8..3ad545878 100644 --- a/test/strategies/haversine.cpp +++ b/test/strategies/haversine.cpp @@ -60,8 +60,8 @@ struct test_distance haversine_type strategy(radius); Point p1, p2; - bg::assign(p1, lon1, lat1); - bg::assign(p2, lon2, lat2); + bg::assign_values(p1, lon1, lat1); + bg::assign_values(p2, lon2, lat2); return_type d = strategy.apply(p1, p2); BOOST_CHECK_CLOSE(d, expected, tolerance); @@ -102,10 +102,10 @@ void test_services() } P1 p1; - bg::assign(p1, 4, 52); + bg::assign_values(p1, 4, 52); P2 p2; - bg::assign(p2, 2, 48); + bg::assign_values(p2, 2, 48); // ~ Amsterdam/Paris, 467 kilometers double const km = 1000.0; @@ -177,8 +177,8 @@ void time_compare_s(int const n) { boost::timer t; P p1, p2; - bg::assign(p1, 1, 1); - bg::assign(p2, 2, 2); + bg::assign_values(p1, 1, 1); + bg::assign_values(p2, 2, 2); Strategy strategy; typename Strategy::return_type s = 0; for (int i = 0; i < n; i++) diff --git a/test/strategies/projected_point.cpp b/test/strategies/projected_point.cpp index 86fe16190..7ad1e91fb 100644 --- a/test/strategies/projected_point.cpp +++ b/test/strategies/projected_point.cpp @@ -36,11 +36,11 @@ template void test_services() { PS p1, p2; - bg::assign(p1, 0, 0); - bg::assign(p2, 0, 4); + bg::assign_values(p1, 0, 0); + bg::assign_values(p2, 0, 4); P p; - bg::assign(p, 2, 0); + bg::assign_values(p, 2, 0); CalculationType const sqr_expected = 4; CalculationType const expected = 2; diff --git a/test/strategies/pythagoras.cpp b/test/strategies/pythagoras.cpp index 2b022fdfa..204386422 100644 --- a/test/strategies/pythagoras.cpp +++ b/test/strategies/pythagoras.cpp @@ -45,9 +45,9 @@ template void test_null_distance_3d() { P1 p1; - bg::assign(p1, 1, 2, 3); + bg::assign_values(p1, 1, 2, 3); P2 p2; - bg::assign(p2, 1, 2, 3); + bg::assign_values(p2, 1, 2, 3); typedef bg::strategy::distance::pythagoras pythagoras_type; typedef typename bg::strategy::distance::services::return_type::type return_type; @@ -62,9 +62,9 @@ template void test_axis_3d() { P1 p1; - bg::assign(p1, 0, 0, 0); + bg::assign_values(p1, 0, 0, 0); P2 p2; - bg::assign(p2, 1, 0, 0); + bg::assign_values(p2, 1, 0, 0); typedef bg::strategy::distance::pythagoras pythagoras_type; typedef typename bg::strategy::distance::services::return_type::type return_type; @@ -74,11 +74,11 @@ void test_axis_3d() return_type result = pythagoras.apply(p1, p2); BOOST_CHECK_EQUAL(result, return_type(1)); - bg::assign(p2, 0, 1, 0); + bg::assign_values(p2, 0, 1, 0); result = pythagoras.apply(p1, p2); BOOST_CHECK_EQUAL(result, return_type(1)); - bg::assign(p2, 0, 0, 1); + bg::assign_values(p2, 0, 0, 1); result = pythagoras.apply(p1, p2); BOOST_CHECK_CLOSE(result, return_type(1), 0.001); } @@ -87,9 +87,9 @@ template void test_arbitrary_3d() { P1 p1; - bg::assign(p1, 1, 2, 3); + bg::assign_values(p1, 1, 2, 3); P2 p2; - bg::assign(p2, 9, 8, 7); + bg::assign_values(p2, 9, 8, 7); { typedef bg::strategy::distance::pythagoras strategy_type; @@ -125,10 +125,10 @@ void test_services() P1 p1; - bg::assign(p1, 1, 2, 3); + bg::assign_values(p1, 1, 2, 3); P2 p2; - bg::assign(p2, 4, 5, 6); + bg::assign_values(p2, 4, 5, 6); double const sqr_expected = 3*3 + 3*3 + 3*3; // 27 double const expected = sqrt(sqr_expected); // sqrt(27)=5.1961524227 @@ -201,8 +201,8 @@ void test_big_2d_with(AssignType const& x1, AssignType const& y1, point_type p1, p2; - bg::assign(p1, x1, y1); - bg::assign(p2, x2, y2); + bg::assign_values(p1, x1, y1); + bg::assign_values(p2, x2, y2); return_type d = pythagoras.apply(p1, p2); /*** @@ -258,8 +258,8 @@ void time_compare_s(int const n) { boost::timer t; P p1, p2; - bg::assign(p1, 1, 1); - bg::assign(p2, 2, 2); + bg::assign_values(p1, 1, 1); + bg::assign_values(p2, 2, 2); Strategy strategy; typename bg::strategy::distance::services::return_type::type s = 0; for (int i = 0; i < n; i++) diff --git a/test/strategies/segment_intersection.cpp b/test/strategies/segment_intersection.cpp index ddf096f0e..cbf40f278 100644 --- a/test/strategies/segment_intersection.cpp +++ b/test/strategies/segment_intersection.cpp @@ -93,10 +93,10 @@ static void test_segment_intersection(int caseno, typedef segment segment_type; P p1, p2, p3, p4; - bg::assign(p1, x1, y1); - bg::assign(p2, x2, y2); - bg::assign(p3, x3, y3); - bg::assign(p4, x4, y4); + bg::assign_values(p1, x1, y1); + bg::assign_values(p2, x2, y2); + bg::assign_values(p3, x3, y3); + bg::assign_values(p4, x4, y4); segment_type s12(p1,p2); segment_type s34(p3,p4); diff --git a/test/strategies/segment_intersection_collinear.cpp b/test/strategies/segment_intersection_collinear.cpp index e2bc08e18..3c02f39ad 100644 --- a/test/strategies/segment_intersection_collinear.cpp +++ b/test/strategies/segment_intersection_collinear.cpp @@ -67,10 +67,10 @@ static void test_segment_intersection(std::string const& case_id, typedef bg::segment segment_type; P p1, p2, p3, p4; - bg::assign(p1, x1, y1); - bg::assign(p2, x2, y2); - bg::assign(p3, x3, y3); - bg::assign(p4, x4, y4); + bg::assign_values(p1, x1, y1); + bg::assign_values(p2, x2, y2); + bg::assign_values(p3, x3, y3); + bg::assign_values(p4, x4, y4); segment_type s12(p1,p2); segment_type s34(p3,p4); diff --git a/test/strategies/side_by_cross_track.cpp b/test/strategies/side_by_cross_track.cpp index 68c8c2495..e02f3267d 100644 --- a/test/strategies/side_by_cross_track.cpp +++ b/test/strategies/side_by_cross_track.cpp @@ -29,9 +29,9 @@ void test_side(double lon1, double lat1, typedef bg::strategy::side::side_by_cross_track strategy; Point p1, p2, p3; - bg::assign(p1, lon1, lat1); - bg::assign(p2, lon2, lat2); - bg::assign(p3, lon3, lat3); + bg::assign_values(p1, lon1, lat1); + bg::assign_values(p2, lon2, lat2); + bg::assign_values(p3, lon3, lat3); int s = strategy::apply(p1, p2, p3); } diff --git a/test/strategies/transformer.cpp b/test/strategies/transformer.cpp index c8467817b..3826ce823 100644 --- a/test/strategies/transformer.cpp +++ b/test/strategies/transformer.cpp @@ -46,7 +46,7 @@ template void test_all() { P p; - bg::assign(p, 1, 1); + bg::assign_values(p, 1, 1); { bg::strategy::transform::translate_transformer trans(1, 1); diff --git a/test/util/for_each_coordinate.cpp b/test/util/for_each_coordinate.cpp index 3187d3de1..993c6a4d1 100644 --- a/test/util/for_each_coordinate.cpp +++ b/test/util/for_each_coordinate.cpp @@ -55,7 +55,7 @@ template void test_all() { P p; - bg::assign(p, 1, 2, 3); + bg::assign_values(p, 1, 2, 3); bg::for_each_coordinate(p, test_operation()); BOOST_CHECK(bg::get<0>(p) == 10); BOOST_CHECK(bg::get<1>(p) == 20);