Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingChartDataFactory.cs =================================================================== diff -u -r02b8ab97baeb969e7e4008124fe05ffd944e2142 -r27e5d9fb2ffd87ea219ecfb4217a8080f819df62 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingChartDataFactory.cs (.../PipingChartDataFactory.cs) (revision 02b8ab97baeb969e7e4008124fe05ffd944e2142) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingChartDataFactory.cs (.../PipingChartDataFactory.cs) (revision 27e5d9fb2ffd87ea219ecfb4217a8080f819df62) @@ -112,14 +112,14 @@ /// The for which to create . /// based on the . /// /// Thrown when is null. - public static ChartData CreateDitchPolderSide(Point3D ditchPolderSide) + public static ChartData CreateDitchPolderSide(RingtoetsPipingSurfaceLine surfaceLine) { - if (ditchPolderSide == null) + if (surfaceLine == null) { - throw new ArgumentNullException("ditchPolderSide"); + throw new ArgumentNullException("surfaceLine"); } - return CreatePoint(ditchPolderSide, PipingDataResources.CharacteristicPoint_DitchPolderSide, new ChartPointStyle(Color.Red, 8, Color.Transparent, 0, ChartPointSymbol.Circle)); + return CreateLocalPoint(surfaceLine.DitchPolderSide, surfaceLine, PipingDataResources.CharacteristicPoint_DitchPolderSide, new ChartPointStyle(Color.Red, 8, Color.Transparent, 0, ChartPointSymbol.Circle)); } /// @@ -128,14 +128,14 @@ /// The for which to create . /// based on the . /// /// Thrown when is null. - public static ChartData CreateBottomDitchPolderSide(Point3D bottomDitchPolderSide) + public static ChartData CreateBottomDitchPolderSide(RingtoetsPipingSurfaceLine surfaceLine) { - if (bottomDitchPolderSide == null) + if (surfaceLine == null) { - throw new ArgumentNullException("bottomDitchPolderSide"); + throw new ArgumentNullException("surfaceLine"); } - return CreatePoint(bottomDitchPolderSide, PipingDataResources.CharacteristicPoint_BottomDitchPolderSide, new ChartPointStyle(Color.Blue, 8, Color.Transparent, 0, ChartPointSymbol.Circle)); + return CreateLocalPoint(surfaceLine.BottomDitchPolderSide, surfaceLine, PipingDataResources.CharacteristicPoint_BottomDitchPolderSide, new ChartPointStyle(Color.Blue, 8, Color.Transparent, 0, ChartPointSymbol.Circle)); } /// @@ -144,14 +144,14 @@ /// The for which to create . /// based on the . /// /// Thrown when is null. - public static ChartData CreateBottomDitchDikeSide(Point3D bottomDitchDikeSide) + public static ChartData CreateBottomDitchDikeSide(RingtoetsPipingSurfaceLine surfaceLine) { - if (bottomDitchDikeSide == null) + if (surfaceLine == null) { - throw new ArgumentNullException("bottomDitchDikeSide"); + throw new ArgumentNullException("surfaceLine"); } - return CreatePoint(bottomDitchDikeSide, PipingDataResources.CharacteristicPoint_BottomDitchDikeSide, new ChartPointStyle(Color.Green, 8, Color.Transparent, 0, ChartPointSymbol.Circle)); + return CreateLocalPoint(surfaceLine.BottomDitchDikeSide, surfaceLine, PipingDataResources.CharacteristicPoint_BottomDitchDikeSide, new ChartPointStyle(Color.Green, 8, Color.Transparent, 0, ChartPointSymbol.Circle)); } /// @@ -160,14 +160,14 @@ /// The for which to create . /// based on the . /// /// Thrown when is null. - public static ChartData CreateDitchDikeSide(Point3D ditchDikeSide) + public static ChartData CreateDitchDikeSide(RingtoetsPipingSurfaceLine surfaceLine) { - if (ditchDikeSide == null) + if (surfaceLine == null) { - throw new ArgumentNullException("ditchDikeSide"); + throw new ArgumentNullException("surfaceLine"); } - return CreatePoint(ditchDikeSide, PipingDataResources.CharacteristicPoint_DitchDikeSide, new ChartPointStyle(Color.Purple, 8, Color.Transparent, 0, ChartPointSymbol.Circle)); + return CreateLocalPoint(surfaceLine.DitchDikeSide, surfaceLine, PipingDataResources.CharacteristicPoint_DitchDikeSide, new ChartPointStyle(Color.Purple, 8, Color.Transparent, 0, ChartPointSymbol.Circle)); } /// @@ -176,14 +176,14 @@ /// The for which to create . /// based on the . /// /// Thrown when is null. - public static ChartData CreateDikeToeAtRiver(Point3D dikeToeAtRiver) + public static ChartData CreateDikeToeAtRiver(RingtoetsPipingSurfaceLine surfaceLine) { - if (dikeToeAtRiver == null) + if (surfaceLine == null) { - throw new ArgumentNullException("dikeToeAtRiver"); + throw new ArgumentNullException("surfaceLine"); } - return CreatePoint(dikeToeAtRiver, PipingDataResources.CharacteristicPoint_DikeToeAtRiver, new ChartPointStyle(Color.Orange, 8, Color.Transparent, 0, ChartPointSymbol.Circle)); + return CreateLocalPoint(surfaceLine.DikeToeAtRiver, surfaceLine, PipingDataResources.CharacteristicPoint_DikeToeAtRiver, new ChartPointStyle(Color.Orange, 8, Color.Transparent, 0, ChartPointSymbol.Circle)); } /// @@ -192,21 +192,23 @@ /// The for which to create . /// based on the . /// /// Thrown when is null. - public static ChartData CreateDikeToeAtPolder(Point3D dikeToeAtPolder) + public static ChartData CreateDikeToeAtPolder(RingtoetsPipingSurfaceLine surfaceLine) { - if (dikeToeAtPolder == null) + if (surfaceLine == null) { - throw new ArgumentNullException("dikeToeAtPolder"); + throw new ArgumentNullException("surfaceLine"); } - return CreatePoint(dikeToeAtPolder, PipingDataResources.CharacteristicPoint_DikeToeAtPolder, new ChartPointStyle(Color.Silver, 8, Color.Transparent, 0, ChartPointSymbol.Circle)); + return CreateLocalPoint(surfaceLine.DikeToeAtPolder, surfaceLine, PipingDataResources.CharacteristicPoint_DikeToeAtPolder, new ChartPointStyle(Color.Silver, 8, Color.Transparent, 0, ChartPointSymbol.Circle)); } - private static ChartData CreatePoint(Point3D dikeToeAtRiver, string name, ChartPointStyle style) + private static ChartData CreateLocalPoint(Point3D worldPoint, RingtoetsPipingSurfaceLine surfaceLine, string name, ChartPointStyle style) { + Point2D firstPoint = Point3DToPoint2D(surfaceLine.Points.First()); + Point2D lastPoint = Point3DToPoint2D(surfaceLine.Points.Last()); return new ChartPointData(new[] { - Point3DToPoint2D(dikeToeAtRiver) + worldPoint.ProjectIntoLocalCoordinates(firstPoint, lastPoint) }, name) { Style = style @@ -215,7 +217,7 @@ private static Point2D Point3DToPoint2D(Point3D point3D) { - return new Point2D(point3D.X, point3D.Z); + return new Point2D(point3D.X, point3D.Y); } } } \ No newline at end of file