00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GEOS_OP_CONNECTEDINTERIORTESTER_H
00018 #define GEOS_OP_CONNECTEDINTERIORTESTER_H
00019
00020 #include <geos/geom/Coordinate.h>
00021
00022 #include <vector>
00023
00024
00025 namespace geos {
00026 namespace geom {
00027
00028 class Geometry;
00029 class CoordinateSequence;
00030 class GeometryFactory;
00031 class LineString;
00032 }
00033 namespace geomgraph {
00034 class GeometryGraph;
00035 class PlanarGraph;
00036 class EdgeRing;
00037 class DirectedEdge;
00038 class EdgeEnd;
00039 }
00040 }
00041
00042 namespace geos {
00043 namespace operation {
00044 namespace valid {
00045
00060 class ConnectedInteriorTester {
00061 public:
00062 ConnectedInteriorTester(geomgraph::GeometryGraph &newGeomGraph);
00063 ~ConnectedInteriorTester();
00064 geom::Coordinate& getCoordinate();
00065 bool isInteriorsConnected();
00066 static const geom::Coordinate& findDifferentPoint(
00067 const geom::CoordinateSequence *coord,
00068 const geom::Coordinate& pt);
00069
00070 private:
00071
00072 geom::GeometryFactory *geometryFactory;
00073
00074 geomgraph::GeometryGraph &geomGraph;
00075
00079 geom::Coordinate disconnectedRingcoord;
00080
00082 std::vector<geomgraph::EdgeRing*> maximalEdgeRings;
00083
00084 void setInteriorEdgesInResult(geomgraph::PlanarGraph &graph);
00085
00086
00095 std::vector<geomgraph::EdgeRing*>* buildEdgeRings(
00096 std::vector<geomgraph::EdgeEnd*> *dirEdges);
00097
00102 void visitShellInteriors(const geom::Geometry *g, geomgraph::PlanarGraph &graph);
00103
00104 void visitInteriorRing(const geom::LineString *ring, geomgraph::PlanarGraph &graph);
00105
00116 bool hasUnvisitedShellEdge(std::vector<geomgraph::EdgeRing*> *edgeRings);
00117
00118 protected:
00119
00120 void visitLinkedDirectedEdges(geomgraph::DirectedEdge *start);
00121 };
00122
00123
00124 }
00125 }
00126 }
00127
00128 #endif // GEOS_OP_CONNECTEDINTERIORTESTER_H
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142