00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GEOS_INDEX_STRTREE_SIRTREE_H
00017 #define GEOS_INDEX_STRTREE_SIRTREE_H
00018
00019 #include <geos/export.h>
00020
00021 #include <geos/index/strtree/AbstractSTRtree.h>
00022 #include <geos/index/strtree/Interval.h>
00023
00024 #include <vector>
00025 #include <memory>
00026
00027 namespace geos {
00028 namespace index {
00029 namespace strtree {
00030
00042 class GEOS_DLL SIRtree: public AbstractSTRtree {
00043 using AbstractSTRtree::insert;
00044 using AbstractSTRtree::query;
00045
00046 public:
00047
00051 SIRtree();
00052
00057 SIRtree(size_t nodeCapacity);
00058
00059 virtual ~SIRtree();
00060
00061 void insert(double x1, double x2, void* item);
00062
00067 std::vector<void*>* query(double x1, double x2)
00068 {
00069 std::vector<void*>* results = new std::vector<void*>();
00070 Interval interval(std::min(x1, x2), std::max(x1, x2));
00071 AbstractSTRtree::query(&interval, *results);
00072 return results;
00073 }
00074
00078 std::vector<void*>* query(double x) { return query(x,x); }
00079
00080
00081 protected:
00082
00083 class SIRIntersectsOp:public AbstractSTRtree::IntersectsOp {
00084 public:
00085 bool intersects(const void* aBounds, const void* bBounds);
00086 };
00087
00092 std::auto_ptr<BoundableList> createParentBoundables(
00093 BoundableList* childBoundables, int newLevel);
00094
00095 AbstractNode* createNode(int level);
00096
00097 IntersectsOp* getIntersectsOp() {return intersectsOp;};
00098
00099 std::auto_ptr<BoundableList> sortBoundables(const BoundableList* input);
00100
00101 private:
00102
00103 IntersectsOp* intersectsOp;
00104 };
00105
00106
00107 }
00108 }
00109 }
00110
00111 #endif // GEOS_INDEX_STRTREE_SIRTREE_H
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122