GEOS 3.4.2

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

NodingValidator.h
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
25 #include <geos/algorithm/LineIntersector.h>
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
48 class GEOS_DLL NodingValidator {
49 private:
50 algorithm::LineIntersector li;
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, unsigned int segIndex0,
75 const SegmentString& e1, unsigned int 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);
95 NodingValidator& operator=(const NodingValidator& rhs);
96
97 public:
98
99 NodingValidator(const std::vector<SegmentString*>& newSegStrings):
100 segStrings(newSegStrings)
101 {}
102
103 ~NodingValidator() {}
104
105 void checkValid();
106
107 };
108
109
110 } // namespace geos.noding
111 } // namespace geos
112
113 #endif // GEOS_NODING_NODINGVALIDATOR_H