GEOS 3.4.2

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

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
56 class GEOS_DLL Bintree {
57
58 public:
59
70 static Interval* ensureExtent(const Interval *itemInterval,
71 double minExtent);
72
73 Bintree();
74
75 ~Bintree();
76
77 int depth();
78
79 int size();
80
81 int nodeSize();
82
89 void insert(Interval *itemInterval, void* item);
90
91 std::vector<void*>* iterator();
92
93 std::vector<void*>* query(double x);
94
95 std::vector<void*>* query(Interval *interval);
96
97 void query(Interval *interval,
98 std::vector<void*> *foundItems);
99
100 private:
101
102 std::vector<Interval *>newIntervals;
103
104 Root *root;
105
116 double minExtent;
117
118 void collectStats(Interval *interval);
119 };
120
121 } // namespace geos::index::bintree
122 } // namespace geos::index
123 } // namespace geos
124
125 #ifdef _MSC_VER
126 #pragma warning(pop)
127 #endif
128
129 #endif // GEOS_IDX_BINTREE_BINTREE_H
130