GEOS  3.3.8
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 
29 #ifdef _MSC_VER
30 #pragma warning(push)
31 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
32 #endif
33 
34 // Forward declarations
35 namespace geos {
36  namespace geom {
37  class Coordinate;
38  class LinearRing;
39  }
40  namespace geomgraph {
41  class GeometryGraph;
42  }
43 }
44 
45 namespace geos {
46 namespace operation { // geos::operation
47 namespace valid { // geos::operation::valid
48 
55 class GEOS_DLL SimpleNestedRingTester {
56 private:
57  geomgraph::GeometryGraph *graph; // used to find non-node vertices
58  std::vector<geom::LinearRing*> rings;
59  geom::Coordinate *nestedPt;
60 public:
61  SimpleNestedRingTester(geomgraph::GeometryGraph *newGraph)
62  :
63  graph(newGraph),
64  rings(),
65  nestedPt(NULL)
66  {}
67 
69  }
70 
71  void add(geom::LinearRing *ring) {
72  rings.push_back(ring);
73  }
74 
75  /*
76  * Be aware that the returned Coordinate (if != NULL)
77  * will point to storage owned by one of the LinearRing
78  * previously added. If you destroy them, this
79  * will point to an invalid memory address.
80  */
81  geom::Coordinate *getNestedPoint() {
82  return nestedPt;
83  }
84 
85  bool isNonNested();
86 };
87 
88 } // namespace geos.operation.valid
89 } // namespace geos.operation
90 } // namespace geos
91 
92 #ifdef _MSC_VER
93 #pragma warning(pop)
94 #endif
95 
96 #endif // GEOS_OP_SIMPLENESTEDRINGTESTER_H
97 
98 /**********************************************************************
99  * $Log$
100  * Revision 1.1 2006/03/20 16:57:44 strk
101  * spatialindex.h and opValid.h headers split
102  *
103  **********************************************************************/
104