// Copyright (C) Stichting Deltares 2019. All rights reserved. // // This file is part of the Dam Engine. // // The Dam Engine is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero 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 Affero General Public License for more details. // // You should have received a copy of the GNU Affero 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 Deltares.DamEngine.Data.Geotechnics; namespace Deltares.DamEngine.Data.General { /// /// Class holding the soilprofile (either 1D or 2D) and its probability /// public class SoilGeometryProbability { /// /// Gets or sets the name of the SoilProfile1D. /// /// /// The name of the soilgeometry1d. /// public virtual string SoilProfile1DName { get; set; } /// /// Gets or sets the soil profile 1D. /// /// /// The soil profile. /// public virtual SoilProfile1D SoilProfile1D { get; set; } /// /// Gets or sets the name of the SoilProfile2D. /// /// /// The name of the soilgeometry1d. /// public virtual string SoilProfile2DName { get; set; } /// /// Gets or sets the soilprofile2d. /// /// /// The soilprofile2d. /// public virtual SoilProfile2D SoilProfile2D { get; set; } /// /// Gets or sets the name of the sti file (that holds the 2D profile) including full path. /// /// /// The name of the soilgeometry2d including full path. /// public virtual string FullStiFileName { get; set; } /// /// Gets or sets the name of the sti file (that holds the 2D profile). /// /// /// The name of the soilgeometry2d. /// public virtual string StiFileName { get; set; } /// /// Gets or sets the type of the segment failure mechanism. /// /// /// The type of the segment failure mechanism. /// public virtual SegmentFailureMechanismType? SegmentFailureMechanismType { get; set; } /// /// Gets or sets the probability of occurance; number between 0.0 and 100.0. /// /// /// The probability. /// public virtual double Probability { get; set; } /// /// Gets the type of the soil geometry. /// /// /// The type of the soil geometry. /// /// No soilprofile assigned public SoilProfileType SoilProfileType { get; set; } /// /// Returns a that represents this instance. /// /// /// A that represents this instance. /// public override string ToString() { if (SoilProfile1D != null) { return SoilProfile1D.Name; } else { return StiFileName; } } /// Determines the soilProfile1D at x coordinate, regardless of the soil profile type (1D or 2D). /// Does not support *.sti files /// The x coordinate. /// /// /// /// public SoilProfile1D DetermineSoilProfile1DAtX(double xCoordinate, SurfaceLine2 surfaceLine, Soil dikeEmbankmentMaterial) { SoilProfile1D soilProfile1D; switch (this.SoilProfileType) { case SoilProfileType.ProfileType1D: soilProfile1D = SoilProfileHelper.DetermineForSurfaceLineCorrected1DProfileAtX(SoilProfile1D, surfaceLine, xCoordinate, dikeEmbankmentMaterial); break; case SoilProfileType.ProfileType2D: soilProfile1D = SoilProfile2D.GetSoilProfile1D(xCoordinate); break; default: throw new NotSupportedException(String.Format("{0} not supported", SoilProfileType)); } return soilProfile1D; } } }