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 li.setPrecisionModel(&pm);
00086 }
00087
00088 std::vector<SegmentString*>* getNodedSubstrings() const {
00089 return NodedSegmentString::getNodedSubstrings(*nodedSegStrings);
00090 }
00091
00092 void computeNodes(std::vector<SegmentString*>* segStrings);
00093
00102 void computeVertexSnaps(std::vector<SegmentString*>& edges);
00103
00104 private:
00105
00107 geom::PrecisionModel& pm;
00108
00109 algorithm::LineIntersector li;
00110
00111 double scaleFactor;
00112
00113 std::vector<SegmentString*>* nodedSegStrings;
00114
00115 std::auto_ptr<MCIndexPointSnapper> pointSnapper;
00116
00117 void snapRound(MCIndexNoder& noder, std::vector<SegmentString*>* segStrings);
00118
00119
00127 void findInteriorIntersections(MCIndexNoder& noder,
00128 std::vector<SegmentString*>* segStrings,
00129 std::vector<geom::Coordinate>& intersections);
00130
00135 void computeIntersectionSnaps(std::vector<geom::Coordinate>& snapPts);
00136
00141 void computeVertexSnaps(NodedSegmentString* e);
00142
00143 void checkCorrectness(std::vector<SegmentString*>& inputSegmentStrings);
00144
00145
00146 MCIndexSnapRounder(const MCIndexSnapRounder& other);
00147 MCIndexSnapRounder& operator=(const MCIndexSnapRounder& rhs);
00148 };
00149
00150 }
00151 }
00152 }
00153
00154 #ifdef _MSC_VER
00155 #pragma warning(pop)
00156 #endif
00157
00158 #endif // GEOS_NODING_SNAPROUND_MCINDEXSNAPROUNDER_H
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169