GEOS 3.14.0dev
SnappingIntersectionAdder.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2020 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#include <geos/export.h>
18
19#include <vector>
20
21#include <geos/algorithm/LineIntersector.h> // for composition
22#include <geos/geom/Coordinate.h> // for use in vector
23#include <geos/geom/PrecisionModel.h> // for inlines (should drop)
24#include <geos/noding/SegmentIntersector.h>
25
26
27// Forward declarations
28namespace geos {
29namespace geom {
30class PrecisionModel;
31}
32namespace noding {
33class SegmentString;
34class NodedSegmentString;
35namespace snap {
36class SnappingPointIndex;
37}
38}
39}
40
41namespace geos {
42namespace noding { // geos::noding
43namespace snap { // geos::noding::snap
44
45class GEOS_DLL SnappingIntersectionAdder: public SegmentIntersector { // implements SegmentIntersector
46
47private:
48
49 algorithm::LineIntersector li;
50 double snapTolerance;
51 SnappingPointIndex& snapPointIndex;
52
66 void processNearVertex(
67 SegmentString* srcSS,
68 std::size_t srcIndex,
69 const geom::Coordinate& p,
70 SegmentString* ss,
71 std::size_t segIndex,
72 const geom::Coordinate& p0,
73 const geom::Coordinate& p1);
74
80 static bool isAdjacent(SegmentString* ss0, std::size_t segIndex0, SegmentString* ss1, std::size_t segIndex1);
81
82
83public:
84
85 SnappingIntersectionAdder(double p_snapTolerance, SnappingPointIndex& p_snapPointIndex);
86
95 void processIntersections(SegmentString* e0, std::size_t segIndex0, SegmentString* e1, std::size_t segIndex1) override;
96
97 bool isDone() const override { return false; };
98
99
100};
101
102} // namespace geos::noding::snapround
103} // namespace geos::noding
104} // namespace geos
105
106
107
108
109
Basic namespace for all GEOS functionalities.
Definition geos.h:39