GEOS  3.9.1dev
NodingValidator.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************/
14 
15 #ifndef GEOS_NODING_NODINGVALIDATOR_H
16 #define GEOS_NODING_NODINGVALIDATOR_H
17 
18 #include <geos/export.h>
19 
20 #include <vector>
21 #include <iostream>
22 
23 #include <geos/inline.h>
24 
26 //#include <geos/geom/Coordinate.h>
27 
28 // Forward declarations
29 namespace geos {
30 namespace geom {
31 class Coordinate;
32 }
33 namespace noding {
34 class SegmentString;
35 }
36 }
37 
38 namespace geos {
39 namespace noding { // geos.noding
40 
49 private:
51  const std::vector<SegmentString*>& segStrings;
52 
57  void checkCollapses() const;
58 
59  void checkCollapses(const SegmentString& ss) const;
60 
61  void checkCollapse(const geom::Coordinate& p0, const geom::Coordinate& p1,
62  const geom::Coordinate& p2) const;
63 
68  void checkInteriorIntersections();
69 
70  void checkInteriorIntersections(const SegmentString& ss0,
71  const SegmentString& ss1);
72 
73  void checkInteriorIntersections(
74  const SegmentString& e0, size_t segIndex0,
75  const SegmentString& e1, size_t segIndex1);
76 
81  void checkEndPtVertexIntersections() const;
82 
83  void checkEndPtVertexIntersections(const geom::Coordinate& testPt,
84  const std::vector<SegmentString*>& segStrings) const;
85 
90  bool hasInteriorIntersection(const algorithm::LineIntersector& aLi,
91  const geom::Coordinate& p0, const geom::Coordinate& p1) const;
92 
93  // Declare type as noncopyable
94  NodingValidator(const NodingValidator& other) = delete;
95  NodingValidator& operator=(const NodingValidator& rhs) = delete;
96 
97 public:
98 
99  NodingValidator(const std::vector<SegmentString*>& newSegStrings):
100  segStrings(newSegStrings)
101  {}
102 
104 
105  void checkValid();
106 
107 };
108 
109 
110 } // namespace geos.noding
111 } // namespace geos
112 
113 #endif // GEOS_NODING_NODINGVALIDATOR_H
#define GEOS_DLL
Definition: export.h:28
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:46
const std::vector< SegmentString * > & segStrings
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
NodingValidator(const std::vector< SegmentString * > &newSegStrings)
Basic namespace for all GEOS functionalities.
Validates that a collection of SegmentStrings is correctly noded. Throws a TopologyException if a nod...
algorithm::LineIntersector li