GEOS 3.13.1
InvalidSegmentDetector.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2022 Paul Ramsey <pramsey@cleverelephant.ca>
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#pragma once
16
17
18#include <geos/noding/SegmentIntersector.h>
19
20// Forward declarations
21namespace geos {
22namespace geom {
23class Coordinate;
24}
25namespace noding {
26class SegmentString;
27}
28namespace coverage {
29class CoverageRing;
30}
31}
32
33
37
38
39namespace geos { // geos.
40namespace coverage { // geos.coverage
41
56
57private:
58
59 // Members
60 double distanceTol;
61
62 // Methods
63 bool isInvalid(const Coordinate& tgt0, const Coordinate& tgt1,
64 const Coordinate& adj0, const Coordinate& adj1,
65 CoverageRing* adj, std::size_t indexAdj);
66
67 bool isEqual(
68 const Coordinate& t0, const Coordinate& t1,
69 const Coordinate& adj0, const Coordinate& adj1);
70
84 bool isCollinearOrInterior(
85 const Coordinate& tgt0, const Coordinate& tgt1,
86 const Coordinate& adj0, const Coordinate& adj1,
87 CoverageRing* adj, std::size_t indexAdj);
88
89 bool isInteriorSegment(
90 const Coordinate& intVertex,
91 const Coordinate& tgt0, const Coordinate& tgt1,
92 CoverageRing* adj, std::size_t indexAdj);
93
94 static bool isNearlyParallel(
95 const Coordinate& p00, const Coordinate& p01,
96 const Coordinate& p10, const Coordinate& p11,
97 double distanceTol);
98
99
100public:
101
106
107 InvalidSegmentDetector(double p_distanceTol)
108 : distanceTol(p_distanceTol) {};
109
110
111 bool isDone() const override {
112 // process all intersections
113 return false;
114 };
115
123 SegmentString* ssAdj, std::size_t iAdj,
124 SegmentString* ssTarget, std::size_t iTarget) override;
125
126
127
128};
129
130} // namespace geos.coverage
131} // namespace geos
132
133
Definition InvalidSegmentDetector.h:55
void processIntersections(SegmentString *ssAdj, std::size_t iAdj, SegmentString *ssTarget, std::size_t iTarget) override
bool isDone() const override
Reports whether the client of this class needs to continue testing all intersections in an arrangemen...
Definition InvalidSegmentDetector.h:111
InvalidSegmentDetector()
Definition InvalidSegmentDetector.h:105
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:217
Processes possible intersections detected by a Noder.
Definition noding/SegmentIntersector.h:45
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:47
Basic namespace for all GEOS functionalities.
Definition geos.h:39