GEOS  3.4.2
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 
27 #include <vector>
28 
29 #ifdef _MSC_VER
30 #pragma warning(push)
31 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
32 #endif
33 
34 // Forward declarations
35 namespace geos {
36  namespace geom {
37  //class Coordinate;
38  class Geometry;
39  class CoordinateSequence;
40  class GeometryFactory;
41  class LineString;
42  }
43  namespace geomgraph {
44  class GeometryGraph;
45  class PlanarGraph;
46  class EdgeRing;
47  class DirectedEdge;
48  class EdgeEnd;
49  }
50 }
51 
52 namespace geos {
53 namespace operation { // geos::operation
54 namespace valid { // geos::operation::valid
55 
70 class GEOS_DLL ConnectedInteriorTester {
71 public:
74  geom::Coordinate& getCoordinate();
75  bool isInteriorsConnected();
76  static const geom::Coordinate& findDifferentPoint(
77  const geom::CoordinateSequence *coord,
78  const geom::Coordinate& pt);
79 
80 protected:
81 
82  void visitLinkedDirectedEdges(geomgraph::DirectedEdge *start);
83 
84 private:
85 
86  geom::GeometryFactory *geometryFactory;
87 
88  geomgraph::GeometryGraph &geomGraph;
89 
93  geom::Coordinate disconnectedRingcoord;
94 
96  std::vector<geomgraph::EdgeRing*> maximalEdgeRings;
97 
98  void setInteriorEdgesInResult(geomgraph::PlanarGraph &graph);
99 
100 
112  void buildEdgeRings(std::vector<geomgraph::EdgeEnd*> *dirEdges,
113  std::vector<geomgraph::EdgeRing*>& minEdgeRings);
114 
119  void visitShellInteriors(const geom::Geometry *g, geomgraph::PlanarGraph &graph);
120 
121  void visitInteriorRing(const geom::LineString *ring, geomgraph::PlanarGraph &graph);
122 
133  bool hasUnvisitedShellEdge(std::vector<geomgraph::EdgeRing*> *edgeRings);
134 
135  // Declare type as noncopyable
137  ConnectedInteriorTester& operator=(const ConnectedInteriorTester& rhs);
138 };
139 
140 } // namespace geos::operation::valid
141 } // namespace geos::operation
142 } // namespace geos
143 
144 #ifdef _MSC_VER
145 #pragma warning(pop)
146 #endif
147 
148 #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
Definition: GeometryGraph.h:72
A directed EdgeEnd.
Definition: geomgraph/DirectedEdge.h:44
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:167
Definition: LineString.h:70
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:67
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:59
This class tests that the interior of an area Geometry (Polygon or MultiPolygon) is connected...
Definition: ConnectedInteriorTester.h:70