QuadtreeNestedRingTester.h

00001 /**********************************************************************
00002  * $Id: QuadtreeNestedRingTester.h 1820 2006-09-06 16:54:23Z mloskot $
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 #ifndef GEOS_OP_QUADTREENESTEDRINGTESTER_H
00018 #define GEOS_OP_QUADTREENESTEDRINGTESTER_H
00019 
00020 #include <geos/geom/Envelope.h> // for composition
00021 
00022 #include <vector>
00023 
00024 // Forward declarations
00025 namespace geos {
00026         namespace geom {
00027                 class LinearRing;
00028                 class Coordinate;
00029         }
00030         namespace index {
00031                 namespace quadtree {
00032                         class Quadtree;
00033                 }
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 QuadtreeNestedRingTester {
00051 public:
00052 
00054         QuadtreeNestedRingTester(geomgraph::GeometryGraph* newGraph);
00055 
00056         ~QuadtreeNestedRingTester();
00057 
00058         /*
00059          * Be aware that the returned Coordinate (if != NULL)
00060          * will point to storage owned by one of the LinearRing
00061          * previously added. If you destroy them, this
00062          * will point to an invalid memory address.
00063          */
00064         geom::Coordinate* getNestedPoint();
00065 
00066         void add(const geom::LinearRing* ring);
00067 
00068         bool isNonNested();
00069 
00070 private:
00071 
00072         geomgraph::GeometryGraph* graph;  // used to find non-node vertices
00073 
00074         std::vector<const geom::LinearRing*> rings;
00075 
00076         geom::Envelope totalEnv;
00077 
00078         index::quadtree::Quadtree* qt;
00079 
00080         geom::Coordinate* nestedPt;
00081 
00082         void buildQuadtree();
00083 };
00084 
00085 } // namespace geos::operation::valid
00086 } // namespace geos::operation
00087 } // namespace geos
00088 
00089 #endif // GEOS_OP_QUADTREENESTEDRINGTESTER_H
00090 
00091 /**********************************************************************
00092  * $Log$
00093  * Revision 1.2  2006/03/29 11:48:53  strk
00094  * Removed useless heap allocations in construction, enforced const correctness
00095  *
00096  * Revision 1.1  2006/03/20 16:57:44  strk
00097  * spatialindex.h and opValid.h headers split
00098  *
00099  **********************************************************************/
00100 

Generated on Fri Mar 27 04:52:58 2009 for GEOS by  doxygen 1.5.4