# SimpleNestedRingTester.h

    00001 /**********************************************************************
    00002  * $Id: SimpleNestedRingTester.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_SIMPLENESTEDRINGTESTER_H
    00018 #define GEOS_OP_SIMPLENESTEDRINGTESTER_H
    00019
    00020 #include <vector>
    00021
    00022 // Forward declarations
    00023 namespace geos {
    00024         namespace geom {
    00025                 class Coordinate;
    00026                 class LinearRing;
    00027         }
    00028         namespace geomgraph {
    00029                 class GeometryGraph;
    00030         }
    00031 }
    00032
    00033 namespace geos {
    00034 namespace operation { // geos::operation
    00035 namespace valid { // geos::operation::valid
    00036
    00043 class SimpleNestedRingTester {
    00044 private:
    00045         geomgraph::GeometryGraph *graph;  // used to find non-node vertices
    00046         std::vector<geom::LinearRing*> rings;
    00047         geom::Coordinate *nestedPt;
    00048 public:
    00049         SimpleNestedRingTester(geomgraph::GeometryGraph *newGraph)
    00050                 :
    00051                 graph(newGraph),
    00052                 rings(),
    00053                 nestedPt(NULL)
    00054         {}
    00055
    00056         ~SimpleNestedRingTester() {
    00057         }
    00058
    00059         void add(geom::LinearRing *ring) {
    00060                 rings.push_back(ring);
    00061         }
    00062
    00063         /*
    00064          * Be aware that the returned Coordinate (if != NULL)
    00065          * will point to storage owned by one of the LinearRing
    00066          * previously added. If you destroy them, this
    00067          * will point to an invalid memory address.
    00068          */
    00069         geom::Coordinate *getNestedPoint() {
    00070                 return nestedPt;
    00071         }
    00072
    00073         bool isNonNested();
    00074 };
    00075
    00076
    00077 } // namespace geos.operation.valid
    00078 } // namespace geos.operation
    00079 } // namespace geos
    00080
    00081 #endif // GEOS_OP_SIMPLENESTEDRINGTESTER_H
    00082
    00083 /**********************************************************************
    00084  * $Log$
    00085  * Revision 1.1  2006/03/20 16:57:44  strk
    00086  * spatialindex.h and opValid.h headers split
    00087  *
    00088  **********************************************************************/
    00089