// Copyright (C) Stichting Deltares 2016. All rights reserved.
//
// This file is part of Ringtoets.
//
// Ringtoets is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
//
// All names, logos, and references to "Deltares" are registered trademarks of
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
using System;
using System.Collections.Generic;
using Core.Common.Base.Data;
using Core.Common.Base.Geometry;
using Ringtoets.GrassCoverErosionInwards.Data.Properties;
namespace Ringtoets.GrassCoverErosionInwards.Data
{
///
/// Definition for a dike profile for the Grass Cover Erosion Inwards failure mechanism.
///
public class DikeProfile
{
private readonly List foreshoreGeometry;
private readonly List dikeGeometry;
private RoundedDouble orientation;
private RoundedDouble dikeHeight;
///
/// Creates a new instance of the class.
///
/// The value for .
public DikeProfile(Point2D worldCoordinate)
{
if (worldCoordinate == null)
{
throw new ArgumentNullException("worldCoordinate");
}
orientation = new RoundedDouble(2);
dikeHeight = new RoundedDouble(2);
Name = Resources.DikeProfile_DefaultName;
Memo = "";
dikeGeometry = new List();
foreshoreGeometry = new List();
WorldReferencePoint = worldCoordinate;
}
///
/// Gets or sets the name of the dike profile.
///
public string Name { get; set; }
///
/// Gets or sets the optional notes about this instance.
///
public string Memo { get; set; }
///
/// Gets the reference point in world coordinates corresponding to the local coordinate .
///
public Point2D WorldReferencePoint { get; private set; }
///
/// Gets or sets the local x-coordinate corresponding to the world reference point .
///
public double X0 { get; set; }
///
/// Gets or sets the orientation of the dike profile geometry with respect to North
/// in degrees. A positive value equals a clockwise rotation.
///
public RoundedDouble Orientation
{
get
{
return orientation;
}
set
{
orientation = value.ToPrecision(orientation.NumberOfDecimalPlaces);
}
}
///
/// Indicates if there is a break water object available for this instance or not.
///
public bool HasBreakWater
{
get
{
return BreakWater != null;
}
}
///
/// Gets or sets the break water object of the dike profile, if any.
///
public BreakWater BreakWater { get; set; }
///
/// Gets the geometry of the foreshore.
///
public IList ForeshoreGeometry
{
get
{
return foreshoreGeometry;
}
}
///
/// Gets the geometry of the dike with roughness data.
///
///
/// The roughness of a in the list represents
/// the roughness of the section between this
/// and the succeeding . The roughness of the last
/// point is irrelevant.
///
public IList DikeGeometry
{
get
{
return dikeGeometry;
}
}
///
/// Gets or sets the height of the dike [m+NAP].
///
public RoundedDouble DikeHeight
{
get
{
return dikeHeight;
}
set
{
dikeHeight = value.ToPrecision(dikeHeight.NumberOfDecimalPlaces);
}
}
public override string ToString()
{
return Name;
}
}
}