GEOS  3.6.2
QuadtreeNestedRingTester.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/QuadtreeNestedRingTester.java rev. 1.12 (JTS-1.10)
00017  *
00018  **********************************************************************/
00019 
00020 #ifndef GEOS_OP_QUADTREENESTEDRINGTESTER_H
00021 #define GEOS_OP_QUADTREENESTEDRINGTESTER_H
00022 
00023 #include <geos/export.h>
00024 
00025 #include <geos/geom/Envelope.h> // for composition
00026 
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 LinearRing;
00038                 class Coordinate;
00039         }
00040         namespace index {
00041                 namespace quadtree {
00042                         class Quadtree;
00043                 }
00044         }
00045         namespace geomgraph {
00046                 class GeometryGraph;
00047         }
00048 }
00049 
00050 namespace geos {
00051 namespace operation { // geos::operation
00052 namespace valid { // geos::operation::valid
00053 
00060 class GEOS_DLL QuadtreeNestedRingTester {
00061 public:
00062 
00064         QuadtreeNestedRingTester(geomgraph::GeometryGraph* newGraph);
00065 
00066         ~QuadtreeNestedRingTester();
00067 
00068         /*
00069          * Be aware that the returned Coordinate (if != NULL)
00070          * will point to storage owned by one of the LinearRing
00071          * previously added. If you destroy them, this
00072          * will point to an invalid memory address.
00073          */
00074         geom::Coordinate* getNestedPoint();
00075 
00076         void add(const geom::LinearRing* ring);
00077 
00078         bool isNonNested();
00079 
00080 private:
00081 
00082         geomgraph::GeometryGraph* graph;  // used to find non-node vertices
00083 
00084         std::vector<const geom::LinearRing*> rings;
00085 
00086         geom::Envelope totalEnv;
00087 
00088         index::quadtree::Quadtree* qt;
00089 
00090         geom::Coordinate* nestedPt;
00091 
00092         void buildQuadtree();
00093 };
00094 
00095 } // namespace geos::operation::valid
00096 } // namespace geos::operation
00097 } // namespace geos
00098 
00099 #ifdef _MSC_VER
00100 #pragma warning(pop)
00101 #endif
00102 
00103 #endif // GEOS_OP_QUADTREENESTEDRINGTESTER_H