GEOS  3.8.0
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
24 namespace geos {
25 namespace index {
26 class ItemVisitor;
27 }
28 }
29 
30 namespace geos {
31 namespace index {
32 namespace intervalrtree {
33 
52 private:
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 
69 protected:
70 public:
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 
void insert(double min, double max, void *item)
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)
A visitor for items in an index.
Definition: ItemVisitor.h:29
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25