Пример #1
0
        private static PipingPoint CreatePipingPointOfType(Point2D projectedPoint, PipingCharacteristicPointType pointType)
        {
            var pipingPoint = new PipingPoint(projectedPoint.X, 0.0, projectedPoint.Y)
            {
                Type = pointType
            };

            return(pipingPoint);
        }
Пример #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="PipingCharacteristicPointType"/>.</exception>
        /// <exception cref="NotSupportedException">Thrown when <paramref name="type"/> is not supported.</exception>
        private static void SetCharacteristicPoint(PipingSurfaceLine surfaceLine,
                                                   PipingCharacteristicPointType type,
                                                   Point3D geometryPoint)
        {
            if (!Enum.IsDefined(typeof(PipingCharacteristicPointType), type))
            {
                throw new InvalidEnumArgumentException(nameof(type),
                                                       (int)type,
                                                       typeof(PipingCharacteristicPointType));
            }

            switch (type)
            {
            case PipingCharacteristicPointType.DikeToeAtRiver:
                surfaceLine.SetDikeToeAtRiverAt(geometryPoint);
                break;

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

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

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

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

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

            default:
                throw new NotSupportedException();
            }
        }
Пример #3
0
        private static PipingCharacteristicPointEntity CreateCharacteristicPointEntity(Point3D point, PipingCharacteristicPointType type)
        {
            var entity = new PipingCharacteristicPointEntity
            {
                Type = Convert.ToByte(type),
                X    = point.X.ToNaNAsNull(),
                Y    = point.Y.ToNaNAsNull(),
                Z    = point.Z.ToNaNAsNull()
            };

            return(entity);
        }
Пример #4
0
 private static PipingCharacteristicPointEntity CreatePipingCharacteristicPointEntity(Point3D point,
                                                                                      PipingCharacteristicPointType type)
 {
     return(new PipingCharacteristicPointEntity
     {
         Type = Convert.ToByte(type),
         X = point.X,
         Y = point.Y,
         Z = point.Z
     });
 }