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