GEOS 3.9.1
SnapRoundingIntersectionAdder.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#include <memory>
21
22#include <geos/inline.h>
23
24#include <geos/noding/Noder.h> // for inheritance
25#include <geos/algorithm/LineIntersector.h> // for composition
26#include <geos/geom/Coordinate.h> // for use in vector
27#include <geos/geom/PrecisionModel.h> // for inlines (should drop)
28#include <geos/noding/SegmentIntersector.h>
29
30
31// Forward declarations
32namespace geos {
33namespace geom {
34class PrecisionModel;
35}
36namespace noding {
37class SegmentString;
38class NodedSegmentString;
39namespace snapround {
40class HotPixel;
41}
42}
43}
44
45namespace geos {
46namespace noding { // geos::noding
47namespace snapround { // geos::noding::snapround
48
65class GEOS_DLL SnapRoundingIntersectionAdder: public SegmentIntersector { // implements SegmentIntersector
66
67private:
72 static constexpr int NEARNESS_FACTOR = 100;
73
75 std::unique_ptr<std::vector<geom::Coordinate>> intersections;
76 // const geom::PrecisionModel* pm;
77 double nearnessTol;
78
92 void processNearVertex(const geom::Coordinate& p, SegmentString* edge, size_t segIndex,
93 const geom::Coordinate& p0, const geom::Coordinate& p1);
94
95
96public:
97
99
100 std::unique_ptr<std::vector<geom::Coordinate>> getIntersections() { return std::move(intersections); };
101
110 void processIntersections(SegmentString* e0, size_t segIndex0, SegmentString* e1, size_t segIndex1) override;
111
116 bool isDone() const override { return false; }
117
118
119};
120
121} // namespace geos::noding::snapround
122} // namespace geos::noding
123} // namespace geos
124
125
126
127
128
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
Specifies the precision model of the Coordinate in a Geometry.
Definition: PrecisionModel.h:87
Processes possible intersections detected by a Noder.
Definition: noding/SegmentIntersector.h:48
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:46
Definition: SnapRoundingIntersectionAdder.h:65
bool isDone() const override
Definition: SnapRoundingIntersectionAdder.h:116
void processIntersections(SegmentString *e0, size_t segIndex0, SegmentString *e1, size_t segIndex1) override
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26