GEOS 3.8.1
SortedPackedIntervalRTree.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
16#ifndef GEOS_INDEX_INTERVALRTREE_SORTEDPACKEDINTERVALRTREE_H
17#define GEOS_INDEX_INTERVALRTREE_SORTEDPACKEDINTERVALRTREE_H
18
19#include <geos/index/intervalrtree/IntervalRTreeNode.h>
20#include <geos/index/intervalrtree/IntervalRTreeBranchNode.h>
21#include <geos/index/intervalrtree/IntervalRTreeLeafNode.h>
22
23// forward declarations
24namespace geos {
25namespace index {
26class ItemVisitor;
27}
28}
29
30namespace geos {
31namespace index {
32namespace intervalrtree {
33
52private:
53 std::vector<IntervalRTreeLeafNode> leaves;
54 std::vector<IntervalRTreeBranchNode> branches;
55
62 const IntervalRTreeNode* root = nullptr;
63 int level = 0;
64
65 void init();
66 void buildLevel(IntervalRTreeNode::ConstVect& src, IntervalRTreeNode::ConstVect& dest);
67 const IntervalRTreeNode* buildTree();
68
69protected:
70public:
72
73 SortedPackedIntervalRTree(std::size_t initialCapacity)
74 {
75 leaves.reserve(initialCapacity);
76 }
77
87 void insert(double min, double max, void* item);
88
97 void query(double min, double max, index::ItemVisitor* visitor);
98
99};
100
101} // geos::intervalrtree
102} // geos::index
103} // geos
104
105#endif // GEOS_INDEX_INTERVALRTREE_SORTEDPACKEDINTERVALRTREE_H
106
A visitor for items in an index.
Definition: ItemVisitor.h:29
A static index on a set of 1-dimensional intervals, using an R-Tree packed based on the order of the ...
Definition: SortedPackedIntervalRTree.h:51
void query(double min, double max, index::ItemVisitor *visitor)
void insert(double min, double max, void *item)
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25