// Copyright (C) Stichting Deltares 2017. 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 Core.Common.Base;
using Core.Common.Base.Data;
using Core.Common.Base.Geometry;
using Ringtoets.Common.Data.Hydraulics;
namespace Ringtoets.DuneErosion.Data
{
///
/// Location of a dune.
///
public class DuneLocation : Observable
{
///
/// Creates a new instance of .
///
/// Id of the .
/// Name of the .
/// The coordinate of the .
/// The container of the properties for the
///
/// Thrown when
/// or is null.
public DuneLocation(long id, string name, Point2D location, ConstructionProperties properties)
{
if (name == null)
{
throw new ArgumentNullException(nameof(name));
}
if (properties == null)
{
throw new ArgumentNullException(nameof(properties));
}
Id = id;
Name = name;
Location = location;
CoastalAreaId = properties.CoastalAreaId;
Offset = new RoundedDouble(1, properties.Offset);
Orientation = new RoundedDouble(1, properties.Orientation);
D50 = new RoundedDouble(6, properties.D50);
}
///
/// Gets the database id of the dune location.
///
public long Id { get; private set; }
///
/// Gets the name of the dune location.
///
public string Name { get; private set; }
///
/// Gets the coordinate of the dune location.
///
public Point2D Location { get; private set; }
///
/// Gets the coastal area id of the dune location.
///
public int CoastalAreaId { get; private set; }
///
/// Gets the offset of the dune location.
///
public RoundedDouble Offset { get; private set; }
///
/// Gets the orientation of the dune location.
///
public RoundedDouble Orientation { get; private set; }
///
/// Gets the d50 of the dune location.
///
public RoundedDouble D50 { get; private set; }
///
/// Gets or sets the output of a dune erosion calculation.
///
public DuneLocationOutput Output { get; set; }
///
/// Gets the convergence status of the dune erosion calculation.
///
public CalculationConvergence CalculationConvergence
{
get
{
return Output?.CalculationConvergence ?? CalculationConvergence.NotCalculated;
}
}
///
/// Class holding the various construction parameters for .
///
public class ConstructionProperties
{
///
/// Sets the coastal area id of the dune location.
///
public int CoastalAreaId { internal get; set; }
///
/// Sets the offset of the dune location.
///
public double Offset { internal get; set; }
///
/// Sets the orientation of the dune location.
///
public double Orientation { internal get; set; }
///
/// Sets the d50 of the dune location.
///
public double D50 { internal get; set; }
}
}
}