GEOS 3.4.2

- 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