GEOS 3.9.1
SimpleNestedRingTester.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2005-2006 Refractions Research Inc.
7 * Copyright (C) 2001-2002 Vivid Solutions Inc.
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 * Last port: operation/valid/SimpleNestedRingTester.java rev. 1.14 (JTS-1.10)
17 *
18 **********************************************************************/
19
20#ifndef GEOS_OP_SIMPLENESTEDRINGTESTER_H
21#define GEOS_OP_SIMPLENESTEDRINGTESTER_H
22
23#include <geos/export.h>
24
25#include <cstddef>
26#include <vector>
27
28#ifdef _MSC_VER
29#pragma warning(push)
30#pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
31#endif
32
33// Forward declarations
34namespace geos {
35namespace geom {
36class Coordinate;
37class LinearRing;
38}
39namespace geomgraph {
40class GeometryGraph;
41}
42}
43
44namespace geos {
45namespace operation { // geos::operation
46namespace valid { // geos::operation::valid
47
54class GEOS_DLL SimpleNestedRingTester {
55private:
56 geomgraph::GeometryGraph* graph; // used to find non-node vertices
57 std::vector<geom::LinearRing*> rings;
58 geom::Coordinate* nestedPt;
59public:
61 :
62 graph(newGraph),
63 rings(),
64 nestedPt(nullptr)
65 {}
66
68 {
69 }
70
71 void
72 add(geom::LinearRing* ring)
73 {
74 rings.push_back(ring);
75 }
76
77 /*
78 * Be aware that the returned Coordinate (if != NULL)
79 * will point to storage owned by one of the LinearRing
80 * previously added. If you destroy them, this
81 * will point to an invalid memory address.
82 */
84 getNestedPoint()
85 {
86 return nestedPt;
87 }
88
89 bool isNonNested();
90};
91
92} // namespace geos.operation.valid
93} // namespace geos.operation
94} // namespace geos
95
96#ifdef _MSC_VER
97#pragma warning(pop)
98#endif
99
100#endif // GEOS_OP_SIMPLENESTEDRINGTESTER_H
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
Models an OGC SFS LinearRing. A LinearRing is a LineString which is both closed and simple.
Definition LinearRing.h:54
A GeometryGraph is a graph that models a given Geometry.
Definition GeometryGraph.h:74
Tests whether any of a set of LinearRings are nested inside another ring in the set,...
Definition SimpleNestedRingTester.h:54
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26