16 #ifndef SPATIAL_OVERLAP_REGION_HPP
17 #define SPATIAL_OVERLAP_REGION_HPP
19 #include "spatial_region.hpp"
59 template <
typename Key,
typename Compare,
60 typename Layout = llhh_layout_tag>
74 : Compare(compare),
_target(target)
96 return (dim < (rank >> 1))
97 ? (Compare::operator()(dim, key, dim + (rank >> 1), _target)
99 : (Compare::operator()(dim - (rank >> 1), _target, dim, key)
107 return ((dim % 2) == 0)
108 ? (Compare::operator()(dim, key, dim + 1, _target) ?
matching :
above)
116 return (dim < (rank >> 1))
117 ? (Compare::operator()(dim + (rank >> 1), _target, dim, key)
119 : (Compare::operator()(dim, key, dim - (rank >> 1), _target)
127 return ((dim % 2) == 0)
128 ? (Compare::operator()(dim + 1, _target, dim, key) ?
matching :
below)
140 template <
typename Tp,
typename Layout>
142 overlap_bounds<typename container_traits<Tp>::key_type,
143 typename container_traits<Tp>::key_compare,
146 (
const Tp& container,
150 ::spatial::except::check_box(container, target, tag);
153 typename container_traits<Tp>::key_compare, Layout>
154 (container.key_comp(), target);
157 template <
typename Tp>
158 overlap_bounds<typename container_traits<Tp>::key_type,
159 typename container_traits<Tp>::key_compare>
161 (
const Tp& container,
166 template<
typename Ct,
typename Layout = llhh_layout_tag>
169 <Ct, overlap_bounds<typename container_traits<Ct>::key_type,
170 typename container_traits<Ct>::key_compare,
187 template<
typename Ct,
typename Layout>
190 <const Ct, overlap_bounds<typename container_traits<Ct>::key_type,
191 typename container_traits<Ct>::key_compare,
211 typename container_traits<Ct>::key_compare,
214 <
const Ct, overlap_bounds<typename container_traits<Ct>::key_type,
215 typename container_traits<Ct>::key_compare,
220 template<
typename Ct,
typename Layout = llhh_layout_tag>
223 <Ct, overlap_bounds<typename container_traits<Ct>::key_type,
224 typename container_traits<Ct>::key_compare,
233 typename container_traits<Ct>::key_compare,
237 typename container_traits<Ct>::key_compare,
240 <Ct, overlap_bounds<typename container_traits<Ct>::key_type,
241 typename container_traits<Ct>::key_compare,
246 template<
typename Ct,
typename Layout>
249 <const Ct, overlap_bounds<typename container_traits<Ct>::key_type,
250 typename container_traits<Ct>::key_compare,
259 typename container_traits<Ct>::key_compare,
263 typename container_traits<Ct>::key_compare,
266 <
const Ct, overlap_bounds<typename container_traits<Ct>::key_type,
267 typename container_traits<Ct>::key_compare,
274 <
const Ct, overlap_bounds<typename container_traits<Ct>::key_type,
275 typename container_traits<Ct>::key_compare,
280 template <
typename Ct>
281 inline overlap_region_iterator<Ct>
289 template <
typename Ct,
typename Layout>
290 inline overlap_region_iterator<Ct, Layout>
293 const Layout& layout)
299 template <
typename Ct>
300 inline overlap_region_iterator<const Ct>
308 template <
typename Ct,
typename Layout>
309 inline overlap_region_iterator<const Ct, Layout>
312 const Layout& layout)
318 template <
typename Ct>
319 inline overlap_region_iterator<const Ct>
327 template <
typename Ct,
typename Layout>
328 inline overlap_region_iterator<const Ct, Layout>
331 const Layout& layout)
337 template <
typename Ct>
338 inline overlap_region_iterator<Ct>
346 template <
typename Ct,
typename Layout>
347 inline overlap_region_iterator<Ct, Layout>
350 const Layout& layout)
356 template <
typename Ct>
357 inline overlap_region_iterator<const Ct>
365 template <
typename Ct,
typename Layout>
366 inline overlap_region_iterator<const Ct, Layout>
369 const Layout& layout)
375 template <
typename Ct>
376 inline overlap_region_iterator<const Ct>
384 template <
typename Ct,
typename Layout>
385 inline overlap_region_iterator<const Ct, Layout>
388 const Layout& layout)
394 template <
typename Ct>
395 inline overlap_region_iterator_pair<Ct>
403 template <
typename Ct,
typename Layout>
404 inline overlap_region_iterator_pair<Ct, Layout>
407 const Layout& layout)
413 template <
typename Ct>
414 inline overlap_region_iterator_pair<const Ct>
422 template <
typename Ct,
typename Layout>
423 inline overlap_region_iterator_pair<const Ct, Layout>
426 const Layout& layout)
432 template <
typename Ct>
433 inline overlap_region_iterator_pair<const Ct>
441 template <
typename Ct,
typename Layout>
442 inline overlap_region_iterator_pair<const Ct, Layout>
445 const Layout& layout)
453 #endif // SPATIAL_OVERLAP_REGION_HPP
overlap_region_iterator< Ct > overlap_region_begin(Ct &container, const typename container_traits< Ct >::key_type &target)
This type provides both an iterator and a constant iterator to iterate through all elements of a tree...
overlap_region_iterator< Ct > overlap_region_end(Ct &container, const typename container_traits< Ct >::key_type &target)
overlap_region_iterator_pair< const Ct > overlap_region_crange(const Ct &container, const typename container_traits< Ct >::key_type &target)
Represents a coordinate layout for the box.
Represents a coordinate layout for the box.
overlap_region_iterator_pair()
defctor
region_iterator< const Ct, Predicate > region_cend(const Ct &container, const Predicate &pred)
This structure defines a pair of mutable region iterator.
relative_order overlap_bounds_impl(dimension_type dim, dimension_type rank, const Key &key, llhh_layout_tag) const
overlap_region_iterator_pair()
defctor
Tp::key_type key_type
The type representing the key managed by the container.
overlap_bounds()
The default constructor leaves everything un-initialized.
This class is a model of Region Predicate that matches any keys that is overlapping with a given test...
region_iterator< Ct, Predicate > region_begin(Ct &container, const Predicate &pred)
region_iterator_pair< Ct, Predicate > region_range(Ct &container, const Predicate &pred)
Returns a spatial::region_iterator_pair where first points to the first element matching the predicat...
The traits type for all containers in the spatial namespace.
region_iterator< const Ct, Predicate > region_cbegin(const Ct &container, const Predicate &pred)
relative_order
Defines values for relative ordering.
std::size_t dimension_type
Defines the type for the dimension as being a size.
region_iterator< Ct, Predicate > region_end(Ct &container, const Predicate &pred)
overlap_region_iterator()
defctor
overlap_bounds(const Compare &compare, const Key &target)
Set the target box and the comparator to the appropriate value.
relative_order operator()(dimension_type dim, dimension_type rank, const Key &key) const
The operator that tells wheather the point is in region or not.
Represents a coordinate layout for the box.
overlap_region_iterator_pair< Ct > overlap_region_range(Ct &container, const typename container_traits< Ct >::key_type &target)
The main namespace used in the library.
region_iterator_pair< const Ct, Predicate > region_crange(const Ct &container, const Predicate &pred)
This overload works only on constant containers and will return a set of constant iterators...
Key _target
The box value that will be used for overlaping comparison.
overlap_region_iterator< const Ct > overlap_region_cend(const Ct &container, const typename container_traits< Ct >::key_type &target)
Represents a coordinate layout for the box.
overlap_region_iterator()
defctor
overlap_region_iterator< const Ct > overlap_region_cbegin(const Ct &container, const typename container_traits< Ct >::key_type &target)
overlap_bounds< typename container_traits< Tp >::key_type, typename container_traits< Tp >::key_compare, Layout > make_overlap_bounds(const Tp &container, const typename container_traits< Tp >::key_type &target, Layout tag)
Overlap bounds factory that takes in a container, a key and returns an overlap_bounds type...