GEOS 3.9.1
IndexedNestedShellTester.h
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>
23#include <geos/index/SpatialIndex.h>
24
25#include <cstddef>
26#include <memory>
27
28// Forward declarations
29namespace geos {
30namespace algorithm {
31namespace locate {
32 class IndexedPointInAreaLocator;
33}
34}
35namespace geom {
36 class Polygon;
37}
38namespace geomgraph {
39 class GeometryGraph;
40}
41namespace operation {
42namespace valid {
43 class PolygonIndexedLocators;
44}
45}
46}
47
48namespace geos {
49namespace operation {
50namespace valid {
51
52class IndexedNestedShellTester {
53
54public:
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
65private:
66 void compute();
67
79 void checkShellNotNested(const geom::LinearRing* shell, PolygonIndexedLocators & locs);
80
90 const geom::Coordinate* checkShellInsideHole(const geom::LinearRing* shell,
91 algorithm::locate::IndexedPointInAreaLocator & holeLoc);
92
94 const geomgraph::GeometryGraph& graph;
95
96 std::vector<const geom::Polygon*> polys;
97
98 // Externally owned, if not null
99 const geom::Coordinate* nestedPt;
100
101 bool processed;
102};
103
104}
105}
106}
107
108#endif //GEOS_INDEXEDNESTEDSHELLTESTER_H
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26