Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

ConnectedInteriorTester.h

00001 /**********************************************************************
00002  * $Id: ConnectedInteriorTester.h 2572 2009-06-08 22:10:55Z strk $
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 // Forward declarations
00031 namespace geos {
00032         namespace geom {
00033                 //class Coordinate;
00034                 class Geometry;
00035                 class CoordinateSequence;
00036                 class GeometryFactory;
00037                 class LineString;
00038         }
00039         namespace geomgraph {
00040                 class GeometryGraph;
00041                 class PlanarGraph;
00042                 class EdgeRing;
00043                 class DirectedEdge;
00044                 class EdgeEnd;
00045         }
00046 }
00047 
00048 namespace geos {
00049 namespace operation { // geos::operation
00050 namespace valid { // geos::operation::valid
00051 
00066 class GEOS_DLL ConnectedInteriorTester {
00067 public:
00068         ConnectedInteriorTester(geomgraph::GeometryGraph &newGeomGraph);
00069         ~ConnectedInteriorTester();
00070         geom::Coordinate& getCoordinate();
00071         bool isInteriorsConnected();
00072         static const geom::Coordinate& findDifferentPoint(
00073                         const geom::CoordinateSequence *coord,
00074                         const geom::Coordinate& pt);
00075 
00076 private:
00077 
00078         geom::GeometryFactory *geometryFactory;
00079 
00080         geomgraph::GeometryGraph &geomGraph;
00081 
00085         geom::Coordinate disconnectedRingcoord;
00086 
00088         std::vector<geomgraph::EdgeRing*> maximalEdgeRings;
00089 
00090         void setInteriorEdgesInResult(geomgraph::PlanarGraph &graph);
00091 
00092         
00101         std::vector<geomgraph::EdgeRing*>* buildEdgeRings(
00102                         std::vector<geomgraph::EdgeEnd*> *dirEdges);
00103 
00108         void visitShellInteriors(const geom::Geometry *g, geomgraph::PlanarGraph &graph);
00109 
00110         void visitInteriorRing(const geom::LineString *ring, geomgraph::PlanarGraph &graph);
00111 
00122         bool hasUnvisitedShellEdge(std::vector<geomgraph::EdgeRing*> *edgeRings);
00123 
00124 protected:
00125 
00126         void visitLinkedDirectedEdges(geomgraph::DirectedEdge *start);
00127 };
00128 
00129 
00130 } // namespace geos::operation::valid
00131 } // namespace geos::operation
00132 } // namespace geos
00133 
00134 #endif // GEOS_OP_CONNECTEDINTERIORTESTER_H
00135 
00136 /**********************************************************************
00137  * $Log$
00138  * Revision 1.3  2006/04/06 12:48:36  strk
00139  * Added private vector to keep track of allocated MaximalEdgeRings objects
00140  *
00141  * Revision 1.2  2006/03/27 14:20:46  strk
00142  * Added paranoid assertion checking and a note in header about responsibility of return from buildMaximalEdgeRings()
00143  *
00144  * Revision 1.1  2006/03/20 16:57:44  strk
00145  * spatialindex.h and opValid.h headers split
00146  *
00147  **********************************************************************/
00148 

Generated on Thu Jun 11 06:17:00 2009 for GEOS by  doxygen 1.4.4