GEOS 3.8.1
SimpleSnapRounder.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/SimpleSnapRounder.java r320 (JTS-1.12)
16 *
17 **********************************************************************/
18
19#ifndef GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H
20#define GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H
21
22#include <geos/export.h>
23
24#include <vector>
25
26#include <geos/inline.h>
27
28#include <geos/noding/Noder.h> // for inheritance
29#include <geos/algorithm/LineIntersector.h> // for composition
30#include <geos/geom/Coordinate.h> // for use in vector
31#include <geos/geom/PrecisionModel.h> // for inlines (should drop)
32
33// Forward declarations
34namespace geos {
35namespace geom {
36//class PrecisionModel;
37}
38namespace algorithm {
39class LineIntersector;
40}
41namespace noding {
42class SegmentString;
43class NodedSegmentString;
44namespace snapround {
45class HotPixel;
46}
47}
48}
49
50namespace geos {
51namespace noding { // geos::noding
52namespace snapround { // geos::noding::snapround
53
73class GEOS_DLL SimpleSnapRounder: public Noder { // implements NoderIface
74
75public:
76
78
79 std::vector<SegmentString*>* getNodedSubstrings() const override;
80
81 void computeNodes(std::vector<SegmentString*>* inputSegmentStrings) override;
82
83 void add(const SegmentString* segStr);
84
92 void computeVertexSnaps(const std::vector<SegmentString*>& edges);
93
94private:
95
96 const geom::PrecisionModel& pm;
98 double scaleFactor;
99 std::vector<SegmentString*>* nodedSegStrings;
100
101 void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings);
102
103 void snapRound(std::vector<SegmentString*>* segStrings,
105
117 void findInteriorIntersections(std::vector<SegmentString*>& segStrings,
118 algorithm::LineIntersector& li, std::vector<geom::Coordinate>& ret);
119
126 void computeSnaps(const std::vector<SegmentString*>& segStrings,
127 std::vector<geom::Coordinate>& snapPts);
128
129 void computeSnaps(NodedSegmentString* ss, std::vector<geom::Coordinate>& snapPts);
130
136 void computeVertexSnaps(NodedSegmentString* e0, NodedSegmentString* e1);
137
138 // Declare type as noncopyable
139 SimpleSnapRounder(const SimpleSnapRounder& other) = delete;
140 SimpleSnapRounder& operator=(const SimpleSnapRounder& rhs) = delete;
141};
142
143} // namespace geos::noding::snapround
144} // namespace geos::noding
145} // namespace geos
146
147#endif // GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:49
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
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:46
Uses Snap Rounding to compute a rounded, fully noded arrangement from a set of SegmentStrings.
Definition: SimpleSnapRounder.h:73
std::vector< SegmentString * > * getNodedSubstrings() const override
Returns a collection of fully noded SegmentStrings. The SegmentStrings have the same context as their...
void computeNodes(std::vector< SegmentString * > *inputSegmentStrings) override
Computes the noding for a collection of SegmentStrings.
void computeVertexSnaps(const std::vector< SegmentString * > &edges)
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25