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
00030 namespace geos {
00031 namespace geom {
00032 class LineString;
00033 class LinearRing;
00034 class Polygon;
00035 class CoordinateSequence;
00036 class Geometry;
00037 class GeometryFactory;
00038 class Coordinate;
00039 }
00040 namespace planargraph {
00041 class DirectedEdge;
00042 }
00043 }
00044
00045 namespace geos {
00046 namespace operation {
00047 namespace polygonize {
00048
00053 class GEOS_DLL EdgeRing {
00054 private:
00055 const geom::GeometryFactory *factory;
00056 std::vector<const planargraph::DirectedEdge*> *deList;
00057
00058
00059 geom::LinearRing *ring;
00060 geom::CoordinateSequence *ringPts;
00061 std::vector<geom::Geometry*> *holes;
00062
00069 geom::CoordinateSequence* getCoordinates();
00070
00071 static void addEdge(const geom::CoordinateSequence *coords,
00072 bool isForward,
00073 geom::CoordinateSequence *coordList);
00074
00075 public:
00092 static EdgeRing* findEdgeRingContaining(
00093 EdgeRing *testEr,
00094 std::vector<EdgeRing*> *shellList);
00095
00106 static const geom::Coordinate& ptNotInList(
00107 const geom::CoordinateSequence *testPts,
00108 const geom::CoordinateSequence *pts);
00109
00118 static bool isInList(const geom::Coordinate &pt,
00119 const geom::CoordinateSequence *pts);
00120
00121 EdgeRing(const geom::GeometryFactory *newFactory);
00122
00123 ~EdgeRing();
00124
00130 void add(const planargraph::DirectedEdge *de);
00131
00139 bool isHole();
00140
00146 void addHole(geom::LinearRing *hole);
00147
00156 geom::Polygon* getPolygon();
00157
00162 bool isValid();
00163
00172 geom::LineString* getLineString();
00173
00181 geom::LinearRing* getRingInternal();
00182
00190 geom::LinearRing* getRingOwnership();
00191 };
00192
00193 }
00194 }
00195 }
00196
00197 #endif // GEOS_OP_POLYGONIZE_EDGERING_H
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208