Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs =================================================================== diff -u -rc67c5e4d2dcf0e3a105aab6b2bb323e9a128ff22 -r473efe5f1b2aff98ffc7ad1d826c3ef90f77a7a6 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs (.../PipingFailureMechanismView.cs) (revision c67c5e4d2dcf0e3a105aab6b2bb323e9a128ff22) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismView.cs (.../PipingFailureMechanismView.cs) (revision 473efe5f1b2aff98ffc7ad1d826c3ef90f77a7a6) @@ -19,25 +19,14 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; using System.Linq; using System.Windows.Forms; using Core.Common.Base; -using Core.Common.Base.Geometry; using Core.Components.Gis.Data; -using Core.Components.Gis.Features; using Core.Components.Gis.Forms; -using Core.Components.Gis.Geometries; -using Core.Components.Gis.Style; -using Ringtoets.Common.Data; using Ringtoets.Common.Forms.Properties; -using Ringtoets.HydraRing.Data; using Ringtoets.Piping.Forms.PresentationObjects; -using Ringtoets.Piping.Primitives; using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; using PipingDataResources = Ringtoets.Piping.Data.Properties.Resources; using PipingFormsResources = Ringtoets.Piping.Forms.Properties.Resources; @@ -210,106 +199,4 @@ return PipingMapDataFactory.CreateEndPoints(data.WrappedData.Sections); } } - - public static class PipingMapDataFactory - { - public static MapData Create(ICollection surfaceLines) - { - var mapFeatures = new List - { - new MapFeature(surfaceLines.Select(surfaceLine => new MapGeometry(surfaceLine.Points.Select(p => new Point2D(p.X, p.Y))))) - }; - - return new MapLineData(mapFeatures, PipingFormsResources.PipingSurfaceLinesCollection_DisplayName) - { - Style = new LineStyle(Color.DarkSeaGreen, 2, DashStyle.Solid) - }; - } - - public static MapData Create(IEnumerable sections) - { - var mapFeatures = new List - { - new MapFeature(sections.Select(section => new MapGeometry(section.Points.Select(p => new Point2D(p.X, p.Y))))) - }; - - return new MapLineData(mapFeatures, Resources.FailureMechanism_Sections_DisplayName) - { - Style = new LineStyle(Color.Khaki, 3, DashStyle.Dot) - }; - } - - public static MapData CreateStartPoints(IEnumerable sections) - { - - IEnumerable startPoints = sections.Select(sl => sl.GetStart()); - string mapDataName = string.Format("{0} ({1})", - Resources.FailureMechanism_Sections_DisplayName, - Resources.FailureMechanismSections_StartPoints_DisplayName); - return new MapPointData(GetMapFeature(startPoints), mapDataName) - { - Style = new PointStyle(Color.DarkKhaki, 15, PointSymbol.Triangle) - }; - } - - public static MapData CreateEndPoints(IEnumerable sections) - { - IEnumerable startPoints = sections.Select(sl => sl.GetLast()); - string mapDataName = string.Format("{0} ({1})", - Resources.FailureMechanism_Sections_DisplayName, - Resources.FailureMechanismSections_EndPoints_DisplayName); - return new MapPointData(GetMapFeature(startPoints), mapDataName) - { - Style = new PointStyle(Color.DarkKhaki, 15, PointSymbol.Triangle) - }; - } - - public static MapData Create(ReferenceLine referenceLine) - { - if (referenceLine == null) - { - throw new ArgumentNullException(); - } - var features = GetMapFeature(referenceLine.Points); - - return new MapLineData(features, RingtoetsCommonDataResources.ReferenceLine_DisplayName) - { - Style = new LineStyle(Color.Red, 3, DashStyle.Solid) - }; - } - - public static MapData Create(HydraulicBoundaryDatabase hydraulicBoundaryDatabase) - { - IEnumerable locations = hydraulicBoundaryDatabase.Locations.Select(h => h.Location).ToArray(); - - var features = GetMapFeature(locations); - - return new MapPointData(features, RingtoetsCommonDataResources.HydraulicBoundaryConditions_DisplayName) - { - Style = new PointStyle(Color.DarkBlue, 6, PointSymbol.Circle) - }; - } - - private static IEnumerable GetMapFeature(IEnumerable points) - { - var features = new List - { - new MapFeature(new List - { - new MapGeometry(points) - }) - }; - return features; - } - - public static MapData CreateEmptyLineData(string name) - { - return new MapLineData(Enumerable.Empty(), name); - } - - public static MapData CreateEmptyPointData(string name) - { - return new MapPointData(Enumerable.Empty(), name); - } - } } \ No newline at end of file