Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/DikeProfile.cs =================================================================== diff -u -r30026b56425d53753f03e790e4938a2e7852369a -reab646f5a7508cdda5bc871d6cb2e103383604cf --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/DikeProfile.cs (.../DikeProfile.cs) (revision 30026b56425d53753f03e790e4938a2e7852369a) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/DikeProfile.cs (.../DikeProfile.cs) (revision eab646f5a7508cdda5bc871d6cb2e103383604cf) @@ -21,7 +21,6 @@ using System; using System.Collections.Generic; -using System.Linq; using Core.Common.Base.Data; using Core.Common.Base.Geometry; @@ -35,7 +34,7 @@ public class DikeProfile { private readonly List foreshoreGeometry; - private readonly List dikeGeometry; + private readonly List dikeGeometry; private RoundedDouble orientation; private RoundedDouble crestLevel; @@ -55,7 +54,7 @@ Name = Resources.DikeProfile_DefaultName; Memo = ""; - dikeGeometry = new List(); + dikeGeometry = new List(); foreshoreGeometry = new List(); WorldReferencePoint = worldCoordinate; } @@ -109,7 +108,13 @@ /// /// Gets the geometry of the dike with roughness data. /// - public IEnumerable DikeGeometry + /// + /// The roughness of a in the list represents + /// the roughness of the section between this + /// and the succeeding . The roughness of the last + /// point is irrelevant. + /// + public IList DikeGeometry { get { @@ -158,57 +163,5 @@ return BreakWater != null; } } - - /// - /// Adds a geometry section to . - /// - /// The new section to add. - /// Thrown when the - /// is either not connected to or is connected but has - /// an incorrect orientation. - public void AddDikeGeometrySection(RoughnessProfileSection roughnessProfileSection) - { - AddProfileSection(dikeGeometry, roughnessProfileSection); - } - - /// - /// Adds a profile section to an existing collection profile section, but only if - /// it can be connected properly. - /// - /// The type of profile section. - /// Collection of already defined geometry sections. - /// The section to add to . - /// Thrown when the - /// is either not connected to or is connected - /// but has an incorrect orientation. - private static void AddProfileSection(IList profileSections, T section) where T : ProfileSection - { - if (profileSections.Count == 0) - { - profileSections.Add(section); - return; - } - - ProfileSection startingSection = profileSections.First(); - ProfileSection endingSection = profileSections.Last(); - if (section.StartingPoint.Equals(startingSection.StartingPoint) || - section.EndingPoint.Equals(endingSection.EndingPoint)) - { - throw new ArgumentException(Resources.DikeProfile_AddProfileSection_New_segment_connected_with_incorrect_orientation); - } - - if (section.EndingPoint.Equals(startingSection.StartingPoint)) - { - profileSections.Insert(0, section); - } - else if (section.StartingPoint.Equals(endingSection.EndingPoint)) - { - profileSections.Add(section); - } - else - { - throw new ArgumentException(Resources.DikeProfile_AddProfileSection_New_segment_not_connected); - } - } } } \ No newline at end of file