GEOS
3.3.1
|
00001 /********************************************************************** 00002 * $Id: IndexedNestedRingTester.h 3426 2011-07-05 11:49:01Z strk $ 00003 * 00004 * GEOS - Geometry Engine Open Source 00005 * http://geos.refractions.net 00006 * 00007 * Copyright (C) 2009 Sandro Santilli <strk@keybit.net> 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/IndexedNestedRingTester.java r399 (JTS-1.12) 00017 * 00018 **********************************************************************/ 00019 00020 #ifndef GEOS_OP_VALID_OFFSETCURVEVERTEXLIST_H 00021 #define GEOS_OP_VALID_OFFSETCURVEVERTEXLIST_H 00022 00023 #include <vector> // for composition 00024 00025 // Forward declarations 00026 namespace geos { 00027 namespace geom { 00028 //class Envelope; 00029 class Coordinate; 00030 class LinearRing; 00031 } 00032 namespace index { 00033 class SpatialIndex; 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 00050 class IndexedNestedRingTester 00051 { 00052 public: 00053 // @param newGraph : ownership retained by caller 00054 IndexedNestedRingTester(geomgraph::GeometryGraph* newGraph) 00055 : 00056 graph(newGraph), 00057 //totalEnv(0), 00058 index(0), 00059 nestedPt(0) 00060 { 00061 } 00062 00063 ~IndexedNestedRingTester(); 00064 00065 /* 00066 * Be aware that the returned Coordinate (if != NULL) 00067 * will point to storage owned by one of the LinearRing 00068 * previously added. If you destroy them, this 00069 * will point to an invalid memory address. 00070 */ 00071 const geom::Coordinate* getNestedPoint() const 00072 { 00073 return nestedPt; 00074 } 00075 00077 void add(const geom::LinearRing* ring) 00078 { 00079 rings.push_back(ring); 00080 } 00081 00082 bool isNonNested(); 00083 00084 private: 00085 00087 geomgraph::GeometryGraph* graph; 00088 00090 std::vector<const geom::LinearRing*> rings; 00091 00092 // CHECK: Owned by (seems unused)? 00093 //geom::Envelope* totalEnv; 00094 00095 // Owned by us (use auto_ptr ?) 00096 geos::index::SpatialIndex* index; // 'index' in JTS 00097 00098 // Externally owned, if not null 00099 const geom::Coordinate *nestedPt; 00100 00101 void buildIndex(); 00102 }; 00103 00104 } // namespace geos.operation.valid 00105 } // namespace geos.operation 00106 } // namespace geos 00107 00108 #endif // GEOS_OP_VALID_OFFSETCURVEVERTEXLIST_H 00109 00110 /********************************************************************** 00111 * $Log$ 00112 **********************************************************************/ 00113