GEOS  3.8.0dev
Bintree.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************/
14 
15 #ifndef GEOS_IDX_BINTREE_BINTREE_H
16 #define GEOS_IDX_BINTREE_BINTREE_H
17 
18 #include <geos/export.h>
19 #include <vector>
20 
21 #ifdef _MSC_VER
22 #pragma warning(push)
23 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
24 #endif
25 
26 // Forward declarations
27 namespace geos {
28 namespace index {
29 namespace bintree {
30 class Interval;
31 class Root;
32 }
33 }
34 }
35 
36 namespace geos {
37 namespace index { // geos::index
38 namespace bintree { // geos::index::bintree
39 
54 class GEOS_DLL Bintree {
55 
56 public:
57 
69  static Interval* ensureExtent(const Interval* itemInterval,
70  double minExtent);
71 
72  Bintree();
73 
74  ~Bintree();
75 
76  int depth();
77 
78  int size();
79 
80  int nodeSize();
81 
88  void insert(Interval* itemInterval, void* item);
89 
90  std::vector<void*>* iterator();
91 
92  std::vector<void*>* query(double x);
93 
94  std::vector<void*>* query(Interval* interval);
95 
96  void query(Interval* interval,
97  std::vector<void*>* foundItems);
98 
99 private:
100 
101  std::vector<Interval*>newIntervals;
102 
103  Root* root;
104 
115  double minExtent;
116 
117  void collectStats(Interval* interval);
118 };
119 
120 } // namespace geos::index::bintree
121 } // namespace geos::index
122 } // namespace geos
123 
124 #ifdef _MSC_VER
125 #pragma warning(pop)
126 #endif
127 
128 #endif // GEOS_IDX_BINTREE_BINTREE_H
129 
Represents an (1-dimensional) closed interval on the Real number line.
Definition: bintree/Interval.h:25
A BinTree (or "Binary Interval Tree") is a 1-dimensional version of a quadtree.
Definition: Bintree.h:54
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
The root node of a single Bintree.
Definition: bintree/Root.h:41