22 #ifndef GEOS_GEOMGRAPH_EDGERING_H
23 #define GEOS_GEOMGRAPH_EDGERING_H
25 #include <geos/export.h>
26 #include <geos/geomgraph/Label.h>
27 #include <geos/geom/CoordinateArraySequence.h>
28 #include <geos/geom/LinearRing.h>
30 #include <geos/inline.h>
39 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
45 class GeometryFactory;
60 class GEOS_DLL EdgeRing {
63 friend std::ostream& operator<< (std::ostream& os,
const EdgeRing& er);
65 EdgeRing(DirectedEdge* newStart,
66 const geom::GeometryFactory* newGeometryFactory);
68 virtual ~EdgeRing() =
default;
79 geom::LinearRing* getLinearRing();
87 void setShell(EdgeRing* newShell);
89 void addHole(EdgeRing* edgeRing);
95 std::unique_ptr<geom::Polygon> toPolygon(
const geom::GeometryFactory* geometryFactory);
104 virtual DirectedEdge* getNext(DirectedEdge* de) = 0;
106 virtual void setEdgeRing(DirectedEdge* de, EdgeRing* er) = 0;
111 std::vector<DirectedEdge*>& getEdges();
113 int getMaxNodeDegree();
121 bool containsPoint(
const geom::Coordinate& p);
124 testInvariant()
const
134 for(
const auto& hole : holes) {
136 assert(hole->getShell() ==
this);
139 #endif // ndef NDEBUG
144 DirectedEdge* startDe;
146 const geom::GeometryFactory* geometryFactory;
149 void computePoints(DirectedEdge* newStart);
151 void mergeLabel(
const Label& deLabel);
165 void mergeLabel(
const Label& deLabel,
int geomIndex);
167 void addPoints(Edge* edge,
bool isForward,
bool isFirstEdge);
170 std::vector<std::unique_ptr<EdgeRing>> holes;
177 std::vector<DirectedEdge*> edges;
179 std::unique_ptr<geom::CoordinateArraySequence> pts;
185 std::unique_ptr<geom::LinearRing> ring;
192 void computeMaxNodeDegree();
196 std::ostream& operator<< (std::ostream& os,
const EdgeRing& er);
205 #endif // ifndef GEOS_GEOMGRAPH_EDGERING_H