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
21 namespace geos {
22 namespace index {
23 namespace bintree {
24 class Node;
25 class Interval;
26 }
27 }
28 }
29 
30 namespace geos {
31 namespace index { // geos::index
32 namespace bintree { // geos::index::bintree
33 
35 class GEOS_DLL NodeBase {
36 
37 public:
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 
60 protected:
61 
62  std::vector<void*>* items;
63 
69  Node* subnode[2];
70 
71  virtual bool isSearchMatch(Interval* interval) = 0;
72 
73 private:
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: Angle.h:25