00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GEOS_IDX_BINTREE_NODEBASE_H
00017 #define GEOS_IDX_BINTREE_NODEBASE_H
00018
00019 #include <vector>
00020
00021
00022 namespace geos {
00023 namespace index {
00024 namespace bintree {
00025 class Node;
00026 class Interval;
00027 }
00028 }
00029 }
00030
00031 namespace geos {
00032 namespace index {
00033 namespace bintree {
00034
00036 class NodeBase {
00037
00038 public:
00039
00040 static int getSubnodeIndex(Interval *interval, double centre);
00041
00042 NodeBase();
00043
00044 virtual ~NodeBase();
00045
00046 virtual std::vector<void*> *getItems();
00047
00048 virtual void add(void* item);
00049
00050 virtual std::vector<void*>* addAllItems(std::vector<void*> *newItems);
00051
00052 virtual std::vector<void*>* addAllItemsFromOverlapping(Interval *interval,
00053 std::vector<void*> *resultItems);
00054
00055 virtual int depth();
00056
00057 virtual int size();
00058
00059 virtual int nodeSize();
00060
00061 protected:
00062
00063 std::vector<void*>* items;
00064
00070 Node* subnode[2];
00071
00072 virtual bool isSearchMatch(Interval *interval)=0;
00073 };
00074
00075 }
00076 }
00077 }
00078
00079 #endif // GEOS_IDX_BINTREE_NODEBASE_H
00080
00081
00082
00083
00084
00085
00086
00087