// 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
{
///
/// Exception class for SoilGeometry
///
public class SoilGeometryException : ApplicationException
{
public SoilGeometryException(string message) : base(message)
{
}
}
public class SoilGeometryBase
{
public virtual SoilProfileType SoilProfileType { get; set; }
public virtual string SoilGeometryName { get; set; }
}
///
/// Super class to contain 1D and 2D soil geometry
///
public class SoilGeometry : SoilGeometryBase
{
private SoilProfile1D soilProfile;
private string soilGeometry2DName;
///
/// Constructor
///
public SoilGeometry(SoilProfile1D soilProfile, string soilGeometry2DName)
{
this.SoilProfile = soilProfile;
this.SoilGeometry2DName = soilGeometry2DName;
}
#region PublicPropteries
public override SoilProfileType SoilProfileType
{
get
{
SoilProfileType soilProfileType = SoilProfileType.ProfileTypeStiFile;
if (soilProfile != null)
{
soilProfileType = SoilProfileType.ProfileType1D;
}
if ((SoilProfile == null) && ((SoilGeometry2DName == null) || SoilGeometry2DName == ""))
{
throw new SoilGeometryException("No geometry assigned");
}
return soilProfileType;
}
}
public SoilProfile1D SoilProfile
{
get { return soilProfile; }
set { soilProfile = value; }
}
public string SoilGeometry2DName
{
get { return soilGeometry2DName; }
set { soilGeometry2DName = value; }
}
#endregion PublicPropteries
}
}