Example #1
0
 private bool Equals(ForeshoreProfile other)
 {
     return(Id.Equals(other.Id) &&
            string.Equals(Name, other.Name) &&
            WorldReferencePoint.Equals(other.WorldReferencePoint) &&
            X0.Equals(other.X0) &&
            Orientation.Equals(other.Orientation) &&
            Equals(BreakWater, other.BreakWater) &&
            EqualGeometry(other.Geometry.ToArray()));
 }
Example #2
0
 private void CopyForeshoreProfileProperties(DikeProfile fromDikeProfile)
 {
     ForeshoreProfile.CopyProperties(new ForeshoreProfile(fromDikeProfile.WorldReferencePoint,
                                                          fromDikeProfile.ForeshoreGeometry,
                                                          fromDikeProfile.BreakWater,
                                                          new ForeshoreProfile.ConstructionProperties
     {
         Id          = fromDikeProfile.Id,
         Name        = fromDikeProfile.Name,
         Orientation = fromDikeProfile.Orientation,
         X0          = fromDikeProfile.X0
     }));
 }
Example #3
0
        /// <summary>
        /// Copies all the properties of <paramref name="fromForeshoreProfile"/>
        /// to the current instance.
        /// </summary>
        /// <param name="fromForeshoreProfile">The foreshore profile to copy the
        /// properties from.</param>
        /// <exception cref="ArgumentNullException">Thrown when
        /// <paramref name="fromForeshoreProfile"/> is <c>null</c>.</exception>
        public void CopyProperties(ForeshoreProfile fromForeshoreProfile)
        {
            if (fromForeshoreProfile == null)
            {
                throw new ArgumentNullException(nameof(fromForeshoreProfile));
            }

            Id          = fromForeshoreProfile.Id;
            Name        = fromForeshoreProfile.Name;
            X0          = fromForeshoreProfile.X0;
            Orientation = fromForeshoreProfile.Orientation;

            BreakWater = fromForeshoreProfile.BreakWater != null
                             ? new BreakWater(fromForeshoreProfile.BreakWater.Type, fromForeshoreProfile.BreakWater.Height)
                             : null;
            WorldReferencePoint = new Point2D(fromForeshoreProfile.WorldReferencePoint);
            SetGeometry(fromForeshoreProfile.Geometry);
        }
Example #4
0
        /// <summary>
        /// Creates a new instance of the <see cref="DikeProfile"/> class.
        /// </summary>
        /// <param name="worldCoordinate">The value for <see cref="WorldReferencePoint"/>.</param>
        /// <param name="dikeGeometry">The geometry of the dike.</param>
        /// <param name="foreshoreGeometry">The geometry of the dike foreshore.</param>
        /// <param name="breakWater">The break water definition (can be null).</param>
        /// <param name="properties">The property values required to create an instance of <see cref="DikeProfile"/>.</param>
        /// <exception cref="ArgumentNullException">Thrown when either <paramref name="dikeGeometry"/>,
        /// <paramref name="foreshoreGeometry"/>, <paramref name="worldCoordinate"/> or
        /// <paramref name="properties"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentException">Thrown when:
        /// <list type="bullet">
        /// <item>any element of <paramref name="dikeGeometry"/>
        /// or <paramref name="foreshoreGeometry"/> is <c>null</c>.</item>
        /// <item><paramref name="properties.Id"/> is <c>null</c>, is empty
        /// or whitespaces.</item>
        /// </list> </exception>
        public DikeProfile(Point2D worldCoordinate, IEnumerable <RoughnessPoint> dikeGeometry, IEnumerable <Point2D> foreshoreGeometry,
                           BreakWater breakWater, ConstructionProperties properties)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            ForeshoreProfile = new ForeshoreProfile(worldCoordinate, foreshoreGeometry, breakWater,
                                                    new ForeshoreProfile.ConstructionProperties
            {
                Id          = properties.Id,
                Name        = properties.Name,
                Orientation = properties.Orientation,
                X0          = properties.X0
            });

            SetGeometry(dikeGeometry);
            DikeHeight = new RoundedDouble(2, properties.DikeHeight);
        }
Example #5
0
 public override int GetHashCode()
 {
     return(ForeshoreProfile.GetHashCode());
 }