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