12 # include <vcl_msvc_warnings.h> 20 template <
class V,
class B,
class C>
class vgl_rtree;
23 template <
class V,
class B,
class C>
29 virtual bool meets(V
const &
v)
const { B b; C::init(b,
v);
return meets(b); }
30 virtual bool meets(B
const &b)
const =0;
35 #define vgl_rtree_MAX_VERTICES (8) 39 #define vgl_rtree_MAX_CHILDREN (8) 42 template <
class V,
class B,
class C>
80 void get(B
const ®ion, std::vector<V> &)
const;
86 void get_all(std::vector<V> &vs)
const;
89 bool find(V
const &
v,
node **n,
int *i)
const;
90 bool find(B
const &b, V
const &
v,
node **n,
int *i)
const;
96 void erase(
unsigned int i);
115 template <
class V,
class B,
class C>
130 template <
class V,
class B,
class C>
134 template <
class V,
class B,
class C>
137 {
return !( a == b ); }
140 template <
class V,
class B,
class C>
161 template <
class V,
class B,
class C>
242 template <
class V,
class B,
class C>
267 void add(V
const &
v) {
313 void get(B
const ®ion, std::vector<V> &vs)
const {
325 void get_all(std::vector<V> &vs)
const {
336 unsigned size()
const {
341 unsigned nodes()
const {
360 #define VGL_RTREE_INSTANTIATE(V, B, C) extern "you must include vgl_rtree.hxx first" 362 #endif // vgl_rtree_h_ void get_all(std::vector< V > &vs) const
vgl_rtree_probe< V, B, C > probe
void update_total_vts(int diff)
vgl_rtree_node< V, B, C > node
virtual ~vgl_rtree_probe()=default
void remove(V const &v)
remove one element from the rtree.
unsigned int find_index_in_parent() const
#define vgl_rtree_MAX_VERTICES
max. number of Vs stored in a node.
vgl_rtree_const_iterator(vgl_rtree_iterator< V, B, C > const &that)
void get(B const ®ion, std::vector< V > &vs) const
get elements in the given region.
unsigned size() const
return number of elements stored in the tree.
const_iterator begin() const
bool operator==(vgl_rtree_iterator_base< V, B, C > const &a, vgl_rtree_iterator_base< V, B, C > const &b)
void add(V const &v)
add an element to the rtree.
vgl_rtree< V, B, C > & operator=(vgl_rtree< V, B, C > const &)
node * chs[vgl_rtree_MAX_CHILDREN]
Represent a node in the rtree.
void update_vertex_count(int diff)
void update_child_count(int diff)
vgl_rtree_const_iterator< V, B, C > const_iterator
node * secret_get_root() const
vgl_rtree_node< V, B, C > node
void erase(iterator i)
erase the element pointed to by the iterator.
virtual bool meets(V const &v) const
return true if the probe "meets" the given object.
vgl_rtree_iterator_base()
const_iterator end() const
vgl_rtree_iterator_base< V, B, C > base
vgl_rtree_const_iterator()=default
unsigned nodes() const
return number of nodes used by the tree.
bool empty() const
return true iff the tree has no elements.
vgl_rtree_node(node *parent, V const &v)
bool find(V const &v, node **n, int *i) const
vgl_rtree_iterator< V, B, C > iterator
iterators.
bool contains(V const &v) const
return true iff the rtree contains an element equal to v.
void erase(unsigned int i)
void get_all(std::vector< V > &vs) const
get all elements in the tree.
void get(B const ®ion, std::vector< V > &) const
void update_total_chs(int diff)
#define vgl_rtree_MAX_CHILDREN
max. number of children of a given node.
const_iterator for rtree.
V const & operator *() const
bool operator!=(vgl_rtree_iterator_base< V, B, C > const &a, vgl_rtree_iterator_base< V, B, C > const &b)
vgl_rtree_node< V, B, C > node
vgl_rtree_node< V, B, C > node
vgl_rtree_iterator()=default
vgl_rtree_iterator_base< V, B, C > base
V vts[vgl_rtree_MAX_VERTICES]
vgl_rtree_node< V, B, C > node
Base class for both rtree iterators.
Function predicate object for querying the tree.