Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71642 - in sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index: filters rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2011-04-30 21:11:46


Author: awulkiew
Date: 2011-04-30 21:11:45 EDT (Sat, 30 Apr 2011)
New Revision: 71642
URL: http://svn.boost.org/trac/boost/changeset/71642

Log:
operator| moved to namespace index
Text files modified:
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/filters/nearest_filter.hpp | 8 ++++++--
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/filters/spacial_filter.hpp | 14 +++++++++-----
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/filters.hpp | 25 +++++++++++++++++++------
   3 files changed, 34 insertions(+), 13 deletions(-)

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/filters/nearest_filter.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/filters/nearest_filter.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/filters/nearest_filter.hpp 2011-04-30 21:11:45 EDT (Sat, 30 Apr 2011)
@@ -10,7 +10,9 @@
 #ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_FILTERS_NEAREST_FILTER_HPP
 #define BOOST_GEOMETRY_EXTENSIONS_INDEX_FILTERS_NEAREST_FILTER_HPP
 
-namespace boost { namespace geometry { namespace index { namespace filters {
+namespace boost { namespace geometry { namespace index {
+
+namespace filters {
 
 template <typename SpacialIndex>
 class nearest_filter
@@ -64,7 +66,7 @@
     return detail::nearest_filtered<Point>(p, distance);
 }
 
-}}}} // namespace boost::geometry::index::filters
+} // namespace filters
 
 template<typename SpacialIndex, typename Point>
 boost::geometry::index::filters::nearest_filter<SpacialIndex>
@@ -75,4 +77,6 @@
     return boost::geometry::index::filters::nearest_filter<SpacialIndex>(si, f.point(), f.distance());
 }
 
+}}} // namespace boost::geometry::index
+
 #endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_FILTERS_NEAREST_FILTER_HPP

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/filters/spacial_filter.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/filters/spacial_filter.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/filters/spacial_filter.hpp 2011-04-30 21:11:45 EDT (Sat, 30 Apr 2011)
@@ -10,7 +10,9 @@
 #ifndef BOOST_GEOMETRY_EXTENSIONS_INDEX_FILTERS_SPACIAL_FILTER_HPP
 #define BOOST_GEOMETRY_EXTENSIONS_INDEX_FILTERS_SPACIAL_FILTER_HPP
 
-namespace boost { namespace geometry { namespace index { namespace filters {
+namespace boost { namespace geometry { namespace index {
+
+namespace filters {
 
 template <typename SpacialIndex>
 class spatial_filter
@@ -49,15 +51,17 @@
     return detail::spatially_filtered<Geometry>(geom);
 }
 
-}}}} // namespace boost::geometry::index::filters
+} // namespace filters
 
 template<typename SpacialIndex, typename Geometry>
-boost::geometry::index::filters::spatial_filter<SpacialIndex>
+index::filters::spatial_filter<SpacialIndex>
 operator|(
     SpacialIndex const& si,
- boost::geometry::index::filters::detail::spatially_filtered<Geometry> const& f)
+ index::filters::detail::spatially_filtered<Geometry> const& f)
 {
- return boost::geometry::index::filters::spatial_filter<SpacialIndex>(si, f.geometry());
+ return index::filters::spatial_filter<SpacialIndex>(si, f.geometry());
 }
 
+}}} // namespace boost::geometry::index
+
 #endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_FILTERS_SPACIAL_FILTER_HPP

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/filters.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/filters.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/filters.hpp 2011-04-30 21:11:45 EDT (Sat, 30 Apr 2011)
@@ -31,17 +31,17 @@
 public:
     typedef typename std::deque<Value>::iterator iterator;
     typedef typename std::deque<Value>::const_iterator const_iterator;
-
+
     template <typename Geometry>
- spatial_filter(index::rtree<Value, Translator, Tag> const& rtree, Geometry const& geom)
+ inline spatial_filter(index::rtree<Value, Translator, Tag> const& rtree, Geometry const& geom)
     {
         rtree.find(geom, std::back_inserter(m_result));
     }
 
- iterator begin() { return m_result.begin(); }
- iterator end() { return m_result.end(); }
- const_iterator begin() const { return m_result.begin(); }
- const_iterator end() const { return m_result.end(); }
+ inline iterator begin() { return m_result.begin(); }
+ inline iterator end() { return m_result.end(); }
+ inline const_iterator begin() const { return m_result.begin(); }
+ inline const_iterator end() const { return m_result.end(); }
 
 private:
     std::deque<Value> m_result;
@@ -49,6 +49,19 @@
 
 } // namespace filters
 
+// TODO: awulkiew - filter may be implemented in operator|
+
+//template<typename Value, typename Translator, typename Tag, typename Geometry>
+//std::deque<Value>
+//operator|(
+// index::rtree<Value, Translator, Tag> const& si,
+// index::filters::detail::spatially_filtered<Geometry> const& f)
+//{
+// std::deque<Value> result;
+// si.find(f.geometry(), std::back_inserter(result));
+// return result;
+//}
+
 }}} // namespace boost::geometry::index
 
 #endif // BOOST_GEOMETRY_EXTENSIONS_INDEX_RTREE_FILTERS_HPP


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