using System; using System.ComponentModel; 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 { [Serializable] public class LineLoad : GeometryObject { private double direction = 0.0; private double distribution = 0.0; private GeometryPoint lineLoadPoint = null; private double magnitude = 0.0; public LineLoad() { magnitude = 0.0; direction = 0.0; distribution = 0.0; lineLoadPoint = new GeometryPoint(); } [Browsable(false)] public GeometryPoint LineLoadPoint { get { return lineLoadPoint; } } [Unit(UnitType.PressurePerLength)] [Minimum(0)] [Maximum(100000)] [PropertyOrder(1)] [Format("F3")] public double Magnitude { get { return magnitude; } set { if (value != magnitude) { DataEventPublisher.BeforeChange(this, "Magnitude"); magnitude = value; DataEventPublisher.AfterChange(this, "Magnitude"); } } } [Unit(UnitType.Angle)] [Minimum(-90)] [Maximum(90)] [PropertyOrder(4)] [Format("F3")] public double Direction { get { return direction; } set { if (value != direction) { DataEventPublisher.BeforeChange(this, "Direction"); direction = value; DataEventPublisher.AfterChange(this, "Direction"); } } } [Unit(UnitType.Angle)] [Minimum(0)] [Maximum(90)] [PropertyOrder(5)] [Format("F3")] public double Distribution { get { return distribution; } set { if (value != distribution) { DataEventPublisher.BeforeChange(this, "Distribution"); distribution = value; DataEventPublisher.AfterChange(this, "Distribution"); } } } [Unit(UnitType.Length)] [Minimum(-1.000e+06)] [Maximum(1.000e+06)] [PropertyOrder(2)] [Format("F3")] public double X { get { return lineLoadPoint.X; } set { if (value != lineLoadPoint.X) { lineLoadPoint.X = value; DataEventPublisher.Changed(this); } } } [Browsable(false)] public double Y { get { return lineLoadPoint.Y; } set { if (value != lineLoadPoint.Y) { lineLoadPoint.Y = value; DataEventPublisher.Changed(this, "Y"); } } } [Unit(UnitType.Length)] [Minimum(-1.000e+06)] [Maximum(1.000e+06)] [PropertyOrder(3)] [Format("F3")] public double Z { get { return lineLoadPoint.Z; } set { if (value != lineLoadPoint.Z) { lineLoadPoint.Z = value; DataEventPublisher.Changed(this); } } } public override GeometryBounds GetGeometryBounds() { return lineLoadPoint.GetGeometryBounds(); } public override bool ContainsPoint(Point3D point, double tolerance) { return Routines2D.DetermineIfPointsCoincide(point.GetPointXZ(), lineLoadPoint.GetPointXz(), tolerance); } } }