SortedPackedIntervalRTree.h

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 
00016 #ifndef GEOS_INDEX_INTERVALRTREE_SORTEDPACKEDINTERVALRTREE_H
00017 #define GEOS_INDEX_INTERVALRTREE_SORTEDPACKEDINTERVALRTREE_H
00018 
00019 #include <geos/index/intervalrtree/IntervalRTreeNode.h>
00020 
00021 // forward declarations
00022 namespace geos {
00023         namespace index {
00024                 class ItemVisitor;
00025         }
00026 }
00027 
00028 namespace geos {
00029 namespace index {
00030 namespace intervalrtree {
00031 
00049 class SortedPackedIntervalRTree 
00050 {
00051 private:
00052         IntervalRTreeNode::ConstVect * leaves;
00053         const IntervalRTreeNode * root;
00054         int level;
00055 
00056         void init();
00057         void buildLevel( IntervalRTreeNode::ConstVect * src, IntervalRTreeNode::ConstVect * dest);
00058         const IntervalRTreeNode * buildTree();
00059 
00060 protected:
00061 public:
00062         SortedPackedIntervalRTree();
00063         
00064         ~SortedPackedIntervalRTree();
00065 
00075         void insert( double min, double max, void * item);
00076  
00085         void query( double min, double max, index::ItemVisitor * visitor);
00086 
00087 };
00088 
00089 } // geos::intervalrtree
00090 } // geos::index
00091 } // geos
00092 
00093 #endif // GEOS_INDEX_INTERVALRTREE_SORTEDPACKEDINTERVALRTREE_H
00094 

Generated on 15 May 2014 for GEOS by  doxygen 1.4.7