GEOS 3.3.4

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

- File List

SimpleSnapRounder.h
1 /**********************************************************************
2 * $Id: SimpleSnapRounder.h 3239 2011-02-23 14:37:29Z strk $
3 *
4 * GEOS - Geometry Engine Open Source
5 * http://geos.refractions.net
6 *
7 * Copyright (C) 2006 Refractions Research Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 **********************************************************************
15 *
16 * Last port: noding/snapround/SimpleSnapRounder.java r320 (JTS-1.12)
17 *
18 **********************************************************************/
19
20 #ifndef GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H
21 #define GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H
22
23 #include <geos/export.h>
24
25 #include <vector>
26
27 #include <geos/inline.h>
28
29 #include <geos/noding/Noder.h> // for inheritance
30 #include <geos/algorithm/LineIntersector.h> // for composition
31 #include <geos/geom/Coordinate.h> // for use in vector
32 #include <geos/geom/PrecisionModel.h> // for inlines (should drop)
33
34 // Forward declarations
35 namespace geos {
36 namespace geom {
37 //class PrecisionModel;
38 }
39 namespace algorithm {
40 class LineIntersector;
41 }
42 namespace noding {
43 class SegmentString;
44 class NodedSegmentString;
45 namespace snapround {
46 class HotPixel;
47 }
48 }
49 }
50
51 namespace geos {
52 namespace noding { // geos::noding
53 namespace snapround { // geos::noding::snapround
54
74 class GEOS_DLL SimpleSnapRounder: public Noder { // implements NoderIface
75
76 public:
77
78 SimpleSnapRounder(const geom::PrecisionModel& newPm);
79
80 std::vector<SegmentString*>* getNodedSubstrings() const;
81
82 void computeNodes(std::vector<SegmentString*>* inputSegmentStrings);
83
84 void add(const SegmentString* segStr);
85
93 void computeVertexSnaps(const std::vector<SegmentString*>& edges);
94
95 private:
96
97 const geom::PrecisionModel& pm;
98 algorithm::LineIntersector li;
99 double scaleFactor;
100 std::vector<SegmentString*>* nodedSegStrings;
101
102 void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings);
103
104 void snapRound(std::vector<SegmentString*>* segStrings,
105 algorithm::LineIntersector& li);
106
118 void findInteriorIntersections(std::vector<SegmentString*>& segStrings,
119 algorithm::LineIntersector& li, std::vector<geom::Coordinate>& ret);
120
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);
140 SimpleSnapRounder& operator=(const SimpleSnapRounder& rhs);
141 };
142
143 } // namespace geos::noding::snapround
144 } // namespace geos::noding
145 } // namespace geos
146
147 //#ifdef GEOS_INLINE
148 //# include "geos/noding/snapround/SimpleSnapRounder.inl"
149 //#endif
150
151 #endif // GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H
152
153 /**********************************************************************
154 * $Log$
155 * Revision 1.3 2006/05/03 15:02:49 strk
156 * moved some implementations from header to .cpp file (taken out of inline)
157 *
158 * Revision 1.2 2006/03/24 09:52:41 strk
159 * USE_INLINE => GEOS_INLINE
160 *
161 * Revision 1.1 2006/03/14 12:55:56 strk
162 * Headers split: geomgraphindex.h, nodingSnapround.h
163 *
164 **********************************************************************/
165