GEOS  3.3.3
EdgeNodingValidator.h
1 /**********************************************************************
2  * $Id: EdgeNodingValidator.h 3255 2011-03-01 17:56:10Z mloskot $
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: geomgraph/EdgeNodingValidator.java rev. 1.6 (JTS-1.10)
18  *
19  **********************************************************************/
20 
21 
22 #ifndef GEOS_GEOMGRAPH_EDGENODINGVALIDATOR_H
23 #define GEOS_GEOMGRAPH_EDGENODINGVALIDATOR_H
24 
25 #include <geos/export.h>
26 #include <vector>
27 
28 #include <geos/noding/FastNodingValidator.h> // for composition
29 
30 #include <geos/inline.h>
31 
32 #ifdef _MSC_VER
33 #pragma warning(push)
34 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
35 #endif
36 
37 // Forward declarations
38 namespace geos {
39  namespace geom {
40  class CoordinateSequence;
41  }
42  namespace noding {
43  class SegmentString;
44  }
45  namespace geomgraph {
46  class Edge;
47  }
48 }
49 
50 namespace geos {
51 namespace geomgraph { // geos.geomgraph
52 
58 class GEOS_DLL EdgeNodingValidator {
59 
60 private:
61  std::vector<noding::SegmentString*>& toSegmentStrings(std::vector<Edge*>& edges);
62 
63  // Make sure this member is initialized *before*
64  // the NodingValidator, as initialization of
65  // NodingValidator will use toSegmentString(), that
66  // in turn expects this member to be initialized
67  std::vector<noding::SegmentString*> segStr;
68 
69  // Make sure this member is initialized *before*
70  // the NodingValidator, as initialization of
71  // NodingValidator will use toSegmentString(), that
72  // in turn expects this member to be initialized
73  std::vector<geom::CoordinateSequence*> newCoordSeq;
74 
76 
77 public:
78 
90  static void checkValid(std::vector<Edge*>& edges)
91  {
92  EdgeNodingValidator validator(edges);
93  validator.checkValid();
94  }
95 
96  EdgeNodingValidator(std::vector<Edge*>& edges)
97  :
98  segStr(),
99  newCoordSeq(),
100  nv(toSegmentStrings(edges))
101  {}
102 
103  ~EdgeNodingValidator();
104 
105  void checkValid() { nv.checkValid(); }
106 };
107 
108 
109 } // namespace geos.geomgraph
110 } // namespace geos
111 
112 #ifdef _MSC_VER
113 #pragma warning(pop)
114 #endif
115 
116 //#ifdef GEOS_INLINE
117 //# include "geos/geomgraph/EdgeNodingValidator.inl"
118 //#endif
119 
120 #endif // ifndef GEOS_GEOMGRAPH_EDGENODINGVALIDATOR_H
121 
122 /**********************************************************************
123  * $Log$
124  * Revision 1.2 2006/03/24 09:52:41 strk
125  * USE_INLINE => GEOS_INLINE
126  *
127  * Revision 1.1 2006/03/09 16:46:49 strk
128  * geos::geom namespace definition, first pass at headers split
129  *
130  **********************************************************************/
131