GEOS  3.13.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
21 namespace geos {
22 namespace geom {
23 class Coordinate;
24 }
25 namespace noding {
26 class SegmentString;
27 }
28 namespace coverage {
29 class CoverageRing;
30 }
31 }
32 
33 
37 
38 
39 namespace geos { // geos.
40 namespace coverage { // geos.coverage
41 
55 class GEOS_DLL InvalidSegmentDetector : public SegmentIntersector {
56 
57 private:
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 
100 public:
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:216
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: Angle.h:25