using System.ComponentModel; using System.Xml.Serialization; using Deltares.Geometry; using Deltares.Standard; using Deltares.Standard.Attributes; using Deltares.Standard.EventPublisher; using Deltares.Standard.Units; using Deltares.Standard.Validation; namespace Deltares.Stability { public class SlipCircleFixedPoint : GeometryObject, IVisibleEnabled { private readonly GeometryPoint fixedGeometryPoint = new GeometryPoint(); private ISlipCircleGridOwner owner = null; private bool useFixedPoint; public GeometryPoint FixedGeometryPoint { get { return fixedGeometryPoint; } } /// /// Gets and sets the Fixed Value Of X /// [Unit(UnitType.Length)] [Minimum(-1.000e+06)] [Maximum(1.000e+06)] [PropertyOrder(0)] [Label("XFixedCaption")] [Description("XFixedDescription")] [Format("F3")] public double XFixed { get { return fixedGeometryPoint.X; } set { fixedGeometryPoint.X = value; } } /// /// gets and sets the Fixed Value of Z /// [Unit(UnitType.Length)] [Minimum(-1.000e+06)] [Maximum(1.000e+06)] [PropertyOrder(1)] [Label("ZFixedCaption")] [Description("ZFixedDescription")] [Format("F3")] public double ZFixed { get { return fixedGeometryPoint.Z; } set { fixedGeometryPoint.Z = value; } } /// /// Boolean to Flag if FixedPoint Is Used /// [Browsable(false)] public bool UseFixedPoint { get { return useFixedPoint; } set { if (value != useFixedPoint) { DataEventPublisher.BeforeChange(this, "UseFixedPoint"); useFixedPoint = value; DataEventPublisher.AfterChange(this, "UseFixedPoint"); } DataEventPublisher.Changed(this); } } [Browsable(false)] [XmlIgnore] public ISlipCircleGridOwner Owner { get { return owner; } set { owner = value; } } public bool IsVisible(string property) { switch (property) { case "Name": return false; default: return true; } } public bool IsEnabled(string property) { switch (property) { case "XFixed": return UseFixedPoint; case "ZFixed": return UseFixedPoint; default: return true; } } } }