Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/PlLinesToWaternetConverter.cs =================================================================== diff -u -r5994 -r6087 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/PlLinesToWaternetConverter.cs (.../PlLinesToWaternetConverter.cs) (revision 5994) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/MacroStabilityCommon/PlLinesToWaternetConverter.cs (.../PlLinesToWaternetConverter.cs) (revision 6087) @@ -67,8 +67,8 @@ // Here we only have to check that the PL-lines were indeed created. ThrowWhenPlLinesIsNull(plLines); - double xLeft = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.SurfaceLevelOutside).X; - double xRight = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.SurfaceLevelInside).X; + double xLeft = surfaceLine.CharacteristicPoints.GetPoint2D(CharacteristicPointType.SurfaceLevelOutside).X; + double xRight = surfaceLine.CharacteristicPoints.GetPoint2D(CharacteristicPointType.SurfaceLevelInside).X; var waternet = new Waternet(); @@ -80,11 +80,10 @@ WaternetLine waternetLine = CreateWaternetLineForPhreaticLine(soilProfile1D, surfaceLine, plLine, xLeft, xRight, pressureType); waternetLine.Name = waternetLine1Name; waternetLine.HeadLine = headLine; - waternetLine.HeadLine.SyncCalcPoints(); waternet.WaternetLineList.Add(waternetLine); } - double x = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder).X; + double x = surfaceLine.CharacteristicPoints.GetPoint2D(CharacteristicPointType.DikeToeAtPolder).X; var dummySoil = new Soil("dummy", 0.0, 0.0); SoilProfile1D soilProfile1DDikeToeAtPolder = SoilProfileHelper.DetermineForSurfaceLineCorrected1DProfileAtX(soilProfile1D, surfaceLine, x, dummySoil); @@ -185,9 +184,8 @@ internal static WaternetLine CreateWaternetLine(double level, double xLeft, double xRight) { var waternetLine = new WaternetLine(); - waternetLine.Points.Add(new GeometryPoint(xLeft, level)); - waternetLine.Points.Add(new GeometryPoint(xRight, level)); - waternetLine.SyncCalcPoints(); + waternetLine.CalcPoints.Add(new Point2D(xLeft, level)); + waternetLine.CalcPoints.Add(new Point2D(xRight, level)); return waternetLine; } @@ -267,8 +265,7 @@ } var line = new TLineType(); - line.Points.AddRange(plLine.Points); - line.SyncCalcPoints(); + line.CalcPoints.AddRange(plLine.Points); line.Name = name; return line; } @@ -278,16 +275,14 @@ var line = new WaternetLine(); foreach (Point2D coordinate in coordinates) { - var point = new GeometryPoint(coordinate.X, coordinate.Z + zOffSet); - line.Points.Add(point); + var point = new Point2D(coordinate.X, coordinate.Z + zOffSet); + line.CalcPoints.Add(point); } - line.SyncCalcPoints(); LineHelper.RemoveDuplicatedPoints(line.CalcPoints, toleranceAlmostEqual); line.RemoveUnnecessaryPoints(); AvoidUpwardsVerticalLine(line.CalcPoints); - line.SyncPoints(); - + return line; } @@ -314,7 +309,7 @@ { case IntrusionVerticalWaterPressureType.Linear: { - List coordinates = surfaceLine.Geometry.Points.Select(point => new Point2D(point.X, point.Z)).ToList(); + List coordinates = surfaceLine.Geometry.CalcPoints.Select(point => new Point2D(point.X, point.Z)).ToList(); return CreateWaternetLine(coordinates); } case IntrusionVerticalWaterPressureType.HydroStatic: @@ -378,7 +373,7 @@ } case IntrusionVerticalWaterPressureType.Linear: { - List xCoordinates = soilProfile2D.Geometry.SurfaceLine.Points.Select(point => new Point2D(point.X, point.Z)).ToList(); + List xCoordinates = soilProfile2D.Geometry.SurfaceLine.CalcPoints.Select(point => new Point2D(point.X, point.Z)).ToList(); return CreateWaternetLine(xCoordinates); } case IntrusionVerticalWaterPressureType.FullHydroStatic: @@ -414,20 +409,18 @@ // Add the first point to get a closed GeometryPointString outerLoop.CalcPoints.Add(new Point2D(outerLoop.CalcPoints[0].X, outerLoop.CalcPoints[0].Z)); - var plLineInGeometryPoint = new GeometryPointString(); + var plLineInPoint2D = new GeometryPointString(); foreach (PlLinePoint point in plLine.Points) { - plLineInGeometryPoint.Points.Add(new GeometryPoint(point.X, point.Z)); - plLineInGeometryPoint.SyncCalcPoints(); + plLineInPoint2D.CalcPoints.Add(new Point2D(point.X, point.Z)); } - List intersectionPoints = outerLoop.IntersectionXzPointsWithGeometryString(plLineInGeometryPoint); + List intersectionPoints = outerLoop.IntersectionXzPointsWithGeometryString(plLineInPoint2D); // Only the layers that intersect the phreatic line are kept. if (intersectionPoints.Count > 0) { var geometrySurface = new GeometrySurface(outerLoop); GeometryPointString bottom = geometrySurface.DetermineBottomGeometrySurface(); - bottom.SyncPoints(); bottom.SortPointsByXAscending(); curves.Add(bottom); } @@ -452,23 +445,21 @@ List relevantLinesAtXWithZBeginMax = relevantLinesAtX.FindAll(line => Math.Abs(line.BeginPoint.Z - minZBegin) < toleranceAlmostEqual); double minZEnd = relevantLinesAtXWithZBeginMax.Select(line => line.EndPoint.Z).Min(); Line relevantLine = relevantLinesAtXWithZBeginMax.Find(line => Math.Abs(line.EndPoint.Z - minZEnd) < toleranceAlmostEqual); - waternetLine.Points.Add(new GeometryPoint(relevantLine.BeginPoint.X, relevantLine.BeginPoint.Z)); - waternetLine.Points.Add(new GeometryPoint(relevantLine.EndPoint.X, relevantLine.EndPoint.Z)); + waternetLine.CalcPoints.Add(new Point2D(relevantLine.BeginPoint.X, relevantLine.BeginPoint.Z)); + waternetLine.CalcPoints.Add(new Point2D(relevantLine.EndPoint.X, relevantLine.EndPoint.Z)); } // Make sure the waternet line for PL 1 is not in the bottom aquifer. - foreach (GeometryPoint waternetLinePoint in waternetLine.Points) + foreach (Point2D waternetLinePoint in waternetLine.CalcPoints) { double bottomAquiferLevel = soilProfile2D.GetSoilProfile1D(waternetLinePoint.X).BottomAquiferLayer.TopLevel; waternetLinePoint.Z = Math.Max(waternetLinePoint.Z, bottomAquiferLevel); } - waternetLine.SyncCalcPoints(); LineHelper.RemoveDuplicatedPoints(waternetLine.CalcPoints, toleranceAlmostEqual); waternetLine.RemoveUnnecessaryPoints(); AvoidUpwardsVerticalLine(waternetLine.CalcPoints); - waternetLine.SyncPoints(); - + return waternetLine; } @@ -497,15 +488,14 @@ WaternetLine waternetLine1 = waternet.WaternetLineList.Find(w => w.Name == waternetLine1Name); if (waternetLine1 != null) { - foreach (GeometryPoint waternetLine1Point + foreach (Point2D waternetLine1Point in from waternetLineOther in waternet.WaternetLineList.FindAll(w => w.Name != waternetLine1Name) - from waternetLine1Point in waternetLine1.Points - where waternetLineOther.Points.Any(point => Math.Abs(point.Z - waternetLine1Point.Z) < toleranceAlmostEqual) + from waternetLine1Point in waternetLine1.CalcPoints + where waternetLineOther.CalcPoints.Any(point => Math.Abs(point.Z - waternetLine1Point.Z) < toleranceAlmostEqual) select waternetLine1Point) { waternetLine1Point.Z += minimumDistance; } - waternetLine1.SyncCalcPoints(); } } @@ -551,7 +541,7 @@ private static List DivideCurvesIntoLines(List curves) { var lines = new List(); - foreach (IList points in curves.Select(curve => curve.Points)) + foreach (IList points in curves.Select(curve => curve.CalcPoints)) { for (var i = 0; i < points.Count - 1; i++) { @@ -593,7 +583,7 @@ private static bool IsLineEndingInPolderSide(GeometryPointString line, SurfaceLine2 surfaceLine) { - GeometryPoint dikeToeAtPolder = surfaceLine.CharacteristicPoints.GetGeometryPoint(CharacteristicPointType.DikeToeAtPolder); + Point2D dikeToeAtPolder = surfaceLine.CharacteristicPoints.GetPoint2D(CharacteristicPointType.DikeToeAtPolder); return dikeToeAtPolder.X.IsLessThan(line.CalcPoints.Last().X, toleranceAlmostEqual); } } \ No newline at end of file