GEOS: SimpleSnapRounder.h Source File

GEOS 3.5.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

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
34 namespace geos {
35 namespace geom {
36 //class PrecisionModel;
37 }
38 namespace algorithm {
39 class LineIntersector;
40 }
41 namespace noding {
42 class SegmentString;
43 class NodedSegmentString;
44 namespace snapround {
45 class HotPixel;
46 }
47 }
48 }
49
50 namespace geos {
51 namespace noding { // geos::noding
52 namespace snapround { // geos::noding::snapround
53
73 class GEOS_DLL SimpleSnapRounder: public Noder { // implements NoderIface
74
75 public:
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
94 private:
95
96 const geom::PrecisionModel& pm;
97 algorithm::LineIntersector li;
98 double scaleFactor;
99 std::vector<SegmentString*>* nodedSegStrings;
100
101 void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings);
102
103 void snapRound(std::vector<SegmentString*>* segStrings,
104 algorithm::LineIntersector& li);
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
135 void computeVertexSnaps(NodedSegmentString* e0, NodedSegmentString* e1);
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
geos::noding::snapround::SimpleSnapRounder
Uses Snap Rounding to compute a rounded, fully noded arrangement from a set of SegmentStrings.
Definition: SimpleSnapRounder.h:73
geos::noding::SegmentString
An interface for classes which represent a sequence of contiguous line segments.
Definition: SegmentString.h:46
geos::noding::NodedSegmentString
Represents a list of contiguous line segments, and supports noding the segments.
Definition: NodedSegmentString.h:57
geos::geom::PrecisionModel
Specifies the precision model of the Coordinate in a Geometry.
Definition: PrecisionModel.h:87
geos::algorithm::LineIntersector
A LineIntersector is an algorithm that can both test whether two line segments intersect and compute ...
Definition: LineIntersector.h:49
geos
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
geos::noding::Noder
Computes all intersections between segments in a set of SegmentString.
Definition: Noder.h:49