00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GEOS_OP_POLYGONIZE_EDGERING_H
00023 #define GEOS_OP_POLYGONIZE_EDGERING_H
00024
00025 #include <geos/export.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 class LineString;
00038 class LinearRing;
00039 class Polygon;
00040 class CoordinateSequence;
00041 class Geometry;
00042 class GeometryFactory;
00043 class Coordinate;
00044 }
00045 namespace planargraph {
00046 class DirectedEdge;
00047 }
00048 }
00049
00050 namespace geos {
00051 namespace operation {
00052 namespace polygonize {
00053
00058 class GEOS_DLL EdgeRing {
00059 private:
00060 const geom::GeometryFactory *factory;
00061
00062 typedef std::vector<const planargraph::DirectedEdge*> DeList;
00063 DeList deList;
00064
00065
00066 geom::LinearRing *ring;
00067 geom::CoordinateSequence *ringPts;
00068
00069 typedef std::vector<geom::Geometry*> GeomVect;
00070 GeomVect *holes;
00071
00078 geom::CoordinateSequence* getCoordinates();
00079
00080 static void addEdge(const geom::CoordinateSequence *coords,
00081 bool isForward,
00082 geom::CoordinateSequence *coordList);
00083
00084 public:
00103 static EdgeRing* findEdgeRingContaining(
00104 EdgeRing *testEr,
00105 std::vector<EdgeRing*> *shellList);
00106
00117 static const geom::Coordinate& ptNotInList(
00118 const geom::CoordinateSequence *testPts,
00119 const geom::CoordinateSequence *pts);
00120
00129 static bool isInList(const geom::Coordinate &pt,
00130 const geom::CoordinateSequence *pts);
00131
00132 EdgeRing(const geom::GeometryFactory *newFactory);
00133
00134 ~EdgeRing();
00135
00141 void add(const planargraph::DirectedEdge *de);
00142
00150 bool isHole();
00151
00157 void addHole(geom::LinearRing *hole);
00158
00167 geom::Polygon* getPolygon();
00168
00173 bool isValid();
00174
00183 geom::LineString* getLineString();
00184
00192 geom::LinearRing* getRingInternal();
00193
00201 geom::LinearRing* getRingOwnership();
00202 };
00203
00204 }
00205 }
00206 }
00207
00208 #ifdef _MSC_VER
00209 #pragma warning(pop)
00210 #endif
00211
00212 #endif // GEOS_OP_POLYGONIZE_EDGERING_H
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223