Index: DamClients/DamUI/trunk/src/Dam/Forms/SurfaceLineDrawingObject.cs =================================================================== diff -u -r2088 -r3436 --- DamClients/DamUI/trunk/src/Dam/Forms/SurfaceLineDrawingObject.cs (.../SurfaceLineDrawingObject.cs) (revision 2088) +++ DamClients/DamUI/trunk/src/Dam/Forms/SurfaceLineDrawingObject.cs (.../SurfaceLineDrawingObject.cs) (revision 3436) @@ -30,7 +30,7 @@ { public class SurfaceLineDrawingObject : DrawingObject { - private GeometryPointString surfaceLine = null; + private GeometryPointString surfaceLine; private Color color = Color.Salmon; /// @@ -58,7 +58,7 @@ /// The data object. public override void SetDataObject(object dataObject) { - this.surfaceLine = (GeometryPointString)dataObject; + surfaceLine = (GeometryPointString)dataObject; } /// @@ -73,7 +73,7 @@ /// /// override The Draw3D() Method /// - /// + /// public override void Draw3D(GraphicsInfo info) { DrawingSupport.SetIEPDraw3D(info.Graphics); @@ -90,8 +90,8 @@ var calculatedPoint = new Point3D(); var calculatedPoint1 = new Point3D(); - this.GetScaled3DPoint(info.Projection, pointList[curveIndex].GetPoint3D(), ref calculatedPoint); - this.GetScaled3DPoint(info.Projection, pointList[curveIndex + 1].GetPoint3D(), ref calculatedPoint1); + GetScaled3DPoint(info.Projection, pointList[curveIndex].GetPoint3D(), ref calculatedPoint); + GetScaled3DPoint(info.Projection, pointList[curveIndex + 1].GetPoint3D(), ref calculatedPoint1); DrawingSupport.Line3D(calculatedPoint.X, calculatedPoint.Y, calculatedPoint.Z, calculatedPoint1.X, calculatedPoint1.Y, calculatedPoint1.Z); } } Index: DamClients/DamUI/trunk/src/Dam/Forms/Deltares.Dam.Forms.csproj =================================================================== diff -u -r2755 -r3436 --- DamClients/DamUI/trunk/src/Dam/Forms/Deltares.Dam.Forms.csproj (.../Deltares.Dam.Forms.csproj) (revision 2755) +++ DamClients/DamUI/trunk/src/Dam/Forms/Deltares.Dam.Forms.csproj (.../Deltares.Dam.Forms.csproj) (revision 3436) @@ -233,6 +233,7 @@ Resources.resx + UserControl Index: DamClients/DamUI/trunk/src/Dam/Forms/SlipCircleDrawingObject.cs =================================================================== diff -u --- DamClients/DamUI/trunk/src/Dam/Forms/SlipCircleDrawingObject.cs (revision 0) +++ DamClients/DamUI/trunk/src/Dam/Forms/SlipCircleDrawingObject.cs (revision 3436) @@ -0,0 +1,124 @@ +// Copyright (C) Stichting Deltares 2021. All rights reserved. +// +// This file is part of the application DAM - UI. +// +// DAM - UI is free software: you can redistribute it and/or modify +// it under the terms of the GNU 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 General Public License for more details. +// +// You should have received a copy of the GNU 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.Collections.Generic; +using System.Drawing; +using Deltares.Dam.Data; +using Deltares.Geometry.Forms; +using Deltares.Mathematics; +using Deltares.Standard.Forms; + +namespace Deltares.Dam.Forms +{ + public class SlipCircleDrawingObject : DrawingObject + { + private StabilityResultSlice slipcircle; + private Color color = Color.Salmon; + + /// + /// Initializes a new instance of the class. + /// + public SlipCircleDrawingObject() + { + this.Layer = -60; + } + /// + /// Gets or sets the color. + /// + /// + /// The color. + /// + public Color Color + { + get { return color; } + set { color = value; } + } + + /// + /// Sets the data object. + /// + /// The data object. + public override void SetDataObject(object dataObject) + { + slipcircle = (StabilityResultSlice)dataObject; + } + + /// + /// Gets the data object. + /// + /// + public override object GetDataObject() + { + return slipcircle; + } + + /// + /// override The Draw3D() Method + /// + /// + public override void Draw3D(GraphicsInfo info) + { + DrawingSupport.SetIEPDraw3D(info.Graphics); + DrawingSupport.ColorMaterial3D(Color.CornflowerBlue); + + DrawingSupport.Brush3D(Color.Black); + + DrawingSupport.Pen3D(System.Drawing.Drawing2D.DashStyle.Solid, 3, color); + + var bottomLeftPoint = new Point3D() + { + X = slipcircle.BottomLeftPoint.X, + Y = 0, + Z = slipcircle.BottomLeftPoint.Y + }; + + var bottomRightPoint = new Point3D() + { + X = slipcircle.BottomRightPoint.X, + Y = 0, + Z = slipcircle.BottomRightPoint.Y + }; + + var topLeftPoint = new Point3D() + { + X = slipcircle.TopLeftPoint.X, + Y = 0, + Z = slipcircle.TopLeftPoint.Y + }; + + var topRightPoint = new Point3D() + { + X = slipcircle.TopRightPoint.X, + Y = 0, + Z = slipcircle.TopRightPoint.Y + }; + + GetScaled3DPoint(info.Projection, bottomLeftPoint, ref bottomLeftPoint); + GetScaled3DPoint(info.Projection, bottomRightPoint, ref bottomRightPoint); + GetScaled3DPoint(info.Projection, topLeftPoint, ref topLeftPoint); + GetScaled3DPoint(info.Projection, topRightPoint, ref topRightPoint); + DrawingSupport.Line3D(bottomLeftPoint.X, bottomLeftPoint.Y, bottomLeftPoint.Z, bottomRightPoint.X, bottomRightPoint.Y, bottomRightPoint.Z); + DrawingSupport.Line3D(bottomRightPoint.X, bottomRightPoint.Y, bottomRightPoint.Z, topRightPoint.X, topRightPoint.Y, topRightPoint.Z); + DrawingSupport.Line3D(topRightPoint.X, topRightPoint.Y, topRightPoint.Z, topLeftPoint.X, topLeftPoint.Y, topLeftPoint.Z); + DrawingSupport.Line3D(topLeftPoint.X, topLeftPoint.Y, topLeftPoint.Z, bottomLeftPoint.X, bottomLeftPoint.Y, bottomLeftPoint.Z); + } + } +} Index: DamClients/DamUI/trunk/src/Dam/Forms/DamSpatialEditorDecorator.cs =================================================================== diff -u -r2618 -r3436 --- DamClients/DamUI/trunk/src/Dam/Forms/DamSpatialEditorDecorator.cs (.../DamSpatialEditorDecorator.cs) (revision 2618) +++ DamClients/DamUI/trunk/src/Dam/Forms/DamSpatialEditorDecorator.cs (.../DamSpatialEditorDecorator.cs) (revision 3436) @@ -51,6 +51,7 @@ private readonly Color surfaceLineColor = Color.Salmon; private readonly Color redesignedSurfaceLineColor = Color.Lime; private readonly Color sensorColor = Color.Lime; + private readonly Color slipCircleColor = Color.Black; private bool editMode; private int GeometryProbabilitiesCount @@ -119,6 +120,21 @@ private SoilSurfaceProfile CurrentSoilProfile { get; set; } /// + /// The currently visible slices of the slip circle for this location + /// + internal StabilityResultSlice ResultSlice + { + get + { + if (csvExportData != null) + { + return csvExportData.ResultSlices[index]; + } + return null; + } + } + + /// /// Constructs a DamSpatialEditorDecorator by adapting the passed spatialEditor. /// /// The spatial editor to be decorated @@ -332,6 +348,12 @@ UpdateRedesignedSurfaceLine(); } + // Add drawing object for slip circle + if (csvExportData != null) + { + DrawSlipCircle(); + } + decoratedSpatialEditor.EmptySelection = new EmptyShape(locationJob); decoratedSpatialEditor.ZoomToExtents(); @@ -356,6 +378,18 @@ decoratedSpatialEditor.AddShape(surfaceLineObject); } + /// + /// Shows the slip circle. + /// + private void DrawSlipCircle() + { + var slipCircleObject = new SlipCircleDrawingObject(); + slipCircleObject.SetDataObject(ResultSlice); + slipCircleObject.Color = slipCircleColor; + + decoratedSpatialEditor.AddShape(slipCircleObject); + } + private void DrawSoilProfile() { decoratedSpatialEditor.AddObject(CurrentSoilProfile); Index: DamClients/DamUI/trunk/src/Dam/Forms/DamGeometryEditor.cs =================================================================== diff -u -r2135 -r3436 --- DamClients/DamUI/trunk/src/Dam/Forms/DamGeometryEditor.cs (.../DamGeometryEditor.cs) (revision 2135) +++ DamClients/DamUI/trunk/src/Dam/Forms/DamGeometryEditor.cs (.../DamGeometryEditor.cs) (revision 3436) @@ -67,6 +67,7 @@ BindSupport.Bind(panel, nextButton, spatialEditor.GetType(), StaticReflection.GetMemberName(x => x.Next())); BindSupport.Bind(panel, probabilityItem, spatialEditor.GetType(), StaticReflection.GetMemberName(x => x.ProbabilityString)); BindSupport.Bind(panel, soilProfileLabel, spatialEditor.GetType(), StaticReflection.GetMemberName(x => x.ProfileName)); + BindSupport.Bind(panel, soilProfileLabel, spatialEditor.GetType(), StaticReflection.GetMemberName(x => x.ResultSlice)); BindSupport.Bind(panel, editMode, spatialEditor.GetType(), StaticReflection.GetMemberName(x => x.EditMode)); BindSupport.Assign(panel, spatialEditor); }