/// <summary> /// Creates a new instance of the <see cref="ForeshoreProfile"/> class. /// </summary> /// <param name="worldCoordinate">The value for <see cref="WorldReferencePoint"/>.</param> /// <param name="geometry">The geometry of the 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="ForeshoreProfile"/>.</param> /// <exception cref="ArgumentNullException">Thrown when either <paramref name="geometry"/>, /// <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="geometry"/> is <c>null</c></item> /// <item><paramref name="properties.Id"/> is <c>null</c>, empty or whitespaces</item> /// </list> /// </exception> public ForeshoreProfile(Point2D worldCoordinate, IEnumerable <Point2D> geometry, BreakWater breakWater, ConstructionProperties properties) { if (worldCoordinate == null) { throw new ArgumentNullException(nameof(worldCoordinate)); } if (geometry == null) { throw new ArgumentNullException(nameof(geometry)); } if (properties == null) { throw new ArgumentNullException(nameof(properties)); } if (string.IsNullOrWhiteSpace(properties.Id)) { throw new ArgumentException(@"Id is null, empty or consists of whitespace.", nameof(properties)); } SetGeometry(geometry); Orientation = new RoundedDouble(2, properties.Orientation); BreakWater = breakWater; Id = properties.Id; Name = string.IsNullOrWhiteSpace(properties.Name) ? properties.Id : properties.Name; WorldReferencePoint = worldCoordinate; X0 = properties.X0; }
/// <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); }
private bool Equals(BreakWater other) { return(height.Equals(other.height) && Type == other.Type); }