/// <summary> /// Validates whether or not the dike toes are in the right order. /// </summary> /// <param name="surfaceLine">The surface line.</param> /// <param name="characteristicPoints">The characteristic points (possibly) containing the dike toes.</param> /// <exception cref="ImportedDataTransformException">Thrown when the dike toes are not in the right order.</exception> private static void ValidateDikeToesInOrder(this PipingSurfaceLine surfaceLine, CharacteristicPoints characteristicPoints) { if (characteristicPoints.DikeToeAtRiver != null && characteristicPoints.DikeToeAtPolder != null) { Point2D localDikeToeAtRiver = surfaceLine.GetLocalPointFromGeometry(characteristicPoints.DikeToeAtRiver); Point2D localDikeToeAtPolder = surfaceLine.GetLocalPointFromGeometry(characteristicPoints.DikeToeAtPolder); if (localDikeToeAtPolder.X <= localDikeToeAtRiver.X) { string message = string.Format(Resources.SurfaceLinesCsvImporter_CheckCharacteristicPoints_EntryPointL_greater_or_equal_to_ExitPointL_for_0_, characteristicPoints.Name); throw new ImportedDataTransformException(message); } } }
/// <summary> /// Create a ditch dike side point in 2D space based on the provided <paramref name="surfaceLine"/>. /// </summary> /// <param name="surfaceLine">The <see cref="PipingSurfaceLine"/> to create the ditch dike side point for.</param> /// <returns>An array with a ditch dike side point in 2D space or an empty array when: /// <list type="bullet"> /// <item><paramref name="surfaceLine"/> is <c>null</c>;</item> /// <item>the ditch dike side point in <paramref name="surfaceLine"/> is <c>null</c>.</item> /// </list> /// </returns> public static Point2D[] CreateDitchDikeSidePoint(PipingSurfaceLine surfaceLine) { return(surfaceLine?.DitchDikeSide != null ? new[] { surfaceLine.GetLocalPointFromGeometry(surfaceLine.DitchDikeSide) } : new Point2D[0]); }
/// <summary> /// Create a dike toe at polder point in 2D space based on the provided <paramref name="surfaceLine"/>. /// </summary> /// <param name="surfaceLine">The <see cref="PipingSurfaceLine"/> to create the dike toe at polder point for.</param> /// <returns>An array with a dike toe at polder point in 2D space or an empty array when: /// <list type="bullet"> /// <item><paramref name="surfaceLine"/> is <c>null</c>;</item> /// <item>the dike toe at polder point in <paramref name="surfaceLine"/> is <c>null</c>.</item> /// </list> /// </returns> public static Point2D[] CreateDikeToeAtPolderPoint(PipingSurfaceLine surfaceLine) { return(surfaceLine?.DikeToeAtPolder != null ? new[] { surfaceLine.GetLocalPointFromGeometry(surfaceLine.DikeToeAtPolder) } : new Point2D[0]); }
/// <summary> /// Create a bottom ditch polder side point in 2D space based on the provided <paramref name="surfaceLine"/>. /// </summary> /// <param name="surfaceLine">The <see cref="PipingSurfaceLine"/> to create the bottom ditch polder side point for.</param> /// <returns>An array with a bottom ditch polder side point in 2D space or an empty array when: /// <list type="bullet"> /// <item><paramref name="surfaceLine"/> is <c>null</c>;</item> /// <item>the bottom ditch polder side point in <paramref name="surfaceLine"/> is <c>null</c>.</item> /// </list> /// </returns> public static Point2D[] CreateBottomDitchPolderSidePoint(PipingSurfaceLine surfaceLine) { return(surfaceLine?.BottomDitchPolderSide != null ? new[] { surfaceLine.GetLocalPointFromGeometry(surfaceLine.BottomDitchPolderSide) } : new Point2D[0]); }