00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
00017 #define GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_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
00027
00028 namespace geos {
00029 namespace geom {
00030 class PrecisionModel;
00031 }
00032 namespace algorithm {
00033 class LineIntersector;
00034 }
00035 namespace noding {
00036 class SegmentString;
00037 class MCIndexNoder;
00038 namespace snapround {
00039
00040 class MCIndexPointSnapper;
00041 }
00042 }
00043 }
00044
00045 namespace geos {
00046 namespace noding {
00047 namespace snapround {
00048
00049
00073 class MCIndexSnapRounder: public Noder {
00074
00075 private:
00076
00078 geom::PrecisionModel& pm;
00079
00080 algorithm::LineIntersector li;
00081
00082 double scaleFactor;
00083
00084 std::vector<SegmentString*>* nodedSegStrings;
00085
00086 std::auto_ptr<MCIndexPointSnapper> pointSnapper;
00087
00088 void snapRound(MCIndexNoder& noder, std::vector<SegmentString*>* segStrings);
00089
00090
00098 void findInteriorIntersections(MCIndexNoder& noder,
00099 std::vector<SegmentString*>* segStrings,
00100 std::vector<geom::Coordinate>& intersections);
00101
00106 void computeIntersectionSnaps(std::vector<geom::Coordinate>& snapPts);
00107
00112 void computeEdgeVertexSnaps(SegmentString* e);
00113
00114 void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings);
00115
00116 public:
00117
00118 MCIndexSnapRounder(geom::PrecisionModel& nPm);
00119
00120 std::vector<SegmentString*>* getNodedSubstrings() const;
00121
00122 void computeNodes(std::vector<SegmentString*>* segStrings);
00123
00130 void computeVertexSnaps(std::vector<SegmentString*>& edges);
00131
00132 };
00133
00134
00135 }
00136 }
00137 }
00138
00139 #ifdef GEOS_INLINE
00140 # include <geos/noding/snapround/MCIndexSnapRounder.inl>
00141 #endif
00142
00143 #endif // GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154