00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_OP_CONNECTEDINTERIORTESTER_H
00021 #define GEOS_OP_CONNECTEDINTERIORTESTER_H
00022
00023 #include <geos/export.h>
00024
00025 #include <geos/geom/Coordinate.h>
00026
00027 #include <vector>
00028
00029 #ifdef _MSC_VER
00030 #pragma warning(push)
00031 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00032 #endif
00033
00034
00035 namespace geos {
00036 namespace geom {
00037
00038 class Geometry;
00039 class CoordinateSequence;
00040 class GeometryFactory;
00041 class LineString;
00042 }
00043 namespace geomgraph {
00044 class GeometryGraph;
00045 class PlanarGraph;
00046 class EdgeRing;
00047 class DirectedEdge;
00048 class EdgeEnd;
00049 }
00050 }
00051
00052 namespace geos {
00053 namespace operation {
00054 namespace valid {
00055
00070 class GEOS_DLL ConnectedInteriorTester {
00071 public:
00072 ConnectedInteriorTester(geomgraph::GeometryGraph &newGeomGraph);
00073 ~ConnectedInteriorTester();
00074 geom::Coordinate& getCoordinate();
00075 bool isInteriorsConnected();
00076 static const geom::Coordinate& findDifferentPoint(
00077 const geom::CoordinateSequence *coord,
00078 const geom::Coordinate& pt);
00079
00080 protected:
00081
00082 void visitLinkedDirectedEdges(geomgraph::DirectedEdge *start);
00083
00084 private:
00085
00086 geom::GeometryFactory *geometryFactory;
00087
00088 geomgraph::GeometryGraph &geomGraph;
00089
00093 geom::Coordinate disconnectedRingcoord;
00094
00096 std::vector<geomgraph::EdgeRing*> maximalEdgeRings;
00097
00098 void setInteriorEdgesInResult(geomgraph::PlanarGraph &graph);
00099
00100
00112 void buildEdgeRings(std::vector<geomgraph::EdgeEnd*> *dirEdges,
00113 std::vector<geomgraph::EdgeRing*>& minEdgeRings);
00114
00119 void visitShellInteriors(const geom::Geometry *g, geomgraph::PlanarGraph &graph);
00120
00121 void visitInteriorRing(const geom::LineString *ring, geomgraph::PlanarGraph &graph);
00122
00133 bool hasUnvisitedShellEdge(std::vector<geomgraph::EdgeRing*> *edgeRings);
00134
00135
00136 ConnectedInteriorTester(const ConnectedInteriorTester& other);
00137 ConnectedInteriorTester& operator=(const ConnectedInteriorTester& rhs);
00138 };
00139
00140 }
00141 }
00142 }
00143
00144 #ifdef _MSC_VER
00145 #pragma warning(pop)
00146 #endif
00147
00148 #endif // GEOS_OP_CONNECTEDINTERIORTESTER_H