Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81548 - in sandbox-branches/geometry/index_dev: boost/geometry/extensions/index test/rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2012-11-26 06:55:41


Author: awulkiew
Date: 2012-11-26 06:55:40 EST (Mon, 26 Nov 2012)
New Revision: 81548
URL: http://svn.boost.org/trac/boost/changeset/81548

Log:
not_xxx() predicates generators removed.
disjoint test added.
Text files modified:
   sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/predicates.hpp | 108 +++------------------------------------
   sandbox-branches/geometry/index_dev/test/rtree/test_rtree.hpp | 24 +++++++-
   2 files changed, 28 insertions(+), 104 deletions(-)

Modified: sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/predicates.hpp
==============================================================================
--- sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/predicates.hpp (original)
+++ sandbox-branches/geometry/index_dev/boost/geometry/extensions/index/predicates.hpp 2012-11-26 06:55:40 EST (Mon, 26 Nov 2012)
@@ -203,15 +203,15 @@
     return detail::overlaps<Geometry>(g);
 }
 
-/*!
-Generate a predicate defining Value and Geometry relationship.
-Value will be returned by the query if bg::touches(Indexable, Geometry)
-returns true.
-
-\tparam Geometry The Geometry type.
-
-\param g The Geometry object.
-*/
+//*!
+//Generate a predicate defining Value and Geometry relationship.
+//Value will be returned by the query if bg::touches(Indexable, Geometry)
+//returns true.
+//
+//\tparam Geometry The Geometry type.
+//
+//\param g The Geometry object.
+//*/
 //template <typename Geometry>
 //inline detail::touches<Geometry> touches(Geometry const& g)
 //{
@@ -233,96 +233,6 @@
     return detail::within<Geometry>(g);
 }
 
-/*!
-Generate a predicate defining Value and Geometry relationship.
-Value will be returned by the query if bg::covered_by(Indexable, Geometry)
-returns false.
-
-\tparam Geometry The Geometry type.
-
-\param g The Geometry object.
-*/
-template <typename Geometry>
-inline detail::not_covered_by<Geometry> not_covered_by(Geometry const& g)
-{
- return detail::not_covered_by<Geometry>(g);
-}
-
-/*!
-Generate a predicate defining Value and Geometry relationship.
-Value will be returned by the query if bg::disjoint(Indexable, Geometry)
-returns false.
-
-\tparam Geometry The Geometry type.
-
-\param g The Geometry object.
-*/
-template <typename Geometry>
-inline detail::not_disjoint<Geometry> not_disjoint(Geometry const& g)
-{
- return detail::not_disjoint<Geometry>(g);
-}
-
-/*!
-Generate a predicate defining Value and Geometry relationship.
-Value will be returned by the query if bg::intersects(Indexable, Geometry)
-returns false.
-
-\tparam Geometry The Geometry type.
-
-\param g The Geometry object.
-*/
-template <typename Geometry>
-inline detail::not_intersects<Geometry> not_intersects(Geometry const& g)
-{
- return detail::not_intersects<Geometry>(g);
-}
-
-/*!
-Generate a predicate defining Value and Geometry relationship.
-Value will be returned by the query if bg::overlaps(Indexable, Geometry)
-returns false.
-
-\tparam Geometry The Geometry type.
-
-\param g The Geometry object.
-*/
-template <typename Geometry>
-inline detail::not_overlaps<Geometry> not_overlaps(Geometry const& g)
-{
- return detail::not_overlaps<Geometry>(g);
-}
-
-/*!
-Generate a predicate defining Value and Geometry relationship.
-Value will be returned by the query if bg::touches(Indexable, Geometry)
-returns false.
-
-\tparam Geometry The Geometry type.
-
-\param g The Geometry object.
-*/
-//template <typename Geometry>
-//inline detail::not_touches<Geometry> not_touches(Geometry const& g)
-//{
-// return detail::not_touches<Geometry>(g);
-//}
-
-/*!
-Generate a predicate defining Value and Geometry relationship.
-Value will be returned by the query if bg::within(Indexable, Geometry)
-returns false.
-
-\tparam Geometry The Geometry type.
-
-\param g The Geometry object.
-*/
-template <typename Geometry>
-inline detail::not_within<Geometry> not_within(Geometry const& g)
-{
- return detail::not_within<Geometry>(g);
-}
-
 namespace detail
 {
 

Modified: sandbox-branches/geometry/index_dev/test/rtree/test_rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index_dev/test/rtree/test_rtree.hpp (original)
+++ sandbox-branches/geometry/index_dev/test/rtree/test_rtree.hpp 2012-11-26 06:55:40 EST (Mon, 26 Nov 2012)
@@ -281,7 +281,7 @@
 // rtree specific queries tests
 
 template <typename Value, typename Algo, typename Box>
-void test_intersects_and_disjoint(bgi::rtree<Value, Algo> const& tree, std::vector<Value> const& input, Box const& qbox)
+void test_intersects(bgi::rtree<Value, Algo> const& tree, std::vector<Value> const& input, Box const& qbox)
 {
     std::vector<Value> expected_output;
 
@@ -291,12 +291,24 @@
 
     test_spatial_query(tree, qbox, expected_output);
     test_spatial_query(tree, bgi::intersects(qbox), expected_output);
- test_spatial_query(tree, !bgi::not_intersects(qbox), expected_output);
     test_spatial_query(tree, !bgi::disjoint(qbox), expected_output);
- test_spatial_query(tree, bgi::not_disjoint(qbox), expected_output);
 }
 
 template <typename Value, typename Algo, typename Box>
+void test_disjoint(bgi::rtree<Value, Algo> const& tree, std::vector<Value> const& input, Box const& qbox)
+{
+ std::vector<Value> expected_output;
+
+ BOOST_FOREACH(Value const& v, input)
+ if ( bg::disjoint(tree.translator()(v), qbox) )
+ expected_output.push_back(v);
+
+ test_spatial_query(tree, bgi::disjoint(qbox), expected_output);
+ test_spatial_query(tree, !bgi::intersects(qbox), expected_output);
+}
+
+
+template <typename Value, typename Algo, typename Box>
 void test_covered_by(bgi::rtree<Value, Algo> const& tree, std::vector<Value> const& input, Box const& qbox)
 {
     std::vector<Value> expected_output;
@@ -638,7 +650,8 @@
 
     generate_rtree(tree, input, qbox);
 
- test_intersects_and_disjoint(tree, input, qbox);
+ test_intersects(tree, input, qbox);
+ test_disjoint(tree, input, qbox);
     test_covered_by(tree, input, qbox);
     test_overlaps(tree, input, qbox);
     //test_touches(tree, input, qbox);
@@ -661,7 +674,8 @@
     Tree empty_tree(parameters);
     std::vector<Value> empty_input;
 
- test_intersects_and_disjoint(empty_tree, empty_input, qbox);
+ test_intersects(empty_tree, empty_input, qbox);
+ test_disjoint(empty_tree, empty_input, qbox);
     test_covered_by(empty_tree, empty_input, qbox);
     test_overlaps(empty_tree, empty_input, qbox);
     //test_touches(empty_tree, empty_input, qbox);


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