00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
00021 #define GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_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
00033
00034 namespace geos {
00035 namespace geom {
00036 class PrecisionModel;
00037 }
00038 namespace algorithm {
00039 class LineIntersector;
00040 }
00041 namespace noding {
00042 class SegmentString;
00043 class NodedSegmentString;
00044 class MCIndexNoder;
00045 namespace snapround {
00046
00047 class MCIndexPointSnapper;
00048 }
00049 }
00050 }
00051
00052 namespace geos {
00053 namespace noding {
00054 namespace snapround {
00055
00056
00077 class GEOS_DLL MCIndexSnapRounder: public Noder {
00078
00079 private:
00080
00082 geom::PrecisionModel& pm;
00083
00084 algorithm::LineIntersector li;
00085
00086 double scaleFactor;
00087
00088 std::vector<SegmentString*>* nodedSegStrings;
00089
00090 std::auto_ptr<MCIndexPointSnapper> pointSnapper;
00091
00092 void snapRound(MCIndexNoder& noder, std::vector<SegmentString*>* segStrings);
00093
00094
00102 void findInteriorIntersections(MCIndexNoder& noder,
00103 std::vector<SegmentString*>* segStrings,
00104 std::vector<geom::Coordinate>& intersections);
00105
00110 void computeIntersectionSnaps(std::vector<geom::Coordinate>& snapPts);
00111
00116 void computeVertexSnaps(NodedSegmentString* e);
00117
00118 void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings);
00119
00120 public:
00121
00122 MCIndexSnapRounder(geom::PrecisionModel& nPm);
00123
00124 std::vector<SegmentString*>* getNodedSubstrings() const;
00125
00126 void computeNodes(std::vector<SegmentString*>* segStrings);
00127
00136 void computeVertexSnaps(std::vector<SegmentString*>& edges);
00137
00138 };
00139
00140
00141 }
00142 }
00143 }
00144
00145 #ifdef GEOS_INLINE
00146 # include <geos/noding/snapround/MCIndexSnapRounder.inl>
00147 #endif
00148
00149 #endif // GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160