// Copyright (C) Stichting Deltares 2024. 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 Deltares.DamEngine.Data.Standard; using Deltares.DamEngine.Data.Standard.Validation; namespace Deltares.DamEngine.Data.General; public class SlipCircleDefinition : IAssignable, ICloneable { public double XCoordinateLowestUpliftFactorPoint { get; set; } public TangentLinesDefinition UpliftVanTangentLinesDefinition { get; set; } public double UpliftVanTangentLinesDistance { get; set; } public GridSizeDetermination BishopSearchAreaDetermination { get; set; } public double BishopTangentLinesDistance { get; set; } public GridSizeDetermination UpliftVanGridSizeDetermination { get; set; } public int UpliftVanLeftGridVerticalPointCount { get; set; } public double UpliftVanLeftGridVerticalPointDistance { get; set; } public int UpliftVanLeftGridHorizontalPointCount { get; set; } public double UpliftVanLeftGridHorizontalPointDistance { get; set; } public int UpliftVanRightGridVerticalPointCount { get; set; } public double UpliftVanRightGridVerticalPointDistance { get; set; } public int UpliftVanRightGridHorizontalPointCount { get; set; } public double UpliftVanRightGridHorizontalPointDistance { get; set; } public int BishopGridVerticalPointCount { get; set; } public double BishopGridVerticalPointDistance { get; set; } public int BishopGridHorizontalPointCount { get; set; } public double BishopGridHorizontalPointDistance { get; set; } public DamFailureMechanismeCalculationSpecification Specification { get; set; } public void Assign(SlipCircleDefinition slipCircleDefinition) { XCoordinateLowestUpliftFactorPoint = slipCircleDefinition.XCoordinateLowestUpliftFactorPoint; UpliftVanTangentLinesDefinition = slipCircleDefinition.UpliftVanTangentLinesDefinition; UpliftVanTangentLinesDistance = slipCircleDefinition.UpliftVanTangentLinesDistance; UpliftVanGridSizeDetermination = slipCircleDefinition.UpliftVanGridSizeDetermination; UpliftVanLeftGridVerticalPointCount = slipCircleDefinition.UpliftVanLeftGridVerticalPointCount; UpliftVanLeftGridVerticalPointDistance = slipCircleDefinition.UpliftVanLeftGridVerticalPointDistance; UpliftVanLeftGridHorizontalPointCount = slipCircleDefinition.UpliftVanLeftGridHorizontalPointCount; UpliftVanLeftGridHorizontalPointDistance = slipCircleDefinition.UpliftVanLeftGridHorizontalPointDistance; UpliftVanRightGridVerticalPointCount = slipCircleDefinition.UpliftVanRightGridVerticalPointCount; UpliftVanRightGridVerticalPointDistance = slipCircleDefinition.UpliftVanRightGridVerticalPointDistance; UpliftVanRightGridHorizontalPointCount = slipCircleDefinition.UpliftVanRightGridHorizontalPointCount; UpliftVanRightGridHorizontalPointDistance = slipCircleDefinition.UpliftVanRightGridHorizontalPointDistance; BishopSearchAreaDetermination = slipCircleDefinition.BishopSearchAreaDetermination; BishopTangentLinesDistance = slipCircleDefinition.BishopTangentLinesDistance; BishopGridVerticalPointCount = slipCircleDefinition.BishopGridVerticalPointCount; BishopGridVerticalPointDistance = slipCircleDefinition.BishopGridVerticalPointDistance; BishopGridHorizontalPointCount = slipCircleDefinition.BishopGridHorizontalPointCount; BishopGridHorizontalPointDistance = slipCircleDefinition.BishopGridHorizontalPointDistance; } public SlipCircleDefinition Clone() { var slipCircleDefinition = new SlipCircleDefinition(); slipCircleDefinition.Assign(this); return slipCircleDefinition; } } public class MStabParameters : ICloneable { public MStabParameters() { Model = StabilityModelType.Bishop; SearchMethod = StabilitySearchMethod.Grid; GridPosition = StabilityGridPosition.Right; SlipCircleDefinition = new SlipCircleDefinition(); } public StabilityModelType Model { get; set; } public StabilitySearchMethod SearchMethod { get; set; } public string ProjectFileName { get; set; } [Validate] public SlipCircleDefinition SlipCircleDefinition { get; set; } public StabilityGridPosition GridPosition { get; set; } public void Assign(MStabParameters mstabParameters) { Model = mstabParameters.Model; SearchMethod = mstabParameters.SearchMethod; GridPosition = mstabParameters.GridPosition; ProjectFileName = mstabParameters.ProjectFileName; if (SlipCircleDefinition != null) { SlipCircleDefinition.Assign(mstabParameters.SlipCircleDefinition); } else { SlipCircleDefinition = null; } } public MStabParameters Clone() { var mstabParameters = new MStabParameters(); if (SlipCircleDefinition != null) { mstabParameters.SlipCircleDefinition = SlipCircleDefinition.Clone(); } mstabParameters.Assign(this); return mstabParameters; } }