operator| moved to namespace index

[SVN r71642]
This commit is contained in:
Adam Wulkiewicz
2011-05-01 01:11:45 +00:00
parent 7a761b359e
commit 803ac7fbf9
3 changed files with 34 additions and 13 deletions

View File

@@ -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 @@ detail::nearest_filtered<Point> nearest_filtered(
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 @@ boost::geometry::index::filters::nearest_filter<SpacialIndex>
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

View File

@@ -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 @@ detail::spatially_filtered<Geometry> spatially_filtered(Geometry const& geom)
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

View File

@@ -31,17 +31,17 @@ class spatial_filter< index::rtree<Value, Translator, Tag> >
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 @@ private:
} // 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