GEOS 3.14.0dev
quadtree/Root.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 * Last port: index/quadtree/Root.java rev 1.7 (JTS-1.10)
16 *
17 **********************************************************************/
18
19#pragma once
20
21#include <geos/export.h>
22#include <geos/index/quadtree/NodeBase.h> // for inheritance
23#include <geos/geom/Coordinate.h> // for composition
24
25// Forward declarations
26namespace geos {
27namespace geom {
28class Envelope;
29}
30namespace index {
31namespace quadtree {
32class Node;
33}
34}
35}
36
37namespace geos {
38namespace index { // geos::index
39namespace quadtree { // geos::index::quadtree
40
48class GEOS_DLL Root: public NodeBase {
49//friend class Unload;
50
51private:
52
53 static const geom::Coordinate origin;
54
60 void insertContained(Node* tree, const geom::Envelope* itemEnv,
61 void* item);
62
63public:
64
65 Root() {}
66
67 ~Root() override {}
68
72 void insert(const geom::Envelope* itemEnv, void* item);
73
74protected:
75
76 bool
77 isSearchMatch(const geom::Envelope& /* searchEnv */) const override
78 {
79 return true;
80 }
81
82};
83
84} // namespace geos::index::quadtree
85} // namespace geos::index
86} // namespace geos
87
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition Envelope.h:59
The base class for nodes in a Quadtree.
Definition quadtree/NodeBase.h:54
Represents a node of a Quadtree.
Definition index/quadtree/Node.h:54
QuadRoot is the root of a single Quadtree. It is centred at the origin, and does not have a defined e...
Definition quadtree/Root.h:48
void insert(const geom::Envelope *itemEnv, void *item)
Basic namespace for all GEOS functionalities.
Definition geos.h:39