22 #ifndef GEOS_GEOMGRAPH_GEOMETRYGRAPH_H
23 #define GEOS_GEOMGRAPH_GEOMETRYGRAPH_H
25 #include <geos/export.h>
30 #include <geos/geom/Coordinate.h>
31 #include <geos/geom/CoordinateSequence.h>
32 #include <geos/geomgraph/PlanarGraph.h>
33 #include <geos/geomgraph/index/SegmentIntersector.h>
34 #include <geos/geom/LineString.h>
36 #include <geos/inline.h>
40 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
50 class GeometryCollection;
55 class LineIntersector;
56 class BoundaryNodeRule;
62 class EdgeSetIntersector;
73 class GEOS_DLL GeometryGraph:
public PlanarGraph {
74 using PlanarGraph::add;
79 const geom::Geometry* parentGeom;
90 std::map<const geom::LineString*, Edge*> lineEdgeMap;
96 bool useBoundaryDeterminationRule;
98 const algorithm::BoundaryNodeRule& boundaryNodeRule;
107 std::unique_ptr< geom::CoordinateSequence > boundaryPoints;
109 std::unique_ptr< std::vector<Node*> > boundaryNodes;
111 bool hasTooFewPointsVar;
113 geom::Coordinate invalidPoint;
116 index::EdgeSetIntersector* createEdgeSetIntersector();
118 void add(
const geom::Geometry* g);
121 void addCollection(
const geom::GeometryCollection* gc);
123 void addPoint(
const geom::Point* p);
125 void addPolygonRing(
const geom::LinearRing* lr,
128 void addPolygon(
const geom::Polygon* p);
130 void addLineString(
const geom::LineString* line);
132 void insertPoint(
int argIndex,
const geom::Coordinate& coord,
142 void insertBoundaryPoint(
int argIndex,
const geom::Coordinate& coord);
144 void addSelfIntersectionNodes(
int argIndex);
153 void addSelfIntersectionNode(
int argIndex,
157 GeometryGraph(
const GeometryGraph& other) =
delete;
158 GeometryGraph& operator=(
const GeometryGraph& rhs) =
delete;
162 static bool isInBoundary(
int boundaryCount);
167 const algorithm::BoundaryNodeRule& boundaryNodeRule,
172 GeometryGraph(
int newArgIndex,
const geom::Geometry* newParentGeom);
174 GeometryGraph(
int newArgIndex,
const geom::Geometry* newParentGeom,
175 const algorithm::BoundaryNodeRule& boundaryNodeRule);
177 ~GeometryGraph()
override;
180 const geom::Geometry* getGeometry();
183 std::vector<Node*>* getBoundaryNodes();
185 void getBoundaryNodes(std::vector<Node*>& bdyNodes);
188 geom::CoordinateSequence* getBoundaryPoints();
190 Edge* findEdge(
const geom::LineString* line);
192 void computeSplitEdges(std::vector<Edge*>* edgelist);
194 void addEdge(Edge* e);
196 void addPoint(geom::Coordinate& pt);
212 std::unique_ptr<index::SegmentIntersector>
215 bool computeRingSelfNodes,
218 return computeSelfNodes(*li, computeRingSelfNodes, env);
221 std::unique_ptr<index::SegmentIntersector>
224 bool computeRingSelfNodes,
225 bool isDoneIfProperInt,
228 return computeSelfNodes(*li, computeRingSelfNodes, isDoneIfProperInt, env);
233 std::unique_ptr<index::SegmentIntersector> computeSelfNodes(
237 std::unique_ptr<index::SegmentIntersector> computeSelfNodes(
239 bool computeRingSelfNodes,
bool isDoneIfProperInt,
const geom::Envelope* env =
nullptr);
241 std::unique_ptr<index::SegmentIntersector> computeEdgeIntersections(GeometryGraph* g,
245 std::vector<Edge*>* getEdges();
247 bool hasTooFewPoints();
252 getBoundaryNodeRule()
const
254 return boundaryNodeRule;
268 # include "geos/geomgraph/GeometryGraph.inl"
271 #endif // ifndef GEOS_GEOMGRAPH_GEOMETRYGRAPH_H