GEOS  3.9.1dev
SnapRoundingIntersectionAdder.h
Go to the documentation of this file.
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)
29 
30 
31 // Forward declarations
32 namespace geos {
33 namespace geom {
34 class PrecisionModel;
35 }
36 namespace noding {
37 class SegmentString;
38 class NodedSegmentString;
39 namespace snapround {
40 class HotPixel;
41 }
42 }
43 }
44 
45 namespace geos {
46 namespace noding { // geos::noding
47 namespace snapround { // geos::noding::snapround
48 
65 class GEOS_DLL SnapRoundingIntersectionAdder: public SegmentIntersector { // implements SegmentIntersector
66 
67 private:
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 
96 public:
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 
#define GEOS_DLL
Definition: export.h:28
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:60
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:46
Specifies the precision model of the Coordinate in a Geometry.
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Basic namespace for all GEOS functionalities.
Processes possible intersections detected by a Noder.
std::unique_ptr< std::vector< geom::Coordinate > > intersections
std::unique_ptr< std::vector< geom::Coordinate > > getIntersections()