GEOS
3.6.2
|
00001 /********************************************************************** 00002 * 00003 * GEOS - Geometry Engine Open Source 00004 * http://geos.osgeo.org 00005 * 00006 * Copyright (C) 2006 Refractions Research Inc. 00007 * 00008 * This is free software; you can redistribute and/or modify it under 00009 * the terms of the GNU Lesser General Public Licence as published 00010 * by the Free Software Foundation. 00011 * See the COPYING file for more information. 00012 * 00013 **********************************************************************/ 00014 00015 #ifndef GEOS_IDX_BINTREE_NODE_H 00016 #define GEOS_IDX_BINTREE_NODE_H 00017 00018 #include <geos/export.h> 00019 #include <geos/index/bintree/NodeBase.h> // for inheritance 00020 00021 // Forward declarations 00022 namespace geos { 00023 namespace index { 00024 namespace bintree { 00025 class Interval; 00026 } 00027 } 00028 } 00029 00030 namespace geos { 00031 namespace index { // geos::index 00032 namespace bintree { // geos::index::bintree 00033 00035 class GEOS_DLL Node: public NodeBase { 00036 00037 public: 00038 00039 static Node* createNode(Interval *itemInterval); 00040 00041 static Node* createExpanded(Node *node,Interval *addInterval); 00042 00043 Node(Interval *newInterval,int newLevel); 00044 00045 ~Node(); 00046 00047 Interval* getInterval(); 00048 00049 Node* getNode(Interval *searchInterval); 00050 00051 NodeBase* find(Interval *searchInterval); 00052 00053 void insert(Node *node); 00054 00055 private: 00056 00057 Interval *interval; 00058 00059 double centre; 00060 00061 int level; 00062 00063 Node* getSubnode(int index); 00064 00065 Node* createSubnode(int index); 00066 00067 protected: 00068 00069 bool isSearchMatch(Interval *itemInterval); 00070 }; 00071 00072 } // namespace geos::index::bintree 00073 } // namespace geos::index 00074 } // namespace geos 00075 00076 #endif // GEOS_IDX_BINTREE_NODE_H 00077