Index: dam clients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs =================================================================== diff -u -r743 -r755 --- dam clients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs (.../DamPlugin.cs) (revision 743) +++ dam clients/DamUI/trunk/src/Dam/Forms/DamPlugin.cs (.../DamPlugin.cs) (revision 755) @@ -1420,7 +1420,7 @@ var newlyCreatedSurfaceLines = new List(); foreach (CsvExportData designResult in this.damProject.DamProjectData.DesignCalculations) { - var redesignedSurfaceLinePipingGlobal = designResult.CreateRedesignedSurfaceLinePipingGlobal(); + var redesignedSurfaceLinePipingGlobal = designResult.CreateRedesignedSurfaceLineGlobal(); if (redesignedSurfaceLinePipingGlobal != null) { newlyCreatedSurfaceLines.Add(redesignedSurfaceLinePipingGlobal); @@ -1448,7 +1448,7 @@ exportListSurfaceLines = new List(); foreach (CsvExportData designResult in this.damProject.DamProjectData.DesignCalculations) { - var globalRedesignedSurfaceLine = designResult.CreateRedesignedSurfaceLineStabilityGlobal(); + var globalRedesignedSurfaceLine = designResult.CreateRedesignedSurfaceLineGlobal(); if (globalRedesignedSurfaceLine != null) { newlyCreatedSurfaceLines.Add(globalRedesignedSurfaceLine); Index: dam clients/DamUI/trunk/src/Dam/Data/CsvExportData.cs =================================================================== diff -u -r753 -r755 --- dam clients/DamUI/trunk/src/Dam/Data/CsvExportData.cs (.../CsvExportData.cs) (revision 753) +++ dam clients/DamUI/trunk/src/Dam/Data/CsvExportData.cs (.../CsvExportData.cs) (revision 755) @@ -25,13 +25,11 @@ using System.Xml.Serialization; using Deltares.Geographic; using Deltares.Geometry; -using Deltares.Geotechnics.Converter; using Deltares.Geotechnics.GeotechnicalGeometry; using Deltares.Standard; using Deltares.Standard.EventPublisher; using Deltares.Standard.Units; using System; -using System.Collections.Generic; using Deltares.Geotechnics.Soils; using Deltares.Geotechnics.SurfaceLines; using Deltares.Standard.Attributes; @@ -99,20 +97,14 @@ private string notes = ""; private StabilityKernelType selectedStabilityKernelType = StabilityKernelType.DamClassic; - // redesigned LOCAL surfaceline for stability (initialized with original local surfaceline) - private SurfaceLine2 redesignedSurfaceLineStability; - // redesigned Global surfaceline for stability (based on redesignedSurfaceLineStability) - private SurfaceLine2 redesignedSurfaceLineStabilityGlobal; - // redesigned LOCAL surfaceline for piping (initialized with original local surfaceline) - private SurfaceLine2 redesignedSurfaceLinePiping; - // redesigned Global surfaceline for piping (based on redesignedSurfaceLinePiping) - private SurfaceLine2 redesignedSurfaceLinePipingGlobal; + // redesigned LOCAL surfaceline (initialized with original local surfaceline) + private SurfaceLine2 redesignedSurfaceLine; // redesigned Global surfaceline in use for this result (either piping or stability) private SurfaceLine2 redesignedSurfaceLineGlobal; public CsvExportData() { - // + // this contructor is needed for the UI table eventhough is seems not to be referenced. } /// @@ -585,10 +577,10 @@ { get { - if (redesignedSurfaceLineStabilityGlobal == null) + if (redesignedSurfaceLineGlobal == null) return null; - GeometryPoint point = redesignedSurfaceLineStabilityGlobal.GetDikeToeInward(); + GeometryPoint point = redesignedSurfaceLineGlobal.GetDikeToeInward(); if (point != null) return point.X; return null; @@ -604,10 +596,10 @@ { get { - if (redesignedSurfaceLineStabilityGlobal == null) + if (redesignedSurfaceLineGlobal == null) return null; - GeometryPoint point = redesignedSurfaceLineStabilityGlobal.GetDikeToeInward(); + GeometryPoint point = redesignedSurfaceLineGlobal.GetDikeToeInward(); if (point != null) return point.Z; return null; @@ -623,10 +615,10 @@ { get { - if (redesignedSurfaceLineStabilityGlobal == null) + if (redesignedSurfaceLineGlobal == null) return null; - GeometryPoint point = redesignedSurfaceLineStabilityGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); + GeometryPoint point = redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); if (point != null) return point.Z; return null; @@ -699,10 +691,10 @@ { get { - if (redesignedSurfaceLinePipingGlobal == null) + if (redesignedSurfaceLineGlobal == null) return null; - GeometryPoint point = redesignedSurfaceLinePipingGlobal.GetDikeToeInward(); + GeometryPoint point = redesignedSurfaceLineGlobal.GetDikeToeInward(); if (point != null) return point.X; return null; @@ -718,10 +710,10 @@ { get { - if (redesignedSurfaceLinePipingGlobal == null) + if (redesignedSurfaceLineGlobal == null) return null; - GeometryPoint point = redesignedSurfaceLinePipingGlobal.GetDikeToeInward(); + GeometryPoint point = redesignedSurfaceLineGlobal.GetDikeToeInward(); if (point != null) return point.Z; return null; @@ -737,10 +729,10 @@ { get { - if (redesignedSurfaceLinePipingGlobal == null) + if (redesignedSurfaceLineGlobal == null) return null; - GeometryPoint point = redesignedSurfaceLinePipingGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); + GeometryPoint point = redesignedSurfaceLineGlobal.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.ShoulderTopInside); if (point != null) return point.Z; return null; @@ -779,7 +771,11 @@ { get { - return redesignedSurfaceLineGlobal.GetDikeLength(); + if (redesignedSurfaceLineGlobal != null) + { + return redesignedSurfaceLineGlobal.GetDikeLength(); + } + return null; } } @@ -817,11 +813,11 @@ { get { - if (localZone1EntryPointX == null) + if (localZone1EntryPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone1EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); + new GeometryPoint(localZone1EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } @@ -838,11 +834,11 @@ { get { - if (localZone1EntryPointX == null) + if (localZone1EntryPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone1EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); + new GeometryPoint(localZone1EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } @@ -861,9 +857,9 @@ { if (localZone1EntryPointX == null) return null; - if (redesignedSurfaceLineStability == null) + if (redesignedSurfaceLine == null) return null; - return redesignedSurfaceLineStability.Geometry.GetZAtX(localZone1EntryPointX.Value); + return redesignedSurfaceLine.Geometry.GetZAtX(localZone1EntryPointX.Value); } } @@ -889,11 +885,11 @@ { get { - if (localZone1ExitPointX == null) + if (localZone1ExitPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone1ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); + new GeometryPoint(localZone1ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } @@ -909,11 +905,11 @@ { get { - if (localZone1ExitPointX == null) + if (localZone1ExitPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone1ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); + new GeometryPoint(localZone1ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } @@ -931,9 +927,9 @@ { if (localZone1ExitPointX == null) return null; - if (redesignedSurfaceLineStability == null) + if (redesignedSurfaceLine == null) return null; - return redesignedSurfaceLineStability.Geometry.GetZAtX(localZone1ExitPointX.Value); + return redesignedSurfaceLine.Geometry.GetZAtX(localZone1ExitPointX.Value); } } @@ -971,11 +967,11 @@ { get { - if (localZone2EntryPointX == null) + if (localZone2EntryPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone2EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); + new GeometryPoint(localZone2EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; @@ -992,11 +988,11 @@ { get { - if (localZone2EntryPointX == null) + if (localZone2EntryPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone2EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); + new GeometryPoint(localZone2EntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; @@ -1015,9 +1011,9 @@ { if (localZone2EntryPointX == null) return null; - if (redesignedSurfaceLineStability == null) + if (redesignedSurfaceLine == null) return null; - return redesignedSurfaceLineStability.Geometry.GetZAtX(localZone2EntryPointX.Value); + return redesignedSurfaceLine.Geometry.GetZAtX(localZone2EntryPointX.Value); } } @@ -1043,11 +1039,11 @@ { get { - if (localZone2ExitPointX == null) + if (localZone2ExitPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone2ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); + new GeometryPoint(localZone2ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } @@ -1063,11 +1059,11 @@ { get { - if (localZone2ExitPointX == null) + if (localZone2ExitPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localZone2ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineStabilityGlobal); + new GeometryPoint(localZone2ExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } @@ -1083,11 +1079,9 @@ { get { - if (localZone2ExitPointX == null) + if (localZone2ExitPointX == null || redesignedSurfaceLine == null) return null; - if (redesignedSurfaceLineStability == null) - return null; - return redesignedSurfaceLineStability.Geometry.GetZAtX(localZone2ExitPointX.Value); + return redesignedSurfaceLine.Geometry.GetZAtX(localZone2ExitPointX.Value); } } @@ -1148,7 +1142,7 @@ { get { - if (pl3LocalLocationXMinUplift == null) + if (pl3LocalLocationXMinUplift == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( @@ -1169,7 +1163,7 @@ { get { - if (pl3LocalLocationXMinUplift == null) + if (pl3LocalLocationXMinUplift == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( @@ -1226,7 +1220,7 @@ { get { - if (pl4LocalLocationXMinUplift == null) + if (pl4LocalLocationXMinUplift == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( @@ -1247,7 +1241,7 @@ { get { - if (pl4LocalLocationXMinUplift == null) + if (pl4LocalLocationXMinUplift == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( @@ -1529,81 +1523,42 @@ } /// - /// Creates a new instance based on + /// Creates a new instance based on /// with global coordinates instead of local coordinates. /// [Browsable(false)] - public SurfaceLine2 CreateRedesignedSurfaceLineStabilityGlobal() + public SurfaceLine2 CreateRedesignedSurfaceLineGlobal() { - if (redesignedSurfaceLineStability == null) + if (redesignedSurfaceLine == null) return null; SurfaceLine2 originalSurfaceLine = scenario.Location.SurfaceLine2; var coordinateSystemConverter = new CoordinateSystemConverter(); coordinateSystemConverter.DefineGlobalXYZBasedOnLine(originalSurfaceLine.Geometry); - var localRedesignedSurfaceLineStabilityGlobal = new SurfaceLine2 + var localRedesignedSurfaceLineGlobal = new SurfaceLine2 { CharacteristicPoints = { GeometryMustContainPoint = true }, Geometry = new LocalizedGeometryPointString() }; - localRedesignedSurfaceLineStabilityGlobal.Assign(redesignedSurfaceLineStability); - coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(localRedesignedSurfaceLineStabilityGlobal.Geometry); + localRedesignedSurfaceLineGlobal.Assign(redesignedSurfaceLine); + coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(localRedesignedSurfaceLineGlobal.Geometry); - return localRedesignedSurfaceLineStabilityGlobal; + return localRedesignedSurfaceLineGlobal; } [Browsable(false)] - public SurfaceLine2 RedesignedSurfaceLine2Stability + public SurfaceLine2 RedesignedSurfaceLine2 { - get { return redesignedSurfaceLineStability; } + get { return redesignedSurfaceLine; } set { - redesignedSurfaceLineStability = value; - // Also determine and set the correct global versions in order to retrieve dependend properties - redesignedSurfaceLineStabilityGlobal = CreateRedesignedSurfaceLineStabilityGlobal(); - redesignedSurfaceLineGlobal = redesignedSurfaceLineStabilityGlobal; + redesignedSurfaceLine = value; + // Also determine and set the correct global version in order to retrieve dependend properties + redesignedSurfaceLineGlobal = CreateRedesignedSurfaceLineGlobal(); } } - /// - /// Creates a new instance based on - /// with global coordinates instead of local coordinates. - /// - [Browsable(false)] - public SurfaceLine2 CreateRedesignedSurfaceLinePipingGlobal() - { - if (redesignedSurfaceLinePiping == null) - return null; - - SurfaceLine2 originalSurfaceLine = scenario.Location.SurfaceLine2; - var coordinateSystemConverter = new CoordinateSystemConverter(); - coordinateSystemConverter.DefineGlobalXYZBasedOnLine(originalSurfaceLine.Geometry); - - var localRedesignedSurfaceLinePipingGlobal = new SurfaceLine2 - { - CharacteristicPoints = { GeometryMustContainPoint = true }, - Geometry = new LocalizedGeometryPointString() - }; - localRedesignedSurfaceLinePipingGlobal.Assign(redesignedSurfaceLinePiping); - coordinateSystemConverter.ConvertLocalXZToGlobalXYZ(localRedesignedSurfaceLinePipingGlobal.Geometry); - - return localRedesignedSurfaceLinePipingGlobal; - } - - [Browsable(false)] - public SurfaceLine2 RedesignedSurfaceLine2Piping - { - get { return redesignedSurfaceLinePiping; } - set - { - redesignedSurfaceLinePiping = value; - // Also determine and set the correct global versions in order to retrieve dependend properties - redesignedSurfaceLinePipingGlobal = CreateRedesignedSurfaceLinePipingGlobal(); - redesignedSurfaceLineGlobal = redesignedSurfaceLinePipingGlobal; - } - } - [Label("Profile")] [PropertyOrder(2, 1)] [XmlIgnore] @@ -1923,9 +1878,9 @@ get { GeometryPoint point = null; - if (redesignedSurfaceLinePiping != null) + if (redesignedSurfaceLine != null) { - point = redesignedSurfaceLinePiping.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); + point = redesignedSurfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtRiver); } if (point != null) return point.X; @@ -1943,11 +1898,11 @@ { get { - if (LocalPipingEntryPointX == null) + if (LocalPipingEntryPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(LocalPipingEntryPointX.Value, 0.0, 0.0), redesignedSurfaceLinePipingGlobal); + new GeometryPoint(LocalPipingEntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } @@ -1963,11 +1918,11 @@ { get { - if (LocalPipingEntryPointX == null) + if (LocalPipingEntryPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(LocalPipingEntryPointX.Value, 0.0, 0.0), redesignedSurfaceLinePipingGlobal); + new GeometryPoint(LocalPipingEntryPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } @@ -1994,11 +1949,11 @@ { get { - if (localPipingExitPointX == null) + if (localPipingExitPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localPipingExitPointX.Value, 0.0, 0.0), redesignedSurfaceLinePipingGlobal); + new GeometryPoint(localPipingExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.X; } @@ -2014,11 +1969,11 @@ { get { - if (localPipingExitPointX == null) + if (localPipingExitPointX == null || redesignedSurfaceLineGlobal == null) return null; GeometryPoint point = DetermineGlobalPointCoordinatesBasedOnGlobalSurfaceLine( - new GeometryPoint(localPipingExitPointX.Value, 0.0, 0.0), redesignedSurfaceLinePipingGlobal); + new GeometryPoint(localPipingExitPointX.Value, 0.0, 0.0), redesignedSurfaceLineGlobal); return point.Y; } Index: dam clients/DamUI/trunk/src/Dam/Forms/DamSpatialEditorDecorator.cs =================================================================== diff -u -r655 -r755 --- dam clients/DamUI/trunk/src/Dam/Forms/DamSpatialEditorDecorator.cs (.../DamSpatialEditorDecorator.cs) (revision 655) +++ dam clients/DamUI/trunk/src/Dam/Forms/DamSpatialEditorDecorator.cs (.../DamSpatialEditorDecorator.cs) (revision 755) @@ -432,21 +432,9 @@ { if (csvExportData.AnalysisType == AnalysisType.AdaptGeometry) { - switch (csvExportData.DamFailureMechanismeCalculation.FailureMechanismSystemType) + if (csvExportData.RedesignedSurfaceLine2 != null) { - case FailureMechanismSystemType.Piping: - if (csvExportData.RedesignedSurfaceLine2Piping != null) - { - ShowRedesignedSurfaceLine(csvExportData.RedesignedSurfaceLine2Piping.Geometry); - } - break; - case FailureMechanismSystemType.StabilityInside: - case FailureMechanismSystemType.StabilityOutside: - if (csvExportData.RedesignedSurfaceLine2Stability != null) - { - ShowRedesignedSurfaceLine(csvExportData.RedesignedSurfaceLine2Stability.Geometry); - } - break; + ShowRedesignedSurfaceLine(csvExportData.RedesignedSurfaceLine2.Geometry); } } } Index: dam clients/DamUI/trunk/src/Dam/Data/DamEngineIo/FillDamUiFromXmlOutput.cs =================================================================== diff -u -r754 -r755 --- dam clients/DamUI/trunk/src/Dam/Data/DamEngineIo/FillDamUiFromXmlOutput.cs (.../FillDamUiFromXmlOutput.cs) (revision 754) +++ dam clients/DamUI/trunk/src/Dam/Data/DamEngineIo/FillDamUiFromXmlOutput.cs (.../FillDamUiFromXmlOutput.cs) (revision 755) @@ -123,9 +123,9 @@ desResult.ResultMessage = designResult.PipingDesignResults.ResultMessage; if (designResult.PipingDesignResults.RedesignedSurfaceLine != null) { - desResult.RedesignedSurfaceLine2Piping = new SurfaceLine2(); + desResult.RedesignedSurfaceLine2 = new SurfaceLine2(); var surfaceLine = ConvertXmlSurfaceLineToSurfaceLine2(designResult.PipingDesignResults.RedesignedSurfaceLine); - desResult.RedesignedSurfaceLine2Piping = surfaceLine; + desResult.RedesignedSurfaceLine2 = surfaceLine; } if (designResult.PipingDesignResults.UpliftFactorSpecified) desResult.UpliftFactor = designResult.PipingDesignResults.UpliftFactor; if (designResult.PipingDesignResults.HeaveFactorSpecified) desResult.HeaveFactor = designResult.PipingDesignResults.HeaveFactor; @@ -217,9 +217,9 @@ desResult.ResultMessage = designResult.StabilityDesignResults.ResultMessage; if (designResult.StabilityDesignResults.RedesignedSurfaceLine != null) { - desResult.RedesignedSurfaceLine2Stability = new SurfaceLine2(); + desResult.RedesignedSurfaceLine2 = new SurfaceLine2(); var surfaceLine = ConvertXmlSurfaceLineToSurfaceLine2(designResult.StabilityDesignResults.RedesignedSurfaceLine); - desResult.RedesignedSurfaceLine2Stability = surfaceLine; + desResult.RedesignedSurfaceLine2 = surfaceLine; } if (designResult.StabilityDesignResults.SafetyFactorSpecified) desResult.StabilitySafetyFactor = designResult.StabilityDesignResults.SafetyFactor; if (designResult.StabilityDesignResults.Zone1SafetyFactorSpecified) desResult.Zone1SafetyFactorStability = designResult.StabilityDesignResults.Zone1SafetyFactor;