GEOS  3.3.3
SimpleNestedRingTester.h
1 /**********************************************************************
2  * $Id: SimpleNestedRingTester.h 3274 2011-03-26 14:02:20Z strk $
3  *
4  * GEOS - Geometry Engine Open Source
5  * http://geos.refractions.net
6  *
7  * Copyright (C) 2005-2006 Refractions Research Inc.
8  * Copyright (C) 2001-2002 Vivid Solutions Inc.
9  *
10  * This is free software; you can redistribute and/or modify it under
11  * the terms of the GNU Lesser General Public Licence as published
12  * by the Free Software Foundation.
13  * See the COPYING file for more information.
14  *
15  **********************************************************************
16  *
17  * Last port: operation/valid/SimpleNestedRingTester.java rev. 1.14 (JTS-1.10)
18  *
19  **********************************************************************/
20 
21 #ifndef GEOS_OP_SIMPLENESTEDRINGTESTER_H
22 #define GEOS_OP_SIMPLENESTEDRINGTESTER_H
23 
24 #include <geos/export.h>
25 
26 #include <cstddef>
27 #include <vector>
28 #include <cstddef>
29 
30 #ifdef _MSC_VER
31 #pragma warning(push)
32 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
33 #endif
34 
35 // Forward declarations
36 namespace geos {
37  namespace geom {
38  class Coordinate;
39  class LinearRing;
40  }
41  namespace geomgraph {
42  class GeometryGraph;
43  }
44 }
45 
46 namespace geos {
47 namespace operation { // geos::operation
48 namespace valid { // geos::operation::valid
49 
50 using namespace std;
51 
58 class GEOS_DLL SimpleNestedRingTester {
59 private:
60  geomgraph::GeometryGraph *graph; // used to find non-node vertices
61  std::vector<geom::LinearRing*> rings;
62  geom::Coordinate *nestedPt;
63 public:
64  SimpleNestedRingTester(geomgraph::GeometryGraph *newGraph)
65  :
66  graph(newGraph),
67  rings(),
68  nestedPt(NULL)
69  {}
70 
72  }
73 
74  void add(geom::LinearRing *ring) {
75  rings.push_back(ring);
76  }
77 
78  /*
79  * Be aware that the returned Coordinate (if != NULL)
80  * will point to storage owned by one of the LinearRing
81  * previously added. If you destroy them, this
82  * will point to an invalid memory address.
83  */
84  geom::Coordinate *getNestedPoint() {
85  return nestedPt;
86  }
87 
88  bool isNonNested();
89 };
90 
91 } // namespace geos.operation.valid
92 } // namespace geos.operation
93 } // namespace geos
94 
95 #ifdef _MSC_VER
96 #pragma warning(pop)
97 #endif
98 
99 #endif // GEOS_OP_SIMPLENESTEDRINGTESTER_H
100 
101 /**********************************************************************
102  * $Log$
103  * Revision 1.1 2006/03/20 16:57:44 strk
104  * spatialindex.h and opValid.h headers split
105  *
106  **********************************************************************/
107