00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEOS_NODING_MCINDEXNODER_H
00021 #define GEOS_NODING_MCINDEXNODER_H
00022
00023 #include <geos/export.h>
00024
00025 #include <geos/inline.h>
00026
00027 #include <geos/index/chain/MonotoneChainOverlapAction.h>
00028 #include <geos/noding/SinglePassNoder.h>
00029 #include <geos/index/strtree/STRtree.h>
00030 #include <geos/util.h>
00031
00032 #include <vector>
00033 #include <iostream>
00034
00035
00036 namespace geos {
00037 namespace geom {
00038 class LineSegment;
00039 }
00040 namespace noding {
00041 class SegmentString;
00042 class SegmentIntersector;
00043 }
00044 }
00045
00046 namespace geos {
00047 namespace noding {
00048
00059 class GEOS_DLL MCIndexNoder : public SinglePassNoder {
00060
00061 private:
00062 std::vector<index::chain::MonotoneChain*> monoChains;
00063 index::strtree::STRtree index;
00064 int idCounter;
00065 std::vector<SegmentString*>* nodedSegStrings;
00066
00067 int nOverlaps;
00068
00069 void intersectChains();
00070
00071 void add(SegmentString* segStr);
00072
00073 public:
00074
00075 MCIndexNoder(SegmentIntersector *nSegInt=NULL)
00076 :
00077 SinglePassNoder(nSegInt),
00078 idCounter(0),
00079 nodedSegStrings(NULL),
00080 nOverlaps(0)
00081 {}
00082
00083 ~MCIndexNoder();
00084
00086 std::vector<index::chain::MonotoneChain*>& getMonotoneChains() { return monoChains; }
00087
00088 index::SpatialIndex& getIndex();
00089
00090 std::vector<SegmentString*>* getNodedSubstrings() const;
00091
00092 void computeNodes(std::vector<SegmentString*>* inputSegmentStrings);
00093
00094 class SegmentOverlapAction : public index::chain::MonotoneChainOverlapAction {
00095 private:
00096 SegmentIntersector& si;
00097 public:
00098 SegmentOverlapAction(SegmentIntersector& newSi)
00099 :
00100 index::chain::MonotoneChainOverlapAction(),
00101 si(newSi)
00102 {}
00103
00104 void overlap(index::chain::MonotoneChain& mc1, size_t start1,
00105 index::chain::MonotoneChain& mc2, size_t start2);
00106
00107 };
00108
00109 };
00110
00111 }
00112 }
00113
00114 #ifdef GEOS_INLINE
00115 # include <geos/noding/MCIndexNoder.inl>
00116 #endif
00117
00118 #endif // GEOS_NODING_MCINDEXNODER_H
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135