00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_OP_SWEEPLINENESTEDRINGTESTER_H
00022 #define GEOS_OP_SWEEPLINENESTEDRINGTESTER_H
00023
00024 #include <geos/export.h>
00025 #include <vector>
00026
00027 #include <geos/geom/Envelope.h>
00028
00029 #include <geos/index/sweepline/SweepLineOverlapAction.h>
00030 #include <geos/index/sweepline/SweepLineIndex.h>
00031
00032
00033 namespace geos {
00034 namespace geom {
00035 class LinearRing;
00036 class Envelope;
00037 class Coordinate;
00038 }
00039 namespace index {
00040 namespace sweepline {
00041 class SweepLineIndex;
00042 }
00043 }
00044 namespace geomgraph {
00045 class GeometryGraph;
00046 }
00047 }
00048
00049 namespace geos {
00050 namespace operation {
00051 namespace valid {
00052
00058 class GEOS_DLL SweeplineNestedRingTester {
00059
00060 private:
00061 geomgraph::GeometryGraph *graph;
00062 std::vector<geom::LinearRing*> rings;
00063 index::sweepline::SweepLineIndex *sweepLine;
00064 geom::Coordinate *nestedPt;
00065 void buildIndex();
00066
00067 public:
00068
00069 SweeplineNestedRingTester(geomgraph::GeometryGraph *newGraph)
00070 :
00071 graph(newGraph),
00072 rings(),
00073 sweepLine(new index::sweepline::SweepLineIndex()),
00074 nestedPt(NULL)
00075 {}
00076
00077 ~SweeplineNestedRingTester()
00078 {
00079 delete sweepLine;
00080 }
00081
00082
00083
00084
00085
00086
00087
00088 geom::Coordinate *getNestedPoint() { return nestedPt; }
00089
00090 void add(geom::LinearRing* ring) {
00091 rings.push_back(ring);
00092 }
00093
00094 bool isNonNested();
00095 bool isInside(geom::LinearRing *innerRing, geom::LinearRing *searchRing);
00096 class OverlapAction: public index::sweepline::SweepLineOverlapAction {
00097 public:
00098 bool isNonNested;
00099 OverlapAction(SweeplineNestedRingTester *p);
00100 void overlap(index::sweepline::SweepLineInterval *s0,
00101 index::sweepline::SweepLineInterval *s1);
00102 private:
00103 SweeplineNestedRingTester *parent;
00104 };
00105 };
00106
00107
00108 }
00109 }
00110 }
00111
00112 #endif // GEOS_OP_SWEEPLINENESTEDRINGTESTER_H
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123