// 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 System.Drawing;
namespace Ringtoets.MacroStabilityInwards.Primitives
{
///
/// Properties of a soil layer.
///
public class SoilLayerProperties
{
private string materialName = string.Empty;
///
/// Gets or sets a value indicating whether the layer is an aquifer.
///
public bool IsAquifer { get; set; }
///
/// Gets or sets the name of the material that was assigned to the layer.
///
/// Thrown when is null.
public string MaterialName
{
get
{
return materialName;
}
set
{
if (value == null)
{
throw new ArgumentNullException(nameof(value));
}
materialName = value;
}
}
///
/// Gets or sets the that was used to represent the layer.
///
public Color Color { get; set; }
///
/// Gets or sets a value indicating whether to use POP for the layer.
///
public bool UsePop { get; set; }
///
/// Gets or sets the shear strenth model to use for the layer.
///
public ShearStrengthModel ShearStrengthModel { get; set; }
///
/// Gets or sets the mean of the distribution for the volumic weight of the layer above the phreatic level.
/// [kN/m³]
///
public double AbovePhreaticLevelMean { get; set; } = double.NaN;
///
/// Gets or sets the deviation of the distribution for the volumic weight of the layer above the phreatic level.
/// [kN/m³]
///
public double AbovePhreaticLevelDeviation { get; set; } = double.NaN;
///
/// Gets or sets the mean of the distribution for the volumic weight of the layer below the phreatic level.
/// [kN/m³]
///
public double BelowPhreaticLevelMean { get; set; } = double.NaN;
///
/// Gets or sets the deviation of the distribution for the volumic weight of the layer below the phreatic level.
/// [kN/m³]
///
public double BelowPhreaticLevelDeviation { get; set; } = double.NaN;
///
/// Gets or sets the mean of the distribution for the cohesion of the
/// [kN/m³]
///
public double CohesionMean { get; set; } = double.NaN;
///
/// Gets or sets the deviation of the distribution for the cohesion of the .
/// [kN/m³]
///
public double CohesionDeviation { get; set; } = double.NaN;
///
/// Gets or sets the shift of the distribution for the cohesion of the .
/// [kN/m³]
///
public double CohesionShift { get; set; } = double.NaN;
///
/// Gets or sets the mean of the distribution for the friction angle of the
/// [°]
///
public double FrictionAngleMean { get; set; } = double.NaN;
///
/// Gets or sets the deviation of the distribution for the friction angle of the .
/// [°]
///
public double FrictionAngleDeviation { get; set; } = double.NaN;
///
/// Gets or sets the shift of the distribution for the friction angle of the .
/// [°]
///
public double FrictionAngleShift { get; set; } = double.NaN;
///
/// Gets or sets the mean of the distribution for the ratio of shear strength S of the
/// [-]
///
public double ShearStrengthRatioMean { get; set; } = double.NaN;
///
/// Gets or sets the deviation of the distribution for the ratio of shear strength S of the .
/// [-]
///
public double ShearStrengthRatioDeviation { get; set; } = double.NaN;
///
/// Gets or sets the shift of the distribution for the ratio of shear strength S of the .
/// [-]
///
public double ShearStrengthRatioShift { get; set; } = double.NaN;
///
/// Gets or sets the mean of the distribution for the strength increase exponent (m) of the
/// [-]
///
public double StrengthIncreaseExponentMean { get; set; } = double.NaN;
///
/// Gets or sets the deviation of the distribution for the strength increase exponent (m) of the .
/// [-]
///
public double StrengthIncreaseExponentDeviation { get; set; } = double.NaN;
///
/// Gets or sets the shift of the distribution for the strength increase exponent (m) of the .
/// [-]
///
public double StrengthIncreaseExponentShift { get; set; } = double.NaN;
///
/// Gets or sets the mean of the distribution for the POP of the
/// [kN/m²]
///
public double PopMean { get; set; } = double.NaN;
///
/// Gets or sets the deviation of the distribution for the POP of the .
/// [kN/m²]
///
public double PopDeviation { get; set; } = double.NaN;
///
/// Gets or sets the shift of the distribution for the POP of the .
/// [kN/m²]
///
public double PopShift { get; set; } = double.NaN;
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != GetType()) return false;
return Equals((SoilLayerProperties) obj);
}
public override int GetHashCode()
{
unchecked
{
int hashCode = StringComparer.InvariantCulture.GetHashCode(materialName);
hashCode = (hashCode * 397) ^ IsAquifer.GetHashCode();
hashCode = (hashCode * 397) ^ Color.GetHashCode();
hashCode = (hashCode * 397) ^ UsePop.GetHashCode();
hashCode = (hashCode * 397) ^ (int) ShearStrengthModel;
hashCode = (hashCode * 397) ^ AbovePhreaticLevelMean.GetHashCode();
hashCode = (hashCode * 397) ^ AbovePhreaticLevelDeviation.GetHashCode();
hashCode = (hashCode * 397) ^ BelowPhreaticLevelMean.GetHashCode();
hashCode = (hashCode * 397) ^ BelowPhreaticLevelDeviation.GetHashCode();
hashCode = (hashCode * 397) ^ CohesionMean.GetHashCode();
hashCode = (hashCode * 397) ^ CohesionDeviation.GetHashCode();
hashCode = (hashCode * 397) ^ CohesionShift.GetHashCode();
hashCode = (hashCode * 397) ^ FrictionAngleMean.GetHashCode();
hashCode = (hashCode * 397) ^ FrictionAngleDeviation.GetHashCode();
hashCode = (hashCode * 397) ^ FrictionAngleShift.GetHashCode();
hashCode = (hashCode * 397) ^ ShearStrengthRatioMean.GetHashCode();
hashCode = (hashCode * 397) ^ ShearStrengthRatioDeviation.GetHashCode();
hashCode = (hashCode * 397) ^ ShearStrengthRatioShift.GetHashCode();
hashCode = (hashCode * 397) ^ StrengthIncreaseExponentMean.GetHashCode();
hashCode = (hashCode * 397) ^ StrengthIncreaseExponentDeviation.GetHashCode();
hashCode = (hashCode * 397) ^ StrengthIncreaseExponentShift.GetHashCode();
hashCode = (hashCode * 397) ^ PopMean.GetHashCode();
hashCode = (hashCode * 397) ^ PopDeviation.GetHashCode();
hashCode = (hashCode * 397) ^ PopShift.GetHashCode();
return hashCode;
}
}
private bool Equals(SoilLayerProperties other)
{
return string.Equals(materialName, other.materialName, StringComparison.InvariantCulture)
&& IsAquifer == other.IsAquifer
&& Color.ToArgb().Equals(other.Color.ToArgb())
&& UsePop == other.UsePop
&& ShearStrengthModel == other.ShearStrengthModel
&& AbovePhreaticLevelMean.Equals(other.AbovePhreaticLevelMean)
&& AbovePhreaticLevelDeviation.Equals(other.AbovePhreaticLevelDeviation)
&& BelowPhreaticLevelMean.Equals(other.BelowPhreaticLevelMean)
&& BelowPhreaticLevelDeviation.Equals(other.BelowPhreaticLevelDeviation)
&& CohesionMean.Equals(other.CohesionMean)
&& CohesionDeviation.Equals(other.CohesionDeviation)
&& CohesionShift.Equals(other.CohesionShift)
&& FrictionAngleMean.Equals(other.FrictionAngleMean)
&& FrictionAngleDeviation.Equals(other.FrictionAngleDeviation)
&& FrictionAngleShift.Equals(other.FrictionAngleShift)
&& ShearStrengthRatioMean.Equals(other.ShearStrengthRatioMean)
&& ShearStrengthRatioDeviation.Equals(other.ShearStrengthRatioDeviation)
&& ShearStrengthRatioShift.Equals(other.ShearStrengthRatioShift)
&& StrengthIncreaseExponentMean.Equals(other.StrengthIncreaseExponentMean)
&& StrengthIncreaseExponentDeviation.Equals(other.StrengthIncreaseExponentDeviation)
&& StrengthIncreaseExponentShift.Equals(other.StrengthIncreaseExponentShift)
&& PopMean.Equals(other.PopMean)
&& PopDeviation.Equals(other.PopDeviation)
&& PopShift.Equals(other.PopShift);
}
}
}