/// <summary> /// Calls <see cref="ISegmentIntersector.ProcessIntersections(ISegmentString, int, ISegmentString, int)"/> /// for all <i>candidate</i> intersections between /// the given collection of SegmentStrings and the set of indexed segments. /// </summary> /// <param name="segmentStrings"></param> /// <param name="segmentIntersector"></param> public void Process(ICollection<ISegmentString> segmentStrings, ISegmentIntersector segmentIntersector) { var monoChains = new List<MonotoneChain>(); foreach (var segStr in segmentStrings) { AddToMonoChains(segStr, monoChains); } IntersectChains(monoChains, segmentIntersector); // System.out.println("MCIndexBichromaticIntersector: # chain overlaps = " + nOverlaps); // System.out.println("MCIndexBichromaticIntersector: # oct chain overlaps = " + nOctOverlaps); }
/// <summary> /// Calls <see cref="ISegmentIntersector.ProcessIntersections(ISegmentString, int, ISegmentString, int)"/> /// for all <i>candidate</i> intersections between /// the given collection of SegmentStrings and the set of base segments. /// </summary> /// <param name="segmentStrings">A collection of <see cref="ISegmentString"/>s to node</param> /// <param name="segmentIntersector">The intersection detector to either record intersection occurences /// or add intersection nodes to the input segment strings.</param> public void Process(ICollection<ISegmentString> segmentStrings, ISegmentIntersector segmentIntersector) { foreach (var baseSegmentString in _baseBaseSegStrings) { foreach (var segmentString in segmentStrings) { Intersect(baseSegmentString, segmentString, segmentIntersector); if (segmentIntersector.IsDone) return; } } }
/// <summary> /// Calls <see cref="ISegmentIntersector.ProcessIntersections(ISegmentString, int, ISegmentString, int)"/> /// for all <i>candidate</i> intersections between /// the given collection of SegmentStrings and the set of indexed segments. /// </summary> /// <param name="segmentStrings"></param> /// <param name="segmentIntersector"></param> public void Process(IEnumerable <ISegmentString> segmentStrings, ISegmentIntersector segmentIntersector) { var monoChains = new List <MonotoneChain>(); foreach (var segStr in segmentStrings) { AddToMonoChains(segStr, monoChains); } IntersectChains(monoChains, segmentIntersector); // System.out.println("MCIndexBichromaticIntersector: # chain overlaps = " + nOverlaps); // System.out.println("MCIndexBichromaticIntersector: # oct chain overlaps = " + nOctOverlaps); }
/// <summary> /// Calls <see cref="ISegmentIntersector.ProcessIntersections(ISegmentString, int, ISegmentString, int)"/> /// for all <i>candidate</i> intersections between /// the given collection of SegmentStrings and the set of base segments. /// </summary> /// <param name="segmentStrings">A collection of <see cref="ISegmentString"/>s to node</param> /// <param name="segmentIntersector">The intersection detector to either record intersection occurences /// or add intersection nodes to the input segment strings.</param> public void Process(ICollection <ISegmentString> segmentStrings, ISegmentIntersector segmentIntersector) { foreach (var baseSegmentString in _baseBaseSegStrings) { foreach (var segmentString in segmentStrings) { Intersect(baseSegmentString, segmentString, segmentIntersector); if (segmentIntersector.IsDone) { return; } } } }
/// <summary> /// Processes all of the segment pairs in the given segment strings /// using the given <paramref name="segInt">SegmentIntersector</paramref>. /// </summary> /// <param name="ss0">A segment string</param> /// <param name="ss1">A segment string</param> /// <param name="segInt">The segment intersector to use</param> private static void Intersect(ISegmentString ss0, ISegmentString ss1, ISegmentIntersector segInt) { var pts0 = ss0.Coordinates; var pts1 = ss1.Coordinates; for (var i0 = 0; i0 < pts0.Length - 1; i0++) { for (var i1 = 0; i1 < pts1.Length - 1; i1++) { segInt.ProcessIntersections(ss0, i0, ss1, i1); if (segInt.IsDone) return; } } }
/// <summary> /// Processes all of the segment pairs in the given segment strings /// using the given <paramref name="segInt">SegmentIntersector</paramref>. /// </summary> /// <param name="ss0">A segment string</param> /// <param name="ss1">A segment string</param> /// <param name="segInt">The segment intersector to use</param> private static void Intersect(ISegmentString ss0, ISegmentString ss1, ISegmentIntersector segInt) { var pts0 = ss0.Coordinates; var pts1 = ss1.Coordinates; for (int i0 = 0; i0 < pts0.Length - 1; i0++) { for (int i1 = 0; i1 < pts1.Length - 1; i1++) { segInt.ProcessIntersections(ss0, i0, ss1, i1); if (segInt.IsDone) { return; } } } }
/// <summary> /// Calls <see cref="ISegmentIntersector.ProcessIntersections(ISegmentString, int, ISegmentString, int)"/> /// for all <i>candidate</i> intersections between /// the given collection of SegmentStrings and the set of base segments. /// </summary> /// <param name="segmentStrings">A collection of <see cref="ISegmentString"/>s to node</param> /// <param name="segmentIntersector">The intersection detector to either record intersection occurences /// or add intersection nodes to the input segment strings.</param> public void Process(IEnumerable <ISegmentString> segmentStrings, ISegmentIntersector segmentIntersector) { // don't iterate over the input more than once. var segmentStringsArray = segmentStrings?.ToArray(); foreach (var baseSegmentString in _baseBaseSegStrings) { foreach (var segmentString in segmentStringsArray) { Intersect(baseSegmentString, segmentString, segmentIntersector); if (segmentIntersector.IsDone) { return; } } } }
private void IntersectChains(List <MonotoneChain> monoChains, ISegmentIntersector segmentIntersector) { var overlapAction = new SegmentOverlapAction(segmentIntersector); foreach (var queryChain in monoChains) { var overlapChains = _index.Query(queryChain.Envelope); foreach (var testChain in overlapChains) { queryChain.ComputeOverlaps(testChain, overlapAction); if (segmentIntersector.IsDone) { return; } } } }
/// <summary> /// Initializes a new instance of the <see cref="SegmentOverlapAction"/> class. /// </summary> /// <param name="si">The <see cref="ISegmentIntersector" /></param> public SegmentOverlapAction(ISegmentIntersector si) { this.si = si; }
/// <summary> /// Initializes a new instance of the <see cref="SimpleNoder"/> class. /// </summary> /// <param name="segInt"></param> public SimpleNoder(ISegmentIntersector segInt) : base(segInt) { }
/// <summary> /// Initializes a new instance of the <see cref="MCIndexNoder"/> class. /// </summary> /// <param name="si">The <see cref="ISegmentIntersector"/> to use.</param> /// <param name="overlapTolerance">The expansion distance for overlap tests</param> public MCIndexNoder(ISegmentIntersector si, double overlapTolerance) : base(si) { _overlapTolerance = overlapTolerance; }
/// <summary> /// Initializes a new instance of the <see cref="SegmentOverlapAction"/> class. /// </summary> /// <param name="si">The <see cref="ISegmentIntersector" /></param> public SegmentOverlapAction(ISegmentIntersector si) { _si = si; }
/// <summary> /// Initializes a new instance of the <see cref="MCIndexNoder"/> class. /// </summary> /// <param name="segInt">The <see cref="ISegmentIntersector"/> to use.</param> public MCIndexNoder(ISegmentIntersector segInt) : base(segInt) { }
/// <summary> /// Initializes a new instance of the <see cref="SinglePassNoder"/> class. /// </summary> /// <param name="segInt">The <see cref="ISegmentIntersector" /> to use.</param> protected SinglePassNoder(ISegmentIntersector segInt) { SegmentIntersector = segInt; }
/// <summary> /// Initializes a new instance of the <see cref="SinglePassNoder"/> class. /// </summary> /// <param name="segInt">The <see cref="ISegmentIntersector" /> to use.</param> public SinglePassNoder(ISegmentIntersector segInt) { this.segInt = segInt; }
/// <summary> /// Initializes a new instance of the <see cref="MCIndexNoder"/> class. /// </summary> /// <param name="si">The <see cref="ISegmentIntersector"/> to use.</param> public MCIndexNoder(ISegmentIntersector si) : base(si) { }
/// <summary> /// Initializes a new instance of the <see cref="SinglePassNoder"/> class. /// </summary> /// <param name="segInt">The <see cref="ISegmentIntersector" /> to use.</param> protected SinglePassNoder(ISegmentIntersector segInt) { _segInt = segInt; }
private void IntersectChains(IEnumerable<MonotoneChain> monoChains, ISegmentIntersector segmentIntersector) { MonotoneChainOverlapAction overlapAction = new SegmentOverlapAction(segmentIntersector); foreach (var queryChain in monoChains) { var overlapChains = _index.Query(queryChain.Envelope); foreach (var testChain in overlapChains) { queryChain.ComputeOverlaps(testChain, overlapAction); if (segmentIntersector.IsDone) return; } } }
public SegmentOverlapAction(MCIndexNoder indexNoder, ISegmentIntersector si) { m_objIndexNoder = indexNoder; this.si = si; }