GEOS 3.6.2
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 {
35 namespace geom {
36 //class PrecisionModel;
37 }
38 namespace algorithm {
39 class LineIntersector;
40 }
41 namespace noding {
42 class SegmentString;
44 namespace snapround {
45 class 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
77 SimpleSnapRounder(const geom::PrecisionModel& newPm);
78
79 std::vector<SegmentString*>* getNodedSubstrings() const;
80
81 void computeNodes(std::vector<SegmentString*>* inputSegmentStrings);
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
125 void computeSnaps(const std::vector<SegmentString*>& segStrings,
126 std::vector<geom::Coordinate>& snapPts);
127
128 void computeSnaps(NodedSegmentString* ss, std::vector<geom::Coordinate>& snapPts);
129
136
137 // Declare type as noncopyable
138 SimpleSnapRounder(const SimpleSnapRounder& other);
139 SimpleSnapRounder& operator=(const SimpleSnapRounder& rhs);
140};
141
142} // namespace geos::noding::snapround
143} // namespace geos::noding
144} // namespace geos
145
146#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:58
An interface for classes which represent a sequence of contiguous line segments.
Definition SegmentString.h:46
Implements a "hot pixel" as used in the Snap Rounding algorithm.
Definition HotPixel.h:62
void computeNodes(std::vector< SegmentString * > *inputSegmentStrings)
Computes the noding for a collection of SegmentStrings.
void computeVertexSnaps(const std::vector< SegmentString * > &edges)
std::vector< SegmentString * > * getNodedSubstrings() const
Returns a Collection of fully noded SegmentStrings. The SegmentStrings have the same context as their...
Contains classes and interfaces implementing fundamental computational geometry algorithms.
Definition Angle.h:33
Contains the Geometry interface hierarchy and supporting classes.
Definition IndexedNestedRingTester.h:26
Contains classes to implement the Snap Rounding algorithm for noding linestrings.
Definition HotPixel.h:49
Classes to compute nodings for arrangements of line segments and line segment sequences.
Definition PreparedLineString.h:27
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:25