GEOS  3.3.3
ConnectedInteriorTester.h
1 /**********************************************************************
2  * $Id: ConnectedInteriorTester.h 3255 2011-03-01 17:56:10Z mloskot $
3  *
4  * GEOS - Geometry Engine Open Source
5  * http://geos.refractions.net
6  *
7  * Copyright (C) 2005-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/valid/ConnectedInteriorTester.java rev. 1.15 (JTS-1.10)
18  *
19  **********************************************************************/
20 
21 #ifndef GEOS_OP_CONNECTEDINTERIORTESTER_H
22 #define GEOS_OP_CONNECTEDINTERIORTESTER_H
23 
24 #include <geos/export.h>
25 
26 #include <geos/geom/Coordinate.h> // for composition
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:
73  ConnectedInteriorTester(geomgraph::GeometryGraph &newGeomGraph);
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 *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);
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
150 
151 /**********************************************************************
152  * $Log$
153  * Revision 1.3 2006/04/06 12:48:36 strk
154  * Added private vector to keep track of allocated MaximalEdgeRings objects
155  *
156  * Revision 1.2 2006/03/27 14:20:46 strk
157  * Added paranoid assertion checking and a note in header about responsibility of return from buildMaximalEdgeRings()
158  *
159  * Revision 1.1 2006/03/20 16:57:44 strk
160  * spatialindex.h and opValid.h headers split
161  *
162  **********************************************************************/
163