00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H
00021 #define GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H
00022
00023 #include <geos/export.h>
00024
00025 #include <vector>
00026
00027 #include <geos/inline.h>
00028
00029 #include <geos/noding/Noder.h>
00030 #include <geos/algorithm/LineIntersector.h>
00031 #include <geos/geom/Coordinate.h>
00032 #include <geos/geom/PrecisionModel.h>
00033
00034
00035 namespace geos {
00036 namespace geom {
00037
00038 }
00039 namespace algorithm {
00040 class LineIntersector;
00041 }
00042 namespace noding {
00043 class SegmentString;
00044 class NodedSegmentString;
00045 namespace snapround {
00046 class HotPixel;
00047 }
00048 }
00049 }
00050
00051 namespace geos {
00052 namespace noding {
00053 namespace snapround {
00054
00073 class GEOS_DLL SimpleSnapRounder: public Noder {
00074
00075 public:
00076
00077 SimpleSnapRounder(const geom::PrecisionModel& newPm);
00078
00079 std::vector<SegmentString*>* getNodedSubstrings() const;
00080
00081 void computeNodes(std::vector<SegmentString*>* inputSegmentStrings);
00082
00083 void add(const SegmentString* segStr);
00084
00092 void computeVertexSnaps(const std::vector<SegmentString*>& edges);
00093
00094 private:
00095
00096 const geom::PrecisionModel& pm;
00097 algorithm::LineIntersector li;
00098 double scaleFactor;
00099 std::vector<SegmentString*>* nodedSegStrings;
00100
00101 void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings);
00102
00103 void snapRound(std::vector<SegmentString*>* segStrings,
00104 algorithm::LineIntersector& li);
00105
00117 void findInteriorIntersections(std::vector<SegmentString*>& segStrings,
00118 algorithm::LineIntersector& li, std::vector<geom::Coordinate>& ret);
00119
00125 void computeSnaps(const std::vector<SegmentString*>& segStrings,
00126 std::vector<geom::Coordinate>& snapPts);
00127
00128 void computeSnaps(NodedSegmentString* ss, std::vector<geom::Coordinate>& snapPts);
00129
00135 void computeVertexSnaps(NodedSegmentString* e0, NodedSegmentString* e1);
00136
00137
00138 SimpleSnapRounder(const SimpleSnapRounder& other);
00139 SimpleSnapRounder& operator=(const SimpleSnapRounder& rhs);
00140 };
00141
00142 }
00143 }
00144 }
00145
00146
00147
00148
00149
00150 #endif // GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164