using Deltares.Geometry; using Deltares.Mathematics; using Deltares.Standard; using Deltares.Standard.Attributes; using Deltares.Standard.EventPublisher; using Deltares.Standard.Units; using Deltares.Standard.Validation; namespace Deltares.Stability { /// /// Class which contains properties for Calculation Area (Horizontal Balance). /// public class HorizontalBalance : GeometryObject { private int nZInterval; private double xLeft; private double xRight; private double zBottom; private double zTop; /// /// Constructor. /// public HorizontalBalance() { nZInterval = 1; } /// /// Gets or Sets the X Co-ordinate left side. /// [Unit(UnitType.Length)] [Minimum(-1.000e+06)] [Maximum(1.000e+06)] [PropertyOrder(0)] [Format("F3")] public double XLeft { get { return xLeft; } set { if (value != xLeft) { DataEventPublisher.BeforeChange(this, "XLeft"); // DataEventPublisher.Changed (this,ChangedActions.DataValueBeforeChange, "XLeft"); xLeft = value; DataEventPublisher.AfterChange(this, "XLeft"); // DataEventPublisher.Changed (this,ChangedActions.DataValueAfterChange, "XLeft"); } } } /// /// Gets or Sets the X Co-ordinate right side. /// [Unit(UnitType.Length)] [Minimum(-1.000e+06)] [Maximum(1.000e+06)] [PropertyOrder(1)] [Format("F3")] public double XRight { get { return xRight; } set { if (value != xRight) { DataEventPublisher.BeforeChange(this, "XRight"); //DataEventPublisher.Changed (this,ChangedActions.DataValueBeforeChange, "XRight"); xRight = value; DataEventPublisher.AfterChange(this, "XRight"); //DataEventPublisher.Changed (this,ChangedActions.DataValueAfterChange, "XRight"); } } } /// /// Gets or Sets the highest slip plane level. /// [Unit(UnitType.Length)] [Minimum(-1.000e+06)] [Maximum(1.000e+06)] [PropertyOrder(2)] [Format("F3")] public double ZTop { get { return zTop; } set { if (value != zTop) { DataEventPublisher.BeforeChange(this, "ZTop"); //DataEventPublisher.Changed (this,ChangedActions.DataValueBeforeChange, "ZTop"); zTop = value; DataEventPublisher.AfterChange(this, "ZTop"); //DataEventPublisher.Changed (this,ChangedActions.DataValueAfterChange, "ZTop"); } } } /// /// Gets or Sets the lowest slip plane level. /// [Unit(UnitType.Length)] [Minimum(-1.000e+06)] [Maximum(1.000e+06)] [PropertyOrder(3)] [Format("F3")] public double ZBottom { get { return zBottom; } set { if (value != zBottom) { DataEventPublisher.BeforeChange(this, "ZBottom"); //DataEventPublisher.Changed (this,ChangedActions.DataValueBeforeChange, "ZBottom"); zBottom = value; DataEventPublisher.AfterChange(this, "ZBottom"); //DataEventPublisher.Changed (this,ChangedActions.DataValueAfterChange, "ZBottom"); } } } /// /// Gets or Sets the number of intervals in Slip Plane level. /// [Unit(UnitType.None)] [Minimum(1)] [Maximum(50)] [PropertyOrder(4)] [Format("F3")] public int NZInterval { get { return nZInterval; } set { if (value != NZInterval) { DataEventPublisher.BeforeChange(this, "NZInterval"); nZInterval = value; DataEventPublisher.AfterChange(this, "NZInterval"); } } } public override GeometryBounds GetGeometryBounds() { return new GeometryBounds(XLeft, XRight, ZBottom, ZTop); } public override bool ContainsPoint(Point3D point, double tolerance) { return GetGeometryBounds().ContainsPoint(point.X, point.Z); } } }