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;
36using geos::geom::CoordinateXY;
39using geos::operation::relateng::NodeSections;
40using geos::operation::relateng::RelateGeometry;
41using geos::operation::relateng::RelateNode;
42using geos::operation::relateng::TopologyPredicate;
50class GEOS_DLL TopologyComputer {
55 TopologyPredicate& predicate;
56 RelateGeometry& geomA;
57 RelateGeometry& geomB;
58 std::map<CoordinateXY, NodeSections*> nodeMap;
59 std::deque<std::unique_ptr<NodeSections>> nodeSectionsStore;
66 void initExteriorDims();
68 void initExteriorEmpty(
bool geomNonEmpty);
70 inline RelateGeometry& getGeometry(
bool isA)
const {
71 return isA ? geomA : geomB;
74 void updateDim(Location locA, Location locB,
int dimension);
76 void updateDim(
bool isAB, Location loc1, Location loc2,
int dimension);
109 void addLineEndOnPoint(
bool isLineA, Location locLineEnd, Location locPoint,
const CoordinateXY* pt);
111 void addLineEndOnLine(
bool isLineA, Location locLineEnd, Location locLine,
const CoordinateXY* pt);
113 void addLineEndOnArea(
bool isLineA, Location locLineEnd, Location locArea,
const CoordinateXY* pt);
126 void addAreaVertexOnPoint(
bool isAreaA, Location locArea,
const CoordinateXY* pt);
128 void addAreaVertexOnLine(
bool isAreaA, Location locArea, Location locTarget,
const CoordinateXY* pt);
130 void evaluateNode(NodeSections* nodeSections);
132 void evaluateNodeEdges(
const RelateNode* node);
134 NodeSections* getNodeSections(
const CoordinateXY& nodePt);
141 TopologyPredicate& p_predicate,
142 RelateGeometry& p_geomA,
143 RelateGeometry& p_geomB)
144 : predicate(p_predicate)
151 int getDimension(
bool isA)
const;
153 bool isAreaArea()
const;
170 bool isSelfNodingRequired()
const;
172 bool isExteriorCheckRequired(
bool isA)
const;
174 bool isResultKnown()
const;
176 bool getResult()
const;
185 void addPointOnPointInterior(
const CoordinateXY* pt);
187 void addPointOnPointExterior(
bool isGeomA,
const CoordinateXY* pt);
189 void addPointOnGeometry(
bool isA, Location locTarget,
int dimTarget,
const CoordinateXY* pt);
191 void addLineEndOnGeometry(
bool isLineA, Location locLineEnd, Location locTarget,
int dimTarget,
const CoordinateXY* pt);
209 void addAreaVertex(
bool isAreaA, Location locArea, Location locTarget,
int dimTarget,
const CoordinateXY* pt);
211 void addAreaVertexOnArea(
bool isAreaA, Location locArea, Location locTarget,
const CoordinateXY* pt);
213 void evaluateNodes();
219 TopologyComputer(
const TopologyComputer&) =
delete;
220 TopologyComputer& operator=(
const TopologyComputer&) =
delete;
Definition NodeSection.h:55
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