20 #ifndef GEOS_OP_POLYGONIZE_POLYGONIZEGRAPH_H
21 #define GEOS_OP_POLYGONIZE_POLYGONIZEGRAPH_H
23 #include <geos/export.h>
25 #include <geos/planargraph/PlanarGraph.h>
31 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
38 class GeometryFactory;
40 class CoordinateSequence;
42 namespace planargraph {
48 namespace polygonize {
50 class PolygonizeDirectedEdge;
57 namespace polygonize {
69 class GEOS_DLL PolygonizeGraph:
public planargraph::PlanarGraph {
77 static void deleteAllEdges(planargraph::Node* node);
83 explicit PolygonizeGraph(
const geom::GeometryFactory* newFactory);
89 ~PolygonizeGraph()
override;
96 void addEdge(
const geom::LineString* line);
106 void getEdgeRings(std::vector<EdgeRing*>& edgeRingList);
117 void deleteCutEdges(std::vector<const geom::LineString*>& cutLines);
131 void deleteDangles(std::vector<const geom::LineString*>& dangleLines);
135 static int getDegreeNonDeleted(planargraph::Node* node);
137 static int getDegree(planargraph::Node* node,
long label);
139 const geom::GeometryFactory* factory;
141 planargraph::Node* getNode(
const geom::Coordinate& pt);
143 void computeNextCWEdges();
154 void convertMaximalToMinimalEdgeRings(
155 std::vector<PolygonizeDirectedEdge*>& ringEdges);
167 static void findIntersectionNodes(PolygonizeDirectedEdge* startDE,
168 long label, std::vector<planargraph::Node*>& intNodes
180 static void findLabeledEdgeRings(
181 std::vector<planargraph::DirectedEdge*>& dirEdgesIn,
182 std::vector<PolygonizeDirectedEdge*>& dirEdgesOut);
184 static void label(std::vector<PolygonizeDirectedEdge*>& dirEdges,
long label);
185 static void label(std::vector<planargraph::DirectedEdge*>& dirEdges,
long label);
187 static void computeNextCWEdges(planargraph::Node* node);
196 static void computeNextCCWEdges(planargraph::Node* node,
long label);
198 EdgeRing* findEdgeRing(PolygonizeDirectedEdge* startDE);
201 std::vector<planargraph::Edge*> newEdges;
202 std::vector<planargraph::DirectedEdge*> newDirEdges;
203 std::vector<planargraph::Node*> newNodes;
204 std::vector<EdgeRing*> newEdgeRings;
205 std::vector<geom::CoordinateSequence*> newCoords;
216 #endif // GEOS_OP_POLYGONIZE_POLYGONIZEGRAPH_H