00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H
00017 #define GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H
00018
00019 #include <vector>
00020
00021 #include <geos/inline.h>
00022
00023 #include <geos/noding/Noder.h>
00024 #include <geos/algorithm/LineIntersector.h>
00025 #include <geos/geom/Coordinate.h>
00026 #include <geos/geom/PrecisionModel.h>
00027
00028
00029 namespace geos {
00030 namespace geom {
00031
00032 }
00033 namespace algorithm {
00034 class LineIntersector;
00035 }
00036 namespace noding {
00037 class SegmentString;
00038 namespace snapround {
00039 class HotPixel;
00040 }
00041 }
00042 }
00043
00044 namespace geos {
00045 namespace noding {
00046 namespace snapround {
00047
00068 class SimpleSnapRounder: public Noder {
00069
00070 private:
00071 const geom::PrecisionModel& pm;
00072 algorithm::LineIntersector li;
00073 double scaleFactor;
00074 std::vector<SegmentString*>* nodedSegStrings;
00075
00076 void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings);
00077
00078 void snapRound(std::vector<SegmentString*>* segStrings,
00079 algorithm::LineIntersector& li);
00080
00092 void findInteriorIntersections(std::vector<SegmentString*>& segStrings,
00093 algorithm::LineIntersector& li, std::vector<geom::Coordinate>& ret);
00094
00100 void computeSnaps(const std::vector<SegmentString*>& segStrings,
00101 std::vector<geom::Coordinate>& snapPts);
00102
00103 void computeSnaps(SegmentString* ss, std::vector<geom::Coordinate>& snapPts);
00104
00110 void computeVertexSnaps(SegmentString* e0, SegmentString* e1);
00111
00112 public:
00113
00114 SimpleSnapRounder(const geom::PrecisionModel& newPm);
00115
00116 std::vector<SegmentString*>* getNodedSubstrings() const;
00117
00118 void computeNodes(std::vector<SegmentString*>* inputSegmentStrings);
00119
00120 void add(const SegmentString* segStr);
00121
00131 static bool addSnappedNode(const HotPixel& hotPix,
00132 SegmentString& segStr,
00133 unsigned int segIndex);
00134
00141 void computeVertexSnaps(const std::vector<SegmentString*>& edges);
00142 };
00143
00144 }
00145 }
00146 }
00147
00148
00149
00150
00151
00152 #endif // GEOS_NODING_SNAPROUND_SIMPLESNAPROUNDER_H
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166