GEOS 3.9.1
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#ifndef GEOS_OP_RELATE_RELATECOMPUTER_H
22#define GEOS_OP_RELATE_RELATECOMPUTER_H
23
24#include <geos/export.h>
25
26#include <geos/algorithm/PointLocator.h> // for RelateComputer composition
27#include <geos/algorithm/LineIntersector.h> // for RelateComputer composition
28#include <geos/geomgraph/NodeMap.h> // for RelateComputer composition
29#include <geos/geom/Coordinate.h> // for RelateComputer composition
30#include <geos/geom/IntersectionMatrix.h>
31
32#include <vector>
33#include <memory>
34
35#ifdef _MSC_VER
36#pragma warning(push)
37#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
38#endif
39
40// Forward declarations
41namespace geos {
42namespace geom {
43class Geometry;
44}
45namespace geomgraph {
46class GeometryGraph;
47class Edge;
48class EdgeEnd;
49class Node;
50namespace index {
51class SegmentIntersector;
52}
53}
54}
55
56
57namespace geos {
58namespace operation { // geos::operation
59namespace relate { // geos::operation::relate
60
75class GEOS_DLL RelateComputer {
76public:
77 RelateComputer(std::vector<geomgraph::GeometryGraph*>* newArg);
78 ~RelateComputer() = default;
79
80 std::unique_ptr<geom::IntersectionMatrix> computeIM();
81private:
82
84
86
88 std::vector<geomgraph::GeometryGraph*>* arg;
89
90 geomgraph::NodeMap nodes;
91
93 std::unique_ptr<geom::IntersectionMatrix> im;
94
95 std::vector<geomgraph::Edge*> isolatedEdges;
96
98 geom::Coordinate invalidPoint;
99
100 void insertEdgeEnds(std::vector<geomgraph::EdgeEnd*>* ee);
101
102 void computeProperIntersectionIM(
105
106 void copyNodesAndLabels(int argIndex);
107 void computeIntersectionNodes(int argIndex);
108 void labelIntersectionNodes(int argIndex);
109
114 void computeDisjointIM(geom::IntersectionMatrix* imX);
115
116 void labelNodeEdges();
117
121 void updateIM(geom::IntersectionMatrix& imX);
122
131 void labelIsolatedEdges(int thisIndex, int targetIndex);
132
140 void labelIsolatedEdge(geomgraph::Edge* e, int targetIndex,
141 const geom::Geometry* target);
142
152 void labelIsolatedNodes();
153
157 void labelIsolatedNode(geomgraph::Node* n, int targetIndex);
158};
159
160
161} // namespace geos:operation:relate
162} // namespace geos:operation
163} // namespace geos
164
165#ifdef _MSC_VER
166#pragma warning(pop)
167#endif
168
169#endif // GEOS_OP_RELATE_RELATECOMPUTER_H
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:49
Computes the topological relationship (Location) of a single point to a Geometry.
Definition: PointLocator.h:57
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
Implementation of Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix.
Definition: IntersectionMatrix.h:54
Definition: geomgraph/Edge.h:66
The node component of a geometry graph.
Definition: geomgraph/Node.h:62
Computes the intersection of line segments, and adds the intersection to the edges containing the seg...
Definition: geomgraph/index/SegmentIntersector.h:47
Computes the topological relationship between two Geometries.
Definition: RelateComputer.h:75
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26