GEOS: ConnectedInteriorTester.h Source File

- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# ConnectedInteriorTester.h

    00001 /**********************************************************************
    00002  * $Id: ConnectedInteriorTester.h 1820 2006-09-06 16:54:23Z 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 #ifndef GEOS_OP_CONNECTEDINTERIORTESTER_H
    00018 #define GEOS_OP_CONNECTEDINTERIORTESTER_H
    00019
    00020 #include <geos/geom/Coordinate.h> // for composition
    00021
    00022 #include <vector>
    00023
    00024 // Forward declarations
    00025 namespace geos {
    00026         namespace geom {
    00027                 //class Coordinate;
    00028                 class Geometry;
    00029                 class CoordinateSequence;
    00030                 class GeometryFactory;
    00031                 class LineString;
    00032         }
    00033         namespace geomgraph {
    00034                 class GeometryGraph;
    00035                 class PlanarGraph;
    00036                 class EdgeRing;
    00037                 class DirectedEdge;
    00038                 class EdgeEnd;
    00039         }
    00040 }
    00041
    00042 namespace geos {
    00043 namespace operation { // geos::operation
    00044 namespace valid { // geos::operation::valid
    00045
    00060 class ConnectedInteriorTester {
    00061 public:
    00062         ConnectedInteriorTester(geomgraph::GeometryGraph &newGeomGraph);
    00063         ~ConnectedInteriorTester();
    00064         geom::Coordinate& getCoordinate();
    00065         bool isInteriorsConnected();
    00066         static const geom::Coordinate& findDifferentPoint(
    00067                         const geom::CoordinateSequence *coord,
    00068                         const geom::Coordinate& pt);
    00069
    00070 private:
    00071
    00072         geom::GeometryFactory *geometryFactory;
    00073
    00074         geomgraph::GeometryGraph &geomGraph;
    00075
    00079         geom::Coordinate disconnectedRingcoord;
    00080
    00082         std::vector<geomgraph::EdgeRing*> maximalEdgeRings;
    00083
    00084         void setInteriorEdgesInResult(geomgraph::PlanarGraph &graph);
    00085
    00086
    00095         std::vector<geomgraph::EdgeRing*>* buildEdgeRings(
    00096                         std::vector<geomgraph::EdgeEnd*> *dirEdges);
    00097
    00102         void visitShellInteriors(const geom::Geometry *g, geomgraph::PlanarGraph &graph);
    00103
    00104         void visitInteriorRing(const geom::LineString *ring, geomgraph::PlanarGraph &graph);
    00105
    00116         bool hasUnvisitedShellEdge(std::vector<geomgraph::EdgeRing*> *edgeRings);
    00117
    00118 protected:
    00119
    00120         void visitLinkedDirectedEdges(geomgraph::DirectedEdge *start);
    00121 };
    00122
    00123
    00124 } // namespace geos::operation::valid
    00125 } // namespace geos::operation
    00126 } // namespace geos
    00127
    00128 #endif // GEOS_OP_CONNECTEDINTERIORTESTER_H
    00129
    00130 /**********************************************************************
    00131  * $Log$
    00132  * Revision 1.3  2006/04/06 12:48:36  strk
    00133  * Added private vector to keep track of allocated MaximalEdgeRings objects
    00134  *
    00135  * Revision 1.2  2006/03/27 14:20:46  strk
    00136  * Added paranoid assertion checking and a note in header about responsibility of return from buildMaximalEdgeRings()
    00137  *
    00138  * Revision 1.1  2006/03/20 16:57:44  strk
    00139  * spatialindex.h and opValid.h headers split
    00140  *
    00141  **********************************************************************/
    00142