Exemplo n.º 1
0
 private static MacroStabilityInwardsCharacteristicPointEntity CreateMacroStabilityInwardsCharacteristicPointEntity(
     Point3D point,
     MacroStabilityInwardsCharacteristicPointType type)
 {
     return(new MacroStabilityInwardsCharacteristicPointEntity
     {
         Type = Convert.ToByte(type),
         X = point.X,
         Y = point.Y,
         Z = point.Z
     });
 }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the characteristic point and its coordinate to the <paramref name="surfaceLine"/>.
        /// </summary>
        /// <param name="surfaceLine">The surface line to set the characteristic point on.</param>
        /// <param name="type">The type of characteristic point.</param>
        /// <param name="geometryPoint">The point associated with the characteristic point.</param>
        /// <exception cref="InvalidEnumArgumentException">Thrown when <paramref name="type"/> is not
        /// a valid <see cref="MacroStabilityInwardsCharacteristicPointType"/>.</exception>
        /// <exception cref="NotSupportedException">Thrown when <paramref name="type"/> is not supported.</exception>
        private static void SetCharacteristicPoint(MacroStabilityInwardsSurfaceLine surfaceLine,
                                                   MacroStabilityInwardsCharacteristicPointType type,
                                                   Point3D geometryPoint)
        {
            if (!Enum.IsDefined(typeof(MacroStabilityInwardsCharacteristicPointType), type))
            {
                throw new InvalidEnumArgumentException(nameof(type),
                                                       (int)type,
                                                       typeof(MacroStabilityInwardsCharacteristicPointType));
            }

            switch (type)
            {
            case MacroStabilityInwardsCharacteristicPointType.SurfaceLevelOutside:
                surfaceLine.SetSurfaceLevelOutsideAt(geometryPoint);
                break;

            case MacroStabilityInwardsCharacteristicPointType.SurfaceLevelInside:
                surfaceLine.SetSurfaceLevelInsideAt(geometryPoint);
                break;

            case MacroStabilityInwardsCharacteristicPointType.ShoulderBaseInside:
                surfaceLine.SetShoulderBaseInsideAt(geometryPoint);
                break;

            case MacroStabilityInwardsCharacteristicPointType.ShoulderTopInside:
                surfaceLine.SetShoulderTopInsideAt(geometryPoint);
                break;

            case MacroStabilityInwardsCharacteristicPointType.DikeToeAtRiver:
                surfaceLine.SetDikeToeAtRiverAt(geometryPoint);
                break;

            case MacroStabilityInwardsCharacteristicPointType.DikeToeAtPolder:
                surfaceLine.SetDikeToeAtPolderAt(geometryPoint);
                break;

            case MacroStabilityInwardsCharacteristicPointType.BottomDitchDikeSide:
                surfaceLine.SetBottomDitchDikeSideAt(geometryPoint);
                break;

            case MacroStabilityInwardsCharacteristicPointType.BottomDitchPolderSide:
                surfaceLine.SetBottomDitchPolderSideAt(geometryPoint);
                break;

            case MacroStabilityInwardsCharacteristicPointType.DitchDikeSide:
                surfaceLine.SetDitchDikeSideAt(geometryPoint);
                break;

            case MacroStabilityInwardsCharacteristicPointType.DikeTopAtRiver:
                surfaceLine.SetDikeTopAtRiverAt(geometryPoint);
                break;

            case MacroStabilityInwardsCharacteristicPointType.DikeTopAtPolder:
                surfaceLine.SetDikeTopAtPolderAt(geometryPoint);
                break;

            case MacroStabilityInwardsCharacteristicPointType.DitchPolderSide:
                surfaceLine.SetDitchPolderSideAt(geometryPoint);
                break;

            default:
                throw new NotSupportedException();
            }
        }
Exemplo n.º 3
0
        private static MacroStabilityInwardsCharacteristicPointEntity CreateCharacteristicPointEntity(Point3D point, MacroStabilityInwardsCharacteristicPointType type)
        {
            var entity = new MacroStabilityInwardsCharacteristicPointEntity
            {
                Type = Convert.ToByte(type),
                X    = point.X.ToNaNAsNull(),
                Y    = point.Y.ToNaNAsNull(),
                Z    = point.Z.ToNaNAsNull()
            };

            return(entity);
        }