00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GEOS_OP_CONNECTEDINTERIORTESTER_H
00022 #define GEOS_OP_CONNECTEDINTERIORTESTER_H
00023
00024 #include <geos/export.h>
00025
00026 #include <geos/geom/Coordinate.h>
00027
00028 #include <vector>
00029
00030
00031 namespace geos {
00032 namespace geom {
00033
00034 class Geometry;
00035 class CoordinateSequence;
00036 class GeometryFactory;
00037 class LineString;
00038 }
00039 namespace geomgraph {
00040 class GeometryGraph;
00041 class PlanarGraph;
00042 class EdgeRing;
00043 class DirectedEdge;
00044 class EdgeEnd;
00045 }
00046 }
00047
00048 namespace geos {
00049 namespace operation {
00050 namespace valid {
00051
00066 class GEOS_DLL ConnectedInteriorTester {
00067 public:
00068 ConnectedInteriorTester(geomgraph::GeometryGraph &newGeomGraph);
00069 ~ConnectedInteriorTester();
00070 geom::Coordinate& getCoordinate();
00071 bool isInteriorsConnected();
00072 static const geom::Coordinate& findDifferentPoint(
00073 const geom::CoordinateSequence *coord,
00074 const geom::Coordinate& pt);
00075
00076 protected:
00077
00078 void visitLinkedDirectedEdges(geomgraph::DirectedEdge *start);
00079
00080 private:
00081
00082 geom::GeometryFactory *geometryFactory;
00083
00084 geomgraph::GeometryGraph &geomGraph;
00085
00089 geom::Coordinate disconnectedRingcoord;
00090
00092 std::vector<geomgraph::EdgeRing*> maximalEdgeRings;
00093
00094 void setInteriorEdgesInResult(geomgraph::PlanarGraph &graph);
00095
00096
00108 void buildEdgeRings(std::vector<geomgraph::EdgeEnd*> *dirEdges,
00109 std::vector<geomgraph::EdgeRing*>& minEdgeRings);
00110
00115 void visitShellInteriors(const geom::Geometry *g, geomgraph::PlanarGraph &graph);
00116
00117 void visitInteriorRing(const geom::LineString *ring, geomgraph::PlanarGraph &graph);
00118
00129 bool hasUnvisitedShellEdge(std::vector<geomgraph::EdgeRing*> *edgeRings);
00130
00131
00132 ConnectedInteriorTester(const ConnectedInteriorTester& other);
00133 ConnectedInteriorTester& operator=(const ConnectedInteriorTester& rhs);
00134 };
00135
00136
00137 }
00138 }
00139 }
00140
00141 #endif // GEOS_OP_CONNECTEDINTERIORTESTER_H
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155