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 <geos/noding/Noder.h>
00026 #include <geos/noding/NodedSegmentString.h>
00027 #include <geos/noding/snapround/MCIndexPointSnapper.h>
00028 #include <geos/algorithm/LineIntersector.h>
00029 #include <geos/geom/Coordinate.h>
00030 #include <geos/geom/PrecisionModel.h>
00031
00032 #include <vector>
00033
00034 #ifdef _MSC_VER
00035 #pragma warning(push)
00036 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00037 #endif
00038
00039
00040 namespace geos {
00041 namespace algorithm {
00042 class LineIntersector;
00043 }
00044 namespace noding {
00045 class SegmentString;
00046 class MCIndexNoder;
00047 }
00048 }
00049
00050 namespace geos {
00051 namespace noding {
00052 namespace snapround {
00053
00054
00075 class GEOS_DLL MCIndexSnapRounder: public Noder {
00076
00077 public:
00078
00079 MCIndexSnapRounder(geom::PrecisionModel& nPm)
00080 :
00081 pm(nPm),
00082 scaleFactor(nPm.getScale()),
00083 pointSnapper(0)
00084 {}
00085
00086 std::vector<SegmentString*>* getNodedSubstrings() const {
00087 return NodedSegmentString::getNodedSubstrings(*nodedSegStrings);
00088 }
00089
00090 void computeNodes(std::vector<SegmentString*>* segStrings);
00091
00100 void computeVertexSnaps(std::vector<SegmentString*>& edges);
00101
00102 private:
00103
00105 geom::PrecisionModel& pm;
00106
00107 algorithm::LineIntersector li;
00108
00109 double scaleFactor;
00110
00111 std::vector<SegmentString*>* nodedSegStrings;
00112
00113 std::auto_ptr<MCIndexPointSnapper> pointSnapper;
00114
00115 void snapRound(MCIndexNoder& noder, std::vector<SegmentString*>* segStrings);
00116
00117
00125 void findInteriorIntersections(MCIndexNoder& noder,
00126 std::vector<SegmentString*>* segStrings,
00127 std::vector<geom::Coordinate>& intersections);
00128
00133 void computeIntersectionSnaps(std::vector<geom::Coordinate>& snapPts);
00134
00139 void computeVertexSnaps(NodedSegmentString* e);
00140
00141 void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings);
00142
00143
00144 MCIndexSnapRounder(const MCIndexSnapRounder& other);
00145 MCIndexSnapRounder& operator=(const MCIndexSnapRounder& rhs);
00146 };
00147
00148 }
00149 }
00150 }
00151
00152 #ifdef _MSC_VER
00153 #pragma warning(pop)
00154 #endif
00155
00156 #endif // GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167