/// <summary> /// Creates line sections along this face. /// </summary> /// <param name="parentLine">The line that is being subdivided</param> /// <param name="ff">Factory for producing new features (the important thing /// is the editing operation that's involved).</param> /// <param name="isTopological">Should the sections be tagged as polygon boundaries?</param> internal void CreateSections(LineFeature parentLine, FeatureFactory ff, bool isTopological) { // Must have at least two distances if (m_Distances == null) { throw new ArgumentNullException(); } if (m_Distances.Length < 2) { throw new ArgumentException(); } m_Sections = new List <LineFeature>(m_Distances.Length); PointFeature start = parentLine.StartPoint; InternalIdValue item = new InternalIdValue(ff.Creator.EditSequence); for (int i = 0; i < m_Distances.Length; i++) { PointFeature end; if (i == m_Distances.Length - 1) { end = parentLine.EndPoint; } else { item.ItemSequence++; end = ff.CreatePointFeature(item.ToString()); } item.ItemSequence++; LineFeature line = ff.CreateSection(item.ToString(), parentLine, start, end); line.ObservedLength = m_Distances[i]; if (!isTopological) { line.SetTopology(false); } m_Sections.Add(line); start = end; } }
/// <summary> /// Creates line sections along this face. /// </summary> /// <param name="parentLine">The line that is being subdivided</param> /// <param name="ff">Factory for producing new features (the important thing /// is the editing operation that's involved).</param> /// <param name="isTopological">Should the sections be tagged as polygon boundaries?</param> internal void CreateSections(LineFeature parentLine, FeatureFactory ff, bool isTopological) { // Must have at least two distances if (m_Distances == null) throw new ArgumentNullException(); if (m_Distances.Length < 2) throw new ArgumentException(); m_Sections = new List<LineFeature>(m_Distances.Length); PointFeature start = parentLine.StartPoint; InternalIdValue item = new InternalIdValue(ff.Creator.EditSequence); for (int i = 0; i < m_Distances.Length; i++) { PointFeature end; if (i == m_Distances.Length - 1) end = parentLine.EndPoint; else { item.ItemSequence++; end = ff.CreatePointFeature(item.ToString()); } item.ItemSequence++; LineFeature line = ff.CreateSection(item.ToString(), parentLine, start, end); line.ObservedLength = m_Distances[i]; if (!isTopological) line.SetTopology(false); m_Sections.Add(line); start = end; } }