GEOS
3.3.6
|
00001 /********************************************************************** 00002 * $Id: ConnectedInteriorTester.h 3255 2011-03-01 17:56:10Z mloskot $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2005-2006 Refractions Research Inc. 00008 * Copyright (C) 2001-2002 Vivid Solutions Inc. 00009 * 00010 * This is free software; you can redistribute and/or modify it under 00011 * the terms of the GNU Lesser General Public Licence as published 00012 * by the Free Software Foundation. 00013 * See the COPYING file for more information. 00014 * 00015 ********************************************************************** 00016 * 00017 * Last port: operation/valid/ConnectedInteriorTester.java rev. 1.15 (JTS-1.10) 00018 * 00019 **********************************************************************/ 00020 00021 #ifndef GEOS_OP_CONNECTEDINTERIORTESTER_H 00022 #define GEOS_OP_CONNECTEDINTERIORTESTER_H 00023 00024 #include <geos/export.h> 00025 00026 #include <geos/geom/Coordinate.h> // for composition 00027 00028 #include <vector> 00029 00030 #ifdef _MSC_VER 00031 #pragma warning(push) 00032 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class 00033 #endif 00034 00035 // Forward declarations 00036 namespace geos { 00037 namespace geom { 00038 //class Coordinate; 00039 class Geometry; 00040 class CoordinateSequence; 00041 class GeometryFactory; 00042 class LineString; 00043 } 00044 namespace geomgraph { 00045 class GeometryGraph; 00046 class PlanarGraph; 00047 class EdgeRing; 00048 class DirectedEdge; 00049 class EdgeEnd; 00050 } 00051 } 00052 00053 namespace geos { 00054 namespace operation { // geos::operation 00055 namespace valid { // geos::operation::valid 00056 00071 class GEOS_DLL ConnectedInteriorTester { 00072 public: 00073 ConnectedInteriorTester(geomgraph::GeometryGraph &newGeomGraph); 00074 ~ConnectedInteriorTester(); 00075 geom::Coordinate& getCoordinate(); 00076 bool isInteriorsConnected(); 00077 static const geom::Coordinate& findDifferentPoint( 00078 const geom::CoordinateSequence *coord, 00079 const geom::Coordinate& pt); 00080 00081 protected: 00082 00083 void visitLinkedDirectedEdges(geomgraph::DirectedEdge *start); 00084 00085 private: 00086 00087 geom::GeometryFactory *geometryFactory; 00088 00089 geomgraph::GeometryGraph &geomGraph; 00090 00094 geom::Coordinate disconnectedRingcoord; 00095 00097 std::vector<geomgraph::EdgeRing*> maximalEdgeRings; 00098 00099 void setInteriorEdgesInResult(geomgraph::PlanarGraph &graph); 00100 00101 00113 void buildEdgeRings(std::vector<geomgraph::EdgeEnd*> *dirEdges, 00114 std::vector<geomgraph::EdgeRing*>& minEdgeRings); 00115 00120 void visitShellInteriors(const geom::Geometry *g, geomgraph::PlanarGraph &graph); 00121 00122 void visitInteriorRing(const geom::LineString *ring, geomgraph::PlanarGraph &graph); 00123 00134 bool hasUnvisitedShellEdge(std::vector<geomgraph::EdgeRing*> *edgeRings); 00135 00136 // Declare type as noncopyable 00137 ConnectedInteriorTester(const ConnectedInteriorTester& other); 00138 ConnectedInteriorTester& operator=(const ConnectedInteriorTester& rhs); 00139 }; 00140 00141 } // namespace geos::operation::valid 00142 } // namespace geos::operation 00143 } // namespace geos 00144 00145 #ifdef _MSC_VER 00146 #pragma warning(pop) 00147 #endif 00148 00149 #endif // GEOS_OP_CONNECTEDINTERIORTESTER_H 00150 00151 /********************************************************************** 00152 * $Log$ 00153 * Revision 1.3 2006/04/06 12:48:36 strk 00154 * Added private vector to keep track of allocated MaximalEdgeRings objects 00155 * 00156 * Revision 1.2 2006/03/27 14:20:46 strk 00157 * Added paranoid assertion checking and a note in header about responsibility of return from buildMaximalEdgeRings() 00158 * 00159 * Revision 1.1 2006/03/20 16:57:44 strk 00160 * spatialindex.h and opValid.h headers split 00161 * 00162 **********************************************************************/ 00163