/// <summary> /// Returns the pair of segments that join at the point specified by index. /// If the point is the first or last point, the leading or following segment will be null. /// </summary> /// <param name="pointIndex">Index of the point.</param> /// <returns>Tuple<IPathSegment, IPathSegment>.</returns> public Tuple <IPathSegment, IPathSegment> AdjacentSegmentsAt(int pointIndex) { PointBoundary boundary = PointBoundary(); if (pointIndex < 0 || pointIndex > boundary.Count - 1) { throw new IndexOutOfRangeException(); } return(AdjacentSegments(boundary[pointIndex])); }
/// <summary> /// Returns the points that define the boundary between segments. /// </summary> /// <returns>PointBoundary.</returns> public PointBoundary PointBoundary() { PointBoundary pointBoundary = new PointBoundary(); for (int i = 0; i < Count; i++) { pointBoundary.Add(_contents[i].I); } pointBoundary.Add(LastPoint()); return(pointBoundary); }