GEOS  3.6.2
SimpleNestedRingTester.h
00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2005-2006 Refractions Research Inc.
00007  * Copyright (C) 2001-2002 Vivid Solutions Inc.
00008  *
00009  * This is free software; you can redistribute and/or modify it under
00010  * the terms of the GNU Lesser General Public Licence as published
00011  * by the Free Software Foundation. 
00012  * See the COPYING file for more information.
00013  *
00014  **********************************************************************
00015  *
00016  * Last port: operation/valid/SimpleNestedRingTester.java rev. 1.14 (JTS-1.10)
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_OP_SIMPLENESTEDRINGTESTER_H
00021 #define GEOS_OP_SIMPLENESTEDRINGTESTER_H
00022 
00023 #include <geos/export.h>
00024 
00025 #include <cstddef>
00026 #include <vector>
00027 
00028 #ifdef _MSC_VER
00029 #pragma warning(push)
00030 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00031 #endif
00032 
00033 // Forward declarations
00034 namespace geos {
00035         namespace geom {
00036                 class Coordinate;
00037                 class LinearRing;
00038         }
00039         namespace geomgraph {
00040                 class GeometryGraph;
00041         }
00042 }
00043 
00044 namespace geos {
00045 namespace operation { // geos::operation
00046 namespace valid { // geos::operation::valid
00047 
00054 class GEOS_DLL SimpleNestedRingTester {
00055 private:
00056         geomgraph::GeometryGraph *graph;  // used to find non-node vertices
00057         std::vector<geom::LinearRing*> rings;
00058         geom::Coordinate *nestedPt;
00059 public:
00060         SimpleNestedRingTester(geomgraph::GeometryGraph *newGraph)
00061                 :
00062                 graph(newGraph),
00063                 rings(),
00064                 nestedPt(NULL)
00065         {}
00066 
00067         ~SimpleNestedRingTester() {
00068         }
00069 
00070         void add(geom::LinearRing *ring) {
00071                 rings.push_back(ring);
00072         }
00073 
00074         /*
00075          * Be aware that the returned Coordinate (if != NULL)
00076          * will point to storage owned by one of the LinearRing
00077          * previously added. If you destroy them, this
00078          * will point to an invalid memory address.
00079          */
00080         geom::Coordinate *getNestedPoint() {
00081                 return nestedPt;
00082         }
00083 
00084         bool isNonNested();
00085 };
00086 
00087 } // namespace geos.operation.valid
00088 } // namespace geos.operation
00089 } // namespace geos
00090 
00091 #ifdef _MSC_VER
00092 #pragma warning(pop)
00093 #endif
00094 
00095 #endif // GEOS_OP_SIMPLENESTEDRINGTESTER_H