Index: Core/Components/src/Core.Components.OxyPlot/Converter/Chart/ChartMultipleAreaDataConverter.cs =================================================================== diff -u -rbf790921e622ee49149a92e6b52668fb30d6e3a6 -r52bf1eb466e06cc2da8d336229ebb8caaa877ba8 --- Core/Components/src/Core.Components.OxyPlot/Converter/Chart/ChartMultipleAreaDataConverter.cs (.../ChartMultipleAreaDataConverter.cs) (revision bf790921e622ee49149a92e6b52668fb30d6e3a6) +++ Core/Components/src/Core.Components.OxyPlot/Converter/Chart/ChartMultipleAreaDataConverter.cs (.../ChartMultipleAreaDataConverter.cs) (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.Collections.Generic; using System.Linq; using Core.Common.Base.Geometry; using Core.Components.Chart.Data; @@ -37,7 +38,7 @@ { series.Areas.Clear(); - foreach (Point2D[] area in data.Areas) + foreach (IEnumerable area in data.Areas) { series.Areas.Add(area.Select(p => new DataPoint(p.X, p.Y)).ToArray()); } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataFactory.cs =================================================================== diff -u -r2351e33d2db5e822abd37b63a88930d9239528b7 -r52bf1eb466e06cc2da8d336229ebb8caaa877ba8 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataFactory.cs (.../MacroStabilityInwardsChartDataFactory.cs) (revision 2351e33d2db5e822abd37b63a88930d9239528b7) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataFactory.cs (.../MacroStabilityInwardsChartDataFactory.cs) (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -33,7 +33,7 @@ namespace Ringtoets.MacroStabilityInwards.Forms.Factories { /// - /// Factory for creating for data used as input in the macro stability inwards failure mechanism. + /// Factory for creating for data used in the macro stability inwards failure mechanism. /// internal static class MacroStabilityInwardsChartDataFactory { @@ -269,22 +269,6 @@ } /// - /// Create a for the slices in a slip plane. - /// - /// The created . - public static ChartMultipleAreaData CreateSlicesChartData() - { - return new ChartMultipleAreaData(Resources.Slices_DisplayName, - new ChartAreaStyle - { - FillColor = Color.Empty, - StrokeColor = Color.DarkGreen, - StrokeThickness = 2, - IsEditable = true - }); - } - - /// /// Creates with default styling for the tangent lines. /// /// The created . Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataPointsFactory.cs =================================================================== diff -u -rf85578eb9fbbd05088386a9b17f9687f832b051a -r52bf1eb466e06cc2da8d336229ebb8caaa877ba8 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataPointsFactory.cs (.../MacroStabilityInwardsChartDataPointsFactory.cs) (revision f85578eb9fbbd05088386a9b17f9687f832b051a) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsChartDataPointsFactory.cs (.../MacroStabilityInwardsChartDataPointsFactory.cs) (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -31,7 +31,7 @@ namespace Ringtoets.MacroStabilityInwards.Forms.Factories { /// - /// Factory for creating arrays of to use in + /// Factory for creating collections of points in 2D space to use in /// (created via ). /// internal static class MacroStabilityInwardsChartDataPointsFactory @@ -40,8 +40,8 @@ /// Create surface line points in 2D space based on the provided . /// /// The to create the surface line points for. - /// An array of points in 2D space or an empty array when is null. - public static Point2D[] CreateSurfaceLinePoints(MacroStabilityInwardsSurfaceLine surfaceLine) + /// A collection of points in 2D space or an empty collection when is null. + public static IEnumerable CreateSurfaceLinePoints(MacroStabilityInwardsSurfaceLine surfaceLine) { return surfaceLine?.LocalGeometry.ToArray() ?? new Point2D[0]; } @@ -50,13 +50,13 @@ /// Create a surface level outside point in 2D space based on the provided . /// /// The surface line to create the surface level outside point for. - /// An array with a surface level outside point in 2D space or an empty array when: + /// A collection with a surface level outside point in 2D space or an empty collection when: /// /// is null; /// the surface level outside point in is null. /// /// - public static Point2D[] CreateSurfaceLevelOutsidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable CreateSurfaceLevelOutsidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.SurfaceLevelOutside); } @@ -65,13 +65,13 @@ /// Create a dike top at river point in 2D space based on the provided . /// /// The surface line to create the dike top at river point for. - /// An array with a dike top at river point in 2D space or an empty array when: + /// A collection with a dike top at river point in 2D space or an empty collection when: /// /// is null; /// the dike top at river point in is null. /// /// - public static Point2D[] CreateDikeTopAtRiverPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable CreateDikeTopAtRiverPoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.DikeTopAtRiver); } @@ -80,13 +80,13 @@ /// Create a dike toe at river point in 2D space based on the provided . /// /// The surface line to create the dike toe at river point for. - /// An array with a dike toe at river point in 2D space or an empty array when: + /// A collection with a dike toe at river point in 2D space or an empty collection when: /// /// is null; /// the dike toe at river point in is null. /// /// - public static Point2D[] CreateDikeToeAtRiverPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable CreateDikeToeAtRiverPoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.DikeToeAtRiver); } @@ -95,13 +95,13 @@ /// Create a dike top at polder point in 2D space based on the provided . /// /// The surface line to create the dike top at polder point for. - /// An array with a dike top at polder point in 2D space or an empty array when: + /// A collection with a dike top at polder point in 2D space or an empty collection when: /// /// is null; /// the dike top at polder point in is null. /// /// - public static Point2D[] CreateDikeTopAtPolderPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable CreateDikeTopAtPolderPoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.DikeTopAtPolder); } @@ -110,13 +110,13 @@ /// Create a shoulder base inside point in 2D space based on the provided . /// /// The surface line to create the shoulder base inside point for. - /// An array with a shoulder base inside point in 2D space or an empty array when: + /// A collection with a shoulder base inside point in 2D space or an empty collection when: /// /// is null; /// the shoulder base inside point in is null. /// /// - public static Point2D[] CreateShoulderBaseInsidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable CreateShoulderBaseInsidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.ShoulderBaseInside); } @@ -125,13 +125,13 @@ /// Create a shoulder top inside point in 2D space based on the provided . /// /// The surface line to create the shoulder top inside point for. - /// An array with a shoulder top inside point in 2D space or an empty array when: + /// A collection with a shoulder top inside point in 2D space or an empty collection when: /// /// is null; /// the shoulder top inside point in is null. /// /// - public static Point2D[] CreateShoulderTopInsidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable CreateShoulderTopInsidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.ShoulderTopInside); } @@ -140,13 +140,13 @@ /// Create a dike toe at polder point in 2D space based on the provided . /// /// The surface line to create the dike toe at polder point for. - /// An array with a dike toe at polder point in 2D space or an empty array when: + /// A collection with a dike toe at polder point in 2D space or an empty collection when: /// /// is null; /// the dike toe at polder point in is null. /// /// - public static Point2D[] CreateDikeToeAtPolderPoint(MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable CreateDikeToeAtPolderPoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.DikeToeAtPolder); } @@ -155,13 +155,13 @@ /// Create a ditch dike side point in 2D space based on the provided . /// /// The surface line to create the ditch dike side point for. - /// An array with a ditch dike side point in 2D space or an empty array when: + /// A collection with a ditch dike side point in 2D space or an empty collection when: /// /// is null; /// the ditch dike side point in is null. /// /// - public static Point2D[] CreateDitchDikeSidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable CreateDitchDikeSidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.DitchDikeSide); } @@ -170,13 +170,13 @@ /// Create a bottom ditch dike side point in 2D space based on the provided . /// /// The surface line to create the bottom ditch dike side point for. - /// An array with a bottom ditch dike side point in 2D space or an empty array when: + /// A collection with a bottom ditch dike side point in 2D space or an empty collection when: /// /// is null; /// the bottom ditch dike side point in is null. /// /// - public static Point2D[] CreateBottomDitchDikeSidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable CreateBottomDitchDikeSidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.BottomDitchDikeSide); } @@ -185,13 +185,13 @@ /// Create a bottom ditch polder side point in 2D space based on the provided . /// /// The surface line to create the bottom ditch polder side point for. - /// An array with a bottom ditch polder side point in 2D space or an empty array when: + /// A collection with a bottom ditch polder side point in 2D space or an empty collection when: /// /// is null; /// the bottom ditch polder side point in is null. /// /// - public static Point2D[] CreateBottomDitchPolderSidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable CreateBottomDitchPolderSidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.BottomDitchPolderSide); } @@ -200,13 +200,13 @@ /// Create a surface level inside point in 2D space based on the provided . /// /// The surface line to create the surface level inside point for. - /// An array with a surface level inside point in 2D space or an empty array when: + /// A collection with a surface level inside point in 2D space or an empty collection when: /// /// is null; /// the surface level inside point in is null. /// /// - public static Point2D[] CreateSurfaceLevelInsidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable CreateSurfaceLevelInsidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.SurfaceLevelInside); } @@ -215,13 +215,13 @@ /// Create a ditch polder side point in 2D space based on the provided . /// /// The surface line to create the ditch polder side point for. - /// An array with a ditch polder side point in 2D space or an empty array when: + /// A collection with a ditch polder side point in 2D space or an empty collection when: /// /// is null; /// the ditch polder side point in is null. /// /// - public static Point2D[] CreateDitchPolderSidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable CreateDitchPolderSidePoint(MacroStabilityInwardsSurfaceLine surfaceLine) { return GetLocalPointsFromGeometry(surfaceLine, surfaceLine?.DitchPolderSide); } @@ -230,27 +230,27 @@ /// Create an area of the outer ring in 2D space based on the provided . /// /// The soil layer to create the outer ring for. - /// A collection containing a single array of points in 2D space + /// A collection containing a single collection of points in 2D space /// or an empty collection when is null. - public static IEnumerable CreateOuterRingArea(MacroStabilityInwardsSoilLayer2D soilLayer) + public static IEnumerable> CreateOuterRingArea(MacroStabilityInwardsSoilLayer2D soilLayer) { return soilLayer != null - ? new List + ? new IEnumerable[] { soilLayer.OuterRing.Points.ToArray() } - : Enumerable.Empty(); + : Enumerable.Empty>(); } /// /// Create points of the phreatic line in 2D space based on the provided . /// /// The phreatic line to create the points for. - /// An array of points in 2D space or an empty array when + /// A collection of points in 2D space or an empty collection when /// is null. - public static Point2D[] CreatePhreaticLinePoints(MacroStabilityInwardsPhreaticLine phreaticLine) + public static IEnumerable CreatePhreaticLinePoints(MacroStabilityInwardsPhreaticLine phreaticLine) { - return phreaticLine?.Geometry.ToArray() ?? new Point2D[0]; + return phreaticLine?.Geometry ?? new Point2D[0]; } /// @@ -260,29 +260,29 @@ /// The that may intersect with /// the and by doing that restricts the /// drawn height of it. - /// An array of points in 2D space or an empty array when: + /// A collection of points in 2D space or an empty collection when: /// /// is null; /// is null; /// The geometry of the is empty; /// The geometry of the is empty. /// /// - public static IEnumerable CreateWaternetZonePoints(MacroStabilityInwardsWaternetLine waternetLine, - MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable> CreateWaternetZonePoints(MacroStabilityInwardsWaternetLine waternetLine, + MacroStabilityInwardsSurfaceLine surfaceLine) { if (waternetLine == null || surfaceLine == null || !waternetLine.Geometry.Any() || !waternetLine.PhreaticLine.Geometry.Any()) { return new Point2D[0][]; } - Point2D[] surfaceLineLocalGeometry = surfaceLine.LocalGeometry.ToArray(); - Point2D[] phreaticLineGeometry = new RoundedPoint2DCollection(2, waternetLine.PhreaticLine.Geometry).ToArray(); - Point2D[] waternetLineGeometry = new RoundedPoint2DCollection(2, waternetLine.Geometry).ToArray(); + IEnumerable surfaceLineLocalGeometry = surfaceLine.LocalGeometry.ToArray(); + IEnumerable phreaticLineGeometry = new RoundedPoint2DCollection(2, waternetLine.PhreaticLine.Geometry).ToArray(); + IEnumerable waternetLineGeometry = new RoundedPoint2DCollection(2, waternetLine.Geometry).ToArray(); return IsSurfaceLineAboveWaternetZone(surfaceLineLocalGeometry, waternetLineGeometry, phreaticLineGeometry) - ? CreateZoneAreas(waternetLineGeometry, phreaticLineGeometry).ToArray() + ? CreateZoneAreas(waternetLineGeometry, phreaticLineGeometry) : GetWaternetZoneWithSurfaceLineIntersection(surfaceLineLocalGeometry, waternetLineGeometry, phreaticLineGeometry).ToArray(); } @@ -291,15 +291,15 @@ /// /// The grid to create the grid points for. /// The grid determination type. - /// An array of interpolated points in 2D space based on the provided - /// or an empty array when: + /// A collection of interpolated points in 2D space based on the provided + /// or an empty collection when: /// /// is null; /// is ; /// The grid boundaries are . /// /// - public static Point2D[] CreateGridPoints(MacroStabilityInwardsGrid grid, MacroStabilityInwardsGridDeterminationType gridDeterminationType) + public static IEnumerable CreateGridPoints(MacroStabilityInwardsGrid grid, MacroStabilityInwardsGridDeterminationType gridDeterminationType) { return gridDeterminationType == MacroStabilityInwardsGridDeterminationType.Automatic ? new Point2D[0] @@ -310,14 +310,14 @@ /// Creates grid points in 2D space based on the provided . /// /// The grid to create the grid points for. - /// An array of interpolated points in 2D space based on the provided - /// or an empty array when: + /// A collection of interpolated points in 2D space based on the provided + /// or an empty collection when: /// /// is null; /// The grid boundaries are . /// /// - public static Point2D[] CreateGridPoints(MacroStabilityInwardsGrid grid) + public static IEnumerable CreateGridPoints(MacroStabilityInwardsGrid grid) { if (grid == null || !AreGridSettingsValid(grid)) { @@ -336,16 +336,16 @@ grid.NumberOfHorizontalPoints)); } - return points.ToArray(); + return points; } /// /// Create points of the slip plane in 2D space based on the provided . /// /// The sliding curve to create the points for. - /// An array of points in 2D space or an empty array when + /// A collection of points in 2D space or an empty collection when /// is null or doesn't contain any slices. - public static Point2D[] CreateSlipPlanePoints(MacroStabilityInwardsSlidingCurve slidingCurve) + public static IEnumerable CreateSlipPlanePoints(MacroStabilityInwardsSlidingCurve slidingCurve) { if (slidingCurve == null || !slidingCurve.Slices.Any()) { @@ -355,16 +355,16 @@ List points = slidingCurve.Slices.Select(slice => slice.BottomLeftPoint).OrderBy(x => x.X).ToList(); points.Add(slidingCurve.Slices.Last().BottomRightPoint); - return points.ToArray(); + return points; } /// /// Create points of the left circle radius in 2D space based on the provided . /// /// The sliding curve to create the points for. - /// An array of points in 2D space or an empty array when + /// A collection of points in 2D space or an empty collection when /// is null or doesn't contain any slices. - public static Point2D[] CreateLeftCircleRadiusPoints(MacroStabilityInwardsSlidingCurve slidingCurve) + public static IEnumerable CreateLeftCircleRadiusPoints(MacroStabilityInwardsSlidingCurve slidingCurve) { if (slidingCurve == null || !slidingCurve.Slices.Any()) { @@ -382,9 +382,9 @@ /// Create points of the right circle radius in 2D space based on the provided . /// /// The sliding curve to create the points for. - /// An array of points in 2D space or an empty array when + /// A collection of points in 2D space or an empty collection when /// is null or doesn't contain any slices. - public static Point2D[] CreateRightCircleRadiusPoints(MacroStabilityInwardsSlidingCurve slidingCurve) + public static IEnumerable CreateRightCircleRadiusPoints(MacroStabilityInwardsSlidingCurve slidingCurve) { if (slidingCurve == null || !slidingCurve.Slices.Any()) { @@ -405,14 +405,14 @@ /// The tangent line Z-coordinates. /// The surface line that determines the horizontal boundaries /// of the tangent lines. - /// A collection of arrays of points in 2D space or an empty collection when + /// A collection of collections of points in 2D space or an empty collection when /// or is null. - public static IEnumerable CreateTangentLines(IEnumerable tangentLines, - MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable> CreateTangentLines(IEnumerable tangentLines, + MacroStabilityInwardsSurfaceLine surfaceLine) { if (surfaceLine == null || tangentLines == null) { - return Enumerable.Empty(); + return Enumerable.Empty>(); } return tangentLines.Select(tangentLine => new[] @@ -434,7 +434,7 @@ /// The amount of tangent lines to display. /// The surface line that determines the horizontal boundaries /// of the tangent lines. - /// A collection of arrays of points in 2D space or an empty collection when: + /// A collection of collections of points in 2D space or an empty collection when: /// /// is ; /// is ; @@ -443,12 +443,12 @@ /// is or infinity. /// /// - public static IEnumerable CreateTangentLines(MacroStabilityInwardsGridDeterminationType gridDeterminationType, - MacroStabilityInwardsTangentLineDeterminationType tangentLineDeterminationType, - RoundedDouble tangentLineBottom, - RoundedDouble tangentLineTop, - int tangentLineNumber, - MacroStabilityInwardsSurfaceLine surfaceLine) + public static IEnumerable> CreateTangentLines(MacroStabilityInwardsGridDeterminationType gridDeterminationType, + MacroStabilityInwardsTangentLineDeterminationType tangentLineDeterminationType, + RoundedDouble tangentLineBottom, + RoundedDouble tangentLineTop, + int tangentLineNumber, + MacroStabilityInwardsSurfaceLine surfaceLine) { if (gridDeterminationType == MacroStabilityInwardsGridDeterminationType.Automatic || tangentLineDeterminationType == MacroStabilityInwardsTangentLineDeterminationType.LayerSeparated @@ -457,35 +457,13 @@ || double.IsNaN(tangentLineTop) || double.IsInfinity(tangentLineTop)) { - return Enumerable.Empty(); + return Enumerable.Empty>(); } return CreateTangentLines(GetInterPolatedVerticalPositions(tangentLineTop, tangentLineBottom, tangentLineNumber), surfaceLine); } - /// - /// Create lines of the slices based on the provided . - /// - /// The slices to create the areas for. - /// A collection of arrays of points in 2D space or an empty collection when - /// is null. - public static IEnumerable CreateSliceAreas(IEnumerable slices) - { - if (slices == null) - { - return Enumerable.Empty(); - } - - return slices.Select(slice => new[] - { - slice.TopLeftPoint, - slice.TopRightPoint, - slice.BottomRightPoint, - slice.BottomLeftPoint - }); - } - #region General Helpers private static IEnumerable GetInterPolatedVerticalPositions(RoundedDouble startPoint, @@ -519,8 +497,8 @@ #region SoilLayers and Surface Line Helpers - private static Point2D[] GetLocalPointsFromGeometry(MacroStabilityInwardsSurfaceLine surfaceLine, - Point3D worldCoordinate) + private static IEnumerable GetLocalPointsFromGeometry(MacroStabilityInwardsSurfaceLine surfaceLine, + Point3D worldCoordinate) { if (surfaceLine == null || worldCoordinate == null) { @@ -577,23 +555,23 @@ #region Waternet Helpers - private static IEnumerable GetWaternetZoneWithSurfaceLineIntersection(Point2D[] surfaceLineLocalGeometry, - Point2D[] waternetLineGeometry, - Point2D[] phreaticLineGeometry) + private static IEnumerable> GetWaternetZoneWithSurfaceLineIntersection(IEnumerable surfaceLineLocalGeometry, + IEnumerable waternetLineGeometry, + IEnumerable phreaticLineGeometry) { - IEnumerable waternetZoneAsPolygons = CreateZoneAreas(waternetLineGeometry, phreaticLineGeometry); + IEnumerable> waternetZoneAsPolygons = CreateZoneAreas(waternetLineGeometry, phreaticLineGeometry); - foreach (Point2D[] waternetZoneAsPolygon in waternetZoneAsPolygons) + foreach (IEnumerable waternetZoneAsPolygon in waternetZoneAsPolygons) { - Point2D[] areaPoints = ClipWaternetZoneToSurfaceLine(surfaceLineLocalGeometry, waternetZoneAsPolygon); + IEnumerable areaPoints = ClipWaternetZoneToSurfaceLine(surfaceLineLocalGeometry, waternetZoneAsPolygon); if (areaPoints.Any()) { yield return areaPoints; } } } - private static Point2D[] ClipWaternetZoneToSurfaceLine(Point2D[] surfaceLineLocalGeometry, Point2D[] waternetZoneAsPolygon) + private static IEnumerable ClipWaternetZoneToSurfaceLine(IEnumerable surfaceLineLocalGeometry, IEnumerable waternetZoneAsPolygon) { double leftX = waternetZoneAsPolygon.Min(p => p.X); double rightX = waternetZoneAsPolygon.Max(p => p.X); @@ -629,7 +607,7 @@ foreach (double xCoordinate in allXCoordinates) { Point2D surfaceLineIntersection = Math2D.SegmentsIntersectionWithVerticalLine(surfaceLineSegments, xCoordinate).First(); - Point2D[] waternetZoneIntersection = Math2D.SegmentsIntersectionWithVerticalLine(waternetZoneSegments, xCoordinate).Distinct().ToArray(); + IEnumerable waternetZoneIntersection = Math2D.SegmentsIntersectionWithVerticalLine(waternetZoneSegments, xCoordinate).Distinct().ToArray(); if (waternetZoneIntersection.Any()) { @@ -669,30 +647,29 @@ area.Add(topLine.First()); } } - return area.ToArray(); + return area; } - private static bool AreaIsNotFlatLine(List topLine, List bottomLine) + private static bool AreaIsNotFlatLine(IEnumerable topLine, IEnumerable bottomLine) { - Point2D[] topLineCoordinates = topLine.ToArray(); - Point2D[] bottomLineCoordinates = bottomLine.ToArray(); - - return topLineCoordinates.Length != bottomLineCoordinates.Length - || topLineCoordinates.Where((t, i) => !(Math.Abs(t.X - bottomLineCoordinates[i].X) < 1e-6) - || !(Math.Abs(t.Y - bottomLineCoordinates[i].Y) < 1e-6)).Any(); + return topLine.Count() != bottomLine.Count() + || topLine.Where((t, i) => !(Math.Abs(t.X - bottomLine.ElementAt(i).X) < 1e-6) + || !(Math.Abs(t.Y - bottomLine.ElementAt(i).Y) < 1e-6)).Any(); } - private static bool IsSurfaceLineAboveWaternetZone(Point2D[] surfaceLineLocalGeometry, Point2D[] waternetLineGeometry, Point2D[] phreaticLineGeometry) + private static bool IsSurfaceLineAboveWaternetZone(IEnumerable surfaceLineLocalGeometry, + IEnumerable waternetLineGeometry, + IEnumerable phreaticLineGeometry) { double surfaceLineLowestPointY = surfaceLineLocalGeometry.Min(p => p.Y); double waternetZoneHeighestPointY = Math.Max(waternetLineGeometry.Max(p => p.Y), phreaticLineGeometry.Max(p => p.Y)); return surfaceLineLowestPointY >= waternetZoneHeighestPointY; } - private static IEnumerable CreateZoneAreas(Point2D[] waternetLineGeometry, Point2D[] phreaticLineGeometry) + private static IEnumerable> CreateZoneAreas(IEnumerable waternetLineGeometry, IEnumerable phreaticLineGeometry) { - var areas = new List(); + var areas = new List>(); Segment2D[] phreaticLineSegments = Math2D.ConvertLinePointsToLineSegments(phreaticLineGeometry).ToArray(); Segment2D[] waternetLineSegments = Math2D.ConvertLinePointsToLineSegments(waternetLineGeometry).ToArray(); Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsSliceChartDataFactory.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsSliceChartDataFactory.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsSliceChartDataFactory.cs (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -0,0 +1,227 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Drawing; +using Core.Components.Chart.Data; +using Core.Components.Chart.Styles; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.Forms.Properties; + +namespace Ringtoets.MacroStabilityInwards.Forms.Factories +{ + /// + /// Factory for creating for slice data used in the macro stability inwards failure mechanism. + /// + internal static class MacroStabilityInwardsSliceChartDataFactory + { + /// + /// Create a for the slices in a slip plane. + /// + /// The created . + public static ChartMultipleAreaData CreateSlicesChartData() + { + return new ChartMultipleAreaData(Resources.Slices_DisplayName, + new ChartAreaStyle + { + FillColor = Color.Empty, + StrokeColor = Color.DarkGreen, + StrokeThickness = 2, + IsEditable = true + }); + } + + /// + /// Create a for the slice output parameters. + /// + public static ChartDataCollection CreateSliceParametersChartDataCollection() + { + return new ChartDataCollection(Resources.SliceParameters_DisplayName); + } + + /// + /// Create a for the representation + /// of values in a + /// sliding curve. + /// + /// The created . + public static ChartMultipleAreaData CreateCohesionChartData() + { + return CreateSliceParameterChartData(Resources.Cohesion_DisplayName, false); + } + + /// + /// Create a for the representation + /// of values in a + /// sliding curve. + /// + /// The created . + public static ChartMultipleAreaData CreateEffectiveStressChartData() + { + return CreateSliceParameterChartData(Resources.MacroStabilityInwardsSlice_EffectiveStress_DisplayName, true); + } + + /// + /// Create a for the representation + /// of values in a + /// sliding curve. + /// + /// The created . + public static ChartMultipleAreaData CreateEffectiveStressDailyChartData() + { + return CreateSliceParameterChartData(Resources.MacroStabilityInwardsSlice_EffectiveStressDaily_DisplayName, false); + } + + /// + /// Create a for the representation + /// of values in a + /// sliding curve. + /// + /// The created . + public static ChartMultipleAreaData CreateTotalPorePressureChartData() + { + return CreateSliceParameterChartData(Resources.MacroStabilityInwardsSlice_TotalPorePressure_DisplayName, false); + } + + /// + /// Create a for the representation + /// of values in a + /// sliding curve. + /// + /// The created . + public static ChartMultipleAreaData CreateWeightChartData() + { + return CreateSliceParameterChartData(Resources.MacroStabilityInwardsSlice_Weight_DisplayName, false); + } + + /// + /// Create a for the representation + /// of values in a + /// sliding curve. + /// + /// The created . + public static ChartMultipleAreaData CreatePiezometricPorePressureChartData() + { + return CreateSliceParameterChartData(Resources.MacroStabilityInwardsSlice_PiezometricPorePressure_DisplayName, false); + } + + /// + /// Create a for the representation + /// of values in a + /// sliding curve. + /// + /// The created . + public static ChartMultipleAreaData CreatePorePressureChartData() + { + return CreateSliceParameterChartData(Resources.MacroStabilityInwardsSlice_PorePressure_DisplayName, false); + } + + /// + /// Create a for the representation + /// of values in a + /// sliding curve. + /// + /// The created . + public static ChartMultipleAreaData CreateVerticalPorePressureChartData() + { + return CreateSliceParameterChartData(Resources.MacroStabilityInwardsSlice_VerticalPorePressure_DisplayName, false); + } + + /// + /// Create a for the representation + /// of values in a + /// sliding curve. + /// + /// The created . + public static ChartMultipleAreaData CreateHorizontalPorePressureChartData() + { + return CreateSliceParameterChartData(Resources.MacroStabilityInwardsSlice_HorizontalPorePressure_DisplayName, false); + } + + /// + /// Create a for the representation + /// of values in a + /// sliding curve. + /// + /// The created . + public static ChartMultipleAreaData CreateOverConsolidationRatioChartData() + { + return CreateSliceParameterChartData(Resources.MacroStabilityInwardsSlice_OverConsolidationRatio_DisplayName, false); + } + + /// + /// Create a for the representation + /// of values in a + /// sliding curve. + /// + /// The created . + public static ChartMultipleAreaData CreatePopChartData() + { + return CreateSliceParameterChartData(Resources.Pop_DisplayName, false); + } + + /// + /// Create a for the representation + /// of values in a + /// sliding curve. + /// + /// The created . + public static ChartMultipleAreaData CreateNormalStressChartData() + { + return CreateSliceParameterChartData(Resources.MacroStabilityInwardsSlice_NormalStress_DisplayName, false); + } + + /// + /// Create a for the representation + /// of values in a + /// sliding curve. + /// + /// The created . + public static ChartMultipleAreaData CreateShearStressChartData() + { + return CreateSliceParameterChartData(Resources.MacroStabilityInwardsSlice_ShearStress_DisplayName, false); + } + + /// + /// Create a for the representation + /// of values in a + /// sliding curve. + /// + /// The created . + public static ChartMultipleAreaData CreateLoadStressChartData() + { + return CreateSliceParameterChartData(Resources.MacroStabilityInwardsSlice_LoadStress_DisplayName, false); + } + + private static ChartMultipleAreaData CreateSliceParameterChartData(string name, bool isVisible) + { + return new ChartMultipleAreaData(name, new ChartAreaStyle + { + StrokeThickness = 1, + StrokeColor = Color.Black, + FillColor = Color.FromArgb(150, Color.Red), + IsEditable = true + }) + { + IsVisible = isVisible + }; + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsSliceChartDataPointsFactory.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsSliceChartDataPointsFactory.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Factories/MacroStabilityInwardsSliceChartDataPointsFactory.cs (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -0,0 +1,297 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Linq; +using Core.Common.Base.Data; +using Core.Common.Base.Geometry; +using Core.Common.Util.Extensions; +using Core.Components.Chart.Data; +using Ringtoets.MacroStabilityInwards.Data; + +namespace Ringtoets.MacroStabilityInwards.Forms.Factories +{ + /// + /// Factory for creating collections of points in 2D space for a collection of + /// to use in (created via ). + /// + internal static class MacroStabilityInwardsSliceChartDataPointsFactory + { + /// + /// Create lines of the slices based on the provided . + /// + /// The containing the slices + /// to create the areas for. + /// A collection of collections of points in 2D space or an empty collection when + /// is null. + public static IEnumerable> CreateSliceAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + if (slidingCurve == null) + { + return Enumerable.Empty(); + } + + return slidingCurve.Slices.Select(slice => new[] + { + slice.TopLeftPoint, + slice.TopRightPoint, + slice.BottomRightPoint, + slice.BottomLeftPoint + }).ToArray(); + } + + /// + /// Creates the areas for + /// values in . + /// + /// The to + /// get the slices from. + /// A collection of collections of points in 2D space containing areas representing the + /// slice output values, or an empty collection when is null. + /// + public static IEnumerable> CreateCohesionAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + return CreateParameterAreas(slidingCurve?.Slices, slice => slice.Cohesion, 0.125); + } + + /// + /// Creates the areas for + /// values in . + /// + /// The to + /// get the slices from. + /// A collection of collections of points in 2D space containing areas representing the + /// slice output values, or an empty collection when is null. + /// + public static IEnumerable> CreateEffectiveStressAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + return CreateParameterAreas(slidingCurve?.Slices, slice => slice.EffectiveStress, 0.125); + } + + /// + /// Creates the areas for + /// values in . + /// + /// The to + /// get the slices from. + /// A collection of collections of points in 2D space containing areas representing the + /// slice output values, or an empty collection when is null. + /// + public static IEnumerable> CreateEffectiveStressDailyAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + return CreateParameterAreas(slidingCurve?.Slices, slice => slice.EffectiveStressDaily, 0.125); + } + + /// + /// Creates the areas for + /// values in . + /// + /// The to + /// get the slices from. + /// A collection of collections of points in 2D space containing areas representing the + /// slice output values, or an empty collection when is null. + /// + public static IEnumerable> CreateTotalPorePressureAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + return CreateParameterAreas(slidingCurve?.Slices, slice => slice.TotalPorePressure, 0.125); + } + + /// + /// Creates the areas for + /// values in . + /// + /// The to + /// get the slices from. + /// A collection of collections of points in 2D space containing areas representing the + /// slice output values, or an empty collection when is null. + /// + public static IEnumerable> CreateWeightAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + return CreateParameterAreas(slidingCurve?.Slices, slice => slice.Weight, 0.125); + } + + /// + /// Creates the areas for + /// values in . + /// + /// The to + /// get the slices from. + /// A collection of collections of points in 2D space containing areas representing the + /// slice output values, or an empty collection when is null. + /// + public static IEnumerable> CreatePiezometricPorePressureAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + return CreateParameterAreas(slidingCurve?.Slices, slice => slice.PiezometricPorePressure, 0.125); + } + + /// + /// Creates the areas for + /// values in . + /// + /// The to + /// get the slices from. + /// A collection of collections of points in 2D space containing areas representing the + /// slice output values, or an empty collection when is null. + /// + public static IEnumerable> CreatePorePressureAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + return CreateParameterAreas(slidingCurve?.Slices, slice => slice.PorePressure, 0.125); + } + + /// + /// Creates the areas for + /// values in . + /// + /// The to + /// get the slices from. + /// A collection of collections of points in 2D space containing areas representing the + /// slice output values, or an empty collection when is null. + /// + public static IEnumerable> CreateVerticalPorePressureAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + return CreateParameterAreas(slidingCurve?.Slices, slice => slice.VerticalPorePressure, 0.125); + } + + /// + /// Creates the areas for + /// values in . + /// + /// The to + /// get the slices from. + /// A collection of collections of points in 2D space containing areas representing the + /// slice output values, or an empty collection when is null. + /// + public static IEnumerable> CreateHorizontalPorePressureAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + return CreateParameterAreas(slidingCurve?.Slices, slice => slice.HorizontalPorePressure, 0.125); + } + + /// + /// Creates the areas for + /// values in . + /// + /// The to + /// get the slices from. + /// A collection of collections of points in 2D space containing areas representing the + /// slice output values, or an empty collection when is null. + /// + public static IEnumerable> CreateOverConsolidationRatioAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + return CreateParameterAreas(slidingCurve?.Slices, slice => slice.OverConsolidationRatio, 0.05); + } + + /// + /// Creates the areas for + /// values in . + /// + /// The to + /// get the slices from. + /// A collection of collections of points in 2D space containing areas representing the + /// slice output values, or an empty collection when is null. + /// + public static IEnumerable> CreatePopAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + return CreateParameterAreas(slidingCurve?.Slices, slice => slice.Pop, 0.125); + } + + /// + /// Creates the areas for + /// values in . + /// + /// The to + /// get the slices from. + /// A collection of collections of points in 2D space containing areas representing the + /// slice output values, or an empty collection when is null. + /// + public static IEnumerable> CreateNormalStressAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + return CreateParameterAreas(slidingCurve?.Slices, slice => slice.NormalStress, 0.125); + } + + /// + /// Creates the areas for + /// values in . + /// + /// The to + /// get the slices from. + /// A collection of collections of points in 2D space containing areas representing the + /// slice output values, or an empty collection when is null. + /// + public static IEnumerable> CreateShearStressAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + return CreateParameterAreas(slidingCurve?.Slices, slice => slice.ShearStress, 0.125); + } + + /// + /// Creates the areas for + /// values in . + /// + /// The to + /// get the slices from. + /// A collection of collections of points in 2D space containing areas representing the + /// slice output values, or an empty collection when is null. + /// + public static IEnumerable> CreateLoadStressAreas(MacroStabilityInwardsSlidingCurve slidingCurve) + { + return CreateParameterAreas(slidingCurve?.Slices, slice => slice.LoadStress, 0.125); + } + + private static IEnumerable> CreateParameterAreas(IEnumerable slices, + Func getParameterFunc, + double scaleFactor) + { + if (slices == null || getParameterFunc == null) + { + return Enumerable.Empty(); + } + + var areas = new List(); + foreach (MacroStabilityInwardsSlice slice in slices) + { + RoundedDouble value = getParameterFunc(slice); + if (double.IsNaN(value)) + { + value = (RoundedDouble) 0.0; + } + value = value.ClipValue((RoundedDouble) (-2000.0), (RoundedDouble) 2000.0); + + double offset = value * scaleFactor; + double deltaX = slice.BottomLeftPoint.X - slice.BottomRightPoint.X; + double deltaY = slice.BottomLeftPoint.Y - slice.BottomRightPoint.Y; + + double length = Math.Sqrt(Math.Pow(deltaX, 2) + + Math.Pow(deltaY, 2)); + + areas.Add(new[] + { + slice.BottomLeftPoint, + slice.BottomRightPoint, + new Point2D(slice.BottomRightPoint.X + offset * -deltaY / length, + slice.BottomRightPoint.Y + offset * deltaX / length), + new Point2D(slice.BottomLeftPoint.X + offset * -deltaY / length, + slice.BottomLeftPoint.Y + offset * deltaX / length) + }); + } + return areas; + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r8d246ac6328e6e649ff6e78dfe3fac210d789ba0 -r52bf1eb466e06cc2da8d336229ebb8caaa877ba8 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 8d246ac6328e6e649ff6e78dfe3fac210d789ba0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -40,7 +40,7 @@ // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { @@ -136,6 +136,15 @@ } /// + /// Looks up a localized string similar to Cohesie. + /// + public static string Cohesion_DisplayName { + get { + return ResourceManager.GetString("Cohesion_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Gebruik zoneringsgrenzen bij het bepalen van het intredepunt van het glijvlak?. /// public static string CreateZones_Description { @@ -226,6 +235,15 @@ } /// + /// Looks up a localized string similar to Wrijvingshoek. + /// + public static string FrictionAngle_DisplayName { + get { + return ResourceManager.GetString("FrictionAngle_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to De parameter 'a' die gebruikt wordt voor het lengte-effect in berekening van de maximaal toelaatbare faalkans.. /// public static string GeneralMacroStabilityInwardsInput_A_Description { @@ -750,173 +768,173 @@ } /// - /// Looks up a localized string similar to Booglengte [m]. + /// Looks up a localized string similar to Booglengte. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_ArcLength { + public static string MacroStabilityInwardsSlice_ArcLength_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_ArcLength", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_ArcLength_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Bodemhoek [°]. + /// Looks up a localized string similar to Bodemhoek. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_BottomAngle { + public static string MacroStabilityInwardsSlice_BottomAngle_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_BottomAngle", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_BottomAngle_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Effectieve spanning [kN/m²]. + /// Looks up a localized string similar to Effectieve spanning. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_EffectiveStress { + public static string MacroStabilityInwardsSlice_EffectiveStress_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_EffectiveStress", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_EffectiveStress_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Effectieve spanning (dagelijks) [kN/m²]. + /// Looks up a localized string similar to Effectieve spanning (dagelijks). /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_EffectiveStressDaily { + public static string MacroStabilityInwardsSlice_EffectiveStressDaily_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_EffectiveStressDaily", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_EffectiveStressDaily_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Horizontale waterspanning op maaiveld [kN/m²]. + /// Looks up a localized string similar to Horizontale waterspanning op maaiveld. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_HorizontalPorePressure { + public static string MacroStabilityInwardsSlice_HorizontalPorePressure_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_HorizontalPorePressure", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_HorizontalPorePressure_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Spanning belasting [kN/m²]. + /// Looks up a localized string similar to Spanning belasting. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_LoadStress { + public static string MacroStabilityInwardsSlice_LoadStress_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_LoadStress", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_LoadStress_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Naam. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_Name { + public static string MacroStabilityInwardsSlice_Name_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_Name", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_Name_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Normaalspanning [kN/m²]. + /// Looks up a localized string similar to Normaalspanning. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_NormalStress { + public static string MacroStabilityInwardsSlice_NormalStress_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_NormalStress", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_NormalStress_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to OCR [-]. + /// Looks up a localized string similar to OCR. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_OverConsolidationRatio { + public static string MacroStabilityInwardsSlice_OverConsolidationRatio_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_OverConsolidationRatio", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_OverConsolidationRatio_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Piezometrische waterspanning [kN/m²]. + /// Looks up a localized string similar to Piezometrische waterspanning. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_PiezometricPorePressure { + public static string MacroStabilityInwardsSlice_PiezometricPorePressure_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_PiezometricPorePressure", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_PiezometricPorePressure_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Waterspanning op maaiveld [kN/m²]. + /// Looks up a localized string similar to Waterspanning op maaiveld. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_PorePressure { + public static string MacroStabilityInwardsSlice_PorePressure_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_PorePressure", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_PorePressure_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Schuifspanning [kN/m²]. + /// Looks up a localized string similar to Schuifspanning. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_ShearStress { + public static string MacroStabilityInwardsSlice_ShearStress_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_ShearStress", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_ShearStress_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Tophoek [°]. + /// Looks up a localized string similar to Tophoek. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_TopAngle { + public static string MacroStabilityInwardsSlice_TopAngle_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_TopAngle", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_TopAngle_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Totale waterspanning [kN/m²]. + /// Looks up a localized string similar to Totale waterspanning. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_TotalPorePressure { + public static string MacroStabilityInwardsSlice_TotalPorePressure_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_TotalPorePressure", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_TotalPorePressure_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Verticale waterspanning op maaiveld [kN/m²]. + /// Looks up a localized string similar to Verticale waterspanning op maaiveld. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_VerticalPorePressure { + public static string MacroStabilityInwardsSlice_VerticalPorePressure_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_VerticalPorePressure", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_VerticalPorePressure_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Gewicht [kN/m]. + /// Looks up a localized string similar to Gewicht. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_Weight { + public static string MacroStabilityInwardsSlice_Weight_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_Weight", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_Weight_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Breedte [m]. + /// Looks up a localized string similar to Breedte. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_Width { + public static string MacroStabilityInwardsSlice_Width_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_Width", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_Width_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to X centrum [m]. + /// Looks up a localized string similar to X centrum. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_XCenter { + public static string MacroStabilityInwardsSlice_XCenter_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_XCenter", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_XCenter_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Z centrum bodem [m+NAP]. + /// Looks up a localized string similar to Z centrum bodem. /// - public static string MacroStabilityInwardsSlicesTable_ColumnHeader_ZCenterBottom { + public static string MacroStabilityInwardsSlice_ZCenterBottom_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSlicesTable_ColumnHeader_ZCenterBottom", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSlice_ZCenterBottom_DisplayName", resourceCulture); } } @@ -930,83 +948,83 @@ } /// - /// Looks up a localized string similar to Onverzadigd gewicht [kN/m³]. + /// Looks up a localized string similar to Onverzadigd gewicht. /// - public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_AbovePhreaticLevel { + public static string MacroStabilityInwardsSoilLayerData_AbovePhreaticLevel_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_AbovePhreaticLevel", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSoilLayerData_AbovePhreaticLevel_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Verzadigd gewicht [kN/m³]. + /// Looks up a localized string similar to Verzadigd gewicht. /// - public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_BelowPhreaticLevel { + public static string MacroStabilityInwardsSoilLayerData_BelowPhreaticLevel_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_BelowPhreaticLevel", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSoilLayerData_BelowPhreaticLevel_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Kleur. /// - public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_Color { + public static string MacroStabilityInwardsSoilLayerData_Color_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_Color", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSoilLayerData_Color_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Is aquifer. /// - public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_IsAquifer { + public static string MacroStabilityInwardsSoilLayerData_IsAquifer_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_IsAquifer", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSoilLayerData_IsAquifer_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Naam. /// - public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_MaterialName { + public static string MacroStabilityInwardsSoilLayerData_MaterialName_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_MaterialName", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSoilLayerData_MaterialName_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Schuifsterkte model. /// - public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_ShearStrengthModel { + public static string MacroStabilityInwardsSoilLayerData_ShearStrengthModel_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_ShearStrengthModel", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSoilLayerData_ShearStrengthModel_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Schuifsterkte ratio (S) [-]. + /// Looks up a localized string similar to Schuifsterkte ratio (S). /// - public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_ShearStrengthRatio { + public static string MacroStabilityInwardsSoilLayerData_ShearStrengthRatio_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_ShearStrengthRatio", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSoilLayerData_ShearStrengthRatio_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Sterkte toename exp (m) [-]. + /// Looks up a localized string similar to Sterkte toename exp (m). /// - public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_StrengthIncreaseExponent { + public static string MacroStabilityInwardsSoilLayerData_StrengthIncreaseExponent_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_StrengthIncreaseExponent", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSoilLayerData_StrengthIncreaseExponent_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Gebruik POP. /// - public static string MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_UsePop { + public static string MacroStabilityInwardsSoilLayerData_UsePop_DisplayName { get { - return ResourceManager.GetString("MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_UsePop", resourceCulture); + return ResourceManager.GetString("MacroStabilityInwardsSoilLayerData_UsePop_DisplayName", resourceCulture); } } @@ -1029,33 +1047,6 @@ } /// - /// Looks up a localized string similar to Cohesie [kN/m²]. - /// - public static string MacroStabilityInwardsTable_ColumnHeader_Cohesion { - get { - return ResourceManager.GetString("MacroStabilityInwardsTable_ColumnHeader_Cohesion", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Wrijvingshoek [°]. - /// - public static string MacroStabilityInwardsTable_ColumnHeader_FrictionAngle { - get { - return ResourceManager.GetString("MacroStabilityInwardsTable_ColumnHeader_FrictionAngle", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to POP [kN/m²]. - /// - public static string MacroStabilityInwardsTable_ColumnHeader_Pop { - get { - return ResourceManager.GetString("MacroStabilityInwardsTable_ColumnHeader_Pop", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Maximale breedte van een lamel.. /// public static string MaximumSliceWidth_Description { @@ -1335,6 +1326,15 @@ } /// + /// Looks up a localized string similar to POP. + /// + public static string Pop_DisplayName { + get { + return ResourceManager.GetString("Pop_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to De grensspanningen in de ondergrondschematisatie.. /// public static string PreconsolidationStresses_Description { @@ -1371,6 +1371,15 @@ } /// + /// Looks up a localized string similar to Uitvoer per lamel. + /// + public static string SliceParameters_DisplayName { + get { + return ResourceManager.GetString("SliceParameters_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Lamellen. /// public static string Slices_DisplayName { @@ -1590,6 +1599,69 @@ } /// + /// Looks up a localized string similar to [°]. + /// + public static string Unit_Degree { + get { + return ResourceManager.GetString("Unit_Degree", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [kN/m³]. + /// + public static string Unit_KiloNewtonPerCubicMeter { + get { + return ResourceManager.GetString("Unit_KiloNewtonPerCubicMeter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [kN/m]. + /// + public static string Unit_KiloNewtonPerMeter { + get { + return ResourceManager.GetString("Unit_KiloNewtonPerMeter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [kN/m²]. + /// + public static string Unit_KiloNewtonPerSquareMeter { + get { + return ResourceManager.GetString("Unit_KiloNewtonPerSquareMeter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [m]. + /// + public static string Unit_Meter { + get { + return ResourceManager.GetString("Unit_Meter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [m+NAP]. + /// + public static string Unit_MeterAboveNAP { + get { + return ResourceManager.GetString("Unit_MeterAboveNAP", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [-]. + /// + public static string Unit_None { + get { + return ResourceManager.GetString("Unit_None", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Gebruik standaard waterstandsverschillen voor het bepalen van de freatische lijn?. /// public static string UseDefaultOffsets_Description { Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.resx =================================================================== diff -u -r8d246ac6328e6e649ff6e78dfe3fac210d789ba0 -r52bf1eb466e06cc2da8d336229ebb8caaa877ba8 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 8d246ac6328e6e649ff6e78dfe3fac210d789ba0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -226,31 +226,31 @@ Handmatig toetspeil invoeren - + Naam - + Kleur - + Is aquifer - - Onverzadigd gewicht [kN/m³] + + Onverzadigd gewicht - - Verzadigd gewicht [kN/m³] + + Verzadigd gewicht - + Schuifsterkte model - - Schuifsterkte ratio (S) [-] + + Schuifsterkte ratio (S) - - Sterkte toename exp (m) [-] + + Sterkte toename exp (m) - + Gebruik POP @@ -652,70 +652,70 @@ Zones extreem - - Booglengte [m] + + Booglengte - - Bodemhoek [°] + + Bodemhoek - - Cohesie [kN/m²] + + Cohesie - - Effectieve spanning [kN/m²] + + Effectieve spanning - - Effectieve spanning (dagelijks) [kN/m²] + + Effectieve spanning (dagelijks) - - Wrijvingshoek [°] + + Wrijvingshoek - - Horizontale waterspanning op maaiveld [kN/m²] + + Horizontale waterspanning op maaiveld - - Spanning belasting [kN/m²] + + Spanning belasting - - Normaalspanning [kN/m²] + + Normaalspanning - - OCR [-] + + OCR - - Piezometrische waterspanning [kN/m²] + + Piezometrische waterspanning - - POP [kN/m²] + + POP - - Waterspanning op maaiveld [kN/m²] + + Waterspanning op maaiveld - - Schuifspanning [kN/m²] + + Schuifspanning - - Tophoek [°] + + Tophoek - - Totale waterspanning [kN/m²] + + Totale waterspanning - - Verticale waterspanning op maaiveld [kN/m²] + + Verticale waterspanning op maaiveld - - Gewicht [kN/m] + + Gewicht - - Breedte [m] + + Breedte - - X centrum [m] + + X centrum - - Z centrum bodem [m+NAP] + + Z centrum bodem - + Naam @@ -736,4 +736,28 @@ Zoneringsgrens rechts + + Uitvoer per lamel + + + [°] + + + [kN/m] + + + [kN/m²] + + + [kN/m³] + + + [m] + + + [m+NAP] + + + [-] + \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj =================================================================== diff -u -rc4392a12110e2bb3549c5fee1ec319c229b67198 -r52bf1eb466e06cc2da8d336229ebb8caaa877ba8 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj (.../Ringtoets.MacroStabilityInwards.Forms.csproj) (revision c4392a12110e2bb3549c5fee1ec319c229b67198) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj (.../Ringtoets.MacroStabilityInwards.Forms.csproj) (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -44,6 +44,8 @@ Properties\GlobalAssembly.cs + + Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputChartControl.cs =================================================================== diff -u -r2351e33d2db5e822abd37b63a88930d9239528b7 -r52bf1eb466e06cc2da8d336229ebb8caaa877ba8 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputChartControl.cs (.../MacroStabilityInwardsOutputChartControl.cs) (revision 2351e33d2db5e822abd37b63a88930d9239528b7) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsOutputChartControl.cs (.../MacroStabilityInwardsOutputChartControl.cs) (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -65,6 +65,22 @@ private readonly ChartLineData rightCircleRadiusChartData; private readonly ChartMultipleLineData tangentLinesChartData; + private readonly ChartDataCollection sliceParametersChartDataCollection; + private readonly ChartMultipleAreaData sliceCohesionChartData; + private readonly ChartMultipleAreaData sliceEffectiveStressChartData; + private readonly ChartMultipleAreaData sliceEffectiveStressDailyChartData; + private readonly ChartMultipleAreaData sliceTotalPorePressureChartData; + private readonly ChartMultipleAreaData sliceWeightChartData; + private readonly ChartMultipleAreaData slicePiezometricPorePressureChartData; + private readonly ChartMultipleAreaData slicePorePressureChartData; + private readonly ChartMultipleAreaData sliceVerticalPorePressureChartData; + private readonly ChartMultipleAreaData sliceHorizontalPorePressureChartData; + private readonly ChartMultipleAreaData sliceOverConsolidationRatioChartData; + private readonly ChartMultipleAreaData slicePopChartData; + private readonly ChartMultipleAreaData sliceNormalStressChartData; + private readonly ChartMultipleAreaData sliceShearStressChartData; + private readonly ChartMultipleAreaData sliceLoadStressChartData; + private readonly List soilLayerChartDataLookup; private readonly IDictionary phreaticLineExtremeLookup; @@ -108,8 +124,24 @@ slipPlaneChartData = MacroStabilityInwardsChartDataFactory.CreateSlipPlaneChartData(); leftCircleRadiusChartData = MacroStabilityInwardsChartDataFactory.CreateActiveCircleRadiusChartData(); rightCircleRadiusChartData = MacroStabilityInwardsChartDataFactory.CreatePassiveCircleRadiusChartData(); - slicesChartData = MacroStabilityInwardsChartDataFactory.CreateSlicesChartData(); + slicesChartData = MacroStabilityInwardsSliceChartDataFactory.CreateSlicesChartData(); + sliceParametersChartDataCollection = MacroStabilityInwardsSliceChartDataFactory.CreateSliceParametersChartDataCollection(); + sliceCohesionChartData = MacroStabilityInwardsSliceChartDataFactory.CreateCohesionChartData(); + sliceEffectiveStressChartData = MacroStabilityInwardsSliceChartDataFactory.CreateEffectiveStressChartData(); + sliceEffectiveStressDailyChartData = MacroStabilityInwardsSliceChartDataFactory.CreateEffectiveStressDailyChartData(); + sliceTotalPorePressureChartData = MacroStabilityInwardsSliceChartDataFactory.CreateTotalPorePressureChartData(); + sliceWeightChartData = MacroStabilityInwardsSliceChartDataFactory.CreateWeightChartData(); + slicePiezometricPorePressureChartData = MacroStabilityInwardsSliceChartDataFactory.CreatePiezometricPorePressureChartData(); + slicePorePressureChartData = MacroStabilityInwardsSliceChartDataFactory.CreatePorePressureChartData(); + sliceVerticalPorePressureChartData = MacroStabilityInwardsSliceChartDataFactory.CreateVerticalPorePressureChartData(); + sliceHorizontalPorePressureChartData = MacroStabilityInwardsSliceChartDataFactory.CreateHorizontalPorePressureChartData(); + sliceOverConsolidationRatioChartData = MacroStabilityInwardsSliceChartDataFactory.CreateOverConsolidationRatioChartData(); + slicePopChartData = MacroStabilityInwardsSliceChartDataFactory.CreatePopChartData(); + sliceNormalStressChartData = MacroStabilityInwardsSliceChartDataFactory.CreateNormalStressChartData(); + sliceShearStressChartData = MacroStabilityInwardsSliceChartDataFactory.CreateShearStressChartData(); + sliceLoadStressChartData = MacroStabilityInwardsSliceChartDataFactory.CreateLoadStressChartData(); + chartDataCollection.Add(soilProfileChartData); chartDataCollection.Add(surfaceLineChartData); chartDataCollection.Add(surfaceLevelInsideChartData); @@ -134,6 +166,22 @@ chartDataCollection.Add(leftCircleRadiusChartData); chartDataCollection.Add(rightCircleRadiusChartData); + chartDataCollection.Add(sliceParametersChartDataCollection); + sliceParametersChartDataCollection.Add(sliceLoadStressChartData); + sliceParametersChartDataCollection.Add(sliceShearStressChartData); + sliceParametersChartDataCollection.Add(sliceNormalStressChartData); + sliceParametersChartDataCollection.Add(slicePopChartData); + sliceParametersChartDataCollection.Add(sliceOverConsolidationRatioChartData); + sliceParametersChartDataCollection.Add(sliceHorizontalPorePressureChartData); + sliceParametersChartDataCollection.Add(sliceVerticalPorePressureChartData); + sliceParametersChartDataCollection.Add(slicePorePressureChartData); + sliceParametersChartDataCollection.Add(slicePiezometricPorePressureChartData); + sliceParametersChartDataCollection.Add(sliceWeightChartData); + sliceParametersChartDataCollection.Add(sliceTotalPorePressureChartData); + sliceParametersChartDataCollection.Add(sliceEffectiveStressDailyChartData); + sliceParametersChartDataCollection.Add(sliceEffectiveStressChartData); + sliceParametersChartDataCollection.Add(sliceCohesionChartData); + soilLayerChartDataLookup = new List(); phreaticLineExtremeLookup = new Dictionary(); @@ -178,6 +226,7 @@ UpdateOutputChartData(); chartDataCollection.Collection.ForEachElementDo(cd => cd.NotifyObservers()); + sliceParametersChartDataCollection.Collection.ForEachElementDo(cd => cd.NotifyObservers()); } } @@ -191,11 +240,30 @@ slipPlaneChartData.Points = MacroStabilityInwardsChartDataPointsFactory.CreateSlipPlanePoints(output?.SlidingCurve); leftCircleRadiusChartData.Points = MacroStabilityInwardsChartDataPointsFactory.CreateLeftCircleRadiusPoints(output?.SlidingCurve); rightCircleRadiusChartData.Points = MacroStabilityInwardsChartDataPointsFactory.CreateRightCircleRadiusPoints(output?.SlidingCurve); - slicesChartData.Areas = MacroStabilityInwardsChartDataPointsFactory.CreateSliceAreas(output?.SlidingCurve.Slices); + slicesChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateSliceAreas(output?.SlidingCurve); tangentLinesChartData.Lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines(output?.SlipPlane.TangentLines, data.InputParameters.SurfaceLine); + SetSliceParameterChartData(output?.SlidingCurve); } + private void SetSliceParameterChartData(MacroStabilityInwardsSlidingCurve slidingCurve) + { + sliceCohesionChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateCohesionAreas(slidingCurve); + sliceEffectiveStressChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateEffectiveStressAreas(slidingCurve); + sliceEffectiveStressDailyChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateEffectiveStressDailyAreas(slidingCurve); + sliceTotalPorePressureChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateTotalPorePressureAreas(slidingCurve); + sliceWeightChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateWeightAreas(slidingCurve); + slicePiezometricPorePressureChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePiezometricPorePressureAreas(slidingCurve); + slicePorePressureChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePorePressureAreas(slidingCurve); + sliceVerticalPorePressureChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateVerticalPorePressureAreas(slidingCurve); + sliceHorizontalPorePressureChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateHorizontalPorePressureAreas(slidingCurve); + sliceOverConsolidationRatioChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateOverConsolidationRatioAreas(slidingCurve); + slicePopChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePopAreas(slidingCurve); + sliceNormalStressChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateNormalStressAreas(slidingCurve); + sliceShearStressChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateShearStressAreas(slidingCurve); + sliceLoadStressChartData.Areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateLoadStressAreas(slidingCurve); + } + private void UpdateInputChartData() { MacroStabilityInwardsInput input = data.InputParameters; Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSlicesTable.cs =================================================================== diff -u -r1d682d2d79d3dc08fc5a8c0ebac889d996dfb492 -r52bf1eb466e06cc2da8d336229ebb8caaa877ba8 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSlicesTable.cs (.../MacroStabilityInwardsSlicesTable.cs) (revision 1d682d2d79d3dc08fc5a8c0ebac889d996dfb492) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSlicesTable.cs (.../MacroStabilityInwardsSlicesTable.cs) (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -54,70 +54,70 @@ private void AddColumns() { AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.Name), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_Name, + Resources.MacroStabilityInwardsSlice_Name_DisplayName, true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.XCenter), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_XCenter, + $"{Resources.MacroStabilityInwardsSlice_XCenter_DisplayName} {Resources.Unit_Meter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.ZCenterBottom), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_ZCenterBottom, + $"{Resources.MacroStabilityInwardsSlice_ZCenterBottom_DisplayName} {Resources.Unit_MeterAboveNAP}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.Width), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_Width, + $"{Resources.MacroStabilityInwardsSlice_Width_DisplayName} {Resources.Unit_Meter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.ArcLength), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_ArcLength, + $"{Resources.MacroStabilityInwardsSlice_ArcLength_DisplayName} {Resources.Unit_Meter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.TopAngle), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_TopAngle, + $"{Resources.MacroStabilityInwardsSlice_TopAngle_DisplayName} {Resources.Unit_Degree}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.BottomAngle), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_BottomAngle, + $"{Resources.MacroStabilityInwardsSlice_BottomAngle_DisplayName} {Resources.Unit_Degree}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.FrictionAngle), - Resources.MacroStabilityInwardsTable_ColumnHeader_FrictionAngle, + $"{Resources.FrictionAngle_DisplayName} {Resources.Unit_Degree}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.Cohesion), - Resources.MacroStabilityInwardsTable_ColumnHeader_Cohesion, + $"{Resources.Cohesion_DisplayName} {Resources.Unit_KiloNewtonPerSquareMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.EffectiveStress), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_EffectiveStress, + $"{Resources.MacroStabilityInwardsSlice_EffectiveStress_DisplayName} {Resources.Unit_KiloNewtonPerSquareMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.EffectiveStressDaily), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_EffectiveStressDaily, + $"{Resources.MacroStabilityInwardsSlice_EffectiveStressDaily_DisplayName} {Resources.Unit_KiloNewtonPerSquareMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.TotalPorePressure), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_TotalPorePressure, + $"{Resources.MacroStabilityInwardsSlice_TotalPorePressure_DisplayName} {Resources.Unit_KiloNewtonPerSquareMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.Weight), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_Weight, + $"{Resources.MacroStabilityInwardsSlice_Weight_DisplayName} {Resources.Unit_KiloNewtonPerMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.PiezometricPorePressure), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_PiezometricPorePressure, + $"{Resources.MacroStabilityInwardsSlice_PiezometricPorePressure_DisplayName} {Resources.Unit_KiloNewtonPerSquareMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.PorePressure), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_PorePressure, + $"{Resources.MacroStabilityInwardsSlice_PorePressure_DisplayName} {Resources.Unit_KiloNewtonPerSquareMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.VerticalPorePressure), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_VerticalPorePressure, + $"{Resources.MacroStabilityInwardsSlice_VerticalPorePressure_DisplayName} {Resources.Unit_KiloNewtonPerSquareMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.HorizontalPorePressure), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_HorizontalPorePressure, + $"{Resources.MacroStabilityInwardsSlice_HorizontalPorePressure_DisplayName} {Resources.Unit_KiloNewtonPerSquareMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.OverConsolidationRatio), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_OverConsolidationRatio, + $"{Resources.MacroStabilityInwardsSlice_OverConsolidationRatio_DisplayName} {Resources.Unit_None}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.Pop), - Resources.MacroStabilityInwardsTable_ColumnHeader_Pop, + $"{Resources.Pop_DisplayName} {Resources.Unit_KiloNewtonPerSquareMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.NormalStress), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_NormalStress, + $"{Resources.MacroStabilityInwardsSlice_NormalStress_DisplayName} {Resources.Unit_KiloNewtonPerSquareMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.ShearStress), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_ShearStress, + $"{Resources.MacroStabilityInwardsSlice_ShearStress_DisplayName} {Resources.Unit_KiloNewtonPerSquareMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsSliceRow.LoadStress), - Resources.MacroStabilityInwardsSlicesTable_ColumnHeader_LoadStress, + $"{Resources.MacroStabilityInwardsSlice_LoadStress_DisplayName} {Resources.Unit_KiloNewtonPerSquareMeter}", true); } } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSoilLayerDataTable.cs =================================================================== diff -u -r3353bf211a1b34b81752a0dcdc40c153a94df1fa -r52bf1eb466e06cc2da8d336229ebb8caaa877ba8 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSoilLayerDataTable.cs (.../MacroStabilityInwardsSoilLayerDataTable.cs) (revision 3353bf211a1b34b81752a0dcdc40c153a94df1fa) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsSoilLayerDataTable.cs (.../MacroStabilityInwardsSoilLayerDataTable.cs) (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -54,39 +54,39 @@ private void AddColumns() { AddTextBoxColumn(nameof(MacroStabilityInwardsFormattedSoilLayerDataRow.MaterialName), - Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_MaterialName, + Resources.MacroStabilityInwardsSoilLayerData_MaterialName_DisplayName, true); AddColorColumn(nameof(MacroStabilityInwardsFormattedSoilLayerDataRow.Color), - Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_Color); + Resources.MacroStabilityInwardsSoilLayerData_Color_DisplayName); AddCheckBoxColumn(nameof(MacroStabilityInwardsFormattedSoilLayerDataRow.IsAquifer), - Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_IsAquifer, + Resources.MacroStabilityInwardsSoilLayerData_IsAquifer_DisplayName, true); AddTextBoxColumn(nameof(MacroStabilityInwardsFormattedSoilLayerDataRow.AbovePhreaticLevel), - Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_AbovePhreaticLevel, + $"{Resources.MacroStabilityInwardsSoilLayerData_AbovePhreaticLevel_DisplayName} {Resources.Unit_KiloNewtonPerCubicMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsFormattedSoilLayerDataRow.BelowPhreaticLevel), - Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_BelowPhreaticLevel, + $"{Resources.MacroStabilityInwardsSoilLayerData_BelowPhreaticLevel_DisplayName} {Resources.Unit_KiloNewtonPerCubicMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsFormattedSoilLayerDataRow.ShearStrengthModel), - Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_ShearStrengthModel, + Resources.MacroStabilityInwardsSoilLayerData_ShearStrengthModel_DisplayName, true); AddTextBoxColumn(nameof(MacroStabilityInwardsFormattedSoilLayerDataRow.Cohesion), - Resources.MacroStabilityInwardsTable_ColumnHeader_Cohesion, + $"{Resources.Cohesion_DisplayName} {Resources.Unit_KiloNewtonPerSquareMeter}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsFormattedSoilLayerDataRow.FrictionAngle), - Resources.MacroStabilityInwardsTable_ColumnHeader_FrictionAngle, + $"{Resources.FrictionAngle_DisplayName} {Resources.Unit_Degree}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsFormattedSoilLayerDataRow.ShearStrengthRatio), - Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_ShearStrengthRatio, + $"{Resources.MacroStabilityInwardsSoilLayerData_ShearStrengthRatio_DisplayName} {Resources.Unit_None}", true); AddTextBoxColumn(nameof(MacroStabilityInwardsFormattedSoilLayerDataRow.StrengthIncreaseExponent), - Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_StrengthIncreaseExponent, + $"{Resources.MacroStabilityInwardsSoilLayerData_StrengthIncreaseExponent_DisplayName} {Resources.Unit_None}", true); AddCheckBoxColumn(nameof(MacroStabilityInwardsFormattedSoilLayerDataRow.UsePop), - Resources.MacroStabilityInwardsSoilLayerDataTable_ColumnHeader_UsePop, + Resources.MacroStabilityInwardsSoilLayerData_UsePop_DisplayName, true); AddTextBoxColumn(nameof(MacroStabilityInwardsFormattedSoilLayerDataRow.Pop), - Resources.MacroStabilityInwardsTable_ColumnHeader_Pop, + $"{Resources.Pop_DisplayName} {Resources.Unit_KiloNewtonPerSquareMeter}", true); } } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsChartDataFactoryTest.cs =================================================================== diff -u -r2351e33d2db5e822abd37b63a88930d9239528b7 -r52bf1eb466e06cc2da8d336229ebb8caaa877ba8 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsChartDataFactoryTest.cs (.../MacroStabilityInwardsChartDataFactoryTest.cs) (revision 2351e33d2db5e822abd37b63a88930d9239528b7) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsChartDataFactoryTest.cs (.../MacroStabilityInwardsChartDataFactoryTest.cs) (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -71,7 +71,7 @@ [Test] [TestCase(true)] [TestCase(false)] - public void CreateWaternetZoneChartData_WithVisibility_ReturnsEmptyChartLineDataWithExpectedVisibility(bool isVisible) + public void CreateWaternetZoneChartData_WithVisibility_ReturnsEmptyChartLineDataWithExpectedStylingAndVisibility(bool isVisible) { // Setup const string name = "zone"; @@ -100,7 +100,7 @@ [Test] [TestCase(true)] [TestCase(false)] - public void CreatePhreaticLineChartData_WithVisibility_ReturnsEmptyChartLineDataWithExpectedVisibility(bool isVisible) + public void CreatePhreaticLineChartData_WithVisibility_ReturnsEmptyChartLineDataWithExpectedStylingAndVisibility(bool isVisible) { // Setup const string name = "zone"; @@ -296,18 +296,6 @@ } [Test] - public void CreateSlicesChartData_ReturnsChartMultipleAreaData() - { - // Call - ChartMultipleAreaData data = MacroStabilityInwardsChartDataFactory.CreateSlicesChartData(); - - // Assert - CollectionAssert.IsEmpty(data.Areas); - Assert.AreEqual("Lamellen", data.Name); - AssertEqualStyle(data.Style, Color.Empty, Color.DarkGreen, 2, true); - } - - [Test] public void CreateTangentLinesChartData_ReturnsChartMultipleLineData() { // Call Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsChartDataPointsFactoryTest.cs =================================================================== diff -u -rf85578eb9fbbd05088386a9b17f9687f832b051a -r52bf1eb466e06cc2da8d336229ebb8caaa877ba8 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsChartDataPointsFactoryTest.cs (.../MacroStabilityInwardsChartDataPointsFactoryTest.cs) (revision f85578eb9fbbd05088386a9b17f9687f832b051a) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsChartDataPointsFactoryTest.cs (.../MacroStabilityInwardsChartDataPointsFactoryTest.cs) (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -38,53 +38,53 @@ public class MacroStabilityInwardsChartDataPointsFactoryTest { [Test] - public void CreateSurfaceLinePoints_SurfaceLineNull_ReturnsEmptyPointsArray() + public void CreateSurfaceLinePoints_SurfaceLineNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLinePoints(null); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLinePoints(null); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateSurfaceLinePoints_GivenSurfaceLine_ReturnsSurfaceLinePointsArray() + public void CreateSurfaceLinePoints_GivenSurfaceLine_ReturnsSurfaceLinePointsCollection() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLinePoints(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLinePoints(surfaceLine); // Assert AssertEqualPointCollection(surfaceLine.LocalGeometry, points); } [Test] - public void CreateSurfaceLevelOutsidePoint_SurfaceLineNull_ReturnsEmptyPointsArray() + public void CreateSurfaceLevelOutsidePoint_SurfaceLineNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLevelOutsidePoint(null); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLevelOutsidePoint(null); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateSurfaceLevelOutsidePoint_SurfaceLevelOutsideNull_ReturnsEmptyPointsArray() + public void CreateSurfaceLevelOutsidePoint_SurfaceLevelOutsideNull_ReturnsEmptyPointsCollection() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLevelOutsidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLevelOutsidePoint(surfaceLine); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateSurfaceLevelOutsidePoint_GivenSurfaceLineWithSurfaceLevelOutside_ReturnsSurfaceLevelOutsideArray() + public void CreateSurfaceLevelOutsidePoint_GivenSurfaceLineWithSurfaceLevelOutside_ReturnsSurfaceLevelOutsidePointsCollection() { // Setup var surfaceLevelOutside = new Point3D(1.2, 2.3, 4.0); @@ -93,37 +93,37 @@ surfaceLine.SetSurfaceLevelOutsideAt(surfaceLevelOutside); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLevelOutsidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLevelOutsidePoint(surfaceLine); // Assert AssertEqualLocalPointCollection(surfaceLevelOutside, surfaceLine, points); } [Test] - public void CreateDikeToeAtRiverPoint_SurfaceLineNull_ReturnsEmptyPointsArray() + public void CreateDikeToeAtRiverPoint_SurfaceLineNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeToeAtRiverPoint(null); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeToeAtRiverPoint(null); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateDikeToeAtRiverPoint_SurfaceLevelOutsideNull_ReturnsEmptyPointsArray() + public void CreateDikeToeAtRiverPoint_DikeToeAtRiverNull_ReturnsEmptyPointsCollection() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeToeAtRiverPoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeToeAtRiverPoint(surfaceLine); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateDikeToeAtRiverPoint_GivenSurfaceLineWithDikeToeAtRiver_ReturnsDikeToeAtRiverPointsArray() + public void CreateDikeToeAtRiverPoint_GivenSurfaceLineWithDikeToeAtRiver_ReturnsDikeToeAtRiverPointsCollection() { // Setup var dikeToeAtRiver = new Point3D(1.2, 2.3, 4.0); @@ -132,37 +132,37 @@ surfaceLine.SetDikeToeAtRiverAt(dikeToeAtRiver); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeToeAtRiverPoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeToeAtRiverPoint(surfaceLine); // Assert AssertEqualLocalPointCollection(dikeToeAtRiver, surfaceLine, points); } [Test] - public void CreateDikeTopAtPolderPoint_SurfaceLineNull_ReturnsEmptyPointsArray() + public void CreateDikeTopAtPolderPoint_SurfaceLineNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeTopAtPolderPoint(null); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeTopAtPolderPoint(null); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateDikeTopAtPolderPoint_DikeTopAtPolderNull_ReturnsEmptyPointsArray() + public void CreateDikeTopAtPolderPoint_DikeTopAtPolderNull_ReturnsEmptyPointsCollection() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeTopAtPolderPoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeTopAtPolderPoint(surfaceLine); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateDikeTopAtPolderPoint_GivenSurfaceLineWithDikeTopAtPolder_ReturnsDikeTopAtPolderPointsArray() + public void CreateDikeTopAtPolderPoint_GivenSurfaceLineWithDikeTopAtPolder_ReturnsDikeTopAtPolderPointsCollection() { // Setup var dikeTopAtPolder = new Point3D(1.2, 2.3, 4.0); @@ -171,37 +171,37 @@ surfaceLine.SetDikeTopAtPolderAt(dikeTopAtPolder); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeTopAtPolderPoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeTopAtPolderPoint(surfaceLine); // Assert AssertEqualLocalPointCollection(dikeTopAtPolder, surfaceLine, points); } [Test] - public void CreateShoulderBaseInsidePoint_SurfaceLineNull_ReturnsEmptyPointsArray() + public void CreateShoulderBaseInsidePoint_SurfaceLineNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateShoulderBaseInsidePoint(null); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateShoulderBaseInsidePoint(null); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateShoulderBaseInsidePoint_ShoulderBaseInsideNull_ReturnsEmptyPointsArray() + public void CreateShoulderBaseInsidePoint_ShoulderBaseInsideNull_ReturnsEmptyPointsCollection() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateShoulderBaseInsidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateShoulderBaseInsidePoint(surfaceLine); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateShoulderBaseInsidePoint_GivenSurfaceLineWithShoulderBaseInside_ReturnsShoulderBaseInsidePointsArray() + public void CreateShoulderBaseInsidePoint_GivenSurfaceLineWithShoulderBaseInside_ReturnsShoulderBaseInsidePointsCollection() { // Setup var shoulderBaseInside = new Point3D(1.2, 2.3, 4.0); @@ -210,37 +210,37 @@ surfaceLine.SetShoulderBaseInsideAt(shoulderBaseInside); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateShoulderBaseInsidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateShoulderBaseInsidePoint(surfaceLine); // Assert AssertEqualLocalPointCollection(shoulderBaseInside, surfaceLine, points); } [Test] - public void CreateShoulderTopInsidePoint_SurfaceLineNull_ReturnsEmptyPointsArray() + public void CreateShoulderTopInsidePoint_SurfaceLineNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateShoulderTopInsidePoint(null); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateShoulderTopInsidePoint(null); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateShoulderTopInsidePoint_ShoulderTopInsideNull_ReturnsEmptyPointsArray() + public void CreateShoulderTopInsidePoint_ShoulderTopInsideNull_ReturnsEmptyPointsCollection() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateShoulderTopInsidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateShoulderTopInsidePoint(surfaceLine); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateShoulderTopInsidePoint_GivenSurfaceLineWithShoulderTopInside_ReturnsShoulderTopInsidePointsArray() + public void CreateShoulderTopInsidePoint_GivenSurfaceLineWithShoulderTopInside_ReturnsShoulderTopInsidePointsCollection() { // Setup var shoulderTopInside = new Point3D(1.2, 2.3, 4.0); @@ -249,37 +249,37 @@ surfaceLine.SetShoulderTopInsideAt(shoulderTopInside); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateShoulderTopInsidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateShoulderTopInsidePoint(surfaceLine); // Assert AssertEqualLocalPointCollection(shoulderTopInside, surfaceLine, points); } [Test] - public void CreateDikeToeAtPolderPoint_SurfaceLineNull_ReturnsEmptyPointsArray() + public void CreateDikeToeAtPolderPoint_SurfaceLineNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeToeAtPolderPoint(null); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeToeAtPolderPoint(null); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateDikeToeAtPolderPoint_DikeToeAtPolderNull_ReturnsEmptyPointsArray() + public void CreateDikeToeAtPolderPoint_DikeToeAtPolderNull_ReturnsEmptyPointsCollection() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeToeAtPolderPoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeToeAtPolderPoint(surfaceLine); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateDikeToeAtPolderPoint_GivenSurfaceLineWithDikeToeAtPolder_ReturnsDikeToeAtPolderPointsArray() + public void CreateDikeToeAtPolderPoint_GivenSurfaceLineWithDikeToeAtPolder_ReturnsDikeToeAtPolderPointsCollection() { // Setup var dikeToeAtPolder = new Point3D(1.2, 2.3, 4.0); @@ -288,37 +288,37 @@ surfaceLine.SetDikeToeAtPolderAt(dikeToeAtPolder); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeToeAtPolderPoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeToeAtPolderPoint(surfaceLine); // Assert AssertEqualLocalPointCollection(dikeToeAtPolder, surfaceLine, points); } [Test] - public void CreateDikeTopAtRiverPoint_SurfaceLineNull_ReturnsEmptyPointsArray() + public void CreateDikeTopAtRiverPoint_SurfaceLineNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeTopAtRiverPoint(null); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeTopAtRiverPoint(null); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateDikeTopAtRiverPoint_DikeTopAtRiverNull_ReturnsEmptyPointsArray() + public void CreateDikeTopAtRiverPoint_DikeTopAtRiverNull_ReturnsEmptyPointsCollection() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeTopAtRiverPoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeTopAtRiverPoint(surfaceLine); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateDikeTopAtRiverPoint_GivenSurfaceLineWithDikeTopAtRiver_ReturnsDikeTopAtRiverPointsArray() + public void CreateDikeTopAtRiverPoint_GivenSurfaceLineWithDikeTopAtRiver_ReturnsDikeTopAtRiverPointsCollection() { // Setup var dikeTopAtRiver = new Point3D(1.2, 2.3, 4.0); @@ -327,37 +327,37 @@ surfaceLine.SetDikeTopAtRiverAt(dikeTopAtRiver); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeTopAtRiverPoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDikeTopAtRiverPoint(surfaceLine); // Assert AssertEqualLocalPointCollection(dikeTopAtRiver, surfaceLine, points); } [Test] - public void CreateDitchDikeSidePoint_SurfaceLineNull_ReturnsEmptyPointsArray() + public void CreateDitchDikeSidePoint_SurfaceLineNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDitchDikeSidePoint(null); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDitchDikeSidePoint(null); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateDitchDikeSidePoint_DitchDikeSideNull_ReturnsEmptyPointsArray() + public void CreateDitchDikeSidePoint_DitchDikeSideNull_ReturnsEmptyPointsCollection() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDitchDikeSidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDitchDikeSidePoint(surfaceLine); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateDitchDikeSidePoint_GivenSurfaceLineWithDitchDikeSide_ReturnsDitchDikeSidePointsArray() + public void CreateDitchDikeSidePoint_GivenSurfaceLineWithDitchDikeSide_ReturnsDitchDikeSidePointsCollection() { // Setup var ditchDikeSide = new Point3D(1.2, 2.3, 4.0); @@ -366,37 +366,37 @@ surfaceLine.SetDitchDikeSideAt(ditchDikeSide); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDitchDikeSidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDitchDikeSidePoint(surfaceLine); // Assert AssertEqualLocalPointCollection(ditchDikeSide, surfaceLine, points); } [Test] - public void CreateBottomDitchDikeSidePoint_SurfaceLineNull_ReturnsEmptyPointsArray() + public void CreateBottomDitchDikeSidePoint_SurfaceLineNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateBottomDitchDikeSidePoint(null); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateBottomDitchDikeSidePoint(null); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateBottomDitchDikeSidePoint_BottomDitchDikeSideNull_ReturnsEmptyPointsArray() + public void CreateBottomDitchDikeSidePoint_BottomDitchDikeSideNull_ReturnsEmptyPointsCollection() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateBottomDitchDikeSidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateBottomDitchDikeSidePoint(surfaceLine); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateBottomDitchDikeSidePoint_GivenSurfaceLineWithBottomDitchDikeSide_ReturnsBottomDitchDikeSidePointsArray() + public void CreateBottomDitchDikeSidePoint_GivenSurfaceLineWithBottomDitchDikeSide_ReturnsBottomDitchDikeSidePointsCollection() { // Setup var bottomDitchDikeSide = new Point3D(1.2, 2.3, 4.0); @@ -405,37 +405,37 @@ surfaceLine.SetBottomDitchDikeSideAt(bottomDitchDikeSide); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateBottomDitchDikeSidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateBottomDitchDikeSidePoint(surfaceLine); // Assert AssertEqualLocalPointCollection(bottomDitchDikeSide, surfaceLine, points); } [Test] - public void CreateBottomDitchPolderSidePoint_SurfaceLineNull_ReturnsEmptyPointsArray() + public void CreateBottomDitchPolderSidePoint_SurfaceLineNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateBottomDitchPolderSidePoint(null); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateBottomDitchPolderSidePoint(null); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateBottomDitchPolderSidePoint_BottomDitchPolderSideNull_ReturnsEmptyPointsArray() + public void CreateBottomDitchPolderSidePoint_BottomDitchPolderSideNull_ReturnsEmptyPointsCollection() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateBottomDitchPolderSidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateBottomDitchPolderSidePoint(surfaceLine); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateBottomDitchPolderSidePoint_GivenSurfaceLineWithBottomDitchPolderSide_ReturnsBottomDitchPolderSidePointsArray() + public void CreateBottomDitchPolderSidePoint_GivenSurfaceLineWithBottomDitchPolderSide_ReturnsBottomDitchPolderSidePointsCollection() { // Setup var bottomDitchPolderSide = new Point3D(1.2, 2.3, 4.0); @@ -444,37 +444,37 @@ surfaceLine.SetBottomDitchPolderSideAt(bottomDitchPolderSide); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateBottomDitchPolderSidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateBottomDitchPolderSidePoint(surfaceLine); // Assert AssertEqualLocalPointCollection(bottomDitchPolderSide, surfaceLine, points); } [Test] - public void CreateDitchPolderSidePoint_SurfaceLineNull_ReturnsEmptyPointsArray() + public void CreateDitchPolderSidePoint_SurfaceLineNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDitchPolderSidePoint(null); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDitchPolderSidePoint(null); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateDitchPolderSidePoint_DitchPolderSideNull_ReturnsEmptyPointsArray() + public void CreateDitchPolderSidePoint_DitchPolderSideNull_ReturnsEmptyPointsCollection() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDitchPolderSidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDitchPolderSidePoint(surfaceLine); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateDitchPolderSidePoint_GivenSurfaceLineWithDitchPolderSide_ReturnsDitchPolderSidePointsArray() + public void CreateDitchPolderSidePoint_GivenSurfaceLineWithDitchPolderSide_ReturnsDitchPolderSidePointsCollection() { // Setup var ditchPolderSide = new Point3D(1.2, 2.3, 4.0); @@ -483,37 +483,37 @@ surfaceLine.SetDitchPolderSideAt(ditchPolderSide); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateDitchPolderSidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateDitchPolderSidePoint(surfaceLine); // Assert AssertEqualLocalPointCollection(ditchPolderSide, surfaceLine, points); } [Test] - public void CreateSurfaceLevelInsidePoint_SurfaceLineNull_ReturnsEmptyPointsArray() + public void CreateSurfaceLevelInsidePoint_SurfaceLineNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLevelInsidePoint(null); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLevelInsidePoint(null); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateSurfaceLevelInsidePoint_SurfaceLevelInsideNull_ReturnsEmptyPointsArray() + public void CreateSurfaceLevelInsidePoint_SurfaceLevelInsideNull_ReturnsEmptyPointsCollection() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLevelInsidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLevelInsidePoint(surfaceLine); // Assert CollectionAssert.IsEmpty(points); } [Test] - public void CreateSurfaceLevelInsidePoint_GivenSurfaceLineWithSurfaceLevelInside_ReturnsSurfaceLevelInsidePointsArray() + public void CreateSurfaceLevelInsidePoint_GivenSurfaceLineWithSurfaceLevelInside_ReturnsSurfaceLevelInsidePointsCollection() { // Setup var surfaceLevelInside = new Point3D(1.2, 2.3, 4.0); @@ -522,7 +522,7 @@ surfaceLine.SetSurfaceLevelInsideAt(surfaceLevelInside); // Call - Point2D[] points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLevelInsidePoint(surfaceLine); + IEnumerable points = MacroStabilityInwardsChartDataPointsFactory.CreateSurfaceLevelInsidePoint(surfaceLine); // Assert AssertEqualLocalPointCollection(surfaceLevelInside, surfaceLine, points); @@ -532,7 +532,7 @@ public void CreateGridPointsWithGridDeterminationType_MacroStabilityInwardsGridNull_ReturnsEmptyPoints() { // Call - Point2D[] gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(null, MacroStabilityInwardsGridDeterminationType.Manual); + IEnumerable gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(null, MacroStabilityInwardsGridDeterminationType.Manual); // Assert CollectionAssert.IsEmpty(gridPoints); @@ -553,7 +553,7 @@ }; // Call - Point2D[] gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid, MacroStabilityInwardsGridDeterminationType.Automatic); + IEnumerable gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid, MacroStabilityInwardsGridDeterminationType.Automatic); // Assert CollectionAssert.IsEmpty(gridPoints); @@ -567,7 +567,7 @@ public void CreateGridPointsWithGridDeterminationType_MacroStabilityInwardsGridNumberOfPointsNoGrid_ReturnsEmptyPoints(MacroStabilityInwardsGrid grid) { // Call - Point2D[] gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid, MacroStabilityInwardsGridDeterminationType.Manual); + IEnumerable gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid, MacroStabilityInwardsGridDeterminationType.Manual); // Assert CollectionAssert.IsEmpty(gridPoints); @@ -582,7 +582,7 @@ MacroStabilityInwardsGrid grid) { // Call - Point2D[] gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid, MacroStabilityInwardsGridDeterminationType.Manual); + IEnumerable gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid, MacroStabilityInwardsGridDeterminationType.Manual); // Assert AssertEqualPointCollection(new[] @@ -597,10 +597,10 @@ "CreateGridPointsWithGridDeterminationType" })] public void CreateGridPointsWithGridDeterminationType_MacroStabilityInwardsGridSettingsOnlyHorizontalPoints_ReturnsGridPointsAtBottomSide( - MacroStabilityInwardsGrid grid, Point2D[] expectedPoints) + MacroStabilityInwardsGrid grid, IEnumerable expectedPoints) { // Call - Point2D[] gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid, MacroStabilityInwardsGridDeterminationType.Manual); + IEnumerable gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid, MacroStabilityInwardsGridDeterminationType.Manual); // Assert AssertEqualPointCollection(expectedPoints, gridPoints); @@ -612,10 +612,10 @@ "CreateGridPointsWithGridDeterminationType" })] public void CreateGridPointsWithGridDeterminationType_CreateGridPoints_MacroStabilityInwardsGridSettingsOnlyVerticallPoints_ReturnsGridPointsAtLeftSide - (MacroStabilityInwardsGrid grid, Point2D[] expectedPoints) + (MacroStabilityInwardsGrid grid, IEnumerable expectedPoints) { // Call - Point2D[] gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid, MacroStabilityInwardsGridDeterminationType.Manual); + IEnumerable gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid, MacroStabilityInwardsGridDeterminationType.Manual); // Assert AssertEqualPointCollection(expectedPoints, gridPoints); @@ -627,10 +627,10 @@ "CreateGridPointsWithGridDeterminationType" })] public void CreateGridPointsWithGridDeterminationType_MacroStabilityInwardsWellDefinedGrid_ReturnsExpectedGridPoints( - MacroStabilityInwardsGrid grid, Point2D[] expectedPoints) + MacroStabilityInwardsGrid grid, IEnumerable expectedPoints) { // Call - Point2D[] gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid, MacroStabilityInwardsGridDeterminationType.Manual); + IEnumerable gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid, MacroStabilityInwardsGridDeterminationType.Manual); // Assert AssertEqualPointCollection(expectedPoints, gridPoints); @@ -640,7 +640,7 @@ public void CreateGridPoints_MacroStabilityInwardsGridNull_ReturnsEmptyPoints() { // Call - Point2D[] gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(null); + IEnumerable gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(null); // Assert CollectionAssert.IsEmpty(gridPoints); @@ -654,7 +654,7 @@ public void CreateGridPoints_MacroStabilityInwardsGridNumberOfPointsNoGrid_ReturnsEmptyPoints(MacroStabilityInwardsGrid grid) { // Call - Point2D[] gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid); + IEnumerable gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid); // Assert CollectionAssert.IsEmpty(gridPoints); @@ -669,7 +669,7 @@ MacroStabilityInwardsGrid grid) { // Call - Point2D[] gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid); + IEnumerable gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid); // Assert AssertEqualPointCollection(new[] @@ -684,10 +684,10 @@ "CreateGridPoints" })] public void CreateGridPoints_MacroStabilityInwardsGridSettingsOnlyHorizontalPoints_ReturnsGridPointsAtBottomSide( - MacroStabilityInwardsGrid grid, Point2D[] expectedPoints) + MacroStabilityInwardsGrid grid, IEnumerable expectedPoints) { // Call - Point2D[] gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid); + IEnumerable gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid); // Assert AssertEqualPointCollection(expectedPoints, gridPoints); @@ -699,10 +699,10 @@ "CreateGridPoints" })] public void CreateGridPoints_CreateGridPoints_MacroStabilityInwardsGridSettingsOnlyVerticallPoints_ReturnsGridPointsAtLeftSide - (MacroStabilityInwardsGrid grid, Point2D[] expectedPoints) + (MacroStabilityInwardsGrid grid, IEnumerable expectedPoints) { // Call - Point2D[] gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid); + IEnumerable gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid); // Assert AssertEqualPointCollection(expectedPoints, gridPoints); @@ -714,10 +714,10 @@ "CreateGridPoints" })] public void CreateGridPoints_MacroStabilityInwardsWellDefinedGrid_ReturnsExpectedGridPoints( - MacroStabilityInwardsGrid grid, Point2D[] expectedPoints) + MacroStabilityInwardsGrid grid, IEnumerable expectedPoints) { // Call - Point2D[] gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid); + IEnumerable gridPoints = MacroStabilityInwardsChartDataPointsFactory.CreateGridPoints(grid); // Assert AssertEqualPointCollection(expectedPoints, gridPoints); @@ -727,7 +727,7 @@ public void CreateOuterRingArea_SoilLayerNull_ReturnsEmptyAreaCollection() { // Call - IEnumerable outerRing = MacroStabilityInwardsChartDataPointsFactory.CreateOuterRingArea(null); + IEnumerable> outerRing = MacroStabilityInwardsChartDataPointsFactory.CreateOuterRingArea(null); // Assert CollectionAssert.IsEmpty(outerRing); @@ -747,7 +747,7 @@ var layer = new MacroStabilityInwardsSoilLayer2D(outerRing); // Call - IEnumerable outerRingChartData = MacroStabilityInwardsChartDataPointsFactory.CreateOuterRingArea(layer); + IEnumerable> outerRingChartData = MacroStabilityInwardsChartDataPointsFactory.CreateOuterRingArea(layer); // Assert CollectionAssert.AreEqual(new[] @@ -757,17 +757,17 @@ } [Test] - public void CreatePhreaticLinePoints_PhreaticLineNull_ReturnsEmptyPointsArray() + public void CreatePhreaticLinePoints_PhreaticLineNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] line = MacroStabilityInwardsChartDataPointsFactory.CreatePhreaticLinePoints(null); + IEnumerable line = MacroStabilityInwardsChartDataPointsFactory.CreatePhreaticLinePoints(null); // Assert CollectionAssert.IsEmpty(line); } [Test] - public void CreatePhreaticLinePoints_WithPhreaticLine_ReturnsPointsArray() + public void CreatePhreaticLinePoints_WithPhreaticLine_ReturnsPointsCollection() { // Setup var points = new[] @@ -778,41 +778,41 @@ }; // Call - Point2D[] line = MacroStabilityInwardsChartDataPointsFactory.CreatePhreaticLinePoints(new MacroStabilityInwardsPhreaticLine("Test", - points)); + IEnumerable line = MacroStabilityInwardsChartDataPointsFactory.CreatePhreaticLinePoints(new MacroStabilityInwardsPhreaticLine("Test", + points)); // Assert CollectionAssert.AreEqual(points, line); } [Test] - public void CreateWaternetZonePoints_WaternetLineNull_ReturnsEmptyPointsArray() + public void CreateWaternetZonePoints_WaternetLineNull_ReturnsEmptyPointsCollection() { // Setup MacroStabilityInwardsSurfaceLine surfaceLine = GetSurfaceLineWithGeometry(); // Call - IEnumerable zone = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(null, surfaceLine); + IEnumerable> zone = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(null, surfaceLine); // Assert CollectionAssert.IsEmpty(zone); } [Test] - public void CreateWaternetZonePoints_SurfaceLineNull_ReturnsEmptyPointsArray() + public void CreateWaternetZonePoints_SurfaceLineNull_ReturnsEmptyPointsCollection() { // Setup var waternetLine = new TestMacroStabilityInwardsWaternetLine(); // Call - IEnumerable zone = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, null); + IEnumerable> zone = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, null); // Assert CollectionAssert.IsEmpty(zone); } [Test] - public void CreateWaternetZonePoints_WaternetLineGeometryEmpty_ReturnsEmptyPointsArray() + public void CreateWaternetZonePoints_WaternetLineGeometryEmpty_ReturnsEmptyPointsCollection() { // Setup var phreaticLineGeometry = new[] @@ -834,14 +834,14 @@ }); // Call - Point2D[][] zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine).ToArray(); + IEnumerable> zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine); // Assert CollectionAssert.IsEmpty(zones); } [Test] - public void CreateWaternetZonePoints_PhreaticLineGeometryEmpty_ReturnsEmptyPointsArray() + public void CreateWaternetZonePoints_PhreaticLineGeometryEmpty_ReturnsEmptyPointsCollection() { // Setup var waternetLineGeometry = new[] @@ -863,32 +863,32 @@ }); // Call - Point2D[][] zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine).ToArray(); + IEnumerable> zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine); // Assert CollectionAssert.IsEmpty(zones); } [Test] [TestCaseSource(nameof(GetPhreaticLineAndWaternetLineConfigurationsBelowSurfaceLine))] - public void CreateWaternetZonePoints_DifferentWaternetLineAndPhreaticLineBelowSurfaceLineConfigurations_ReturnsPointsArray( + public void CreateWaternetZonePoints_DifferentWaternetLineAndPhreaticLineBelowSurfaceLineConfigurations_ReturnsPointsCollection( MacroStabilityInwardsSurfaceLine surfaceLine, MacroStabilityInwardsWaternetLine waternetLine, - Point2D[][] expectedZones) + IEnumerable> expectedZones) { // Call - Point2D[][] zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine).ToArray(); + IEnumerable> zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine); // Assert - Assert.AreEqual(expectedZones.Length, zones.Length); - for (var i = 0; i < expectedZones.Length; i++) + Assert.AreEqual(expectedZones.Count(), zones.Count()); + for (var i = 0; i < expectedZones.Count(); i++) { - CollectionAssert.AreEqual(expectedZones[i], zones[i]); + CollectionAssert.AreEqual(expectedZones.ElementAt(i), zones.ElementAt(i)); } } [Test] - public void CreateWaternetZonePoints_PhreaticLineAboveSurfaceLineBeforeIntersectionPointWithSurfaceLine_ReturnsPointsArray() + public void CreateWaternetZonePoints_PhreaticLineAboveSurfaceLineBeforeIntersectionPointWithSurfaceLine_ReturnsPointsCollection() { // Setup var phreaticLineGeometry = new[] @@ -915,10 +915,9 @@ }); // Call - Point2D[][] zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine).ToArray(); + IEnumerable> zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine); // Assert - Assert.AreEqual(1, zones.Length); CollectionAssert.AreEqual(new[] { new Point2D(0, 2), @@ -934,11 +933,11 @@ new Point2D(1.09, -2), new Point2D(0, -2), new Point2D(0, 2) - }, zones[0], new Point2DComparerWithTolerance(1e-2)); + }, zones.Single(), new Point2DComparerWithTolerance(1e-2)); } [Test] - public void CreateWaternetZonePoints_PhreaticLineBelowSurfaceLineBeforeIntersectionPointWithSurfaceLine_ReturnsPointsArray() + public void CreateWaternetZonePoints_PhreaticLineBelowSurfaceLineBeforeIntersectionPointWithSurfaceLine_ReturnsPointsCollection() { // Setup var waternetLineGeometry = new[] @@ -964,10 +963,9 @@ }); // Call - Point2D[][] zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine).ToArray(); + IEnumerable> zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine); // Assert - Assert.AreEqual(1, zones.Length); CollectionAssert.AreEqual(new[] { new Point2D(0, 2), @@ -979,11 +977,11 @@ new Point2D(3, -2), new Point2D(0, -2), new Point2D(0, 2) - }, zones[0], new Point2DComparerWithTolerance(1e-2)); + }, zones.Single(), new Point2DComparerWithTolerance(1e-2)); } [Test] - public void CreateWaternetZonePoints_WaternetAndPhreaticLinesIntersectSurfaceLine_ReturnsPointsArray() + public void CreateWaternetZonePoints_WaternetAndPhreaticLinesIntersectSurfaceLine_ReturnsPointsCollection() { // Setup var waternetLineGeometry = new[] @@ -1008,11 +1006,9 @@ MacroStabilityInwardsWaternetLine waternetLine = CreateWaternetLine(phreaticLineGeometry, waternetLineGeometry); // Call - Point2D[][] zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine).ToArray(); + IEnumerable> zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine); // Assert - Assert.AreEqual(1, zones.Length); - CollectionAssert.AreEqual(new[] { new Point2D(3.125, 7), @@ -1022,11 +1018,11 @@ new Point2D(5, 5), new Point2D(3.125, 5), new Point2D(3.125, 7) - }, zones[0]); + }, zones.Single()); } [Test] - public void CreateWaternetZonePoints_PhreaticLineIntersectsSurfaceLineAtMultiplePoints_ReturnsPointsArray() + public void CreateWaternetZonePoints_PhreaticLineIntersectsSurfaceLineAtMultiplePoints_ReturnsPointsCollection() { // Setup var waternetLineGeometry = new[] @@ -1052,10 +1048,9 @@ MacroStabilityInwardsWaternetLine waternetLine = CreateWaternetLine(phreaticLineGeometry, waternetLineGeometry); // Call - Point2D[][] zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine).ToArray(); + IEnumerable> zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine); // Assert - Assert.AreEqual(1, zones.Length); CollectionAssert.AreEqual(new[] { new Point2D(0, 2), @@ -1073,11 +1068,11 @@ new Point2D(3.125, -2), new Point2D(0, -2), new Point2D(0, 2) - }, zones[0]); + }, zones.Single()); } [Test] - public void CreateWaternetZonePoints_PhreaticLineIntersectsSurfaceLineAtMultiplePointsAndIntersectsWaternetLine_ReturnsPointsArray() + public void CreateWaternetZonePoints_PhreaticLineIntersectsSurfaceLineAtMultiplePointsAndIntersectsWaternetLine_ReturnsPointsCollection() { // Setup var waternetLineGeometry = new[] @@ -1104,10 +1099,10 @@ MacroStabilityInwardsWaternetLine waternetLine = CreateWaternetLine(phreaticLineGeometry, waternetLineGeometry); // Call - Point2D[][] zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine).ToArray(); + IEnumerable> zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine); // Assert - Assert.AreEqual(2, zones.Length); + Assert.AreEqual(2, zones.Count()); CollectionAssert.AreEqual(new[] { new Point2D(0, 2), @@ -1125,7 +1120,7 @@ new Point2D(3.125, -2), new Point2D(0, -2), new Point2D(0, 2) - }, zones[0], new Point2DComparerWithTolerance(1e-2)); + }, zones.ElementAt(0), new Point2DComparerWithTolerance(1e-2)); CollectionAssert.AreEqual(new[] { @@ -1134,12 +1129,12 @@ new Point2D(15, -8), new Point2D(13, -2), new Point2D(13, -2) - }, zones[1], new Point2DComparerWithTolerance(1e-2)); + }, zones.ElementAt(1), new Point2DComparerWithTolerance(1e-2)); } [Test] [TestCaseSource(nameof(GetPhreaticLineAndWaternetLineWithDifferentLengths))] - public void CreateWaternetZonePoints_PhreaticLineNotSameLength_ReturnsPointArray(IEnumerable waternetLineGeometry, + public void CreateWaternetZonePoints_PhreaticLineNotSameLength_ReturnsPointCollection(IEnumerable waternetLineGeometry, IEnumerable phreaticLineGeometry) { // Setup @@ -1153,18 +1148,17 @@ MacroStabilityInwardsWaternetLine waternetLine = CreateWaternetLine(waternetLineGeometry, phreaticLineGeometry); // Call - Point2D[][] zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine).ToArray(); + IEnumerable> zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine); // Assert - Assert.AreEqual(1, zones.Length); CollectionAssert.AreEqual(new[] { new Point2D(0, 0), new Point2D(5, 0), new Point2D(5, -2), new Point2D(0, -2), new Point2D(0, 0) - }, zones[0], new Point2DComparerWithTolerance(1e-2)); + }, zones.Single(), new Point2DComparerWithTolerance(1e-2)); } [Test] @@ -1197,32 +1191,31 @@ MacroStabilityInwardsWaternetLine waternetLine = CreateWaternetLine(phreaticLineGeometry, waternetLineGeometry); // Call - Point2D[][] zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine).ToArray(); + IEnumerable> zones = MacroStabilityInwardsChartDataPointsFactory.CreateWaternetZonePoints(waternetLine, surfaceLine); // Assert - Assert.AreEqual(1, zones.Length); CollectionAssert.AreEqual(new[] { new Point2D(11.18, 7), new Point2D(15, 8.97), new Point2D(15, -8), new Point2D(11.18, 3.46), new Point2D(11.18, 7) - }, zones[0], new Point2DComparerWithTolerance(1e-2)); + }, zones.Single(), new Point2DComparerWithTolerance(1e-2)); } [Test] - public void CreateSlipPlanePoints_SlidingCurveNull_ReturnsEmptyPointsArray() + public void CreateSlipPlanePoints_SlidingCurveNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] line = MacroStabilityInwardsChartDataPointsFactory.CreateSlipPlanePoints(null); + IEnumerable line = MacroStabilityInwardsChartDataPointsFactory.CreateSlipPlanePoints(null); // Assert CollectionAssert.IsEmpty(line); } [Test] - public void CreateSlipPlanePoints_SlidingCurveEmptySlices_ReturnsEmptyPointsArray() + public void CreateSlipPlanePoints_SlidingCurveEmptySlices_ReturnsEmptyPointsCollection() { // Setup var slidingCurve = new MacroStabilityInwardsSlidingCurve( @@ -1233,14 +1226,14 @@ 0.0); // Call - Point2D[] line = MacroStabilityInwardsChartDataPointsFactory.CreateSlipPlanePoints(slidingCurve); + IEnumerable line = MacroStabilityInwardsChartDataPointsFactory.CreateSlipPlanePoints(slidingCurve); // Assert CollectionAssert.IsEmpty(line); } [Test] - public void CreateSlipPlanePoints_WithSlidingCurve_ReturnsPointsArray() + public void CreateSlipPlanePoints_WithSlidingCurve_ReturnsPointsCollection() { // Setup var points = new[] @@ -1276,24 +1269,24 @@ 0.0); // Call - Point2D[] line = MacroStabilityInwardsChartDataPointsFactory.CreateSlipPlanePoints(slidingCurve); + IEnumerable line = MacroStabilityInwardsChartDataPointsFactory.CreateSlipPlanePoints(slidingCurve); // Assert CollectionAssert.AreEqual(points, line); } [Test] - public void CreateLeftCircleRadiusPoints_SlidingCurveNull_ReturnsEmptyPointsArray() + public void CreateLeftCircleRadiusPoints_SlidingCurveNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] line = MacroStabilityInwardsChartDataPointsFactory.CreateLeftCircleRadiusPoints(null); + IEnumerable line = MacroStabilityInwardsChartDataPointsFactory.CreateLeftCircleRadiusPoints(null); // Assert CollectionAssert.IsEmpty(line); } [Test] - public void CreateLeftCircleRadiusPoints_SlidingCurveEmptySlices_ReturnsEmptyPointsArray() + public void CreateLeftCircleRadiusPoints_SlidingCurveEmptySlices_ReturnsEmptyPointsCollection() { // Setup var slidingCurve = new MacroStabilityInwardsSlidingCurve( @@ -1304,14 +1297,14 @@ 0.0); // Call - Point2D[] line = MacroStabilityInwardsChartDataPointsFactory.CreateLeftCircleRadiusPoints(slidingCurve); + IEnumerable line = MacroStabilityInwardsChartDataPointsFactory.CreateLeftCircleRadiusPoints(slidingCurve); // Assert CollectionAssert.IsEmpty(line); } [Test] - public void CreateLeftCircleRadiusPoints_WithSlidingCurve_ReturnsPointsArray() + public void CreateLeftCircleRadiusPoints_WithSlidingCurve_ReturnsPointsCollection() { // Setup var points = new[] @@ -1335,24 +1328,24 @@ 0.0); // Call - Point2D[] line = MacroStabilityInwardsChartDataPointsFactory.CreateLeftCircleRadiusPoints(slidingCurve); + IEnumerable line = MacroStabilityInwardsChartDataPointsFactory.CreateLeftCircleRadiusPoints(slidingCurve); // Assert CollectionAssert.AreEqual(points, line); } [Test] - public void CreateRightCircleRadiusPoints_SlidingCurveNull_ReturnsEmptyPointsArray() + public void CreateRightCircleRadiusPoints_SlidingCurveNull_ReturnsEmptyPointsCollection() { // Call - Point2D[] line = MacroStabilityInwardsChartDataPointsFactory.CreateRightCircleRadiusPoints(null); + IEnumerable line = MacroStabilityInwardsChartDataPointsFactory.CreateRightCircleRadiusPoints(null); // Assert CollectionAssert.IsEmpty(line); } [Test] - public void CreateRightCircleRadiusPoints_SlidingCurveEmptySlices_ReturnsEmptyPointsArray() + public void CreateRightCircleRadiusPoints_SlidingCurveEmptySlices_ReturnsEmptyPointsCollection() { // Setup var slidingCurve = new MacroStabilityInwardsSlidingCurve( @@ -1363,14 +1356,14 @@ 0.0); // Call - Point2D[] line = MacroStabilityInwardsChartDataPointsFactory.CreateRightCircleRadiusPoints(slidingCurve); + IEnumerable line = MacroStabilityInwardsChartDataPointsFactory.CreateRightCircleRadiusPoints(slidingCurve); // Assert CollectionAssert.IsEmpty(line); } [Test] - public void CreateRightCircleRadiusPoints_WithSlidingCurve_ReturnsPointsArray() + public void CreateRightCircleRadiusPoints_WithSlidingCurve_ReturnsPointsCollection() { // Setup var points = new[] @@ -1394,69 +1387,17 @@ 0.0); // Call - Point2D[] line = MacroStabilityInwardsChartDataPointsFactory.CreateRightCircleRadiusPoints(slidingCurve); + IEnumerable line = MacroStabilityInwardsChartDataPointsFactory.CreateRightCircleRadiusPoints(slidingCurve); // Assert CollectionAssert.AreEqual(points, line); } [Test] - public void CreateSliceAreas_SlicesNull_ReturnsEmptyCollection() - { - // Call - IEnumerable areas = MacroStabilityInwardsChartDataPointsFactory.CreateSliceAreas(null); - - // Assert - CollectionAssert.IsEmpty(areas); - } - - [Test] - public void CreateSliceAreas_WithSlices_ReturnsAreas() - { - // Setup - var slices = - new[] - { - new MacroStabilityInwardsSlice(new Point2D(0, 1), - new Point2D(1, 1), - new Point2D(0, 0), - new Point2D(1, 0), - new MacroStabilityInwardsSlice.ConstructionProperties()), - new MacroStabilityInwardsSlice(new Point2D(3, 4), - new Point2D(4, 4), - new Point2D(3, 3), - new Point2D(4, 3), - new MacroStabilityInwardsSlice.ConstructionProperties()) - }; - - // Call - IEnumerable areas = MacroStabilityInwardsChartDataPointsFactory.CreateSliceAreas(slices); - - // Assert - CollectionAssert.AreEqual(new[] - { - new[] - { - new Point2D(0, 1), - new Point2D(1, 1), - new Point2D(1, 0), - new Point2D(0, 0) - }, - new[] - { - new Point2D(3, 4), - new Point2D(4, 4), - new Point2D(4, 3), - new Point2D(3, 3) - } - }, areas); - } - - [Test] public void CreateTangentLines_TangentLinesNull_ReturnsEmptyCollection() { // Call - IEnumerable lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines(null, new MacroStabilityInwardsSurfaceLine("line")); + IEnumerable> lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines(null, new MacroStabilityInwardsSurfaceLine("line")); // Assert CollectionAssert.IsEmpty(lines); @@ -1466,7 +1407,7 @@ public void CreateTangentLines_SurfaceLineNull_ReturnsEmptyCollection() { // Call - IEnumerable lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines(Enumerable.Empty(), null); + IEnumerable> lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines(Enumerable.Empty(), null); // Assert CollectionAssert.IsEmpty(lines); @@ -1484,7 +1425,7 @@ }); // Call - IEnumerable lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines(new[] + IEnumerable> lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines(new[] { (RoundedDouble) 2.5, (RoundedDouble) 5.8 @@ -1510,7 +1451,7 @@ public void CreateTangentLines_WithBoundaryParametersSurfaceLineNull_ReturnsEmptyCollection() { // Call - IEnumerable lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines( + IEnumerable> lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines( MacroStabilityInwardsGridDeterminationType.Manual, MacroStabilityInwardsTangentLineDeterminationType.Specified, (RoundedDouble) 0.0, @@ -1532,7 +1473,7 @@ public void CreateTangentLines_WithInvalidBoundaryParameters_ReturnsEmptyCollection(double bottom, double top) { // Call - IEnumerable lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines( + IEnumerable> lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines( MacroStabilityInwardsGridDeterminationType.Manual, MacroStabilityInwardsTangentLineDeterminationType.Specified, (RoundedDouble) bottom, @@ -1553,7 +1494,7 @@ MacroStabilityInwardsTangentLineDeterminationType tangentLineDeterminationType) { // Call - IEnumerable lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines( + IEnumerable> lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines( gridDeterminationType, tangentLineDeterminationType, (RoundedDouble) 10.0, @@ -1577,7 +1518,7 @@ }); // Call - IEnumerable lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines( + IEnumerable> lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines( MacroStabilityInwardsGridDeterminationType.Manual, MacroStabilityInwardsTangentLineDeterminationType.Specified, (RoundedDouble) 10.0, @@ -1608,7 +1549,7 @@ }); // Call - IEnumerable lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines( + IEnumerable> lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines( MacroStabilityInwardsGridDeterminationType.Manual, MacroStabilityInwardsTangentLineDeterminationType.Specified, (RoundedDouble) 10.0, @@ -1649,7 +1590,7 @@ }); // Call - IEnumerable lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines( + IEnumerable> lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines( MacroStabilityInwardsGridDeterminationType.Manual, MacroStabilityInwardsTangentLineDeterminationType.Specified, (RoundedDouble) 10.0, @@ -1690,7 +1631,7 @@ }); // Call - IEnumerable lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines( + IEnumerable> lines = MacroStabilityInwardsChartDataPointsFactory.CreateTangentLines( MacroStabilityInwardsGridDeterminationType.Manual, MacroStabilityInwardsTangentLineDeterminationType.Specified, (RoundedDouble) 10.0, Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsSliceChartDataFactoryTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsSliceChartDataFactoryTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsSliceChartDataFactoryTest.cs (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -0,0 +1,246 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Drawing; +using Core.Components.Chart.Data; +using Core.Components.Chart.Styles; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.Forms.Factories; + +namespace Ringtoets.MacroStabilityInwards.Forms.Test.Factories +{ + [TestFixture] + public class MacroStabilityInwardsSliceChartDataFactoryTest + { + [Test] + public void CreateSlicesChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreateSlicesChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("Lamellen", data.Name); + AssertEqualStyle(data.Style, Color.Empty, Color.DarkGreen, 2, true); + } + + [Test] + public void CreateSliceParametersChartDataCollection_ReturnsEmptyChartDataCollection() + { + // Call + ChartDataCollection data = MacroStabilityInwardsSliceChartDataFactory.CreateSliceParametersChartDataCollection(); + + // Assert + CollectionAssert.IsEmpty(data.Collection); + Assert.AreEqual("Uitvoer per lamel", data.Name); + } + + [Test] + public void CreateCohesionChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreateCohesionChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("Cohesie", data.Name); + Assert.IsFalse(data.IsVisible); + AssertEqualStyle(data.Style, Color.FromArgb(150, 255, 0, 0), Color.Black, 1, true); + } + + [Test] + public void CreateEffectiveStressChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreateEffectiveStressChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("Effectieve spanning", data.Name); + Assert.IsTrue(data.IsVisible); + AssertEqualStyle(data.Style, Color.FromArgb(150, 255, 0, 0), Color.Black, 1, true); + } + + [Test] + public void CreateEffectiveStressDailyChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreateEffectiveStressDailyChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("Effectieve spanning (dagelijks)", data.Name); + Assert.IsFalse(data.IsVisible); + AssertEqualStyle(data.Style, Color.FromArgb(150, 255, 0, 0), Color.Black, 1, true); + } + + [Test] + public void CreateTotalPorePressureChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreateTotalPorePressureChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("Totale waterspanning", data.Name); + Assert.IsFalse(data.IsVisible); + AssertEqualStyle(data.Style, Color.FromArgb(150, 255, 0, 0), Color.Black, 1, true); + } + + [Test] + public void CreateWeightChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreateWeightChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("Gewicht", data.Name); + Assert.IsFalse(data.IsVisible); + AssertEqualStyle(data.Style, Color.FromArgb(150, 255, 0, 0), Color.Black, 1, true); + } + + [Test] + public void CreatePiezometricPorePressureChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreatePiezometricPorePressureChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("Piezometrische waterspanning", data.Name); + Assert.IsFalse(data.IsVisible); + AssertEqualStyle(data.Style, Color.FromArgb(150, 255, 0, 0), Color.Black, 1, true); + } + + [Test] + public void CreatePorePressureChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreatePorePressureChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("Waterspanning op maaiveld", data.Name); + Assert.IsFalse(data.IsVisible); + AssertEqualStyle(data.Style, Color.FromArgb(150, 255, 0, 0), Color.Black, 1, true); + } + + [Test] + public void CreateVerticalPorePressureChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreateVerticalPorePressureChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("Verticale waterspanning op maaiveld", data.Name); + Assert.IsFalse(data.IsVisible); + AssertEqualStyle(data.Style, Color.FromArgb(150, 255, 0, 0), Color.Black, 1, true); + } + + [Test] + public void CreateHorizontalPorePressureChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreateHorizontalPorePressureChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("Horizontale waterspanning op maaiveld", data.Name); + Assert.IsFalse(data.IsVisible); + AssertEqualStyle(data.Style, Color.FromArgb(150, 255, 0, 0), Color.Black, 1, true); + } + + [Test] + public void CreateOverConsolidationRatioChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreateOverConsolidationRatioChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("OCR", data.Name); + Assert.IsFalse(data.IsVisible); + AssertEqualStyle(data.Style, Color.FromArgb(150, 255, 0, 0), Color.Black, 1, true); + } + + [Test] + public void CreatePopChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreatePopChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("POP", data.Name); + Assert.IsFalse(data.IsVisible); + AssertEqualStyle(data.Style, Color.FromArgb(150, 255, 0, 0), Color.Black, 1, true); + } + + [Test] + public void CreateNormalStressChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreateNormalStressChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("Normaalspanning", data.Name); + Assert.IsFalse(data.IsVisible); + AssertEqualStyle(data.Style, Color.FromArgb(150, 255, 0, 0), Color.Black, 1, true); + } + + [Test] + public void CreateShearStressChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreateShearStressChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("Schuifspanning", data.Name); + Assert.IsFalse(data.IsVisible); + AssertEqualStyle(data.Style, Color.FromArgb(150, 255, 0, 0), Color.Black, 1, true); + } + + [Test] + public void CreateLoadStressChartData_ReturnsChartMultipleAreaData() + { + // Call + ChartMultipleAreaData data = MacroStabilityInwardsSliceChartDataFactory.CreateLoadStressChartData(); + + // Assert + CollectionAssert.IsEmpty(data.Areas); + Assert.AreEqual("Spanning belasting", data.Name); + Assert.IsFalse(data.IsVisible); + AssertEqualStyle(data.Style, Color.FromArgb(150, 255, 0, 0), Color.Black, 1, true); + } + + private static void AssertEqualStyle(ChartAreaStyle areaStyle, Color fillColor, Color strokeColor, int width, bool isEditable) + { + Assert.AreEqual(fillColor, areaStyle.FillColor); + Assert.AreEqual(strokeColor, areaStyle.StrokeColor); + Assert.AreEqual(width, areaStyle.StrokeThickness); + Assert.AreEqual(isEditable, areaStyle.IsEditable); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsSliceChartDataPointsFactoryTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsSliceChartDataPointsFactoryTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Factories/MacroStabilityInwardsSliceChartDataPointsFactoryTest.cs (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -0,0 +1,2105 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Base.Geometry; +using Core.Common.Base.TestUtil.Geometry; +using NUnit.Framework; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.Data.TestUtil; +using Ringtoets.MacroStabilityInwards.Forms.Factories; + +namespace Ringtoets.MacroStabilityInwards.Forms.Test.Factories +{ + [TestFixture] + public class MacroStabilityInwardsSliceChartDataPointsFactoryTest + { + [Test] + public void CreateSliceAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateSliceAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + public void CreateSliceAreas_WithSlidingCurve_ReturnsAreas() + { + // Setup + var slidingCurve = new MacroStabilityInwardsSlidingCurve( + MacroStabilityInwardsSlidingCircleTestFactory.Create(), + MacroStabilityInwardsSlidingCircleTestFactory.Create(), + new[] + { + new MacroStabilityInwardsSlice(new Point2D(0, 1), + new Point2D(1, 1), + new Point2D(0, 0), + new Point2D(1, 0), + new MacroStabilityInwardsSlice.ConstructionProperties()), + new MacroStabilityInwardsSlice(new Point2D(3, 4), + new Point2D(4, 4), + new Point2D(3, 3), + new Point2D(4, 3), + new MacroStabilityInwardsSlice.ConstructionProperties()) + }, + 0.0, + 0.0); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateSliceAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 1), + new Point2D(1, 1), + new Point2D(1, 0), + new Point2D(0, 0) + }, + new[] + { + new Point2D(3, 4), + new Point2D(4, 4), + new Point2D(4, 3), + new Point2D(3, 3) + } + }, areas); + } + + [Test] + [TestCaseSource(nameof(GetCreateParameterMethods))] + public void CreateParameterAreas_ValueNaN_ReturnsExpectedAreas(Func>> createParameterAreas) + { + // Setup + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(new MacroStabilityInwardsSlice.ConstructionProperties()); + + // Call + IEnumerable> areas = createParameterAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 0), + new Point2D(0, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(1, 1), + new Point2D(1, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(2, 1), + new Point2D(1, 0) + } + }, areas); + } + + [Test] + public void CreateCohesionAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateCohesionAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + [TestCaseSource(nameof(GetValuesAboveUpperLimit))] + public void CreateCohesionAreas_ValueAboveUpperLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + Cohesion = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateCohesionAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -250), + new Point2D(0, -250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(251, 1), + new Point2D(251, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(178.776695, -175.776695), + new Point2D(177.776695, -176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + [TestCaseSource(nameof(GetValuesBelowLowerLimit))] + public void CreateCohesionAreas_ValueBelowLowerLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + Cohesion = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateCohesionAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 250), + new Point2D(0, 250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(-249, 1), + new Point2D(-249, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(-174.776695, 177.776695), + new Point2D(-175.776695, 176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateCohesionAreas_ValidParameters_ReturnsExpectedAreas() + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + Cohesion = 30.0 + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateCohesionAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -3.75), + new Point2D(0, -3.75) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(4.75, 1), + new Point2D(4.75, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(4.65165, -1.65165), + new Point2D(3.65165, -2.65165) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateEffectiveStressAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateEffectiveStressAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + [TestCaseSource(nameof(GetValuesAboveUpperLimit))] + public void CreateEffectiveStressAreas_ValueAboveUpperLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + EffectiveStress = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateEffectiveStressAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -250), + new Point2D(0, -250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(251, 1), + new Point2D(251, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(178.776695, -175.776695), + new Point2D(177.776695, -176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + [TestCaseSource(nameof(GetValuesBelowLowerLimit))] + public void CreateEffectiveStressAreas_ValueBelowLowerLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + EffectiveStress = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateEffectiveStressAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 250), + new Point2D(0, 250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(-249, 1), + new Point2D(-249, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(-174.776695, 177.776695), + new Point2D(-175.776695, 176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateEffectiveStressAreas_ValidParameters_ReturnsExpectedAreas() + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + EffectiveStress = 40.0 + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateEffectiveStressAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -5), + new Point2D(0, -5) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(6, 1), + new Point2D(6, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(5.535534, -2.535534), + new Point2D(4.535534, -3.535534) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateEffectiveStressDailyAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateEffectiveStressDailyAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + [TestCaseSource(nameof(GetValuesAboveUpperLimit))] + public void CreateEffectiveStressDailyAreas_ValueAboveUpperLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + EffectiveStressDaily = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateEffectiveStressDailyAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -250), + new Point2D(0, -250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(251, 1), + new Point2D(251, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(178.776695, -175.776695), + new Point2D(177.776695, -176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + [TestCaseSource(nameof(GetValuesBelowLowerLimit))] + public void CreateEffectiveStressDailyAreas_ValueBelowLowerLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + EffectiveStressDaily = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateEffectiveStressDailyAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 250), + new Point2D(0, 250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(-249, 1), + new Point2D(-249, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(-174.776695, 177.776695), + new Point2D(-175.776695, 176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateEffectiveStressDailyAreas_ValidParameters_ReturnsExpectedAreas() + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + EffectiveStressDaily = 50.0 + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateEffectiveStressDailyAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -6.25), + new Point2D(0, -6.25) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(7.25, 1), + new Point2D(7.25, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(6.419417, -3.419417), + new Point2D(5.419417, -4.419417) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateTotalPorePressureAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateTotalPorePressureAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + [TestCaseSource(nameof(GetValuesAboveUpperLimit))] + public void CreateTotalPorePressureAreas_ValueAboveUpperLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + TotalPorePressure = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateTotalPorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -250), + new Point2D(0, -250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(251, 1), + new Point2D(251, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(178.776695, -175.776695), + new Point2D(177.776695, -176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + [TestCaseSource(nameof(GetValuesBelowLowerLimit))] + public void CreateTotalPorePressureAreas_ValueBelowLowerLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + TotalPorePressure = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateTotalPorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 250), + new Point2D(0, 250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(-249, 1), + new Point2D(-249, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(-174.776695, 177.776695), + new Point2D(-175.776695, 176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateTotalPorePressureAreas_ValidParameters_ReturnsExpectedAreas() + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + TotalPorePressure = 60.0 + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateTotalPorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -7.5), + new Point2D(0, -7.5) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(8.5, 1), + new Point2D(8.5, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(7.303301, -4.303301), + new Point2D(6.303301, -5.303301) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateWeightAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateWeightAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + [TestCaseSource(nameof(GetValuesAboveUpperLimit))] + public void CreateWeightAreas_ValueAboveUpperLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + Weight = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateWeightAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -250), + new Point2D(0, -250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(251, 1), + new Point2D(251, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(178.776695, -175.776695), + new Point2D(177.776695, -176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + [TestCaseSource(nameof(GetValuesBelowLowerLimit))] + public void CreateWeightAreas_ValueBelowLowerLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + Weight = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateWeightAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 250), + new Point2D(0, 250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(-249, 1), + new Point2D(-249, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(-174.776695, 177.776695), + new Point2D(-175.776695, 176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateWeightAreas_ValidParameters_ReturnsExpectedAreas() + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + Weight = 70.0 + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateWeightAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -8.75), + new Point2D(0, -8.75) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(9.75, 1), + new Point2D(9.75, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(8.187184, -5.187184), + new Point2D(7.187184, -6.187184) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreatePiezometricPorePressureAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePiezometricPorePressureAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + [TestCaseSource(nameof(GetValuesAboveUpperLimit))] + public void CreatePiezometricPorePressureAreas_ValueAboveUpperLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + PiezometricPorePressure = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePiezometricPorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -250), + new Point2D(0, -250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(251, 1), + new Point2D(251, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(178.776695, -175.776695), + new Point2D(177.776695, -176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + [TestCaseSource(nameof(GetValuesBelowLowerLimit))] + public void CreatePiezometricPorePressureAreas_ValueBelowLowerLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + PiezometricPorePressure = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePiezometricPorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 250), + new Point2D(0, 250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(-249, 1), + new Point2D(-249, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(-174.776695, 177.776695), + new Point2D(-175.776695, 176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreatePiezometricPorePressureAreas_ValidParameters_ReturnsExpectedAreas() + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + PiezometricPorePressure = 80.0 + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePiezometricPorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -10), + new Point2D(0, -10) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(11, 1), + new Point2D(11, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(9.071068, -6.071068), + new Point2D(8.071068, -7.071068) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreatePorePressureAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePorePressureAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + [TestCaseSource(nameof(GetValuesAboveUpperLimit))] + public void CreatePorePressureAreas_ValueAboveUpperLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + PorePressure = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -250), + new Point2D(0, -250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(251, 1), + new Point2D(251, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(178.776695, -175.776695), + new Point2D(177.776695, -176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + [TestCaseSource(nameof(GetValuesBelowLowerLimit))] + public void CreatePorePressureAreas_ValueBelowLowerLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + PorePressure = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 250), + new Point2D(0, 250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(-249, 1), + new Point2D(-249, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(-174.776695, 177.776695), + new Point2D(-175.776695, 176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreatePorePressureAreas_ValidParameters_ReturnsExpectedAreas() + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + PorePressure = 90.0 + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -11.25), + new Point2D(0, -11.25) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(12.25, 1), + new Point2D(12.25, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(9.954951, -6.954951), + new Point2D(8.954951, -7.954951) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateVerticalPorePressureAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateVerticalPorePressureAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + [TestCaseSource(nameof(GetValuesAboveUpperLimit))] + public void CreateVerticalPorePressureAreas_ValueAboveUpperLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + VerticalPorePressure = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateVerticalPorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -250), + new Point2D(0, -250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(251, 1), + new Point2D(251, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(178.776695, -175.776695), + new Point2D(177.776695, -176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + [TestCaseSource(nameof(GetValuesBelowLowerLimit))] + public void CreateVerticalPorePressureAreas_ValueBelowLowerLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + VerticalPorePressure = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateVerticalPorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 250), + new Point2D(0, 250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(-249, 1), + new Point2D(-249, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(-174.776695, 177.776695), + new Point2D(-175.776695, 176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateVerticalPorePressureAreas_ValidParameters_ReturnsExpectedAreas() + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + VerticalPorePressure = 100.0 + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateVerticalPorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -12.5), + new Point2D(0, -12.5) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(13.5, 1), + new Point2D(13.5, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(10.838835, -7.838835), + new Point2D(9.838835, -8.838835) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateHorizontalPorePressureAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateHorizontalPorePressureAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + [TestCaseSource(nameof(GetValuesAboveUpperLimit))] + public void CreateHorizontalPorePressureAreas_ValueAboveUpperLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + HorizontalPorePressure = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateHorizontalPorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -250), + new Point2D(0, -250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(251, 1), + new Point2D(251, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(178.776695, -175.776695), + new Point2D(177.776695, -176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + [TestCaseSource(nameof(GetValuesBelowLowerLimit))] + public void CreateHorizontalPorePressureAreas_ValueBelowLowerLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + HorizontalPorePressure = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateHorizontalPorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 250), + new Point2D(0, 250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(-249, 1), + new Point2D(-249, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(-174.776695, 177.776695), + new Point2D(-175.776695, 176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateHorizontalPorePressureAreas_ValidParameters_ReturnsExpectedAreas() + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + HorizontalPorePressure = 110.0 + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateHorizontalPorePressureAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -13.75), + new Point2D(0, -13.75) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(14.75, 1), + new Point2D(14.75, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(11.722718, -8.722718), + new Point2D(10.722718, -9.722718) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateOverConsolidationRatioAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateOverConsolidationRatioAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + [TestCaseSource(nameof(GetValuesAboveUpperLimit))] + public void CreateOverConsolidationRatioAreas_ValueAboveUpperLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + OverConsolidationRatio = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateOverConsolidationRatioAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -100), + new Point2D(0, -100) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(101, 1), + new Point2D(101, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(72.710678, -69.710678), + new Point2D(71.710678, -70.710678) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + [TestCaseSource(nameof(GetValuesBelowLowerLimit))] + public void CreateOverConsolidationRatioAreas_ValueBelowLowerLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + OverConsolidationRatio = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateOverConsolidationRatioAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 100), + new Point2D(0, 100) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(-99, 1), + new Point2D(-99, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(-68.710678, 71.710678), + new Point2D(-69.710678, 70.710678) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateOverConsolidationRatioAreas_ValidParameters_ReturnsExpectedAreas() + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + OverConsolidationRatio = 40.0 + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateOverConsolidationRatioAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -2), + new Point2D(0, -2) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(3, 1), + new Point2D(3, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(3.414213, -0.414213), + new Point2D(2.414213, -1.414213) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreatePopAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePopAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + [TestCaseSource(nameof(GetValuesAboveUpperLimit))] + public void CreatePopAreas_ValueAboveUpperLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + Pop = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePopAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -250), + new Point2D(0, -250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(251, 1), + new Point2D(251, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(178.776695, -175.776695), + new Point2D(177.776695, -176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + [TestCaseSource(nameof(GetValuesBelowLowerLimit))] + public void CreatePopAreas_ValueBelowLowerLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + Pop = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePopAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 250), + new Point2D(0, 250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(-249, 1), + new Point2D(-249, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(-174.776695, 177.776695), + new Point2D(-175.776695, 176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreatePopAreas_ValidParameters_ReturnsExpectedAreas() + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + Pop = 120.0 + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreatePopAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -15), + new Point2D(0, -15) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(16, 1), + new Point2D(16, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(12.606602, -9.606602), + new Point2D(11.606602, -10.606602) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateNormalStressAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateNormalStressAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + [TestCaseSource(nameof(GetValuesAboveUpperLimit))] + public void CreateNormalStressAreas_ValueAboveUpperLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + NormalStress = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateNormalStressAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -250), + new Point2D(0, -250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(251, 1), + new Point2D(251, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(178.776695, -175.776695), + new Point2D(177.776695, -176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + [TestCaseSource(nameof(GetValuesBelowLowerLimit))] + public void CreateNormalStressAreas_ValueBelowLowerLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + NormalStress = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateNormalStressAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 250), + new Point2D(0, 250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(-249, 1), + new Point2D(-249, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(-174.776695, 177.776695), + new Point2D(-175.776695, 176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateNormalStressAreas_ValidParameters_ReturnsExpectedAreas() + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + NormalStress = 130.0 + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateNormalStressAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -16.25), + new Point2D(0, -16.25) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(17.25, 1), + new Point2D(17.25, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(13.490485, -10.490485), + new Point2D(12.490485, -11.490485) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateShearStressAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateShearStressAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + [TestCaseSource(nameof(GetValuesAboveUpperLimit))] + public void CreateShearStressAreas_ValueAboveUpperLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + ShearStress = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateShearStressAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -250), + new Point2D(0, -250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(251, 1), + new Point2D(251, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(178.776695, -175.776695), + new Point2D(177.776695, -176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + [TestCaseSource(nameof(GetValuesBelowLowerLimit))] + public void CreateShearStressAreas_ValueBelowLowerLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + ShearStress = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateShearStressAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 250), + new Point2D(0, 250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(-249, 1), + new Point2D(-249, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(-174.776695, 177.776695), + new Point2D(-175.776695, 176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateShearStressAreas_ValidParameters_ReturnsExpectedAreas() + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + ShearStress = 150.0 + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateShearStressAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -18.75), + new Point2D(0, -18.75) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(19.75, 1), + new Point2D(19.75, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(15.258252, -12.258252), + new Point2D(14.258252, -13.258252) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateLoadStressAreas_SlidingCurveNull_ReturnsEmptyCollection() + { + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateLoadStressAreas(null); + + // Assert + CollectionAssert.IsEmpty(areas); + } + + [Test] + [TestCaseSource(nameof(GetValuesAboveUpperLimit))] + public void CreateLoadStressAreas_ValueAboveUpperLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + LoadStress = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateLoadStressAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -250), + new Point2D(0, -250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(251, 1), + new Point2D(251, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(178.776695, -175.776695), + new Point2D(177.776695, -176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + [TestCaseSource(nameof(GetValuesBelowLowerLimit))] + public void CreateLoadStressAreas_ValueBelowLowerLimit_ReturnsExpectedAreas(double value) + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + LoadStress = value + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateLoadStressAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, 250), + new Point2D(0, 250) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(-249, 1), + new Point2D(-249, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(-174.776695, 177.776695), + new Point2D(-175.776695, 176.776695) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + [Test] + public void CreateLoadStressAreas_ValidParameters_ReturnsExpectedAreas() + { + // Setup + var constructionProperties = new MacroStabilityInwardsSlice.ConstructionProperties + { + LoadStress = 160.0 + }; + + MacroStabilityInwardsSlidingCurve slidingCurve = CreateSlidingCurve(constructionProperties); + + // Call + IEnumerable> areas = MacroStabilityInwardsSliceChartDataPointsFactory.CreateLoadStressAreas(slidingCurve); + + // Assert + CollectionAssert.AreEqual(new[] + { + new[] + { + new Point2D(0, 0), + new Point2D(1, 0), + new Point2D(1, -20), + new Point2D(0, -20) + }, + new[] + { + new Point2D(1, 0), + new Point2D(1, 1), + new Point2D(21, 1), + new Point2D(21, 0) + }, + new[] + { + new Point2D(1, 0), + new Point2D(2, 1), + new Point2D(16.142136, -13.142136), + new Point2D(15.142136, -14.142136) + } + }, areas, new Point2DComparerWithTolerance(1e-6)); + } + + private static IEnumerable GetCreateParameterMethods() + { + yield return new TestCaseData(new Func>>( + MacroStabilityInwardsSliceChartDataPointsFactory.CreateCohesionAreas)) + .SetName(nameof(MacroStabilityInwardsSliceChartDataPointsFactory.CreateCohesionAreas)); + yield return new TestCaseData(new Func>>( + MacroStabilityInwardsSliceChartDataPointsFactory.CreateEffectiveStressAreas)) + .SetName(nameof(MacroStabilityInwardsSliceChartDataPointsFactory.CreateEffectiveStressAreas)); + yield return new TestCaseData(new Func>>( + MacroStabilityInwardsSliceChartDataPointsFactory.CreateEffectiveStressDailyAreas)) + .SetName(nameof(MacroStabilityInwardsSliceChartDataPointsFactory.CreateEffectiveStressDailyAreas)); + yield return new TestCaseData(new Func>>( + MacroStabilityInwardsSliceChartDataPointsFactory.CreateTotalPorePressureAreas)) + .SetName(nameof(MacroStabilityInwardsSliceChartDataPointsFactory.CreateTotalPorePressureAreas)); + yield return new TestCaseData(new Func>>( + MacroStabilityInwardsSliceChartDataPointsFactory.CreateWeightAreas)) + .SetName(nameof(MacroStabilityInwardsSliceChartDataPointsFactory.CreateWeightAreas)); + yield return new TestCaseData(new Func>>( + MacroStabilityInwardsSliceChartDataPointsFactory.CreatePiezometricPorePressureAreas)) + .SetName(nameof(MacroStabilityInwardsSliceChartDataPointsFactory.CreatePiezometricPorePressureAreas)); + yield return new TestCaseData(new Func>>( + MacroStabilityInwardsSliceChartDataPointsFactory.CreatePorePressureAreas)) + .SetName(nameof(MacroStabilityInwardsSliceChartDataPointsFactory.CreatePorePressureAreas)); + yield return new TestCaseData(new Func>>( + MacroStabilityInwardsSliceChartDataPointsFactory.CreateVerticalPorePressureAreas)) + .SetName(nameof(MacroStabilityInwardsSliceChartDataPointsFactory.CreateVerticalPorePressureAreas)); + yield return new TestCaseData(new Func>>( + MacroStabilityInwardsSliceChartDataPointsFactory.CreateHorizontalPorePressureAreas)) + .SetName(nameof(MacroStabilityInwardsSliceChartDataPointsFactory.CreateHorizontalPorePressureAreas)); + yield return new TestCaseData(new Func>>( + MacroStabilityInwardsSliceChartDataPointsFactory.CreateOverConsolidationRatioAreas)) + .SetName(nameof(MacroStabilityInwardsSliceChartDataPointsFactory.CreateOverConsolidationRatioAreas)); + yield return new TestCaseData(new Func>>( + MacroStabilityInwardsSliceChartDataPointsFactory.CreatePopAreas)) + .SetName(nameof(MacroStabilityInwardsSliceChartDataPointsFactory.CreatePopAreas)); + yield return new TestCaseData(new Func>>( + MacroStabilityInwardsSliceChartDataPointsFactory.CreatePopAreas)) + .SetName(nameof(MacroStabilityInwardsSliceChartDataPointsFactory.CreateNormalStressAreas)); + yield return new TestCaseData(new Func>>( + MacroStabilityInwardsSliceChartDataPointsFactory.CreatePopAreas)) + .SetName(nameof(MacroStabilityInwardsSliceChartDataPointsFactory.CreateShearStressAreas)); + yield return new TestCaseData(new Func>>( + MacroStabilityInwardsSliceChartDataPointsFactory.CreatePopAreas)) + .SetName(nameof(MacroStabilityInwardsSliceChartDataPointsFactory.CreateLoadStressAreas)); + } + + private static IEnumerable GetValuesAboveUpperLimit() + { + yield return new TestCaseData(2000.0); + yield return new TestCaseData(3500.0); + yield return new TestCaseData(double.MaxValue); + } + + private static IEnumerable GetValuesBelowLowerLimit() + { + yield return new TestCaseData(-2000.0); + yield return new TestCaseData(-3500.0); + yield return new TestCaseData(double.MinValue); + } + + private static MacroStabilityInwardsSlidingCurve CreateSlidingCurve(MacroStabilityInwardsSlice.ConstructionProperties constructionProperties) + { + return new MacroStabilityInwardsSlidingCurve( + MacroStabilityInwardsSlidingCircleTestFactory.Create(), + MacroStabilityInwardsSlidingCircleTestFactory.Create(), new[] + { + new MacroStabilityInwardsSlice(new Point2D(0, 1), + new Point2D(1, 1), + new Point2D(0, 0), + new Point2D(1, 0), + constructionProperties), + new MacroStabilityInwardsSlice(new Point2D(0, 0), + new Point2D(0, 1), + new Point2D(1, 0), + new Point2D(1, 1), + constructionProperties), + new MacroStabilityInwardsSlice(new Point2D(0, 1), + new Point2D(1, 2), + new Point2D(1, 0), + new Point2D(2, 1), + constructionProperties) + }, + 0.0, + 0.0); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj =================================================================== diff -u -ra5e08e189250782e4349a926b0fb43f8d53904a4 -r52bf1eb466e06cc2da8d336229ebb8caaa877ba8 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj (.../Ringtoets.MacroStabilityInwards.Forms.Test.csproj) (revision a5e08e189250782e4349a926b0fb43f8d53904a4) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj (.../Ringtoets.MacroStabilityInwards.Forms.Test.csproj) (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -58,6 +58,8 @@ Properties\GlobalAssembly.cs + + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.TestUtil/MacroStabilityInwardsOutputViewChartDataAssert.cs =================================================================== diff -u -rf85578eb9fbbd05088386a9b17f9687f832b051a -r52bf1eb466e06cc2da8d336229ebb8caaa877ba8 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.TestUtil/MacroStabilityInwardsOutputViewChartDataAssert.cs (.../MacroStabilityInwardsOutputViewChartDataAssert.cs) (revision f85578eb9fbbd05088386a9b17f9687f832b051a) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.TestUtil/MacroStabilityInwardsOutputViewChartDataAssert.cs (.../MacroStabilityInwardsOutputViewChartDataAssert.cs) (revision 52bf1eb466e06cc2da8d336229ebb8caaa877ba8) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using System.Linq; using Core.Common.Base.Data; @@ -59,8 +60,25 @@ private const int slipPlaneIndex = 20; private const int activeCircleRadiusIndex = 21; private const int passiveCircleRadiusIndex = 22; - private const int nrOfChartData = 23; + private const int sliceParameterIndex = 23; + private const int nrOfChartData = 24; + private const int sliceParameterLoadStressIndex = 0; + private const int sliceParameterShearStressIndex = 1; + private const int sliceParameterNormalStressIndex = 2; + private const int sliceParameterPopIndex = 3; + private const int sliceParameterOverConsolidationRatioIndex = 4; + private const int sliceParameterHorizontalPorePressureIndex = 5; + private const int sliceParameterVerticalPorePressureIndex = 6; + private const int sliceParameterPorePressureIndex = 7; + private const int sliceParameterPiezometricPorePressureIndex = 8; + private const int sliceParameterWeightIndex = 9; + private const int sliceParameterTotalPorePressureIndex = 10; + private const int sliceParameterEffectiveStressDailyIndex = 11; + private const int sliceParameterEffectiveStressIndex = 12; + private const int sliceParameterCohesionIndex = 13; + private const int sliceParameterNrOfChartData = 14; + /// /// Asserts whether corresponds to the input of . /// @@ -105,6 +123,9 @@ AssertSlicesChartData(calculationScenario.Output.SlidingCurve.Slices, (ChartMultipleAreaData) actual.Collection.ElementAt(slicesIndex)); + AssertSliceParametersChartData(calculationScenario.Output.SlidingCurve.Slices, + (ChartDataCollection) actual.Collection.ElementAt(sliceParameterIndex)); + AssertSlipPlaneChartData(calculationScenario.Output.SlidingCurve, (ChartLineData) actual.Collection.ElementAt(slipPlaneIndex)); @@ -163,6 +184,8 @@ Assert.AreEqual("Glijvlak", slipPlaneData.Name); Assert.AreEqual("Radius actieve cirkel", activeCircleRadiusData.Name); Assert.AreEqual("Radius passieve cirkel", passiveCircleRadiusData.Name); + + AssertEmptySliceParameterChartData((ChartDataCollection) chartDataArray[sliceParameterIndex]); } /// @@ -222,6 +245,105 @@ } /// + /// Asserts whether corresponds to . + /// + /// The original slices. + /// The actual . + /// Thrown when + /// does not correspond to . + private static void AssertSliceParametersChartData(IEnumerable slices, ChartDataCollection actual) + { + MacroStabilityInwardsSlice[] macroStabilityInwardsSlices = slices.ToArray(); + CollectionAssert.IsNotEmpty(macroStabilityInwardsSlices); + + CollectionAssert.AreEqual(CreateExpectedSliceParameterAreas(macroStabilityInwardsSlices, s => s.Cohesion, 0.125), + ((ChartMultipleAreaData) actual.Collection.ElementAt(sliceParameterCohesionIndex)).Areas); + CollectionAssert.AreEqual(CreateExpectedSliceParameterAreas(macroStabilityInwardsSlices, s => s.EffectiveStress, 0.125), + ((ChartMultipleAreaData) actual.Collection.ElementAt(sliceParameterEffectiveStressIndex)).Areas); + CollectionAssert.AreEqual(CreateExpectedSliceParameterAreas(macroStabilityInwardsSlices, s => s.EffectiveStressDaily, 0.125), + ((ChartMultipleAreaData) actual.Collection.ElementAt(sliceParameterEffectiveStressDailyIndex)).Areas); + CollectionAssert.AreEqual(CreateExpectedSliceParameterAreas(macroStabilityInwardsSlices, s => s.TotalPorePressure, 0.125), + ((ChartMultipleAreaData) actual.Collection.ElementAt(sliceParameterTotalPorePressureIndex)).Areas); + CollectionAssert.AreEqual(CreateExpectedSliceParameterAreas(macroStabilityInwardsSlices, s => s.Weight, 0.125), + ((ChartMultipleAreaData) actual.Collection.ElementAt(sliceParameterWeightIndex)).Areas); + CollectionAssert.AreEqual(CreateExpectedSliceParameterAreas(macroStabilityInwardsSlices, s => s.PiezometricPorePressure, 0.125), + ((ChartMultipleAreaData) actual.Collection.ElementAt(sliceParameterPiezometricPorePressureIndex)).Areas); + CollectionAssert.AreEqual(CreateExpectedSliceParameterAreas(macroStabilityInwardsSlices, s => s.PorePressure, 0.125), + ((ChartMultipleAreaData) actual.Collection.ElementAt(sliceParameterPorePressureIndex)).Areas); + CollectionAssert.AreEqual(CreateExpectedSliceParameterAreas(macroStabilityInwardsSlices, s => s.VerticalPorePressure, 0.125), + ((ChartMultipleAreaData) actual.Collection.ElementAt(sliceParameterVerticalPorePressureIndex)).Areas); + CollectionAssert.AreEqual(CreateExpectedSliceParameterAreas(macroStabilityInwardsSlices, s => s.HorizontalPorePressure, 0.125), + ((ChartMultipleAreaData) actual.Collection.ElementAt(sliceParameterHorizontalPorePressureIndex)).Areas); + CollectionAssert.AreEqual(CreateExpectedSliceParameterAreas(macroStabilityInwardsSlices, s => s.OverConsolidationRatio, 0.05), + ((ChartMultipleAreaData) actual.Collection.ElementAt(sliceParameterOverConsolidationRatioIndex)).Areas); + CollectionAssert.AreEqual(CreateExpectedSliceParameterAreas(macroStabilityInwardsSlices, s => s.Pop, 0.125), + ((ChartMultipleAreaData) actual.Collection.ElementAt(sliceParameterPopIndex)).Areas); + CollectionAssert.AreEqual(CreateExpectedSliceParameterAreas(macroStabilityInwardsSlices, s => s.NormalStress, 0.125), + ((ChartMultipleAreaData) actual.Collection.ElementAt(sliceParameterNormalStressIndex)).Areas); + CollectionAssert.AreEqual(CreateExpectedSliceParameterAreas(macroStabilityInwardsSlices, s => s.ShearStress, 0.125), + ((ChartMultipleAreaData) actual.Collection.ElementAt(sliceParameterShearStressIndex)).Areas); + CollectionAssert.AreEqual(CreateExpectedSliceParameterAreas(macroStabilityInwardsSlices, s => s.LoadStress, 0.125), + ((ChartMultipleAreaData) actual.Collection.ElementAt(sliceParameterLoadStressIndex)).Areas); + } + + /// + /// Asserts whether contains no slice values chart data. + /// + /// The actual . + /// Thrown when a slice value area is present. + private static void AssertEmptySliceParameterChartData(ChartDataCollection chartDataCollection) + { + Assert.AreEqual("Uitvoer per lamel", chartDataCollection.Name); + + ChartData[] chartDataArray = chartDataCollection.Collection.ToArray(); + Assert.AreEqual(sliceParameterNrOfChartData, chartDataArray.Length); + var cohesionSliceData = (ChartMultipleAreaData) chartDataArray[sliceParameterCohesionIndex]; + var effectiveStressSliceData = (ChartMultipleAreaData) chartDataArray[sliceParameterEffectiveStressIndex]; + var effectiveStressDailySliceData = (ChartMultipleAreaData) chartDataArray[sliceParameterEffectiveStressDailyIndex]; + var totalPorePressureSliceData = (ChartMultipleAreaData) chartDataArray[sliceParameterTotalPorePressureIndex]; + var weightSliceData = (ChartMultipleAreaData) chartDataArray[sliceParameterWeightIndex]; + var piezometricPorePressureSliceData = (ChartMultipleAreaData) chartDataArray[sliceParameterPiezometricPorePressureIndex]; + var porePressureSliceData = (ChartMultipleAreaData) chartDataArray[sliceParameterPorePressureIndex]; + var verticalPorePressureSliceData = (ChartMultipleAreaData) chartDataArray[sliceParameterVerticalPorePressureIndex]; + var horizontalPorePressureSliceData = (ChartMultipleAreaData) chartDataArray[sliceParameterHorizontalPorePressureIndex]; + var overConsolidationRatioSliceData = (ChartMultipleAreaData) chartDataArray[sliceParameterOverConsolidationRatioIndex]; + var popSliceData = (ChartMultipleAreaData) chartDataArray[sliceParameterPopIndex]; + var normalStressSliceData = (ChartMultipleAreaData) chartDataArray[sliceParameterNormalStressIndex]; + var shearStressSliceData = (ChartMultipleAreaData) chartDataArray[sliceParameterShearStressIndex]; + var loadStressSliceData = (ChartMultipleAreaData) chartDataArray[sliceParameterLoadStressIndex]; + + CollectionAssert.IsEmpty(cohesionSliceData.Areas); + CollectionAssert.IsEmpty(effectiveStressSliceData.Areas); + CollectionAssert.IsEmpty(effectiveStressDailySliceData.Areas); + CollectionAssert.IsEmpty(totalPorePressureSliceData.Areas); + CollectionAssert.IsEmpty(weightSliceData.Areas); + CollectionAssert.IsEmpty(piezometricPorePressureSliceData.Areas); + CollectionAssert.IsEmpty(porePressureSliceData.Areas); + CollectionAssert.IsEmpty(verticalPorePressureSliceData.Areas); + CollectionAssert.IsEmpty(horizontalPorePressureSliceData.Areas); + CollectionAssert.IsEmpty(overConsolidationRatioSliceData.Areas); + CollectionAssert.IsEmpty(popSliceData.Areas); + CollectionAssert.IsEmpty(normalStressSliceData.Areas); + CollectionAssert.IsEmpty(shearStressSliceData.Areas); + CollectionAssert.IsEmpty(loadStressSliceData.Areas); + + Assert.AreEqual("Cohesie", cohesionSliceData.Name); + Assert.AreEqual("Effectieve spanning", effectiveStressSliceData.Name); + Assert.AreEqual("Effectieve spanning (dagelijks)", effectiveStressDailySliceData.Name); + Assert.AreEqual("Totale waterspanning", totalPorePressureSliceData.Name); + Assert.AreEqual("Gewicht", weightSliceData.Name); + Assert.AreEqual("Piezometrische waterspanning", piezometricPorePressureSliceData.Name); + Assert.AreEqual("Waterspanning op maaiveld", porePressureSliceData.Name); + Assert.AreEqual("Verticale waterspanning op maaiveld", verticalPorePressureSliceData.Name); + Assert.AreEqual("Horizontale waterspanning op maaiveld", horizontalPorePressureSliceData.Name); + Assert.AreEqual("OCR", overConsolidationRatioSliceData.Name); + Assert.AreEqual("POP", popSliceData.Name); + Assert.AreEqual("Normaalspanning", normalStressSliceData.Name); + Assert.AreEqual("Schuifspanning", shearStressSliceData.Name); + Assert.AreEqual("Spanning belasting", loadStressSliceData.Name); + } + + /// /// Asserts whether corresponds to /// and . /// @@ -273,6 +395,31 @@ } } + private static IEnumerable CreateExpectedSliceParameterAreas(IEnumerable slices, + Func getParameterFunc, + double scaleFactor) + { + var areas = new List(); + foreach (MacroStabilityInwardsSlice slice in slices) + { + RoundedDouble value = getParameterFunc(slice); + double offset = value * scaleFactor; + double length = Math.Sqrt(Math.Pow(slice.BottomLeftPoint.X - slice.BottomRightPoint.X, 2) + + Math.Pow(slice.BottomLeftPoint.Y - slice.BottomRightPoint.Y, 2)); + + areas.Add(new[] + { + slice.BottomLeftPoint, + slice.BottomRightPoint, + new Point2D(slice.BottomRightPoint.X + offset * (slice.BottomRightPoint.Y - slice.BottomLeftPoint.Y) / length, + slice.BottomRightPoint.Y + offset * (slice.BottomLeftPoint.X - slice.BottomRightPoint.X) / length), + new Point2D(slice.BottomLeftPoint.X + offset * (slice.BottomRightPoint.Y - slice.BottomLeftPoint.Y) / length, + slice.BottomLeftPoint.Y + offset * (slice.BottomLeftPoint.X - slice.BottomRightPoint.X) / length) + }); + } + return areas; + } + /// /// Asserts whether corresponds to /// and .