GEOS: SimpleNestedRingTester.h Source File

GEOS 3.5.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

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
34 namespace geos {
35 namespace geom {
36 class Coordinate;
37 class LinearRing;
38 }
39 namespace geomgraph {
40 class GeometryGraph;
41 }
42 }
43
44 namespace geos {
45 namespace operation { // geos::operation
46 namespace valid { // geos::operation::valid
47
54 class GEOS_DLL SimpleNestedRingTester {
55 private:
56 geomgraph::GeometryGraph *graph; // used to find non-node vertices
57 std::vector<geom::LinearRing*> rings;
58 geom::Coordinate *nestedPt;
59 public:
60 SimpleNestedRingTester(geomgraph::GeometryGraph *newGraph)
61 :
62 graph(newGraph),
63 rings(),
64 nestedPt(NULL)
65 {}
66
67 ~SimpleNestedRingTester() {
68 }
69
70 void add(geom::LinearRing *ring) {
71 rings.push_back(ring);
72 }
73
74 /*
75 * Be aware that the returned Coordinate (if != NULL)
76 * will point to storage owned by one of the LinearRing
77 * previously added. If you destroy them, this
78 * will point to an invalid memory address.
79 */
80 geom::Coordinate *getNestedPoint() {
81 return nestedPt;
82 }
83
84 bool isNonNested();
85 };
86
87 } // namespace geos.operation.valid
88 } // namespace geos.operation
89 } // namespace geos
90
91 #ifdef _MSC_VER
92 #pragma warning(pop)
93 #endif
94
95 #endif // GEOS_OP_SIMPLENESTEDRINGTESTER_H
geos::geom::Coordinate
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
geos::geomgraph::GeometryGraph
Definition: GeometryGraph.h:73
geos
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
geos::geom::LinearRing
Models an OGC SFS LinearRing.
Definition: LinearRing.h:57
geos::operation::valid::SimpleNestedRingTester
Tests whether any of a set of LinearRings are nested inside another ring in the set, using a simple O(n^2) comparison.
Definition: SimpleNestedRingTester.h:54