GEOS  3.8.0dev
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
36 namespace geos {
37 namespace geom {
38 //class Coordinate;
39 class Geometry;
40 class CoordinateSequence;
41 class GeometryFactory;
42 class LineString;
43 }
44 namespace geomgraph {
45 class GeometryGraph;
46 class PlanarGraph;
47 class EdgeRing;
48 class DirectedEdge;
49 class EdgeEnd;
50 }
51 }
52 
53 namespace geos {
54 namespace operation { // geos::operation
55 namespace valid { // geos::operation::valid
56 
71 class GEOS_DLL ConnectedInteriorTester {
72 public:
75  geom::Coordinate& getCoordinate();
76  bool isInteriorsConnected();
77  static const geom::Coordinate& findDifferentPoint(
78  const geom::CoordinateSequence* coord,
79  const geom::Coordinate& pt);
80 
81 protected:
82 
83  void visitLinkedDirectedEdges(geomgraph::DirectedEdge* start);
84 
85 private:
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
137  ConnectedInteriorTester(const ConnectedInteriorTester& other) = delete;
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
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
Represents a directed graph which is embeddable in a planar surface.
Definition: geomgraph/PlanarGraph.h:75
A GeometryGraph is a graph that models a given Geometry.
Definition: GeometryGraph.h:73
A directed EdgeEnd.
Definition: geomgraph/DirectedEdge.h:45
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:188
Definition: LineString.h:68
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:58
This class tests that the interior of an area Geometry (Polygon or MultiPolygon) is connected...
Definition: ConnectedInteriorTester.h:71