GEOS 3.9.1
ConnectedInteriorTester.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2005-2006 Refractions Research Inc.
7 * Copyright (C) 2001-2002 Vivid Solutions Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************
15 *
16 * Last port: operation/valid/ConnectedInteriorTester.java rev. 1.15 (JTS-1.10)
17 *
18 **********************************************************************/
19
20#ifndef GEOS_OP_CONNECTEDINTERIORTESTER_H
21#define GEOS_OP_CONNECTEDINTERIORTESTER_H
22
23#include <geos/export.h>
24
25#include <geos/geom/Coordinate.h> // for composition
26#include <geos/geom/GeometryFactory.h> // for GeometryFactory::Ptr
27
28#include <vector>
29
30#ifdef _MSC_VER
31#pragma warning(push)
32#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
33#endif
34
35// Forward declarations
36namespace geos {
37namespace geom {
38//class Coordinate;
39class Geometry;
40class CoordinateSequence;
41class GeometryFactory;
42class LineString;
43}
44namespace geomgraph {
45class GeometryGraph;
46class PlanarGraph;
47class EdgeRing;
48class DirectedEdge;
49class EdgeEnd;
50}
51}
52
53namespace geos {
54namespace operation { // geos::operation
55namespace valid { // geos::operation::valid
56
72public:
74 ~ConnectedInteriorTester() = default;
75 geom::Coordinate& getCoordinate();
76 bool isInteriorsConnected();
77 static const geom::Coordinate& findDifferentPoint(
78 const geom::CoordinateSequence* coord,
79 const geom::Coordinate& pt);
80
81protected:
82
83 void visitLinkedDirectedEdges(geomgraph::DirectedEdge* start);
84
85private:
86
87 geom::GeometryFactory::Ptr geometryFactory;
88
89 geomgraph::GeometryGraph& geomGraph;
90
94 geom::Coordinate disconnectedRingcoord;
95
97 std::vector<geomgraph::EdgeRing*> maximalEdgeRings;
98
99 void setInteriorEdgesInResult(geomgraph::PlanarGraph& graph);
100
101
113 void buildEdgeRings(std::vector<geomgraph::EdgeEnd*>* dirEdges,
114 std::vector<geomgraph::EdgeRing*>& minEdgeRings);
115
120 void visitShellInteriors(const geom::Geometry* g, geomgraph::PlanarGraph& graph);
121
122 void visitInteriorRing(const geom::LineString* ring, geomgraph::PlanarGraph& graph);
123
134 bool hasUnvisitedShellEdge(std::vector<geomgraph::EdgeRing*>* edgeRings);
135
136 // Declare type as noncopyable
138 ConnectedInteriorTester& operator=(const ConnectedInteriorTester& rhs) = delete;
139};
140
141} // namespace geos::operation::valid
142} // namespace geos::operation
143} // namespace geos
144
145#ifdef _MSC_VER
146#pragma warning(pop)
147#endif
148
149#endif // GEOS_OP_CONNECTEDINTERIORTESTER_H
The internal representation of a list of coordinates inside a Geometry.
Definition CoordinateSequence.h:58
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
Definition LineString.h:68
A directed EdgeEnd.
Definition geomgraph/DirectedEdge.h:45
A GeometryGraph is a graph that models a given Geometry.
Definition GeometryGraph.h:74
Represents a directed graph which is embeddable in a planar surface.
Definition geomgraph/PlanarGraph.h:75
This class tests that the interior of an area Geometry (Polygon or MultiPolygon) is connected.
Definition ConnectedInteriorTester.h:71
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26