GEOS  3.13.0dev
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
24 namespace geos {
25 namespace geom {
26 class Coordinate;
27 class Polygon;
28 class LinearRing;
29 }
30 }
31 
32 
33 namespace geos { // geos.
34 namespace operation { // geos.operation
35 namespace valid { // geos.operation.valid
36 
39 using geos::geom::CoordinateXY;
40 
41 
42 class GEOS_DLL IndexedNestedHoleTester {
43 
44 private:
45 
46  const Polygon* polygon;
47  index::strtree::TemplateSTRtree<const LinearRing*> index;
48  CoordinateXY nestedPt;
49 
50  void loadIndex();
51 
52 
53 public:
54 
55  IndexedNestedHoleTester(const Polygon* p_polygon)
56  : polygon(p_polygon)
57  {
58  loadIndex();
59  }
60 
66  const CoordinateXY& 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 
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition: LinearRing.h:54
Represents a linear polygon, which may include holes.
Definition: Polygon.h:60
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25