GEOS 3.11.0
RelateComputer.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2011 Sandro Santilli <strk@kbt.io>
7 * Copyright (C) 2006 Refractions Research Inc.
8 * Copyright (C) 2001-2002 Vivid Solutions Inc.
9 *
10 * This is free software; you can redistribute and/or modify it under
11 * the terms of the GNU Lesser General Public Licence as published
12 * by the Free Software Foundation.
13 * See the COPYING file for more information.
14 *
15 **********************************************************************
16 *
17 * Last port: operation/relate/RelateComputer.java rev. 1.24 (JTS-1.10)
18 *
19 **********************************************************************/
20
21#pragma once
22
23#include <geos/export.h>
24
25#include <geos/algorithm/PointLocator.h> // for RelateComputer composition
26#include <geos/algorithm/LineIntersector.h> // for RelateComputer composition
27#include <geos/geomgraph/NodeMap.h> // for RelateComputer composition
28#include <geos/geom/Coordinate.h> // for RelateComputer composition
29#include <geos/geom/IntersectionMatrix.h>
30
31#include <vector>
32#include <memory>
33
34#ifdef _MSC_VER
35#pragma warning(push)
36#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
37#endif
38
39// Forward declarations
40namespace geos {
41namespace geom {
42class Geometry;
43}
44namespace geomgraph {
45class GeometryGraph;
46class Edge;
47class EdgeEnd;
48class Node;
49namespace index {
50class SegmentIntersector;
51}
52}
53}
54
55
56namespace geos {
57namespace operation { // geos::operation
58namespace relate { // geos::operation::relate
59
74class GEOS_DLL RelateComputer {
75public:
76 RelateComputer(std::vector<geomgraph::GeometryGraph*>* newArg);
77 ~RelateComputer() = default;
78
79 std::unique_ptr<geom::IntersectionMatrix> computeIM();
80private:
81
83
85
87 std::vector<geomgraph::GeometryGraph*>* arg;
88
89 geomgraph::NodeMap nodes;
90
92 std::unique_ptr<geom::IntersectionMatrix> im;
93
94 std::vector<geomgraph::Edge*> isolatedEdges;
95
97 geom::Coordinate invalidPoint;
98
99 void insertEdgeEnds(std::vector<geomgraph::EdgeEnd*>* ee);
100
101 void computeProperIntersectionIM(
104
105 void copyNodesAndLabels(uint8_t argIndex);
106 void computeIntersectionNodes(uint8_t argIndex);
107 void labelIntersectionNodes(uint8_t argIndex);
108
113 void computeDisjointIM(geom::IntersectionMatrix* imX);
114
115 void labelNodeEdges();
116
120 void updateIM(geom::IntersectionMatrix& imX);
121
130 void labelIsolatedEdges(uint8_t thisIndex, uint8_t targetIndex);
131
139 void labelIsolatedEdge(geomgraph::Edge* e, uint8_t targetIndex,
140 const geom::Geometry* target);
141
151 void labelIsolatedNodes();
152
156 void labelIsolatedNode(geomgraph::Node* n, uint8_t targetIndex);
157};
158
159
160} // namespace geos:operation:relate
161} // namespace geos:operation
162} // namespace geos
163
164#ifdef _MSC_VER
165#pragma warning(pop)
166#endif
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:50
Computes the topological relationship (Location) of a single point to a Geometry.
Definition: PointLocator.h:56
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Implementation of Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix.
Definition: IntersectionMatrix.h:51
Definition: geomgraph/Edge.h:63
The node component of a geometry graph.
Definition: geomgraph/Node.h:59
Computes the intersection of line segments, and adds the intersection to the edges containing the seg...
Definition: geomgraph/index/SegmentIntersector.h:46
Computes the topological relationship between two Geometries.
Definition: RelateComputer.h:74
Basic namespace for all GEOS functionalities.
Definition: geos.h:39