GEOS 3.9.1
SnapRoundingNoder.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2006 Refractions Research Inc.
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 * Last port: noding/snapround/SnapRoundingNoder.java r320 (JTS-1.12)
16 *
17 **********************************************************************/
18
19#pragma once
20
21#include <geos/export.h>
22
23#include <geos/geom/Coordinate.h>
24#include <geos/geom/Envelope.h>
25#include <geos/noding/snapround/HotPixelIndex.h>
26#include <geos/noding/Noder.h>
27
28
29// Forward declarations
30namespace geos {
31namespace geom {
32class Envelope;
33class PrecisionModel;
34}
35namespace noding {
36class NodedSegmentString;
37}
38}
39
40namespace geos {
41namespace noding { // geos::noding
42namespace snapround { // geos::noding::snapround
43
71class GEOS_DLL SnapRoundingNoder : public Noder {
72
73private:
74
75 // Members
76 const geom::PrecisionModel* pm;
77 noding::snapround::HotPixelIndex pixelIndex;
78 std::vector<SegmentString*> snappedResult;
79
80 // Methods
81 void snapRound(std::vector<SegmentString*>& inputSegStrings, std::vector<SegmentString*>& resultNodedSegments);
82
90 void addVertexPixels(std::vector<SegmentString*>& segStrings);
91
97 void addIntersectionPixels(std::vector<SegmentString*>& segStrings);
98
99 void round(const geom::Coordinate& pt, geom::Coordinate& ptOut);
100
108 std::unique_ptr<std::vector<geom::Coordinate>> round(const std::vector<geom::Coordinate>& pts);
109
117 void computeSnaps(const std::vector<SegmentString*>& segStrings, std::vector<SegmentString*>& snapped);
118 NodedSegmentString* computeSegmentSnaps(NodedSegmentString* ss);
119
128 void snapSegment(geom::Coordinate& p0, geom::Coordinate& p1, NodedSegmentString* ss, size_t segIndex);
129
134 void addVertexNodeSnaps(NodedSegmentString* ss);
135
136 void snapVertexNode(const geom::Coordinate& p0, NodedSegmentString* ss, size_t segIndex);
137
138public:
139
141 : pm(p_pm)
142 , pixelIndex(p_pm)
143 {}
144
148 std::vector<SegmentString*>* getNodedSubstrings() const override;
149
154 void computeNodes(std::vector<SegmentString*>* inputSegStrings) override; //override
155
156};
157
158
159} // namespace geos::noding::snapround
160} // namespace geos::noding
161} // namespace geos
162
163
164
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
Represents a list of contiguous line segments, and supports noding the segments.
Definition NodedSegmentString.h:57
Computes all intersections between segments in a set of SegmentString.
Definition Noder.h:49
Definition SnapRoundingNoder.h:71
void computeNodes(std::vector< SegmentString * > *inputSegStrings) override
std::vector< SegmentString * > * getNodedSubstrings() const override
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26