Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/DikeProfile.cs =================================================================== diff -u -re039612b6aedef09462b8f260b2f377483d4ea65 -ra9de6c776f0a8367193b3ac142d784979bb3766a --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/DikeProfile.cs (.../DikeProfile.cs) (revision e039612b6aedef09462b8f260b2f377483d4ea65) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/DikeProfile.cs (.../DikeProfile.cs) (revision a9de6c776f0a8367193b3ac142d784979bb3766a) @@ -39,7 +39,7 @@ private RoundedDouble crestLevel; /// - /// Initializes a new instance of the class. + /// Creates a new instance of the class. /// /// The value for . public DikeProfile(Point2D worldCoordinate) Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsCalculation.cs =================================================================== diff -u -re039612b6aedef09462b8f260b2f377483d4ea65 -ra9de6c776f0a8367193b3ac142d784979bb3766a --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsCalculation.cs (.../GrassCoverErosionInwardsCalculation.cs) (revision e039612b6aedef09462b8f260b2f377483d4ea65) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsCalculation.cs (.../GrassCoverErosionInwardsCalculation.cs) (revision a9de6c776f0a8367193b3ac142d784979bb3766a) @@ -87,23 +87,22 @@ private void AddDemoInput() { - // BreakWater - InputParameters.BreakWater.Type = BreakWaterType.Dam; - InputParameters.BreakWater.Height = (RoundedDouble) 10; - InputParameters.UseBreakWater = true; - - // Orientation - InputParameters.Orientation = (RoundedDouble) 5.5; - - // Dike and Foreshore - InputParameters.DikeGeometry.Add(new RoughnessPoint(new Point2D(1.1, 2.2), 0.6)); - InputParameters.DikeGeometry.Add(new RoughnessPoint(new Point2D(3.3, 4.4), 0.7)); - InputParameters.ForeshoreGeometry.Add(new Point2D(3.3, 4.4)); - InputParameters.ForeshoreGeometry.Add(new Point2D(5.5, 6.6)); - InputParameters.UseForeshore = true; - - // Dike height - InputParameters.DikeHeight = (RoundedDouble) 10; + InputParameters.DikeProfile = new DikeProfile(new Point2D(0, 0)) + { + Orientation = (RoundedDouble) 5.5, + BreakWater = new BreakWater(BreakWaterType.Dam, 10.0), + DikeGeometry = + { + new RoughnessPoint(new Point2D(1.1, 2.2), 0.6), + new RoughnessPoint(new Point2D(3.3, 4.4), 0.7) + }, + ForeshoreGeometry = + { + new Point2D(3.3, 4.4), + new Point2D(5.5, 6.6) + }, + CrestLevel = (RoundedDouble) 10 + }; } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs =================================================================== diff -u -rcf913a00f5768780ab2f8bd8d5145069581a8068 -ra9de6c776f0a8367193b3ac142d784979bb3766a --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs (.../GrassCoverErosionInwardsInput.cs) (revision cf913a00f5768780ab2f8bd8d5145069581a8068) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsInput.cs (.../GrassCoverErosionInwardsInput.cs) (revision a9de6c776f0a8367193b3ac142d784979bb3766a) @@ -55,9 +55,6 @@ Mean = (RoundedDouble) 0.004, StandardDeviation = (RoundedDouble) 0.0006 }; - - DikeGeometry = new List(); - ForeshoreGeometry = new List(); } /// @@ -99,7 +96,15 @@ /// /// Gets the geometry of the foreshore. /// - public IList ForeshoreGeometry { get; private set; } + public IEnumerable ForeshoreGeometry + { + get + { + return dikeProfile != null + ? dikeProfile.ForeshoreGeometry + : new List(); + } + } /// /// Gets or sets if needs to be taken into account. @@ -114,10 +119,24 @@ /// /// Gets the geometry of the dike with roughness data. /// - public IList DikeGeometry { get; private set; } + /// + /// The roughness of a in the collection represents + /// the roughness of the section between this + /// and the succeeding . The roughness of the last + /// point is irrelevant. + /// + public IEnumerable DikeGeometry + { + get + { + return dikeProfile != null + ? dikeProfile.DikeGeometry + : new List(); + } + } /// - /// Gets or sets the dike height. + /// Gets or sets the height of the dike [m+NAP]. /// public RoundedDouble DikeHeight { Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs =================================================================== diff -u -re039612b6aedef09462b8f260b2f377483d4ea65 -ra9de6c776f0a8367193b3ac142d784979bb3766a --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs (.../GrassCoverErosionInwardsCalculationService.cs) (revision e039612b6aedef09462b8f260b2f377483d4ea65) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsCalculationService.cs (.../GrassCoverErosionInwardsCalculationService.cs) (revision a9de6c776f0a8367193b3ac142d784979bb3766a) @@ -100,19 +100,19 @@ return input.ForeshoreGeometry.Select(c => new HydraRingForelandPoint(c.X, c.Y)); } - private static IEnumerable ParseProfilePoints(IList roughnessProfilePoints) + private static IEnumerable ParseProfilePoints(IEnumerable roughnessProfilePoints) { - for (var i = 0; i < roughnessProfilePoints.Count; i++) + for (var i = 0; i < roughnessProfilePoints.Count(); i++) { - var roughnessProfilePoint = roughnessProfilePoints[i]; + var roughnessProfilePoint = roughnessProfilePoints.ElementAt(i); if (i == 0) { yield return new HydraRingRoughnessProfilePoint(roughnessProfilePoint.Point.X, roughnessProfilePoint.Point.Y, 1.0); } else { - var precedingRoughnessProfilePoint = roughnessProfilePoints[i - 1]; + var precedingRoughnessProfilePoint = roughnessProfilePoints.ElementAt(i - 1); yield return new HydraRingRoughnessProfilePoint(roughnessProfilePoint.Point.X, roughnessProfilePoint.Point.Y, precedingRoughnessProfilePoint.Roughness); }