GEOS: SimpleNestedRingTester.h Source File

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

- File List

# SimpleNestedRingTester.h

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