GEOS 3.14.0dev
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
33namespace geos { // geos.
34namespace coverage { // geos.coverage
35
52
53private:
54
55 // Members
56 double distanceTol;
57
58 // Methods
59 bool isInvalid(const Coordinate& tgt0, const Coordinate& tgt1,
60 const Coordinate& adj0, const Coordinate& adj1,
61 CoverageRing* adj, std::size_t indexAdj);
62
63 bool isEqual(
64 const Coordinate& t0, const Coordinate& t1,
65 const Coordinate& adj0, const Coordinate& adj1);
66
80 bool isCollinearOrInterior(
81 const Coordinate& tgt0, const Coordinate& tgt1,
82 const Coordinate& adj0, const Coordinate& adj1,
83 CoverageRing* adj, std::size_t indexAdj);
84
85 bool isInteriorSegment(
86 const Coordinate& intVertex,
87 const Coordinate& tgt0, const Coordinate& tgt1,
88 CoverageRing* adj, std::size_t indexAdj);
89
90 static bool isNearlyParallel(
91 const Coordinate& p00, const Coordinate& p01,
92 const Coordinate& p10, const Coordinate& p11,
93 double distanceTol);
94
95
96public:
97
102
103 InvalidSegmentDetector(double p_distanceTol)
104 : distanceTol(p_distanceTol) {};
105
106
107 bool isDone() const override {
108 // process all intersections
109 return false;
110 };
111
119 SegmentString* ssAdj, std::size_t iAdj,
120 SegmentString* ssTarget, std::size_t iTarget) override;
121
122
123
124};
125
126} // namespace geos.coverage
127} // namespace geos
128
129
Definition InvalidSegmentDetector.h:49
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:107
InvalidSegmentDetector()
Definition InvalidSegmentDetector.h:101
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