GEOS  3.8.0dev
EdgeNodingValidator.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: geomgraph/EdgeNodingValidator.java rev. 1.6 (JTS-1.10)
17  *
18  **********************************************************************/
19 
20 
21 #ifndef GEOS_GEOMGRAPH_EDGENODINGVALIDATOR_H
22 #define GEOS_GEOMGRAPH_EDGENODINGVALIDATOR_H
23 
24 #include <geos/export.h>
25 #include <vector>
26 
27 #include <geos/noding/FastNodingValidator.h> // for composition
28 
29 #include <geos/inline.h>
30 
31 #ifdef _MSC_VER
32 #pragma warning(push)
33 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
34 #endif
35 
36 // Forward declarations
37 namespace geos {
38 namespace geom {
39 class CoordinateSequence;
40 }
41 namespace noding {
42 class SegmentString;
43 }
44 namespace geomgraph {
45 class Edge;
46 }
47 }
48 
49 namespace geos {
50 namespace geomgraph { // geos.geomgraph
51 
57 class GEOS_DLL EdgeNodingValidator {
58 
59 private:
60  std::vector<noding::SegmentString*>& toSegmentStrings(std::vector<Edge*>& edges);
61 
62  // Make sure this member is initialized *before*
63  // the NodingValidator, as initialization of
64  // NodingValidator will use toSegmentString(), that
65  // in turn expects this member to be initialized
66  std::vector<noding::SegmentString*> segStr;
67 
68  // Make sure this member is initialized *before*
69  // the NodingValidator, as initialization of
70  // NodingValidator will use toSegmentString(), that
71  // in turn expects this member to be initialized
72  std::vector<geom::CoordinateSequence*> newCoordSeq;
73 
75 
76 public:
77 
87  static void
88  checkValid(std::vector<Edge*>& edges)
89  {
90  EdgeNodingValidator validator(edges);
91  validator.checkValid();
92  }
93 
94  EdgeNodingValidator(std::vector<Edge*>& edges)
95  :
96  segStr(),
97  newCoordSeq(),
98  nv(toSegmentStrings(edges))
99  {}
100 
101  ~EdgeNodingValidator();
102 
103  void
104  checkValid()
105  {
106  nv.checkValid();
107  }
108 };
109 
110 
111 } // namespace geos.geomgraph
112 } // namespace geos
113 
114 #ifdef _MSC_VER
115 #pragma warning(pop)
116 #endif
117 
118 //#ifdef GEOS_INLINE
119 //# include "geos/geomgraph/EdgeNodingValidator.inl"
120 //#endif
121 
122 #endif // ifndef GEOS_GEOMGRAPH_EDGENODINGVALIDATOR_H
Validates that a collection of SegmentStrings is correctly noded.
Definition: EdgeNodingValidator.h:57
static void checkValid(std::vector< Edge * > &edges)
Checks whether the supplied Edges are correctly noded.
Definition: EdgeNodingValidator.h:88
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
Validates that a collection of SegmentStrings is correctly noded.
Definition: FastNodingValidator.h:60
void checkValid()
Checks for an intersection and throws a TopologyException if one is found.