GEOS  3.9.1dev
IndexedNestedShellTester.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2001-2002 Vivid Solutions Inc.
7  * Copyright (C) 2005 Refractions Research Inc.
8  * Copyright (C) 2010 Safe Software Inc.
9  * Copyright (C) 2010 Sandro Santilli <strk@kbt.io>
10  * Copyright (C) 2019 Daniel Baston <dbaston@gmail.com>
11  *
12  * This is free software; you can redistribute and/or modify it under
13  * the terms of the GNU Lesser General Public Licence as published
14  * by the Free Software Foundation.
15  * See the COPYING file for more information.
16  *
17  **********************************************************************/
18 
19 #ifndef GEOS_OP_VALID_INDEXEDNESTEDSHELLTESTER_H
20 #define GEOS_OP_VALID_INDEXEDNESTEDSHELLTESTER_H
21 
22 #include <geos/geom/Polygon.h>
24 
25 #include <cstddef>
26 #include <memory>
27 
28 // Forward declarations
29 namespace geos {
30 namespace algorithm {
31 namespace locate {
32  class IndexedPointInAreaLocator;
33 }
34 }
35 namespace geom {
36  class Polygon;
37 }
38 namespace geomgraph {
39  class GeometryGraph;
40 }
41 namespace operation {
42 namespace valid {
43  class PolygonIndexedLocators;
44 }
45 }
46 }
47 
48 namespace geos {
49 namespace operation {
50 namespace valid {
51 
53 
54 public:
55  IndexedNestedShellTester(const geomgraph::GeometryGraph& g, size_t initialCapacity);
56 
57  void add(const geom::Polygon& p) {
58  polys.push_back(&p);
59  }
60 
61  const geom::Coordinate* getNestedPoint();
62 
63  bool isNonNested();
64 
65 private:
66  void compute();
67 
79  void checkShellNotNested(const geom::LinearRing* shell, PolygonIndexedLocators & locs);
80 
90  const geom::Coordinate* checkShellInsideHole(const geom::LinearRing* shell,
92 
95 
96  std::vector<const geom::Polygon*> polys;
97 
98  // Externally owned, if not null
100 
101  bool processed;
102 };
103 
104 }
105 }
106 }
107 
108 #endif //GEOS_INDEXEDNESTEDSHELLTESTER_H
Determines the location of Coordinates relative to an areal geometry, using indexing for efficiency...
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
A GeometryGraph is a graph that models a given Geometry.
Definition: GeometryGraph.h:74
Represents a linear polygon, which may include holes.
Definition: Polygon.h:64
Basic namespace for all GEOS functionalities.
const geomgraph::GeometryGraph & graph
Externally owned.
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple...
Definition: LinearRing.h:54