GEOS 3.9.1
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
29namespace geos {
30namespace geom {
31class Coordinate;
32}
33namespace noding {
34class SegmentString;
35}
36}
37
38namespace geos {
39namespace noding { // geos.noding
40
48class GEOS_DLL NodingValidator {
49private:
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
97public:
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
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition LineIntersector.h:49
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
Validates that a collection of SegmentStrings is correctly noded. Throws a TopologyException if a nod...
Definition NodingValidator.h:48
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:46
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26