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 <geos/geom/Envelope.h>
00026
00027 #include <geos/index/sweepline/SweepLineOverlapAction.h>
00028 #include <geos/index/sweepline/SweepLineIndex.h>
00029
00030 #include <vector>
00031
00032 #ifdef _MSC_VER
00033 #pragma warning(push)
00034 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00035 #endif
00036
00037
00038 namespace geos {
00039 namespace geom {
00040 class LinearRing;
00041 class Envelope;
00042 class Coordinate;
00043 }
00044 namespace index {
00045 namespace sweepline {
00046 class SweepLineIndex;
00047 }
00048 }
00049 namespace geomgraph {
00050 class GeometryGraph;
00051 }
00052 }
00053
00054 namespace geos {
00055 namespace operation {
00056 namespace valid {
00057
00063 class GEOS_DLL SweeplineNestedRingTester {
00064
00065 private:
00066 geomgraph::GeometryGraph *graph;
00067 std::vector<geom::LinearRing*> rings;
00068 index::sweepline::SweepLineIndex *sweepLine;
00069 geom::Coordinate *nestedPt;
00070 void buildIndex();
00071
00072 public:
00073
00074 SweeplineNestedRingTester(geomgraph::GeometryGraph *newGraph)
00075 :
00076 graph(newGraph),
00077 rings(),
00078 sweepLine(new index::sweepline::SweepLineIndex()),
00079 nestedPt(NULL)
00080 {}
00081
00082 ~SweeplineNestedRingTester()
00083 {
00084 delete sweepLine;
00085 }
00086
00087
00088
00089
00090
00091
00092
00093 geom::Coordinate *getNestedPoint() { return nestedPt; }
00094
00095 void add(geom::LinearRing* ring) {
00096 rings.push_back(ring);
00097 }
00098
00099 bool isNonNested();
00100 bool isInside(geom::LinearRing *innerRing, geom::LinearRing *searchRing);
00101 class OverlapAction: public index::sweepline::SweepLineOverlapAction {
00102 public:
00103 bool isNonNested;
00104 OverlapAction(SweeplineNestedRingTester *p);
00105 void overlap(index::sweepline::SweepLineInterval *s0,
00106 index::sweepline::SweepLineInterval *s1);
00107 private:
00108 SweeplineNestedRingTester *parent;
00109 };
00110 };
00111
00112 }
00113 }
00114 }
00115
00116 #ifdef _MSC_VER
00117 #pragma warning(pop)
00118 #endif
00119
00120 #endif // GEOS_OP_SWEEPLINENESTEDRINGTESTER_H
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131