/// <summary> /// Initializes a new instance of the <see cref="ShamosHoeyAlgorithm" /> class. /// </summary> /// <param name="source">The collection of coordinates representing multiple line strings.</param> /// <param name="precisionModel">The precision model.</param> /// <exception cref="System.ArgumentNullException">The source is null.</exception> public ShamosHoeyAlgorithm(IEnumerable <IBasicLineString> source, PrecisionModel precisionModel = null) { if (source == null) { throw new ArgumentNullException("source", "The source is null."); } PrecisionModel = precisionModel ?? PrecisionModel.Default; _eventQueue = new PresortedEventQueue(source.Select(lineString => lineString == null ? null : lineString.Coordinates)); _sweepLine = new SweepLine(source.Select(hole => hole.Coordinates), precisionModel); _hasResult = false; }
/// <summary> /// Initializes a new instance of the <see cref="ShamosHoeyAlgorithm" /> class. /// </summary> /// <param name="source">The line string.</param> /// <param name="precisionModel">The precision model.</param> /// <exception cref="System.ArgumentNullException">The source is null.</exception> public ShamosHoeyAlgorithm(IBasicLineString source, PrecisionModel precisionModel = null) { if (source == null) { throw new ArgumentNullException("source", "The source is null."); } PrecisionModel = precisionModel ?? PrecisionModel.Default; _eventQueue = new PresortedEventQueue(source.Coordinates); _sweepLine = new SweepLine(source.Coordinates, precisionModel); _hasResult = false; }
/// <summary> /// Initializes a new instance of the <see cref="ShamosHoeyAlgorithm" /> class. /// </summary> /// <param name="source">The collection of coordinates representing multiple line strings.</param> /// <param name="precisionModel">The precision model.</param> /// <exception cref="System.ArgumentNullException">The source is null.</exception> public ShamosHoeyAlgorithm(IEnumerable <IEnumerable <Coordinate> > source, PrecisionModel precisionModel) { if (source == null) { throw new ArgumentNullException(nameof(source)); } this.PrecisionModel = precisionModel ?? PrecisionModel.Default; this.eventQueue = new PresortedEventQueue(source); this.sweepLine = new SweepLine(source, precisionModel); this.hasResult = false; }