Node.h

00001 /**********************************************************************
00002  * $Id: Node.h 1820 2006-09-06 16:54:23Z mloskot $
00003  *
00004  * GEOS - Geometry Engine Open Source
00005  * http://geos.refractions.net
00006  *
00007  * Copyright (C) 2006 Refractions Research Inc.
00008  *
00009  * This is free software; you can redistribute and/or modify it under
00010  * the terms of the GNU Lesser General Public Licence as published
00011  * by the Free Software Foundation. 
00012  * See the COPYING file for more information.
00013  *
00014  **********************************************************************/
00015 
00016 #ifndef GEOS_IDX_BINTREE_NODE_H
00017 #define GEOS_IDX_BINTREE_NODE_H
00018 
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 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 
00078 /**********************************************************************
00079  * $Log$
00080  * Revision 1.1  2006/03/22 16:01:33  strk
00081  * indexBintree.h header split, classes renamed to match JTS
00082  *
00083  **********************************************************************/
00084 

Generated on Fri Mar 27 04:52:53 2009 for GEOS by  doxygen 1.5.4