diff --git a/doc/doxy/Doxyfile b/doc/doxy/Doxyfile index 880e69b0c..2cd86526b 100644 --- a/doc/doxy/Doxyfile +++ b/doc/doxy/Doxyfile @@ -54,6 +54,7 @@ ALIASES = qbk{1}="\xmlonly \1 \endxmlonly" \ tparam_box="Any type fulfilling a Box Concept" \ tparam_box_or_segment="Any type fulfilling a Box Concept or a Segment Concept" \ tparam_calculation="numeric type for calculation (e.g. high precision); if [*void] then it is extracted automatically from the coordinate type and (if necessary) promoted to floating point" \ + tparam_radius="numeric type for radius (of sphere, earth)" \ tparam_container="container type, for example std::vector, std::deque" \ tparam_dimension_required="Dimension, this template parameter is required. Should contain \\[0 .. n-1\\] for an n-dimensional geometry" \ tparam_first_point="first point type" \ diff --git a/doc/doxy/doxygen_input/sourcecode/boost.vsprops b/doc/doxy/doxygen_input/sourcecode/boost.vsprops deleted file mode 100644 index 68eaf1ffa..000000000 --- a/doc/doxy/doxygen_input/sourcecode/boost.vsprops +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/doc/doxy/doxygen_input/sourcecode/doxygen_1.vcproj b/doc/doxy/doxygen_input/sourcecode/doxygen_1.vcproj deleted file mode 100644 index 72b68d7b6..000000000 --- a/doc/doxy/doxygen_input/sourcecode/doxygen_1.vcproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/doxy/doxygen_input/sourcecode/doxygen_2.vcproj b/doc/doxy/doxygen_input/sourcecode/doxygen_2.vcproj deleted file mode 100644 index 78e45ef4e..000000000 --- a/doc/doxy/doxygen_input/sourcecode/doxygen_2.vcproj +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/doxy/doxygen_input/sourcecode/doxygen_3.vcproj b/doc/doxy/doxygen_input/sourcecode/doxygen_3.vcproj deleted file mode 100644 index 0a326ba5e..000000000 --- a/doc/doxy/doxygen_input/sourcecode/doxygen_3.vcproj +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/doxy/doxygen_input/sourcecode/doxygen_4.vcproj b/doc/doxy/doxygen_input/sourcecode/doxygen_4.vcproj deleted file mode 100644 index d65ca80c1..000000000 --- a/doc/doxy/doxygen_input/sourcecode/doxygen_4.vcproj +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/doxy/doxygen_input/sourcecode/doxygen_5.vcproj b/doc/doxy/doxygen_input/sourcecode/doxygen_5.vcproj deleted file mode 100644 index 23505e8c9..000000000 --- a/doc/doxy/doxygen_input/sourcecode/doxygen_5.vcproj +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/doxy/doxygen_input/sourcecode/doxygen_examples.sln b/doc/doxy/doxygen_input/sourcecode/doxygen_examples.sln deleted file mode 100644 index d7fd0b326..000000000 --- a/doc/doxy/doxygen_input/sourcecode/doxygen_examples.sln +++ /dev/null @@ -1,43 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doxygen_1", "doxygen_1.vcproj", "{861F130D-2849-4B50-B240-049DBD9D3F18}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doxygen_2", "doxygen_2.vcproj", "{6CF6A521-57E0-4DA4-9D17-ED5D29E4208C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doxygen_3", "doxygen_3.vcproj", "{45D4139F-BC5B-4D48-BAB8-9901C53ECCC9}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doxygen_4", "doxygen_4.vcproj", "{CBEDAEC7-EC87-4F91-9C45-F9505A052A44}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "doxygen_5", "doxygen_5.vcproj", "{0CDE9E15-C937-4D05-B9BF-A2D96B8EAD33}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {861F130D-2849-4B50-B240-049DBD9D3F18}.Debug|Win32.ActiveCfg = Debug|Win32 - {861F130D-2849-4B50-B240-049DBD9D3F18}.Debug|Win32.Build.0 = Debug|Win32 - {861F130D-2849-4B50-B240-049DBD9D3F18}.Release|Win32.ActiveCfg = Release|Win32 - {861F130D-2849-4B50-B240-049DBD9D3F18}.Release|Win32.Build.0 = Release|Win32 - {6CF6A521-57E0-4DA4-9D17-ED5D29E4208C}.Debug|Win32.ActiveCfg = Debug|Win32 - {6CF6A521-57E0-4DA4-9D17-ED5D29E4208C}.Debug|Win32.Build.0 = Debug|Win32 - {6CF6A521-57E0-4DA4-9D17-ED5D29E4208C}.Release|Win32.ActiveCfg = Release|Win32 - {6CF6A521-57E0-4DA4-9D17-ED5D29E4208C}.Release|Win32.Build.0 = Release|Win32 - {45D4139F-BC5B-4D48-BAB8-9901C53ECCC9}.Debug|Win32.ActiveCfg = Debug|Win32 - {45D4139F-BC5B-4D48-BAB8-9901C53ECCC9}.Debug|Win32.Build.0 = Debug|Win32 - {45D4139F-BC5B-4D48-BAB8-9901C53ECCC9}.Release|Win32.ActiveCfg = Release|Win32 - {45D4139F-BC5B-4D48-BAB8-9901C53ECCC9}.Release|Win32.Build.0 = Release|Win32 - {CBEDAEC7-EC87-4F91-9C45-F9505A052A44}.Debug|Win32.ActiveCfg = Debug|Win32 - {CBEDAEC7-EC87-4F91-9C45-F9505A052A44}.Debug|Win32.Build.0 = Debug|Win32 - {CBEDAEC7-EC87-4F91-9C45-F9505A052A44}.Release|Win32.ActiveCfg = Release|Win32 - {CBEDAEC7-EC87-4F91-9C45-F9505A052A44}.Release|Win32.Build.0 = Release|Win32 - {0CDE9E15-C937-4D05-B9BF-A2D96B8EAD33}.Debug|Win32.ActiveCfg = Debug|Win32 - {0CDE9E15-C937-4D05-B9BF-A2D96B8EAD33}.Debug|Win32.Build.0 = Debug|Win32 - {0CDE9E15-C937-4D05-B9BF-A2D96B8EAD33}.Release|Win32.ActiveCfg = Release|Win32 - {0CDE9E15-C937-4D05-B9BF-A2D96B8EAD33}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/doc/html/img/index/rtree/build_non_ovl.png b/doc/html/img/index/rtree/build_non_ovl.png index 8bcb0d675..4aaedfe36 100644 Binary files a/doc/html/img/index/rtree/build_non_ovl.png and b/doc/html/img/index/rtree/build_non_ovl.png differ diff --git a/doc/html/img/index/rtree/build_ovl.png b/doc/html/img/index/rtree/build_ovl.png index 338766666..d443def7d 100644 Binary files a/doc/html/img/index/rtree/build_ovl.png and b/doc/html/img/index/rtree/build_ovl.png differ diff --git a/doc/html/img/index/rtree/intersects_linestring.png b/doc/html/img/index/rtree/intersects_linestring.png new file mode 100644 index 000000000..d7d84d210 Binary files /dev/null and b/doc/html/img/index/rtree/intersects_linestring.png differ diff --git a/doc/html/img/index/rtree/intersects_segment.png b/doc/html/img/index/rtree/intersects_segment.png new file mode 100644 index 000000000..213af34bf Binary files /dev/null and b/doc/html/img/index/rtree/intersects_segment.png differ diff --git a/doc/html/img/index/rtree/query_non_ovl.png b/doc/html/img/index/rtree/query_non_ovl.png index 537265fab..2594aea4a 100644 Binary files a/doc/html/img/index/rtree/query_non_ovl.png and b/doc/html/img/index/rtree/query_non_ovl.png differ diff --git a/doc/html/img/index/rtree/query_ovl.png b/doc/html/img/index/rtree/query_ovl.png index 12a2eab6f..510811389 100644 Binary files a/doc/html/img/index/rtree/query_ovl.png and b/doc/html/img/index/rtree/query_ovl.png differ diff --git a/doc/index/introduction.qbk b/doc/index/introduction.qbk index 9f1a61886..cb7bcf1d3 100644 --- a/doc/index/introduction.qbk +++ b/doc/index/introduction.qbk @@ -49,11 +49,11 @@ This method is faster and results in R-trees with better internal structure. Thi The examples of structures of trees created by use of different algorithms and exemplary operations times are presented below. [table -[[] [Linear algorithm] [Quadratic algorithm] [R*-tree] [Packing algorithm (trunk)]] +[[] [Linear algorithm] [Quadratic algorithm] [R*-tree] [Packing algorithm]] [[*Example structure*] [[$img/index/rtree/linear.png]] [[$img/index/rtree/quadratic.png]] [[$img/index/rtree/rstar.png]] [[$img/index/rtree/bulk.png]]] [[*1M Values inserts*] [1.76s] [2.47s] [6.19s] [1.67s]] [[*100k spatial queries*] [2.21s] [0.51s] [0.12s] [0.07s]] -[[*100k knn queries*] [6.37s] [2.09s] [0.64s] [0.52]] +[[*100k knn queries*] [6.37s] [2.09s] [0.64s] [0.52s]] ] The performance of the R-tree for different values of Max parameter and Min=0.5*Max is presented in the table below. @@ -74,25 +74,31 @@ Key features of this implementation of the __rtree__ are: * capable to store arbitrary __value__ type, * three different balancing algorithms - linear, quadratic or rstar, +* creation using packing algorithm, * parameters (including maximal and minimal number of elements) may be passed as compile- or run-time parameters, in compile-time version nodes elements are stored in static-size containers, * advanced queries - e.g. search for 5 nearest Values to some point and intersecting some Geometry but not within the other one, +* iterative queries - by use of iterators, * C++11 conformant: move semantics, stateful allocators, * capable to store __value__ type with no default constructor, * in-memory storage (shared memory by use of Boost.Interprocess allocator). -[heading Planned and experimental features] +[heading Planned features] Below you can find features that will (or probably will) be added in the future releases: +[/ Done * rstar optimization (planned for release in Boost 1.55), * bulk loading (planned for release in Boost 1.55), -* iterative queries - query iterators / type-erased query iterators (experimental), -* path/ray query predicate - search for Values along Segment or LineString, closest to the starting point (experimental), -* persistent storage. -[/ * 'reversed' spatial predicates or additional spatial predicates like contains(), -* other geometries as Values, e.g. NSpheres. Rings would probably require using move semantics instead of copying +* iterative queries - query iterators / type-erased query iterators, +/] +* path/ray query predicate - search for Values along Segment or LineString, closest to the starting point, +* user-defined distance calculation in nearest() predicate, +* serialization, +* persistent storage. +[/ Maybe +* other geometries as Indexables, e.g. NSpheres. Rings would probably require using move semantics instead of copying * bounding tree - rtree variation capable to use other Geometries as bounds, e.g. NSpheres, Rings/convex polygons/ (moving required), Capsules, Elipses, Variants etc. * moving instead of copying + optimizations for movable/nonthrowing/trivialy copied elements * passing more than one nearest/path predicate - "returned value is one of k1 nearest values to p1 and ... and one of kN nearest values to pN" diff --git a/doc/index/rtree/query.qbk b/doc/index/rtree/query.qbk index 493654602..7f10db949 100644 --- a/doc/index/rtree/query.qbk +++ b/doc/index/rtree/query.qbk @@ -24,32 +24,44 @@ For example queries may be used to retrieve Values: [h4 Performing a query] -There are three ways to perform a query presented below. All of them returns `__value__`s intersecting some -region defined as a `__box__`. +There are various ways to perform a query. They are presented below. +All of them returns `__value__`s intersecting some region defined as a `__box__`. -Method call +Member function call std::vector<__value__> returned_values; __box__ box_region(...); rt.query(bgi::intersects(box_region), std::back_inserter(returned_values)); -Function call +Free function call std::vector<__value__> returned_values; __box__ box_region(...); - index::query(rt, bgi::intersects(box_region), std::back_inserter(returned_values)); + bgi::query(rt, bgi::intersects(box_region), std::back_inserter(returned_values)); -Use of pipe operator generating a range +Range generated by `operator|` __box__ box_region(...); - BOOST_FOREACH(__value__ & v, rt | index::adaptors::queried(bgi::intersects(box_region))) + BOOST_FOREACH(__value__ & v, rt | bgi::adaptors::queried(bgi::intersects(box_region))) ; // do something with v +Query iterators returned by member functions + + std::vector<__value__> returned_values; + __box__ box_region(...); + std::copy(rt.qbegin(bgi::intersects(box_region)), rt.qend(), std::back_inserter(returned_values)); + +Query iterators returned by free functions + + std::vector<__value__> returned_values; + __box__ box_region(...); + std::copy(bgi::qbegin(rt, bgi::intersects(box_region)), bgi::qend(rt), std::back_inserter(returned_values)); + [h4 Spatial predicates] Queries using spatial predicates returns `__value__`s which are related somehow to some Geometry - box, polygon, etc. -Names of spatial predicates correspond to names of __boost_geometry__ algorithms. Examples of some -basic queries may be found in tables below. The query region and result `Value`s are orange. +Names of spatial predicates correspond to names of __boost_geometry__ algorithms (boolean operations). +Examples of some basic queries may be found in the tables below. The query region and result `Value`s are orange. [table [[intersects(Box)] [covered_by(Box)] [disjoint(Box)] [overlaps(Box)] [within(Box)]] @@ -57,15 +69,17 @@ basic queries may be found in tables below. The query region and result `Value`s ] [table -[[intersects(Ring)] [intersects(Polygon)] [intersects(MultiPolygon)]] -[[[$img/index/rtree/intersects_ring.png]] [[$img/index/rtree/intersects_poly.png]] [[$img/index/rtree/intersects_mpoly.png]]] +[[intersects(Ring)] [intersects(Polygon)] [intersects(MultiPolygon)] [intersects(Segment)] [intersects(Linestring)]] +[[[$img/index/rtree/intersects_ring.png]] [[$img/index/rtree/intersects_poly.png]] [[$img/index/rtree/intersects_mpoly.png]] [[$img/index/rtree/intersects_segment.png]] [[$img/index/rtree/intersects_linestring.png]]] ] -To use a spatial predicate one may use one of the functions defined in `boost::geometry::index` namespace. +Spatial predicates are generated by functions defined in `boost::geometry::index` namespace. - rt.query(index::intersects(box), std::back_inserter(result)); + rt.query(index::contains(box), std::back_inserter(result)); rt.query(index::covered_by(box), std::back_inserter(result)); + rt.query(index::covers(box), std::back_inserter(result)); rt.query(index::disjont(box), std::back_inserter(result)); + rt.query(index::intersects(box), std::back_inserter(result)); rt.query(index::overlaps(box), std::back_inserter(result)); rt.query(index::within(box), std::back_inserter(result)); @@ -75,39 +89,21 @@ All spatial predicates may be negated, e.g.: // the same as rt.query(index::disjoint(box), std::back_inserter(result)); -[h4 Distance predicates] - -[h5 Nearest neighbours queries] +[h4 Nearest neighbours queries] Nearest neighbours queries returns `__value__`s which are closest to some point in space. -Additionally it is possible to define how the distance to the `Value` should be calculated. -The example of knn query is presented below. 5 `__value__`s nearest to some point are orange. +The example of knn query is presented below. 5 `__value__`s nearest to the point are orange. [$img/index/rtree/knn.png] -[h5 k nearest neighbours] - -There are three ways of performing knn queries. Following queries returns -`k` `__value__`s closest to some point in space. For `__box__`es -`__indexable__`s the distance to the nearest point is calculated by default. - -Method call +To perform the knn query one must pass the nearest predicate generated by the +`nearest()` function defined in `boost::geometry::index` namespace. +The following query returns `k` `__value__`s closest to some point in space. +For non-point `__indexable__`s the shortest distance is calculated. std::vector<__value__> returned_values; __point__ pt(...); - rt.query(index::nearest(pt, k), std::back_inserter(returned_values)); - -Function call - - std::vector<__value__> returned_values; - __point__ pt(...); - index::query(rt, index::nearest(pt, k), std::back_inserter(returned_values)); - -Use of `operator |` - - __point__ pt(...); - BOOST_FOREACH(__value__ & v, rt | index::adaptors::queried(index::nearest(pt, k))) - ; // do something with v + rt.query(bgi::nearest(pt, k), std::back_inserter(returned_values)); [h4 User-defined unary predicate] @@ -177,6 +173,19 @@ Of course it's possible to connect different types of predicates together. BOOST_FOREACH(Value & v, rt | index::adaptors::queried(index::nearest(pt, k) && index::covered_by(b))) ; // do something with v +[h4 Breaking or pausing the query] + +The query performed using query iterators may be paused and resumed if needed, e.g. when the query takes too long, +or stopped at some point, e.g when all interesting values were gathered. + + for ( Rtree::const_query_iterator it = tree.qbegin(bgi::nearest(pt, 10000)) ; + it != tree.qend() ; ++it ) + { + // do something with value + if ( has_enough_nearest_values() ) + break; + } + [h4 Inserting query results into the other R-tree] There are several ways of inserting Values returned by a query to the other R-tree container. diff --git a/doc/make_qbk.py b/doc/make_qbk.py index c776ca5f7..ae8adfda7 100755 --- a/doc/make_qbk.py +++ b/doc/make_qbk.py @@ -31,10 +31,12 @@ cmd = cmd + " --convenience_header_path ../../../boost/geometry/" cmd = cmd + " --convenience_headers geometry.hpp,geometries/geometries.hpp,multi/multi.hpp" cmd = cmd + " --skip_namespace boost::geometry::" cmd = cmd + " --copyright src/copyright_block.qbk" +cmd = cmd + " --output_member_variables false" cmd = cmd + " > generated/%s.qbk" def call_doxygen(): os.chdir("doxy"); + os.system("rm -f doxygen_output/xml/*.xml") os.system(doxygen_cmd) os.chdir("..") diff --git a/doc/quickref.xml b/doc/quickref.xml index 87952f4d7..987cad233 100644 --- a/doc/quickref.xml +++ b/doc/quickref.xml @@ -680,6 +680,8 @@ remove(Iterator, Iterator) remove(Range const &) query(Predicates const &, OutIter) + qbegin(Predicates const &) + qend() size() empty() clear() @@ -701,6 +703,8 @@ remove(rtree<...> &, Iterator, Iterator) remove(rtree<...> &, Range const &) query(rtree<...> const &, Predicates const &, OutIter) + qbegin(rtree<...> const &, Predicates const &) + qend(rtree<...> const &) clear(rtree<...> &) size(rtree<...> const &) empty(rtree<...> const &) @@ -728,7 +732,9 @@ Predicates (boost::geometry::index::) + contains(Geometry const &) covered_by(Geometry const &) + covers(Geometry const &) disjoint(Geometry const &) intersects(Geometry const &) overlaps(Geometry const &) diff --git a/doc/release_notes.qbk b/doc/release_notes.qbk index 3f0779452..a5842810a 100644 --- a/doc/release_notes.qbk +++ b/doc/release_notes.qbk @@ -13,6 +13,42 @@ [section:release_notes Release Notes] +[/=================] +[heading Boost 1.55] +[/=================] + +[*Additional functionality] + +* Added centroid for segment type +* Added intersects() and disjoints() for Segment-Box and Linestring-Box +* Added rtree creation using packing algorithm +* Added contains() and covers() spatial query predicates +* Added iterative queries + +[*Documentation] + +[*Bugfixes] + +* In some cases .back() or .clear() was called, violating the usage of Concepts. Fixed for the reported cases + +[*Solved tickets] + +* [@https://svn.boost.org/trac/boost/ticket/6958 6958] Intersection generates self-intersection. Caused by spike, fixed +* [@https://svn.boost.org/trac/boost/ticket/8364 8364] Invalid input exception, caused by spikes in previous steps, fixed +* [@https://svn.boost.org/trac/boost/ticket/8365 8365] Invalid input exception, caused by spikes in previous steps, fixed +* [@https://svn.boost.org/trac/boost/ticket/8969 8969] boost::geometry::model::point single argument constructor should be explicit +* [@https://svn.boost.org/trac/boost/ticket/8825 8825] Patch adding member variable documentation to doxygen_xml2qbk +* [@https://svn.boost.org/trac/boost/ticket/8652 8652] Intersection fails for triangle-triangle intersection. Caused by spike, fixed +* [@https://svn.boost.org/trac/boost/ticket/9047 9047] Boost files that include themselves (strategies/intersection.hpp), fixed + +[*Internal changes] + +* Distance-strategy TODO +* Transform-strategy TODO +* Spikes (could be generated in difference) in integer-based overlays are now avoided during generation +* Cleanup, removed old MSVC2005 project files, let all tests pass green (also in extensions) +* R*-tree balancing algorithm optimized + [/=================] [heading Boost 1.54] [/=================] diff --git a/doc/src/docutils/tools/doxygen_xml2qbk/configuration.hpp b/doc/src/docutils/tools/doxygen_xml2qbk/configuration.hpp index 3cb8ddf83..cb21cfdca 100644 --- a/doc/src/docutils/tools/doxygen_xml2qbk/configuration.hpp +++ b/doc/src/docutils/tools/doxygen_xml2qbk/configuration.hpp @@ -29,10 +29,15 @@ struct configuration std::vector convenience_headers; std::string skip_namespace; + bool output_member_variables; enum output_style_type {def, alt}; output_style_type output_style; - configuration() : output_style(def) {} + + configuration() + : output_style(def) + , output_member_variables(false) + {} }; diff --git a/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp b/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp index 04d50dcfa..43fc98bce 100644 --- a/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp +++ b/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_elements.hpp @@ -164,7 +164,7 @@ struct class_or_struct : public element std::vector functions; std::vector typedefs; - std::vector variables; + std::vector variables; std::vector base_classes; }; diff --git a/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml2qbk.cpp b/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml2qbk.cpp index 87ac68e07..f3a67fbec 100644 --- a/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml2qbk.cpp +++ b/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml2qbk.cpp @@ -42,7 +42,7 @@ #include #include -static const std::string version = "1.1.0"; +static const std::string version = "1.1.1"; inline std::string program_description(bool decorated) { @@ -95,6 +95,8 @@ int main(int argc, char** argv) ("output_style", po::value(&output_style), "Docbook output style. Available values: 'alt'") + ("output_member_variables", po::value(&config.output_member_variables), + "Output member variables inside the class") ; po::variables_map varmap; diff --git a/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp b/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp index 0a98f4296..119a57364 100644 --- a/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp +++ b/doc/src/docutils/tools/doxygen_xml2qbk/doxygen_xml_parser.hpp @@ -691,13 +691,44 @@ static void parse(rapidxml::xml_node<>* node, configuration const& config, docum } else if (kind == "variable") { - if (boost::equals(get_attribute(node, "static"), "yes") - && boost::equals(get_attribute(node, "mutable"), "no") - && boost::equals(get_attribute(node, "prot"), "public")) + if (boost::equals(get_attribute(node, "prot"), "public")) { - std::string name = parse_named_node(node->first_node(), "name"); - doc.cos.variables.push_back(base_element(name)); - doc.cos.variables.back().id = id; + parameter p; + p.id = id; + for(rapidxml::xml_node<>* var_node = node->first_node(); var_node; var_node=var_node->next_sibling()) + { + if(boost::equals(var_node->name(), "name")) + { + p.name = var_node->value(); + } + else if(boost::equals(var_node->name(), "type")) + { + get_contents(var_node->first_node(), p.fulltype); + p.type = p.fulltype; + //boost::replace_all(p.type, " const", ""); + //boost::trim(p.type); + //boost::replace_all(p.type, "&", ""); + //boost::replace_all(p.type, "*", ""); + boost::trim(p.type); + + // If alt output is used retrieve type with QBK links + if ( configuration::alt == config.output_style ) + { + p.fulltype_without_links = p.fulltype; + p.fulltype.clear(); + parse_para(var_node->first_node(), config, p.fulltype, p.skip); + } + } + else if(boost::equals(var_node->name(), "briefdescription")) + { + parse_para(var_node->first_node(), config, p.brief_description, p.skip); + } + else if(p.brief_description.empty() && boost::equals(var_node->name(), "detaileddescription")) + { + parse_para(var_node->first_node(), config, p.brief_description, p.skip); + } + } + doc.cos.variables.push_back(p); } } diff --git a/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp b/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp index 34295b7d4..0f2d9de2a 100644 --- a/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp +++ b/doc/src/docutils/tools/doxygen_xml2qbk/quickbook_output.hpp @@ -544,9 +544,38 @@ void quickbook_output(class_or_struct const& cos, configuration const& config, s out << std::endl; } - out << "{" << std::endl - << " // ..." << std::endl - << "};" << std::endl + out << "{" << std::endl; + if (! cos.variables.empty() && config.output_member_variables) + { + size_t maxlength = 0; + BOOST_FOREACH(parameter const& p, cos.variables) + { + if (! p.skip) + { + size_t length = 6 + p.fulltype.size() + p.name.size(); + if (length > maxlength) maxlength = length; + } + } + BOOST_FOREACH(parameter const& p, cos.variables) + { + if (! p.skip) + { + size_t length = 4 + p.fulltype.size() + p.name.size(); + out << " " << p.fulltype << " " << p.name << ";"; + if (! p.brief_description.empty()) + { + while(length++ < maxlength) out << " "; + out << "// " << p.brief_description; + } + out << std::endl; + } + } + } + else + { + out << " // ..." << std::endl; + } + out << "};" << std::endl << "``" << std::endl << std::endl; quickbook_markup(cos.qbk_markup, markup_after, markup_synopsis, out); diff --git a/doc/src/examples/algorithms/length_with_strategy.cpp b/doc/src/examples/algorithms/length_with_strategy.cpp index 99c15fb19..4a643c894 100644 --- a/doc/src/examples/algorithms/length_with_strategy.cpp +++ b/doc/src/examples/algorithms/length_with_strategy.cpp @@ -24,7 +24,7 @@ int main() line.push_back(P(5, 52)); double const mean_radius = 6371.0; /*< [@http://en.wikipedia.org/wiki/Earth_radius Wiki] >*/ std::cout << "length is " - << length(line, strategy::distance::haversine

(mean_radius) ) + << length(line, strategy::distance::haversine(mean_radius) ) << " kilometers " << std::endl; return 0; diff --git a/doc/src/examples/algorithms/transform_with_strategy.cpp b/doc/src/examples/algorithms/transform_with_strategy.cpp index df44d6336..d55e5e2d1 100644 --- a/doc/src/examples/algorithms/transform_with_strategy.cpp +++ b/doc/src/examples/algorithms/transform_with_strategy.cpp @@ -25,17 +25,17 @@ int main() // Translate over (1.5, 1.5) point_type p2; - trans::translate_transformer translate(1.5, 1.5); + 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); + 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); + trans::rotate_transformer rotate(90.0); boost::geometry::transform(p1, p4, rotate); std::cout diff --git a/example/06_a_transformation_example.cpp b/example/06_a_transformation_example.cpp index 367d5e16f..01a560173 100644 --- a/example/06_a_transformation_example.cpp +++ b/example/06_a_transformation_example.cpp @@ -29,7 +29,7 @@ int main() point_2d p2; // Example: translate a point over (5,5) - strategy::transform::translate_transformer translate(5, 5); + strategy::transform::translate_transformer translate(5, 5); transform(p, p2, translate); std::cout << "transformed point " << boost::geometry::dsv(p2) << std::endl; diff --git a/example/06_b_transformation_example.cpp b/example/06_b_transformation_example.cpp index 5dd972548..db125ff53 100644 --- a/example/06_b_transformation_example.cpp +++ b/example/06_b_transformation_example.cpp @@ -127,25 +127,25 @@ int main() svg.put(g1, "g1"); // G1 - Translate -> G2 - translate_transformer translate(0, 250); + translate_transformer translate(0, 250); model::polygon g2; transform(g1, g2, translate); std::clog << "translated:\t" << boost::geometry::dsv(g2) << std::endl; svg.put(g2, "g2=g1.translate(0,250)"); // G2 - Scale -> G3 - scale_transformer scale(0.5, 0.5); + scale_transformer scale(0.5, 0.5); model::polygon g3; transform(g2, g3, scale); std::clog << "scaled:\t" << boost::geometry::dsv(g3) << std::endl; svg.put(g3, "g3=g2.scale(0.5,0.5)"); // G3 - Combine rotate and translate -> G4 - rotate_transformer rotate(45); + rotate_transformer rotate(45); // Compose matrix for the two transformation // Create transformer attached to the transformation matrix - ublas_transformer + ublas_transformer combined(boost::numeric::ublas::prod(rotate.matrix(), translate.matrix())); //combined(rotate.matrix()); diff --git a/example/07_a_graph_route_example.cpp b/example/07_a_graph_route_example.cpp index 735d2dfa7..5b476ffb5 100644 --- a/example/07_a_graph_route_example.cpp +++ b/example/07_a_graph_route_example.cpp @@ -306,7 +306,7 @@ int main() << std::fixed << std::setprecision(0); // To calculate distance, declare and construct a strategy with average earth radius - boost::geometry::strategy::distance::haversine haversine(6372795.0); + boost::geometry::strategy::distance::haversine haversine(6372795.0); // Main functionality: calculate shortest routes from/to all cities diff --git a/example/07_b_graph_route_example.cpp b/example/07_b_graph_route_example.cpp index 843a84e6f..5490dc5fb 100644 --- a/example/07_b_graph_route_example.cpp +++ b/example/07_b_graph_route_example.cpp @@ -293,7 +293,7 @@ int main() << std::fixed << std::setprecision(0); // To calculate distance, declare and construct a strategy with average earth radius - boost::geometry::strategy::distance::haversine haversine(6372795.0); + boost::geometry::strategy::distance::haversine haversine(6372795.0); // Main functionality: calculate shortest routes from/to all cities diff --git a/example/boost.vsprops b/example/boost.vsprops deleted file mode 100644 index e376ce44a..000000000 --- a/example/boost.vsprops +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/example/c04_b_custom_triangle_example.cpp b/example/c04_b_custom_triangle_example.cpp index a48100529..320dc6ede 100644 --- a/example/c04_b_custom_triangle_example.cpp +++ b/example/c04_b_custom_triangle_example.cpp @@ -38,10 +38,11 @@ BOOST_GEOMETRY_REGISTER_RING_TEMPLATED(triangle) namespace boost { namespace geometry { namespace dispatch { // Specializations of area dispatch structure, implement algorithm -template -struct area, S> +template +struct area, ring_tag> { - static inline double apply(triangle

const& t, S const&) + template + static inline double apply(triangle const& t, Strategy const&) { return 0.5 * ((get<0>(t[1]) - get<0>(t[0])) * (get<1>(t[2]) - get<1>(t[0])) - (get<0>(t[2]) - get<0>(t[0])) * (get<1>(t[1]) - get<1>(t[0]))); diff --git a/example/c08_custom_non_std_example.cpp b/example/c08_custom_non_std_example.cpp index 966c6298b..d60f4a079 100644 --- a/example/c08_custom_non_std_example.cpp +++ b/example/c08_custom_non_std_example.cpp @@ -65,41 +65,59 @@ class my_polygon // Adaption: implement iterator and range-extension, and register with Boost.Geometry // 1) implement iterator (const and non-const versions) -template +template struct custom_iterator : public boost::iterator_facade < - custom_iterator, + custom_iterator, my_point, boost::random_access_traversal_tag, - typename boost::geometry::add_const_if_c::type& + typename boost::mpl::if_ + < + boost::is_const, + my_point const, + my_point + >::type& > { // Constructor for begin() - explicit custom_iterator(typename boost::geometry::add_const_if_c::type& polygon) + explicit custom_iterator(MyPolygon& polygon) : m_polygon(&polygon) , m_index(0) {} // Constructor for end() - explicit custom_iterator(bool, typename boost::geometry::add_const_if_c::type& polygon) + explicit custom_iterator(bool, MyPolygon& polygon) : m_polygon(&polygon) , m_index(polygon.point_count()) {} + // Default constructor + explicit custom_iterator() + : m_polygon(NULL) + , m_index(-1) + {} + + typedef typename boost::mpl::if_ + < + boost::is_const, + my_point const, + my_point + >::type my_point_type; private: friend class boost::iterator_core_access; + typedef boost::iterator_facade < - custom_iterator, + custom_iterator, my_point, boost::random_access_traversal_tag, - typename boost::geometry::add_const_if_c::type& + my_point_type& > facade; - typename boost::geometry::add_const_if_c::type* m_polygon; + MyPolygon* m_polygon; int m_index; bool equal(custom_iterator const& other) const @@ -134,7 +152,7 @@ private: } // const and non-const dereference of this iterator - typename boost::geometry::add_const_if_c::type& dereference() const + my_point_type& dereference() const { return m_polygon->get_point(m_index); } @@ -150,12 +168,12 @@ namespace boost { template<> struct range_mutable_iterator { - typedef custom_iterator type; + typedef custom_iterator type; }; template<> struct range_const_iterator { - typedef custom_iterator type; + typedef custom_iterator type; }; // RangeEx @@ -168,24 +186,24 @@ namespace boost // 2b) free-standing function for Boost.Range ADP -inline custom_iterator range_begin(my_polygon& polygon) +inline custom_iterator range_begin(my_polygon& polygon) { - return custom_iterator(polygon); + return custom_iterator(polygon); } -inline custom_iterator range_begin(my_polygon const& polygon) +inline custom_iterator range_begin(my_polygon const& polygon) { - return custom_iterator(polygon); + return custom_iterator(polygon); } -inline custom_iterator range_end(my_polygon& polygon) +inline custom_iterator range_end(my_polygon& polygon) { - return custom_iterator(true, polygon); + return custom_iterator(true, polygon); } -inline custom_iterator range_end(my_polygon const& polygon) +inline custom_iterator range_end(my_polygon const& polygon) { - return custom_iterator(true, polygon); + return custom_iterator(true, polygon); } @@ -210,6 +228,14 @@ template<> struct resize } }; +template<> struct clear +{ + static inline void apply(my_polygon& polygon) + { + polygon.erase_all(); + } +}; + }}} @@ -225,8 +251,8 @@ BOOST_GEOMETRY_REGISTER_RING(my_polygon) void walk_using_iterator(my_polygon const& polygon) { - for (custom_iterator it = custom_iterator(polygon); - it != custom_iterator(true, polygon); + for (custom_iterator it = custom_iterator(polygon); + it != custom_iterator(true, polygon); ++it) { std::cout << boost::geometry::dsv(*it) << std::endl; diff --git a/example/c10_custom_cs_example.cpp b/example/c10_custom_cs_example.cpp index b71ad8976..6676955d7 100644 --- a/example/c10_custom_cs_example.cpp +++ b/example/c10_custom_cs_example.cpp @@ -56,7 +56,7 @@ namespace boost { namespace geometry { namespace strategy { namespace distance { template struct default_strategy { - typedef haversine type; + typedef haversine type; }; }}}}} // namespaces diff --git a/example/c11_custom_cs_transform_example.cpp b/example/c11_custom_cs_transform_example.cpp index 38a3f012a..896ee069a 100644 --- a/example/c11_custom_cs_transform_example.cpp +++ b/example/c11_custom_cs_transform_example.cpp @@ -32,9 +32,9 @@ template<> struct cs_tag { typedef cartesian_tag type; }; // 3: sample implementation of a shift // to convert coordinate system "cart" to "cart_shirted5" -template struct shift { + template inline bool apply(P1 const& p1, P2& p2) const { namespace bg = boost::geometry; @@ -52,16 +52,16 @@ namespace boost { namespace geometry { namespace strategy { namespace transform template struct default_strategy { - typedef shift type; + typedef shift type; }; }}}}} // namespaces // 5: implement a distance strategy between the two different ones -template struct shift_and_calc_distance { + template inline double apply(P1 const& p1, P2 const& p2) const { P2 p1_shifted; @@ -77,14 +77,14 @@ typedef boost::geometry::model::point point2; // 7: register the distance strategy namespace boost { namespace geometry { namespace strategy { namespace distance { namespace services { - template - struct tag > + template <> + struct tag { typedef strategy_tag_distance_point_point type; }; - template - struct return_type > + template + struct return_type { typedef double type; }; @@ -92,7 +92,7 @@ namespace boost { namespace geometry { namespace strategy { namespace distance { template <> struct default_strategy { - typedef shift_and_calc_distance type; + typedef shift_and_calc_distance type; }; diff --git a/example/ml01_multipolygon_simplify.vcproj b/example/ml01_multipolygon_simplify.vcproj deleted file mode 100644 index fe5492da9..000000000 --- a/example/ml01_multipolygon_simplify.vcproj +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/ml02_distance_strategy.vcproj b/example/ml02_distance_strategy.vcproj deleted file mode 100644 index 0b04ecfac..000000000 --- a/example/ml02_distance_strategy.vcproj +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/with_external_libs/gd.vsprops b/example/with_external_libs/gd.vsprops deleted file mode 100644 index 209165c2e..000000000 --- a/example/with_external_libs/gd.vsprops +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/example/with_external_libs/postgresql.vsprops b/example/with_external_libs/postgresql.vsprops deleted file mode 100644 index 6a95d3e1c..000000000 --- a/example/with_external_libs/postgresql.vsprops +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/example/with_external_libs/qt.vsprops b/example/with_external_libs/qt.vsprops deleted file mode 100644 index 8de8e56ac..000000000 --- a/example/with_external_libs/qt.vsprops +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - diff --git a/example/with_external_libs/shapelib.vsprops b/example/with_external_libs/shapelib.vsprops deleted file mode 100644 index fcd579559..000000000 --- a/example/with_external_libs/shapelib.vsprops +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/example/with_external_libs/soci.vsprops b/example/with_external_libs/soci.vsprops deleted file mode 100644 index c397b1241..000000000 --- a/example/with_external_libs/soci.vsprops +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/example/with_external_libs/wxwidgets.vsprops b/example/with_external_libs/wxwidgets.vsprops deleted file mode 100644 index a5a0836fc..000000000 --- a/example/with_external_libs/wxwidgets.vsprops +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/example/with_external_libs/x01_qt_example.sln b/example/with_external_libs/x01_qt_example.sln deleted file mode 100644 index 6af3e9304..000000000 --- a/example/with_external_libs/x01_qt_example.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x01_qt_example", "x01_qt_example.vcproj", "{242C6ADC-3A10-4B69-81F7-5669E0582A8B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Debug|Win32.ActiveCfg = Debug|Win32 - {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Debug|Win32.Build.0 = Debug|Win32 - {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Release|Win32.ActiveCfg = Release|Win32 - {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/example/with_external_libs/x01_qt_example.vcproj b/example/with_external_libs/x01_qt_example.vcproj deleted file mode 100644 index eba736e3f..000000000 --- a/example/with_external_libs/x01_qt_example.vcproj +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/with_external_libs/x02_gd_example.sln b/example/with_external_libs/x02_gd_example.sln deleted file mode 100644 index 1ab96a86f..000000000 --- a/example/with_external_libs/x02_gd_example.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}") = "x02_gd_example", "x02_gd_example.vcproj", "{A73F21AC-6F32-41A9-A86C-53BD4DC84B05}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A73F21AC-6F32-41A9-A86C-53BD4DC84B05}.Debug|Win32.ActiveCfg = Debug|Win32 - {A73F21AC-6F32-41A9-A86C-53BD4DC84B05}.Debug|Win32.Build.0 = Debug|Win32 - {A73F21AC-6F32-41A9-A86C-53BD4DC84B05}.Release|Win32.ActiveCfg = Release|Win32 - {A73F21AC-6F32-41A9-A86C-53BD4DC84B05}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/example/with_external_libs/x02_gd_example.vcproj b/example/with_external_libs/x02_gd_example.vcproj deleted file mode 100644 index 20471a0a6..000000000 --- a/example/with_external_libs/x02_gd_example.vcproj +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/with_external_libs/x03_a_soci_example.vcproj b/example/with_external_libs/x03_a_soci_example.vcproj deleted file mode 100644 index 2f6665a51..000000000 --- a/example/with_external_libs/x03_a_soci_example.vcproj +++ /dev/null @@ -1,744 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/with_external_libs/x03_b_soci_example.vcproj b/example/with_external_libs/x03_b_soci_example.vcproj deleted file mode 100644 index 35781e542..000000000 --- a/example/with_external_libs/x03_b_soci_example.vcproj +++ /dev/null @@ -1,744 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/with_external_libs/x03_c_soci_example.vcproj b/example/with_external_libs/x03_c_soci_example.vcproj deleted file mode 100644 index 05a4ae022..000000000 --- a/example/with_external_libs/x03_c_soci_example.vcproj +++ /dev/null @@ -1,744 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/with_external_libs/x03_d_soci_example.vcproj b/example/with_external_libs/x03_d_soci_example.vcproj deleted file mode 100644 index d699d5186..000000000 --- a/example/with_external_libs/x03_d_soci_example.vcproj +++ /dev/null @@ -1,744 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/with_external_libs/x03_soci_examples.sln b/example/with_external_libs/x03_soci_examples.sln deleted file mode 100644 index 49ea1a3be..000000000 --- a/example/with_external_libs/x03_soci_examples.sln +++ /dev/null @@ -1,37 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x03_a_soci_example", "x03_a_soci_example.vcproj", "{C3B3143D-F354-4036-9DA1-5975D8A4F166}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x03_b_soci_example", "x03_b_soci_example.vcproj", "{5EFD08EE-10CB-4D3E-9907-4E9A7F3AB1C1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x03_c_soci_example", "x03_c_soci_example.vcproj", "{5EFD08FE-10CB-4D3E-9907-4E9A2F3AB1C1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x03_d_soci_example", "x03_d_soci_example.vcproj", "{5EFD08FE-10CB-4D3E-9917-4E9A2F3AB1C1}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C3B3143D-F354-4036-9DA1-5975D8A4F166}.Debug|Win32.ActiveCfg = Debug|Win32 - {C3B3143D-F354-4036-9DA1-5975D8A4F166}.Debug|Win32.Build.0 = Debug|Win32 - {C3B3143D-F354-4036-9DA1-5975D8A4F166}.Release|Win32.ActiveCfg = Release|Win32 - {C3B3143D-F354-4036-9DA1-5975D8A4F166}.Release|Win32.Build.0 = Release|Win32 - {5EFD08EE-10CB-4D3E-9907-4E9A7F3AB1C1}.Debug|Win32.ActiveCfg = Debug|Win32 - {5EFD08EE-10CB-4D3E-9907-4E9A7F3AB1C1}.Debug|Win32.Build.0 = Debug|Win32 - {5EFD08EE-10CB-4D3E-9907-4E9A7F3AB1C1}.Release|Win32.ActiveCfg = Release|Win32 - {5EFD08EE-10CB-4D3E-9907-4E9A7F3AB1C1}.Release|Win32.Build.0 = Release|Win32 - {5EFD08FE-10CB-4D3E-9907-4E9A2F3AB1C1}.Debug|Win32.ActiveCfg = Debug|Win32 - {5EFD08FE-10CB-4D3E-9907-4E9A2F3AB1C1}.Debug|Win32.Build.0 = Debug|Win32 - {5EFD08FE-10CB-4D3E-9907-4E9A2F3AB1C1}.Release|Win32.ActiveCfg = Release|Win32 - {5EFD08FE-10CB-4D3E-9907-4E9A2F3AB1C1}.Release|Win32.Build.0 = Release|Win32 - {5EFD08FE-10CB-4D3E-9917-4E9A2F3AB1C1}.Debug|Win32.ActiveCfg = Debug|Win32 - {5EFD08FE-10CB-4D3E-9917-4E9A2F3AB1C1}.Debug|Win32.Build.0 = Debug|Win32 - {5EFD08FE-10CB-4D3E-9917-4E9A2F3AB1C1}.Release|Win32.ActiveCfg = Release|Win32 - {5EFD08FE-10CB-4D3E-9917-4E9A2F3AB1C1}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/example/with_external_libs/x04_wxwidgets_world_mapper.cpp b/example/with_external_libs/x04_wxwidgets_world_mapper.cpp index 1a8bde389..d3d2cc186 100644 --- a/example/with_external_libs/x04_wxwidgets_world_mapper.cpp +++ b/example/with_external_libs/x04_wxwidgets_world_mapper.cpp @@ -159,13 +159,13 @@ private: typedef boost::geometry::strategy::transform::map_transformer < - point_2d, wxPoint, + double, 2, 2, true, true > map_transformer_type; typedef boost::geometry::strategy::transform::inverse_transformer < - wxPoint, point_2d + double, 2, 2 > inverse_transformer_type; boost::shared_ptr m_map_transformer; diff --git a/example/with_external_libs/x04_wxwidgets_world_mapper.sln b/example/with_external_libs/x04_wxwidgets_world_mapper.sln deleted file mode 100644 index 9761bba39..000000000 --- a/example/with_external_libs/x04_wxwidgets_world_mapper.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x04_wxwidgets_world_mapper", "x04_wxwidgets_world_mapper.vcproj", "{DD1D469B-29A8-4873-A596-9CCCB24F54FA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DD1D469B-29A8-4873-A596-9CCCB24F54FA}.Debug|Win32.ActiveCfg = Debug|Win32 - {DD1D469B-29A8-4873-A596-9CCCB24F54FA}.Debug|Win32.Build.0 = Debug|Win32 - {DD1D469B-29A8-4873-A596-9CCCB24F54FA}.Release|Win32.ActiveCfg = Release|Win32 - {DD1D469B-29A8-4873-A596-9CCCB24F54FA}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/example/with_external_libs/x04_wxwidgets_world_mapper.vcproj b/example/with_external_libs/x04_wxwidgets_world_mapper.vcproj deleted file mode 100644 index 3d4ed9ab1..000000000 --- a/example/with_external_libs/x04_wxwidgets_world_mapper.vcproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/with_external_libs/x04_wxwidgets_world_mapper_readme.txt b/example/with_external_libs/x04_wxwidgets_world_mapper_readme.txt index ed3df6cb0..cba0c8eeb 100644 --- a/example/with_external_libs/x04_wxwidgets_world_mapper_readme.txt +++ b/example/with_external_libs/x04_wxwidgets_world_mapper_readme.txt @@ -16,15 +16,7 @@ the mouse, and indicating position of the mouse in latitude/longitude and in pix To compile this program: Install wxWidgets (if not done before) -Install Boost (if not done before) -Using MSVC: - - edit the file wxwidgets.vsprops - - set the UserMacro WXWIDGETS to point to your wxWidgets distribution - - edit the file boost.vsprops - - set the UserMacro BOOST_ROOT to point to your Boost distribution - - alternatively you can include Boost and/or wxWidgets in your standard include path - Using Linux/gcc - check if installation is OK, http://wiki.wxwidgets.org/Installing_and_configuring_under_Ubuntu - compile using e.g. gcc -o x04_wxwidgets -I../../../.. x04_wxwidgets_world_mapper.cpp `wx-config --cxxflags` `wx-config --libs` diff --git a/example/with_external_libs/x05_shapelib_example.sln b/example/with_external_libs/x05_shapelib_example.sln deleted file mode 100644 index 48693bb6a..000000000 --- a/example/with_external_libs/x05_shapelib_example.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x05_shapelib_example", "x05_shapelib_example.vcproj", "{92ECE1AC-1A5D-4554-A8AD-690AC266210D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {92ECE1AC-1A5D-4554-A8AD-690AC266210D}.Debug|Win32.ActiveCfg = Debug|Win32 - {92ECE1AC-1A5D-4554-A8AD-690AC266210D}.Debug|Win32.Build.0 = Debug|Win32 - {92ECE1AC-1A5D-4554-A8AD-690AC266210D}.Release|Win32.ActiveCfg = Release|Win32 - {92ECE1AC-1A5D-4554-A8AD-690AC266210D}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/example/with_external_libs/x05_shapelib_example.vcproj b/example/with_external_libs/x05_shapelib_example.vcproj deleted file mode 100644 index d9c6a1d3f..000000000 --- a/example/with_external_libs/x05_shapelib_example.vcproj +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/with_external_libs/x06_qt_world_mapper.cpp b/example/with_external_libs/x06_qt_world_mapper.cpp index 8f0cf3477..b4a060c84 100644 --- a/example/with_external_libs/x06_qt_world_mapper.cpp +++ b/example/with_external_libs/x06_qt_world_mapper.cpp @@ -91,7 +91,7 @@ class WorldMapper : public QWidget private: typedef boost::geometry::strategy::transform::map_transformer < - point_2d, QPointF, + double, 2, 2, true, true > map_transformer_type; diff --git a/example/with_external_libs/x06_qt_world_mapper.sln b/example/with_external_libs/x06_qt_world_mapper.sln deleted file mode 100644 index 32cfaf4ad..000000000 --- a/example/with_external_libs/x06_qt_world_mapper.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x06_qt_world_mapper", "x06_qt_world_mapper.vcproj", "{242C6ADC-3A10-4B69-81F7-5669E0582A8B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Debug|Win32.ActiveCfg = Debug|Win32 - {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Debug|Win32.Build.0 = Debug|Win32 - {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Release|Win32.ActiveCfg = Release|Win32 - {242C6ADC-3A10-4B69-81F7-5669E0582A8B}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/example/with_external_libs/x06_qt_world_mapper.vcproj b/example/with_external_libs/x06_qt_world_mapper.vcproj deleted file mode 100644 index efee2124e..000000000 --- a/example/with_external_libs/x06_qt_world_mapper.vcproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/with_external_libs/x06_qt_world_mapper_readme.txt b/example/with_external_libs/x06_qt_world_mapper_readme.txt index 8c67025e2..131bcca21 100644 --- a/example/with_external_libs/x06_qt_world_mapper_readme.txt +++ b/example/with_external_libs/x06_qt_world_mapper_readme.txt @@ -12,14 +12,6 @@ It will show a basic Qt Widget, displaying world countries To compile this program: Install Qt (if not done before) -Install Boost (if not done before) - -Using MSVC: - - edit the file qt.vsprops - - set the UserMacro QT to point to your Qt distribution - - edit the file boost.vsprops - - set the UserMacro BOOST_ROOT to point to your Boost distribution - - alternatively you can include Boost and/or Qt in your standard include path Using Linux/gcc - install Qt with sudo apt-get install libqt4-dev diff --git a/include/boost/geometry/algorithms/centroid.hpp b/include/boost/geometry/algorithms/centroid.hpp index 9be51f409..f673c133d 100644 --- a/include/boost/geometry/algorithms/centroid.hpp +++ b/include/boost/geometry/algorithms/centroid.hpp @@ -90,55 +90,56 @@ struct centroid_point template < - typename Box, + typename Indexed, typename Point, std::size_t Dimension, std::size_t DimensionCount > -struct centroid_box_calculator +struct centroid_indexed_calculator { typedef typename select_coordinate_type < - Box, Point + Indexed, Point >::type coordinate_type; - static inline void apply(Box const& box, Point& centroid) + static inline void apply(Indexed const& indexed, Point& centroid) { - coordinate_type const c1 = get(box); - coordinate_type const c2 = get(box); + coordinate_type const c1 = get(indexed); + coordinate_type const c2 = get(indexed); coordinate_type m = c1 + c2; - m /= 2.0; + coordinate_type const two = 2; + m /= two; set(centroid, m); - centroid_box_calculator + centroid_indexed_calculator < - Box, Point, + Indexed, Point, Dimension + 1, DimensionCount - >::apply(box, centroid); + >::apply(indexed, centroid); } }; -template -struct centroid_box_calculator +template +struct centroid_indexed_calculator { - static inline void apply(Box const& , Point& ) + static inline void apply(Indexed const& , Point& ) { } }; -struct centroid_box +struct centroid_indexed { - template - static inline void apply(Box const& box, Point& centroid, + template + static inline void apply(Indexed const& indexed, Point& centroid, Strategy const&) { - centroid_box_calculator + centroid_indexed_calculator < - Box, Point, - 0, dimension::type::value - >::apply(box, centroid); + Indexed, Point, + 0, dimension::type::value + >::apply(indexed, centroid); } }; @@ -279,7 +280,12 @@ struct centroid template struct centroid - : detail::centroid::centroid_box + : detail::centroid::centroid_indexed +{}; + +template +struct centroid + : detail::centroid::centroid_indexed {}; template diff --git a/include/boost/geometry/algorithms/detail/assign_values.hpp b/include/boost/geometry/algorithms/detail/assign_values.hpp index ed4713493..82dd6bec6 100644 --- a/include/boost/geometry/algorithms/detail/assign_values.hpp +++ b/include/boost/geometry/algorithms/detail/assign_values.hpp @@ -46,36 +46,30 @@ namespace detail { namespace assign { -template -< - typename Box, std::size_t Index, - std::size_t Dimension, std::size_t DimensionCount -> +template struct initialize { - typedef typename coordinate_type::type coordinate_type; - - static inline void apply(Box& box, coordinate_type const& value) + template + static inline void apply(Box& box, typename coordinate_type::type const& value) { geometry::set(box, value); - initialize::apply(box, value); + initialize::apply(box, value); } }; -template -struct initialize +template +struct initialize { - typedef typename coordinate_type::type coordinate_type; - - static inline void apply(Box&, coordinate_type const& ) + template + static inline void apply(Box&, typename coordinate_type::type const&) {} }; -template struct assign_zero_point { + template static inline void apply(Point& point) { geometry::assign_value(point, 0); @@ -83,44 +77,38 @@ struct assign_zero_point }; -template struct assign_inverse_box_or_segment { - typedef typename point_type::type point_type; + template static inline void apply(BoxOrSegment& geometry) { + typedef typename point_type::type point_type; typedef typename coordinate_type::type bound_type; - initialize - < - BoxOrSegment, 0, 0, dimension::type::value - >::apply( - geometry, boost::numeric::bounds::highest()); - initialize - < - BoxOrSegment, 1, 0, dimension::type::value - >::apply( - geometry, boost::numeric::bounds::lowest()); + initialize<0, 0, dimension::type::value>::apply( + geometry, boost::numeric::bounds::highest() + ); + initialize<1, 0, dimension::type::value>::apply( + geometry, boost::numeric::bounds::lowest() + ); } }; -template struct assign_zero_box_or_segment { + template static inline void apply(BoxOrSegment& geometry) { typedef typename coordinate_type::type coordinate_type; - initialize - < - BoxOrSegment, 0, 0, dimension::type::value - >::apply(geometry, coordinate_type()); - initialize - < - BoxOrSegment, 1, 0, dimension::type::value - >::apply(geometry, coordinate_type()); + initialize<0, 0, dimension::type::value>::apply( + geometry, coordinate_type() + ); + initialize<1, 0, dimension::type::value>::apply( + geometry, coordinate_type() + ); } }; @@ -312,17 +300,17 @@ struct assign_zero {}; template struct assign_zero - : detail::assign::assign_zero_point + : detail::assign::assign_zero_point {}; template struct assign_zero - : detail::assign::assign_zero_box_or_segment + : detail::assign::assign_zero_box_or_segment {}; template struct assign_zero - : detail::assign::assign_zero_box_or_segment + : detail::assign::assign_zero_box_or_segment {}; @@ -331,12 +319,12 @@ struct assign_inverse {}; template struct assign_inverse - : detail::assign::assign_inverse_box_or_segment + : detail::assign::assign_inverse_box_or_segment {}; template struct assign_inverse - : detail::assign::assign_inverse_box_or_segment + : detail::assign::assign_inverse_box_or_segment {}; diff --git a/include/boost/geometry/algorithms/detail/disjoint.hpp b/include/boost/geometry/algorithms/detail/disjoint.hpp index e944e5169..f25e8a843 100644 --- a/include/boost/geometry/algorithms/detail/disjoint.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint.hpp @@ -165,6 +165,128 @@ struct box_box } }; +// Segment - Box intersection +// Based on Ray-AABB intersection +// http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtinter3.htm + +// TODO - later maybe move to strategy::intersects and add a policy to conditionally extract intersection points + +template +struct segment_box_intersection_dim +{ + //BOOST_STATIC_ASSERT(I < dimension::value); + //BOOST_STATIC_ASSERT(I < dimension::value); + //BOOST_STATIC_ASSERT(dimension::value == dimension::value); + + typedef typename coordinate_type::type point_coordinate; + + template static inline + bool apply(Point const& p0, Point const& p1, Box const& b, RelativeDistance & t_near, RelativeDistance & t_far) + { + //// WARNING! - RelativeDistance must be IEEE float for this to work (division by 0) + //BOOST_STATIC_ASSERT(boost::is_float::value); + //// Ray origin is in segment point 0 + //RelativeDistance ray_d = geometry::get(p1) - geometry::get(p0); + //RelativeDistance tn = ( geometry::get(b) - geometry::get(p0) ) / ray_d; + //RelativeDistance tf = ( geometry::get(b) - geometry::get(p0) ) / ray_d; + + // TODO - should we support also unsigned integers? + BOOST_STATIC_ASSERT(!boost::is_unsigned::value); + point_coordinate ray_d = geometry::get(p1) - geometry::get(p0); + RelativeDistance tn, tf; + if ( is_zero(ray_d) ) + { + tn = dist_div_by_zero(geometry::get(b) - geometry::get(p0)); + tf = dist_div_by_zero(geometry::get(b) - geometry::get(p0)); + } + else + { + tn = static_cast(geometry::get(b) - geometry::get(p0)) / ray_d; + tf = static_cast(geometry::get(b) - geometry::get(p0)) / ray_d; + } + + if ( tf < tn ) + ::std::swap(tn, tf); + + if ( t_near < tn ) + t_near = tn; + if ( tf < t_far ) + t_far = tf; + + return 0 <= t_far && t_near <= t_far && t_near <= 1; + } + + template static inline + R dist_div_by_zero(T const& val) + { + if ( is_zero(val) ) + return 0; + else if ( val < 0 ) + return -(::std::numeric_limits::max)(); + else + return (::std::numeric_limits::max)(); + } + + template static inline + bool is_zero(T const& val) + { + // ray_d == 0 is here because eps of rational is 0 which isn't < than 0 + return val == 0 || math::abs(val) < ::std::numeric_limits::epsilon(); + } +}; + +template +struct segment_box_intersection_impl +{ + BOOST_STATIC_ASSERT(0 < CurrentDimension); + + typedef segment_box_intersection_dim for_dim; + + template + static inline bool apply(Point const& p0, Point const& p1, Box const& b, + RelativeDistance & t_near, RelativeDistance & t_far) + { + return segment_box_intersection_impl::apply(p0, p1, b, t_near, t_far) + && for_dim::apply(p0, p1, b, t_near, t_far); + } +}; + +template +struct segment_box_intersection_impl +{ + typedef segment_box_intersection_dim for_dim; + + template + static inline bool apply(Point const& p0, Point const& p1, Box const& b, + RelativeDistance & t_near, RelativeDistance & t_far) + { + return for_dim::apply(p0, p1, b, t_near, t_far); + } +}; + +template +struct segment_box_intersection +{ + typedef segment_box_intersection_impl::value> impl; + + static inline bool apply(Point const& p0, Point const& p1, Box const& b) + { + typedef + typename geometry::promote_floating_point< + typename geometry::select_most_precise< + typename coordinate_type::type, + typename coordinate_type::type + >::type + >::type relative_distance_type; + + relative_distance_type t_near = -(::std::numeric_limits::max)(); + relative_distance_type t_far = (::std::numeric_limits::max)(); + + // relative_distance = 0 < t_near ? t_near : 0; + + return impl::apply(p0, p1, b, t_near, t_far); + } +}; template < diff --git a/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp b/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp new file mode 100644 index 000000000..29094de90 --- /dev/null +++ b/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp @@ -0,0 +1,66 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2012 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) + +#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPS_OR_SPIKES_HPP +#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPS_OR_SPIKES_HPP + +#include + +#include +#include +#include + + +namespace boost { namespace geometry +{ + + +#ifndef DOXYGEN_NO_DETAIL +namespace detail { namespace overlay +{ + +template +inline void append_no_dups_or_spikes(Range& range, Point const& point) +{ +#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION + std::cout << " add: (" + << geometry::get<0>(point) << ", " << geometry::get<1>(point) << ")" + << std::endl; +#endif + + traits::push_back::apply(range, point); + + // If a point is equal, or forming a spike, remove the pen-ultimate point because this one caused the spike. + // If so, the now-new-pen-ultimate point can again cause a spike (possibly at a corner). So keep doing this. + // Besides spikes it will also avoid duplicates. + while(boost::size(range) >= 3 + && point_is_spike_or_equal(point, *(boost::end(range) - 3), *(boost::end(range) - 2))) + { + // Use the Concept/traits, so resize and append again + traits::resize::apply(range, boost::size(range) - 2); + traits::push_back::apply(range, point); + } + + // There might still be one duplicate not catched by the condition above + if (boost::size(range) == 2 + && geometry::detail::equals::equals_point_point(*boost::begin(range), point)) + { + traits::clear::apply(range); + traits::push_back::apply(range, point); + } +} + + +}} // namespace detail::overlay +#endif // DOXYGEN_NO_DETAIL + + +}} // namespace boost::geometry + + +#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_APPEND_NO_DUPS_OR_SPIKES_HPP diff --git a/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp b/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp index 5063f49eb..646219d46 100644 --- a/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp @@ -18,6 +18,10 @@ #include +#ifdef BOOST_GEOMETRY_TIME_OVERLAY +# include +#endif + namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp b/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp index 012b3aca3..ef840d86a 100644 --- a/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp @@ -101,7 +101,7 @@ public : // Make bad output clean rings.resize(size_at_start); - ring.clear(); + geometry::traits::clear::type>::apply(ring); // Reject this as a starting point operation.visited.set_rejected(); diff --git a/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp b/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp index 805f3923e..8d487d599 100644 --- a/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp @@ -27,7 +27,7 @@ #include #include -#include +#include namespace boost { namespace geometry { @@ -93,7 +93,7 @@ struct copy_segments_ring for (size_type i = 0; i < count; ++i, ++it) { - detail::overlay::append_no_duplicates(current_output, *it); + detail::overlay::append_no_dups_or_spikes(current_output, *it); } } }; @@ -129,7 +129,7 @@ struct copy_segments_linestring for (size_type i = 0; i < count; ++i, ++it) { - detail::overlay::append_no_duplicates(current_output, *it); + detail::overlay::append_no_dups_or_spikes(current_output, *it); } } }; @@ -195,7 +195,7 @@ struct copy_segments_box // (see comments in ring-version) for (int i = 0; i < count; i++, index++) { - detail::overlay::append_no_duplicates(current_output, bp[index % 5]); + detail::overlay::append_no_dups_or_spikes(current_output, bp[index % 5]); } } diff --git a/include/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp b/include/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp index 8c8ed9618..d92a0a969 100644 --- a/include/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/enrichment_info.hpp @@ -40,7 +40,8 @@ struct enrichment_info point_tag, P >::type - >::type + >::type, + P, P >::type distance_type; inline enrichment_info() diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp index 782ea7fd2..23487872a 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp @@ -256,7 +256,6 @@ public : advance_to_non_duplicate_next(nd_next2, it2, sec2); typedef typename boost::range_value::type turn_info; - typedef typename turn_info::point_type ip; turn_info ti; ti.operations[0].seg_id = segment_identifier(source_id1, @@ -838,13 +837,13 @@ inline void get_turns(Geometry1 const& geometry1, { concept::check_concepts_and_equal_dimensions(); - typedef typename strategy_intersection - < - typename cs_tag::type, - Geometry1, - Geometry2, - typename boost::range_value::type - >::segment_intersection_strategy_type segment_intersection_strategy_type; + //typedef typename strategy_intersection + // < + // typename cs_tag::type, + // Geometry1, + // Geometry2, + // typename boost::range_value::type + // >::segment_intersection_strategy_type segment_intersection_strategy_type; typedef detail::overlay::get_turn_info < diff --git a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp index af9a8d991..39432dc50 100644 --- a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp @@ -40,6 +40,10 @@ # include #endif +#ifdef BOOST_GEOMETRY_TIME_OVERLAY +# include +#endif + namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp b/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp index 9c4c99394..e5f32d993 100644 --- a/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/self_turn_points.hpp @@ -275,14 +275,6 @@ inline void self_turns(Geometry const& geometry, { concept::check(); - typedef typename strategy_intersection - < - typename cs_tag::type, - Geometry, - Geometry, - typename boost::range_value::type - >::segment_intersection_strategy_type strategy_type; - typedef detail::overlay::get_turn_info < typename point_type::type, diff --git a/include/boost/geometry/algorithms/detail/overlay/traverse.hpp b/include/boost/geometry/algorithms/detail/overlay/traverse.hpp index 72665922b..e41a01510 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traverse.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traverse.hpp @@ -13,7 +13,7 @@ #include -#include +#include #include #include #include @@ -139,7 +139,8 @@ inline bool assign_next_ip(G1 const& g1, G2 const& g2, seg_id = info.seg_id; } - detail::overlay::append_no_duplicates(current_output, ip->point); + detail::overlay::append_no_dups_or_spikes(current_output, ip->point); + return true; } @@ -277,8 +278,7 @@ public : set_visited_for_continue(*it, *iit); ring_type current_output; - detail::overlay::append_no_duplicates(current_output, - it->point, true); + geometry::append(current_output, it->point); turn_iterator current = it; turn_operation_iterator_type current_iit = iit; diff --git a/include/boost/geometry/algorithms/detail/point_is_spike_or_equal.hpp b/include/boost/geometry/algorithms/detail/point_is_spike_or_equal.hpp new file mode 100644 index 000000000..23078bf64 --- /dev/null +++ b/include/boost/geometry/algorithms/detail/point_is_spike_or_equal.hpp @@ -0,0 +1,71 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) + +// Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2013 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2013 Mateusz Loskot, London, UK. +// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. + +// 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) + +#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_POINT_IS_EQUAL_OR_SPIKE_HPP +#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_POINT_IS_EQUAL_OR_SPIKE_HPP + +#include +#include +#include +#include + +namespace boost { namespace geometry +{ + + +#ifndef DOXYGEN_NO_DETAIL +namespace detail +{ + +template +static inline bool point_is_spike_or_equal(Point1 const& last_point, Point2 const& segment_a, Point3 const& segment_b) +{ + typedef typename strategy::side::services::default_strategy + < + typename cs_tag::type + >::type side_strategy; + + typedef Point1 vector_type; + + int const side = side_strategy::apply(last_point, segment_a, segment_b); + if (side == 0) + { + // Last point is collinear w.r.t previous segment. + // Check if it is equal + vector_type diff1; + conversion::convert_point_to_point(last_point, diff1); + geometry::subtract_point(diff1, segment_b); + int const sgn_x1 = math::sign(geometry::get<0>(diff1)); + int const sgn_y1 = math::sign(geometry::get<1>(diff1)); + if (sgn_x1 == 0 && sgn_y1 == 0) + { + return true; + } + + // Check if it moves forward + vector_type diff2; + conversion::convert_point_to_point(segment_b, diff2); + geometry::subtract_point(diff2, segment_a); + int const sgn_x2 = math::sign(geometry::get<0>(diff2)); + int const sgn_y2 = math::sign(geometry::get<1>(diff2)); + + return sgn_x1 != sgn_x2 || sgn_y1 != sgn_y2; + } + return false; +} + +} // namespace detail +#endif + +}} // namespace boost::geometry + + +#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_POINT_IS_EQUAL_OR_SPIKE_HPP diff --git a/include/boost/geometry/algorithms/detail/point_on_border.hpp b/include/boost/geometry/algorithms/detail/point_on_border.hpp index b7e15ba3f..70113ab3a 100644 --- a/include/boost/geometry/algorithms/detail/point_on_border.hpp +++ b/include/boost/geometry/algorithms/detail/point_on_border.hpp @@ -229,8 +229,6 @@ inline bool point_on_border(Point& point, concept::check(); concept::check(); - typedef typename point_type::type point_type; - return dispatch::point_on_border < typename tag::type, diff --git a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp index 2ec63aa42..f5588522f 100644 --- a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp +++ b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp @@ -81,7 +81,7 @@ struct section , non_duplicate_index(-1) { assign_inverse(bounding_box); - for (register std::size_t i = 0; i < DimensionCount; i++) + for (std::size_t i = 0; i < DimensionCount; i++) { directions[i] = 0; } @@ -367,8 +367,6 @@ struct sectionalize_range static inline void apply(Range const& range, Sections& sections, ring_identifier ring_id) { - typedef model::referring_segment segment_type; - cview_type cview(range); view_type view(cview); diff --git a/include/boost/geometry/algorithms/disjoint.hpp b/include/boost/geometry/algorithms/disjoint.hpp index ade4e57d5..cd384d380 100644 --- a/include/boost/geometry/algorithms/disjoint.hpp +++ b/include/boost/geometry/algorithms/disjoint.hpp @@ -3,6 +3,7 @@ // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -172,6 +173,51 @@ struct general_areal } }; +template +struct disjoint_segment_box +{ + static inline bool apply(Segment const& segment, Box const& box) + { + typedef typename point_type::type point_type; + point_type p0, p1; + geometry::detail::assign_point_from_index<0>(segment, p0); + geometry::detail::assign_point_from_index<1>(segment, p1); + + return ! detail::disjoint::segment_box_intersection::apply(p0, p1, box); + } +}; + +template +struct disjoint_linestring_box +{ + static inline bool apply(Linestring const& linestring, Box const& box) + { + typedef typename ::boost::range_value::type point_type; + typedef typename ::boost::range_const_iterator::type const_iterator; + typedef typename ::boost::range_size::type size_type; + + const size_type count = ::boost::size(linestring); + + if ( count == 0 ) + return false; + else if ( count == 1 ) + return detail::disjoint::point_box::value> + ::apply(*::boost::begin(linestring), box); + else + { + const_iterator it0 = ::boost::begin(linestring); + const_iterator it1 = ::boost::begin(linestring) + 1; + const_iterator last = ::boost::end(linestring); + + for ( ; it1 != last ; ++it0, ++it1 ) + { + if ( detail::disjoint::segment_box_intersection::apply(*it0, *it1, box) ) + return false; + } + return true; + } + } +}; }} // namespace detail::disjoint #endif // DOXYGEN_NO_DETAIL @@ -249,9 +295,9 @@ struct disjoint {}; -template -struct disjoint - : detail::disjoint::disjoint_segment +template +struct disjoint + : detail::disjoint::disjoint_segment {}; template @@ -259,6 +305,15 @@ struct disjoint : detail::disjoint::disjoint_linear {}; +template +struct disjoint + : detail::disjoint::disjoint_segment_box +{}; + +template +struct disjoint + : detail::disjoint::disjoint_linestring_box +{}; } // namespace dispatch #endif // DOXYGEN_NO_DISPATCH diff --git a/include/boost/geometry/algorithms/distance.hpp b/include/boost/geometry/algorithms/distance.hpp index 0fd5c43f4..a810fd7b8 100644 --- a/include/boost/geometry/algorithms/distance.hpp +++ b/include/boost/geometry/algorithms/distance.hpp @@ -53,8 +53,8 @@ using strategy::distance::services::return_type; template struct point_to_point { - static inline typename return_type::type apply(P1 const& p1, - P2 const& p2, Strategy const& strategy) + static inline typename return_type::type + apply(P1 const& p1, P2 const& p2, Strategy const& strategy) { boost::ignore_unused_variable_warning(strategy); return strategy.apply(p1, p2); @@ -65,8 +65,8 @@ struct point_to_point template struct point_to_segment { - static inline typename return_type::type apply(Point const& point, - Segment const& segment, Strategy const& ) + static inline typename return_type::type>::type + apply(Point const& point, Segment const& segment, Strategy const& ) { typename strategy::distance::services::default_strategy < @@ -96,7 +96,7 @@ template > struct point_to_range { - typedef typename return_type::type return_type; + typedef typename return_type::type>::type return_type; static inline return_type apply(Point const& point, Range const& range, PPStrategy const& pp_strategy, PSStrategy const& ps_strategy) @@ -161,7 +161,7 @@ struct point_to_ring { typedef std::pair < - typename return_type::type, bool + typename return_type::type>::type, bool > distance_containment; static inline distance_containment apply(Point const& point, @@ -195,7 +195,7 @@ template > struct point_to_polygon { - typedef typename return_type::type return_type; + typedef typename return_type::type>::type return_type; typedef std::pair distance_containment; static inline distance_containment apply(Point const& point, @@ -288,7 +288,14 @@ struct distance > : distance { - static inline typename return_type::type apply( + typedef typename strategy::distance::services::return_type + < + Strategy, + typename point_type::type, + typename point_type::type + >::type return_type; + + static inline return_type apply( Geometry1 const& g1, Geometry2 const& g2, Strategy const& strategy) @@ -302,44 +309,6 @@ struct distance } }; -// If reversal is needed and we got the strategy by default, invert it before -// proceeding to the reversal. -template -< - typename Geometry1, typename Geometry2, - typename Tag1, typename Tag2, typename StrategyTag -> -struct distance -< - Geometry1, Geometry2, - typename detail::distance::default_strategy::type, - Tag1, Tag2, StrategyTag, - true -> - : distance - < - Geometry2, Geometry1, - typename detail::distance::default_strategy::type, - Tag2, Tag1, StrategyTag, - false - > -{ - typedef typename detail::distance::default_strategy::type reversed_strategy; - - static inline typename strategy::distance::services::return_type::type apply( - Geometry1 const& g1, - Geometry2 const& g2, - typename detail::distance::default_strategy::type const&) - { - return distance - < - Geometry2, Geometry1, reversed_strategy, - Tag2, Tag1, StrategyTag, - false - >::apply(g2, g1, reversed_strategy()); - } -}; - // Point-point template @@ -363,9 +332,10 @@ struct distance > { - static inline typename return_type::type apply(Point const& point, - Linestring const& linestring, - Strategy const& strategy) + static inline typename return_type::type>::type + apply(Point const& point, + Linestring const& linestring, + Strategy const& strategy) { typedef typename strategy::distance::services::default_strategy < @@ -394,9 +364,10 @@ struct distance false > { - static inline typename return_type::type apply(Point const& point, - Linestring const& linestring, - Strategy const& strategy) + static inline typename return_type::type>::type + apply(Point const& point, + Linestring const& linestring, + Strategy const& strategy) { typedef typename Strategy::point_strategy_type pp_strategy_type; return detail::distance::point_to_range @@ -415,7 +386,7 @@ struct distance false > { - typedef typename return_type::type return_type; + typedef typename return_type::type>::type return_type; static inline return_type apply(Point const& point, Ring const& ring, @@ -450,7 +421,7 @@ struct distance false > { - typedef typename return_type::type return_type; + typedef typename return_type::type>::type return_type; static inline return_type apply(Point const& point, Polygon const& polygon, @@ -496,8 +467,10 @@ struct distance false > { - static inline typename return_type::type apply(Point const& point, - Segment const& segment, Strategy const& strategy) + static inline typename return_type::type>::type + apply(Point const& point, + Segment const& segment, + Strategy const& strategy) { typename point_type::type p[2]; @@ -549,9 +522,15 @@ for distance, it is probably so that there is no specialization for return_type<...> for your strategy. */ template -inline typename strategy::distance::services::return_type::type distance( - Geometry1 const& geometry1, Geometry2 const& geometry2, - Strategy const& strategy) +inline typename strategy::distance::services::return_type + < + Strategy, + typename point_type::type, + typename point_type::type + >::type +distance(Geometry1 const& geometry1, + Geometry2 const& geometry2, + Strategy const& strategy) { concept::check(); concept::check(); diff --git a/include/boost/geometry/algorithms/num_points.hpp b/include/boost/geometry/algorithms/num_points.hpp index 923ae8297..af7ee1d0c 100644 --- a/include/boost/geometry/algorithms/num_points.hpp +++ b/include/boost/geometry/algorithms/num_points.hpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -82,8 +81,6 @@ struct polygon_count: private range_count template static inline std::size_t apply(Polygon const& poly, bool add_for_open) { - typedef typename geometry::ring_type::type ring_type; - std::size_t n = range_count::apply( exterior_ring(poly), add_for_open); diff --git a/include/boost/geometry/algorithms/simplify.hpp b/include/boost/geometry/algorithms/simplify.hpp index 7e3aca401..2bd097f13 100644 --- a/include/boost/geometry/algorithms/simplify.hpp +++ b/include/boost/geometry/algorithms/simplify.hpp @@ -252,7 +252,9 @@ inline void simplify(Geometry const& geometry, Geometry& out, { concept::check(); - BOOST_CONCEPT_ASSERT( (geometry::concept::SimplifyStrategy) ); + BOOST_CONCEPT_ASSERT( + (concept::SimplifyStrategy::type>) + ); geometry::clear(out); @@ -322,7 +324,9 @@ inline void simplify_insert(Geometry const& geometry, OutputIterator out, Distance const& max_distance, Strategy const& strategy) { concept::check(); - BOOST_CONCEPT_ASSERT( (geometry::concept::SimplifyStrategy) ); + BOOST_CONCEPT_ASSERT( + (concept::SimplifyStrategy::type>) + ); dispatch::simplify_insert::apply(geometry, out, max_distance, strategy); } diff --git a/include/boost/geometry/algorithms/unique.hpp b/include/boost/geometry/algorithms/unique.hpp index e11dc13c4..b64f7565c 100644 --- a/include/boost/geometry/algorithms/unique.hpp +++ b/include/boost/geometry/algorithms/unique.hpp @@ -57,8 +57,6 @@ struct polygon_unique template static inline void apply(Polygon& polygon, ComparePolicy const& policy) { - typedef typename geometry::ring_type::type ring_type; - range_unique::apply(exterior_ring(polygon), policy); typename interior_return_type::type rings diff --git a/include/boost/geometry/geometries/point.hpp b/include/boost/geometry/geometries/point.hpp index b53114731..1a6382082 100644 --- a/include/boost/geometry/geometries/point.hpp +++ b/include/boost/geometry/geometries/point.hpp @@ -71,7 +71,7 @@ public: {} /// @brief Constructor to set one, two or three values - inline point(CoordinateType const& v0, CoordinateType const& v1 = 0, CoordinateType const& v2 = 0) + explicit inline point(CoordinateType const& v0, CoordinateType const& v1 = 0, CoordinateType const& v2 = 0) { if (DimensionCount >= 1) m_values[0] = v0; if (DimensionCount >= 2) m_values[1] = v1; diff --git a/include/boost/geometry/index/detail/algorithms/segment_intersection.hpp b/include/boost/geometry/index/detail/algorithms/segment_intersection.hpp index 4ae82c6ba..a6ad30181 100644 --- a/include/boost/geometry/index/detail/algorithms/segment_intersection.hpp +++ b/include/boost/geometry/index/detail/algorithms/segment_intersection.hpp @@ -34,8 +34,10 @@ namespace dispatch { template struct box_segment_intersection_dim { - BOOST_STATIC_ASSERT(I < dimension::value); - BOOST_STATIC_ASSERT(I < dimension::value); + BOOST_STATIC_ASSERT(0 <= dimension::value); + BOOST_STATIC_ASSERT(0 <= dimension::value); + BOOST_STATIC_ASSERT(I < size_t(dimension::value)); + BOOST_STATIC_ASSERT(I < size_t(dimension::value)); BOOST_STATIC_ASSERT(dimension::value == dimension::value); // WARNING! - RelativeDistance must be IEEE float for this to work diff --git a/include/boost/geometry/index/detail/rtree/node/node_auto_ptr.hpp b/include/boost/geometry/index/detail/rtree/node/node_auto_ptr.hpp index 359d4380d..c19e123b6 100644 --- a/include/boost/geometry/index/detail/rtree/node/node_auto_ptr.hpp +++ b/include/boost/geometry/index/detail/rtree/node/node_auto_ptr.hpp @@ -17,6 +17,8 @@ namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { +// TODO - change the name to node_scoped_ptr + template class node_auto_ptr { diff --git a/include/boost/geometry/index/detail/rtree/node/node_d_mem_dynamic.hpp b/include/boost/geometry/index/detail/rtree/node/node_d_mem_dynamic.hpp index 832335f24..1e3cd58d5 100644 --- a/include/boost/geometry/index/detail/rtree/node/node_d_mem_dynamic.hpp +++ b/include/boost/geometry/index/detail/rtree/node/node_d_mem_dynamic.hpp @@ -183,9 +183,9 @@ public: typename node::type >::other::pointer node_pointer; - typedef typename Allocator::template rebind< - typename internal_node::type - >::other::pointer internal_node_pointer; +// typedef typename Allocator::template rebind< +// typename internal_node::type +// >::other::pointer internal_node_pointer; typedef typename Allocator::template rebind< typename internal_node::type diff --git a/include/boost/geometry/index/detail/rtree/node/node_d_mem_static.hpp b/include/boost/geometry/index/detail/rtree/node/node_d_mem_static.hpp index bfbe0ae93..184c48e44 100644 --- a/include/boost/geometry/index/detail/rtree/node/node_d_mem_static.hpp +++ b/include/boost/geometry/index/detail/rtree/node/node_d_mem_static.hpp @@ -130,9 +130,9 @@ public: typename node::type >::other::pointer node_pointer; - typedef typename Allocator::template rebind< - typename internal_node::type - >::other::pointer internal_node_pointer; +// typedef typename Allocator::template rebind< +// typename internal_node::type +// >::other::pointer internal_node_pointer; typedef typename Allocator::template rebind< typename internal_node::type diff --git a/include/boost/geometry/index/detail/rtree/node/node_s_mem_dynamic.hpp b/include/boost/geometry/index/detail/rtree/node/node_s_mem_dynamic.hpp index a37856c55..8cf7c9c0d 100644 --- a/include/boost/geometry/index/detail/rtree/node/node_s_mem_dynamic.hpp +++ b/include/boost/geometry/index/detail/rtree/node/node_s_mem_dynamic.hpp @@ -115,9 +115,9 @@ public: typename node::type >::other::pointer node_pointer; - typedef typename Allocator::template rebind< - typename internal_node::type - >::other::pointer internal_node_pointer; +// typedef typename Allocator::template rebind< +// typename internal_node::type +// >::other::pointer internal_node_pointer; typedef typename Allocator::template rebind< typename node::type diff --git a/include/boost/geometry/index/detail/rtree/node/node_s_mem_static.hpp b/include/boost/geometry/index/detail/rtree/node/node_s_mem_static.hpp index fa9fb456f..d5d68cbd1 100644 --- a/include/boost/geometry/index/detail/rtree/node/node_s_mem_static.hpp +++ b/include/boost/geometry/index/detail/rtree/node/node_s_mem_static.hpp @@ -111,9 +111,9 @@ public: typename node::type >::other::pointer node_pointer; - typedef typename Allocator::template rebind< - typename internal_node::type - >::other::pointer internal_node_pointer; +// typedef typename Allocator::template rebind< +// typename internal_node::type +// >::other::pointer internal_node_pointer; typedef typename Allocator::template rebind< typename node::type diff --git a/include/boost/geometry/index/detail/rtree/query_iterators.hpp b/include/boost/geometry/index/detail/rtree/query_iterators.hpp index 8d0dbdd9d..8366fca19 100644 --- a/include/boost/geometry/index/detail/rtree/query_iterators.hpp +++ b/include/boost/geometry/index/detail/rtree/query_iterators.hpp @@ -11,9 +11,12 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_QUERY_ITERATORS_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_QUERY_ITERATORS_HPP -namespace boost { namespace geometry { namespace index { +#define BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_VIRTUAL +//#define BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_FUNCTION +//#define BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_TYPE_ERASURE +//#define BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_MOVE -namespace detail { namespace rtree { +namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { namespace iterators { template struct end_query_iterator @@ -50,15 +53,10 @@ struct end_query_iterator return *this; } - friend bool operator==(end_query_iterator l, end_query_iterator r) + friend bool operator==(end_query_iterator const& /*l*/, end_query_iterator const& /*r*/) { return true; } - - friend bool operator!=(end_query_iterator l, end_query_iterator r) - { - return false; - } }; template @@ -81,8 +79,7 @@ public: inline spatial_query_iterator(node_pointer root, Translator const& t, Predicates const& p) : m_visitor(t, p) { - detail::rtree::apply_visitor(m_visitor, *root); - m_visitor.increment(); + m_visitor.initialize(root); } reference operator*() const @@ -113,30 +110,15 @@ public: return l.m_visitor == r.m_visitor; } - friend bool operator==(spatial_query_iterator const& l, end_query_iterator) + friend bool operator==(spatial_query_iterator const& l, end_query_iterator const& /*r*/) { return l.m_visitor.is_end(); } - friend bool operator==(end_query_iterator, spatial_query_iterator const& r) + friend bool operator==(end_query_iterator const& /*l*/, spatial_query_iterator const& r) { return r.m_visitor.is_end(); } - - friend bool operator!=(spatial_query_iterator const& l, spatial_query_iterator const& r) - { - return !(l.m_visitor == r.m_visitor); - } - - friend bool operator!=(spatial_query_iterator const& l, end_query_iterator) - { - return !l.m_visitor.is_end(); - } - - friend bool operator!=(end_query_iterator, spatial_query_iterator const& r) - { - return !r.m_visitor.is_end(); - } private: visitor_type m_visitor; @@ -162,8 +144,7 @@ public: inline distance_query_iterator(node_pointer root, Translator const& t, Predicates const& p) : m_visitor(t, p) { - detail::rtree::apply_visitor(m_visitor, *root); - m_visitor.increment(); + m_visitor.initialize(root); } reference operator*() const @@ -194,37 +175,425 @@ public: return l.m_visitor == r.m_visitor; } - friend bool operator==(distance_query_iterator const& l, end_query_iterator) + friend bool operator==(distance_query_iterator const& l, end_query_iterator const& /*r*/) { return l.m_visitor.is_end(); } - friend bool operator==(end_query_iterator, distance_query_iterator const& r) + friend bool operator==(end_query_iterator const& /*l*/, distance_query_iterator const& r) { return r.m_visitor.is_end(); } - friend bool operator!=(distance_query_iterator const& l, distance_query_iterator const& r) - { - return !(l.m_visitor == r.m_visitor); - } - - friend bool operator!=(distance_query_iterator const& l, end_query_iterator) - { - return !l.m_visitor.is_end(); - } - - friend bool operator!=(end_query_iterator, distance_query_iterator const& r) - { - return !r.m_visitor.is_end(); - } - private: visitor_type m_visitor; }; -}} // namespace detail::rtree +template +inline bool operator!=(L const& l, R const& r) +{ + return !(l == r); +} -}}} // namespace boost::geometry::index +}}}}}} // namespace boost::geometry::index::detail::rtree::iterators + +#if defined(BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_VIRTUAL) || defined(BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_FUNCTION) + +#if defined(BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_VIRTUAL) + +namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { namespace iterators { + +template +class query_iterator_base +{ +public: + typedef std::input_iterator_tag iterator_category; + typedef Value value_type; + typedef typename Allocators::const_reference reference; + typedef typename Allocators::difference_type difference_type; + typedef typename Allocators::const_pointer pointer; + + virtual ~query_iterator_base() {} + + virtual query_iterator_base * clone() const = 0; + + virtual bool is_end() const = 0; + virtual reference dereference() const = 0; + virtual void increment() = 0; + virtual bool equals(query_iterator_base const&) const = 0; +}; + +template +class query_iterator_wrapper + : public query_iterator_base +{ + typedef query_iterator_base base_t; + +public: + typedef std::input_iterator_tag iterator_category; + typedef Value value_type; + typedef typename Allocators::const_reference reference; + typedef typename Allocators::difference_type difference_type; + typedef typename Allocators::const_pointer pointer; + + explicit query_iterator_wrapper(Iterator const& it) : m_iterator(it) {} + + virtual base_t * clone() const { return new query_iterator_wrapper(m_iterator); } + + virtual bool is_end() const { return m_iterator == end_query_iterator(); } + virtual reference dereference() const { return *m_iterator; } + virtual void increment() { ++m_iterator; } + virtual bool equals(base_t const& r) const + { + const query_iterator_wrapper * p = dynamic_cast(boost::addressof(r)); + BOOST_ASSERT_MSG(p, "those iterators can't be compared"); + return m_iterator == p->m_iterator; + } + +private: + Iterator m_iterator; +}; + +#elif defined(BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_FUNCTION) + +#include +#include + +namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { namespace iterators { + +template +class query_iterator_base +{ +public: + typedef std::input_iterator_tag iterator_category; + typedef Value value_type; + typedef typename Allocators::const_reference reference; + typedef typename Allocators::difference_type difference_type; + typedef typename Allocators::const_pointer pointer; + + virtual ~query_iterator_base() {} + + boost::function clone; + boost::function is_end; + boost::function dereference; + boost::function increment; + boost::function equals; +}; + +template +class query_iterator_wrapper + : public query_iterator_base +{ + typedef query_iterator_base base_t; + +public: + typedef std::input_iterator_tag iterator_category; + typedef Value value_type; + typedef typename Allocators::const_reference reference; + typedef typename Allocators::difference_type difference_type; + typedef typename Allocators::const_pointer pointer; + + explicit query_iterator_wrapper(Iterator const& it) + : m_iterator(it) + { + base_t::clone = boost::bind(&query_iterator_wrapper::clone_, this); + base_t::is_end = boost::bind(&query_iterator_wrapper::is_end_, this); + base_t::dereference = boost::bind(&query_iterator_wrapper::dereference_, this); + base_t::increment = boost::bind(&query_iterator_wrapper::increment_, this); + base_t::equals = boost::bind(&query_iterator_wrapper::equals_, this, _1); + } + +private: + base_t * clone_() const { return new query_iterator_wrapper(m_iterator); } + + bool is_end_() const { return m_iterator == end_query_iterator(); } + reference dereference_() const { return *m_iterator; } + void increment_() { ++m_iterator; } + bool equals_(base_t const& r) const + { + const query_iterator_wrapper * p = dynamic_cast(boost::addressof(r)); + BOOST_ASSERT_MSG(p, "those iterators can't be compared"); + return m_iterator == p->m_iterator; + } + +private: + Iterator m_iterator; +}; + +#endif + +template +class query_iterator +{ + typedef query_iterator_base iterator_base; + typedef std::auto_ptr iterator_ptr; + +public: + typedef std::input_iterator_tag iterator_category; + typedef Value value_type; + typedef typename Allocators::const_reference reference; + typedef typename Allocators::difference_type difference_type; + typedef typename Allocators::const_pointer pointer; + + query_iterator() {} + + template + query_iterator(It const& it) + : m_ptr(static_cast( + new query_iterator_wrapper(it) )) + {} + + query_iterator(end_query_iterator const& /*it*/) + {} + + query_iterator(query_iterator const& o) + : m_ptr(o.m_ptr.get() ? o.m_ptr->clone() : 0) + {} + +#ifndef BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_MOVE + query_iterator & operator=(query_iterator const& o) + { + m_ptr.reset(o.m_ptr.get() ? o.m_ptr->clone() : 0); + return *this; + } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + query_iterator(query_iterator && o) + : m_ptr(o.m_ptr.get()) + { + o.m_ptr.release(); + } + query_iterator & operator=(query_iterator && o) + { + if ( this != boost::addressof(o) ) + { + m_ptr.reset(o.m_ptr.get()); + o.m_ptr.release(); + } + return *this; + } +#endif +#else // !BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_MOVE +private: + BOOST_COPYABLE_AND_MOVABLE(query_iterator) +public: + query_iterator & operator=(BOOST_COPY_ASSIGN_REF(query_iterator) o) + { + m_ptr.reset(o.m_ptr.get() ? o.m_ptr->clone() : 0); + return *this; + } + query_iterator(BOOST_RV_REF(query_iterator) o) + : m_ptr(o.m_ptr.get()) + { + o.m_ptr.release(); + } + query_iterator & operator=(BOOST_RV_REF(query_iterator) o) + { + if ( this != boost::addressof(o) ) + { + m_ptr.reset(o.m_ptr.get()); + o.m_ptr.release(); + } + return *this; + } +#endif // BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_MOVE + + reference operator*() const + { + return m_ptr->dereference(); + } + + const value_type * operator->() const + { + return boost::addressof(m_ptr->dereference()); + } + + query_iterator & operator++() + { + m_ptr->increment(); + return *this; + } + + query_iterator operator++(int) + { + query_iterator temp = *this; + this->operator++(); + return temp; + } + + friend bool operator==(query_iterator const& l, query_iterator const& r) + { + if ( l.m_ptr.get() ) + { + if ( r.m_ptr.get() ) + return l.m_ptr->equals(*r.m_ptr); + else + return l.m_ptr->is_end(); + } + else + { + if ( r.m_ptr.get() ) + return r.m_ptr->is_end(); + else + return true; + } + } + +private: + iterator_ptr m_ptr; +}; + +}}}}}} // namespace boost::geometry::index::detail::rtree::iterators + +#elif defined(BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_TYPE_ERASURE) + +#include +#include +#include + +namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { namespace iterators { + +template +struct single_pass_iterator_concept : + ::boost::mpl::vector< + ::boost::type_erasure::copy_constructible, + ::boost::type_erasure::equality_comparable, + ::boost::type_erasure::dereferenceable, + ::boost::type_erasure::assignable, + ::boost::type_erasure::incrementable, + ::boost::type_erasure::equality_comparable >, + ::boost::type_erasure::relaxed // default ctor + > +{}; + +template +struct single_pass_iterator_type +{ + typedef ::boost::type_erasure::any< + single_pass_iterator_concept< + ::boost::type_erasure::_self, Value, Allocators + > + > type; +}; + +}}}}}} // namespace boost::geometry::index::detail::rtree::iterators + +namespace boost { namespace type_erasure { + +template +struct concept_interface< + ::boost::geometry::index::detail::rtree::single_pass_iterator_concept< + T, Value, Allocators + >, Base, T> + : Base +{ + typedef Value value_type; + typedef typename Allocators::const_reference reference; + typedef typename Allocators::const_pointer pointer; + typedef typename Allocators::difference_type difference_type; + typedef ::std::input_iterator_tag iterator_category; +}; + +}} // boost::type_erasure + +namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { namespace iterators { + +template +class query_iterator +{ +public: + typedef std::input_iterator_tag iterator_category; + typedef Value value_type; + typedef typename Allocators::const_reference reference; + typedef typename Allocators::difference_type difference_type; + typedef typename Allocators::const_pointer pointer; + +private: + typedef typename rtree::single_pass_iterator_type::type iterator_type; + +public: + + query_iterator() {} + + template + query_iterator(It const& it) + : m_iterator(it) + {} + + query_iterator(end_query_iterator const& /*it*/) + {} + +#ifdef BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_MOVE +private: + BOOST_COPYABLE_AND_MOVABLE(query_iterator) +public: + query_iterator(query_iterator const& o) + : m_iterator(o.m_iterator) + {} + query_iterator & operator=(BOOST_COPY_ASSIGN_REF(query_iterator) o) + { + m_iterator = o.m_iterator; + return *this; + } + query_iterator(BOOST_RV_REF(query_iterator) o) + : m_iterator(boost::move(o.m_iterator)) + {} + query_iterator & operator=(BOOST_RV_REF(query_iterator) o) + { + if ( this != boost::addressof(o) ) + { + m_iterator = boost::move(o.m_iterator); + } + return *this; + } +#endif // BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_MOVE + + reference operator*() const + { + return *m_iterator; + } + + const value_type * operator->() const + { + return boost::addressof(*m_iterator); + } + + query_iterator & operator++() + { + ++m_iterator; + return *this; + } + + query_iterator operator++(int) + { + query_iterator temp = *this; + ++m_iterator; + return temp; + } + + friend bool operator==(query_iterator const& l, query_iterator const& r) + { + if ( !::boost::type_erasure::is_empty(l.m_iterator) ) + { + if ( !::boost::type_erasure::is_empty(r.m_iterator) ) + return l.m_iterator == r.m_iterator; + else + return l.m_iterator == end_query_iterator(); + } + else + { + if ( !::boost::type_erasure::is_empty(r.m_iterator) ) + return r.m_iterator == end_query_iterator(); + else + return true; + } + } + +private: + iterator_type m_iterator; +}; + +}}}}}} // namespace boost::geometry::index::detail::rtree::iterators + +#endif // BOOST_GEOMETRY_INDEX_DETAIL_QUERY_ITERATORS_USE_TYPE_ERASURE #endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_QUERY_ITERATORS_HPP diff --git a/include/boost/geometry/index/detail/rtree/rstar/insert.hpp b/include/boost/geometry/index/detail/rtree/rstar/insert.hpp index e681bbb6b..37bc31efa 100644 --- a/include/boost/geometry/index/detail/rtree/rstar/insert.hpp +++ b/include/boost/geometry/index/detail/rtree/rstar/insert.hpp @@ -28,7 +28,9 @@ public: typedef typename rtree::leaf::type leaf; typedef typename Options::parameters_type parameters_type; - typedef typename Allocators::internal_node_pointer internal_node_pointer; + + //typedef typename Allocators::internal_node_pointer internal_node_pointer; + typedef internal_node * internal_node_pointer; template static inline void apply(ResultElements & result_elements, diff --git a/include/boost/geometry/index/detail/rtree/utilities/gl_draw.hpp b/include/boost/geometry/index/detail/rtree/utilities/gl_draw.hpp index 7072a1879..9b5e4d035 100644 --- a/include/boost/geometry/index/detail/rtree/utilities/gl_draw.hpp +++ b/include/boost/geometry/index/detail/rtree/utilities/gl_draw.hpp @@ -58,7 +58,7 @@ struct gl_draw_indexable template struct gl_draw_indexable { - static const size_t dimension = dimension::value; + static const size_t dimension = geometry::dimension::value; static inline void apply(Indexable const& i, typename coordinate_type::type z) { @@ -69,7 +69,7 @@ struct gl_draw_indexable template struct gl_draw_indexable { - static const size_t dimension = dimension::value; + static const size_t dimension = geometry::dimension::value; static inline void apply(Indexable const& i, typename coordinate_type::type z) { diff --git a/include/boost/geometry/index/detail/rtree/utilities/print.hpp b/include/boost/geometry/index/detail/rtree/utilities/print.hpp index f7d503a7d..452471061 100644 --- a/include/boost/geometry/index/detail/rtree/utilities/print.hpp +++ b/include/boost/geometry/index/detail/rtree/utilities/print.hpp @@ -71,7 +71,7 @@ struct print_indexable template struct print_indexable { - static const size_t dimension = dimension::value; + static const size_t dimension = geometry::dimension::value; static inline void apply(std::ostream &os, Indexable const& i) { @@ -86,7 +86,7 @@ struct print_indexable template struct print_indexable { - static const size_t dimension = dimension::value; + static const size_t dimension = geometry::dimension::value; static inline void apply(std::ostream &os, Indexable const& i) { diff --git a/include/boost/geometry/index/detail/rtree/utilities/statistics.hpp b/include/boost/geometry/index/detail/rtree/utilities/statistics.hpp index c8e420d91..bbaed8100 100644 --- a/include/boost/geometry/index/detail/rtree/utilities/statistics.hpp +++ b/include/boost/geometry/index/detail/rtree/utilities/statistics.hpp @@ -13,7 +13,7 @@ #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_UTILITIES_STATISTICS_HPP #include -#include +#include namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { namespace utilities { diff --git a/include/boost/geometry/index/detail/rtree/visitors/distance_query.hpp b/include/boost/geometry/index/detail/rtree/visitors/distance_query.hpp index 616150222..c0d336df1 100644 --- a/include/boost/geometry/index/detail/rtree/visitors/distance_query.hpp +++ b/include/boost/geometry/index/detail/rtree/visitors/distance_query.hpp @@ -318,6 +318,12 @@ public: return *(neighbors[current_neighbor].second); } + void initialize(node_pointer root) + { + rtree::apply_visitor(*this, *root); + increment(); + } + void increment() { for (;;) diff --git a/include/boost/geometry/index/detail/rtree/visitors/insert.hpp b/include/boost/geometry/index/detail/rtree/visitors/insert.hpp index 9ff5f0749..540de5a4c 100644 --- a/include/boost/geometry/index/detail/rtree/visitors/insert.hpp +++ b/include/boost/geometry/index/detail/rtree/visitors/insert.hpp @@ -231,7 +231,9 @@ protected: typedef rtree::node_auto_ptr node_auto_ptr; typedef typename Allocators::node_pointer node_pointer; - typedef typename Allocators::internal_node_pointer internal_node_pointer; + + //typedef typename Allocators::internal_node_pointer internal_node_pointer; + typedef internal_node * internal_node_pointer; inline insert(node_pointer & root, size_t & leafs_level, diff --git a/include/boost/geometry/index/detail/rtree/visitors/remove.hpp b/include/boost/geometry/index/detail/rtree/visitors/remove.hpp index 5b77b5acb..19da61d49 100644 --- a/include/boost/geometry/index/detail/rtree/visitors/remove.hpp +++ b/include/boost/geometry/index/detail/rtree/visitors/remove.hpp @@ -32,7 +32,9 @@ class remove typedef rtree::node_auto_ptr node_auto_ptr; typedef typename Allocators::node_pointer node_pointer; - typedef typename Allocators::internal_node_pointer internal_node_pointer; + + //typedef typename Allocators::internal_node_pointer internal_node_pointer; + typedef internal_node * internal_node_pointer; public: inline remove(node_pointer & root, diff --git a/include/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp b/include/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp index 48d9c3d3c..0a43111ac 100644 --- a/include/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp +++ b/include/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp @@ -112,7 +112,6 @@ public: { m_values = ::boost::addressof(rtree::elements(n)); m_current = rtree::elements(n).begin(); - m_last = rtree::elements(n).end(); } const_reference dereference() const @@ -121,17 +120,26 @@ public: return *m_current; } + void initialize(node_pointer root) + { + rtree::apply_visitor(*this, *root); + search_value(); + } + void increment() { - if ( m_values ) - ++m_current; + ++m_current; + search_value(); + } + void search_value() + { for (;;) { // if leaf is choosen, move to the next value in leaf if ( m_values ) { - if ( m_current != m_last ) + if ( m_current != m_values->end() ) { // return if next value is found Value const& v = *m_current; @@ -188,7 +196,7 @@ private: std::vector< std::pair > m_internal_stack; const leaf_elements * m_values; - leaf_iterator m_current, m_last; + leaf_iterator m_current; }; }}} // namespace detail::rtree::visitors diff --git a/include/boost/geometry/index/detail/serialization.hpp b/include/boost/geometry/index/detail/serialization.hpp new file mode 100644 index 000000000..4f3dc7c01 --- /dev/null +++ b/include/boost/geometry/index/detail/serialization.hpp @@ -0,0 +1,581 @@ +// Boost.Geometry Index +// +// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland. +// +// 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) + +#ifndef BOOST_GEOMETRY_INDEX_DETAIL_SERIALIZATION_HPP +#define BOOST_GEOMETRY_INDEX_DETAIL_SERIALIZATION_HPP + +//#include +#include +#include +//#include + +// TODO +// how about using the unsigned type capable of storing Max in compile-time versions? + +// TODO +// - add wrappers for Point and Box and implement serialize for those wrappers instead of +// raw geometries +// PROBLEM: after implementing this, how Values would be set? +// - store the name of the parameters to know how to load and detect errors +// - in the header, once store info about the Indexable and Bounds types (geometry type, point CS, Dim, etc.) +// each geometry save without this info + +// TODO - move to index/detail/serialization.hpp +namespace boost { namespace geometry { namespace index { namespace detail { + +// TODO - use boost::move? +template +class serialization_storage +{ +public: + template + serialization_storage(Archive & ar, unsigned int version) + { + boost::serialization::load_construct_data_adl(ar, this->address(), version); + } + ~serialization_storage() + { + this->address()->~T(); + } + T * address() + { + return static_cast(m_storage.address()); + } +private: + boost::aligned_storage::value> m_storage; +}; + +// TODO - save and load item_version? see: collections_load_imp and collections_save_imp +// this should be done once for the whole container +// versions of all used types should be stored + +template inline +T serialization_load(const char * name, Archive & ar) +{ + namespace bs = boost::serialization; + serialization_storage storage(ar, bs::version::value); // load_construct_data + ar >> boost::serialization::make_nvp(name, *storage.address()); // serialize + //ar >> *storage.address(); // serialize + return *storage.address(); +} + +template inline +void serialization_save(T const& t, const char * name, Archive & ar) +{ + namespace bs = boost::serialization; + bs::save_construct_data_adl(ar, boost::addressof(t), bs::version::value); // save_construct_data + ar << boost::serialization::make_nvp(name, t); // serialize + //ar << t; // serialize +} + +}}}} + +// TODO - move to index/serialization/rtree.hpp +namespace boost { namespace serialization { + +// boost::geometry::index::linear + +template +void save_construct_data(Archive & ar, const boost::geometry::index::linear * params, unsigned int ) +{ + size_t max = params->get_max_elements(), min = params->get_min_elements(); + ar << boost::serialization::make_nvp("max", max); + ar << boost::serialization::make_nvp("min", min); +} +template +void load_construct_data(Archive & ar, boost::geometry::index::linear * params, unsigned int ) +{ + size_t max, min; + ar >> boost::serialization::make_nvp("max", max); + ar >> boost::serialization::make_nvp("min", min); + if ( max != params->get_max_elements() || min != params->get_min_elements() ) + // TODO change exception type + BOOST_THROW_EXCEPTION(std::runtime_error("parameters not compatible")); + // the constructor musn't be called for this type + //::new(params)boost::geometry::index::linear(); +} +template void serialize(Archive &, boost::geometry::index::linear &, unsigned int) {} + +// boost::geometry::index::quadratic + +template +void save_construct_data(Archive & ar, const boost::geometry::index::quadratic * params, unsigned int ) +{ + size_t max = params->get_max_elements(), min = params->get_min_elements(); + ar << boost::serialization::make_nvp("max", max); + ar << boost::serialization::make_nvp("min", min); +} +template +void load_construct_data(Archive & ar, boost::geometry::index::quadratic * params, unsigned int ) +{ + size_t max, min; + ar >> boost::serialization::make_nvp("max", max); + ar >> boost::serialization::make_nvp("min", min); + if ( max != params->get_max_elements() || min != params->get_min_elements() ) + // TODO change exception type + BOOST_THROW_EXCEPTION(std::runtime_error("parameters not compatible")); + // the constructor musn't be called for this type + //::new(params)boost::geometry::index::quadratic(); +} +template void serialize(Archive &, boost::geometry::index::quadratic &, unsigned int) {} + +// boost::geometry::index::rstar + +template +void save_construct_data(Archive & ar, const boost::geometry::index::rstar * params, unsigned int ) +{ + size_t max = params->get_max_elements() + , min = params->get_min_elements() + , re = params->get_reinserted_elements() + , oct = params->get_overlap_cost_threshold(); + ar << boost::serialization::make_nvp("max", max); + ar << boost::serialization::make_nvp("min", min); + ar << boost::serialization::make_nvp("re", re); + ar << boost::serialization::make_nvp("oct", oct); +} +template +void load_construct_data(Archive & ar, boost::geometry::index::rstar * params, unsigned int ) +{ + size_t max, min, re, oct; + ar >> boost::serialization::make_nvp("max", max); + ar >> boost::serialization::make_nvp("min", min); + ar >> boost::serialization::make_nvp("re", re); + ar >> boost::serialization::make_nvp("oct", oct); + if ( max != params->get_max_elements() || min != params->get_min_elements() || + re != params->get_reinserted_elements() || oct != params->get_overlap_cost_threshold() ) + // TODO change exception type + BOOST_THROW_EXCEPTION(std::runtime_error("parameters not compatible")); + // the constructor musn't be called for this type + //::new(params)boost::geometry::index::rstar(); +} +template +void serialize(Archive &, boost::geometry::index::rstar &, unsigned int) {} + +// boost::geometry::index::dynamic_linear + +template +inline void save_construct_data(Archive & ar, const boost::geometry::index::dynamic_linear * params, unsigned int ) +{ + size_t max = params->get_max_elements(), min = params->get_min_elements(); + ar << boost::serialization::make_nvp("max", max); + ar << boost::serialization::make_nvp("min", min); +} +template +inline void load_construct_data(Archive & ar, boost::geometry::index::dynamic_linear * params, unsigned int ) +{ + size_t max, min; + ar >> boost::serialization::make_nvp("max", max); + ar >> boost::serialization::make_nvp("min", min); + ::new(params)boost::geometry::index::dynamic_linear(max, min); +} +template void serialize(Archive &, boost::geometry::index::dynamic_linear &, unsigned int) {} + +// boost::geometry::index::dynamic_quadratic + +template +inline void save_construct_data(Archive & ar, const boost::geometry::index::dynamic_quadratic * params, unsigned int ) +{ + size_t max = params->get_max_elements(), min = params->get_min_elements(); + ar << boost::serialization::make_nvp("max", max); + ar << boost::serialization::make_nvp("min", min); +} +template +inline void load_construct_data(Archive & ar, boost::geometry::index::dynamic_quadratic * params, unsigned int ) +{ + size_t max, min; + ar >> boost::serialization::make_nvp("max", max); + ar >> boost::serialization::make_nvp("min", min); + ::new(params)boost::geometry::index::dynamic_quadratic(max, min); +} +template void serialize(Archive &, boost::geometry::index::dynamic_quadratic &, unsigned int) {} + +// boost::geometry::index::dynamic_rstar + +template +inline void save_construct_data(Archive & ar, const boost::geometry::index::dynamic_rstar * params, unsigned int ) +{ + size_t max = params->get_max_elements() + , min = params->get_min_elements() + , re = params->get_reinserted_elements() + , oct = params->get_overlap_cost_threshold(); + ar << boost::serialization::make_nvp("max", max); + ar << boost::serialization::make_nvp("min", min); + ar << boost::serialization::make_nvp("re", re); + ar << boost::serialization::make_nvp("oct", oct); +} +template +inline void load_construct_data(Archive & ar, boost::geometry::index::dynamic_rstar * params, unsigned int ) +{ + size_t max, min, re, oct; + ar >> boost::serialization::make_nvp("max", max); + ar >> boost::serialization::make_nvp("min", min); + ar >> boost::serialization::make_nvp("re", re); + ar >> boost::serialization::make_nvp("oct", oct); + ::new(params)boost::geometry::index::dynamic_rstar(max, min, re, oct); +} +template void serialize(Archive &, boost::geometry::index::dynamic_rstar &, unsigned int) {} + +}} // boost::serialization + +// TODO - move to index/detail/serialization.hpp or maybe geometry/serialization.hpp +namespace boost { namespace geometry { namespace index { namespace detail { + +template ::value> +struct serialize_point +{ + template + static inline void save(Archive & ar, P const& p, unsigned int version) + { + typename coordinate_type

::type c = get(p); + ar << boost::serialization::make_nvp("c", c); + serialize_point::save(ar, p, version); + } + + template + static inline void load(Archive & ar, P & p, unsigned int version) + { + typename traits::coordinate_type

::type c; + ar >> boost::serialization::make_nvp("c", c); + set(p, c); + serialize_point::load(ar, p, version); + } +}; + +template +struct serialize_point +{ + template static inline void save(Archive &, P const&, unsigned int) {} + template static inline void load(Archive &, P &, unsigned int) {} +}; + +}}}} + +// TODO - move to index/detail/serialization.hpp or maybe geometry/serialization.hpp +namespace boost { namespace serialization { + +template +void save(Archive & ar, boost::geometry::model::point const& p, unsigned int version) +{ + boost::geometry::index::detail::serialize_point< boost::geometry::model::point >::save(ar, p, version); +} +template +void load(Archive & ar, boost::geometry::model::point & p, unsigned int version) +{ + boost::geometry::index::detail::serialize_point< boost::geometry::model::point >::load(ar, p, version); +} +template +inline void serialize(Archive & ar, boost::geometry::model::point & o, const unsigned int version) { split_free(ar, o, version); } + +template +inline void serialize(Archive & ar, boost::geometry::model::box

& b, const unsigned int) +{ + ar & boost::serialization::make_nvp("min", b.min_corner()); + ar & boost::serialization::make_nvp("max", b.max_corner()); +} + +}} // boost::serialization + +// TODO - move to index/detail/rtree/visitors/save.hpp +namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { namespace visitors { + +// TODO move saving and loading of the rtree outside the rtree, this will require adding some kind of members_view + +template +class save + : public rtree::visitor::type +{ +public: + typedef typename rtree::node::type node; + typedef typename rtree::internal_node::type internal_node; + typedef typename rtree::leaf::type leaf; + + save(Archive & archive, unsigned int version) + : m_archive(archive), m_version(version) + {} + + inline void operator()(internal_node const& n) + { + typedef typename rtree::elements_type::type elements_type; + elements_type const& elements = rtree::elements(n); + + // change to elements_type::size_type or size_type? + size_t s = elements.size(); + m_archive << boost::serialization::make_nvp("s", s); + + for (typename elements_type::const_iterator it = elements.begin() ; it != elements.end() ; ++it) + { + serialization_save(it->first, "b", m_archive); + + rtree::apply_visitor(*this, *it->second); + } + } + + inline void operator()(leaf const& l) + { + typedef typename rtree::elements_type::type elements_type; + typedef typename elements_type::size_type elements_size; + elements_type const& elements = rtree::elements(l); + + // change to elements_type::size_type or size_type? + size_t s = elements.size(); + m_archive << boost::serialization::make_nvp("s", s); + + for (typename elements_type::const_iterator it = elements.begin() ; it != elements.end() ; ++it) + { + serialization_save(*it, "v", m_archive); + } + } + +private: + Archive & m_archive; + unsigned int m_version; +}; + +}}}}}} // boost::geometry::index::detail::rtree::visitors + +// TODO - move to index/detail/rtree/load.hpp +namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { + +template +class load +{ + typedef typename rtree::node::type node; + typedef typename rtree::internal_node::type internal_node; + typedef typename rtree::leaf::type leaf; + + typedef typename Options::parameters_type parameters_type; + + typedef typename Allocators::node_pointer node_pointer; + typedef rtree::node_auto_ptr node_auto_ptr; + typedef typename Allocators::size_type size_type; + +public: + template inline static + node_pointer apply(Archive & ar, unsigned int version, size_type leafs_level, size_type & values_count, parameters_type const& parameters, Translator const& translator, Allocators & allocators) + { + values_count = 0; + return raw_apply(ar, version, leafs_level, values_count, parameters, translator, allocators); + } + +private: + template inline static + node_pointer raw_apply(Archive & ar, unsigned int version, size_type leafs_level, size_type & values_count, parameters_type const& parameters, Translator const& translator, Allocators & allocators, size_type current_level = 0) + { + //BOOST_GEOMETRY_INDEX_ASSERT(current_level <= leafs_level, "invalid parameter"); + + // change to elements_type::size_type or size_type? + size_t elements_count; + ar >> boost::serialization::make_nvp("s", elements_count); + + if ( elements_count < parameters.get_min_elements() || parameters.get_max_elements() < elements_count ) + BOOST_THROW_EXCEPTION(std::runtime_error("rtree loading error")); + + if ( current_level < leafs_level ) + { + node_pointer n = rtree::create_node::apply(allocators); // MAY THROW (A) + node_auto_ptr auto_remover(n, allocators); + internal_node & in = rtree::get(*n); + + typedef typename rtree::elements_type::type elements_type; + typedef typename elements_type::value_type element_type; + typedef typename elements_type::size_type elements_size; + elements_type & elements = rtree::elements(in); + + elements.reserve(elements_count); // MAY THROW (A) + + for ( size_t i = 0 ; i < elements_count ; ++i ) + { + typedef typename elements_type::value_type::first_type box_type; + box_type b = serialization_load("b", ar); + node_pointer n = raw_apply(ar, version, leafs_level, values_count, parameters, translator, allocators, current_level+1); // recursive call + elements.push_back(element_type(b, n)); + } + + auto_remover.release(); + return n; + } + else + { + BOOST_GEOMETRY_INDEX_ASSERT(current_level == leafs_level, "unexpected value"); + + node_pointer n = rtree::create_node::apply(allocators); // MAY THROW (A) + node_auto_ptr auto_remover(n, allocators); + leaf & l = rtree::get(*n); + + typedef typename rtree::elements_type::type elements_type; + typedef typename elements_type::value_type element_type; + elements_type & elements = rtree::elements(l); + + values_count += elements_count; + + elements.reserve(elements_count); // MAY THROW (A) + + for ( size_t i = 0 ; i < elements_count ; ++i ) + { + element_type el = serialization_load("v", ar); // MAY THROW (C) + elements.push_back(el); // MAY THROW (C) + } + + auto_remover.release(); + return n; + } + } +}; + +}}}}} // boost::geometry::index::detail::rtree + +// TODO - move to index/detail/rtree/private_view.hpp +namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { + +template +class const_private_view +{ +public: + typedef typename Rtree::size_type size_type; + + typedef typename Rtree::translator_type translator_type; + typedef typename Rtree::value_type value_type; + typedef typename Rtree::options_type options_type; + typedef typename Rtree::box_type box_type; + typedef typename Rtree::allocators_type allocators_type; + + const_private_view(Rtree const& rt) : m_rtree(rt) {} + + typedef typename Rtree::members_holder members_holder; + + members_holder const& members() const { return m_rtree.m_members; } + +private: + const_private_view(const_private_view const&); + const_private_view & operator=(const_private_view const&); + + Rtree const& m_rtree; +}; + +template +class private_view +{ +public: + typedef typename Rtree::size_type size_type; + + typedef typename Rtree::translator_type translator_type; + typedef typename Rtree::value_type value_type; + typedef typename Rtree::options_type options_type; + typedef typename Rtree::box_type box_type; + typedef typename Rtree::allocators_type allocators_type; + + private_view(Rtree & rt) : m_rtree(rt) {} + + typedef typename Rtree::members_holder members_holder; + + members_holder & members() { return m_rtree.m_members; } + members_holder const& members() const { return m_rtree.m_members; } + +private: + private_view(private_view const&); + private_view & operator=(private_view const&); + + Rtree & m_rtree; +}; + +}}}}} // namespace boost::geometry::index::detail::rtree + +// TODO - move to index/serialization/rtree.hpp +namespace boost { namespace serialization { + +template +void save(Archive & ar, boost::geometry::index::rtree const& rt, unsigned int version) +{ + namespace detail = boost::geometry::index::detail; + + typedef boost::geometry::index::rtree rtree; + typedef detail::rtree::const_private_view view; + typedef typename view::translator_type translator_type; + typedef typename view::value_type value_type; + typedef typename view::options_type options_type; + typedef typename view::box_type box_type; + typedef typename view::allocators_type allocators_type; + + view tree(rt); + + detail::serialization_save(tree.members().parameters(), "parameters", ar); + + ar << boost::serialization::make_nvp("values_count", tree.members().values_count); + ar << boost::serialization::make_nvp("leafs_level", tree.members().leafs_level); + + if ( tree.members().values_count ) + { + BOOST_GEOMETRY_INDEX_ASSERT(tree.members().root, "root shouldn't be null_ptr"); + + detail::rtree::visitors::save save_v(ar, version); + detail::rtree::apply_visitor(save_v, *tree.members().root); + } +} + +template +void load(Archive & ar, boost::geometry::index::rtree & rt, unsigned int version) +{ + namespace detail = boost::geometry::index::detail; + + typedef boost::geometry::index::rtree rtree; + typedef detail::rtree::private_view view; + typedef typename view::size_type size_type; + typedef typename view::translator_type translator_type; + typedef typename view::value_type value_type; + typedef typename view::options_type options_type; + typedef typename view::box_type box_type; + typedef typename view::allocators_type allocators_type; + + typedef typename options_type::parameters_type parameters_type; + typedef typename allocators_type::node_pointer node_pointer; + typedef detail::rtree::node_auto_ptr node_auto_ptr; + + view tree(rt); + + parameters_type params = detail::serialization_load("parameters", ar); + + size_type values_count, leafs_level; + ar >> boost::serialization::make_nvp("values_count", values_count); + ar >> boost::serialization::make_nvp("leafs_level", leafs_level); + + node_pointer n(0); + if ( 0 < values_count ) + { + size_type loaded_values_count = 0; + n = detail::rtree::load + ::apply(ar, version, leafs_level, loaded_values_count, params, tree.members().translator(), tree.members().allocators()); // MAY THROW + + node_auto_ptr remover(n, tree.members().allocators()); + if ( loaded_values_count != values_count ) + BOOST_THROW_EXCEPTION(std::runtime_error("unexpected number of values")); // TODO change exception type + remover.release(); + } + + tree.members().parameters() = params; + tree.members().values_count = values_count; + tree.members().leafs_level = leafs_level; + + node_auto_ptr remover(tree.members().root, tree.members().allocators()); + tree.members().root = n; +} + +template inline +void serialize(Archive & ar, boost::geometry::index::rtree & rt, unsigned int version) +{ + split_free(ar, rt, version); +} + +template inline +void serialize(Archive & ar, boost::geometry::index::rtree const& rt, unsigned int version) +{ + split_free(ar, rt, version); +} + +}} // boost::serialization + +#endif // BOOST_GEOMETRY_INDEX_DETAIL_SERIALIZATION_HPP diff --git a/include/boost/geometry/index/detail/type_erased_iterators.hpp b/include/boost/geometry/index/detail/type_erased_iterators.hpp deleted file mode 100644 index 92867a4ce..000000000 --- a/include/boost/geometry/index/detail/type_erased_iterators.hpp +++ /dev/null @@ -1,60 +0,0 @@ -// Boost.Geometry Index -// -// Type-erased iterators -// -// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland. -// -// 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) - -#ifndef BOOST_GEOMETRY_INDEX_DETAIL_TYPE_ERASED_ITERATORS_HPP -#define BOOST_GEOMETRY_INDEX_DETAIL_TYPE_ERASED_ITERATORS_HPP - -#include -#include - -namespace boost { namespace geometry { namespace index { namespace detail { - -template -struct single_pass_iterator_concept : - ::boost::mpl::vector< - ::boost::type_erasure::copy_constructible, - ::boost::type_erasure::equality_comparable, - ::boost::type_erasure::dereferenceable, - ::boost::type_erasure::assignable, - ::boost::type_erasure::incrementable - > -{}; - -template -struct single_pass_iterator_type -{ - typedef ::boost::type_erasure::any< - single_pass_iterator_concept< - ::boost::type_erasure::_self, ValueType, Reference, Pointer, DifferenceType - > - > type; -}; - -}}}} // namespace boost::geometry::index::detail - -namespace boost { namespace type_erasure { - -template -struct concept_interface< - ::boost::geometry::index::detail::single_pass_iterator_concept< - T, ValueType, Reference, Pointer, DifferenceType - >, Base, T> - : Base -{ - typedef ValueType value_type; - typedef Reference reference; - typedef Pointer pointer; - typedef DifferenceType difference_type; - typedef ::std::input_iterator_tag iterator_category; -}; - -}} // namespace boost::type_erasure - -#endif // BOOST_GEOMETRY_INDEX_DETAIL_TYPE_ERASED_ITERATORS_HPP diff --git a/include/boost/geometry/index/detail/varray.hpp b/include/boost/geometry/index/detail/varray.hpp index 9570c21ce..78b90bd7e 100644 --- a/include/boost/geometry/index/detail/varray.hpp +++ b/include/boost/geometry/index/detail/varray.hpp @@ -37,6 +37,7 @@ #include #include +#include /*! \defgroup varray_non_member varray non-member functions diff --git a/include/boost/geometry/index/detail/varray_detail.hpp b/include/boost/geometry/index/detail/varray_detail.hpp index 4e16cc97d..2298ef4ce 100644 --- a/include/boost/geometry/index/detail/varray_detail.hpp +++ b/include/boost/geometry/index/detail/varray_detail.hpp @@ -29,6 +29,8 @@ #include #include #include +#include +#include //#include //#include //#include @@ -409,12 +411,12 @@ struct has_nothrow_move : public template inline O uninitialized_move_if_noexcept_dispatch(I first, I last, O dst, boost::mpl::bool_ const& /*use_move*/) -{ return uninitialized_move(first, last, dst); } +{ return varray_detail::uninitialized_move(first, last, dst); } template inline O uninitialized_move_if_noexcept_dispatch(I first, I last, O dst, boost::mpl::bool_ const& /*use_move*/) -{ return uninitialized_copy(first, last, dst); } +{ return varray_detail::uninitialized_copy(first, last, dst); } template inline @@ -532,16 +534,16 @@ void construct(DisableTrivialInit const&, I pos) template inline -void construct_dispatch(I pos, V const& v, - boost::mpl::bool_ const& /*use_memcpy*/) +void construct_copy_dispatch(I pos, V const& v, + boost::mpl::bool_ const& /*use_memcpy*/) { ::memcpy(boost::addressof(*pos), boost::addressof(v), sizeof(V)); } template inline -void construct_dispatch(I pos, P const& p, - boost::mpl::bool_ const& /*use_memcpy*/) +void construct_copy_dispatch(I pos, P const& p, + boost::mpl::bool_ const& /*use_memcpy*/) { typedef typename boost::iterator_value::type V; new (static_cast(boost::addressof(*pos))) V(p); // may throw @@ -559,11 +561,28 @@ void construct(DisableTrivialInit const&, >::type use_memcpy; - construct_dispatch(pos, p, use_memcpy()); // may throw + construct_copy_dispatch(pos, p, use_memcpy()); // may throw } // Needed by push_back(V &&) +template +inline +void construct_move_dispatch(I pos, V const& v, + boost::mpl::bool_ const& /*use_memcpy*/) +{ + ::memcpy(boost::addressof(*pos), boost::addressof(v), sizeof(V)); +} + +template +inline +void construct_move_dispatch(I pos, BOOST_RV_REF(P) p, + boost::mpl::bool_ const& /*use_memcpy*/) +{ + typedef typename boost::iterator_value::type V; + new (static_cast(boost::addressof(*pos))) V(::boost::move(p)); // may throw +} + template inline void construct(DisableTrivialInit const&, I pos, BOOST_RV_REF(P) p) @@ -571,12 +590,11 @@ void construct(DisableTrivialInit const&, I pos, BOOST_RV_REF(P) p) typedef typename ::boost::mpl::and_< is_corresponding_value, - ::boost::has_trivial_copy

+ ::boost::has_trivial_move_constructor

>::type use_memcpy; - typedef typename boost::iterator_value::type V; - new (static_cast(boost::addressof(*pos))) V(::boost::move(p)); // may throw + construct_move_dispatch(pos, ::boost::move(p), use_memcpy()); // may throw } // Needed by emplace_back() and emplace() @@ -624,16 +642,17 @@ void construct(DisableTrivialInit const&, template inline -void assign_dispatch(I pos, V const& v, - boost::mpl::bool_ const& /*use_memcpy*/) +void assign_copy_dispatch(I pos, V const& v, + boost::mpl::bool_ const& /*use_memcpy*/) { +// TODO - use memmove here? ::memcpy(boost::addressof(*pos), boost::addressof(v), sizeof(V)); } template inline -void assign_dispatch(I pos, V const& v, - boost::mpl::bool_ const& /*use_memcpy*/) +void assign_copy_dispatch(I pos, V const& v, + boost::mpl::bool_ const& /*use_memcpy*/) { *pos = v; // may throw } @@ -649,16 +668,39 @@ void assign(I pos, V const& v) >::type use_memcpy; - assign_dispatch(pos, v, use_memcpy()); // may throw + assign_copy_dispatch(pos, v, use_memcpy()); // may throw +} + +template +inline +void assign_move_dispatch(I pos, V const& v, + boost::mpl::bool_ const& /*use_memcpy*/) +{ +// TODO - use memmove here? + ::memcpy(boost::addressof(*pos), boost::addressof(v), sizeof(V)); +} + +template +inline +void assign_move_dispatch(I pos, BOOST_RV_REF(V) v, + boost::mpl::bool_ const& /*use_memcpy*/) +{ + *pos = boost::move(v); // may throw } template inline void assign(I pos, BOOST_RV_REF(V) v) { - *pos = boost::move(v); // may throw -} + typedef typename + ::boost::mpl::and_< + is_corresponding_value, + ::boost::has_trivial_move_assign + >::type + use_memcpy; + assign_move_dispatch(pos, ::boost::move(v), use_memcpy()); +} // uninitialized_copy_s diff --git a/include/boost/geometry/index/predicates.hpp b/include/boost/geometry/index/predicates.hpp index 5bf88df05..ad6a537f0 100644 --- a/include/boost/geometry/index/predicates.hpp +++ b/include/boost/geometry/index/predicates.hpp @@ -24,8 +24,6 @@ namespace boost { namespace geometry { namespace index { -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL - /*! \brief Generate \c contains() predicate. @@ -51,8 +49,6 @@ contains(Geometry const& g) return detail::spatial_predicate(g); } -#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL - /*! \brief Generate \c covered_by() predicate. @@ -78,8 +74,6 @@ covered_by(Geometry const& g) return detail::spatial_predicate(g); } -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL - /*! \brief Generate \c covers() predicate. @@ -105,8 +99,6 @@ covers(Geometry const& g) return detail::spatial_predicate(g); } -#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL - /*! \brief Generate \c disjoint() predicate. diff --git a/include/boost/geometry/index/rtree.hpp b/include/boost/geometry/index/rtree.hpp index 018d508f6..6decfe70f 100644 --- a/include/boost/geometry/index/rtree.hpp +++ b/include/boost/geometry/index/rtree.hpp @@ -61,11 +61,11 @@ #include -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL #include -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_TYPE_ERASED_ITERATORS -#include -#endif + +#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL +// serialization +#include #endif // TODO change the name to bounding_tree @@ -98,13 +98,18 @@ Predefined algorithms with run-time parameters are: \li \c boost::geometry::index::dynamic_quadratic, \li \c boost::geometry::index::dynamic_rstar. -\par Translator -The Translator translates from Value to Indexable each time r-tree requires it. Which means that this -operation is done for each Value access. Therefore the Translator should return the Indexable by -const reference instead of a value. Default translator can translate all types adapted to Point +\par IndexableGetter +The object of IndexableGetter type translates from Value to Indexable each time r-tree requires it. Which means that this +operation is done for each Value access. Therefore the IndexableGetter should return the Indexable by +const reference instead of a value. Default one can translate all types adapted to Point or Box concepts (called Indexables). It also handles std::pair and boost::tuple. For example, if std::pair is stored in the -container, the default translator translates from std::pair const& to Box const&. +container, the default IndexableGetter translates from std::pair const& to Box const&. + +\par EqualTo +The object of EqualTo type compares Values and returns true if they're equal. It's similar to std::equal_to<>. +The default EqualTo returns the result of boost::geometry::equals() for types adapted to some Geometry concept +defined in Boost.Geometry and the result of operator= for other types. Components of Pairs and Tuples are compared left-to-right. \tparam Value The type of objects stored in the container. \tparam Parameters Compile-time parameters. @@ -166,8 +171,13 @@ private: typedef typename allocators_type::node_pointer node_pointer; typedef ::boost::container::allocator_traits allocator_traits_type; + typedef detail::rtree::node_auto_ptr node_auto_ptr; friend class detail::rtree::utilities::view; +#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL + friend class detail::rtree::private_view; + friend class detail::rtree::const_private_view; +#endif public: @@ -184,6 +194,9 @@ public: /*! \brief Unsigned integral type used by the container. */ typedef typename allocators_type::size_type size_type; + /*! \brief Type of const query iterator. */ + typedef index::detail::rtree::iterators::query_iterator const_query_iterator; + public: /*! @@ -223,6 +236,8 @@ public: /*! \brief The constructor. + The tree is created using packing algorithm. + \param first The beginning of the range of Values. \param last The end of the range of Values. \param parameters The parameters object. @@ -254,6 +269,8 @@ public: /*! \brief The constructor. + The tree is created using packing algorithm. + \param rng The range of Values. \param parameters The parameters object. \param getter The function object extracting Indexable from Value. @@ -682,14 +699,18 @@ public: Spatial predicates Spatial predicates may be generated by one of the functions listed below: + \li \c boost::geometry::index::contains(), \li \c boost::geometry::index::covered_by(), + \li \c boost::geometry::index::covers(), \li \c boost::geometry::index::disjoint(), \li \c boost::geometry::index::intersects(), \li \c boost::geometry::index::overlaps(), \li \c boost::geometry::index::within(), It is possible to negate spatial predicates: + \li ! boost::geometry::index::contains(), \li ! boost::geometry::index::covered_by(), + \li ! boost::geometry::index::covers(), \li ! boost::geometry::index::disjoint(), \li ! boost::geometry::index::intersects(), \li ! boost::geometry::index::overlaps(), @@ -726,6 +747,7 @@ public: \par Throws If Value copy constructor or copy assignment throws. + If predicates copy throws. \warning Only one \c nearest() perdicate may be passed to the query. Passing more of them results in compile-time error. @@ -748,44 +770,123 @@ public: return query_dispatch(predicates, out_it, boost::mpl::bool_()); } -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL + /*! + \brief Returns the query iterator pointing at the begin of the query range. -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_TYPE_ERASED_ITERATORS + This method returns the iterator which may be used to perform iterative queries. For the information + about the predicates which may be passed to this method see query(). + + \par Example + \verbatim + for ( Rtree::const_query_iterator it = tree.qbegin(bgi::nearest(pt, 10000)) ; + it != tree.qend() ; ++it ) + { + // do something with value + if ( has_enough_nearest_values() ) + break; + } + \endverbatim - // BEWARE! - // Don't use this type-erased iterator after assigning values returned by qbegin(Pred) and qend() - // e.g. don't pass them into the std::copy() or compare them like this: - // const_query_iterator i1 = qbegin(...); - // const_query_iterator i2 = qend(); - // i1 == i2; // BAM! - // now this will cause undefined behaviour. - // using native types is ok: - // qbegin(...) == qend(); + \par Throws + If predicates copy throws. + If allocation throws. - typedef typename index::detail::single_pass_iterator_type< - value_type, const_reference, const_pointer, difference_type - >::type const_query_iterator; + \param predicates Predicates. + + \return The iterator pointing at the begin of the query range. + */ + template + const_query_iterator qbegin(Predicates const& predicates) const + { + return const_query_iterator(qbegin_(predicates)); + } -#endif // BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_TYPE_ERASED_ITERATORS + /*! + \brief Returns the query iterator pointing at the end of the query range. + This method returns the iterator which may be used to check if the query has ended. + + \par Example + \verbatim + for ( Rtree::const_query_iterator it = tree.qbegin(bgi::nearest(pt, 10000)) ; + it != tree.qend() ; ++it ) + { + // do something with value + if ( has_enough_nearest_values() ) + break; + } + \endverbatim + + \par Throws + Nothing + + \return The iterator pointing at the end of the query range. + */ + const_query_iterator qend() const + { + return const_query_iterator(); + } + +#ifndef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL +private: +#endif + /*! + \brief Returns the query iterator pointing at the begin of the query range. + + This method returns the iterator which may be used to perform iterative queries. For the information + about the predicates which may be passed to this method see query(). + + The type of the returned iterator depends on the type of passed Predicates but the iterator of this type + may be assigned to the variable of const_query_iterator type. If you'd like to use the type of the iterator + returned by this method you may get the type e.g. by using C++11 decltype or Boost.Typeof library. + This iterator may be compared with iterators returned by both versions of qend() method. + + \par Example + \verbatim + // Store the result in the container using std::copy() - it requires both iterators of the same type + std::copy(tree.qbegin(bgi::intersects(box)), tree.qend(bgi::intersects(box)), std::back_inserter(result)); + + // Store the result in the container using std::copy() and type-erased iterators + Rtree::const_query_iterator first = tree.qbegin(bgi::intersects(box)); + Rtree::const_query_iterator last = tree.qend(); + std::copy(first, last, std::back_inserter(result)); + + // Boost.Typeof + typedef BOOST_TYPEOF(tree.qbegin(bgi::nearest(pt, 10000))) Iter; + for ( Iter it = tree.qbegin(bgi::nearest(pt, 10000)) ; it != tree.qend() ; ++it ) + { + // do something with value + if ( has_enough_nearest_values() ) + break; + } + \endverbatim + + \par Throws + If predicates copy throws. + If allocation throws. + + \param predicates Predicates. + + \return The iterator pointing at the begin of the query range. + */ template typename boost::mpl::if_c< detail::predicates_count_distance::value == 0, - detail::rtree::spatial_query_iterator, - detail::rtree::distance_query_iterator< + detail::rtree::iterators::spatial_query_iterator, + detail::rtree::iterators::distance_query_iterator< value_type, options_type, translator_type, box_type, allocators_type, Predicates, detail::predicates_find_distance::value > >::type - qbegin(Predicates const& predicates) const + qbegin_(Predicates const& predicates) const { static const unsigned distance_predicates_count = detail::predicates_count_distance::value; BOOST_MPL_ASSERT_MSG((distance_predicates_count <= 1), PASS_ONLY_ONE_DISTANCE_PREDICATE, (Predicates)); typedef typename boost::mpl::if_c< detail::predicates_count_distance::value == 0, - detail::rtree::spatial_query_iterator, - detail::rtree::distance_query_iterator< + detail::rtree::iterators::spatial_query_iterator, + detail::rtree::iterators::distance_query_iterator< value_type, options_type, translator_type, box_type, allocators_type, Predicates, detail::predicates_find_distance::value > @@ -797,24 +898,50 @@ public: return iterator_type(m_members.root, m_members.translator(), predicates); } + /*! + \brief Returns the query iterator pointing at the end of the query range. + + This method returns the iterator which may be used to perform iterative queries. For the information + about the predicates which may be passed to this method see query(). + + The type of the returned iterator depends on the type of passed Predicates but the iterator of this type + may be assigned to the variable of const_query_iterator type. If you'd like to use the type of the iterator + returned by this method you may get the type e.g. by using C++11 decltype or Boost.Typeof library. + + The type of the iterator returned by this method is the same as the one returned by qbegin() to which + the same predicates were passed. + + \par Example + \verbatim + // Store the result in the container using std::copy() - it requires both iterators of the same type + std::copy(tree.qbegin(bgi::intersects(box)), tree.qend(bgi::intersects(box)), std::back_inserter(result)); + \endverbatim + + \par Throws + If predicates copy throws. + + \param predicates Predicates. + + \return The iterator pointing at the end of the query range. + */ template typename boost::mpl::if_c< detail::predicates_count_distance::value == 0, - detail::rtree::spatial_query_iterator, - detail::rtree::distance_query_iterator< + detail::rtree::iterators::spatial_query_iterator, + detail::rtree::iterators::distance_query_iterator< value_type, options_type, translator_type, box_type, allocators_type, Predicates, detail::predicates_find_distance::value > >::type - qend(Predicates const& predicates) const + qend_(Predicates const& predicates) const { static const unsigned distance_predicates_count = detail::predicates_count_distance::value; BOOST_MPL_ASSERT_MSG((distance_predicates_count <= 1), PASS_ONLY_ONE_DISTANCE_PREDICATE, (Predicates)); typedef typename boost::mpl::if_c< detail::predicates_count_distance::value == 0, - detail::rtree::spatial_query_iterator, - detail::rtree::distance_query_iterator< + detail::rtree::iterators::spatial_query_iterator, + detail::rtree::iterators::distance_query_iterator< value_type, options_type, translator_type, box_type, allocators_type, Predicates, detail::predicates_find_distance::value > @@ -823,13 +950,48 @@ public: return iterator_type(m_members.translator(), predicates); } - detail::rtree::end_query_iterator - qend() const + /*! + \brief Returns the query iterator pointing at the end of the query range. + + This method returns the iterator which may be compared with the iterator returned by qbegin() in order to + check if the query has ended. + + The type of the returned iterator is different than the type returned by qbegin() but the iterator of this type + may be assigned to the variable of const_query_iterator type. If you'd like to use the type of the iterator returned by this + method, which most certainly will be faster than the type-erased iterator, you may get the type + e.g. by using C++11 decltype or Boost.Typeof library. + + The type of the iterator returned by this method is dfferent than the type returned by qbegin(). + + \par Example + \verbatim + // Store the result in the container using std::copy() and type-erased iterators + Rtree::const_query_iterator first = tree.qbegin(bgi::intersects(box)); + Rtree::const_query_iterator last = tree.qend(); + std::copy(first, last, std::back_inserter(result)); + + // Boost.Typeof + typedef BOOST_TYPEOF(tree.qbegin(bgi::nearest(pt, 10000))) Iter; + for ( Iter it = tree.qbegin(bgi::nearest(pt, 10000)) ; it != tree.qend() ; ++it ) { - return detail::rtree::end_query_iterator(); + // do something with value + if ( has_enough_nearest_values() ) + break; + } + \endverbatim + + \par Throws + Nothing + + \return The iterator pointing at the end of the query range. + */ + detail::rtree::iterators::end_query_iterator + qend_() const + { + return detail::rtree::iterators::end_query_iterator(); } -#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL +public: /*! \brief Returns the number of stored values. @@ -1155,6 +1317,7 @@ private: dst.m_members.parameters() = src.m_members.parameters(); } + // TODO use node_auto_ptr if ( dst.m_members.root ) { detail::rtree::visitors::destroy @@ -1393,14 +1556,18 @@ Values will be returned only if all predicates are met. Spatial predicates Spatial predicates may be generated by one of the functions listed below: +\li \c boost::geometry::index::contains(), \li \c boost::geometry::index::covered_by(), +\li \c boost::geometry::index::covers(), \li \c boost::geometry::index::disjoint(), \li \c boost::geometry::index::intersects(), \li \c boost::geometry::index::overlaps(), \li \c boost::geometry::index::within(), It is possible to negate spatial predicates: +\li ! boost::geometry::index::contains(), \li ! boost::geometry::index::covered_by(), +\li ! boost::geometry::index::covers(), \li ! boost::geometry::index::disjoint(), \li ! boost::geometry::index::intersects(), \li ! boost::geometry::index::overlaps(), @@ -1459,6 +1626,75 @@ query(rtree const& tree, return tree.query(predicates, out_it); } +/*! +\brief Returns the query iterator pointing at the begin of the query range. + +This method returns the iterator which may be used to perform iterative queries. For the information +about the predicates which may be passed to this method see query(). + +\par Example +\verbatim + +for ( Rtree::const_query_iterator it = qbegin(tree, bgi::nearest(pt, 10000)) ; + it != qend(tree) ; ++it ) +{ + // do something with value + if ( has_enough_nearest_values() ) + break; +} +\endverbatim + +\par Throws +If predicates copy throws. +If allocation throws. + +\ingroup rtree_functions + +\param tree The rtree. +\param predicates Predicates. + +\return The iterator pointing at the begin of the query range. +*/ +template inline +typename rtree::const_query_iterator +qbegin(rtree const& tree, + Predicates const& predicates) +{ + return tree.qbegin(predicates); +} + +/*! +\brief Returns the query iterator pointing at the end of the query range. + +This method returns the iterator which may be used to check if the query has ended. + +\par Example +\verbatim + +for ( Rtree::const_query_iterator it = qbegin(tree, bgi::nearest(pt, 10000)) ; + it != qend(tree) ; ++it ) +{ + // do something with value + if ( has_enough_nearest_values() ) + break; +} +\endverbatim + +\par Throws +Nothing + +\ingroup rtree_functions + +\return The iterator pointing at the end of the query range. +*/ +template inline +typename rtree::const_query_iterator +qend(rtree const& tree) +{ + return tree.qend(); +} + /*! \brief Remove all values from the index. diff --git a/include/boost/geometry/io/svg/svg_mapper.hpp b/include/boost/geometry/io/svg/svg_mapper.hpp index 1252cc806..fbe0a37da 100644 --- a/include/boost/geometry/io/svg/svg_mapper.hpp +++ b/include/boost/geometry/io/svg/svg_mapper.hpp @@ -226,10 +226,17 @@ inline void svg_map(std::ostream& stream, template class svg_mapper : boost::noncopyable { + typedef typename geometry::select_most_precise + < + typename coordinate_type::type, + double + >::type calculation_type; + typedef strategy::transform::map_transformer < - Point, - detail::svg::svg_point_type, + calculation_type, + geometry::dimension::type::value, + geometry::dimension::type::value, true, SameScale > transformer_type; @@ -247,6 +254,7 @@ class svg_mapper : boost::noncopyable m_matrix.reset(new transformer_type(m_bounding_box, m_width, m_height)); + m_stream << "" << std::endl << "" + << "xmlns=\"http://www.w3.org/2000/svg\"" + << std::endl + << "xmlns:xlink=\"http://www.w3.org/1999/xlink\"" + << ">" << std::endl; } } @@ -319,18 +330,6 @@ public : void map(Geometry const& geometry, std::string const& style, int size = -1) { - BOOST_MPL_ASSERT_MSG - ( - ( boost::is_same - < - Point, - typename point_type::type - >::value ) - , POINT_TYPES_ARE_NOT_SAME_FOR_MAPPER_AND_MAP - , (types::type>) - ); - - init_matrix(); svg_map(m_stream, style, size, geometry, *m_matrix); } diff --git a/include/boost/geometry/multi/algorithms/distance.hpp b/include/boost/geometry/multi/algorithms/distance.hpp index 32b41fcef..92352d5fe 100644 --- a/include/boost/geometry/multi/algorithms/distance.hpp +++ b/include/boost/geometry/multi/algorithms/distance.hpp @@ -45,7 +45,12 @@ struct distance_single_to_multi Strategy > { - typedef typename strategy::distance::services::return_type::type return_type; + typedef typename strategy::distance::services::return_type + < + Strategy, + typename point_type::type, + typename point_type::type + >::type return_type; static inline return_type apply(Geometry const& geometry, MultiGeometry const& multi, @@ -84,7 +89,12 @@ struct distance_multi_to_multi Strategy > { - typedef typename strategy::distance::services::return_type::type return_type; + typedef typename strategy::distance::services::return_type + < + Strategy, + typename point_type::type, + typename point_type::type + >::type return_type; static inline return_type apply(Multi1 const& multi1, Multi2 const& multi2, Strategy const& strategy) diff --git a/include/boost/geometry/multi/geometries/concepts/multi_linestring_concept.hpp b/include/boost/geometry/multi/geometries/concepts/multi_linestring_concept.hpp index b0519f07e..d232fa8c8 100644 --- a/include/boost/geometry/multi/geometries/concepts/multi_linestring_concept.hpp +++ b/include/boost/geometry/multi/geometries/concepts/multi_linestring_concept.hpp @@ -53,6 +53,11 @@ public : BOOST_CONCEPT_USAGE(MultiLinestring) { + Geometry* mls = 0; + traits::clear::apply(*mls); + traits::resize::apply(*mls, 0); + linestring_type* ls = 0; + traits::push_back::apply(*mls, *ls); } #endif }; diff --git a/include/boost/geometry/multi/geometries/concepts/multi_point_concept.hpp b/include/boost/geometry/multi/geometries/concepts/multi_point_concept.hpp index f5942df07..7d04248a5 100644 --- a/include/boost/geometry/multi/geometries/concepts/multi_point_concept.hpp +++ b/include/boost/geometry/multi/geometries/concepts/multi_point_concept.hpp @@ -52,6 +52,11 @@ public : BOOST_CONCEPT_USAGE(MultiPoint) { + Geometry* mp = 0; + traits::clear::apply(*mp); + traits::resize::apply(*mp, 0); + point_type* point = 0; + traits::push_back::apply(*mp, *point); } #endif }; diff --git a/include/boost/geometry/multi/geometries/concepts/multi_polygon_concept.hpp b/include/boost/geometry/multi/geometries/concepts/multi_polygon_concept.hpp index ca730d4f6..ec37ef15a 100644 --- a/include/boost/geometry/multi/geometries/concepts/multi_polygon_concept.hpp +++ b/include/boost/geometry/multi/geometries/concepts/multi_polygon_concept.hpp @@ -52,6 +52,11 @@ public : BOOST_CONCEPT_USAGE(MultiPolygon) { + Geometry* mp = 0; + traits::clear::apply(*mp); + traits::resize::apply(*mp, 0); + polygon_type* poly = 0; + traits::push_back::apply(*mp, *poly); } #endif }; diff --git a/include/boost/geometry/multi/io/wkt/read.hpp b/include/boost/geometry/multi/io/wkt/read.hpp index 2bfa830cf..c72f5e128 100644 --- a/include/boost/geometry/multi/io/wkt/read.hpp +++ b/include/boost/geometry/multi/io/wkt/read.hpp @@ -49,7 +49,7 @@ struct multi_parser Parser < typename boost::range_value::type - >::apply(it, tokens.end(), wkt, geometry.back()); + >::apply(it, tokens.end(), wkt, *(boost::end(geometry) - 1)); if (it != tokens.end() && *it == ",") { // Skip "," after multi-element is parsed @@ -101,14 +101,14 @@ struct multi_point_parser point_parser < typename boost::range_value::type - >::apply(it, tokens.end(), wkt, geometry.back()); + >::apply(it, tokens.end(), wkt, *(boost::end(geometry) - 1)); } else { noparenthesis_point_parser < typename boost::range_value::type - >::apply(it, tokens.end(), wkt, geometry.back()); + >::apply(it, tokens.end(), wkt, *(boost::end(geometry) - 1)); } if (it != tokens.end() && *it == ",") diff --git a/include/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp b/include/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp index 8825791db..f59fa55d6 100644 --- a/include/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp +++ b/include/boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp @@ -74,9 +74,6 @@ namespace detail \ingroup strategies \details The douglas_peucker strategy simplifies a linestring, ring or vector of points using the well-known Douglas-Peucker algorithm. - For the algorithm, see for example: -\see http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm -\see http://www2.dcs.hull.ac.uk/CISRG/projects/Royal-Inst/demos/dp.html \tparam Point the point type \tparam PointDistanceStrategy point-segment distance strategy to be used \note This strategy uses itself a point-segment-distance strategy which @@ -84,6 +81,12 @@ namespace detail \author Barend and Maarten, 1995/1996 \author Barend, revised for Generic Geometry Library, 2008 */ + +/* +For the algorithm, see for example: + - http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm + - http://www2.dcs.hull.ac.uk/CISRG/projects/Royal-Inst/demos/dp.html +*/ template < typename Point, @@ -99,7 +102,11 @@ public : typedef PointDistanceStrategy distance_strategy_type; // typedef typename strategy::distance::services::comparable_type::type distance_strategy_type; - typedef typename strategy::distance::services::return_type::type return_type; + typedef typename strategy::distance::services::return_type + < + distance_strategy_type, + Point, Point + >::type return_type; private : typedef detail::douglas_peucker_point dp_point_type; @@ -197,8 +204,6 @@ public : // Get points, recursively, including them if they are further away // than the specified distance - typedef typename strategy::distance::services::return_type::type return_type; - consider(boost::begin(ref_candidates), boost::end(ref_candidates), max_distance, n, strategy); // Copy included elements to the output @@ -224,6 +229,17 @@ public : }} // namespace strategy::simplify +namespace traits { + +template +struct point_type > +{ + typedef P type; +}; + +} // namespace traits + + }} // namespace boost::geometry #endif // BOOST_GEOMETRY_STRATEGY_AGNOSTIC_SIMPLIFY_DOUGLAS_PEUCKER_HPP diff --git a/include/boost/geometry/strategies/cartesian/cart_intersect.hpp b/include/boost/geometry/strategies/cartesian/cart_intersect.hpp index 678e9d7c2..9680f6a4f 100644 --- a/include/boost/geometry/strategies/cartesian/cart_intersect.hpp +++ b/include/boost/geometry/strategies/cartesian/cart_intersect.hpp @@ -1,6 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -746,8 +747,6 @@ private : }} // namespace strategy::intersection - - }} // namespace boost::geometry diff --git a/include/boost/geometry/strategies/cartesian/centroid_bashein_detmer.hpp b/include/boost/geometry/strategies/cartesian/centroid_bashein_detmer.hpp index 8b42715e0..f199fb80e 100644 --- a/include/boost/geometry/strategies/cartesian/centroid_bashein_detmer.hpp +++ b/include/boost/geometry/strategies/cartesian/centroid_bashein_detmer.hpp @@ -38,17 +38,26 @@ namespace strategy { namespace centroid /*! -\brief Centroid calculation using algorith Bashein / Detmer +\brief Centroid calculation using algorithm Bashein / Detmer \ingroup strategies \details Calculates centroid using triangulation method published by Bashein / Detmer \tparam Point point type of centroid to calculate \tparam PointOfSegment point type of segments, defaults to Point -\par Concepts for Point and PointOfSegment: -- specialized point_traits class +\tparam CalculationType \tparam_calculation + \author Adapted from "Centroid of a Polygon" by Gerard Bashein and Paul R. Detmer, in "Graphics Gems IV", Academic Press, 1994 + + +\qbk{ +[heading See also] +[link geometry.reference.algorithms.centroid.centroid_3_with_strategy centroid (with strategy)] +} +*/ + +/* \par Research notes The algorithm gives the same results as Oracle and PostGIS but differs from MySQL @@ -100,12 +109,6 @@ Statements: , mdsys.sdo_dim_array(mdsys.sdo_dim_element('x',0,10,.00000005) ,mdsys.sdo_dim_element('y',0,10,.00000005))) from dual - -\qbk{ -[heading See also] -[link geometry.reference.algorithms.centroid.centroid_3_with_strategy centroid (with strategy)] -} - */ template < @@ -151,9 +154,7 @@ private : , sum_a2(calculation_type()) , sum_x(calculation_type()) , sum_y(calculation_type()) - { - typedef calculation_type ct; - } + {} }; public : diff --git a/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp b/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp index 9cff4d8af..620b5bf4c 100644 --- a/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp @@ -50,8 +50,6 @@ namespace strategy { namespace distance \ingroup strategies \details Calculates distance using projected-point method, and (optionally) Pythagoras \author Adapted from: http://geometryalgorithms.com/Archive/algorithm_0102/algorithm_0102.htm -\tparam Point \tparam_point -\tparam PointOfSegment \tparam_segment_point \tparam CalculationType \tparam_calculation \tparam Strategy underlying point-point distance strategy \par Concepts for Strategy: @@ -67,10 +65,8 @@ namespace strategy { namespace distance */ template < - typename Point, - typename PointOfSegment = Point, typename CalculationType = void, - typename Strategy = pythagoras + typename Strategy = pythagoras > class projected_point { @@ -81,45 +77,41 @@ public : // Integer coordinates can still result in FP distances. // There is a division, which must be represented in FP. // So promote. - typedef typename promote_floating_point - < - typename strategy::distance::services::return_type - < - Strategy - >::type - >::type calculation_type; - -private : - - // A projected point of points in Integer coordinates must be able to be - // represented in FP. - typedef model::point - < - calculation_type, - dimension::value, - typename coordinate_system::type - > fp_point_type; - - // For convenience - typedef fp_point_type fp_vector_type; - - // We have to use a strategy using FP coordinates (fp-type) which is - // not always the same as Strategy (defined as point_strategy_type) - // So we create a "similar" one - typedef typename strategy::distance::services::similar_type - < - Strategy, - Point, - fp_point_type - >::type fp_strategy_type; + template + struct calculation_type + : promote_floating_point + < + typename strategy::distance::services::return_type + < + Strategy, + Point, + PointOfSegment + >::type + > + {}; public : - inline calculation_type apply(Point const& p, - PointOfSegment const& p1, PointOfSegment const& p2) const + template + inline typename calculation_type::type + apply(Point const& p, PointOfSegment const& p1, PointOfSegment const& p2) const { assert_dimension_equal(); + typedef typename calculation_type::type calculation_type; + + // A projected point of points in Integer coordinates must be able to be + // represented in FP. + typedef model::point + < + calculation_type, + dimension::value, + typename coordinate_system::type + > fp_point_type; + + // For convenience + typedef fp_point_type fp_vector_type; + /* Algorithm [p1: (x1,y1), p2: (x2,y2), p: (px,py)] VECTOR v(x2 - x1, y2 - y1) @@ -157,21 +149,12 @@ public : // See above, c1 > 0 AND c2 > c1 so: c2 != 0 calculation_type const b = c1 / c2; - fp_strategy_type fp_strategy - = strategy::distance::services::get_similar - < - Strategy, Point, fp_point_type - >::apply(strategy); - boost::ignore_unused_variable_warning(fp_strategy); - fp_point_type projected; geometry::convert(p1, projected); multiply_value(v, b); add_point(projected, v); - //std::cout << "distance " << dsv(p) << " .. " << dsv(projected) << std::endl; - - return fp_strategy.apply(p, projected); + return strategy.apply(p, projected); } }; @@ -179,103 +162,64 @@ public : namespace services { -template -struct tag > +template +struct tag > { typedef strategy_tag_distance_point_segment type; }; -template -struct return_type > -{ - typedef typename projected_point::calculation_type type; -}; +template +struct return_type, P, PS> + : projected_point::template calculation_type +{}; -template -struct strategy_point_point > +template +struct strategy_point_point > { typedef Strategy type; }; -template -< - typename Point, - typename PointOfSegment, - typename CalculationType, - typename Strategy, - typename P1, - typename P2 -> -struct similar_type, P1, P2> -{ - typedef projected_point type; -}; - - -template -< - typename Point, - typename PointOfSegment, - typename CalculationType, - typename Strategy, - typename P1, - typename P2 -> -struct get_similar, P1, P2> -{ - static inline typename similar_type - < - projected_point, P1, P2 - >::type apply(projected_point const& ) - { - return projected_point(); - } -}; - - -template -struct comparable_type > +template +struct comparable_type > { // Define a projected_point strategy with its underlying point-point-strategy // being comparable typedef projected_point < - Point, - PointOfSegment, CalculationType, typename comparable_type::type > type; }; -template -struct get_comparable > +template +struct get_comparable > { typedef typename comparable_type < - projected_point + projected_point >::type comparable_type; public : - static inline comparable_type apply(projected_point const& ) + static inline comparable_type apply(projected_point const& ) { return comparable_type(); } }; -template -struct result_from_distance > +template +struct result_from_distance, P, PS> { private : - typedef typename return_type >::type return_type; + typedef typename return_type, P, PS>::type return_type; public : template - static inline return_type apply(projected_point const& , T const& value) + static inline return_type apply(projected_point const& , T const& value) { Strategy s; - return result_from_distance::apply(s, value); + return result_from_distance::apply(s, value); } }; @@ -290,8 +234,6 @@ struct default_strategy +template struct compute_pythagoras { + template static inline T apply(Point1 const& p1, Point2 const& p2) { T const c1 = boost::numeric_cast(get(p1)); T const c2 = boost::numeric_cast(get(p2)); T const d = c1 - c2; - return d * d + compute_pythagoras::apply(p1, p2); + return d * d + compute_pythagoras::apply(p1, p2); } }; -template -struct compute_pythagoras +template +struct compute_pythagoras<0, T> { + template static inline T apply(Point1 const&, Point2 const&) { return boost::numeric_cast(0); @@ -72,24 +74,24 @@ namespace comparable \tparam Point2 \tparam_second_point \tparam CalculationType \tparam_calculation */ -template -< - typename Point1, - typename Point2 = Point1, - typename CalculationType = void -> +template class pythagoras { public : - typedef typename util::calculation_type::geometric::binary - < - Point1, - Point2, - CalculationType - >::type calculation_type; + template + struct calculation_type + : util::calculation_type::geometric::binary + < + Point1, + Point2, + CalculationType + > + {}; - static inline calculation_type apply(Point1 const& p1, Point2 const& p2) + template + static inline typename calculation_type::type + apply(Point1 const& p1, Point2 const& p2) { BOOST_CONCEPT_ASSERT( (concept::ConstPoint) ); BOOST_CONCEPT_ASSERT( (concept::ConstPoint) ); @@ -101,9 +103,8 @@ public : return detail::compute_pythagoras < - Point1, Point2, dimension::value, - calculation_type + typename calculation_type::type >::apply(p1, p2); } }; @@ -114,8 +115,6 @@ public : /*! \brief Strategy to calculate the distance between two points \ingroup strategies -\tparam Point1 \tparam_first_point -\tparam Point2 \tparam_second_point \tparam CalculationType \tparam_calculation \qbk{ @@ -128,22 +127,23 @@ public : */ template < - typename Point1, - typename Point2 = Point1, typename CalculationType = void > class pythagoras { - typedef comparable::pythagoras comparable_type; public : - typedef typename util::calculation_type::geometric::binary - < - Point1, - Point2, - CalculationType, - double, - double // promote integer to double - >::type calculation_type; + + template + struct calculation_type + : util::calculation_type::geometric::binary + < + P1, + P2, + CalculationType, + double, + double // promote integer to double + > + {}; /*! \brief applies the distance calculation using pythagoras @@ -151,10 +151,18 @@ public : \param p1 first point \param p2 second point */ - static inline calculation_type apply(Point1 const& p1, Point2 const& p2) + template + static inline typename calculation_type::type + apply(P1 const& p1, P2 const& p2) { - calculation_type const t = comparable_type::apply(p1, p2); - return sqrt(t); + // The cast is necessary for MSVC which considers sqrt __int64 as an ambiguous call + return std::sqrt + ( + boost::numeric_cast::type> + ( + comparable::pythagoras::apply(p1, p2) + ) + ); } }; @@ -163,81 +171,46 @@ public : namespace services { -template -struct tag > +template +struct tag > { typedef strategy_tag_distance_point_point type; }; -template -struct return_type > +template +struct return_type, P1, P2> + : pythagoras::template calculation_type +{}; + + +template +struct comparable_type > { - typedef typename pythagoras::calculation_type type; + typedef comparable::pythagoras type; }; -template -< - typename Point1, - typename Point2, - typename CalculationType, - typename P1, - typename P2 -> -struct similar_type, P1, P2> +template +struct get_comparable > { - typedef pythagoras type; -}; - - -template -< - typename Point1, - typename Point2, - typename CalculationType, - typename P1, - typename P2 -> -struct get_similar, P1, P2> -{ - static inline typename similar_type - < - pythagoras, P1, P2 - >::type apply(pythagoras const& ) - { - return pythagoras(); - } -}; - - -template -struct comparable_type > -{ - typedef comparable::pythagoras type; -}; - - -template -struct get_comparable > -{ - typedef comparable::pythagoras comparable_type; + typedef comparable::pythagoras comparable_type; public : - static inline comparable_type apply(pythagoras const& ) + static inline comparable_type apply(pythagoras const& ) { return comparable_type(); } }; -template -struct result_from_distance > +template +struct result_from_distance, Point1, Point2> { private : - typedef typename return_type >::type return_type; + typedef typename return_type, Point1, Point2>::type return_type; public : template - static inline return_type apply(pythagoras const& , T const& value) + static inline return_type apply(pythagoras const& , T const& value) { return return_type(value); } @@ -245,83 +218,48 @@ public : // Specializations for comparable::pythagoras -template -struct tag > +template +struct tag > { typedef strategy_tag_distance_point_point type; }; -template -struct return_type > +template +struct return_type, P1, P2> + : comparable::pythagoras::template calculation_type +{}; + + + + +template +struct comparable_type > { - typedef typename comparable::pythagoras::calculation_type type; + typedef comparable::pythagoras type; }; - - -template -< - typename Point1, - typename Point2, - typename CalculationType, - typename P1, - typename P2 -> -struct similar_type, P1, P2> +template +struct get_comparable > { - typedef comparable::pythagoras type; -}; - - -template -< - typename Point1, - typename Point2, - typename CalculationType, - typename P1, - typename P2 -> -struct get_similar, P1, P2> -{ - static inline typename similar_type - < - comparable::pythagoras, P1, P2 - >::type apply(comparable::pythagoras const& ) - { - return comparable::pythagoras(); - } -}; - - -template -struct comparable_type > -{ - typedef comparable::pythagoras type; -}; - - -template -struct get_comparable > -{ - typedef comparable::pythagoras comparable_type; + typedef comparable::pythagoras comparable_type; public : - static inline comparable_type apply(comparable::pythagoras const& ) + static inline comparable_type apply(comparable::pythagoras const& ) { return comparable_type(); } }; -template -struct result_from_distance > +template +struct result_from_distance, Point1, Point2> { private : - typedef typename return_type >::type return_type; + typedef typename return_type, Point1, Point2>::type return_type; public : template - static inline return_type apply(comparable::pythagoras const& , T const& value) + static inline return_type apply(comparable::pythagoras const& , T const& value) { return_type const v = value; return v * v; @@ -332,7 +270,7 @@ public : template struct default_strategy { - typedef pythagoras type; + typedef pythagoras<> type; }; diff --git a/include/boost/geometry/strategies/concepts/distance_concept.hpp b/include/boost/geometry/strategies/concepts/distance_concept.hpp index ba347d015..5d8cfb690 100644 --- a/include/boost/geometry/strategies/concepts/distance_concept.hpp +++ b/include/boost/geometry/strategies/concepts/distance_concept.hpp @@ -23,6 +23,7 @@ #include #include +#include namespace boost { namespace geometry { namespace concept @@ -33,7 +34,7 @@ namespace boost { namespace geometry { namespace concept \brief Checks strategy for point-segment-distance \ingroup distance */ -template +template struct PointDistanceStrategy { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS @@ -42,7 +43,7 @@ private : struct checker { template - static void apply(ApplyMethod const&) + static void apply(ApplyMethod) { // 1: inspect and define both arguments of apply typedef typename parameter_type_of @@ -55,66 +56,44 @@ private : ApplyMethod, 1 >::type ptype2; - // 2) check if apply-arguments fulfill point concept - BOOST_CONCEPT_ASSERT - ( - (concept::ConstPoint) - ); - - BOOST_CONCEPT_ASSERT - ( - (concept::ConstPoint) - ); - - - // 3) must define meta-function return_type - typedef typename strategy::distance::services::return_type::type rtype; - - // 4) must define meta-function "similar_type" - typedef typename strategy::distance::services::similar_type + // 2) must define meta-function return_type + typedef typename strategy::distance::services::return_type < - Strategy, ptype2, ptype1 - >::type stype; + Strategy, ptype1, ptype2 + >::type rtype; - // 5) must define meta-function "comparable_type" + // 3) must define meta-function "comparable_type" typedef typename strategy::distance::services::comparable_type < Strategy >::type ctype; - // 6) must define meta-function "tag" + // 4) must define meta-function "tag" typedef typename strategy::distance::services::tag < Strategy >::type tag; - // 7) must implement apply with arguments + // 5) must implement apply with arguments Strategy* str = 0; ptype1 *p1 = 0; ptype2 *p2 = 0; rtype r = str->apply(*p1, *p2); - // 8) must define (meta)struct "get_similar" with apply - stype s = strategy::distance::services::get_similar - < - Strategy, - ptype2, ptype1 - >::apply(*str); - - // 9) must define (meta)struct "get_comparable" with apply + // 6) must define (meta)struct "get_comparable" with apply ctype c = strategy::distance::services::get_comparable < Strategy >::apply(*str); - // 10) must define (meta)struct "result_from_distance" with apply + // 7) must define (meta)struct "result_from_distance" with apply r = strategy::distance::services::result_from_distance < - Strategy + Strategy, + ptype1, ptype2 >::apply(*str, 1.0); boost::ignore_unused_variable_warning(str); - boost::ignore_unused_variable_warning(s); boost::ignore_unused_variable_warning(c); boost::ignore_unused_variable_warning(r); } @@ -125,7 +104,7 @@ private : public : BOOST_CONCEPT_USAGE(PointDistanceStrategy) { - checker::apply(&Strategy::apply); + checker::apply(&Strategy::template apply); } #endif }; @@ -135,7 +114,7 @@ public : \brief Checks strategy for point-segment-distance \ingroup strategy_concepts */ -template +template struct PointSegmentDistanceStrategy { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS @@ -144,7 +123,7 @@ private : struct checker { template - static void apply(ApplyMethod const&) + static void apply(ApplyMethod) { typedef typename parameter_type_of < @@ -156,26 +135,14 @@ private : ApplyMethod, 1 >::type sptype; - // 2) check if apply-arguments fulfill point concept - BOOST_CONCEPT_ASSERT - ( - (concept::ConstPoint) - ); + // 1) must define meta-function return_type + typedef typename strategy::distance::services::return_type::type rtype; - BOOST_CONCEPT_ASSERT - ( - (concept::ConstPoint) - ); - - - // 3) must define meta-function return_type - typedef typename strategy::distance::services::return_type::type rtype; - - // 4) must define underlying point-distance-strategy + // 2) must define underlying point-distance-strategy typedef typename strategy::distance::services::strategy_point_point::type stype; BOOST_CONCEPT_ASSERT ( - (concept::PointDistanceStrategy) + (concept::PointDistanceStrategy) ); @@ -194,7 +161,7 @@ private : public : BOOST_CONCEPT_USAGE(PointSegmentDistanceStrategy) { - checker::apply(&Strategy::apply); + checker::apply(&Strategy::template apply); } #endif }; diff --git a/include/boost/geometry/strategies/concepts/simplify_concept.hpp b/include/boost/geometry/strategies/concepts/simplify_concept.hpp index 92e5156b5..e1506e884 100644 --- a/include/boost/geometry/strategies/concepts/simplify_concept.hpp +++ b/include/boost/geometry/strategies/concepts/simplify_concept.hpp @@ -19,6 +19,7 @@ #include +#include #include @@ -30,7 +31,7 @@ namespace boost { namespace geometry { namespace concept \brief Checks strategy for simplify \ingroup simplify */ -template +template struct SimplifyStrategy { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS @@ -44,7 +45,7 @@ private : struct checker { template - static void apply(ApplyMethod const&) + static void apply(ApplyMethod) { namespace ft = boost::function_types; typedef typename ft::parameter_types @@ -59,29 +60,14 @@ private : boost::mpl::int_<0> >::type base_index; - // 1: inspect and define both arguments of apply - typedef typename boost::remove_const - < - typename boost::remove_reference - < - typename boost::mpl::at - < - parameter_types, - base_index - >::type - >::type - >::type point_type; - - - BOOST_CONCEPT_ASSERT ( - (concept::PointSegmentDistanceStrategy) + (concept::PointSegmentDistanceStrategy) ); Strategy *str = 0; - std::vector const* v1 = 0; - std::vector * v2 = 0; + std::vector const* v1 = 0; + std::vector * v2 = 0; // 2) must implement method apply with arguments // - Range @@ -96,8 +82,7 @@ private : public : BOOST_CONCEPT_USAGE(SimplifyStrategy) { - checker::apply(&ds_type::apply); - + checker::apply(&ds_type::template apply); } #endif }; diff --git a/include/boost/geometry/strategies/default_distance_result.hpp b/include/boost/geometry/strategies/default_distance_result.hpp index ea5f3ff76..74ce495d3 100644 --- a/include/boost/geometry/strategies/default_distance_result.hpp +++ b/include/boost/geometry/strategies/default_distance_result.hpp @@ -39,7 +39,9 @@ struct default_distance_result point_tag, typename point_type::type, typename point_type::type - >::type + >::type, + typename point_type::type, + typename point_type::type >::type type; }; diff --git a/include/boost/geometry/strategies/distance.hpp b/include/boost/geometry/strategies/distance.hpp index ef9a7ee10..4179f8250 100644 --- a/include/boost/geometry/strategies/distance.hpp +++ b/include/boost/geometry/strategies/distance.hpp @@ -30,48 +30,17 @@ namespace strategy { namespace distance { namespace services template struct tag {}; -template struct return_type + +template +struct return_type { BOOST_MPL_ASSERT_MSG ( - false, NOT_IMPLEMENTED_FOR_THIS_STRATEGY, (types) + false, NOT_IMPLEMENTED_FOR_THIS_STRATEGY, (types) ); }; -/*! - \brief Metafunction delivering a similar strategy with other input point types -*/ -template -< - typename Strategy, - typename Point1, - typename Point2 -> -struct similar_type -{ - BOOST_MPL_ASSERT_MSG - ( - false, NOT_IMPLEMENTED_FOR_THIS_STRATEGY - , (types) - ); -}; - -template -< - typename Strategy, - typename Point1, - typename Point2 -> -struct get_similar -{ - BOOST_MPL_ASSERT_MSG - ( - false, NOT_IMPLEMENTED_FOR_THIS_STRATEGY - , (types) - ); -}; - template struct comparable_type { BOOST_MPL_ASSERT_MSG @@ -88,7 +57,8 @@ template struct get_comparable ); }; -template struct result_from_distance {}; +template +struct result_from_distance {}; // For point-segment only: diff --git a/include/boost/geometry/strategies/intersection.hpp b/include/boost/geometry/strategies/intersection.hpp index fc628c063..243f5b561 100644 --- a/include/boost/geometry/strategies/intersection.hpp +++ b/include/boost/geometry/strategies/intersection.hpp @@ -17,7 +17,6 @@ #include #include -#include #include #include diff --git a/include/boost/geometry/strategies/spherical/area_huiller.hpp b/include/boost/geometry/strategies/spherical/area_huiller.hpp index 1bef9b5f2..c41d80abc 100644 --- a/include/boost/geometry/strategies/spherical/area_huiller.hpp +++ b/include/boost/geometry/strategies/spherical/area_huiller.hpp @@ -82,8 +82,7 @@ protected : calculation_type sum; // Distances are calculated on unit sphere here - strategy::distance::haversine - distance_over_unit_sphere; + strategy::distance::haversine distance_over_unit_sphere; inline excess_sum() diff --git a/include/boost/geometry/strategies/spherical/distance_cross_track.hpp b/include/boost/geometry/strategies/spherical/distance_cross_track.hpp index 7b353020e..4185a9479 100644 --- a/include/boost/geometry/strategies/spherical/distance_cross_track.hpp +++ b/include/boost/geometry/strategies/spherical/distance_cross_track.hpp @@ -10,6 +10,7 @@ #define BOOST_GEOMETRY_STRATEGIES_SPHERICAL_DISTANCE_CROSS_TRACK_HPP +#include #include #include #include @@ -21,6 +22,7 @@ #include #include +#include #include #include @@ -40,10 +42,8 @@ namespace strategy { namespace distance /*! \brief Strategy functor for distance point to segment calculation \ingroup strategies -\details Class which calculates the distance of a point to a segment, using latlong points +\details Class which calculates the distance of a point to a segment, for points on a sphere or globe \see http://williams.best.vwh.net/avform.htm -\tparam Point point type -\tparam PointOfSegment \tparam_segment_point \tparam CalculationType \tparam_calculation \tparam Strategy underlying point-point distance strategy, defaults to haversine @@ -55,40 +55,35 @@ namespace strategy { namespace distance */ template < - typename Point, - typename PointOfSegment = Point, typename CalculationType = void, - typename Strategy = typename services::default_strategy::type + typename Strategy = haversine > class cross_track { public : - typedef typename promote_floating_point - < - typename select_calculation_type - < - Point, - PointOfSegment, - CalculationType - >::type - >::type return_type; + template + struct return_type + : promote_floating_point + < + typename select_calculation_type + < + Point, + PointOfSegment, + CalculationType + >::type + > + {}; inline cross_track() - { - m_strategy = Strategy(); - m_radius = m_strategy.radius(); - } + {} - inline cross_track(return_type const& r) - : m_radius(r) - , m_strategy(r) + explicit inline cross_track(typename Strategy::radius_type const& r) + : m_strategy(r) {} inline cross_track(Strategy const& s) : m_strategy(s) - { - m_radius = m_strategy.radius(); - } + {} // It might be useful in the future @@ -96,9 +91,20 @@ public : // crosstrack(...) {} - inline return_type apply(Point const& p, - PointOfSegment const& sp1, PointOfSegment const& sp2) const + template + inline typename return_type::type + apply(Point const& p, PointOfSegment const& sp1, PointOfSegment const& sp2) const { + +#if !defined(BOOST_MSVC) + BOOST_CONCEPT_ASSERT + ( + (concept::PointDistanceStrategy) + ); +#endif + + typedef typename return_type::type return_type; + // http://williams.best.vwh.net/avform.htm#XTE return_type d1 = m_strategy.apply(sp1, p); return_type d3 = m_strategy.apply(sp1, sp2); @@ -132,7 +138,7 @@ public : if(projection1 > 0.0 && projection2 > 0.0) { - return_type XTD = m_radius * geometry::math::abs( asin( sin( d1 / m_radius ) * sin( d_crs1 ) )); + return_type XTD = radius() * geometry::math::abs( asin( sin( d1 / radius() ) * sin( d_crs1 ) )); #ifdef BOOST_GEOMETRY_DEBUG_CROSS_TRACK std::cout << "Projection ON the segment" << std::endl; @@ -153,23 +159,20 @@ public : } } - inline return_type radius() const { return m_radius; } + inline typename Strategy::radius_type radius() const + { return m_strategy.radius(); } private : - BOOST_CONCEPT_ASSERT - ( - (geometry::concept::PointDistanceStrategy) - ); - - return_type m_radius; - - // Point-point distances are calculated in radians, on the unit sphere Strategy m_strategy; /// Calculate course (bearing) between two points. Might be moved to a "course formula" ... - inline return_type course(Point const& p1, Point const& p2) const + template + inline typename return_type::type + course(Point1 const& p1, Point2 const& p2) const { + typedef typename return_type::type return_type; + // http://williams.best.vwh.net/avform.htm#Crs return_type dlon = get_as_radian<0>(p2) - get_as_radian<0>(p1); return_type cos_p2lat = cos(get_as_radian<1>(p2)); @@ -188,116 +191,71 @@ private : namespace services { -template -struct tag > +template +struct tag > { typedef strategy_tag_distance_point_segment type; }; -template -struct return_type > +template +struct return_type, P, PS> + : cross_track::template return_type +{}; + + +template +struct comparable_type > { - typedef typename cross_track::return_type type; + // There is no shortcut, so the strategy itself is its comparable type + typedef cross_track type; }; template < - typename Point, - typename PointOfSegment, typename CalculationType, - typename Strategy, - typename P, - typename PS -> -struct similar_type, P, PS> -{ - typedef cross_track type; -}; - - -template -< - typename Point, - typename PointOfSegment, - typename CalculationType, - typename Strategy, - typename P, - typename PS -> -struct get_similar, P, PS> -{ - static inline typename similar_type - < - cross_track, P, PS - >::type apply(cross_track const& strategy) - { - return cross_track(strategy.radius()); - } -}; - - -template -struct comparable_type > -{ - // Comparable type is here just the strategy - typedef typename similar_type - < - cross_track - < - Point, PointOfSegment, CalculationType, Strategy - >, Point, PointOfSegment - >::type type; -}; - - -template -< - typename Point, typename PointOfSegment, - typename CalculationType, typename Strategy > -struct get_comparable > +struct get_comparable > { typedef typename comparable_type < - cross_track + cross_track >::type comparable_type; public : - static inline comparable_type apply(cross_track const& strategy) + static inline comparable_type apply(cross_track const& strategy) { return comparable_type(strategy.radius()); } }; -template +template < - typename Point, typename PointOfSegment, - typename CalculationType, - typename Strategy + typename CalculationType, + typename Strategy, + typename P, typename PS > -struct result_from_distance > +struct result_from_distance, P, PS> { private : - typedef typename cross_track::return_type return_type; + typedef typename cross_track::template return_type return_type; public : template - static inline return_type apply(cross_track const& , T const& distance) + static inline return_type apply(cross_track const& , T const& distance) { return distance; } }; -template +template < - typename Point, typename PointOfSegment, - typename CalculationType, + typename CalculationType, typename Strategy > -struct strategy_point_point > +struct strategy_point_point > { typedef Strategy type; }; @@ -311,15 +269,13 @@ TODO: spherical polar coordinate system requires "get_as_radian_equatorial<>" template struct default_strategy < - segment_tag, Point, PointOfSegment, - spherical_polar_tag, spherical_polar_tag, + segment_tag, Point, PointOfSegment, + spherical_polar_tag, spherical_polar_tag, Strategy > { typedef cross_track < - Point, - PointOfSegment, void, typename boost::mpl::if_ < @@ -338,15 +294,13 @@ struct default_strategy template struct default_strategy < - segment_tag, Point, PointOfSegment, - spherical_equatorial_tag, spherical_equatorial_tag, + segment_tag, Point, PointOfSegment, + spherical_equatorial_tag, spherical_equatorial_tag, Strategy > { typedef cross_track < - Point, - PointOfSegment, void, typename boost::mpl::if_ < diff --git a/include/boost/geometry/strategies/spherical/distance_haversine.hpp b/include/boost/geometry/strategies/spherical/distance_haversine.hpp index 5a866c2ed..60ccfdbd6 100644 --- a/include/boost/geometry/strategies/spherical/distance_haversine.hpp +++ b/include/boost/geometry/strategies/spherical/distance_haversine.hpp @@ -39,52 +39,57 @@ namespace comparable // - applying asin (which is strictly (monotone) increasing) template < - typename Point1, - typename Point2 = Point1, + typename RadiusType, typename CalculationType = void > class haversine { public : - typedef typename promote_floating_point - < - typename select_calculation_type - < - Point1, - Point2, - CalculationType - >::type - >::type calculation_type; + template + struct calculation_type + : promote_floating_point + < + typename select_calculation_type + < + Point1, + Point2, + CalculationType + >::type + > + {}; - inline haversine(calculation_type const& r = 1.0) + typedef RadiusType radius_type; + + explicit inline haversine(RadiusType const& r = 1.0) : m_radius(r) {} - - static inline calculation_type apply(Point1 const& p1, Point2 const& p2) + template + static inline typename calculation_type::type + apply(Point1 const& p1, Point2 const& p2) { - return calculate(get_as_radian<0>(p1), get_as_radian<1>(p1), - get_as_radian<0>(p2), get_as_radian<1>(p2)); + return calculate::type>( + get_as_radian<0>(p1), get_as_radian<1>(p1), + get_as_radian<0>(p2), get_as_radian<1>(p2) + ); } - inline calculation_type radius() const + inline RadiusType radius() const { return m_radius; } private : - - static inline calculation_type calculate(calculation_type const& lon1, - calculation_type const& lat1, - calculation_type const& lon2, - calculation_type const& lat2) + template + static inline R calculate(T1 const& lon1, T1 const& lat1, + T2 const& lon2, T2 const& lat2) { return math::hav(lat2 - lat1) + cos(lat1) * cos(lat2) * math::hav(lon2 - lon1); } - calculation_type m_radius; + RadiusType m_radius; }; @@ -95,8 +100,7 @@ private : \brief Distance calculation for spherical coordinates on a perfect sphere using haversine \ingroup strategies -\tparam Point1 \tparam_first_point -\tparam Point2 \tparam_second_point +\tparam RadiusType \tparam_radius \tparam CalculationType \tparam_calculation \author Adapted from: http://williams.best.vwh.net/avform.htm \see http://en.wikipedia.org/wiki/Great-circle_distance @@ -117,23 +121,26 @@ A mathematically equivalent formula, which is less subject */ template < - typename Point1, - typename Point2 = Point1, + typename RadiusType, typename CalculationType = void > class haversine { - typedef comparable::haversine comparable_type; + typedef comparable::haversine comparable_type; public : + template + struct calculation_type + : services::return_type + {}; - typedef typename services::return_type::type calculation_type; + typedef RadiusType radius_type; /*! \brief Constructor \param radius radius of the sphere, defaults to 1.0 for the unit sphere */ - inline haversine(calculation_type const& radius = 1.0) + inline haversine(RadiusType const& radius = 1.0) : m_radius(radius) {} @@ -143,8 +150,11 @@ public : \param p1 first point \param p2 second point */ - inline calculation_type apply(Point1 const& p1, Point2 const& p2) const + template + inline typename calculation_type::type + apply(Point1 const& p1, Point2 const& p2) const { + typedef typename calculation_type::type calculation_type; calculation_type const a = comparable_type::apply(p1, p2); calculation_type const c = calculation_type(2.0) * asin(sqrt(a)); return m_radius * c; @@ -154,13 +164,13 @@ public : \brief access to radius value \return the radius */ - inline calculation_type radius() const + inline RadiusType radius() const { return m_radius; } private : - calculation_type m_radius; + RadiusType m_radius; }; @@ -168,52 +178,32 @@ private : namespace services { -template -struct tag > +template +struct tag > { typedef strategy_tag_distance_point_point type; }; -template -struct return_type > +template +struct return_type, P1, P2> + : haversine::template calculation_type +{}; + + +template +struct comparable_type > { - typedef typename haversine::calculation_type type; + typedef comparable::haversine type; }; -template -struct similar_type, P1, P2> -{ - typedef haversine type; -}; - - -template -struct get_similar, P1, P2> +template +struct get_comparable > { private : - typedef haversine this_type; -public : - static inline typename similar_type::type apply(this_type const& input) - { - return haversine(input.radius()); - } -}; - -template -struct comparable_type > -{ - typedef comparable::haversine type; -}; - - -template -struct get_comparable > -{ -private : - typedef haversine this_type; - typedef comparable::haversine comparable_type; + typedef haversine this_type; + typedef comparable::haversine comparable_type; public : static inline comparable_type apply(this_type const& input) { @@ -221,12 +211,12 @@ public : } }; -template -struct result_from_distance > +template +struct result_from_distance, P1, P2> { private : - typedef haversine this_type; - typedef typename return_type::type return_type; + typedef haversine this_type; + typedef typename return_type::type return_type; public : template static inline return_type apply(this_type const& , T const& value) @@ -237,51 +227,31 @@ public : // Specializations for comparable::haversine -template -struct tag > +template +struct tag > { typedef strategy_tag_distance_point_point type; }; -template -struct return_type > +template +struct return_type, P1, P2> + : comparable::haversine::template calculation_type +{}; + + +template +struct comparable_type > { - typedef typename comparable::haversine::calculation_type type; + typedef comparable::haversine type; }; -template -struct similar_type, P1, P2> -{ - typedef comparable::haversine type; -}; - - -template -struct get_similar, P1, P2> +template +struct get_comparable > { private : - typedef comparable::haversine this_type; -public : - static inline typename similar_type::type apply(this_type const& input) - { - return comparable::haversine(input.radius()); - } -}; - -template -struct comparable_type > -{ - typedef comparable::haversine type; -}; - - -template -struct get_comparable > -{ -private : - typedef comparable::haversine this_type; + typedef comparable::haversine this_type; public : static inline this_type apply(this_type const& input) { @@ -290,12 +260,12 @@ public : }; -template -struct result_from_distance > +template +struct result_from_distance, P1, P2> { private : - typedef comparable::haversine strategy_type; - typedef typename return_type::type return_type; + typedef comparable::haversine strategy_type; + typedef typename return_type::type return_type; public : template static inline return_type apply(strategy_type const& strategy, T const& distance) @@ -311,7 +281,7 @@ public : template struct default_strategy { - typedef strategy::distance::haversine type; + typedef strategy::distance::haversine::type> type; }; // Note: spherical polar coordinate system requires "get_as_radian_equatorial" diff --git a/include/boost/geometry/strategies/transform/inverse_transformer.hpp b/include/boost/geometry/strategies/transform/inverse_transformer.hpp index 845a71ded..685cf874b 100644 --- a/include/boost/geometry/strategies/transform/inverse_transformer.hpp +++ b/include/boost/geometry/strategies/transform/inverse_transformer.hpp @@ -31,22 +31,23 @@ namespace strategy { namespace transform { /*! -\brief Transformation strategy to do an inverse ransformation in Cartesian system +\brief Transformation strategy to do an inverse transformation in a Cartesian coordinate system \ingroup strategies -\tparam P1 first point type -\tparam P2 second point type */ -template +template +< + typename CalculationType, + std::size_t Dimension1, + std::size_t Dimension2 +> class inverse_transformer - : public ublas_transformer::type::value, dimension::type::value> + : public ublas_transformer { - typedef typename select_coordinate_type::type T; - public : template inline inverse_transformer(Transformer const& input) { - typedef boost::numeric::ublas::matrix matrix_type; + typedef boost::numeric::ublas::matrix matrix_type; // create a working copy of the input matrix_type copy(input.matrix()); @@ -60,7 +61,7 @@ public : if( res == 0 ) { // create identity matrix - this->m_matrix.assign(boost::numeric::ublas::identity_matrix(copy.size1())); + this->m_matrix.assign(boost::numeric::ublas::identity_matrix(copy.size1())); // backsubstitute to get the inverse boost::numeric::ublas::lu_substitute(copy, pm, this->m_matrix); diff --git a/include/boost/geometry/strategies/transform/map_transformer.hpp b/include/boost/geometry/strategies/transform/map_transformer.hpp index 2755d5353..baf721658 100644 --- a/include/boost/geometry/strategies/transform/map_transformer.hpp +++ b/include/boost/geometry/strategies/transform/map_transformer.hpp @@ -32,25 +32,23 @@ namespace strategy { namespace transform { /*! -\brief Transformation strategy to do map from one to another Cartesian system +\brief Transformation strategy to map from one to another Cartesian coordinate system \ingroup strategies -\tparam P1 first point type -\tparam P2 second point type \tparam Mirror if true map is mirrored upside-down (in most cases pixels are from top to bottom, while map is from bottom to top) */ template < - typename P1, typename P2, - bool Mirror = false, bool SameScale = true, - std::size_t Dimension1 = dimension::type::value, - std::size_t Dimension2 = dimension::type::value + typename CalculationType, + std::size_t Dimension1, + std::size_t Dimension2, + bool Mirror = false, + bool SameScale = true > class map_transformer - : public ublas_transformer + : public ublas_transformer { - typedef typename select_coordinate_type::type T; - typedef boost::numeric::ublas::matrix M; + typedef boost::numeric::ublas::matrix M; public : template diff --git a/include/boost/geometry/strategies/transform/matrix_transformers.hpp b/include/boost/geometry/strategies/transform/matrix_transformers.hpp index b37a3712e..27a3a2ae8 100644 --- a/include/boost/geometry/strategies/transform/matrix_transformers.hpp +++ b/include/boost/geometry/strategies/transform/matrix_transformers.hpp @@ -22,9 +22,20 @@ #define BOOST_UBLAS_TYPE_CHECK 0 #include + +#if defined(__clang__) +// Avoid warning about unused UBLAS function: boost_numeric_ublas_abs +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-function" +#endif + #include #include +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + #include #include #include @@ -46,14 +57,12 @@ namespace strategy { namespace transform \see http://en.wikipedia.org/wiki/Affine_transformation and http://www.devmaster.net/wiki/Transformation_matrices \ingroup strategies -\tparam P1 first point type (source) -\tparam P2 second point type (target) -\tparam Dimension1 number of dimensions to transform from first point -\tparam Dimension1 number of dimensions to transform to second point +\tparam Dimension1 number of dimensions to transform from +\tparam Dimension2 number of dimensions to transform to */ template < - typename P1, typename P2, + typename CalculationType, std::size_t Dimension1, std::size_t Dimension2 > @@ -62,13 +71,12 @@ class ublas_transformer }; -template -class ublas_transformer +template +class ublas_transformer { protected : - typedef typename select_coordinate_type::type coordinate_type; - typedef coordinate_type ct; // Abbreviation - typedef boost::numeric::ublas::matrix matrix_type; + typedef CalculationType ct; + typedef boost::numeric::ublas::matrix matrix_type; matrix_type m_matrix; public : @@ -91,17 +99,17 @@ public : inline ublas_transformer() : m_matrix(3, 3) {} + template inline bool apply(P1 const& p1, P2& p2) const { assert_dimension_greater_equal(); assert_dimension_greater_equal(); - coordinate_type const& c1 = get<0>(p1); - coordinate_type const& c2 = get<1>(p1); + ct const& c1 = get<0>(p1); + ct const& c2 = get<1>(p1); - - coordinate_type p2x = c1 * m_matrix(0,0) + c2 * m_matrix(0,1) + m_matrix(0,2); - coordinate_type p2y = c1 * m_matrix(1,0) + c2 * m_matrix(1,1) + m_matrix(1,2); + ct p2x = c1 * m_matrix(0,0) + c2 * m_matrix(0,1) + m_matrix(0,2); + ct p2y = c1 * m_matrix(1,0) + c2 * m_matrix(1,1) + m_matrix(1,2); typedef typename geometry::coordinate_type::type ct2; set<0>(p2, boost::numeric_cast(p2x)); @@ -115,36 +123,34 @@ public : // It IS possible to go from 3 to 2 coordinates -template -class ublas_transformer : public ublas_transformer +template +class ublas_transformer : public ublas_transformer { - typedef typename select_coordinate_type::type coordinate_type; - typedef coordinate_type ct; // Abbreviation + typedef CalculationType ct; public : inline ublas_transformer( ct const& m_0_0, ct const& m_0_1, ct const& m_0_2, ct const& m_1_0, ct const& m_1_1, ct const& m_1_2, ct const& m_2_0, ct const& m_2_1, ct const& m_2_2) - : ublas_transformer( + : ublas_transformer( m_0_0, m_0_1, m_0_2, m_1_0, m_1_1, m_1_2, m_2_0, m_2_1, m_2_2) {} inline ublas_transformer() - : ublas_transformer() + : ublas_transformer() {} }; -template -class ublas_transformer +template +class ublas_transformer { protected : - typedef typename select_coordinate_type::type coordinate_type; - typedef coordinate_type ct; // Abbreviation - typedef boost::numeric::ublas::matrix matrix_type; + typedef CalculationType ct; + typedef boost::numeric::ublas::matrix matrix_type; matrix_type m_matrix; public : @@ -164,11 +170,12 @@ public : inline ublas_transformer() : m_matrix(4, 4) {} + template inline bool apply(P1 const& p1, P2& p2) const { - coordinate_type const& c1 = get<0>(p1); - coordinate_type const& c2 = get<1>(p1); - coordinate_type const& c3 = get<2>(p1); + ct const& c1 = get<0>(p1); + ct const& c2 = get<1>(p1); + ct const& c3 = get<2>(p1); typedef typename geometry::coordinate_type::type ct2; @@ -191,34 +198,30 @@ public : \details Translate moves a geometry a fixed distance in 2 or 3 dimensions. \see http://en.wikipedia.org/wiki/Translation_%28geometry%29 \ingroup strategies -\tparam P1 first point type -\tparam P2 second point type -\tparam Dimension1 number of dimensions to transform from first point -\tparam Dimension1 number of dimensions to transform to second point +\tparam Dimension1 number of dimensions to transform from +\tparam Dimension2 number of dimensions to transform to */ template < - typename P1, typename P2, - std::size_t Dimension1 = geometry::dimension::type::value, - std::size_t Dimension2 = geometry::dimension::type::value + typename CalculationType, + std::size_t Dimension1, + std::size_t Dimension2 > class translate_transformer { }; -template -class translate_transformer : public ublas_transformer +template +class translate_transformer : public ublas_transformer { - typedef typename select_coordinate_type::type coordinate_type; - public : // To have translate transformers compatible for 2/3 dimensions, the // constructor takes an optional third argument doing nothing. - inline translate_transformer(coordinate_type const& translate_x, - coordinate_type const& translate_y, - coordinate_type const& = 0) - : ublas_transformer( + inline translate_transformer(CalculationType const& translate_x, + CalculationType const& translate_y, + CalculationType const& = 0) + : ublas_transformer( 1, 0, translate_x, 0, 1, translate_y, 0, 0, 1) @@ -226,16 +229,14 @@ public : }; -template -class translate_transformer : public ublas_transformer +template +class translate_transformer : public ublas_transformer { - typedef typename select_coordinate_type::type coordinate_type; - public : - inline translate_transformer(coordinate_type const& translate_x, - coordinate_type const& translate_y, - coordinate_type const& translate_z) - : ublas_transformer( + inline translate_transformer(CalculationType const& translate_x, + CalculationType const& translate_y, + CalculationType const& translate_z) + : ublas_transformer( 1, 0, 0, translate_x, 0, 1, 0, translate_y, 0, 0, 1, translate_z, @@ -250,40 +251,37 @@ public : \details Scale scales a geometry up or down in all its dimensions. \see http://en.wikipedia.org/wiki/Scaling_%28geometry%29 \ingroup strategies -\tparam P1 first point type -\tparam P2 second point type -\tparam Dimension1 number of dimensions to transform from first point -\tparam Dimension1 number of dimensions to transform to second point +\tparam Dimension1 number of dimensions to transform from +\tparam Dimension2 number of dimensions to transform to */ template < - typename P1, typename P2 = P1, - std::size_t Dimension1 = geometry::dimension::type::value, - std::size_t Dimension2 = geometry::dimension::type::value + typename CalculationType, + std::size_t Dimension1, + std::size_t Dimension2 > class scale_transformer { }; -template -class scale_transformer : public ublas_transformer +template +class scale_transformer : public ublas_transformer { - typedef typename select_coordinate_type::type coordinate_type; public : - inline scale_transformer(coordinate_type const& scale_x, - coordinate_type const& scale_y, - coordinate_type const& = 0) - : ublas_transformer( + inline scale_transformer(CalculationType const& scale_x, + CalculationType const& scale_y, + CalculationType const& = 0) + : ublas_transformer( scale_x, 0, 0, 0, scale_y, 0, 0, 0, 1) {} - inline scale_transformer(coordinate_type const& scale) - : ublas_transformer( + inline scale_transformer(CalculationType const& scale) + : ublas_transformer( scale, 0, 0, 0, scale, 0, 0, 0, 1) @@ -291,16 +289,14 @@ public : }; -template -class scale_transformer : public ublas_transformer +template +class scale_transformer : public ublas_transformer { - typedef typename select_coordinate_type::type coordinate_type; - public : - inline scale_transformer(coordinate_type const& scale_x, - coordinate_type const& scale_y, - coordinate_type const& scale_z) - : ublas_transformer( + inline scale_transformer(CalculationType const& scale_x, + CalculationType const& scale_y, + CalculationType const& scale_z) + : ublas_transformer( scale_x, 0, 0, 0, 0, scale_y, 0, 0, 0, 0, scale_z, 0, @@ -308,8 +304,8 @@ public : {} - inline scale_transformer(coordinate_type const& scale) - : ublas_transformer( + inline scale_transformer(CalculationType const& scale) + : ublas_transformer( scale, 0, 0, 0, 0, scale, 0, 0, 0, 0, scale, 0, @@ -352,23 +348,16 @@ struct as_radian template < - typename P1, typename P2, - std::size_t Dimension1 = geometry::dimension::type::value, - std::size_t Dimension2 = geometry::dimension::type::value + typename CalculationType, + std::size_t Dimension1, + std::size_t Dimension2 > class rad_rotate_transformer - : public ublas_transformer + : public ublas_transformer { - // Angle has type of coordinate type, but at least a double - typedef typename select_most_precise - < - typename select_coordinate_type::type, - double - >::type angle_type; - public : - inline rad_rotate_transformer(angle_type const& angle) - : ublas_transformer( + inline rad_rotate_transformer(CalculationType const& angle) + : ublas_transformer( cos(angle), sin(angle), 0, -sin(angle), cos(angle), 0, 0, 0, 1) @@ -381,33 +370,31 @@ public : /*! -\brief Strategy of rotate transformation in Cartesian system. +\brief Strategy for rotate transformation in Cartesian coordinate system. \details Rotate rotates a geometry of specified angle about a fixed point (e.g. origin). \see http://en.wikipedia.org/wiki/Rotation_%28mathematics%29 \ingroup strategies -\tparam P1 first point type -\tparam P2 second point type \tparam DegreeOrRadian degree/or/radian, type of rotation angle specification \note A single angle is needed to specify a rotation in 2D. Not yet in 3D, the 3D version requires special things to allow for rotation around X, Y, Z or arbitrary axis. \todo The 3D version will not compile. */ -template -class rotate_transformer : public detail::rad_rotate_transformer +template +< + typename DegreeOrRadian, + typename CalculationType, + std::size_t Dimension1, + std::size_t Dimension2 +> +class rotate_transformer : public detail::rad_rotate_transformer { - // Angle has type of coordinate type, but at least a double - typedef typename select_most_precise - < - typename select_coordinate_type::type, - double - >::type angle_type; public : - inline rotate_transformer(angle_type const& angle) + inline rotate_transformer(CalculationType const& angle) : detail::rad_rotate_transformer < - P1, P2 + CalculationType, Dimension1, Dimension2 >(detail::as_radian::get(angle)) {} }; diff --git a/include/boost/geometry/util/math.hpp b/include/boost/geometry/util/math.hpp index 8c152edd2..5829f9cbd 100644 --- a/include/boost/geometry/util/math.hpp +++ b/include/boost/geometry/util/math.hpp @@ -216,16 +216,27 @@ inline T sqr(T const& value) return value * value; } - /*! \brief Short utility to workaround gcc/clang problem that abs is converting to integer + and that older versions of MSVC does not support abs of long long... \ingroup utility */ template -inline T abs(const T& t) +inline T abs(T const& value) { - using std::abs; - return abs(t); + T const zero = T(); + return value < zero ? -value : value; +} + +/*! +\brief Short utility to calculate the sign of a number: -1 (negative), 0 (zero), 1 (positive) +\ingroup utility +*/ +template +static inline int sign(T const& value) +{ + T const zero = T(); + return value > zero ? 1 : value < zero ? -1 : 0; } diff --git a/index/example/Jamfile.v2 b/index/example/Jamfile.v2 index 2067e8d7c..065f49b98 100644 --- a/index/example/Jamfile.v2 +++ b/index/example/Jamfile.v2 @@ -44,6 +44,7 @@ if $(GLUT_ROOT) } exe random_test : random_test.cpp ; +link serialize.cpp /boost//serialization : ; link benchmark.cpp /boost//chrono : multi ; link benchmark2.cpp /boost//chrono : multi ; link benchmark3.cpp /boost//chrono : multi ; diff --git a/index/example/benchmark_experimental.cpp b/index/example/benchmark_experimental.cpp index 5d9c229a3..34b08744f 100644 --- a/index/example/benchmark_experimental.cpp +++ b/index/example/benchmark_experimental.cpp @@ -8,7 +8,6 @@ // http://www.boost.org/LICENSE_1_0.txt) #define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL -#define BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_TYPE_ERASED_ITERATORS #include @@ -72,10 +71,10 @@ int main() #ifndef BOOST_GEOMETRY_INDEX_BENCHMARK_DEBUG size_t values_count = 1000000; size_t queries_count = 100000; - size_t nearest_queries_count = 10000; + size_t nearest_queries_count = 20000; unsigned neighbours_count = 10; size_t path_queries_count = 2000; - size_t path_queries_count2 = 10000; + size_t path_queries_count2 = 20000; unsigned path_values_count = 10; #else size_t values_count = 1000; @@ -175,6 +174,22 @@ int main() std::cout << time << " - query(B) " << queries_count << " found " << temp << '\n'; } + { + clock_t::time_point start = clock_t::now(); + size_t temp = 0; + for (size_t i = 0 ; i < queries_count ; ++i ) + { + float x = coords[i].first; + float y = coords[i].second; + result.clear(); + boost::copy(t | bgi::adaptors::queried(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))), + std::back_inserter(result)); + temp += result.size(); + } + dur_t time = clock_t::now() - start; + std::cout << time << " - range queried(B) " << queries_count << " found " << temp << '\n'; + } + #ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL { clock_t::time_point start = clock_t::now(); @@ -185,9 +200,9 @@ int main() float y = coords[i].second; result.clear(); std::copy( - t.qbegin(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))), - t.qend(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))), - std::back_inserter(result)); + t.qbegin_(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))), + t.qend_(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))), + std::back_inserter(result)); temp += result.size(); } dur_t time = clock_t::now() - start; @@ -202,15 +217,34 @@ int main() float y = coords[i].second; result.clear(); mycopy( - t.qbegin(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))), - t.qend(), + t.qbegin_(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))), + t.qend_(), std::back_inserter(result)); temp += result.size(); } dur_t time = clock_t::now() - start; std::cout << time << " - qbegin(B) qend() " << queries_count << " found " << temp << '\n'; } -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_TYPE_ERASED_ITERATORS + { + clock_t::time_point start = clock_t::now(); + size_t temp = 0; + for (size_t i = 0 ; i < queries_count ; ++i ) + { + float x = coords[i].first; + float y = coords[i].second; + result.clear(); + boost::copy( + std::make_pair( + t.qbegin_(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))), + t.qend_(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))) + ), std::back_inserter(result)); + temp += result.size(); + } + dur_t time = clock_t::now() - start; + std::cout << time << " - range qbegin(B) qend(B)" << queries_count << " found " << temp << '\n'; + } +#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL + { clock_t::time_point start = clock_t::now(); size_t temp = 0; @@ -220,15 +254,29 @@ int main() float y = coords[i].second; result.clear(); RT::const_query_iterator first = t.qbegin(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))); - RT::const_query_iterator last = t.qend(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))); + RT::const_query_iterator last = t.qend(); std::copy(first, last, std::back_inserter(result)); temp += result.size(); } dur_t time = clock_t::now() - start; - std::cout << time << " - type-erased qbegin(B) qend(B) " << queries_count << " found " << temp << '\n'; + std::cout << time << " - type-erased qbegin(B) qend() " << queries_count << " found " << temp << '\n'; + } + { + clock_t::time_point start = clock_t::now(); + size_t temp = 0; + for (size_t i = 0 ; i < queries_count ; ++i ) + { + float x = coords[i].first; + float y = coords[i].second; + result.clear(); + RT::const_query_iterator first = t.qbegin(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))); + RT::const_query_iterator last = t.qend(); + boost::copy(std::make_pair(first, last), std::back_inserter(result)); + temp += result.size(); + } + dur_t time = clock_t::now() - start; + std::cout << time << " - range type-erased qbegin(B) qend() " << queries_count << " found " << temp << '\n'; } -#endif -#endif { clock_t::time_point start = clock_t::now(); @@ -283,8 +331,8 @@ int main() float y = coords[i].second + 100; result.clear(); std::copy( - t.qbegin(bgi::nearest(P(x, y), neighbours_count)), - t.qend(bgi::nearest(P(x, y), neighbours_count)), + t.qbegin_(bgi::nearest(P(x, y), neighbours_count)), + t.qend_(bgi::nearest(P(x, y), neighbours_count)), std::back_inserter(result)); temp += result.size(); } @@ -300,15 +348,16 @@ int main() float y = coords[i].second + 100; result.clear(); mycopy( - t.qbegin(bgi::nearest(P(x, y), neighbours_count)), - t.qend(), + t.qbegin_(bgi::nearest(P(x, y), neighbours_count)), + t.qend_(), std::back_inserter(result)); temp += result.size(); } dur_t time = clock_t::now() - start; std::cout << time << " - qbegin(nearest(P, " << neighbours_count << ")) qend() " << nearest_queries_count << " found " << temp << '\n'; } -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_TYPE_ERASED_ITERATORS +#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL + { clock_t::time_point start = clock_t::now(); size_t temp = 0; @@ -318,14 +367,15 @@ int main() float y = coords[i].second; result.clear(); RT::const_query_iterator first = t.qbegin(bgi::nearest(P(x, y), neighbours_count)); - RT::const_query_iterator last = t.qend(bgi::nearest(P(x, y), neighbours_count)); + RT::const_query_iterator last = t.qend(); std::copy(first, last, std::back_inserter(result)); temp += result.size(); } dur_t time = clock_t::now() - start; - std::cout << time << " - type-erased qbegin(nearest(P, " << neighbours_count << ")) qend(n) " << nearest_queries_count << " found " << temp << '\n'; + std::cout << time << " - type-erased qbegin(nearest(P, " << neighbours_count << ")) qend() " << nearest_queries_count << " found " << temp << '\n'; } -#endif + +#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL { LS ls; diff --git a/index/example/glut_vis.cpp b/index/example/glut_vis.cpp index d6a434707..e0e6a00c0 100644 --- a/index/example/glut_vis.cpp +++ b/index/example/glut_vis.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -31,6 +32,7 @@ typedef bg::model::point P; typedef bg::model::box

B; //bgi::rtree t(2, 1); typedef bg::model::linestring

LS; +typedef bg::model::segment

S; typedef bg::model::ring

R; typedef bg::model::polygon

Poly; typedef bg::model::multi_polygon MPoly; @@ -50,10 +52,12 @@ B search_box; R search_ring; Poly search_poly; MPoly search_multi_poly; +S search_segment; +LS search_linestring; LS search_path; enum query_mode_type { - qm_knn, qm_c, qm_d, qm_i, qm_o, qm_w, qm_nc, qm_nd, qm_ni, qm_no, qm_nw, qm_all, qm_ri, qm_pi, qm_mpi, qm_path + qm_knn, qm_c, qm_d, qm_i, qm_o, qm_w, qm_nc, qm_nd, qm_ni, qm_no, qm_nw, qm_all, qm_ri, qm_pi, qm_mpi, qm_si, qm_lsi, qm_path } query_mode = qm_knn; bool search_valid = false; @@ -335,6 +339,81 @@ void query_multi_poly() std::cout << "boxes not found\n"; } +template +void query_segment() +{ + float x = ( rand() % 1000 ) / 10.0f; + float y = ( rand() % 1000 ) / 10.0f; + float w = 10.0f - ( rand() % 1000 ) / 50.0f; + float h = 10.0f - ( rand() % 1000 ) / 50.0f; + w += 0 <= w ? 10 : -10; + h += 0 <= h ? 10 : -10; + + boost::geometry::set<0, 0>(search_segment, x - w); + boost::geometry::set<0, 1>(search_segment, y - h); + boost::geometry::set<1, 0>(search_segment, x + w); + boost::geometry::set<1, 1>(search_segment, y + h); + + nearest_boxes.clear(); + found_count = t.query(Predicate(search_segment), std::back_inserter(nearest_boxes) ); + + if ( found_count > 0 ) + { + std::cout << "search segment: "; + bgi::detail::utilities::print_indexable(std::cout, P(x-w, y-h)); + bgi::detail::utilities::print_indexable(std::cout, P(x+w, y+h)); + + std::cout << "\nfound: "; + for ( size_t i = 0 ; i < nearest_boxes.size() ; ++i ) + { + bgi::detail::utilities::print_indexable(std::cout, nearest_boxes[i]); + std::cout << '\n'; + } + } + else + std::cout << "boxes not found\n"; +} + +template +void query_linestring() +{ + float x = ( rand() % 1000 ) / 10.0f; + float y = ( rand() % 1000 ) / 10.0f; + float w = 10 + ( rand() % 1000 ) / 100.0f; + float h = 10 + ( rand() % 1000 ) / 100.0f; + + search_linestring.clear(); + float a = 0; + float d = 0; + for ( size_t i = 0 ; i < 300 ; ++i, a += 0.05, d += 0.005 ) + { + float xx = x + w * d * ::cos(a); + float yy = y + h * d * ::sin(a); + search_linestring.push_back(P(xx, yy)); + } + + nearest_boxes.clear(); + found_count = t.query(Predicate(search_linestring), std::back_inserter(nearest_boxes) ); + + if ( found_count > 0 ) + { + std::cout << "search linestring: "; + BOOST_FOREACH(P const& p, search_linestring) + { + bgi::detail::utilities::print_indexable(std::cout, p); + std::cout << ' '; + } + std::cout << "\nfound: "; + for ( size_t i = 0 ; i < nearest_boxes.size() ; ++i ) + { + bgi::detail::utilities::print_indexable(std::cout, nearest_boxes[i]); + std::cout << '\n'; + } + } + else + std::cout << "boxes not found\n"; +} + void search() { namespace d = bgi::detail; @@ -369,6 +448,10 @@ void search() query_poly< d::spatial_predicate >(); else if ( query_mode == qm_mpi ) query_multi_poly< d::spatial_predicate >(); + else if ( query_mode == qm_si ) + query_segment< d::spatial_predicate >(); + else if ( query_mode == qm_lsi ) + query_linestring< d::spatial_predicate >(); else if ( query_mode == qm_path ) query_path(); @@ -403,7 +486,7 @@ void draw_knn_area(float min_distance, float max_distance) glEnd(); } -void draw_path(LS const& ls) +void draw_linestring(LS const& ls) { glBegin(GL_LINE_STRIP); @@ -418,6 +501,20 @@ void draw_path(LS const& ls) glEnd(); } +void draw_segment(S const& s) +{ + float x1 = boost::geometry::get<0, 0>(s); + float y1 = boost::geometry::get<0, 1>(s); + float x2 = boost::geometry::get<1, 0>(s); + float y2 = boost::geometry::get<1, 1>(s); + float z = bgi::detail::rtree::utilities::view(t).depth(); + + glBegin(GL_LINES); + glVertex3f(x1, y1, z); + glVertex3f(x2, y2, z); + glEnd(); +} + template void draw_box(Box const& box) { @@ -487,8 +584,12 @@ void render_scene(void) draw_polygon(search_poly); else if ( query_mode == qm_mpi ) draw_multi_polygon(search_multi_poly); + else if ( query_mode == qm_si ) + draw_segment(search_segment); + else if ( query_mode == qm_lsi ) + draw_linestring(search_linestring); else if ( query_mode == qm_path ) - draw_path(search_path); + draw_linestring(search_path); else draw_box(search_box); @@ -686,6 +787,10 @@ void keyboard(unsigned char key, int /*x*/, int /*y*/) query_mode = qm_pi; else if ( current_line == "mpi" ) query_mode = qm_mpi; + else if ( current_line == "si" ) + query_mode = qm_si; + else if ( current_line == "lsi" ) + query_mode = qm_lsi; else if ( current_line == "path" ) query_mode = qm_path; diff --git a/index/example/random_test.cpp b/index/example/random_test.cpp index f4145152c..48a45191c 100644 --- a/index/example/random_test.cpp +++ b/index/example/random_test.cpp @@ -100,8 +100,8 @@ int main() float x = coords[i].first; float y = coords[i].second; result.clear(); - std::copy(t.qbegin(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))), - t.qend(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))), + std::copy(t.qbegin_(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))), + t.qend_(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))), std::back_inserter(result)); // test @@ -152,8 +152,8 @@ int main() float y = coords[i].second + 100; result.clear(); - std::copy(t.qbegin(bgi::nearest(P(x, y), neighbours_count)), - t.qend(bgi::nearest(P(x, y), neighbours_count)), + std::copy(t.qbegin_(bgi::nearest(P(x, y), neighbours_count)), + t.qend_(bgi::nearest(P(x, y), neighbours_count)), std::back_inserter(result)); // test diff --git a/index/example/serialize.cpp b/index/example/serialize.cpp new file mode 100644 index 000000000..1ce9437b9 --- /dev/null +++ b/index/example/serialize.cpp @@ -0,0 +1,166 @@ +// Boost.Geometry Index +// Additional tests + +// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland. + +// 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 + +#define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +template ::value> +struct print_tuple +{ + template + static inline Os & apply(Os & os, T const& t) + { + os << boost::get(t) << ", "; + return print_tuple::apply(os, t); + } +}; + +template +struct print_tuple +{ + template + static inline Os & apply(Os & os, T const&) + { + return os; + } +}; + +int main() +{ + namespace bg = boost::geometry; + namespace bgi = bg::index; + + typedef boost::tuple S; + + typedef bg::model::point P; + typedef bg::model::box

B; + typedef B V; + //typedef bgi::rtree > RT; + //typedef bgi::rtree > RT; + //typedef bgi::rtree > RT; + typedef bgi::rtree RT; + + //RT tree; + RT tree(bgi::dynamic_linear(16)); + std::vector vect; + + boost::timer t; + + //insert values + { + for ( double x = 0 ; x < 1000 ; x += 1 ) + for ( double y = 0 ; y < 1000 ; y += 1 ) + vect.push_back(B(P(x, y), P(x+0.5, y+0.5))); + RT tmp(vect, tree.parameters()); + tree = boost::move(tmp); + } + B q(P(5, 5), P(6, 6)); + S s; + + std::cout << "vector and tree created in: " << t.elapsed() << std::endl; + + print_tuple::apply(std::cout, bgi::detail::rtree::utilities::statistics(tree)) << std::endl; + std::cout << boost::get<0>(s) << std::endl; + BOOST_FOREACH(V const& v, tree | bgi::adaptors::queried(bgi::intersects(q))) + std::cout << bg::wkt(v) << std::endl; + + // save + { + std::ofstream ofs("serialized_vector.bin", std::ios::binary | std::ios::trunc); + boost::archive::binary_oarchive oa(ofs); + t.restart(); + oa << vect; + std::cout << "vector saved to bin in: " << t.elapsed() << std::endl; + } + { + std::ofstream ofs("serialized_tree.bin", std::ios::binary | std::ios::trunc); + boost::archive::binary_oarchive oa(ofs); + t.restart(); + oa << tree; + std::cout << "tree saved to bin in: " << t.elapsed() << std::endl; + } + { + std::ofstream ofs("serialized_tree.xml", std::ios::trunc); + boost::archive::xml_oarchive oa(ofs); + t.restart(); + oa << boost::serialization::make_nvp("rtree", tree); + std::cout << "tree saved to xml in: " << t.elapsed() << std::endl; + } + + t.restart(); + vect.clear(); + std::cout << "vector cleared in: " << t.elapsed() << std::endl; + + t.restart(); + tree.clear(); + std::cout << "tree cleared in: " << t.elapsed() << std::endl; + + // load + + { + std::ifstream ifs("serialized_vector.bin", std::ios::binary); + boost::archive::binary_iarchive ia(ifs); + t.restart(); + ia >> vect; + std::cout << "vector loaded from bin in: " << t.elapsed() << std::endl; + t.restart(); + RT tmp(vect, tree.parameters()); + tree = boost::move(tmp); + std::cout << "tree rebuilt from vector in: " << t.elapsed() << std::endl; + } + + t.restart(); + tree.clear(); + std::cout << "tree cleared in: " << t.elapsed() << std::endl; + + { + std::ifstream ifs("serialized_tree.bin", std::ios::binary); + boost::archive::binary_iarchive ia(ifs); + t.restart(); + ia >> tree; + std::cout << "tree loaded from bin in: " << t.elapsed() << std::endl; + } + + std::cout << "loaded from bin" << std::endl; + print_tuple::apply(std::cout, bgi::detail::rtree::utilities::statistics(tree)) << std::endl; + BOOST_FOREACH(V const& v, tree | bgi::adaptors::queried(bgi::intersects(q))) + std::cout << bg::wkt(v) << std::endl; + + t.restart(); + tree.clear(); + std::cout << "tree cleared in: " << t.elapsed() << std::endl; + + { + std::ifstream ifs("serialized_tree.xml"); + boost::archive::xml_iarchive ia(ifs); + t.restart(); + ia >> boost::serialization::make_nvp("rtree", tree); + std::cout << "tree loaded from xml in: " << t.elapsed() << std::endl; + } + + std::cout << "loaded from xml" << std::endl; + print_tuple::apply(std::cout, bgi::detail::rtree::utilities::statistics(tree)) << std::endl; + BOOST_FOREACH(V const& v, tree | bgi::adaptors::queried(bgi::intersects(q))) + std::cout << bg::wkt(v) << std::endl; + + return 0; +} diff --git a/index/test/rtree/interprocess/Jamfile.v2 b/index/test/rtree/interprocess/Jamfile.v2 index be709a43b..d0643b45f 100644 --- a/index/test/rtree/interprocess/Jamfile.v2 +++ b/index/test/rtree/interprocess/Jamfile.v2 @@ -20,6 +20,7 @@ rule test_all acc-pa_risc:-lrt gcc-mingw:"-lole32 -loleaut32 -lpsapi -ladvapi32" hpux,gcc:"-Wl,+as,mpas" + windows,clang:"-lole32 -loleaut32 -lpsapi -ladvapi32" ] ; } diff --git a/index/test/rtree/interprocess/rtree_interprocess_linear.cpp b/index/test/rtree/interprocess/rtree_interprocess_linear.cpp index 1a6077f41..80221ac3f 100644 --- a/index/test/rtree/interprocess/rtree_interprocess_linear.cpp +++ b/index/test/rtree/interprocess/rtree_interprocess_linear.cpp @@ -13,8 +13,7 @@ int test_main(int, char* []) { typedef bg::model::point P2f; - testset::interprocess::modifiers(bgi::linear<32, 8>()); - testset::interprocess::additional(bgi::linear<32, 8>()); + testset::interprocess::modifiers_and_additional(bgi::linear<32, 8>()); return 0; } diff --git a/index/test/rtree/interprocess/rtree_interprocess_linear_dyn.cpp b/index/test/rtree/interprocess/rtree_interprocess_linear_dyn.cpp index 4823bbb57..17717ce31 100644 --- a/index/test/rtree/interprocess/rtree_interprocess_linear_dyn.cpp +++ b/index/test/rtree/interprocess/rtree_interprocess_linear_dyn.cpp @@ -13,8 +13,7 @@ int test_main(int, char* []) { typedef bg::model::point P2f; - testset::interprocess::modifiers(bgi::dynamic_linear(32, 8)); - testset::interprocess::additional(bgi::dynamic_linear(32, 8)); + testset::interprocess::modifiers_and_additional(bgi::dynamic_linear(32, 8)); return 0; } diff --git a/index/test/rtree/interprocess/rtree_interprocess_quadratic.cpp b/index/test/rtree/interprocess/rtree_interprocess_quadratic.cpp index 8a8bea0e8..b4630a172 100644 --- a/index/test/rtree/interprocess/rtree_interprocess_quadratic.cpp +++ b/index/test/rtree/interprocess/rtree_interprocess_quadratic.cpp @@ -13,8 +13,7 @@ int test_main(int, char* []) { typedef bg::model::point P2f; - testset::interprocess::modifiers(bgi::quadratic<32, 8>()); - testset::interprocess::additional(bgi::quadratic<32, 8>()); + testset::interprocess::modifiers_and_additional(bgi::quadratic<32, 8>()); return 0; } diff --git a/index/test/rtree/interprocess/rtree_interprocess_quadratic_dyn.cpp b/index/test/rtree/interprocess/rtree_interprocess_quadratic_dyn.cpp index b7710ef4b..cf935b377 100644 --- a/index/test/rtree/interprocess/rtree_interprocess_quadratic_dyn.cpp +++ b/index/test/rtree/interprocess/rtree_interprocess_quadratic_dyn.cpp @@ -13,8 +13,7 @@ int test_main(int, char* []) { typedef bg::model::point P2f; - testset::interprocess::modifiers(bgi::dynamic_quadratic(32, 8)); - testset::interprocess::additional(bgi::dynamic_quadratic(32, 8)); + testset::interprocess::modifiers_and_additional(bgi::dynamic_quadratic(32, 8)); return 0; } diff --git a/index/test/rtree/interprocess/rtree_interprocess_rstar.cpp b/index/test/rtree/interprocess/rtree_interprocess_rstar.cpp index 8402bb0fc..415a473da 100644 --- a/index/test/rtree/interprocess/rtree_interprocess_rstar.cpp +++ b/index/test/rtree/interprocess/rtree_interprocess_rstar.cpp @@ -13,8 +13,7 @@ int test_main(int, char* []) { typedef bg::model::point P2f; - testset::interprocess::modifiers(bgi::rstar<32, 8>()); - testset::interprocess::additional(bgi::rstar<32, 8>()); + testset::interprocess::modifiers_and_additional(bgi::rstar<32, 8>()); return 0; } diff --git a/index/test/rtree/interprocess/rtree_interprocess_rstar_dyn.cpp b/index/test/rtree/interprocess/rtree_interprocess_rstar_dyn.cpp index 52c81e958..06edc43a8 100644 --- a/index/test/rtree/interprocess/rtree_interprocess_rstar_dyn.cpp +++ b/index/test/rtree/interprocess/rtree_interprocess_rstar_dyn.cpp @@ -13,8 +13,7 @@ int test_main(int, char* []) { typedef bg::model::point P2f; - testset::interprocess::modifiers(bgi::dynamic_rstar(32, 8)); - testset::interprocess::additional(bgi::dynamic_rstar(32, 8)); + testset::interprocess::modifiers_and_additional(bgi::dynamic_rstar(32, 8)); return 0; } diff --git a/index/test/rtree/interprocess/test_interprocess.hpp b/index/test/rtree/interprocess/test_interprocess.hpp index 471f9fa15..7f061b00c 100644 --- a/index/test/rtree/interprocess/test_interprocess.hpp +++ b/index/test/rtree/interprocess/test_interprocess.hpp @@ -81,4 +81,21 @@ void additional(Parameters const& parameters = Parameters()) testset::additional(parameters, shmem_alloc(segment.get_segment_manager())); } -}} \ No newline at end of file +template +void modifiers_and_additional(Parameters const& parameters = Parameters()) +{ + namespace bi = boost::interprocess; + struct shm_remove + { + shm_remove() { bi::shared_memory_object::remove("shmem"); } + ~shm_remove(){ bi::shared_memory_object::remove("shmem"); } + } remover; + + bi::managed_shared_memory segment(bi::create_only, "shmem", 65535); + typedef bi::allocator shmem_alloc; + + testset::modifiers(parameters, shmem_alloc(segment.get_segment_manager())); + testset::additional(parameters, shmem_alloc(segment.get_segment_manager())); +} + +}} diff --git a/index/test/rtree/test_rtree.hpp b/index/test/rtree/test_rtree.hpp index de15f6913..0d259ae62 100644 --- a/index/test/rtree/test_rtree.hpp +++ b/index/test/rtree/test_rtree.hpp @@ -16,9 +16,6 @@ #include -// TEST -//#define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL -//#define BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_TYPE_ERASED_ITERATORS #include #include @@ -645,6 +642,14 @@ void exactly_the_same_outputs(Rtree const& rtree, Range1 const& output, Range2 c } } +// alternative version of std::copy taking iterators of differnet types +template +void copy_alt(First first, Last last, Out out) +{ + for ( ; first != last ; ++first, ++out ) + *out = *first; +} + // spatial query template @@ -668,23 +673,26 @@ void spatial_query(Rtree & rtree, Predicates const& pred, std::vector con exactly_the_same_outputs(rtree, output, rtree | bgi::adaptors::queried(pred)); -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL std::vector output3; - std::copy(rtree.qbegin(pred), rtree.qend(pred), std::back_inserter(output3)); + std::copy(rtree.qbegin(pred), rtree.qend(), std::back_inserter(output3)); compare_outputs(rtree, output3, expected_output); -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_TYPE_ERASED_ITERATORS + std::vector output4; + std::copy(qbegin(rtree, pred), qend(rtree), std::back_inserter(output4)); + + exactly_the_same_outputs(rtree, output3, output4); + +#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL { - typedef typename Rtree::const_query_iterator QI; - QI first = rtree.qbegin(pred); - QI last = rtree.qend(pred); std::vector output4; - std::copy(first, last, std::back_inserter(output4)); + std::copy(rtree.qbegin_(pred), rtree.qend_(pred), std::back_inserter(output4)); + compare_outputs(rtree, output4, expected_output); + output4.clear(); + copy_alt(rtree.qbegin_(pred), rtree.qend_(), std::back_inserter(output4)); compare_outputs(rtree, output4, expected_output); } #endif -#endif } // rtree specific queries tests @@ -734,8 +742,6 @@ void disjoint(Rtree const& tree, std::vector const& input, Box const& qbo spatial_query(tree, bgi::disjoint(qpoly), expected_output);*/ } -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL - template struct contains_impl { @@ -778,8 +784,6 @@ void contains(Rtree const& tree, std::vector const& input, Box const& qbo >::apply(tree, input, qbox); } -#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL - template void covered_by(Rtree const& tree, std::vector const& input, Box const& qbox) { @@ -800,8 +804,6 @@ void covered_by(Rtree const& tree, std::vector const& input, Box const& q spatial_query(tree, bgi::covered_by(qpoly), expected_output);*/ } -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL - template struct covers_impl { @@ -844,8 +846,6 @@ void covers(Rtree const& tree, std::vector const& input, Box const& qbox) >::apply(tree, input, qbox); } -#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL - template struct overlaps_impl { @@ -1039,23 +1039,21 @@ void nearest_query_k(Rtree const& rtree, std::vector const& input, Point exactly_the_same_outputs(rtree, output, output2); -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL std::vector output3; - std::copy(rtree.qbegin(bgi::nearest(pt, k)), rtree.qend(bgi::nearest(pt, k)), std::back_inserter(output3)); + std::copy(rtree.qbegin(bgi::nearest(pt, k)), rtree.qend(), std::back_inserter(output3)); compare_nearest_outputs(rtree, output3, expected_output, pt, greatest_distance); -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_ENABLE_TYPE_ERASED_ITERATORS +#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL { - typedef typename Rtree::const_query_iterator QI; - QI first = rtree.qbegin(bgi::nearest(pt, k)); - QI last = rtree.qend(bgi::nearest(pt, k)); std::vector output4; - std::copy(first, last, std::back_inserter(output4)); + std::copy(rtree.qbegin_(bgi::nearest(pt, k)), rtree.qend_(bgi::nearest(pt, k)), std::back_inserter(output4)); + compare_nearest_outputs(rtree, output4, expected_output, pt, greatest_distance); + output4.clear(); + copy_alt(rtree.qbegin_(bgi::nearest(pt, k)), rtree.qend_(), std::back_inserter(output4)); compare_nearest_outputs(rtree, output4, expected_output, pt, greatest_distance); } #endif -#endif } // rtree nearest not found @@ -1420,10 +1418,8 @@ void queries(Rtree const& tree, std::vector const& input, Box const& qbox basictest::overlaps(tree, input, qbox); //basictest::touches(tree, input, qbox); basictest::within(tree, input, qbox); -#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL basictest::contains(tree, input, qbox); basictest::covers(tree, input, qbox); -#endif typedef typename bg::point_type::type P; P pt; diff --git a/test/algorithms/Jamfile.v2 b/test/algorithms/Jamfile.v2 index 13811d303..438c41c2c 100644 --- a/test/algorithms/Jamfile.v2 +++ b/test/algorithms/Jamfile.v2 @@ -10,24 +10,24 @@ test-suite boost-geometry-algorithms : - [ run append.cpp ] + [ run append.cpp : : : msvc:/bigobj ] [ run area.cpp ] [ run assign.cpp ] [ run buffer.cpp ] - [ run centroid.cpp ] + [ run centroid.cpp : : : msvc:/bigobj ] [ run comparable_distance.cpp ] [ run convex_hull.cpp ] [ run correct.cpp ] - [ run convert.cpp ] + [ run convert.cpp : : : msvc:/bigobj ] [ run covered_by.cpp ] - [ run difference.cpp ] + [ run difference.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE msvc:/bigobj ] [ run disjoint.cpp ] - [ run distance.cpp ] + [ run distance.cpp : : : msvc:/bigobj ] [ run envelope.cpp ] [ run equals.cpp ] [ run expand.cpp ] [ run for_each.cpp ] - [ run intersection.cpp ] + [ run intersection.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE msvc:/bigobj ] [ run intersects.cpp ] [ run length.cpp ] [ run make.cpp ] @@ -37,7 +37,7 @@ test-suite boost-geometry-algorithms [ run simplify.cpp ] [ run touches.cpp ] [ run transform.cpp ] - [ run union.cpp ] + [ run union.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE ] [ run unique.cpp ] [ run within.cpp ] ; diff --git a/test/algorithms/algorithms_tests.sln b/test/algorithms/algorithms_tests.sln deleted file mode 100644 index 96ba06492..000000000 --- a/test/algorithms/algorithms_tests.sln +++ /dev/null @@ -1,193 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "append", "append.vcproj", "{774F6471-D8A0-481C-9B0A-4903EED25C70}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "area", "area.vcproj", "{E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "assign", "assign.vcproj", "{94BC6547-67C1-44DB-903D-526537A91E23}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "expand", "expand.vcproj", "{5330DAB1-DF27-44FC-971B-3C5094F82FA3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "convex_hull", "convex_hull.vcproj", "{0AFF7A85-63A7-4178-92A5-CC692B09F5B9}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "distance", "distance.vcproj", "{347D08A4-22E9-45B1-A55B-AE84AA2EAA53}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "envelope", "envelope.vcproj", "{26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make", "make.vcproj", "{BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simplify", "simplify.vcproj", "{B1760CB8-553B-42AB-B54E-3D0320FF252F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "transform", "transform.vcproj", "{41413E56-08DA-4592-94D2-5311FE90C62B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "buffer", "buffer.vcproj", "{C66E1F6F-84F6-44E2-B5E8-2B127065BE31}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "for_each", "for_each.vcproj", "{774F6471-D8A0-481C-9B0A-4903EAD25B70}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "disjoint", "disjoint.vcproj", "{96D51D96-B35F-47C8-864D-371DF2280686}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "centroid", "centroid.vcproj", "{1E90E5BC-1280-4A6A-B197-132ABBF97EB9}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "intersection", "intersection.vcproj", "{2FD8EDAB-B3C3-4654-B6C3-B25C12A063D3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "correct", "correct.vcproj", "{71582BDA-D4DF-400D-8630-378BE102C038}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "within", "within.vcproj", "{C7BCD670-543D-4B29-B2D6-F3169949F79D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "length", "length.vcproj", "{C4D75B1E-34D5-4A98-8535-A9535BE949E4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "perimeter", "perimeter.vcproj", "{EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "union", "union.vcproj", "{CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "overlaps", "overlaps.vcproj", "{30C37854-9ED6-4C1E-97FB-BF8637BD5811}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "intersects", "intersects.vcproj", "{B1A97F62-85CD-4239-BB56-619988B08260}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "equals", "equals.vcproj", "{E54F493F-BF9D-4A6D-AE2F-5F97AC95251A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "difference", "difference.vcproj", "{4EBFC27A-75C9-43A1-8DDA-AFEB45C564DC}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unique", "unique.vcproj", "{104D31F9-49BA-4A1A-B84F-0A3AEE3C4DB2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reverse", "reverse.vcproj", "{14B5DFC5-D511-4D8C-A231-EE90A05687E1}" -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 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "covered_by", "covered_by.vcproj", "{5ABF0B56-F9F1-4D93-B15A-E3972F45D97B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "touches", "touches.vcproj", "{8359726E-9F03-4300-8F63-1FEAC84251D0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {774F6471-D8A0-481C-9B0A-4903EED25C70}.Debug|Win32.ActiveCfg = Debug|Win32 - {774F6471-D8A0-481C-9B0A-4903EED25C70}.Debug|Win32.Build.0 = Debug|Win32 - {774F6471-D8A0-481C-9B0A-4903EED25C70}.Release|Win32.ActiveCfg = Release|Win32 - {774F6471-D8A0-481C-9B0A-4903EED25C70}.Release|Win32.Build.0 = Release|Win32 - {E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}.Debug|Win32.ActiveCfg = Debug|Win32 - {E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}.Debug|Win32.Build.0 = Debug|Win32 - {E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}.Release|Win32.ActiveCfg = Release|Win32 - {E86E6687-AC05-4DBE-A8BD-C47BCB6AEE90}.Release|Win32.Build.0 = Release|Win32 - {94BC6547-67C1-44DB-903D-526537A91E23}.Debug|Win32.ActiveCfg = Debug|Win32 - {94BC6547-67C1-44DB-903D-526537A91E23}.Debug|Win32.Build.0 = Debug|Win32 - {94BC6547-67C1-44DB-903D-526537A91E23}.Release|Win32.ActiveCfg = Release|Win32 - {94BC6547-67C1-44DB-903D-526537A91E23}.Release|Win32.Build.0 = Release|Win32 - {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Debug|Win32.ActiveCfg = Debug|Win32 - {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Debug|Win32.Build.0 = Debug|Win32 - {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Release|Win32.ActiveCfg = Release|Win32 - {5330DAB1-DF27-44FC-971B-3C5094F82FA3}.Release|Win32.Build.0 = Release|Win32 - {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Debug|Win32.ActiveCfg = Debug|Win32 - {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Debug|Win32.Build.0 = Debug|Win32 - {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Release|Win32.ActiveCfg = Release|Win32 - {0AFF7A85-63A7-4178-92A5-CC692B09F5B9}.Release|Win32.Build.0 = Release|Win32 - {347D08A4-22E9-45B1-A55B-AE84AA2EAA53}.Debug|Win32.ActiveCfg = Debug|Win32 - {347D08A4-22E9-45B1-A55B-AE84AA2EAA53}.Debug|Win32.Build.0 = Debug|Win32 - {347D08A4-22E9-45B1-A55B-AE84AA2EAA53}.Release|Win32.ActiveCfg = Release|Win32 - {347D08A4-22E9-45B1-A55B-AE84AA2EAA53}.Release|Win32.Build.0 = Release|Win32 - {26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}.Debug|Win32.ActiveCfg = Debug|Win32 - {26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}.Debug|Win32.Build.0 = Debug|Win32 - {26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}.Release|Win32.ActiveCfg = Release|Win32 - {26EFCAF4-7907-4A47-ACBF-6CAB738CDCEB}.Release|Win32.Build.0 = Release|Win32 - {BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}.Debug|Win32.ActiveCfg = Debug|Win32 - {BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}.Debug|Win32.Build.0 = Debug|Win32 - {BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}.Release|Win32.ActiveCfg = Release|Win32 - {BCD17F3E-8DF2-4B00-A75E-BF7372D2873B}.Release|Win32.Build.0 = Release|Win32 - {B1760CB8-553B-42AB-B54E-3D0320FF252F}.Debug|Win32.ActiveCfg = Debug|Win32 - {B1760CB8-553B-42AB-B54E-3D0320FF252F}.Debug|Win32.Build.0 = Debug|Win32 - {B1760CB8-553B-42AB-B54E-3D0320FF252F}.Release|Win32.ActiveCfg = Release|Win32 - {B1760CB8-553B-42AB-B54E-3D0320FF252F}.Release|Win32.Build.0 = Release|Win32 - {41413E56-08DA-4592-94D2-5311FE90C62B}.Debug|Win32.ActiveCfg = Debug|Win32 - {41413E56-08DA-4592-94D2-5311FE90C62B}.Debug|Win32.Build.0 = Debug|Win32 - {41413E56-08DA-4592-94D2-5311FE90C62B}.Release|Win32.ActiveCfg = Release|Win32 - {41413E56-08DA-4592-94D2-5311FE90C62B}.Release|Win32.Build.0 = Release|Win32 - {C66E1F6F-84F6-44E2-B5E8-2B127065BE31}.Debug|Win32.ActiveCfg = Debug|Win32 - {C66E1F6F-84F6-44E2-B5E8-2B127065BE31}.Debug|Win32.Build.0 = Debug|Win32 - {C66E1F6F-84F6-44E2-B5E8-2B127065BE31}.Release|Win32.ActiveCfg = Release|Win32 - {C66E1F6F-84F6-44E2-B5E8-2B127065BE31}.Release|Win32.Build.0 = Release|Win32 - {774F6471-D8A0-481C-9B0A-4903EAD25B70}.Debug|Win32.ActiveCfg = Debug|Win32 - {774F6471-D8A0-481C-9B0A-4903EAD25B70}.Debug|Win32.Build.0 = Debug|Win32 - {774F6471-D8A0-481C-9B0A-4903EAD25B70}.Release|Win32.ActiveCfg = Release|Win32 - {774F6471-D8A0-481C-9B0A-4903EAD25B70}.Release|Win32.Build.0 = Release|Win32 - {96D51D96-B35F-47C8-864D-371DF2280686}.Debug|Win32.ActiveCfg = Debug|Win32 - {96D51D96-B35F-47C8-864D-371DF2280686}.Debug|Win32.Build.0 = Debug|Win32 - {96D51D96-B35F-47C8-864D-371DF2280686}.Release|Win32.ActiveCfg = Release|Win32 - {96D51D96-B35F-47C8-864D-371DF2280686}.Release|Win32.Build.0 = Release|Win32 - {1E90E5BC-1280-4A6A-B197-132ABBF97EB9}.Debug|Win32.ActiveCfg = Debug|Win32 - {1E90E5BC-1280-4A6A-B197-132ABBF97EB9}.Debug|Win32.Build.0 = Debug|Win32 - {1E90E5BC-1280-4A6A-B197-132ABBF97EB9}.Release|Win32.ActiveCfg = Release|Win32 - {1E90E5BC-1280-4A6A-B197-132ABBF97EB9}.Release|Win32.Build.0 = Release|Win32 - {2FD8EDAB-B3C3-4654-B6C3-B25C12A063D3}.Debug|Win32.ActiveCfg = Debug|Win32 - {2FD8EDAB-B3C3-4654-B6C3-B25C12A063D3}.Debug|Win32.Build.0 = Debug|Win32 - {2FD8EDAB-B3C3-4654-B6C3-B25C12A063D3}.Release|Win32.ActiveCfg = Release|Win32 - {2FD8EDAB-B3C3-4654-B6C3-B25C12A063D3}.Release|Win32.Build.0 = Release|Win32 - {71582BDA-D4DF-400D-8630-378BE102C038}.Debug|Win32.ActiveCfg = Debug|Win32 - {71582BDA-D4DF-400D-8630-378BE102C038}.Debug|Win32.Build.0 = Debug|Win32 - {71582BDA-D4DF-400D-8630-378BE102C038}.Release|Win32.ActiveCfg = Release|Win32 - {71582BDA-D4DF-400D-8630-378BE102C038}.Release|Win32.Build.0 = Release|Win32 - {C7BCD670-543D-4B29-B2D6-F3169949F79D}.Debug|Win32.ActiveCfg = Debug|Win32 - {C7BCD670-543D-4B29-B2D6-F3169949F79D}.Debug|Win32.Build.0 = Debug|Win32 - {C7BCD670-543D-4B29-B2D6-F3169949F79D}.Release|Win32.ActiveCfg = Release|Win32 - {C7BCD670-543D-4B29-B2D6-F3169949F79D}.Release|Win32.Build.0 = Release|Win32 - {C4D75B1E-34D5-4A98-8535-A9535BE949E4}.Debug|Win32.ActiveCfg = Debug|Win32 - {C4D75B1E-34D5-4A98-8535-A9535BE949E4}.Debug|Win32.Build.0 = Debug|Win32 - {C4D75B1E-34D5-4A98-8535-A9535BE949E4}.Release|Win32.ActiveCfg = Release|Win32 - {C4D75B1E-34D5-4A98-8535-A9535BE949E4}.Release|Win32.Build.0 = Release|Win32 - {EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}.Debug|Win32.ActiveCfg = Debug|Win32 - {EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}.Debug|Win32.Build.0 = Debug|Win32 - {EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}.Release|Win32.ActiveCfg = Release|Win32 - {EFC23FC0-86D3-4C81-A218-26F0D5A4D50B}.Release|Win32.Build.0 = Release|Win32 - {CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}.Debug|Win32.ActiveCfg = Debug|Win32 - {CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}.Debug|Win32.Build.0 = Debug|Win32 - {CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}.Release|Win32.ActiveCfg = Release|Win32 - {CA5EE1D6-CB4B-4A15-85C5-31D5C00289C4}.Release|Win32.Build.0 = Release|Win32 - {30C37854-9ED6-4C1E-97FB-BF8637BD5811}.Debug|Win32.ActiveCfg = Debug|Win32 - {30C37854-9ED6-4C1E-97FB-BF8637BD5811}.Debug|Win32.Build.0 = Debug|Win32 - {30C37854-9ED6-4C1E-97FB-BF8637BD5811}.Release|Win32.ActiveCfg = Release|Win32 - {30C37854-9ED6-4C1E-97FB-BF8637BD5811}.Release|Win32.Build.0 = Release|Win32 - {B1A97F62-85CD-4239-BB56-619988B08260}.Debug|Win32.ActiveCfg = Debug|Win32 - {B1A97F62-85CD-4239-BB56-619988B08260}.Debug|Win32.Build.0 = Debug|Win32 - {B1A97F62-85CD-4239-BB56-619988B08260}.Release|Win32.ActiveCfg = Release|Win32 - {B1A97F62-85CD-4239-BB56-619988B08260}.Release|Win32.Build.0 = Release|Win32 - {E54F493F-BF9D-4A6D-AE2F-5F97AC95251A}.Debug|Win32.ActiveCfg = Debug|Win32 - {E54F493F-BF9D-4A6D-AE2F-5F97AC95251A}.Debug|Win32.Build.0 = Debug|Win32 - {E54F493F-BF9D-4A6D-AE2F-5F97AC95251A}.Release|Win32.ActiveCfg = Release|Win32 - {E54F493F-BF9D-4A6D-AE2F-5F97AC95251A}.Release|Win32.Build.0 = Release|Win32 - {4EBFC27A-75C9-43A1-8DDA-AFEB45C564DC}.Debug|Win32.ActiveCfg = Debug|Win32 - {4EBFC27A-75C9-43A1-8DDA-AFEB45C564DC}.Debug|Win32.Build.0 = Debug|Win32 - {4EBFC27A-75C9-43A1-8DDA-AFEB45C564DC}.Release|Win32.ActiveCfg = Release|Win32 - {4EBFC27A-75C9-43A1-8DDA-AFEB45C564DC}.Release|Win32.Build.0 = Release|Win32 - {104D31F9-49BA-4A1A-B84F-0A3AEE3C4DB2}.Debug|Win32.ActiveCfg = Debug|Win32 - {104D31F9-49BA-4A1A-B84F-0A3AEE3C4DB2}.Debug|Win32.Build.0 = Debug|Win32 - {104D31F9-49BA-4A1A-B84F-0A3AEE3C4DB2}.Release|Win32.ActiveCfg = Release|Win32 - {104D31F9-49BA-4A1A-B84F-0A3AEE3C4DB2}.Release|Win32.Build.0 = Release|Win32 - {14B5DFC5-D511-4D8C-A231-EE90A05687E1}.Debug|Win32.ActiveCfg = Debug|Win32 - {14B5DFC5-D511-4D8C-A231-EE90A05687E1}.Debug|Win32.Build.0 = Debug|Win32 - {14B5DFC5-D511-4D8C-A231-EE90A05687E1}.Release|Win32.ActiveCfg = Release|Win32 - {14B5DFC5-D511-4D8C-A231-EE90A05687E1}.Release|Win32.Build.0 = Release|Win32 - {F11970B5-BE16-4FF5-9780-4C15082B76A0}.Debug|Win32.ActiveCfg = Debug|Win32 - {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 - {5ABF0B56-F9F1-4D93-B15A-E3972F45D97B}.Debug|Win32.ActiveCfg = Debug|Win32 - {5ABF0B56-F9F1-4D93-B15A-E3972F45D97B}.Debug|Win32.Build.0 = Debug|Win32 - {5ABF0B56-F9F1-4D93-B15A-E3972F45D97B}.Release|Win32.ActiveCfg = Release|Win32 - {5ABF0B56-F9F1-4D93-B15A-E3972F45D97B}.Release|Win32.Build.0 = Release|Win32 - {8359726E-9F03-4300-8F63-1FEAC84251D0}.Debug|Win32.ActiveCfg = Debug|Win32 - {8359726E-9F03-4300-8F63-1FEAC84251D0}.Debug|Win32.Build.0 = Debug|Win32 - {8359726E-9F03-4300-8F63-1FEAC84251D0}.Release|Win32.ActiveCfg = Release|Win32 - {8359726E-9F03-4300-8F63-1FEAC84251D0}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/algorithms/append.vcproj b/test/algorithms/append.vcproj deleted file mode 100644 index b162dd1b0..000000000 --- a/test/algorithms/append.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/area.vcproj b/test/algorithms/area.vcproj deleted file mode 100644 index e091e28fa..000000000 --- a/test/algorithms/area.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/assign.vcproj b/test/algorithms/assign.vcproj deleted file mode 100644 index 50214b53b..000000000 --- a/test/algorithms/assign.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/buffer.vcproj b/test/algorithms/buffer.vcproj deleted file mode 100644 index 60514c768..000000000 --- a/test/algorithms/buffer.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/centroid.cpp b/test/algorithms/centroid.cpp index 90eca01ab..607eb86c4 100644 --- a/test/algorithms/centroid.cpp +++ b/test/algorithms/centroid.cpp @@ -51,6 +51,8 @@ void test_2d() test_centroid >("LINESTRING(0 0,0 4, 4 4)", 1.0, 3.0); test_centroid >("LINESTRING(0 0,3 3,0 6,3 9,0 12)", 1.5, 6.0); + test_centroid >("LINESTRING(1 1, 3 3)", 2.0, 2.0); + test_centroid >( "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))", @@ -82,6 +84,7 @@ void test_3d() test_centroid >("LINESTRING(1 2 3,4 5 -6,7 -8 9,-10 11 12,13 -14 -15, 16 17 18)", 5.6748865168734692, 0.31974938587214002, 1.9915270387763671); test_centroid >("POLYGON((1 2 3,5 6 7))", 3, 4, 5); + test_centroid >("LINESTRING(1 1 1,3 3 3)", 2, 2, 2); test_centroid

("POINT(1 2 3)", 1, 2, 3); } diff --git a/test/algorithms/centroid.vcproj b/test/algorithms/centroid.vcproj deleted file mode 100644 index 5c908c654..000000000 --- a/test/algorithms/centroid.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/comparable_distance.vcproj b/test/algorithms/comparable_distance.vcproj deleted file mode 100644 index cf9b8ea41..000000000 --- a/test/algorithms/comparable_distance.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/convert.vcproj b/test/algorithms/convert.vcproj deleted file mode 100644 index c75bf0ee5..000000000 --- a/test/algorithms/convert.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/convex_hull.vcproj b/test/algorithms/convex_hull.vcproj deleted file mode 100644 index 365f60c0f..000000000 --- a/test/algorithms/convex_hull.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/correct.vcproj b/test/algorithms/correct.vcproj deleted file mode 100644 index e36945a2d..000000000 --- a/test/algorithms/correct.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/covered_by.vcproj b/test/algorithms/covered_by.vcproj deleted file mode 100644 index 13f41e930..000000000 --- a/test/algorithms/covered_by.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/detail/detail.sln b/test/algorithms/detail/detail.sln deleted file mode 100644 index 394921ecc..000000000 --- a/test/algorithms/detail/detail.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "partition", "partition.vcproj", "{5EF21715-DB87-41AB-9D0A-59ED04F316A1}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5EF21715-DB87-41AB-9D0A-59ED04F316A1}.Debug|Win32.ActiveCfg = Debug|Win32 - {5EF21715-DB87-41AB-9D0A-59ED04F316A1}.Debug|Win32.Build.0 = Debug|Win32 - {5EF21715-DB87-41AB-9D0A-59ED04F316A1}.Release|Win32.ActiveCfg = Release|Win32 - {5EF21715-DB87-41AB-9D0A-59ED04F316A1}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/algorithms/detail/partition.vcproj b/test/algorithms/detail/partition.vcproj deleted file mode 100644 index 66e26a973..000000000 --- a/test/algorithms/detail/partition.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/detail/sections/range_by_section.vcproj b/test/algorithms/detail/sections/range_by_section.vcproj deleted file mode 100644 index 0d7ffb6cf..000000000 --- a/test/algorithms/detail/sections/range_by_section.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/detail/sections/sectionalize.sln b/test/algorithms/detail/sections/sectionalize.sln deleted file mode 100644 index 5b2ae402b..000000000 --- a/test/algorithms/detail/sections/sectionalize.sln +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sectionalize", "sectionalize.vcproj", "{50410F81-7B83-49D9-BDAE-FA3F0ADB2ADC}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "range_by_section", "range_by_section.vcproj", "{A91434CB-CB32-48AE-8C74-81B6A1EB342F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {50410F81-7B83-49D9-BDAE-FA3F0ADB2ADC}.Debug|Win32.ActiveCfg = Debug|Win32 - {50410F81-7B83-49D9-BDAE-FA3F0ADB2ADC}.Debug|Win32.Build.0 = Debug|Win32 - {50410F81-7B83-49D9-BDAE-FA3F0ADB2ADC}.Release|Win32.ActiveCfg = Release|Win32 - {50410F81-7B83-49D9-BDAE-FA3F0ADB2ADC}.Release|Win32.Build.0 = Release|Win32 - {A91434CB-CB32-48AE-8C74-81B6A1EB342F}.Debug|Win32.ActiveCfg = Debug|Win32 - {A91434CB-CB32-48AE-8C74-81B6A1EB342F}.Debug|Win32.Build.0 = Debug|Win32 - {A91434CB-CB32-48AE-8C74-81B6A1EB342F}.Release|Win32.ActiveCfg = Release|Win32 - {A91434CB-CB32-48AE-8C74-81B6A1EB342F}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/algorithms/detail/sections/sectionalize.vcproj b/test/algorithms/detail/sections/sectionalize.vcproj deleted file mode 100644 index 7c7ee5ac8..000000000 --- a/test/algorithms/detail/sections/sectionalize.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/difference.cpp b/test/algorithms/difference.cpp index acc9284d5..a9ac9b1e0 100644 --- a/test/algorithms/difference.cpp +++ b/test/algorithms/difference.cpp @@ -7,20 +7,6 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// #define TEST_ISOVIST - -//#define HAVE_TTMATH - -//#define BOOST_GEOMETRY_CHECK_WITH_POSTGIS - -//#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER -//#define BOOST_GEOMETRY_DEBUG_INTERSECTION -//#define BOOST_GEOMETRY_DEBUG_TRAVERSE -//#define BOOST_GEOMETRY_DEBUG_FOLLOW -//#define BOOST_GEOMETRY_DEBUG_ASSEMBLE -//#define BOOST_GEOMETRY_DEBUG_IDENTIFIER - - #include #include #include @@ -35,9 +21,6 @@ #include -//#include -//#include - #include #include #include @@ -258,8 +241,8 @@ void test_all() { test_one("buffer_mp2", buffer_mp2[0], buffer_mp2[1], - 1, 92, 12.09857, - 1, 157, 24.19787); + 1, 91, 12.09857, + 1, 156, 24.19787); } /*** TODO: self-tangencies for difference @@ -295,7 +278,7 @@ void test_all() test_one("ggl_list_20110307_javier", ggl_list_20110307_javier[0], ggl_list_20110307_javier[1], - 1, 13, 16815.6, + 1, if_typed(14, 13), 16815.6, 1, 4, 3200.4, 0.01); @@ -326,13 +309,20 @@ void test_all() // Boost.Geometry gives results depending on FP-type, and compiler, and operating system. // For double, it is zero (skipped). On gcc/Linux, for float either. // Because we cannot predict this, we only test for MSVC - test_one("ggl_list_20110627_phillip", - ggl_list_20110627_phillip[0], ggl_list_20110627_phillip[1], - if_typed_tt(1, 0), -1, - if_typed_tt(0.0000000000001105367, 0.0), - 1, -1, 3577.40960816756, - 0.01 - ); + if (boost::is_same::value +#if defined(HAVE_TTMATH) + || boost::is_same::value +#endif + ) + { + test_one("ggl_list_20110627_phillip", + ggl_list_20110627_phillip[0], ggl_list_20110627_phillip[1], + if_typed_tt(1, 0), -1, + if_typed_tt(0.0000000000001105367, 0.0), + 1, -1, 3577.40960816756, + 0.01 + ); + } #endif // Other combi's diff --git a/test/algorithms/difference.vcproj b/test/algorithms/difference.vcproj deleted file mode 100644 index 2302ee27f..000000000 --- a/test/algorithms/difference.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/disjoint.vcproj b/test/algorithms/disjoint.vcproj deleted file mode 100644 index d27526cc7..000000000 --- a/test/algorithms/disjoint.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/distance.cpp b/test/algorithms/distance.cpp index e7d072976..ab7fc5bf6 100644 --- a/test/algorithms/distance.cpp +++ b/test/algorithms/distance.cpp @@ -71,12 +71,12 @@ void test_distance_point() { // Test custom strategy - BOOST_CONCEPT_ASSERT( (bg::concept::PointDistanceStrategy >) ); + BOOST_CONCEPT_ASSERT( (bg::concept::PointDistanceStrategy) ); - typedef typename services::return_type >::type cab_return_type; + typedef typename services::return_type::type cab_return_type; BOOST_MPL_ASSERT((boost::is_same::type>)); - taxicab_distance

tcd; + taxicab_distance tcd; cab_return_type d = bg::distance(p1, p2, tcd); BOOST_CHECK( bg::math::abs(d - cab_return_type(2)) <= cab_return_type(0.01) ); @@ -90,7 +90,7 @@ void test_distance_point() strategy_type strategy; comparable_strategy_type comparable_strategy = services::get_comparable::apply(strategy); - return_type comparable = services::result_from_distance::apply(comparable_strategy, 3); + return_type comparable = services::result_from_distance::apply(comparable_strategy, 3); BOOST_CHECK_CLOSE(comparable, return_type(9), 0.001); } @@ -145,7 +145,7 @@ void test_distance_segment() BOOST_CHECK_CLOSE(d1, return_type(1), 0.001); // 3) custom point strategy - taxicab_distance

tcd; + taxicab_distance tcd; d1 = bg::distance(p1, seg, tcd); BOOST_CHECK_CLOSE(d1, return_type(1), 0.001); } diff --git a/test/algorithms/distance.vcproj b/test/algorithms/distance.vcproj deleted file mode 100644 index 831fafbaa..000000000 --- a/test/algorithms/distance.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/envelope.vcproj b/test/algorithms/envelope.vcproj deleted file mode 100644 index aa26c762b..000000000 --- a/test/algorithms/envelope.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/equals.vcproj b/test/algorithms/equals.vcproj deleted file mode 100644 index 64697ef87..000000000 --- a/test/algorithms/equals.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/expand.vcproj b/test/algorithms/expand.vcproj deleted file mode 100644 index 7fb588e5d..000000000 --- a/test/algorithms/expand.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/for_each.vcproj b/test/algorithms/for_each.vcproj deleted file mode 100644 index 453064a3b..000000000 --- a/test/algorithms/for_each.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/intersection.cpp b/test/algorithms/intersection.cpp index ba303e24f..e176e2356 100644 --- a/test/algorithms/intersection.cpp +++ b/test/algorithms/intersection.cpp @@ -15,17 +15,8 @@ #include #include -#define BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE #define TEST_ISOVIST -//#define BOOST_GEOMETRY_DEBUG_SEGMENT_IDENTIFIER -//#define BOOST_GEOMETRY_DEBUG_INTERSECTION -//#define BOOST_GEOMETRY_DEBUG_TRAVERSE -//#define BOOST_GEOMETRY_DEBUG_FOLLOW -//#define BOOST_GEOMETRY_DEBUG_ASSEMBLE -//#define BOOST_GEOMETRY_DEBUG_IDENTIFIER - - #include #include @@ -166,6 +157,9 @@ void test_areal() 3, 0, 1.5); typedef typename bg::coordinate_type::type ct; + bool const ccw = bg::point_order::value == bg::counterclockwise; + bool const open = bg::closure::value == bg::open; + #ifdef TEST_ISOVIST #ifdef _MSC_VER @@ -182,11 +176,18 @@ void test_areal() //std::cout << typeid(ct).name() << std::endl; - test_one("ggl_list_20110306_javier", - ggl_list_20110306_javier[0], ggl_list_20110306_javier[1], - 1, if_typed_tt(5, 4), - 0.6649875, - if_typed(1.0, 0.01)); + if (! ccw && open) + { + // Pointcount for ttmath/double (both 5) or float (4) + // double returns 5 (since method append_no_dups_or_spikes) + // but not for ccw/open. Those cases has to be adapted once, anyway, + // because for open always one point too much is generated... + test_one("ggl_list_20110306_javier", + ggl_list_20110306_javier[0], ggl_list_20110306_javier[1], + 1, if_typed(4, 5), + 0.6649875, + if_typed(1.0, 0.01)); + } test_one("ggl_list_20110307_javier", ggl_list_20110307_javier[0], ggl_list_20110307_javier[1], @@ -202,7 +203,7 @@ void test_areal() test_one("ggl_list_20110716_enrico", ggl_list_20110716_enrico[0], ggl_list_20110716_enrico[1], 3, - if_typed(19, if_typed(22, 21)), + if_typed(19, 21), 35723.8506317139); } #endif @@ -216,6 +217,12 @@ void test_areal() test_one("ticket_8254", ticket_8254[0], ticket_8254[1], 1, 4, 3.63593e-08, 0.01); + test_one("ticket_6958", ticket_6958[0], ticket_6958[1], + 1, 4, 4.34355e-05, 0.01); + + test_one("ticket_8652", ticket_8652[0], ticket_8652[1], + 1, 4, 0.0003, 0.00001); + test_one("buffer_mp1", buffer_mp1[0], buffer_mp1[1], 1, 31, 2.271707796); diff --git a/test/algorithms/intersection.vcproj b/test/algorithms/intersection.vcproj deleted file mode 100644 index a9bc3a6f3..000000000 --- a/test/algorithms/intersection.vcproj +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/intersects.cpp b/test/algorithms/intersects.cpp index feafb0437..adef1141f 100644 --- a/test/algorithms/intersects.cpp +++ b/test/algorithms/intersects.cpp @@ -1,6 +1,8 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// // 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) @@ -150,16 +152,48 @@ void test_all() true); } - +// Those tests won't pass for rational<> because numeric_limits<> isn't specialized for this type +template +void test_additional() +{ + test_geometry, bg::model::box

>( + "SEGMENT(0 0,3 3)", + "BOX(1 2,3 5)", + true); + test_geometry, bg::model::box

>( + "SEGMENT(1 1,2 3)", + "BOX(0 0,4 4)", + true); + test_geometry, bg::model::box

>( + "SEGMENT(1 1,1 1)", + "BOX(1 0,3 5)", + true); + test_geometry, bg::model::box

>( + "SEGMENT(0 1,0 1)", + "BOX(1 0,3 5)", + false); + test_geometry, bg::model::box

>( + "SEGMENT(2 1,2 1)", + "BOX(1 0,3 5)", + true); + test_geometry, bg::model::box

>( + "LINESTRING(0 0,1 0,10 10)", + "BOX(1 2,3 5)", + true); + test_geometry, bg::model::box

>( + "LINESTRING(1 2)", + "BOX(0 0,3 5)", + true); +} int test_main( int , char* [] ) { test_all >(); + test_additional >(); test_all > >(); - #if defined(HAVE_TTMATH) test_all >(); #endif diff --git a/test/algorithms/intersects.vcproj b/test/algorithms/intersects.vcproj deleted file mode 100644 index f3f5f64db..000000000 --- a/test/algorithms/intersects.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/length.vcproj b/test/algorithms/length.vcproj deleted file mode 100644 index 17058ddcf..000000000 --- a/test/algorithms/length.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/make.vcproj b/test/algorithms/make.vcproj deleted file mode 100644 index 37ee7ce50..000000000 --- a/test/algorithms/make.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlaps.vcproj b/test/algorithms/overlaps.vcproj deleted file mode 100644 index 06a51367f..000000000 --- a/test/algorithms/overlaps.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/assemble.vcproj b/test/algorithms/overlay/assemble.vcproj deleted file mode 100644 index 335b08ab7..000000000 --- a/test/algorithms/overlay/assemble.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/ccw_traverse.vcproj b/test/algorithms/overlay/ccw_traverse.vcproj deleted file mode 100644 index fc373c847..000000000 --- a/test/algorithms/overlay/ccw_traverse.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/dissolver.vcproj b/test/algorithms/overlay/dissolver.vcproj deleted file mode 100644 index c3c9d4bf0..000000000 --- a/test/algorithms/overlay/dissolver.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/enrich_intersection_points.vcproj b/test/algorithms/overlay/enrich_intersection_points.vcproj deleted file mode 100644 index 8880fb1f3..000000000 --- a/test/algorithms/overlay/enrich_intersection_points.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/get_turn_info.vcproj b/test/algorithms/overlay/get_turn_info.vcproj deleted file mode 100644 index 22bf1d1bd..000000000 --- a/test/algorithms/overlay/get_turn_info.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/get_turns.vcproj b/test/algorithms/overlay/get_turns.vcproj deleted file mode 100644 index 8f1b41c0b..000000000 --- a/test/algorithms/overlay/get_turns.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/merge_intersection_points.vcproj b/test/algorithms/overlay/merge_intersection_points.vcproj deleted file mode 100644 index 00afc97f9..000000000 --- a/test/algorithms/overlay/merge_intersection_points.vcproj +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/overlay.sln b/test/algorithms/overlay/overlay.sln deleted file mode 100644 index 9bbaff6f2..000000000 --- a/test/algorithms/overlay/overlay.sln +++ /dev/null @@ -1,61 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "traverse", "traverse.vcproj", "{6260214E-DB6F-4934-ADF7-DD2B1666171B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "self_intersection_points", "self_intersection_points.vcproj", "{06B6DCBB-AEDA-49FA-81D9-EA8959958EFC}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_turn_info", "get_turn_info.vcproj", "{8D98821A-5033-4616-9AF4-2AEAA42D8456}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "get_turns", "get_turns.vcproj", "{B63116BF-0F0C-4374-A6CE-77061FBC34FF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "relative_order", "relative_order.vcproj", "{4C012342-116A-4E5E-9869-90389D5BBEBD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "assemble", "assemble.vcproj", "{306E829F-ACEC-42D5-B1D4-2531B2F56EA3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ccw_traverse", "ccw_traverse.vcproj", "{BA789719-B2FC-405A-9258-E9E4ABCE1791}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "select_rings", "select_rings.vcproj", "{029117F7-1D6A-4A05-9FB7-93E09751C909}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Debug|Win32.ActiveCfg = Debug|Win32 - {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Debug|Win32.Build.0 = Debug|Win32 - {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Release|Win32.ActiveCfg = Release|Win32 - {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Release|Win32.Build.0 = Release|Win32 - {06B6DCBB-AEDA-49FA-81D9-EA8959958EFC}.Debug|Win32.ActiveCfg = Debug|Win32 - {06B6DCBB-AEDA-49FA-81D9-EA8959958EFC}.Debug|Win32.Build.0 = Debug|Win32 - {06B6DCBB-AEDA-49FA-81D9-EA8959958EFC}.Release|Win32.ActiveCfg = Release|Win32 - {06B6DCBB-AEDA-49FA-81D9-EA8959958EFC}.Release|Win32.Build.0 = Release|Win32 - {8D98821A-5033-4616-9AF4-2AEAA42D8456}.Debug|Win32.ActiveCfg = Debug|Win32 - {8D98821A-5033-4616-9AF4-2AEAA42D8456}.Debug|Win32.Build.0 = Debug|Win32 - {8D98821A-5033-4616-9AF4-2AEAA42D8456}.Release|Win32.ActiveCfg = Release|Win32 - {8D98821A-5033-4616-9AF4-2AEAA42D8456}.Release|Win32.Build.0 = Release|Win32 - {B63116BF-0F0C-4374-A6CE-77061FBC34FF}.Debug|Win32.ActiveCfg = Debug|Win32 - {B63116BF-0F0C-4374-A6CE-77061FBC34FF}.Debug|Win32.Build.0 = Debug|Win32 - {B63116BF-0F0C-4374-A6CE-77061FBC34FF}.Release|Win32.ActiveCfg = Release|Win32 - {B63116BF-0F0C-4374-A6CE-77061FBC34FF}.Release|Win32.Build.0 = Release|Win32 - {4C012342-116A-4E5E-9869-90389D5BBEBD}.Debug|Win32.ActiveCfg = Debug|Win32 - {4C012342-116A-4E5E-9869-90389D5BBEBD}.Debug|Win32.Build.0 = Debug|Win32 - {4C012342-116A-4E5E-9869-90389D5BBEBD}.Release|Win32.ActiveCfg = Release|Win32 - {4C012342-116A-4E5E-9869-90389D5BBEBD}.Release|Win32.Build.0 = Release|Win32 - {306E829F-ACEC-42D5-B1D4-2531B2F56EA3}.Debug|Win32.ActiveCfg = Debug|Win32 - {306E829F-ACEC-42D5-B1D4-2531B2F56EA3}.Debug|Win32.Build.0 = Debug|Win32 - {306E829F-ACEC-42D5-B1D4-2531B2F56EA3}.Release|Win32.ActiveCfg = Release|Win32 - {306E829F-ACEC-42D5-B1D4-2531B2F56EA3}.Release|Win32.Build.0 = Release|Win32 - {BA789719-B2FC-405A-9258-E9E4ABCE1791}.Debug|Win32.ActiveCfg = Debug|Win32 - {BA789719-B2FC-405A-9258-E9E4ABCE1791}.Debug|Win32.Build.0 = Debug|Win32 - {BA789719-B2FC-405A-9258-E9E4ABCE1791}.Release|Win32.ActiveCfg = Release|Win32 - {BA789719-B2FC-405A-9258-E9E4ABCE1791}.Release|Win32.Build.0 = Release|Win32 - {029117F7-1D6A-4A05-9FB7-93E09751C909}.Debug|Win32.ActiveCfg = Debug|Win32 - {029117F7-1D6A-4A05-9FB7-93E09751C909}.Debug|Win32.Build.0 = Debug|Win32 - {029117F7-1D6A-4A05-9FB7-93E09751C909}.Release|Win32.ActiveCfg = Release|Win32 - {029117F7-1D6A-4A05-9FB7-93E09751C909}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/algorithms/overlay/overlay_cases.hpp b/test/algorithms/overlay/overlay_cases.hpp index c3e4f356c..33d09c215 100644 --- a/test/algorithms/overlay/overlay_cases.hpp +++ b/test/algorithms/overlay/overlay_cases.hpp @@ -560,6 +560,12 @@ static std::string ticket_5103[2] = "POLYGON((-95269304 222758,-95260668 419862,-95234760 615696,-95192088 808228,-95132906 996442,-95057214 1178814,-94966028 1354074,-94860110 1520444,-94739968 1676908,-94606618 1822450,-94999048 2214880,-95165164 2033778,-95314770 1838706,-95446850 1631442,-95560388 1413510,-95654368 1186434,-95728282 951992,-95781368 711962,-95813626 468376,-95824294 222758,-95269304 222758))" }; +static std::string ticket_6958[2] = + { + "POLYGON((0.63872330997599124913 0.25963790394761232516 , 0.51901482278481125832 0.36860892060212790966 , 0.24443514109589159489 0.62663296470418572426 , 0.41175117865081167778 0.47178476291601745274 , 0.63872330997599124913 0.25963790394761232516))", + "POLYGON((0.52364358028948876367 0.36823021165656988352 , 0.7762673462275415659 0.13443113025277850237 , 0.59446187055393329146 0.29992923303868185281 , 0.52364358028948876367 0.36823021165656988352))" + }; + static std::string ticket_7462[2] = { "POLYGON((0 0 , -0.3681253195 0.9297761917 , 2.421203136 2.034152031 , 2.789328575 1.104375958 , 0 0))", @@ -573,6 +579,12 @@ static std::string ticket_8254[2] = "POLYGON((-0.27224111308522286334 0.57751061210314269534,-0.27201435369399112885 0.57735026899999997152,-0.27224111308522280783 0.57718992589685735872,-0.27224111308522286334 0.57751061210314269534))" }; +static std::string ticket_8652[2] = + { + "POLYGON((0 0, 0.05 0.04, 0.05 0, 0 0))", + "POLYGON((0.02 -2.77556e-17, 0.05 0.02, 0.05 -2.77556e-17, 0.02 -2.77556e-17))" + }; + static std::string ggl_list_20120229_volker[3] = { "POLYGON((1716 1554,2076 2250,2436 2352,2796 1248,3156 2484,3516 2688,3516 2688,3156 2484,2796 1248,2436 2352,2076 2250, 1716 1554))", diff --git a/test/algorithms/overlay/relative_order.vcproj b/test/algorithms/overlay/relative_order.vcproj deleted file mode 100644 index eb577fafe..000000000 --- a/test/algorithms/overlay/relative_order.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/robustness/Jamfile.v2 b/test/algorithms/overlay/robustness/Jamfile.v2 new file mode 100644 index 000000000..d48296d4b --- /dev/null +++ b/test/algorithms/overlay/robustness/Jamfile.v2 @@ -0,0 +1,26 @@ +# Boost.Geometry (aka GGL, Generic Geometry Library) +# +# Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands. +# Copyright (c) 2008-2013 Bruno Lalande, Paris, France. +# Copyright (c) 2009-2013 Mateusz Loskot, London, UK. +# Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +# +# Use, modification and distribution is subject to the Boost Software License, +# Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +project boost-geometry-algorithms-overlay-robustness + : + requirements + . + /boost/program_options//boost_program_options + ; + +exe interior_triangles : interior_triangles.cpp ; +exe intersection_pies : intersection_pies.cpp ; +exe intersection_stars : intersection_stars.cpp ; +exe intersects : intersects.cpp ; +exe random_ellipses_stars : random_ellipses_stars.cpp ; +exe recursive_polygons : recursive_polygons.cpp ; +exe star_comb : star_comb.cpp ; + diff --git a/test/algorithms/overlay/robustness/interior_triangles.cpp b/test/algorithms/overlay/robustness/interior_triangles.cpp index 5dee530b9..baf945dd9 100644 --- a/test/algorithms/overlay/robustness/interior_triangles.cpp +++ b/test/algorithms/overlay/robustness/interior_triangles.cpp @@ -40,7 +40,7 @@ inline void make_polygon(Polygon& polygon, int count_x, int count_y, int index, { for(int k = 0; k < count_y; ++k) { - polygon.inners().push_back(Polygon::inner_container_type::value_type()); + polygon.inners().push_back(typename Polygon::inner_container_type::value_type()); polygon.inners().back().push_back(point_type(offset + j * 10 + 1, k * 10 + 1)); polygon.inners().back().push_back(point_type(offset + j * 10 + 7, k * 10 + 5 + index)); polygon.inners().back().push_back(point_type(offset + j * 10 + 5 + index, k * 10 + 7)); @@ -81,7 +81,6 @@ void test_all(int count, int count_x, int count_y, int offset, p_q_settings cons > polygon; - int index = 0; for(int i = 0; i < count; i++) { test_star_comb(count_x, count_y, offset, settings); diff --git a/test/algorithms/overlay/robustness/interior_triangles.vcproj b/test/algorithms/overlay/robustness/interior_triangles.vcproj deleted file mode 100644 index 831514b3e..000000000 --- a/test/algorithms/overlay/robustness/interior_triangles.vcproj +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/robustness/intersection_pies.vcproj b/test/algorithms/overlay/robustness/intersection_pies.vcproj deleted file mode 100644 index 1ead5e8e9..000000000 --- a/test/algorithms/overlay/robustness/intersection_pies.vcproj +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/robustness/intersection_stars.vcproj b/test/algorithms/overlay/robustness/intersection_stars.vcproj deleted file mode 100644 index 5c41db055..000000000 --- a/test/algorithms/overlay/robustness/intersection_stars.vcproj +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/robustness/intersects.cpp b/test/algorithms/overlay/robustness/intersects.cpp index e16caeb03..6ad26d22a 100644 --- a/test/algorithms/overlay/robustness/intersects.cpp +++ b/test/algorithms/overlay/robustness/intersects.cpp @@ -36,7 +36,7 @@ inline void make_polygon(MultiPolygon& mp, int count_x, int count_y, int index, { for(int k = 0; k < count_y; ++k) { - mp.push_back(MultiPolygon::value_type()); + mp.push_back(typename MultiPolygon::value_type()); mp.back().outer().push_back(point_type(width_x + j * 10 + 1, k * 10 + 1)); mp.back().outer().push_back(point_type(width_x + j * 10 + width_x, k * 10 + 5 + index)); mp.back().outer().push_back(point_type(width_x + j * 10 + 5 + index, k * 10 + 7)); @@ -93,7 +93,6 @@ void test_all(int count, int count_x, int count_y, int width_x, p_q_settings con > multi_polygon; - int index = 0; for(int i = 0; i < count; i++) { test_intersects(count_x, count_y, width_x, settings); diff --git a/test/algorithms/overlay/robustness/intersects.vcproj b/test/algorithms/overlay/robustness/intersects.vcproj deleted file mode 100644 index 8331792e5..000000000 --- a/test/algorithms/overlay/robustness/intersects.vcproj +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/robustness/random_ellipses_stars.vcproj b/test/algorithms/overlay/robustness/random_ellipses_stars.vcproj deleted file mode 100644 index 6f547c6f7..000000000 --- a/test/algorithms/overlay/robustness/random_ellipses_stars.vcproj +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/robustness/recursive_polygons.vcproj b/test/algorithms/overlay/robustness/recursive_polygons.vcproj deleted file mode 100644 index b2cc41335..000000000 --- a/test/algorithms/overlay/robustness/recursive_polygons.vcproj +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/robustness/robustness.sln b/test/algorithms/overlay/robustness/robustness.sln deleted file mode 100644 index dd6ff8821..000000000 --- a/test/algorithms/overlay/robustness/robustness.sln +++ /dev/null @@ -1,55 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "random_ellipses_stars", "random_ellipses_stars.vcproj", "{C16633DE-83F8-40E3-9915-3B9C872C7B1E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "intersection_stars", "intersection_stars.vcproj", "{A76B81BF-B5B4-4D09-BB81-F235647891DE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "intersection_pies", "intersection_pies.vcproj", "{24D92478-7C66-4DD5-A501-30A3D4376E4F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "recursive_polygons", "recursive_polygons.vcproj", "{E1AA569C-858C-4789-A6FF-5CDFB41C59D7}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "star_comb", "star_comb.vcproj", "{6D8C81C1-23CD-469E-8094-E0C01B51E944}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "interior_triangles", "interior_triangles.vcproj", "{7583C2E3-AD74-4C34-8E94-9162F641B215}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "intersects", "intersects.vcproj", "{1AC9B120-3ED0-4444-86E5-1916108943C7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C16633DE-83F8-40E3-9915-3B9C872C7B1E}.Debug|Win32.ActiveCfg = Debug|Win32 - {C16633DE-83F8-40E3-9915-3B9C872C7B1E}.Debug|Win32.Build.0 = Debug|Win32 - {C16633DE-83F8-40E3-9915-3B9C872C7B1E}.Release|Win32.ActiveCfg = Release|Win32 - {C16633DE-83F8-40E3-9915-3B9C872C7B1E}.Release|Win32.Build.0 = Release|Win32 - {A76B81BF-B5B4-4D09-BB81-F235647891DE}.Debug|Win32.ActiveCfg = Debug|Win32 - {A76B81BF-B5B4-4D09-BB81-F235647891DE}.Debug|Win32.Build.0 = Debug|Win32 - {A76B81BF-B5B4-4D09-BB81-F235647891DE}.Release|Win32.ActiveCfg = Release|Win32 - {A76B81BF-B5B4-4D09-BB81-F235647891DE}.Release|Win32.Build.0 = Release|Win32 - {24D92478-7C66-4DD5-A501-30A3D4376E4F}.Debug|Win32.ActiveCfg = Debug|Win32 - {24D92478-7C66-4DD5-A501-30A3D4376E4F}.Debug|Win32.Build.0 = Debug|Win32 - {24D92478-7C66-4DD5-A501-30A3D4376E4F}.Release|Win32.ActiveCfg = Release|Win32 - {24D92478-7C66-4DD5-A501-30A3D4376E4F}.Release|Win32.Build.0 = Release|Win32 - {E1AA569C-858C-4789-A6FF-5CDFB41C59D7}.Debug|Win32.ActiveCfg = Debug|Win32 - {E1AA569C-858C-4789-A6FF-5CDFB41C59D7}.Debug|Win32.Build.0 = Debug|Win32 - {E1AA569C-858C-4789-A6FF-5CDFB41C59D7}.Release|Win32.ActiveCfg = Release|Win32 - {E1AA569C-858C-4789-A6FF-5CDFB41C59D7}.Release|Win32.Build.0 = Release|Win32 - {6D8C81C1-23CD-469E-8094-E0C01B51E944}.Debug|Win32.ActiveCfg = Debug|Win32 - {6D8C81C1-23CD-469E-8094-E0C01B51E944}.Debug|Win32.Build.0 = Debug|Win32 - {6D8C81C1-23CD-469E-8094-E0C01B51E944}.Release|Win32.ActiveCfg = Release|Win32 - {6D8C81C1-23CD-469E-8094-E0C01B51E944}.Release|Win32.Build.0 = Release|Win32 - {7583C2E3-AD74-4C34-8E94-9162F641B215}.Debug|Win32.ActiveCfg = Debug|Win32 - {7583C2E3-AD74-4C34-8E94-9162F641B215}.Debug|Win32.Build.0 = Debug|Win32 - {7583C2E3-AD74-4C34-8E94-9162F641B215}.Release|Win32.ActiveCfg = Release|Win32 - {7583C2E3-AD74-4C34-8E94-9162F641B215}.Release|Win32.Build.0 = Release|Win32 - {1AC9B120-3ED0-4444-86E5-1916108943C7}.Debug|Win32.ActiveCfg = Debug|Win32 - {1AC9B120-3ED0-4444-86E5-1916108943C7}.Debug|Win32.Build.0 = Debug|Win32 - {1AC9B120-3ED0-4444-86E5-1916108943C7}.Release|Win32.ActiveCfg = Release|Win32 - {1AC9B120-3ED0-4444-86E5-1916108943C7}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/algorithms/overlay/robustness/star_comb.cpp b/test/algorithms/overlay/robustness/star_comb.cpp index 8b1269f61..6713c5618 100644 --- a/test/algorithms/overlay/robustness/star_comb.cpp +++ b/test/algorithms/overlay/robustness/star_comb.cpp @@ -60,8 +60,6 @@ void test_all(int count, int star_point_count, int comb_comb_count, double facto bg::model::d2::point_xy, Clockwise, Closed > polygon; - - int index = 0; for(int i = 0; i < count; i++) { test_star_comb(star_point_count, comb_comb_count, factor1, factor2, do_union, settings); diff --git a/test/algorithms/overlay/robustness/star_comb.vcproj b/test/algorithms/overlay/robustness/star_comb.vcproj deleted file mode 100644 index 01a30306a..000000000 --- a/test/algorithms/overlay/robustness/star_comb.vcproj +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/select_rings.vcproj b/test/algorithms/overlay/select_rings.vcproj deleted file mode 100644 index 5706311fc..000000000 --- a/test/algorithms/overlay/select_rings.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/self_intersection_points.vcproj b/test/algorithms/overlay/self_intersection_points.vcproj deleted file mode 100644 index a4cdb8049..000000000 --- a/test/algorithms/overlay/self_intersection_points.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/split_rings.vcproj b/test/algorithms/overlay/split_rings.vcproj deleted file mode 100644 index cb9b6bf78..000000000 --- a/test/algorithms/overlay/split_rings.vcproj +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/overlay/traverse.vcproj b/test/algorithms/overlay/traverse.vcproj deleted file mode 100644 index f5c83a551..000000000 --- a/test/algorithms/overlay/traverse.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/perimeter.vcproj b/test/algorithms/perimeter.vcproj deleted file mode 100644 index a39d1880f..000000000 --- a/test/algorithms/perimeter.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/reverse.vcproj b/test/algorithms/reverse.vcproj deleted file mode 100644 index 9f438a8c2..000000000 --- a/test/algorithms/reverse.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/simplify.vcproj b/test/algorithms/simplify.vcproj deleted file mode 100644 index 3193c8abf..000000000 --- a/test/algorithms/simplify.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/test_difference.hpp b/test/algorithms/test_difference.hpp index c3e34206d..d5b8ab682 100644 --- a/test/algorithms/test_difference.hpp +++ b/test/algorithms/test_difference.hpp @@ -144,7 +144,7 @@ void test_difference(std::string const& caseid, G1 const& g1, G2 const& g2, "difference: " << caseid << " #points expected: " << expected_point_count << " detected: " << n - << " type: " << string_from_type::name() + << " type: " << (type_for_assert_message()) ); } @@ -154,7 +154,7 @@ void test_difference(std::string const& caseid, G1 const& g1, G2 const& g2, "difference: " << caseid << " #outputs expected: " << expected_count << " detected: " << clip.size() - << " type: " << string_from_type::name() + << " type: " << (type_for_assert_message()) ); } diff --git a/test/algorithms/test_distance.hpp b/test/algorithms/test_distance.hpp index 271bdab6e..a28e777ea 100644 --- a/test/algorithms/test_distance.hpp +++ b/test/algorithms/test_distance.hpp @@ -24,9 +24,9 @@ // For a point-segment-distance operation, there is some magic inside // using another point type and casting if necessary. Therefore, // two point-types are necessary. -template struct taxicab_distance { + template static inline typename bg::coordinate_type::type apply( P1 const& p1, P2 const& p2) { @@ -42,59 +42,40 @@ struct taxicab_distance namespace boost { namespace geometry { namespace strategy { namespace distance { namespace services { -template -struct tag > +template <> +struct tag { typedef strategy_tag_distance_point_point type; }; template -struct return_type > +struct return_type { typedef typename coordinate_type::type type; }; -template -struct similar_type, PN1, PN2> +template <> +struct comparable_type { - typedef taxicab_distance type; + typedef taxicab_distance type; }; - -template -struct get_similar, PN1, PN2> +template <> +struct get_comparable { - static inline typename similar_type - < - taxicab_distance, PN1, PN2 - >::type apply(taxicab_distance const& ) - { - return taxicab_distance(); - } -}; - -template -struct comparable_type > -{ - typedef taxicab_distance type; -}; - -template -struct get_comparable > -{ - static inline taxicab_distance apply(taxicab_distance const& input) + static inline taxicab_distance apply(taxicab_distance const& input) { return input; } }; template -struct result_from_distance > +struct result_from_distance { template - static inline typename coordinate_type::type apply(taxicab_distance const& , T const& value) + static inline typename coordinate_type::type apply(taxicab_distance const& , T const& value) { return value; } diff --git a/test/algorithms/test_intersection.hpp b/test/algorithms/test_intersection.hpp index 4594cb19e..119bdfbc7 100644 --- a/test/algorithms/test_intersection.hpp +++ b/test/algorithms/test_intersection.hpp @@ -42,7 +42,7 @@ typename bg::default_area_result::type test_intersection(std::string const& double percentage = 0.0001, bool debug = false) { - static const bool is_line = bg::geometry_id::type::value == 2; + bool const is_line = bg::geometry_id::type::value == 2; if (debug) { @@ -102,7 +102,7 @@ typename bg::default_area_result::type test_intersection(std::string const& "intersection: " << caseid << " #points expected: " << expected_point_count << " detected: " << n - << " type: " << string_from_type::name() + << " type: " << (type_for_assert_message()) ); } @@ -112,7 +112,7 @@ typename bg::default_area_result::type test_intersection(std::string const& "intersection: " << caseid << " #outputs expected: " << expected_count << " detected: " << clip.size() - << " type: " << string_from_type::name() + << " type: " << (type_for_assert_message()) ); } diff --git a/test/algorithms/test_simplify.hpp b/test/algorithms/test_simplify.hpp index 30f0998f7..b5ed1d359 100644 --- a/test/algorithms/test_simplify.hpp +++ b/test/algorithms/test_simplify.hpp @@ -64,18 +64,14 @@ void test_geometry(std::string const& wkt, std::string const& expected, double d // Check using user-specified strategy typedef typename bg::point_type::type point_type; typedef typename bg::cs_tag::type tag; - typedef bg::strategy::distance::projected_point - < - point_type, - point_type - > strategy; + typedef bg::strategy::distance::projected_point strategy; typedef bg::strategy::simplify::douglas_peucker < point_type, strategy > simplify_strategy_type; - BOOST_CONCEPT_ASSERT( (bg::concept::SimplifyStrategy) ); + BOOST_CONCEPT_ASSERT( (bg::concept::SimplifyStrategy) ); bg::simplify(geometry, simplified, distance, simplify_strategy_type()); { diff --git a/test/algorithms/test_union.hpp b/test/algorithms/test_union.hpp index c449c66e3..e05390629 100644 --- a/test/algorithms/test_union.hpp +++ b/test/algorithms/test_union.hpp @@ -96,7 +96,7 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2, "union: " << caseid << " #points expected: " << expected_point_count << " detected: " << n - << " type: " << string_from_type::name() + << " type: " << (type_for_assert_message()) ); } diff --git a/test/algorithms/touches.vcproj b/test/algorithms/touches.vcproj deleted file mode 100644 index 79cc17048..000000000 --- a/test/algorithms/touches.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/transform.vcproj b/test/algorithms/transform.vcproj deleted file mode 100644 index fcf3c902d..000000000 --- a/test/algorithms/transform.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/union.cpp b/test/algorithms/union.cpp index 751825244..1ac747d83 100644 --- a/test/algorithms/union.cpp +++ b/test/algorithms/union.cpp @@ -15,13 +15,8 @@ #include #include -#define BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE #define TEST_ISOVIST -//#define BOOST_GEOMETRY_DEBUG_ASSEMBLE -//#define BOOST_GEOMETRY_DEBUG_IDENTIFIER - - #include #include @@ -148,7 +143,7 @@ void test_areal() test_one("distance_zero", distance_zero[0], distance_zero[1], - 1, 0, 11, 9.0098387); + 1, 0, if_typed(9, 11), 9.0098387); test_one("wrapped_a", wrapped[0], wrapped[1], @@ -229,7 +224,7 @@ void test_areal() test_one("ggl_list_20110627_phillip", ggl_list_20110627_phillip[0], ggl_list_20110627_phillip[1], 1, 0, - if_typed(5, if_typed_tt(8, 7)), + if_typed(5, if_typed_tt(8, 8)), 14729.07145); @@ -254,7 +249,7 @@ void test_areal() isovist1[0], isovist1[1], 1, 0, - if_typed(71, if_typed(70, 73)), + if_typed(72, if_typed(70, 73)), 313.36036462, 0.1); // SQL Server gives: 313.360374193241 @@ -282,17 +277,17 @@ void test_areal() // Robustness issues, followed out buffer-robustness-tests, test them also reverse test_one("buffer_rt_f", buffer_rt_f[0], buffer_rt_f[1], - 1, 0, if_typed(22, 23), 4.60853); + 1, 0, if_typed(21, 23), 4.60853); test_one("buffer_rt_f_rev", buffer_rt_f[1], buffer_rt_f[0], - 1, 0, if_typed(22, 23), 4.60853); + 1, 0, if_typed(21, 23), 4.60853); test_one("buffer_rt_g", buffer_rt_g[0], buffer_rt_g[1], - 1, 0, 17, 16.571); + 1, 0, if_typed(18, 17), 16.571); test_one("buffer_rt_g_rev", buffer_rt_g[1], buffer_rt_g[0], - 1, 0, 17, 16.571); + 1, 0, if_typed(18, 17), 16.571); test_one("buffer_rt_i", buffer_rt_i[0], buffer_rt_i[1], - 1, 0, 13, 13.6569); + 1, 0, if_typed(14, 13), 13.6569); bool test_rt_i_rev = true; #ifndef _MSC_VER @@ -342,17 +337,17 @@ void test_areal() test_one("buffer_rt_t", buffer_rt_t[0], buffer_rt_t[1], 1, 0, if_typed_tt(16, 14), 15.6569); test_one("buffer_rt_t_ref", buffer_rt_t[1], buffer_rt_t[0], - 1, 0, if_typed_tt(16, 14), 15.6569); + 1, 0, if_typed_tt(16, if_typed(15, 14)), 15.6569); test_one("buffer_mp1", buffer_mp1[0], buffer_mp1[1], - 1, 0, 91, 22.815); + 1, 0, if_typed_tt(93, 91), 22.815); if (boost::is_same::type::value) { // Contains robustness issue for collinear-opposite. // In double it delivers a polygon and a hole test_one("buffer_mp2", buffer_mp2[0], buffer_mp2[1], - 1, 1, 218, 36.7535642); + 1, 1, 217, 36.7535642); } else if (boost::is_same::type::value) { @@ -423,10 +418,6 @@ void test_all() int test_main(int, char* []) { test_all >(); -#if defined(HAVE_TTMATH) - std::cout << "Testing TTMATH" << std::endl; - test_all >(); -#endif #if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) test_all >(); diff --git a/test/algorithms/union.vcproj b/test/algorithms/union.vcproj deleted file mode 100644 index a3399b777..000000000 --- a/test/algorithms/union.vcproj +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/unique.vcproj b/test/algorithms/unique.vcproj deleted file mode 100644 index e4a67084e..000000000 --- a/test/algorithms/unique.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/algorithms/within.vcproj b/test/algorithms/within.vcproj deleted file mode 100644 index 89d03ef72..000000000 --- a/test/algorithms/within.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/arithmetic/arithmetic.vcproj b/test/arithmetic/arithmetic.vcproj deleted file mode 100644 index f2d448a33..000000000 --- a/test/arithmetic/arithmetic.vcproj +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/arithmetic/arithmetic_tests.sln b/test/arithmetic/arithmetic_tests.sln deleted file mode 100644 index 37a636a0e..000000000 --- a/test/arithmetic/arithmetic_tests.sln +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "arithmetic", "arithmetic.vcproj", "{4D447233-54DC-4C1B-B8DF-4689590ACF56}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dot_product", "dot_product.vcproj", "{C9CD2A98-3327-4560-A979-4BF506F777A8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4D447233-54DC-4C1B-B8DF-4689590ACF56}.Debug|Win32.ActiveCfg = Debug|Win32 - {4D447233-54DC-4C1B-B8DF-4689590ACF56}.Debug|Win32.Build.0 = Debug|Win32 - {4D447233-54DC-4C1B-B8DF-4689590ACF56}.Release|Win32.ActiveCfg = Release|Win32 - {4D447233-54DC-4C1B-B8DF-4689590ACF56}.Release|Win32.Build.0 = Release|Win32 - {C9CD2A98-3327-4560-A979-4BF506F777A8}.Debug|Win32.ActiveCfg = Debug|Win32 - {C9CD2A98-3327-4560-A979-4BF506F777A8}.Debug|Win32.Build.0 = Debug|Win32 - {C9CD2A98-3327-4560-A979-4BF506F777A8}.Release|Win32.ActiveCfg = Release|Win32 - {C9CD2A98-3327-4560-A979-4BF506F777A8}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/arithmetic/dot_product.vcproj b/test/arithmetic/dot_product.vcproj deleted file mode 100644 index 879b92154..000000000 --- a/test/arithmetic/dot_product.vcproj +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/boost.vsprops b/test/boost.vsprops deleted file mode 100644 index c527810d4..000000000 --- a/test/boost.vsprops +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - diff --git a/test/concepts/concepts_tests.sln b/test/concepts/concepts_tests.sln deleted file mode 100644 index 1430bdcc0..000000000 --- a/test/concepts/concepts_tests.sln +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "linestring_concept", "linestring_concept.vcproj", "{CA8D5E44-7D8F-44A1-900C-35C28890299B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "polygon_concept", "polygon_concept.vcproj", "{306B99D1-576A-4EB6-BF7E-B111CA3807FE}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Debug|Win32.ActiveCfg = Debug|Win32 - {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Debug|Win32.Build.0 = Debug|Win32 - {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Release|Win32.ActiveCfg = Release|Win32 - {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Release|Win32.Build.0 = Release|Win32 - {306B99D1-576A-4EB6-BF7E-B111CA3807FE}.Debug|Win32.ActiveCfg = Debug|Win32 - {306B99D1-576A-4EB6-BF7E-B111CA3807FE}.Debug|Win32.Build.0 = Debug|Win32 - {306B99D1-576A-4EB6-BF7E-B111CA3807FE}.Release|Win32.ActiveCfg = Release|Win32 - {306B99D1-576A-4EB6-BF7E-B111CA3807FE}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/concepts/linestring_concept.vcproj b/test/concepts/linestring_concept.vcproj deleted file mode 100644 index c40b03bf1..000000000 --- a/test/concepts/linestring_concept.vcproj +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/core/access.vcproj b/test/core/access.vcproj deleted file mode 100644 index 845fa4efe..000000000 --- a/test/core/access.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/core/core.sln b/test/core/core.sln deleted file mode 100644 index 9f368dbc0..000000000 --- a/test/core/core.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}") = "access", "access.vcproj", "{5542B963-D229-4393-968F-E62DDCE4B87B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reverse_dispatch", "reverse_dispatch.vcproj", "{EA65AF97-67BC-49C8-9CAF-4136514A41EE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "radian_access", "radian_access.vcproj", "{DE2968B5-DCA6-4D85-A620-7DA111FC0E06}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ring", "ring.vcproj", "{1EE3F112-638F-4447-8F9D-4C5BB3304C3B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5542B963-D229-4393-968F-E62DDCE4B87B}.Debug|Win32.ActiveCfg = Debug|Win32 - {5542B963-D229-4393-968F-E62DDCE4B87B}.Debug|Win32.Build.0 = Debug|Win32 - {5542B963-D229-4393-968F-E62DDCE4B87B}.Release|Win32.ActiveCfg = Release|Win32 - {5542B963-D229-4393-968F-E62DDCE4B87B}.Release|Win32.Build.0 = Release|Win32 - {EA65AF97-67BC-49C8-9CAF-4136514A41EE}.Debug|Win32.ActiveCfg = Debug|Win32 - {EA65AF97-67BC-49C8-9CAF-4136514A41EE}.Debug|Win32.Build.0 = Debug|Win32 - {EA65AF97-67BC-49C8-9CAF-4136514A41EE}.Release|Win32.ActiveCfg = Release|Win32 - {EA65AF97-67BC-49C8-9CAF-4136514A41EE}.Release|Win32.Build.0 = Release|Win32 - {DE2968B5-DCA6-4D85-A620-7DA111FC0E06}.Debug|Win32.ActiveCfg = Debug|Win32 - {DE2968B5-DCA6-4D85-A620-7DA111FC0E06}.Debug|Win32.Build.0 = Debug|Win32 - {DE2968B5-DCA6-4D85-A620-7DA111FC0E06}.Release|Win32.ActiveCfg = Release|Win32 - {DE2968B5-DCA6-4D85-A620-7DA111FC0E06}.Release|Win32.Build.0 = Release|Win32 - {1EE3F112-638F-4447-8F9D-4C5BB3304C3B}.Debug|Win32.ActiveCfg = Debug|Win32 - {1EE3F112-638F-4447-8F9D-4C5BB3304C3B}.Debug|Win32.Build.0 = Debug|Win32 - {1EE3F112-638F-4447-8F9D-4C5BB3304C3B}.Release|Win32.ActiveCfg = Release|Win32 - {1EE3F112-638F-4447-8F9D-4C5BB3304C3B}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/core/radian_access.vcproj b/test/core/radian_access.vcproj deleted file mode 100644 index 5e5613ca0..000000000 --- a/test/core/radian_access.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/core/reverse_dispatch.vcproj b/test/core/reverse_dispatch.vcproj deleted file mode 100644 index 2966d9db4..000000000 --- a/test/core/reverse_dispatch.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/core/ring.vcproj b/test/core/ring.vcproj deleted file mode 100644 index e5e1a90fb..000000000 --- a/test/core/ring.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/geometries/boost_array_as_point.vcproj b/test/geometries/boost_array_as_point.vcproj deleted file mode 100644 index 75008a582..000000000 --- a/test/geometries/boost_array_as_point.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/geometries/boost_fusion.vcproj b/test/geometries/boost_fusion.vcproj deleted file mode 100644 index 95d2b6015..000000000 --- a/test/geometries/boost_fusion.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/geometries/boost_polygon.vcproj b/test/geometries/boost_polygon.vcproj deleted file mode 100644 index f346bb667..000000000 --- a/test/geometries/boost_polygon.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/geometries/boost_polygon_overlay.vcproj b/test/geometries/boost_polygon_overlay.vcproj deleted file mode 100644 index 8f662b36e..000000000 --- a/test/geometries/boost_polygon_overlay.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/geometries/boost_range.vcproj b/test/geometries/boost_range.vcproj deleted file mode 100644 index e6f7455e9..000000000 --- a/test/geometries/boost_range.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/geometries/box.vcproj b/test/geometries/box.vcproj deleted file mode 100644 index 08bf87585..000000000 --- a/test/geometries/box.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/geometries/concepts/check.sln b/test/geometries/concepts/check.sln deleted file mode 100644 index 98293a669..000000000 --- a/test/geometries/concepts/check.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "check", "check.vcproj", "{6260214E-DB6F-4934-ADF7-DD2B1666171B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Debug|Win32.ActiveCfg = Debug|Win32 - {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Debug|Win32.Build.0 = Debug|Win32 - {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Release|Win32.ActiveCfg = Release|Win32 - {6260214E-DB6F-4934-ADF7-DD2B1666171B}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/geometries/concepts/check.vcproj b/test/geometries/concepts/check.vcproj deleted file mode 100644 index 480b4145b..000000000 --- a/test/geometries/concepts/check.vcproj +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/geometries/custom_linestring.vcproj b/test/geometries/custom_linestring.vcproj deleted file mode 100644 index 8dfe0c7eb..000000000 --- a/test/geometries/custom_linestring.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/geometries/geometries_tests.sln b/test/geometries/geometries_tests.sln deleted file mode 100644 index 56097d012..000000000 --- a/test/geometries/geometries_tests.sln +++ /dev/null @@ -1,61 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "box", "box.vcproj", "{EB7B69C6-2D62-43BC-BA18-D15BEB998665}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "custom_linestring", "custom_linestring.vcproj", "{CA8D5E44-7D8F-44A1-900C-35C28890299B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "segment", "segment.vcproj", "{F995B070-62A2-46FE-A676-79AADB71DBD8}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_array_as_point", "boost_array_as_point.vcproj", "{77F84000-D088-46AD-A023-08552101B1C5}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_polygon", "boost_polygon.vcproj", "{6809180F-1E31-42B0-8481-67AC8E9B180B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_range", "boost_range.vcproj", "{8E719071-B525-4F58-832A-AB75FCA8BEA0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_fusion", "boost_fusion.vcproj", "{C218C979-890F-4690-84E0-837DC661CE57}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_polygon_overlay", "boost_polygon_overlay.vcproj", "{93C4EB19-8A0C-437E-9F82-A0DB4A4A5C32}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EB7B69C6-2D62-43BC-BA18-D15BEB998665}.Debug|Win32.ActiveCfg = Debug|Win32 - {EB7B69C6-2D62-43BC-BA18-D15BEB998665}.Debug|Win32.Build.0 = Debug|Win32 - {EB7B69C6-2D62-43BC-BA18-D15BEB998665}.Release|Win32.ActiveCfg = Release|Win32 - {EB7B69C6-2D62-43BC-BA18-D15BEB998665}.Release|Win32.Build.0 = Release|Win32 - {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Debug|Win32.ActiveCfg = Debug|Win32 - {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Debug|Win32.Build.0 = Debug|Win32 - {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Release|Win32.ActiveCfg = Release|Win32 - {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Release|Win32.Build.0 = Release|Win32 - {F995B070-62A2-46FE-A676-79AADB71DBD8}.Debug|Win32.ActiveCfg = Debug|Win32 - {F995B070-62A2-46FE-A676-79AADB71DBD8}.Debug|Win32.Build.0 = Debug|Win32 - {F995B070-62A2-46FE-A676-79AADB71DBD8}.Release|Win32.ActiveCfg = Release|Win32 - {F995B070-62A2-46FE-A676-79AADB71DBD8}.Release|Win32.Build.0 = Release|Win32 - {77F84000-D088-46AD-A023-08552101B1C5}.Debug|Win32.ActiveCfg = Debug|Win32 - {77F84000-D088-46AD-A023-08552101B1C5}.Debug|Win32.Build.0 = Debug|Win32 - {77F84000-D088-46AD-A023-08552101B1C5}.Release|Win32.ActiveCfg = Release|Win32 - {77F84000-D088-46AD-A023-08552101B1C5}.Release|Win32.Build.0 = Release|Win32 - {6809180F-1E31-42B0-8481-67AC8E9B180B}.Debug|Win32.ActiveCfg = Debug|Win32 - {6809180F-1E31-42B0-8481-67AC8E9B180B}.Debug|Win32.Build.0 = Debug|Win32 - {6809180F-1E31-42B0-8481-67AC8E9B180B}.Release|Win32.ActiveCfg = Release|Win32 - {6809180F-1E31-42B0-8481-67AC8E9B180B}.Release|Win32.Build.0 = Release|Win32 - {8E719071-B525-4F58-832A-AB75FCA8BEA0}.Debug|Win32.ActiveCfg = Debug|Win32 - {8E719071-B525-4F58-832A-AB75FCA8BEA0}.Debug|Win32.Build.0 = Debug|Win32 - {8E719071-B525-4F58-832A-AB75FCA8BEA0}.Release|Win32.ActiveCfg = Release|Win32 - {8E719071-B525-4F58-832A-AB75FCA8BEA0}.Release|Win32.Build.0 = Release|Win32 - {C218C979-890F-4690-84E0-837DC661CE57}.Debug|Win32.ActiveCfg = Debug|Win32 - {C218C979-890F-4690-84E0-837DC661CE57}.Debug|Win32.Build.0 = Debug|Win32 - {C218C979-890F-4690-84E0-837DC661CE57}.Release|Win32.ActiveCfg = Release|Win32 - {C218C979-890F-4690-84E0-837DC661CE57}.Release|Win32.Build.0 = Release|Win32 - {93C4EB19-8A0C-437E-9F82-A0DB4A4A5C32}.Debug|Win32.ActiveCfg = Debug|Win32 - {93C4EB19-8A0C-437E-9F82-A0DB4A4A5C32}.Debug|Win32.Build.0 = Debug|Win32 - {93C4EB19-8A0C-437E-9F82-A0DB4A4A5C32}.Release|Win32.ActiveCfg = Release|Win32 - {93C4EB19-8A0C-437E-9F82-A0DB4A4A5C32}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/geometries/segment.vcproj b/test/geometries/segment.vcproj deleted file mode 100644 index a25abee4e..000000000 --- a/test/geometries/segment.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/geometry_test_common.hpp b/test/geometry_test_common.hpp index 689408c77..0b05135be 100644 --- a/test/geometry_test_common.hpp +++ b/test/geometry_test_common.hpp @@ -38,7 +38,7 @@ // Include some always-included-for-testing files #if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST) -// Until Boost fixes it, silence warning issued by clang: +// Until Boost.Test fixes it, silence warning issued by clang: // warning: unused variable 'check_is_close' [-Wunused-variable] #ifdef __clang__ # pragma clang diagnostic push @@ -73,6 +73,15 @@ # include #endif +// For all tests: +// - do NOT use "using namespace boost::geometry" to make clear what is Boost.Geometry +// - use bg:: as short alias +#include +#include +#include +#include +namespace bg = boost::geometry; + template struct string_from_type {}; @@ -130,8 +139,22 @@ inline T if_typed(T value_typed, T value) return boost::is_same::value ? value_typed : value; } +template +inline std::string type_for_assert_message() +{ + bool const ccw = + bg::point_order::value == bg::counterclockwise + || bg::point_order::value == bg::counterclockwise; + bool const open = + bg::closure::value == bg::open + || bg::closure::value == bg::open; - + std::ostringstream out; + out << string_from_type::type>::name() + << (ccw ? " ccw" : "") + << (open ? " open" : ""); + return out.str(); +} struct geographic_policy { @@ -154,12 +177,4 @@ struct mathematical_policy - -// For all tests: -// - do NOT use "using namespace boost::geometry" to make clear what is Boost.Geometry -// - use bg:: as short alias -#include -namespace bg = boost::geometry; - - #endif // GEOMETRY_TEST_GEOMETRY_TEST_COMMON_HPP diff --git a/test/io/wkt/io_wkt_tests.sln b/test/io/wkt/io_wkt_tests.sln deleted file mode 100644 index 626c327bc..000000000 --- a/test/io/wkt/io_wkt_tests.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wkt", "wkt.vcproj", "{1FA2ADE2-F649-4245-951E-A8F5935E7127}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1FA2ADE2-F649-4245-951E-A8F5935E7127}.Debug|Win32.ActiveCfg = Debug|Win32 - {1FA2ADE2-F649-4245-951E-A8F5935E7127}.Debug|Win32.Build.0 = Debug|Win32 - {1FA2ADE2-F649-4245-951E-A8F5935E7127}.Release|Win32.ActiveCfg = Release|Win32 - {1FA2ADE2-F649-4245-951E-A8F5935E7127}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/io/wkt/wkt.vcproj b/test/io/wkt/wkt.vcproj deleted file mode 100644 index 988ee6af7..000000000 --- a/test/io/wkt/wkt.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/iterators/closing_iterator.vcproj b/test/iterators/closing_iterator.vcproj deleted file mode 100644 index e11dc14ef..000000000 --- a/test/iterators/closing_iterator.vcproj +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/iterators/ever_circling_iterator.vcproj b/test/iterators/ever_circling_iterator.vcproj deleted file mode 100644 index ebeddee29..000000000 --- a/test/iterators/ever_circling_iterator.vcproj +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/iterators/iterators.sln b/test/iterators/iterators.sln deleted file mode 100644 index 8b1e55c7e..000000000 --- a/test/iterators/iterators.sln +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ever_circling_iterator", "ever_circling_iterator.vcproj", "{73F8C969-FA1E-4D9D-81F9-35B1206F0C14}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "closing_iterator", "closing_iterator.vcproj", "{04C31A2D-BE88-4FDB-AFFE-EFDFFA9D9C39}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {73F8C969-FA1E-4D9D-81F9-35B1206F0C14}.Debug|Win32.ActiveCfg = Debug|Win32 - {73F8C969-FA1E-4D9D-81F9-35B1206F0C14}.Debug|Win32.Build.0 = Debug|Win32 - {73F8C969-FA1E-4D9D-81F9-35B1206F0C14}.Release|Win32.ActiveCfg = Release|Win32 - {73F8C969-FA1E-4D9D-81F9-35B1206F0C14}.Release|Win32.Build.0 = Release|Win32 - {04C31A2D-BE88-4FDB-AFFE-EFDFFA9D9C39}.Debug|Win32.ActiveCfg = Debug|Win32 - {04C31A2D-BE88-4FDB-AFFE-EFDFFA9D9C39}.Debug|Win32.Build.0 = Debug|Win32 - {04C31A2D-BE88-4FDB-AFFE-EFDFFA9D9C39}.Release|Win32.ActiveCfg = Release|Win32 - {04C31A2D-BE88-4FDB-AFFE-EFDFFA9D9C39}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/multi/algorithms/Jamfile.v2 b/test/multi/algorithms/Jamfile.v2 index 624193c21..1945fe36a 100644 --- a/test/multi/algorithms/Jamfile.v2 +++ b/test/multi/algorithms/Jamfile.v2 @@ -16,13 +16,14 @@ test-suite boost-geometry-multi-algorithms [ run multi_convex_hull.cpp ] [ run multi_correct.cpp ] [ run multi_covered_by.cpp ] - [ run multi_difference.cpp ] + [ run multi_difference.cpp : : : msvc:/bigobj ] + [ run multi_difference_spike.cpp : : : msvc:/bigobj ] [ run multi_disjoint.cpp ] [ run multi_distance.cpp ] [ run multi_envelope.cpp ] [ run multi_equals.cpp ] [ run multi_for_each.cpp ] - [ run multi_intersection.cpp ] + [ run multi_intersection.cpp : : : msvc:/bigobj ] [ run multi_intersects.cpp ] [ run multi_length.cpp ] [ run multi_num_geometries.cpp ] @@ -33,7 +34,7 @@ test-suite boost-geometry-multi-algorithms [ run multi_simplify.cpp ] [ run multi_touches.cpp ] [ run multi_transform.cpp ] - [ run multi_union.cpp ] + [ run multi_union.cpp : : : msvc:/bigobj ] [ run multi_unique.cpp ] [ run multi_within.cpp ] ; diff --git a/test/multi/algorithms/multi_area.vcproj b/test/multi/algorithms/multi_area.vcproj deleted file mode 100644 index 7adb7a058..000000000 --- a/test/multi/algorithms/multi_area.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_centroid.vcproj b/test/multi/algorithms/multi_centroid.vcproj deleted file mode 100644 index b713a4452..000000000 --- a/test/multi/algorithms/multi_centroid.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_convert.vcproj b/test/multi/algorithms/multi_convert.vcproj deleted file mode 100644 index 4829412be..000000000 --- a/test/multi/algorithms/multi_convert.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_convex_hull.vcproj b/test/multi/algorithms/multi_convex_hull.vcproj deleted file mode 100644 index 839e71c7c..000000000 --- a/test/multi/algorithms/multi_convex_hull.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_correct.vcproj b/test/multi/algorithms/multi_correct.vcproj deleted file mode 100644 index cc280ffd7..000000000 --- a/test/multi/algorithms/multi_correct.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_covered_by.vcproj b/test/multi/algorithms/multi_covered_by.vcproj deleted file mode 100644 index 87a62a938..000000000 --- a/test/multi/algorithms/multi_covered_by.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_difference.cpp b/test/multi/algorithms/multi_difference.cpp index 893d3009b..35160437d 100644 --- a/test/multi/algorithms/multi_difference.cpp +++ b/test/multi/algorithms/multi_difference.cpp @@ -205,11 +205,16 @@ void test_all() int test_main(int, char* []) { - test_all >(); + test_all >(); -#ifdef HAVE_TTMATH +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_all >(); + +#if defined(HAVE_TTMATH) std::cout << "Testing TTMATH" << std::endl; test_all >(); +#endif + #endif return 0; diff --git a/test/multi/algorithms/multi_difference.vcproj b/test/multi/algorithms/multi_difference.vcproj deleted file mode 100644 index 825789743..000000000 --- a/test/multi/algorithms/multi_difference.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_difference_spike.cpp b/test/multi/algorithms/multi_difference_spike.cpp new file mode 100644 index 000000000..07bf65ea5 --- /dev/null +++ b/test/multi/algorithms/multi_difference_spike.cpp @@ -0,0 +1,105 @@ +// Boost.Geometry (aka GGL, Generic Geometry Library) +// Unit Test + +// Copyright (c) 2013 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 + + +template +void test_spikes_in_ticket_8364() +{ + // See: https://svn.boost.org/trac/boost/ticket/8364 + //_TPolygon polygon( "MULTIPOLYGON(((1031 1056,3232 1056,3232 2856,1031 2856)))" ); + //polygon -= _TPolygon( "MULTIPOLYGON(((1032 1458,1032 1212,2136 2328,3234 2220,3234 2412,2136 2646)))" ); + //polygon -= _TPolygon( "MULTIPOLYGON(((1032 1764,1032 1458,2136 2646,3234 2412,3234 2532,2136 2790)))" ); + // RESULTS OF ABOVE IS USED IN STEP 3 BELOW + //polygon -= _TPolygon( "MULTIPOLYGON(((1032 2130,1032 1764,2052 2712)),((3234 2580,2558 2690,3234 2532)),((2558 2690,2136 2790,2052 2712,2136 2760)))" ); USED IN STEP 3 + //polygon -= _TPolygon( "MULTIPOLYGON(((1032 2556,1032 2130,1778 2556)),((3234 2580,2136 2760,1778 2556,3234 2556)))" ); USED IN STEP 4 + // NOTE: polygons below are closed and clockwise + + typedef typename bg::coordinate_type

::type ct; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + + // The difference of polygons below result in a spike. The spike should be there, it is also generated in ttmath, + // and (e.g.) in SQL Server. However, using int-coordinates, the spike makes the polygon invalid. Therefore it is now (since August 2013) checked and removed. + + // So using int's, the spike is removed automatically. Therefore there is one polygon less, and less points. Also area differs + test_one("ticket_8364_step3", + "MULTIPOLYGON(((3232 2532,2136 2790,1032 1764,1032 1458,1032 1212,2136 2328,3232 2220,3232 1056,1031 1056,1031 2856,3232 2856,3232 2532)))", + "MULTIPOLYGON(((1032 2130,2052 2712,1032 1764,1032 2130)),((3234 2580,3234 2532,2558 2690,3234 2580)),((2558 2690,2136 2760,2052 2712,2136 2790,2558 2690)))", + if_typed(1, 2), + if_typed(15, 22), + if_typed(2775561.0, 2775256.487954), // SQL Server: 2775256.47588724 + 3, + 14, + if_typed(7710.5, 7810.487954)); // SQL Server: 7810.48711165739 + + test_one("ticket_8364_step4", + "MULTIPOLYGON(((2567 2688,2136 2790,2052 2712,1032 2130,1032 1764,1032 1458,1032 1212,2136 2328,3232 2220,3232 1056,1031 1056,1031 2856,3232 2856,3232 2580,2567 2688)))", + "MULTIPOLYGON(((1032 2556,1778 2556,1032 2130,1032 2556)),((3234 2580,3234 2556,1778 2556,2136 2760,3234 2580)))", + 1, + if_typed(17, 20), + if_typed(2616292.0, 2616029.559567), // SQL Server: 2616029.55616044 + 1, + if_typed(9, 11), + if_typed(160996.0, 161054.559567)); // SQL Server: 161054.560110092 +} + +template +void test_spikes_in_ticket_8365() +{ + // See: https://svn.boost.org/trac/boost/ticket/8365 + // NOTE: polygons below are closed and clockwise + + typedef typename bg::coordinate_type

::type ct; + typedef bg::model::polygon polygon; + typedef bg::model::multi_polygon multi_polygon; + + test_one("ticket_8365_step2", + "MULTIPOLYGON(((971 2704,971 1402,4640 1402,3912 1722,3180 2376,3912 1884,4643 1402,5395 1402,5395 3353,971 3353,971 2865,1704 3348)))", + "MULTIPOLYGON(((5388 1560,4650 1722,3912 1884,4650 1398)),((2442 3186,1704 3348,966 2700,1704 3024)))", + if_typed(1, 2), + if_typed(17, 21), + if_typed(7974930.5, 7975207.6047877), // SQL Server: + 2, + 9, + if_typed(199.0, 197.1047877)); // SQL Server: +} + + + + + +int test_main(int, char* []) +{ + test_spikes_in_ticket_8364, true, true>(); + test_spikes_in_ticket_8364, true, true>(); + test_spikes_in_ticket_8364, false, false>(); + test_spikes_in_ticket_8364, false, false>(); + + test_spikes_in_ticket_8365, true, true>(); + test_spikes_in_ticket_8365, true, true >(); + test_spikes_in_ticket_8365, false, false>(); + test_spikes_in_ticket_8365, false, false >(); + +#ifdef HAVE_TTMATH + std::cout << "Testing TTMATH" << std::endl; + test_spikes_in_ticket_8364, true, true>(); + test_spikes_in_ticket_8365, true, true>(); +#endif + + return 0; +} + diff --git a/test/multi/algorithms/multi_disjoint.vcproj b/test/multi/algorithms/multi_disjoint.vcproj deleted file mode 100644 index fb55ab325..000000000 --- a/test/multi/algorithms/multi_disjoint.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_distance.cpp b/test/multi/algorithms/multi_distance.cpp index 249598c91..0c932474a 100644 --- a/test/multi/algorithms/multi_distance.cpp +++ b/test/multi/algorithms/multi_distance.cpp @@ -74,7 +74,7 @@ void test_2d() test_distance("MULTILINESTRING((1 1,2 2),(1 0,2 0),(0 2,0 3))", "MULTIPOINT((0 0),(1 1))", 0.0); // Test with a strategy - bg::strategy::distance::pythagoras pyth; + bg::strategy::distance::pythagoras<> pyth; test_distance(pyth, "POINT(0 0)", "POINT(1 1)", sqrt(2.0)); test_distance(pyth, "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); test_distance(pyth, "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); @@ -116,18 +116,18 @@ void test_mixed() // Test with a strategy using namespace bg::strategy::distance; - test_distance(pythagoras(), "POINT(0 0)", "POINT(1 1)", sqrt(2.0)); + test_distance(pythagoras<>(), "POINT(0 0)", "POINT(1 1)", sqrt(2.0)); - test_distance(pythagoras(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); - test_distance(pythagoras(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); - test_distance(pythagoras(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); - test_distance(pythagoras(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); + test_distance(pythagoras<>(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); + test_distance(pythagoras<>(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); + test_distance(pythagoras<>(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); + test_distance(pythagoras<>(), "POINT(0 0)", "MULTIPOINT((1 1),(1 0),(0 2))", 1.0); // Most interesting: reversal AND a strategy (note that the stategy must be reversed automatically - test_distance(pythagoras(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); - test_distance(pythagoras(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); - test_distance(pythagoras(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); - test_distance(pythagoras(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); + test_distance(pythagoras<>(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); + test_distance(pythagoras<>(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); + test_distance(pythagoras<>(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); + test_distance(pythagoras<>(), "MULTIPOINT((1 1),(1 0),(0 2))", "POINT(0 0)", 1.0); } template diff --git a/test/multi/algorithms/multi_distance.vcproj b/test/multi/algorithms/multi_distance.vcproj deleted file mode 100644 index 7b3e77d28..000000000 --- a/test/multi/algorithms/multi_distance.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_envelope.vcproj b/test/multi/algorithms/multi_envelope.vcproj deleted file mode 100644 index 9d4db61af..000000000 --- a/test/multi/algorithms/multi_envelope.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_equals.vcproj b/test/multi/algorithms/multi_equals.vcproj deleted file mode 100644 index c35636018..000000000 --- a/test/multi/algorithms/multi_equals.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_for_each.vcproj b/test/multi/algorithms/multi_for_each.vcproj deleted file mode 100644 index 51c5b9667..000000000 --- a/test/multi/algorithms/multi_for_each.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_intersection.cpp b/test/multi/algorithms/multi_intersection.cpp index fc94811f8..4df030253 100644 --- a/test/multi/algorithms/multi_intersection.cpp +++ b/test/multi/algorithms/multi_intersection.cpp @@ -218,9 +218,14 @@ int test_main(int, char* []) { test_all >(); -#ifdef HAVE_TTMATH +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_all >(); + +#if defined(HAVE_TTMATH) std::cout << "Testing TTMATH" << std::endl; test_all >(); +#endif + #endif return 0; diff --git a/test/multi/algorithms/multi_intersection.vcproj b/test/multi/algorithms/multi_intersection.vcproj deleted file mode 100644 index a286b038c..000000000 --- a/test/multi/algorithms/multi_intersection.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_length.vcproj b/test/multi/algorithms/multi_length.vcproj deleted file mode 100644 index 43967af1a..000000000 --- a/test/multi/algorithms/multi_length.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_num_geometries.vcproj b/test/multi/algorithms/multi_num_geometries.vcproj deleted file mode 100644 index c1beefad1..000000000 --- a/test/multi/algorithms/multi_num_geometries.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_num_interior_rings.vcproj b/test/multi/algorithms/multi_num_interior_rings.vcproj deleted file mode 100644 index 68c6ebf62..000000000 --- a/test/multi/algorithms/multi_num_interior_rings.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_num_points.vcproj b/test/multi/algorithms/multi_num_points.vcproj deleted file mode 100644 index 590d220c3..000000000 --- a/test/multi/algorithms/multi_num_points.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_perimeter.vcproj b/test/multi/algorithms/multi_perimeter.vcproj deleted file mode 100644 index 4059e83bb..000000000 --- a/test/multi/algorithms/multi_perimeter.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_reverse.vcproj b/test/multi/algorithms/multi_reverse.vcproj deleted file mode 100644 index 6afcee18e..000000000 --- a/test/multi/algorithms/multi_reverse.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_simplify.vcproj b/test/multi/algorithms/multi_simplify.vcproj deleted file mode 100644 index e4d11963a..000000000 --- a/test/multi/algorithms/multi_simplify.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_touches.vcproj b/test/multi/algorithms/multi_touches.vcproj deleted file mode 100644 index 05468f6cd..000000000 --- a/test/multi/algorithms/multi_touches.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_transform.cpp b/test/multi/algorithms/multi_transform.cpp index dddb01c45..9c0002583 100644 --- a/test/multi/algorithms/multi_transform.cpp +++ b/test/multi/algorithms/multi_transform.cpp @@ -39,12 +39,13 @@ template void test_transform(std::string const& wkt, std::string const& expected) { - typedef typename bg::point_type::type point_type; + typedef typename bg::coordinate_type::type coordinate_type; + const std::size_t dim = bg::dimension::value; Geometry geometry_in, geometry_out; bg::read_wkt(wkt, geometry_in); bg::transform(geometry_in, geometry_out, - bg::strategy::transform::scale_transformer(2, 2)); + bg::strategy::transform::scale_transformer(2, 2)); std::ostringstream detected; detected << bg::wkt(geometry_out); BOOST_CHECK_EQUAL(detected.str(), expected); diff --git a/test/multi/algorithms/multi_transform.vcproj b/test/multi/algorithms/multi_transform.vcproj deleted file mode 100644 index 543890ffb..000000000 --- a/test/multi/algorithms/multi_transform.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_union.cpp b/test/multi/algorithms/multi_union.cpp index 5cbe1e7a7..e97e9fb43 100644 --- a/test/multi/algorithms/multi_union.cpp +++ b/test/multi/algorithms/multi_union.cpp @@ -140,9 +140,14 @@ int test_main(int, char* []) { test_all >(); -#ifdef HAVE_TTMATH +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) + test_all >(); + +#if defined(HAVE_TTMATH) std::cout << "Testing TTMATH" << std::endl; test_all >(); +#endif + #endif return 0; diff --git a/test/multi/algorithms/multi_union.vcproj b/test/multi/algorithms/multi_union.vcproj deleted file mode 100644 index 9adb10145..000000000 --- a/test/multi/algorithms/multi_union.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_unique.vcproj b/test/multi/algorithms/multi_unique.vcproj deleted file mode 100644 index d6a662b10..000000000 --- a/test/multi/algorithms/multi_unique.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/multi_within.vcproj b/test/multi/algorithms/multi_within.vcproj deleted file mode 100644 index f5d6ad350..000000000 --- a/test/multi/algorithms/multi_within.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/algorithms/overlay/multi_overlay.sln b/test/multi/algorithms/overlay/multi_overlay.sln deleted file mode 100644 index ecb94cc33..000000000 --- a/test/multi/algorithms/overlay/multi_overlay.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_traverse", "multi_traverse.vcproj", "{DB00BBA3-4959-4F9E-A235-E487FF766207}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DB00BBA3-4959-4F9E-A235-E487FF766207}.Debug|Win32.ActiveCfg = Debug|Win32 - {DB00BBA3-4959-4F9E-A235-E487FF766207}.Debug|Win32.Build.0 = Debug|Win32 - {DB00BBA3-4959-4F9E-A235-E487FF766207}.Release|Win32.ActiveCfg = Release|Win32 - {DB00BBA3-4959-4F9E-A235-E487FF766207}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/multi/algorithms/overlay/multi_traverse.vcproj b/test/multi/algorithms/overlay/multi_traverse.vcproj deleted file mode 100644 index c4cb7b8e0..000000000 --- a/test/multi/algorithms/overlay/multi_traverse.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/io/dsv/dsv.sln b/test/multi/io/dsv/dsv.sln deleted file mode 100644 index ecea59719..000000000 --- a/test/multi/io/dsv/dsv.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{6CD4A68C-3EA1-11E1-B9E4-BF144924019B}") = "dsv", "dsv.vcproj", "{7463ED40-3EA1-11E1-9FC7-D0144924019B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7463ED40-3EA1-11E1-9FC7-D0144924019B}.Debug|Win32.ActiveCfg = Debug|Win32 - {7463ED40-3EA1-11E1-9FC7-D0144924019B}.Debug|Win32.Build.0 = Debug|Win32 - {7463ED40-3EA1-11E1-9FC7-D0144924019B}.Release|Win32.ActiveCfg = Release|Win32 - {7463ED40-3EA1-11E1-9FC7-D0144924019B}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/multi/io/dsv/dsv.vcproj b/test/multi/io/dsv/dsv.vcproj deleted file mode 100644 index 494551daa..000000000 --- a/test/multi/io/dsv/dsv.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/io/wkt/io_wkt_tests.sln b/test/multi/io/wkt/io_wkt_tests.sln deleted file mode 100644 index a804d533a..000000000 --- a/test/multi/io/wkt/io_wkt_tests.sln +++ /dev/null @@ -1,27 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wkt", "wkt.vcproj", "{CA8D5E44-7D8F-44A1-900C-35C28890299B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1FA2ADE2-F649-4245-951E-A8F5935E7127}.Debug|Win32.ActiveCfg = Debug|Win32 - {1FA2ADE2-F649-4245-951E-A8F5935E7127}.Debug|Win32.Build.0 = Debug|Win32 - {1FA2ADE2-F649-4245-951E-A8F5935E7127}.Release|Win32.ActiveCfg = Release|Win32 - {1FA2ADE2-F649-4245-951E-A8F5935E7127}.Release|Win32.Build.0 = Release|Win32 - {F2A680B0-F6FC-479E-9988-24CF6851C13C}.Debug|Win32.ActiveCfg = Debug|Win32 - {F2A680B0-F6FC-479E-9988-24CF6851C13C}.Debug|Win32.Build.0 = Debug|Win32 - {F2A680B0-F6FC-479E-9988-24CF6851C13C}.Release|Win32.ActiveCfg = Release|Win32 - {F2A680B0-F6FC-479E-9988-24CF6851C13C}.Release|Win32.Build.0 = Release|Win32 - {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Debug|Win32.ActiveCfg = Debug|Win32 - {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Debug|Win32.Build.0 = Debug|Win32 - {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Release|Win32.ActiveCfg = Release|Win32 - {CA8D5E44-7D8F-44A1-900C-35C28890299B}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/multi/io/wkt/wkt.vcproj b/test/multi/io/wkt/wkt.vcproj deleted file mode 100644 index c8150e853..000000000 --- a/test/multi/io/wkt/wkt.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/multi/multi_tests.sln b/test/multi/multi_tests.sln deleted file mode 100644 index abfef0161..000000000 --- a/test/multi/multi_tests.sln +++ /dev/null @@ -1,163 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_within", "algorithms\multi_within.vcproj", "{CA8D5E44-7D8F-44A1-901C-35C28890299B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_distance", "algorithms\multi_distance.vcproj", "{D770F3E8-0567-4EDD-91FC-20BA402A3F74}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_convex_hull", "algorithms\multi_convex_hull.vcproj", "{B810C404-C4D9-4A6A-96B0-1DCED269D65D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_envelope", "algorithms\multi_envelope.vcproj", "{85385CF0-240C-4900-B5EA-E34D2415A18F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_centroid", "algorithms\multi_centroid.vcproj", "{7EE302E1-7FCF-4E9E-8DB3-36EA4D88B6CA}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_correct", "algorithms\multi_correct.vcproj", "{DFB00B88-2ED8-49CA-B739-7C8A8602D681}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_simplify", "algorithms\multi_simplify.vcproj", "{76A74CE4-EBF8-4F8A-98B7-1AF607B2B68C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_for_each", "algorithms\multi_for_each.vcproj", "{B016FE33-D587-45C6-8444-607839BB2C2D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_area", "algorithms\multi_area.vcproj", "{691082ED-2778-4300-9860-42DFBBABE535}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_length", "algorithms\multi_length.vcproj", "{9087BA6C-7563-41E6-90AD-F60BC58DDC17}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_perimeter", "algorithms\multi_perimeter.vcproj", "{D91C3F39-B8A5-4EB9-A7A8-D72B297DCFBF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_intersection", "algorithms\multi_intersection.vcproj", "{FFB78F24-7999-4416-BDED-9C35A3DDF32D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_union", "algorithms\multi_union.vcproj", "{1A8443BE-2666-4D6B-B4BC-6A7B7DD224B0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_equals", "algorithms\multi_equals.vcproj", "{AA0EFD64-E034-421A-BD4A-E5A336D95C30}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_reverse", "algorithms\multi_reverse.vcproj", "{698BE05D-43E2-4BF5-B7FD-48BE3EE7BC21}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_unique", "algorithms\multi_unique.vcproj", "{71879D37-84A8-4949-8CDB-212982F81D80}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_num_geometries", "algorithms\multi_num_geometries.vcproj", "{8DB68EB9-07CA-4705-859E-B1A7098B5CF3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_num_points", "algorithms\multi_num_points.vcproj", "{EA4B2EB3-1FBA-42BE-B7D7-5A517BC74E2B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_num_interior_rings", "algorithms\multi_num_interior_rings.vcproj", "{3F8E4B3A-43D5-49ED-89F6-C6D1CF609B02}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_difference", "algorithms\multi_difference.vcproj", "{7F85B87A-48A6-47BD-A08C-AB12AEA56582}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_transform", "algorithms\multi_transform.vcproj", "{64985954-0A74-46F5-908F-865E905C3414}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_covered_by", "algorithms\multi_covered_by.vcproj", "{680E56F0-229C-4377-BDC0-80EB9B59314B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_convert", "algorithms\multi_convert.vcproj", "{21B7EF55-23C3-4FD2-9F2F-FD8F0F3FE167}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_disjoint", "algorithms\multi_disjoint.vcproj", "{5DEA6558-9DF7-42D4-AF10-4D6D8BB7EAD1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multi_touches", "algorithms\multi_touches.vcproj", "{108173B8-B6F4-4366-8018-2BF282ED4881}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CA8D5E44-7D8F-44A1-901C-35C28890299B}.Debug|Win32.ActiveCfg = Debug|Win32 - {CA8D5E44-7D8F-44A1-901C-35C28890299B}.Debug|Win32.Build.0 = Debug|Win32 - {CA8D5E44-7D8F-44A1-901C-35C28890299B}.Release|Win32.ActiveCfg = Release|Win32 - {CA8D5E44-7D8F-44A1-901C-35C28890299B}.Release|Win32.Build.0 = Release|Win32 - {D770F3E8-0567-4EDD-91FC-20BA402A3F74}.Debug|Win32.ActiveCfg = Debug|Win32 - {D770F3E8-0567-4EDD-91FC-20BA402A3F74}.Debug|Win32.Build.0 = Debug|Win32 - {D770F3E8-0567-4EDD-91FC-20BA402A3F74}.Release|Win32.ActiveCfg = Release|Win32 - {D770F3E8-0567-4EDD-91FC-20BA402A3F74}.Release|Win32.Build.0 = Release|Win32 - {B810C404-C4D9-4A6A-96B0-1DCED269D65D}.Debug|Win32.ActiveCfg = Debug|Win32 - {B810C404-C4D9-4A6A-96B0-1DCED269D65D}.Debug|Win32.Build.0 = Debug|Win32 - {B810C404-C4D9-4A6A-96B0-1DCED269D65D}.Release|Win32.ActiveCfg = Release|Win32 - {B810C404-C4D9-4A6A-96B0-1DCED269D65D}.Release|Win32.Build.0 = Release|Win32 - {85385CF0-240C-4900-B5EA-E34D2415A18F}.Debug|Win32.ActiveCfg = Debug|Win32 - {85385CF0-240C-4900-B5EA-E34D2415A18F}.Debug|Win32.Build.0 = Debug|Win32 - {85385CF0-240C-4900-B5EA-E34D2415A18F}.Release|Win32.ActiveCfg = Release|Win32 - {85385CF0-240C-4900-B5EA-E34D2415A18F}.Release|Win32.Build.0 = Release|Win32 - {7EE302E1-7FCF-4E9E-8DB3-36EA4D88B6CA}.Debug|Win32.ActiveCfg = Debug|Win32 - {7EE302E1-7FCF-4E9E-8DB3-36EA4D88B6CA}.Debug|Win32.Build.0 = Debug|Win32 - {7EE302E1-7FCF-4E9E-8DB3-36EA4D88B6CA}.Release|Win32.ActiveCfg = Release|Win32 - {7EE302E1-7FCF-4E9E-8DB3-36EA4D88B6CA}.Release|Win32.Build.0 = Release|Win32 - {DFB00B88-2ED8-49CA-B739-7C8A8602D681}.Debug|Win32.ActiveCfg = Debug|Win32 - {DFB00B88-2ED8-49CA-B739-7C8A8602D681}.Debug|Win32.Build.0 = Debug|Win32 - {DFB00B88-2ED8-49CA-B739-7C8A8602D681}.Release|Win32.ActiveCfg = Release|Win32 - {DFB00B88-2ED8-49CA-B739-7C8A8602D681}.Release|Win32.Build.0 = Release|Win32 - {76A74CE4-EBF8-4F8A-98B7-1AF607B2B68C}.Debug|Win32.ActiveCfg = Debug|Win32 - {76A74CE4-EBF8-4F8A-98B7-1AF607B2B68C}.Debug|Win32.Build.0 = Debug|Win32 - {76A74CE4-EBF8-4F8A-98B7-1AF607B2B68C}.Release|Win32.ActiveCfg = Release|Win32 - {76A74CE4-EBF8-4F8A-98B7-1AF607B2B68C}.Release|Win32.Build.0 = Release|Win32 - {B016FE33-D587-45C6-8444-607839BB2C2D}.Debug|Win32.ActiveCfg = Debug|Win32 - {B016FE33-D587-45C6-8444-607839BB2C2D}.Debug|Win32.Build.0 = Debug|Win32 - {B016FE33-D587-45C6-8444-607839BB2C2D}.Release|Win32.ActiveCfg = Release|Win32 - {B016FE33-D587-45C6-8444-607839BB2C2D}.Release|Win32.Build.0 = Release|Win32 - {691082ED-2778-4300-9860-42DFBBABE535}.Debug|Win32.ActiveCfg = Debug|Win32 - {691082ED-2778-4300-9860-42DFBBABE535}.Debug|Win32.Build.0 = Debug|Win32 - {691082ED-2778-4300-9860-42DFBBABE535}.Release|Win32.ActiveCfg = Release|Win32 - {691082ED-2778-4300-9860-42DFBBABE535}.Release|Win32.Build.0 = Release|Win32 - {9087BA6C-7563-41E6-90AD-F60BC58DDC17}.Debug|Win32.ActiveCfg = Debug|Win32 - {9087BA6C-7563-41E6-90AD-F60BC58DDC17}.Debug|Win32.Build.0 = Debug|Win32 - {9087BA6C-7563-41E6-90AD-F60BC58DDC17}.Release|Win32.ActiveCfg = Release|Win32 - {9087BA6C-7563-41E6-90AD-F60BC58DDC17}.Release|Win32.Build.0 = Release|Win32 - {D91C3F39-B8A5-4EB9-A7A8-D72B297DCFBF}.Debug|Win32.ActiveCfg = Debug|Win32 - {D91C3F39-B8A5-4EB9-A7A8-D72B297DCFBF}.Debug|Win32.Build.0 = Debug|Win32 - {D91C3F39-B8A5-4EB9-A7A8-D72B297DCFBF}.Release|Win32.ActiveCfg = Release|Win32 - {D91C3F39-B8A5-4EB9-A7A8-D72B297DCFBF}.Release|Win32.Build.0 = Release|Win32 - {FFB78F24-7999-4416-BDED-9C35A3DDF32D}.Debug|Win32.ActiveCfg = Debug|Win32 - {FFB78F24-7999-4416-BDED-9C35A3DDF32D}.Debug|Win32.Build.0 = Debug|Win32 - {FFB78F24-7999-4416-BDED-9C35A3DDF32D}.Release|Win32.ActiveCfg = Release|Win32 - {FFB78F24-7999-4416-BDED-9C35A3DDF32D}.Release|Win32.Build.0 = Release|Win32 - {1A8443BE-2666-4D6B-B4BC-6A7B7DD224B0}.Debug|Win32.ActiveCfg = Debug|Win32 - {1A8443BE-2666-4D6B-B4BC-6A7B7DD224B0}.Debug|Win32.Build.0 = Debug|Win32 - {1A8443BE-2666-4D6B-B4BC-6A7B7DD224B0}.Release|Win32.ActiveCfg = Release|Win32 - {1A8443BE-2666-4D6B-B4BC-6A7B7DD224B0}.Release|Win32.Build.0 = Release|Win32 - {AA0EFD64-E034-421A-BD4A-E5A336D95C30}.Debug|Win32.ActiveCfg = Debug|Win32 - {AA0EFD64-E034-421A-BD4A-E5A336D95C30}.Debug|Win32.Build.0 = Debug|Win32 - {AA0EFD64-E034-421A-BD4A-E5A336D95C30}.Release|Win32.ActiveCfg = Release|Win32 - {AA0EFD64-E034-421A-BD4A-E5A336D95C30}.Release|Win32.Build.0 = Release|Win32 - {698BE05D-43E2-4BF5-B7FD-48BE3EE7BC21}.Debug|Win32.ActiveCfg = Debug|Win32 - {698BE05D-43E2-4BF5-B7FD-48BE3EE7BC21}.Debug|Win32.Build.0 = Debug|Win32 - {698BE05D-43E2-4BF5-B7FD-48BE3EE7BC21}.Release|Win32.ActiveCfg = Release|Win32 - {698BE05D-43E2-4BF5-B7FD-48BE3EE7BC21}.Release|Win32.Build.0 = Release|Win32 - {71879D37-84A8-4949-8CDB-212982F81D80}.Debug|Win32.ActiveCfg = Debug|Win32 - {71879D37-84A8-4949-8CDB-212982F81D80}.Debug|Win32.Build.0 = Debug|Win32 - {71879D37-84A8-4949-8CDB-212982F81D80}.Release|Win32.ActiveCfg = Release|Win32 - {71879D37-84A8-4949-8CDB-212982F81D80}.Release|Win32.Build.0 = Release|Win32 - {8DB68EB9-07CA-4705-859E-B1A7098B5CF3}.Debug|Win32.ActiveCfg = Debug|Win32 - {8DB68EB9-07CA-4705-859E-B1A7098B5CF3}.Debug|Win32.Build.0 = Debug|Win32 - {8DB68EB9-07CA-4705-859E-B1A7098B5CF3}.Release|Win32.ActiveCfg = Release|Win32 - {8DB68EB9-07CA-4705-859E-B1A7098B5CF3}.Release|Win32.Build.0 = Release|Win32 - {EA4B2EB3-1FBA-42BE-B7D7-5A517BC74E2B}.Debug|Win32.ActiveCfg = Debug|Win32 - {EA4B2EB3-1FBA-42BE-B7D7-5A517BC74E2B}.Debug|Win32.Build.0 = Debug|Win32 - {EA4B2EB3-1FBA-42BE-B7D7-5A517BC74E2B}.Release|Win32.ActiveCfg = Release|Win32 - {EA4B2EB3-1FBA-42BE-B7D7-5A517BC74E2B}.Release|Win32.Build.0 = Release|Win32 - {3F8E4B3A-43D5-49ED-89F6-C6D1CF609B02}.Debug|Win32.ActiveCfg = Debug|Win32 - {3F8E4B3A-43D5-49ED-89F6-C6D1CF609B02}.Debug|Win32.Build.0 = Debug|Win32 - {3F8E4B3A-43D5-49ED-89F6-C6D1CF609B02}.Release|Win32.ActiveCfg = Release|Win32 - {3F8E4B3A-43D5-49ED-89F6-C6D1CF609B02}.Release|Win32.Build.0 = Release|Win32 - {7F85B87A-48A6-47BD-A08C-AB12AEA56582}.Debug|Win32.ActiveCfg = Debug|Win32 - {7F85B87A-48A6-47BD-A08C-AB12AEA56582}.Debug|Win32.Build.0 = Debug|Win32 - {7F85B87A-48A6-47BD-A08C-AB12AEA56582}.Release|Win32.ActiveCfg = Release|Win32 - {7F85B87A-48A6-47BD-A08C-AB12AEA56582}.Release|Win32.Build.0 = Release|Win32 - {64985954-0A74-46F5-908F-865E905C3414}.Debug|Win32.ActiveCfg = Debug|Win32 - {64985954-0A74-46F5-908F-865E905C3414}.Debug|Win32.Build.0 = Debug|Win32 - {64985954-0A74-46F5-908F-865E905C3414}.Release|Win32.ActiveCfg = Release|Win32 - {64985954-0A74-46F5-908F-865E905C3414}.Release|Win32.Build.0 = Release|Win32 - {680E56F0-229C-4377-BDC0-80EB9B59314B}.Debug|Win32.ActiveCfg = Debug|Win32 - {680E56F0-229C-4377-BDC0-80EB9B59314B}.Debug|Win32.Build.0 = Debug|Win32 - {680E56F0-229C-4377-BDC0-80EB9B59314B}.Release|Win32.ActiveCfg = Release|Win32 - {680E56F0-229C-4377-BDC0-80EB9B59314B}.Release|Win32.Build.0 = Release|Win32 - {21B7EF55-23C3-4FD2-9F2F-FD8F0F3FE167}.Debug|Win32.ActiveCfg = Debug|Win32 - {21B7EF55-23C3-4FD2-9F2F-FD8F0F3FE167}.Debug|Win32.Build.0 = Debug|Win32 - {21B7EF55-23C3-4FD2-9F2F-FD8F0F3FE167}.Release|Win32.ActiveCfg = Release|Win32 - {21B7EF55-23C3-4FD2-9F2F-FD8F0F3FE167}.Release|Win32.Build.0 = Release|Win32 - {5DEA6558-9DF7-42D4-AF10-4D6D8BB7EAD1}.Debug|Win32.ActiveCfg = Debug|Win32 - {5DEA6558-9DF7-42D4-AF10-4D6D8BB7EAD1}.Debug|Win32.Build.0 = Debug|Win32 - {5DEA6558-9DF7-42D4-AF10-4D6D8BB7EAD1}.Release|Win32.ActiveCfg = Release|Win32 - {5DEA6558-9DF7-42D4-AF10-4D6D8BB7EAD1}.Release|Win32.Build.0 = Release|Win32 - {108173B8-B6F4-4366-8018-2BF282ED4881}.Debug|Win32.ActiveCfg = Debug|Win32 - {108173B8-B6F4-4366-8018-2BF282ED4881}.Debug|Win32.Build.0 = Debug|Win32 - {108173B8-B6F4-4366-8018-2BF282ED4881}.Release|Win32.ActiveCfg = Release|Win32 - {108173B8-B6F4-4366-8018-2BF282ED4881}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/policies/compare.vcproj b/test/policies/compare.vcproj deleted file mode 100644 index 916e6d72b..000000000 --- a/test/policies/compare.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/policies/policy_tests.sln b/test/policies/policy_tests.sln deleted file mode 100644 index 16917fd38..000000000 --- a/test/policies/policy_tests.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compare", "compare.vcproj", "{71AFA3C2-6873-4368-81D9-CA305A43B458}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {71AFA3C2-6873-4368-81D9-CA305A43B458}.Debug|Win32.ActiveCfg = Debug|Win32 - {71AFA3C2-6873-4368-81D9-CA305A43B458}.Debug|Win32.Build.0 = Debug|Win32 - {71AFA3C2-6873-4368-81D9-CA305A43B458}.Release|Win32.ActiveCfg = Release|Win32 - {71AFA3C2-6873-4368-81D9-CA305A43B458}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/robustness/convex_hull/random_multi_points.sln b/test/robustness/convex_hull/random_multi_points.sln deleted file mode 100644 index 1261464c0..000000000 --- a/test/robustness/convex_hull/random_multi_points.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}") = "random_multi_points", "random_multi_points.vcproj", "{334B6950-6F92-4FA3-9A82-ED6E3B19BB2C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {334B6950-6F92-4FA3-9A82-ED6E3B19BB2C}.Debug|Win32.ActiveCfg = Debug|Win32 - {334B6950-6F92-4FA3-9A82-ED6E3B19BB2C}.Debug|Win32.Build.0 = Debug|Win32 - {334B6950-6F92-4FA3-9A82-ED6E3B19BB2C}.Release|Win32.ActiveCfg = Release|Win32 - {334B6950-6F92-4FA3-9A82-ED6E3B19BB2C}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/robustness/convex_hull/random_multi_points.vcproj b/test/robustness/convex_hull/random_multi_points.vcproj deleted file mode 100644 index 3db9cd3be..000000000 --- a/test/robustness/convex_hull/random_multi_points.vcproj +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/robustness/overlay/buffer/recursive_polygons_buffer.sln b/test/robustness/overlay/buffer/recursive_polygons_buffer.sln deleted file mode 100644 index 6e8c2574f..000000000 --- a/test/robustness/overlay/buffer/recursive_polygons_buffer.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "recursive_polygons_buffer", "recursive_polygons_buffer.vcxproj", "{02C9CFA4-C625-55CA-1C8E-2B96EBB09FE8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {02C9CFA4-C625-55CA-1C8E-2B96EBB09FE8}.Debug|Win32.ActiveCfg = Debug|Win32 - {02C9CFA4-C625-55CA-1C8E-2B96EBB09FE8}.Debug|Win32.Build.0 = Debug|Win32 - {02C9CFA4-C625-55CA-1C8E-2B96EBB09FE8}.Release|Win32.ActiveCfg = Release|Win32 - {02C9CFA4-C625-55CA-1C8E-2B96EBB09FE8}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/robustness/overlay/buffer/recursive_polygons_buffer.vcproj b/test/robustness/overlay/buffer/recursive_polygons_buffer.vcproj deleted file mode 100644 index 3cc4a384f..000000000 --- a/test/robustness/overlay/buffer/recursive_polygons_buffer.vcproj +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.sln b/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.sln deleted file mode 100644 index 5865e1c36..000000000 --- a/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.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}") = "recursive_polygons_linear_areal", "recursive_polygons_linear_areal.vcproj", "{1E269699-9450-4DD6-ACC3-C6A9AD2FC6E0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1E269699-9450-4DD6-ACC3-C6A9AD2FC6E0}.Debug|Win32.ActiveCfg = Debug|Win32 - {1E269699-9450-4DD6-ACC3-C6A9AD2FC6E0}.Debug|Win32.Build.0 = Debug|Win32 - {1E269699-9450-4DD6-ACC3-C6A9AD2FC6E0}.Release|Win32.ActiveCfg = Release|Win32 - {1E269699-9450-4DD6-ACC3-C6A9AD2FC6E0}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.vcproj b/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.vcproj deleted file mode 100644 index 14e8dd6fd..000000000 --- a/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.vcproj +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/strategies/cross_track.cpp b/test/strategies/cross_track.cpp index 38840dc72..2d3b031de 100644 --- a/test/strategies/cross_track.cpp +++ b/test/strategies/cross_track.cpp @@ -46,18 +46,20 @@ void test_distance( { typedef bg::strategy::distance::cross_track < - Point, - Point + typename bg::coordinate_type::type > strategy_type; + typedef typename bg::strategy::distance::services::return_type < - strategy_type + strategy_type, + Point, + Point >::type return_type; BOOST_CONCEPT_ASSERT ( - (bg::concept::PointSegmentDistanceStrategy) + (bg::concept::PointSegmentDistanceStrategy) ); @@ -72,6 +74,10 @@ void test_distance( BOOST_CHECK_CLOSE(radius * d, expected, tolerance); + // The strategy should return the same result if we reverse the parameters + d = strategy.apply(p1, p3, p2); + BOOST_CHECK_CLOSE(radius * d, expected, tolerance); + // Test specifying radius explicitly strategy_type strategy_radius(radius); d = strategy_radius.apply(p1, p2, p3); diff --git a/test/strategies/cross_track.vcproj b/test/strategies/cross_track.vcproj deleted file mode 100644 index e51666fca..000000000 --- a/test/strategies/cross_track.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/strategies/haversine.cpp b/test/strategies/haversine.cpp index 9468810b8..b95ed9a0f 100644 --- a/test/strategies/haversine.cpp +++ b/test/strategies/haversine.cpp @@ -37,25 +37,17 @@ double const average_earth_radius = 6372795.0; template struct test_distance { - typedef bg::strategy::distance::haversine - < - Point, - Point - > haversine_type; - - BOOST_CONCEPT_ASSERT( (bg::concept::PointDistanceStrategy) ); - - - typedef typename bg::strategy::distance::services::return_type::type return_type; + typedef bg::strategy::distance::haversine haversine_type; + typedef typename bg::strategy::distance::services::return_type::type return_type; BOOST_CONCEPT_ASSERT ( - (bg::concept::PointDistanceStrategy) + (bg::concept::PointDistanceStrategy) ); static void test(double lon1, double lat1, double lon2, double lat2, - double radius, return_type expected, double tolerance) + double radius, double expected, double tolerance) { haversine_type strategy(radius); @@ -117,21 +109,15 @@ void test_services() // 1: normal, calculate distance: - typedef bgsd::haversine strategy_type; - typedef typename bgsd::services::return_type::type return_type; + typedef bgsd::haversine strategy_type; + typedef typename bgsd::services::return_type::type return_type; strategy_type strategy(average_earth_radius); return_type result = strategy.apply(p1, p2); BOOST_CHECK_CLOSE(result, return_type(expected), 0.001); - // 2: "similar" to construct a similar strategy (similar but with other template-parameters) for, e.g., the reverse P2/P1 - // 2a: similar_type: - typedef typename services::similar_type::type similar_type; - // 2b: get_similar - similar_type similar = services::get_similar::apply(strategy); - - //result = similar.apply(p1, p2); // should NOT compile because p1/p2 should also be reversed here - result = similar.apply(p2, p1); + // 2: the strategy should return the same result if we reverse parameters + result = strategy.apply(p2, p1); BOOST_CHECK_CLOSE(result, return_type(expected), 0.001); @@ -149,14 +135,14 @@ void test_services() // First the result of the comparable strategy return_type c_result = comparable.apply(p1, p2); // Second the comparable result of the expected distance - return_type c_expected = services::result_from_distance::apply(comparable, expected); + return_type c_expected = services::result_from_distance::apply(comparable, expected); // And that one should be equa. BOOST_CHECK_CLOSE(c_result, return_type(c_expected), 0.001); // 4: the comparable_type should have a distance_strategy_constructor as well, // knowing how to compare something with a fixed distance - return_type c_dist_lower = services::result_from_distance::apply(comparable, expected_lower); - return_type c_dist_higher = services::result_from_distance::apply(comparable, expected_higher); + return_type c_dist_lower = services::result_from_distance::apply(comparable, expected_lower); + return_type c_dist_higher = services::result_from_distance::apply(comparable, expected_higher); // If this is the case: BOOST_CHECK(c_dist_lower < c_result && c_result < c_dist_higher); @@ -166,8 +152,8 @@ void test_services() BOOST_CHECK_CLOSE(c_check, expected, 0.001); // This should also be the case - return_type dist_lower = services::result_from_distance::apply(strategy, expected_lower); - return_type dist_higher = services::result_from_distance::apply(strategy, expected_higher); + return_type dist_lower = services::result_from_distance::apply(strategy, expected_lower); + return_type dist_higher = services::result_from_distance::apply(strategy, expected_higher); BOOST_CHECK(dist_lower < result && result < dist_higher); } @@ -194,8 +180,8 @@ void time_compare_s(int const n) template void time_compare(int const n) { - time_compare_s >(n); - time_compare_s >(n); + time_compare_s >(n); + time_compare_s >(n); } #include diff --git a/test/strategies/haversine.vcproj b/test/strategies/haversine.vcproj deleted file mode 100644 index 31ac6291d..000000000 --- a/test/strategies/haversine.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/strategies/projected_point.cpp b/test/strategies/projected_point.cpp index 11ea749a1..fde126a20 100644 --- a/test/strategies/projected_point.cpp +++ b/test/strategies/projected_point.cpp @@ -52,23 +52,18 @@ void test_services() namespace services = bg::strategy::distance::services; // 1: normal, calculate distance: - typedef bgsd::projected_point strategy_type; + typedef bgsd::projected_point strategy_type; - BOOST_CONCEPT_ASSERT( (bg::concept::PointSegmentDistanceStrategy) ); + BOOST_CONCEPT_ASSERT( (bg::concept::PointSegmentDistanceStrategy) ); - typedef typename services::return_type::type return_type; + typedef typename services::return_type::type return_type; strategy_type strategy; return_type result = strategy.apply(p, p1, p2); BOOST_CHECK_CLOSE(result, return_type(expected), 0.001); - // 2: "similar" to construct a similar strategy (similar but with other template-parameters) for, e.g., the reverse P2/P1 - // 2a: similar_type: - typedef typename services::similar_type::type similar_type; - // 2b: get_similar - similar_type similar = services::get_similar::apply(strategy); - - result = similar.apply(p, p1, p2); + // 2: the strategy should return the same result if we reverse parameters + result = strategy.apply(p, p1, p2); BOOST_CHECK_CLOSE(result, return_type(expected), 0.001); @@ -100,19 +95,15 @@ void test_all_2d(std::string const& wkt_p, bg::read_wkt(wkt_sp2, sp2); { - typedef bg::strategy::distance::projected_point - < - P1, - P2 - > strategy_type; + typedef bg::strategy::distance::projected_point<> strategy_type; BOOST_CONCEPT_ASSERT ( - (bg::concept::PointSegmentDistanceStrategy) + (bg::concept::PointSegmentDistanceStrategy) ); strategy_type strategy; - typedef typename bg::strategy::distance::services::return_type::type return_type; + typedef typename bg::strategy::distance::services::return_type::type return_type; return_type d = strategy.apply(p, sp1, sp2); BOOST_CHECK_CLOSE(d, expected_distance, 0.001); } @@ -121,13 +112,11 @@ void test_all_2d(std::string const& wkt_p, { typedef bg::strategy::distance::projected_point < - P1, - P2, void, - bg::strategy::distance::comparable::pythagoras + bg::strategy::distance::comparable::pythagoras<> > strategy_type; strategy_type strategy; - typedef typename bg::strategy::distance::services::return_type::type return_type; + typedef typename bg::strategy::distance::services::return_type::type return_type; return_type d = strategy.apply(p, sp1, sp2); T expected_squared_distance = expected_distance * expected_distance; BOOST_CHECK_CLOSE(d, expected_squared_distance, 0.01); diff --git a/test/strategies/projected_point.vcproj b/test/strategies/projected_point.vcproj deleted file mode 100644 index 0964383bf..000000000 --- a/test/strategies/projected_point.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/strategies/pythagoras.cpp b/test/strategies/pythagoras.cpp index 2b1f42886..c250d88c0 100644 --- a/test/strategies/pythagoras.cpp +++ b/test/strategies/pythagoras.cpp @@ -51,8 +51,8 @@ void test_null_distance_3d() P2 p2; 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; + typedef bg::strategy::distance::pythagoras<> pythagoras_type; + typedef typename bg::strategy::distance::services::return_type::type return_type; pythagoras_type pythagoras; return_type result = pythagoras.apply(p1, p2); @@ -68,8 +68,8 @@ void test_axis_3d() P2 p2; 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; + typedef bg::strategy::distance::pythagoras<> pythagoras_type; + typedef typename bg::strategy::distance::services::return_type::type return_type; pythagoras_type pythagoras; @@ -94,8 +94,8 @@ void test_arbitrary_3d() bg::assign_values(p2, 9, 8, 7); { - typedef bg::strategy::distance::pythagoras strategy_type; - typedef typename bg::strategy::distance::services::return_type::type return_type; + typedef bg::strategy::distance::pythagoras<> strategy_type; + typedef typename bg::strategy::distance::services::return_type::type return_type; strategy_type strategy; return_type result = strategy.apply(p1, p2); @@ -104,8 +104,8 @@ void test_arbitrary_3d() { // Check comparable distance - typedef bg::strategy::distance::comparable::pythagoras strategy_type; - typedef typename bg::strategy::distance::services::return_type::type return_type; + typedef bg::strategy::distance::comparable::pythagoras<> strategy_type; + typedef typename bg::strategy::distance::services::return_type::type return_type; strategy_type strategy; return_type result = strategy.apply(p1, p2); @@ -137,24 +137,18 @@ void test_services() // 1: normal, calculate distance: - typedef bgsd::pythagoras strategy_type; + typedef bgsd::pythagoras strategy_type; - BOOST_CONCEPT_ASSERT( (bg::concept::PointDistanceStrategy) ); + BOOST_CONCEPT_ASSERT( (bg::concept::PointDistanceStrategy) ); - typedef typename bgsd::services::return_type::type return_type; + typedef typename bgsd::services::return_type::type return_type; strategy_type strategy; return_type result = strategy.apply(p1, p2); BOOST_CHECK_CLOSE(result, return_type(expected), 0.001); - // 2: "similar" to construct a similar strategy (similar but with other template-parameters) for, e.g., the reverse P2/P1 - // 2a: similar_type: - typedef typename services::similar_type::type similar_type; - // 2b: get_similar - similar_type similar = services::get_similar::apply(strategy); - - //result = similar.apply(p1, p2); // should NOT compile because p1/p2 should also be reversed here - result = similar.apply(p2, p1); + // 2: the strategy should return the same result if we reverse parameters + result = strategy.apply(p2, p1); BOOST_CHECK_CLOSE(result, return_type(expected), 0.001); @@ -173,15 +167,15 @@ void test_services() // 4: the comparable_type should have a distance_strategy_constructor as well, // knowing how to compare something with a fixed distance - return_type c_dist5 = services::result_from_distance::apply(comparable, 5.0); - return_type c_dist6 = services::result_from_distance::apply(comparable, 6.0); + return_type c_dist5 = services::result_from_distance::apply(comparable, 5.0); + return_type c_dist6 = services::result_from_distance::apply(comparable, 6.0); // If this is the case: BOOST_CHECK(c_dist5 < c_result && c_result < c_dist6); // This should also be the case - return_type dist5 = services::result_from_distance::apply(strategy, 5.0); - return_type dist6 = services::result_from_distance::apply(strategy, 6.0); + return_type dist5 = services::result_from_distance::apply(strategy, 5.0); + return_type dist6 = services::result_from_distance::apply(strategy, 6.0); BOOST_CHECK(dist5 < result && result < dist6); } @@ -191,15 +185,10 @@ void test_big_2d_with(AssignType const& x1, AssignType const& y1, AssignType const& x2, AssignType const& y2) { typedef bg::model::point point_type; - typedef bg::strategy::distance::pythagoras - < - point_type, - point_type, - CalculationType - > pythagoras_type; + typedef bg::strategy::distance::pythagoras pythagoras_type; pythagoras_type pythagoras; - typedef typename bg::strategy::distance::services::return_type::type return_type; + typedef typename bg::strategy::distance::services::return_type::type return_type; point_type p1, p2; @@ -242,10 +231,7 @@ void test_integer(bool check_types) bg::assign_values(p1, 12345678, 23456789); bg::assign_values(p2, 98765432, 87654321); - typedef bg::strategy::distance::pythagoras - < - point_type - > pythagoras_type; + typedef bg::strategy::distance::pythagoras<> pythagoras_type; pythagoras_type pythagoras; BOOST_AUTO(distance, pythagoras.apply(p1, p2)); BOOST_CHECK_CLOSE(distance, 107655455.02347542, 0.001); @@ -300,7 +286,7 @@ void time_compare_s(int const n) bg::assign_values(p1, 1, 1); bg::assign_values(p2, 2, 2); Strategy strategy; - typename bg::strategy::distance::services::return_type::type s = 0; + typename bg::strategy::distance::services::return_type::type s = 0; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) @@ -315,8 +301,8 @@ void time_compare_s(int const n) template void time_compare(int const n) { - time_compare_s >(n); - time_compare_s >(n); + time_compare_s >(n); + time_compare_s >(n); } int test_main(int, char* []) diff --git a/test/strategies/pythagoras.vcproj b/test/strategies/pythagoras.vcproj deleted file mode 100644 index 7dedcaaa0..000000000 --- a/test/strategies/pythagoras.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/strategies/segment_intersection.vcproj b/test/strategies/segment_intersection.vcproj deleted file mode 100644 index 6ce11dee0..000000000 --- a/test/strategies/segment_intersection.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/strategies/segment_intersection_collinear.vcproj b/test/strategies/segment_intersection_collinear.vcproj deleted file mode 100644 index 0d479586f..000000000 --- a/test/strategies/segment_intersection_collinear.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/strategies/spherical_side.vcproj b/test/strategies/spherical_side.vcproj deleted file mode 100644 index 70dd8689c..000000000 --- a/test/strategies/spherical_side.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/strategies/strategies_tests.sln b/test/strategies/strategies_tests.sln deleted file mode 100644 index d29448213..000000000 --- a/test/strategies/strategies_tests.sln +++ /dev/null @@ -1,73 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythagoras", "pythagoras.vcproj", "{763CA955-FC01-4AFD-9593-69D36836B3F7}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "transformer", "transformer.vcproj", "{9B62EBF7-D444-4D67-BA00-48CAEAF92756}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "segment_intersection", "segment_intersection.vcproj", "{4CCCD6BD-E77F-4A7B-BD9D-89ED2E213309}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "haversine", "haversine.vcproj", "{AA654B76-E384-4E10-B367-4F51B5D3E96F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cross_track", "cross_track.vcproj", "{4CE6F112-9EA1-4D7E-9AC6-907E77895263}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "projected_point", "projected_point.vcproj", "{A27A46D2-AAD2-47F9-86E2-21FF849EF2D4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "segment_intersection_collinear", "segment_intersection_collinear.vcproj", "{2D0CB6D3-6ABC-4119-A235-66E6065A279E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spherical_side", "spherical_side.vcproj", "{ADBE38D8-1828-48A2-BBA1-81F50B53C67C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "within", "within.vcproj", "{AB13D2AC-FD34-4DE4-BD8E-4D463050E5DD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "transform_cs", "transform_cs.vcproj", "{2128A5D9-C67E-4C00-A917-A79058C78FCC}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {763CA955-FC01-4AFD-9593-69D36836B3F7}.Debug|Win32.ActiveCfg = Debug|Win32 - {763CA955-FC01-4AFD-9593-69D36836B3F7}.Debug|Win32.Build.0 = Debug|Win32 - {763CA955-FC01-4AFD-9593-69D36836B3F7}.Release|Win32.ActiveCfg = Release|Win32 - {763CA955-FC01-4AFD-9593-69D36836B3F7}.Release|Win32.Build.0 = Release|Win32 - {9B62EBF7-D444-4D67-BA00-48CAEAF92756}.Debug|Win32.ActiveCfg = Debug|Win32 - {9B62EBF7-D444-4D67-BA00-48CAEAF92756}.Debug|Win32.Build.0 = Debug|Win32 - {9B62EBF7-D444-4D67-BA00-48CAEAF92756}.Release|Win32.ActiveCfg = Release|Win32 - {9B62EBF7-D444-4D67-BA00-48CAEAF92756}.Release|Win32.Build.0 = Release|Win32 - {4CCCD6BD-E77F-4A7B-BD9D-89ED2E213309}.Debug|Win32.ActiveCfg = Debug|Win32 - {4CCCD6BD-E77F-4A7B-BD9D-89ED2E213309}.Debug|Win32.Build.0 = Debug|Win32 - {4CCCD6BD-E77F-4A7B-BD9D-89ED2E213309}.Release|Win32.ActiveCfg = Release|Win32 - {4CCCD6BD-E77F-4A7B-BD9D-89ED2E213309}.Release|Win32.Build.0 = Release|Win32 - {AA654B76-E384-4E10-B367-4F51B5D3E96F}.Debug|Win32.ActiveCfg = Debug|Win32 - {AA654B76-E384-4E10-B367-4F51B5D3E96F}.Debug|Win32.Build.0 = Debug|Win32 - {AA654B76-E384-4E10-B367-4F51B5D3E96F}.Release|Win32.ActiveCfg = Release|Win32 - {AA654B76-E384-4E10-B367-4F51B5D3E96F}.Release|Win32.Build.0 = Release|Win32 - {4CE6F112-9EA1-4D7E-9AC6-907E77895263}.Debug|Win32.ActiveCfg = Debug|Win32 - {4CE6F112-9EA1-4D7E-9AC6-907E77895263}.Debug|Win32.Build.0 = Debug|Win32 - {4CE6F112-9EA1-4D7E-9AC6-907E77895263}.Release|Win32.ActiveCfg = Release|Win32 - {4CE6F112-9EA1-4D7E-9AC6-907E77895263}.Release|Win32.Build.0 = Release|Win32 - {A27A46D2-AAD2-47F9-86E2-21FF849EF2D4}.Debug|Win32.ActiveCfg = Debug|Win32 - {A27A46D2-AAD2-47F9-86E2-21FF849EF2D4}.Debug|Win32.Build.0 = Debug|Win32 - {A27A46D2-AAD2-47F9-86E2-21FF849EF2D4}.Release|Win32.ActiveCfg = Release|Win32 - {A27A46D2-AAD2-47F9-86E2-21FF849EF2D4}.Release|Win32.Build.0 = Release|Win32 - {2D0CB6D3-6ABC-4119-A235-66E6065A279E}.Debug|Win32.ActiveCfg = Debug|Win32 - {2D0CB6D3-6ABC-4119-A235-66E6065A279E}.Debug|Win32.Build.0 = Debug|Win32 - {2D0CB6D3-6ABC-4119-A235-66E6065A279E}.Release|Win32.ActiveCfg = Release|Win32 - {2D0CB6D3-6ABC-4119-A235-66E6065A279E}.Release|Win32.Build.0 = Release|Win32 - {ADBE38D8-1828-48A2-BBA1-81F50B53C67C}.Debug|Win32.ActiveCfg = Debug|Win32 - {ADBE38D8-1828-48A2-BBA1-81F50B53C67C}.Debug|Win32.Build.0 = Debug|Win32 - {ADBE38D8-1828-48A2-BBA1-81F50B53C67C}.Release|Win32.ActiveCfg = Release|Win32 - {ADBE38D8-1828-48A2-BBA1-81F50B53C67C}.Release|Win32.Build.0 = Release|Win32 - {AB13D2AC-FD34-4DE4-BD8E-4D463050E5DD}.Debug|Win32.ActiveCfg = Debug|Win32 - {AB13D2AC-FD34-4DE4-BD8E-4D463050E5DD}.Debug|Win32.Build.0 = Debug|Win32 - {AB13D2AC-FD34-4DE4-BD8E-4D463050E5DD}.Release|Win32.ActiveCfg = Release|Win32 - {AB13D2AC-FD34-4DE4-BD8E-4D463050E5DD}.Release|Win32.Build.0 = Release|Win32 - {2128A5D9-C67E-4C00-A917-A79058C78FCC}.Debug|Win32.ActiveCfg = Debug|Win32 - {2128A5D9-C67E-4C00-A917-A79058C78FCC}.Debug|Win32.Build.0 = Debug|Win32 - {2128A5D9-C67E-4C00-A917-A79058C78FCC}.Release|Win32.ActiveCfg = Release|Win32 - {2128A5D9-C67E-4C00-A917-A79058C78FCC}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/strategies/transform_cs.vcproj b/test/strategies/transform_cs.vcproj deleted file mode 100644 index ea115c56f..000000000 --- a/test/strategies/transform_cs.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/strategies/transformer.cpp b/test/strategies/transformer.cpp index b469e08cc..5cdc567e6 100644 --- a/test/strategies/transformer.cpp +++ b/test/strategies/transformer.cpp @@ -34,7 +34,10 @@ BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template void check_inverse(P const& p, T const& trans) { - bg::strategy::transform::inverse_transformer inverse(trans); + typedef typename bg::coordinate_type

::type coordinate_type; + const std::size_t dim = bg::dimension

::value; + + bg::strategy::transform::inverse_transformer inverse(trans); P i; bg::transform(p, i, inverse); @@ -46,11 +49,14 @@ void check_inverse(P const& p, T const& trans) template void test_all() { + typedef typename bg::coordinate_type

::type coordinate_type; + const std::size_t dim = bg::dimension

::value; + P p; bg::assign_values(p, 1, 1); { - bg::strategy::transform::translate_transformer trans(1, 1); + bg::strategy::transform::translate_transformer trans(1, 1); P tp; bg::transform(p, tp, trans); @@ -61,7 +67,7 @@ void test_all() } { - bg::strategy::transform::scale_transformer trans(10, 10); + bg::strategy::transform::scale_transformer trans(10, 10); P tp; bg::transform(p, tp, trans); @@ -72,7 +78,7 @@ void test_all() } { - bg::strategy::transform::rotate_transformer trans(90.0); + bg::strategy::transform::rotate_transformer trans(90.0); P tp; bg::transform(p, tp, trans); @@ -83,7 +89,7 @@ void test_all() { // Map from 0,0,2,2 to 0,0,500,500 - bg::strategy::transform::map_transformer trans + bg::strategy::transform::map_transformer trans ( 0.0, 0.0, 2.0, 2.0, 500, 500 ); diff --git a/test/strategies/transformer.vcproj b/test/strategies/transformer.vcproj deleted file mode 100644 index f9c02344a..000000000 --- a/test/strategies/transformer.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/strategies/within.vcproj b/test/strategies/within.vcproj deleted file mode 100644 index 8ad1dbc87..000000000 --- a/test/strategies/within.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/ttmath.vsprops b/test/ttmath.vsprops deleted file mode 100644 index e01e29698..000000000 --- a/test/ttmath.vsprops +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/test/util/as_range.vcproj b/test/util/as_range.vcproj deleted file mode 100644 index cc96fd53b..000000000 --- a/test/util/as_range.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/util/calculation_type.vcproj b/test/util/calculation_type.vcproj deleted file mode 100644 index 9c2920035..000000000 --- a/test/util/calculation_type.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/util/for_each_coordinate.vcproj b/test/util/for_each_coordinate.vcproj deleted file mode 100644 index 5afce6532..000000000 --- a/test/util/for_each_coordinate.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/util/rational.vcproj b/test/util/rational.vcproj deleted file mode 100644 index 28ad0a237..000000000 --- a/test/util/rational.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/util/select_most_precise.vcproj b/test/util/select_most_precise.vcproj deleted file mode 100644 index ebe824503..000000000 --- a/test/util/select_most_precise.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/util/util_tests.sln b/test/util/util_tests.sln deleted file mode 100644 index 1e140df83..000000000 --- a/test/util/util_tests.sln +++ /dev/null @@ -1,49 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "for_each_coordinate", "for_each_coordinate.vcproj", "{900CD32E-1B78-40E3-887F-9BCCC0A1041E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "select_most_precise", "select_most_precise.vcproj", "{D0982142-D3B1-4084-B724-83FB7E49EB98}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "write_dsv", "write_dsv.vcproj", "{FC796B9D-2FC4-46C1-B733-9C2C5BB48094}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "as_range", "as_range.vcproj", "{A36D8426-67EB-405C-B6E8-3FBB3374A59B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rational", "rational.vcproj", "{6ABF6324-C1DC-4687-9895-B4CE2B27446F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "calculation_type", "calculation_type.vcproj", "{CF8FE803-A26B-4553-B605-9C28225B5595}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {900CD32E-1B78-40E3-887F-9BCCC0A1041E}.Debug|Win32.ActiveCfg = Debug|Win32 - {900CD32E-1B78-40E3-887F-9BCCC0A1041E}.Debug|Win32.Build.0 = Debug|Win32 - {900CD32E-1B78-40E3-887F-9BCCC0A1041E}.Release|Win32.ActiveCfg = Release|Win32 - {900CD32E-1B78-40E3-887F-9BCCC0A1041E}.Release|Win32.Build.0 = Release|Win32 - {D0982142-D3B1-4084-B724-83FB7E49EB98}.Debug|Win32.ActiveCfg = Debug|Win32 - {D0982142-D3B1-4084-B724-83FB7E49EB98}.Debug|Win32.Build.0 = Debug|Win32 - {D0982142-D3B1-4084-B724-83FB7E49EB98}.Release|Win32.ActiveCfg = Release|Win32 - {D0982142-D3B1-4084-B724-83FB7E49EB98}.Release|Win32.Build.0 = Release|Win32 - {FC796B9D-2FC4-46C1-B733-9C2C5BB48094}.Debug|Win32.ActiveCfg = Debug|Win32 - {FC796B9D-2FC4-46C1-B733-9C2C5BB48094}.Debug|Win32.Build.0 = Debug|Win32 - {FC796B9D-2FC4-46C1-B733-9C2C5BB48094}.Release|Win32.ActiveCfg = Release|Win32 - {FC796B9D-2FC4-46C1-B733-9C2C5BB48094}.Release|Win32.Build.0 = Release|Win32 - {A36D8426-67EB-405C-B6E8-3FBB3374A59B}.Debug|Win32.ActiveCfg = Debug|Win32 - {A36D8426-67EB-405C-B6E8-3FBB3374A59B}.Debug|Win32.Build.0 = Debug|Win32 - {A36D8426-67EB-405C-B6E8-3FBB3374A59B}.Release|Win32.ActiveCfg = Release|Win32 - {A36D8426-67EB-405C-B6E8-3FBB3374A59B}.Release|Win32.Build.0 = Release|Win32 - {6ABF6324-C1DC-4687-9895-B4CE2B27446F}.Debug|Win32.ActiveCfg = Debug|Win32 - {6ABF6324-C1DC-4687-9895-B4CE2B27446F}.Debug|Win32.Build.0 = Debug|Win32 - {6ABF6324-C1DC-4687-9895-B4CE2B27446F}.Release|Win32.ActiveCfg = Release|Win32 - {6ABF6324-C1DC-4687-9895-B4CE2B27446F}.Release|Win32.Build.0 = Release|Win32 - {CF8FE803-A26B-4553-B605-9C28225B5595}.Debug|Win32.ActiveCfg = Debug|Win32 - {CF8FE803-A26B-4553-B605-9C28225B5595}.Debug|Win32.Build.0 = Debug|Win32 - {CF8FE803-A26B-4553-B605-9C28225B5595}.Release|Win32.ActiveCfg = Release|Win32 - {CF8FE803-A26B-4553-B605-9C28225B5595}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/util/write_dsv.vcproj b/test/util/write_dsv.vcproj deleted file mode 100644 index 8525f7393..000000000 --- a/test/util/write_dsv.vcproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/views/box_view.vcproj b/test/views/box_view.vcproj deleted file mode 100644 index ab1036bee..000000000 --- a/test/views/box_view.vcproj +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/views/closeable_view.vcproj b/test/views/closeable_view.vcproj deleted file mode 100644 index 204e1ac30..000000000 --- a/test/views/closeable_view.vcproj +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/views/reversible_closeable.vcproj b/test/views/reversible_closeable.vcproj deleted file mode 100644 index b2a3846b1..000000000 --- a/test/views/reversible_closeable.vcproj +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/views/reversible_view.vcproj b/test/views/reversible_view.vcproj deleted file mode 100644 index f81885210..000000000 --- a/test/views/reversible_view.vcproj +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/views/segment_view.vcproj b/test/views/segment_view.vcproj deleted file mode 100644 index 9b8840193..000000000 --- a/test/views/segment_view.vcproj +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/views/views.sln b/test/views/views.sln deleted file mode 100644 index 7fcf73665..000000000 --- a/test/views/views.sln +++ /dev/null @@ -1,43 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "closeable_view", "closeable_view.vcproj", "{5C40995A-B6FC-4C94-B552-0D80EC9E2049}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reversible_closeable", "reversible_closeable.vcproj", "{AAA72638-34CD-4A34-8329-984DFC766E24}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "reversible_view", "reversible_view.vcproj", "{BFB08FEE-76D6-4F3D-9184-BE03CC3F7968}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "box_view", "box_view.vcproj", "{34A1F53A-DA46-41E6-9E26-740D22D662DC}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "segment_view", "segment_view.vcproj", "{B49AC3E2-3497-465B-88C2-BCADA4B4ADAF}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5C40995A-B6FC-4C94-B552-0D80EC9E2049}.Debug|Win32.ActiveCfg = Debug|Win32 - {5C40995A-B6FC-4C94-B552-0D80EC9E2049}.Debug|Win32.Build.0 = Debug|Win32 - {5C40995A-B6FC-4C94-B552-0D80EC9E2049}.Release|Win32.ActiveCfg = Release|Win32 - {5C40995A-B6FC-4C94-B552-0D80EC9E2049}.Release|Win32.Build.0 = Release|Win32 - {AAA72638-34CD-4A34-8329-984DFC766E24}.Debug|Win32.ActiveCfg = Debug|Win32 - {AAA72638-34CD-4A34-8329-984DFC766E24}.Debug|Win32.Build.0 = Debug|Win32 - {AAA72638-34CD-4A34-8329-984DFC766E24}.Release|Win32.ActiveCfg = Release|Win32 - {AAA72638-34CD-4A34-8329-984DFC766E24}.Release|Win32.Build.0 = Release|Win32 - {BFB08FEE-76D6-4F3D-9184-BE03CC3F7968}.Debug|Win32.ActiveCfg = Debug|Win32 - {BFB08FEE-76D6-4F3D-9184-BE03CC3F7968}.Debug|Win32.Build.0 = Debug|Win32 - {BFB08FEE-76D6-4F3D-9184-BE03CC3F7968}.Release|Win32.ActiveCfg = Release|Win32 - {BFB08FEE-76D6-4F3D-9184-BE03CC3F7968}.Release|Win32.Build.0 = Release|Win32 - {34A1F53A-DA46-41E6-9E26-740D22D662DC}.Debug|Win32.ActiveCfg = Debug|Win32 - {34A1F53A-DA46-41E6-9E26-740D22D662DC}.Debug|Win32.Build.0 = Debug|Win32 - {34A1F53A-DA46-41E6-9E26-740D22D662DC}.Release|Win32.ActiveCfg = Release|Win32 - {34A1F53A-DA46-41E6-9E26-740D22D662DC}.Release|Win32.Build.0 = Release|Win32 - {B49AC3E2-3497-465B-88C2-BCADA4B4ADAF}.Debug|Win32.ActiveCfg = Debug|Win32 - {B49AC3E2-3497-465B-88C2-BCADA4B4ADAF}.Debug|Win32.Build.0 = Debug|Win32 - {B49AC3E2-3497-465B-88C2-BCADA4B4ADAF}.Release|Win32.ActiveCfg = Release|Win32 - {B49AC3E2-3497-465B-88C2-BCADA4B4ADAF}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal