IndexedNestedRingTester.h

00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2009 Sandro Santilli <strk@keybit.net>
00007  *
00008  * This is free software; you can redistribute and/or modify it under
00009  * the terms of the GNU Lesser General Public Licence as published
00010  * by the Free Software Foundation. 
00011  * See the COPYING file for more information.
00012  *
00013  **********************************************************************
00014  *
00015  * Last port: operation/valid/IndexedNestedRingTester.java r399 (JTS-1.12)
00016  *
00017  **********************************************************************/
00018 
00019 #ifndef GEOS_OP_VALID_OFFSETCURVEVERTEXLIST_H
00020 #define GEOS_OP_VALID_OFFSETCURVEVERTEXLIST_H
00021 
00022 #include <vector> // for composition
00023 
00024 // Forward declarations
00025 namespace geos {
00026         namespace geom {
00027                 //class Envelope;
00028                 class Coordinate;
00029                 class LinearRing;
00030         }
00031         namespace index {
00032                 class SpatialIndex;
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 IndexedNestedRingTester
00050 {
00051 public:
00052         // @param newGraph : ownership retained by caller
00053         IndexedNestedRingTester(geomgraph::GeometryGraph* newGraph)
00054                 :
00055                 graph(newGraph),
00056                 //totalEnv(0),
00057                 index(0),
00058                 nestedPt(0)
00059         {
00060         }
00061 
00062         ~IndexedNestedRingTester();
00063 
00064         /*
00065          * Be aware that the returned Coordinate (if != NULL)
00066          * will point to storage owned by one of the LinearRing
00067          * previously added. If you destroy them, this
00068          * will point to an invalid memory address.
00069          */
00070         const geom::Coordinate* getNestedPoint() const
00071         {
00072                 return nestedPt;
00073         }
00074 
00076         void add(const geom::LinearRing* ring)
00077         {
00078                 rings.push_back(ring);
00079         }
00080 
00081         bool isNonNested();
00082 
00083 private:
00084 
00086         geomgraph::GeometryGraph* graph; 
00087 
00089         std::vector<const geom::LinearRing*> rings;
00090 
00091         // CHECK: Owned by (seems unused)?
00092         //geom::Envelope* totalEnv; 
00093 
00094         // Owned by us (use auto_ptr ?)
00095         geos::index::SpatialIndex* index; // 'index' in JTS
00096 
00097         // Externally owned, if not null
00098         const geom::Coordinate *nestedPt; 
00099 
00100         void buildIndex();
00101 };
00102 
00103 } // namespace geos.operation.valid
00104 } // namespace geos.operation
00105 } // namespace geos
00106 
00107 #endif // GEOS_OP_VALID_OFFSETCURVEVERTEXLIST_H

Generated on 30 Dec 2015 for GEOS by  doxygen 1.4.7