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