17#include <geos/export.h>
19#include <geos/geom/Polygon.h>
20#include <geos/operation/overlayng/OverlayEdge.h>
21#include <geos/operation/overlayng/OverlayEdgeRing.h>
22#include <geos/operation/overlayng/MaximalEdgeRing.h>
45class GEOS_DLL PolygonBuilder {
50 const geom::GeometryFactory* geometryFactory;
51 std::vector<OverlayEdgeRing*> shellList;
52 std::vector<OverlayEdgeRing*> freeHoleList;
53 bool isEnforcePolygonal;
56 std::vector<std::unique_ptr<OverlayEdgeRing>> vecOER;
58 std::vector<std::unique_ptr<geom::Polygon>> computePolygons(
const std::vector<OverlayEdgeRing*>& shellList)
const;
60 void buildRings(
const std::vector<OverlayEdge*>& resultAreaEdges);
62 static void linkResultAreaEdgesMax(
const std::vector<OverlayEdge*>& resultEdges);
67 static std::vector<std::unique_ptr<MaximalEdgeRing>>
68 buildMaximalRings(
const std::vector<OverlayEdge *> &edges);
75 std::vector<OverlayEdgeRing*> storeMinimalRings(std::vector<std::unique_ptr<OverlayEdgeRing>>& minRings);
77 void buildMinimalRings(
const std::vector<std::unique_ptr<MaximalEdgeRing>>& maxRings);
79 void assignShellsAndHoles(
const std::vector<OverlayEdgeRing *> &minRings);
90 static OverlayEdgeRing* findSingleShell(
const std::vector<OverlayEdgeRing *> &edgeRings) ;
102 static void assignHoles(OverlayEdgeRing* shell,
const std::vector<OverlayEdgeRing *> &edgeRings);
117 void placeFreeHoles(
const std::vector<OverlayEdgeRing*> & shellList,
const std::vector<OverlayEdgeRing*>& freeHoleList)
const;
123 PolygonBuilder(std::vector<OverlayEdge*>& resultAreaEdges,
const geom::GeometryFactory* geomFact)
124 : geometryFactory(geomFact)
125 , isEnforcePolygonal(true)
127 buildRings(resultAreaEdges);
130 PolygonBuilder(std::vector<OverlayEdge*>& resultAreaEdges,
const geom::GeometryFactory* geomFact,
bool p_isEnforcePolygonal)
131 : geometryFactory(geomFact)
132 , isEnforcePolygonal(p_isEnforcePolygonal)
134 buildRings(resultAreaEdges);
137 PolygonBuilder(
const PolygonBuilder&) =
delete;
138 PolygonBuilder& operator=(
const PolygonBuilder&) =
delete;
141 std::vector<std::unique_ptr<geom::Polygon>> getPolygons()
const;
142 std::vector<OverlayEdgeRing*> getShellRings()
const;
Basic namespace for all GEOS functionalities.
Definition geos.h:39