GEOS 3.9.1
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
27namespace geos {
28namespace index {
29namespace bintree {
30class Interval;
31class Root;
32}
33}
34}
35
36namespace geos {
37namespace index { // geos::index
38namespace bintree { // geos::index::bintree
39
54class GEOS_DLL Bintree {
55
56public:
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
99private:
100
101 std::vector<Interval*>newIntervals;
102
103 Root* root;
104
115 double minExtent;
116
117 void collectStats(Interval* interval);
118
119 Bintree(const Bintree&) = delete;
120 Bintree& operator=(const Bintree&) = delete;
121};
122
123} // namespace geos::index::bintree
124} // namespace geos::index
125} // namespace geos
126
127#ifdef _MSC_VER
128#pragma warning(pop)
129#endif
130
131#endif // GEOS_IDX_BINTREE_BINTREE_H
132
A BinTree (or "Binary Interval Tree") is a 1-dimensional version of a quadtree.
Definition: Bintree.h:54
static Interval * ensureExtent(const Interval *itemInterval, double minExtent)
Ensure that the Interval for the inserted item has non-zero extents.
void insert(Interval *itemInterval, void *item)
Represents an (1-dimensional) closed interval on the Real number line.
Definition: bintree/Interval.h:25
The root node of a single Bintree.
Definition: bintree/Root.h:41
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26