GEOS 3.14.0dev
bintree/NodeBase.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#pragma once
16
17#include <geos/export.h>
18#include <vector>
19
20// Forward declarations
21namespace geos {
22namespace index {
23namespace bintree {
24class Node;
25class Interval;
26}
27}
28}
29
30namespace geos {
31namespace index { // geos::index
32namespace bintree { // geos::index::bintree
33
35class GEOS_DLL NodeBase {
36
37public:
38
39 static int getSubnodeIndex(Interval* interval, double centre);
40
41 NodeBase();
42
43 virtual ~NodeBase();
44
45 virtual std::vector<void*>* getItems();
46
47 virtual void add(void* item);
48
49 virtual std::vector<void*>* addAllItems(std::vector<void*>* newItems);
50
51 virtual std::vector<void*>* addAllItemsFromOverlapping(Interval* interval,
52 std::vector<void*>* resultItems);
53
54 virtual int depth();
55
56 virtual int size();
57
58 virtual int nodeSize();
59
60protected:
61
62 std::vector<void*>* items;
63
69 Node* subnode[2];
70
71 virtual bool isSearchMatch(Interval* interval) = 0;
72
73private:
74
75 NodeBase(const NodeBase&) = delete;
76 NodeBase& operator=(const NodeBase&) = delete;
77
78};
79
80} // namespace geos::index::bintree
81} // namespace geos::index
82} // namespace geos
83
Represents an (1-dimensional) closed interval on the Real number line.
Definition bintree/Interval.h:24
The base class for nodes in a Bintree.
Definition bintree/NodeBase.h:35
A node of a Bintree.
Definition index/bintree/Node.h:34
Basic namespace for all GEOS functionalities.
Definition geos.h:39