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 public:
00080
00081 MCIndexSnapRounder(geom::PrecisionModel& nPm);
00082
00083 std::vector<SegmentString*>* getNodedSubstrings() const;
00084
00085 void computeNodes(std::vector<SegmentString*>* segStrings);
00086
00095 void computeVertexSnaps(std::vector<SegmentString*>& edges);
00096
00097 private:
00098
00100 geom::PrecisionModel& pm;
00101
00102 algorithm::LineIntersector li;
00103
00104 double scaleFactor;
00105
00106 std::vector<SegmentString*>* nodedSegStrings;
00107
00108 std::auto_ptr<MCIndexPointSnapper> pointSnapper;
00109
00110 void snapRound(MCIndexNoder& noder, std::vector<SegmentString*>* segStrings);
00111
00112
00120 void findInteriorIntersections(MCIndexNoder& noder,
00121 std::vector<SegmentString*>* segStrings,
00122 std::vector<geom::Coordinate>& intersections);
00123
00128 void computeIntersectionSnaps(std::vector<geom::Coordinate>& snapPts);
00129
00134 void computeVertexSnaps(NodedSegmentString* e);
00135
00136 void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings);
00137
00138
00139 MCIndexSnapRounder(const MCIndexSnapRounder& other);
00140 MCIndexSnapRounder& operator=(const MCIndexSnapRounder& rhs);
00141 };
00142
00143
00144 }
00145 }
00146 }
00147
00148 #ifdef GEOS_INLINE
00149 # include <geos/noding/snapround/MCIndexSnapRounder.inl>
00150 #endif
00151
00152 #endif // GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163