00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GEOS_NODING_ITERATEDNODER_H
00017 #define GEOS_NODING_ITERATEDNODER_H
00018
00019 #include <vector>
00020 #include <iostream>
00021
00022 #include <geos/inline.h>
00023
00024 #include <geos/algorithm/LineIntersector.h>
00025 #include <geos/noding/SegmentString.h>
00026 #include <geos/noding/Noder.h>
00027
00028
00029 namespace geos {
00030 namespace geom {
00031 class PrecisionModel;
00032 }
00033 }
00034
00035 namespace geos {
00036 namespace noding {
00037
00050 class IteratedNoder : public Noder {
00051
00052 private:
00053 static const int MAX_ITER = 5;
00054
00055
00056 const geom::PrecisionModel *pm;
00057 algorithm::LineIntersector li;
00058 std::vector<SegmentString*>* nodedSegStrings;
00059 int maxIter;
00060
00065 void node(std::vector<SegmentString*>* segStrings,
00066 int *numInteriorIntersections);
00067
00068 public:
00069
00070 IteratedNoder(const geom::PrecisionModel *newPm)
00071 :
00072 pm(newPm),
00073 li(pm),
00074 maxIter(MAX_ITER)
00075 {
00076 }
00077
00078 virtual ~IteratedNoder() {}
00079
00089 void setMaximumIterations(int n) { maxIter = n; }
00090
00091 std::vector<SegmentString*>* getNodedSubstrings() const {
00092 return SegmentString::getNodedSubstrings(*nodedSegStrings);
00093 }
00094
00095
00105 void computeNodes(std::vector<SegmentString*>* inputSegmentStrings);
00106 };
00107
00108 }
00109 }
00110
00111
00112
00113
00114
00115
00116 #endif // GEOS_NODING_ITERATEDNODER_H
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127