GEOS 3.6.2
IndexedNestedRingTester.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2009 Sandro Santilli <strk@keybit.net>
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************
14 *
15 * Last port: operation/valid/IndexedNestedRingTester.java r399 (JTS-1.12)
16 *
17 **********************************************************************/
18
19#ifndef GEOS_OP_VALID_OFFSETCURVEVERTEXLIST_H
20#define GEOS_OP_VALID_OFFSETCURVEVERTEXLIST_H
21
22#include <vector> // for composition
23
24// Forward declarations
25namespace geos {
26 namespace geom {
27 //class Envelope;
28 class Coordinate;
29 class LinearRing;
30 }
31 namespace index {
32 class SpatialIndex;
33 }
34 namespace geomgraph {
35 class GeometryGraph;
36 }
37}
38
39namespace geos {
40namespace operation { // geos.operation
41namespace valid { // geos.operation.valid
42
49class IndexedNestedRingTester
50{
51public:
52 // @param newGraph : ownership retained by caller
53 IndexedNestedRingTester(geomgraph::GeometryGraph* newGraph)
54 :
55 graph(newGraph),
56 //totalEnv(0),
57 index(0),
58 nestedPt(0)
59 {
60 }
61
62 ~IndexedNestedRingTester();
63
64 /*
65 * Be aware that the returned Coordinate (if != NULL)
66 * will point to storage owned by one of the LinearRing
67 * previously added. If you destroy them, this
68 * will point to an invalid memory address.
69 */
70 const geom::Coordinate* getNestedPoint() const
71 {
72 return nestedPt;
73 }
74
76 void add(const geom::LinearRing* ring)
77 {
78 rings.push_back(ring);
79 }
80
81 bool isNonNested();
82
83private:
84
87
89 std::vector<const geom::LinearRing*> rings;
90
91 // CHECK: Owned by (seems unused)?
92 //geom::Envelope* totalEnv;
93
94 // Owned by us (use auto_ptr ?)
95 geos::index::SpatialIndex* index; // 'index' in JTS
96
97 // Externally owned, if not null
98 const geom::Coordinate *nestedPt;
99
100 void buildIndex();
101};
102
103} // namespace geos.operation.valid
104} // namespace geos.operation
105} // namespace geos
106
107#endif // GEOS_OP_VALID_OFFSETCURVEVERTEXLIST_H
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
Models an OGC SFS LinearRing.
Definition LinearRing.h:57
Definition GeometryGraph.h:74
Abstract class defines basic insertion and query operations supported by classes implementing spatial...
Definition SpatialIndex.h:47
void add(const geom::LinearRing *ring)
Definition IndexedNestedRingTester.h:76
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Contains classes that implement topology graphs.
Definition IndexedNestedRingTester.h:34
Provides classes for various kinds of spatial indexes.
Definition IndexedNestedRingTester.h:31
Provides classes for testing the validity of geometries.
Definition IndexedNestedRingTester.h:41
Provides classes for implementing operations on geometries.
Definition IndexedNestedRingTester.h:40
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25