From c583fb2eb5e6c014bc6dbe1f7eaa2e2521112496 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Tue, 18 Jun 2013 16:31:34 +0000 Subject: [PATCH] [geometry][index]: added contains() and touches() predicates generators as experimental features. [SVN r84827] --- include/boost/geometry/index/predicates.hpp | 71 +++++++++++++++------ 1 file changed, 52 insertions(+), 19 deletions(-) diff --git a/include/boost/geometry/index/predicates.hpp b/include/boost/geometry/index/predicates.hpp index 36c7fa369..dbbd5cb04 100644 --- a/include/boost/geometry/index/predicates.hpp +++ b/include/boost/geometry/index/predicates.hpp @@ -27,6 +27,35 @@ namespace boost { namespace geometry { namespace index { +#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL + +/*! +\brief Generate \c contains() predicate. + +Generate a predicate defining Value and Geometry relationship. +Value will be returned by the query if bg::within(Geometry, Indexable) +returns true. + +\par Example +\verbatim +bgi::query(spatial_index, bgi::contains(box), std::back_inserter(result)); +\endverbatim + +\ingroup predicates + +\tparam Geometry The Geometry type. + +\param g The Geometry object. +*/ +template inline +detail::spatial_predicate +contains(Geometry const& g) +{ + return detail::spatial_predicate(g); +} + +#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL + /*! \brief Generate \c covered_by() predicate. @@ -129,25 +158,29 @@ overlaps(Geometry const& g) return detail::spatial_predicate(g); } -///*! -//\brief Generate \c touches() predicate. -// -//Generate a predicate defining Value and Geometry relationship. -//Value will be returned by the query if bg::touches(Indexable, Geometry) -//returns true. -// -//\ingroup predicates -// -//\tparam Geometry The Geometry type. -// -//\param g The Geometry object. -//*/ -//template inline -//detail::spatial_predicate -//touches(Geometry const& g) -//{ -// return detail::spatial_predicate(g); -//} +#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL + +/*! +\brief Generate \c touches() predicate. + +Generate a predicate defining Value and Geometry relationship. +Value will be returned by the query if bg::touches(Indexable, Geometry) +returns true. + +\ingroup predicates + +\tparam Geometry The Geometry type. + +\param g The Geometry object. +*/ +template inline +detail::spatial_predicate +touches(Geometry const& g) +{ + return detail::spatial_predicate(g); +} + +#endif // BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL /*! \brief Generate \c within() predicate.