line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
|
|
|
|
|
|
* Last port: index/quadtree/Root.java rev 1.7 (JTS-1.10) |
16
|
|
|
|
|
|
|
* |
17
|
|
|
|
|
|
|
**********************************************************************/ |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
#ifndef GEOS_IDX_QUADTREE_ROOT_H |
20
|
|
|
|
|
|
|
#define GEOS_IDX_QUADTREE_ROOT_H |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
#include |
23
|
|
|
|
|
|
|
#include // for inheritance |
24
|
|
|
|
|
|
|
#include // for composition |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
// Forward declarations |
27
|
|
|
|
|
|
|
namespace geos { |
28
|
|
|
|
|
|
|
namespace geom { |
29
|
|
|
|
|
|
|
class Envelope; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
namespace index { |
32
|
|
|
|
|
|
|
namespace quadtree { |
33
|
|
|
|
|
|
|
class Node; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
namespace geos { |
39
|
|
|
|
|
|
|
namespace index { // geos::index |
40
|
|
|
|
|
|
|
namespace quadtree { // geos::index::quadtree |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
/** |
43
|
|
|
|
|
|
|
* \class Root indexQuadtree.h geos/indexQuadtree.h |
44
|
|
|
|
|
|
|
* |
45
|
|
|
|
|
|
|
* \brief |
46
|
|
|
|
|
|
|
* QuadRoot is the root of a single Quadtree. It is centred at the origin, |
47
|
|
|
|
|
|
|
* and does not have a defined extent. |
48
|
|
|
|
|
|
|
*/ |
49
|
|
|
|
|
|
|
class GEOS_DLL Root: public NodeBase { |
50
|
|
|
|
|
|
|
//friend class Unload; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
private: |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
static const geom::Coordinate origin; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
/** |
57
|
|
|
|
|
|
|
* insert an item which is known to be contained in the tree rooted at |
58
|
|
|
|
|
|
|
* the given QuadNode root. Lower levels of the tree will be created |
59
|
|
|
|
|
|
|
* if necessary to hold the item. |
60
|
|
|
|
|
|
|
*/ |
61
|
|
|
|
|
|
|
void insertContained(Node *tree, const geom::Envelope *itemEnv, |
62
|
|
|
|
|
|
|
void* item); |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
public: |
65
|
|
|
|
|
|
|
|
66
|
12
|
|
|
|
|
|
Root() {} |
67
|
|
|
|
|
|
|
|
68
|
0
|
0
|
|
|
|
|
~Root() override {} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
/** |
71
|
|
|
|
|
|
|
* Insert an item into the quadtree this is the root of. |
72
|
|
|
|
|
|
|
*/ |
73
|
|
|
|
|
|
|
void insert(const geom::Envelope *itemEnv, void* item); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
protected: |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
bool isSearchMatch(const geom::Envelope& /* searchEnv */) const override { |
78
|
0
|
|
|
|
|
|
return true; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
}; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
} // namespace geos::index::quadtree |
84
|
|
|
|
|
|
|
} // namespace geos::index |
85
|
|
|
|
|
|
|
} // namespace geos |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
#endif // GEOS_IDX_QUADTREE_ROOT_H |