using System.ComponentModel;
using System.Linq;
using Deltares.Geotechnics;
using Deltares.Geotechnics.GeotechnicalGeometry;
using Deltares.Standard;
using Deltares.Standard.Attributes;
using Deltares.Standard.EventPublisher;
using Deltares.Standard.Units;
namespace Deltares.DeltaModel
{
///
/// Cross section for asphalt schematization.
///
public class AsphaltCrossSection : RevetmentCrossSection
{
private double forelandLevel;
///
/// Creates a new . The should contain a .
/// The is used to project the segments upon.
///
/// The container of the , which is used to project the segments on.
public AsphaltCrossSection(IHasSurfaceLine surfaceLineProvider) : base(surfaceLineProvider)
{
Segments.CreateMethod = CreateMethod;
}
///
/// Parameterless constructor is used in deserialization.
///
private AsphaltCrossSection()
{
Segments.CreateMethod = CreateMethod;
}
///
/// The level of the foreland (NAP).
///
[Format("F3")]
[Unit(UnitType.Depth)]
[Category("HydraulicData")]
[PropertyOrder(20, 2)]
public double ForelandLevel
{
get
{
return forelandLevel;
}
set
{
if (value != forelandLevel)
{
DataEventPublisher.BeforeChange(this, x => x.ForelandLevel);
forelandLevel = value;
DataEventPublisher.AfterChange(this, x => x.ForelandLevel);
}
}
}
///
/// Copies the and clones the to another .
///
/// The other to copy this object's values to.
public void CopyTo(AsphaltCrossSection other)
{
other.forelandLevel = forelandLevel;
other.Segments.Clear();
foreach (var segment in Segments.ToList())
{
other.Segments.Add(segment.Clone());
}
}
private AsphaltSegment CreateMethod()
{
return new AsphaltSegment(SurfaceLineProvider);
}
}
}