GEOS: Bintree.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

# Bintree.h

    00001 /**********************************************************************
    00002  * $Id: Bintree.h 3255 2011-03-01 17:56:10Z 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_BINTREE_H
    00017 #define GEOS_IDX_BINTREE_BINTREE_H
    00018
    00019 #include <geos/export.h>
    00020 #include <vector>
    00021
    00022 #ifdef _MSC_VER
    00023 #pragma warning(push)
    00024 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
    00025 #endif
    00026
    00027 // Forward declarations
    00028 namespace geos {
    00029         namespace index {
    00030                 namespace bintree {
    00031                         class Interval;
    00032                         class Root;
    00033                 }
    00034         }
    00035 }
    00036
    00037 namespace geos {
    00038 namespace index { // geos::index
    00039 namespace bintree { // geos::index::bintree
    00040
    00057 class GEOS_DLL Bintree {
    00058
    00059 public:
    00060
    00071         static Interval* ensureExtent(const Interval *itemInterval,
    00072                                                          double minExtent);
    00073
    00074         Bintree();
    00075
    00076         ~Bintree();
    00077
    00078         int depth();
    00079
    00080         int size();
    00081
    00082         int nodeSize();
    00083
    00090         void insert(Interval *itemInterval, void* item);
    00091
    00092         std::vector<void*>* iterator();
    00093
    00094         std::vector<void*>* query(double x);
    00095
    00096         std::vector<void*>* query(Interval *interval);
    00097
    00098         void query(Interval *interval,
    00099                         std::vector<void*> *foundItems);
    00100
    00101 private:
    00102
    00103         std::vector<Interval *>newIntervals;
    00104
    00105         Root *root;
    00106
    00117         double minExtent;
    00118
    00119         void collectStats(Interval *interval);
    00120 };
    00121
    00122 } // namespace geos::index::bintree
    00123 } // namespace geos::index
    00124 } // namespace geos
    00125
    00126 #ifdef _MSC_VER
    00127 #pragma warning(pop)
    00128 #endif
    00129
    00130 #endif // GEOS_IDX_BINTREE_BINTREE_H
    00131
    00132 /**********************************************************************
    00133  * $Log$
    00134  * Revision 1.1  2006/03/22 16:01:33  strk
    00135  * indexBintree.h header split, classes renamed to match JTS
    00136  *
    00137  **********************************************************************/
    00138