20 #ifndef GEOS_NODING_MCINDEXSEGMENTSETMUTUALINTERSECTOR_H
21 #define GEOS_NODING_MCINDEXSEGMENTSETMUTUALINTERSECTOR_H
23 #include <geos/noding/SegmentSetMutualIntersector.h>
24 #include <geos/index/chain/MonotoneChainOverlapAction.h>
39 class SegmentIntersector;
55 class MCIndexSegmentSetMutualIntersector :
public SegmentSetMutualIntersector {
58 MCIndexSegmentSetMutualIntersector();
60 ~MCIndexSegmentSetMutualIntersector()
override;
71 void process(SegmentString::ConstVect* segStrings)
override;
73 class SegmentOverlapAction :
public index::chain::MonotoneChainOverlapAction {
75 SegmentIntersector& si;
78 SegmentOverlapAction(
const SegmentOverlapAction& other) =
delete;
79 SegmentOverlapAction& operator=(
const SegmentOverlapAction& rhs) =
delete;
82 SegmentOverlapAction(SegmentIntersector& p_si) :
83 index::chain::MonotoneChainOverlapAction(), si(p_si)
86 void overlap(index::chain::MonotoneChain& mc1, std::size_t start1,
87 index::chain::MonotoneChain& mc2, std::size_t start2)
override;
94 MCIndexSegmentSetMutualIntersector(
const MCIndexSegmentSetMutualIntersector&) =
delete;
95 MCIndexSegmentSetMutualIntersector& operator=(
const MCIndexSegmentSetMutualIntersector&) =
delete;
99 typedef std::vector<std::unique_ptr<index::chain::MonotoneChain>> MonoChains;
100 MonoChains monoChains;
107 index::SpatialIndex* index;
116 MonoChains chainStore;
118 void addToIndex(SegmentString* segStr);
120 void intersectChains();
122 void addToMonoChains(SegmentString* segStr);
129 #endif // GEOS_NODING_MCINDEXSEGMENTSETMUTUALINTERSECTOR_H