GEOS 3.11.1
IndexedNestedHoleTester.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2021 Paul Ramsey <pramsey@cleverelephant.ca>
7 * Copyright (C) 2021 Martin Davis
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************/
15
16#pragma once
17
18#include <geos/export.h>
19#include <geos/index/strtree/TemplateSTRtree.h>
20
21#include <memory>
22
23// Forward declarations
24namespace geos {
25namespace geom {
26class Coordinate;
27class Polygon;
28class LinearRing;
29}
30}
31
32
33namespace geos { // geos.
34namespace operation { // geos.operation
35namespace valid { // geos.operation.valid
36
40
41
42class GEOS_DLL IndexedNestedHoleTester {
43
44private:
45
46 const Polygon* polygon;
47 index::strtree::TemplateSTRtree<const LinearRing*> index;
48 Coordinate nestedPt;
49
50 void loadIndex();
51
52
53public:
54
55 IndexedNestedHoleTester(const Polygon* p_polygon)
56 : polygon(p_polygon)
57 {
58 loadIndex();
59 }
60
66 const Coordinate& getNestedPoint() { return nestedPt; }
67
74 bool isNested();
75
76};
77
78
79
80} // namespace geos.operation.valid
81} // namespace geos.operation
82} // namespace geos
83
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition: LinearRing.h:55
Represents a linear polygon, which may include holes.
Definition: Polygon.h:61
Basic namespace for all GEOS functionalities.
Definition: geos.h:39