18#include <geos/operation/relateng/NodeSections.h>
19#include <geos/geom/Coordinate.h>
20#include <geos/geom/Location.h>
21#include <geos/export.h>
30 class TopologyPredicate;
40class GEOS_DLL TopologyComputer {
41 using CoordinateXY = geos::geom::CoordinateXY;
44 using NodeSections = geos::operation::relateng::NodeSections;
45 using RelateGeometry = geos::operation::relateng::RelateGeometry;
46 using RelateNode = geos::operation::relateng::RelateNode;
47 using TopologyPredicate = geos::operation::relateng::TopologyPredicate;
52 TopologyPredicate& predicate;
53 RelateGeometry& geomA;
54 RelateGeometry& geomB;
55 std::map<CoordinateXY, NodeSections*> nodeMap;
56 std::deque<std::unique_ptr<NodeSections>> nodeSectionsStore;
63 void initExteriorDims();
65 void initExteriorEmpty(
bool geomNonEmpty);
67 inline RelateGeometry& getGeometry(
bool isA)
const {
68 return isA ? geomA : geomB;
71 void updateDim(Location locA, Location locB,
int dimension);
73 void updateDim(
bool isAB, Location loc1, Location loc2,
int dimension);
81 void updateIntersectionAB(
const NodeSection* a,
const NodeSection* b);
94 void updateAreaAreaCross(
const NodeSection* a,
const NodeSection* b);
102 void updateNodeLocation(
const NodeSection* a,
const NodeSection* b);
104 void addNodeSections(NodeSection* ns0, NodeSection* ns1);
106 void addLineEndOnLine(
bool isLineA, Location locLineEnd, Location locLine,
const CoordinateXY* pt);
108 void addLineEndOnArea(
bool isLineA, Location locLineEnd, Location locArea,
const CoordinateXY* pt);
121 void addAreaVertexOnPoint(
bool isAreaA, Location locArea,
const CoordinateXY* pt);
123 void addAreaVertexOnLine(
bool isAreaA, Location locArea, Location locTarget,
const CoordinateXY* pt);
125 void evaluateNode(NodeSections* nodeSections);
127 void evaluateNodeEdges(
const RelateNode* node);
129 NodeSections* getNodeSections(
const CoordinateXY& nodePt);
136 TopologyPredicate& p_predicate,
137 RelateGeometry& p_geomA,
138 RelateGeometry& p_geomB)
139 : predicate(p_predicate)
146 int getDimension(
bool isA)
const;
148 bool isAreaArea()
const;
163 bool isSelfNodingRequired()
const;
165 bool isExteriorCheckRequired(
bool isA)
const;
167 bool isResultKnown()
const;
169 bool getResult()
const;
176 void addIntersection(NodeSection* a, NodeSection* b);
178 void addPointOnPointInterior(
const CoordinateXY* pt);
180 void addPointOnPointExterior(
bool isGeomA,
const CoordinateXY* pt);
182 void addPointOnGeometry(
bool isA, Location locTarget,
int dimTarget,
const CoordinateXY* pt);
196 void addLineEndOnGeometry(
bool isLineA, Location locLineEnd, Location locTarget,
int dimTarget,
const CoordinateXY* pt);
214 void addAreaVertex(
bool isAreaA, Location locArea, Location locTarget,
int dimTarget,
const CoordinateXY* pt);
216 void addAreaVertexOnArea(
bool isAreaA, Location locArea, Location locTarget,
const CoordinateXY* pt);
218 void evaluateNodes();
224 TopologyComputer(
const TopologyComputer&) =
delete;
225 TopologyComputer& operator=(
const TopologyComputer&) =
delete;
Definition NodeSection.h:50
Location
Constants representing the location of a point relative to a geometry.
Definition Location.h:32
Basic namespace for all GEOS functionalities.
Definition geos.h:39