Index: Ringtoets/Piping/src/Ringtoets.Piping.Primitives/RingtoetsPipingSurfaceLine.cs
===================================================================
diff -u -rc33fbb6a840ef596c665774b609f82b948f3b512 -r558605d41d8d3a54d2d8b5aee1ace1a36cb64214
--- Ringtoets/Piping/src/Ringtoets.Piping.Primitives/RingtoetsPipingSurfaceLine.cs (.../RingtoetsPipingSurfaceLine.cs) (revision c33fbb6a840ef596c665774b609f82b948f3b512)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Primitives/RingtoetsPipingSurfaceLine.cs (.../RingtoetsPipingSurfaceLine.cs) (revision 558605d41d8d3a54d2d8b5aee1ace1a36cb64214)
@@ -23,7 +23,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
-
+using Core.Common.Base.Data;
using Core.Common.Base.Geometry;
using Core.Common.Base.Storage;
using Ringtoets.Piping.Primitives.Exceptions;
@@ -138,8 +138,8 @@
///
/// Sets the at the given point.
///
- /// The location as a which to set as the .
- /// Thrown when doesn't contain a at
+ /// The location as a which to set as the .
+ /// Thrown when doesn't contain a at
/// .
/// is null.
public void SetDitchPolderSideAt(Point3D point)
@@ -155,8 +155,8 @@
///
/// Sets the at the given point.
///
- /// The location as a which to set as the .
- /// Thrown when doesn't contain a at
+ /// The location as a which to set as the .
+ /// Thrown when doesn't contain a at
/// .
/// is null.
public void SetBottomDitchPolderSideAt(Point3D point)
@@ -172,8 +172,8 @@
///
/// Sets the at the given point.
///
- /// The location as a which to set as the .
- /// Thrown when doesn't contain a at
+ /// The location as a which to set as the .
+ /// Thrown when doesn't contain a at
/// .
/// is null.
public void SetBottomDitchDikeSideAt(Point3D point)
@@ -189,8 +189,8 @@
///
/// Sets the at the given point.
///
- /// The location as a which to set as the .
- /// Thrown when doesn't contain a at
+ /// The location as a which to set as the .
+ /// Thrown when doesn't contain a at
/// .
/// is null.
public void SetDitchDikeSideAt(Point3D point)
@@ -206,8 +206,8 @@
///
/// Sets the at the given point.
///
- /// The location as a which to set as the .
- /// Thrown when doesn't contain a at
+ /// The location as a which to set as the .
+ /// Thrown when doesn't contain a at
/// .
/// is null.
public void SetDikeToeAtRiverAt(Point3D point)
@@ -223,8 +223,8 @@
///
/// Sets the at the given point.
///
- /// The location as a which to set as the .
- /// Thrown when doesn't contain a at
+ /// The location as a which to set as the .
+ /// Thrown when doesn't contain a at
/// .
/// is null.
public void SetDikeToeAtPolderAt(Point3D point)
@@ -246,7 +246,7 @@
/// intersection point at have a significant difference in their y coordinate.
/// is not in range of the LZ-projected .
/// is empty.
- public double GetZAtL(double l)
+ public RoundedDouble GetZAtL(double l)
{
ValidateHasPoints();
@@ -267,7 +267,7 @@
if (equalIntersections)
{
- return intersectionPoints.First().Y;
+ return new RoundedDouble(2, intersectionPoints.First().Y);
}
var message = string.Format(Resources.RingtoetsPipingSurfaceLine_Cannot_determine_reliable_z_when_surface_line_is_vertical_in_l, l);
@@ -279,24 +279,25 @@
/// Z-values are retained, and the first point is put a L=0.
///
/// Collection of 2D points in the LZ-plane.
- public IEnumerable ProjectGeometryToLZ()
+ public RoundedPoint2DCollection ProjectGeometryToLZ()
{
+ var numberOfDecimalPlaces = 2;
var count = geometryPoints.Length;
if (count == 0)
{
- return Enumerable.Empty();
+ return new RoundedPoint2DCollection(numberOfDecimalPlaces, Enumerable.Empty());
}
Point3D first = Points.First();
if (count == 1)
{
- return new[] { new Point2D(0.0, first.Z)};
+ return new RoundedPoint2DCollection(numberOfDecimalPlaces, new[] { new Point2D(0.0, first.Z)});
}
Point3D last = Points.Last();
Point2D firstPoint = new Point2D(first.X, first.Y);
Point2D lastPoint = new Point2D(last.X, last.Y);
- return Points.Select(p => p.ProjectIntoLocalCoordinates(firstPoint, lastPoint));
+ return new RoundedPoint2DCollection(numberOfDecimalPlaces, Points.Select(p => p.ProjectIntoLocalCoordinates(firstPoint, lastPoint)));
}
public override string ToString()
@@ -308,7 +309,7 @@
/// Finds a point from which is at the same position as .
///
/// The location of a point from .
- /// The from at the same location as .
+ /// The from at the same location as .
/// is null.
private Point3D GetPointFromGeometry(Point3D point)
{
@@ -347,7 +348,7 @@
/// L-coordinate being monotonically non-decreasing
/// falls outside the L-coordiante span
/// defined by .
- public void ValidateInRange(double localCoordinateL, Point2D[] geometryInLocalCoordinates)
+ private void ValidateInRange(double localCoordinateL, Point2D[] geometryInLocalCoordinates)
{
Point2D firstLocalPoint = geometryInLocalCoordinates.First();
Point2D lastLocalPoint = geometryInLocalCoordinates.Last();