GEOS  3.13.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 #pragma once
22 
23 #include <geos/export.h>
24 #include <vector>
25 
26 #include <geos/noding/FastNodingValidator.h> // for composition
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 CoordinateSequence;
37 }
38 namespace noding {
39 class SegmentString;
40 }
41 namespace geomgraph {
42 class Edge;
43 }
44 }
45 
46 namespace geos {
47 namespace geomgraph { // geos.geomgraph
48 
54 class GEOS_DLL EdgeNodingValidator {
55 
56 private:
57  std::vector<noding::SegmentString*>& toSegmentStrings(std::vector<Edge*>& edges);
58 
59  // Make sure this member is initialized *before*
60  // the NodingValidator, as initialization of
61  // NodingValidator will use toSegmentString(), that
62  // in turn expects this member to be initialized
63  std::vector<noding::SegmentString*> segStr;
64 
65  // Make sure this member is initialized *before*
66  // the NodingValidator, as initialization of
67  // NodingValidator will use toSegmentString(), that
68  // in turn expects this member to be initialized
69  std::vector<geom::CoordinateSequence*> newCoordSeq;
70 
72 
73 public:
74 
84  static void
85  checkValid(std::vector<Edge*>& edges)
86  {
87  EdgeNodingValidator validator(edges);
88  validator.checkValid();
89  }
90 
91  EdgeNodingValidator(std::vector<Edge*>& edges)
92  :
93  segStr(),
94  newCoordSeq(),
95  nv(toSegmentStrings(edges))
96  {}
97 
98  ~EdgeNodingValidator();
99 
100  void
101  checkValid()
102  {
103  nv.checkValid();
104  }
105 };
106 
107 
108 } // namespace geos.geomgraph
109 } // namespace geos
110 
111 #ifdef _MSC_VER
112 #pragma warning(pop)
113 #endif
Validates that a collection of SegmentStrings is correctly noded.
Definition: EdgeNodingValidator.h:54
static void checkValid(std::vector< Edge * > &edges)
Checks whether the supplied Edges are correctly noded.
Definition: EdgeNodingValidator.h:85
Validates that a collection of SegmentStrings is correctly noded.
Definition: FastNodingValidator.h:59
void checkValid()
Checks for an intersection and throws a TopologyException if one is found.
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25