Index: Core/Common/src/Core.Common.Base/Geometry/Point2D.cs
===================================================================
diff -u -rdd7a5cfb0343fa2350b4143232b94cbba37612e9 -r2b820514696fca02cd9e7a65c0ebf634e3321a11
--- Core/Common/src/Core.Common.Base/Geometry/Point2D.cs (.../Point2D.cs) (revision dd7a5cfb0343fa2350b4143232b94cbba37612e9)
+++ Core/Common/src/Core.Common.Base/Geometry/Point2D.cs (.../Point2D.cs) (revision 2b820514696fca02cd9e7a65c0ebf634e3321a11)
@@ -51,12 +51,12 @@
///
/// Gets or sets the x coordinate.
///
- public double X { get; set; }
+ public double X { get; private set; }
///
/// Gets or sets the y coordinate.
///
- public double Y { get; set; }
+ public double Y { get; private set; }
///
/// Determines the 2D vector defined by the difference of two .
Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/Calculation/Math2D.cs
===================================================================
diff -u -rdd7a5cfb0343fa2350b4143232b94cbba37612e9 -r2b820514696fca02cd9e7a65c0ebf634e3321a11
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/Calculation/Math2D.cs (.../Math2D.cs) (revision dd7a5cfb0343fa2350b4143232b94cbba37612e9)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/Calculation/Math2D.cs (.../Math2D.cs) (revision 2b820514696fca02cd9e7a65c0ebf634e3321a11)
@@ -80,10 +80,10 @@
}
return new Point2D
- {
- X = (bOtherLine*cLine - bLine*cOtherLine)/determinant,
- Y = (aLine*cOtherLine - aOtherLine*cLine)/determinant
- };
+ (
+ (bOtherLine*cLine - bLine*cOtherLine)/determinant,
+ (aLine*cOtherLine - aOtherLine*cLine)/determinant
+ );
}
///
@@ -129,15 +129,15 @@
private static Point2D LineIntersectionWithVerticalLine(Point2D point1, Point2D point2, double x)
{
var verticalLineFirstPoint = new Point2D
- {
- X = x,
- Y = 0
- };
+ (
+ x,
+ 0
+ );
var verticalLineSecondPoint = new Point2D
- {
- X = x,
- Y = 1
- };
+ (
+ x,
+ 1
+ );
try
{
Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/RingtoetsPipingSurfaceLine.cs
===================================================================
diff -u -rb4ce929ce35e4770f3d8c12d14174de79cc5bee8 -r2b820514696fca02cd9e7a65c0ebf634e3321a11
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/RingtoetsPipingSurfaceLine.cs (.../RingtoetsPipingSurfaceLine.cs) (revision b4ce929ce35e4770f3d8c12d14174de79cc5bee8)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/RingtoetsPipingSurfaceLine.cs (.../RingtoetsPipingSurfaceLine.cs) (revision 2b820514696fca02cd9e7a65c0ebf634e3321a11)
@@ -325,9 +325,9 @@
for (int i = 0; i < count; i++)
{
result[i] = new Point2D
- {
- X = localCoordinatesX[i], Y = geometryPoints[i].Z
- };
+ (
+ localCoordinatesX[i], geometryPoints[i].Z
+ );
}
return result;
}
@@ -351,9 +351,9 @@
// Determine the vectors from the first coordinate to each other coordinate point
// in the XY world coordinate plane:
Point2D[] worldCoordinates = Points.Select(p => new Point2D
- {
- X = p.X, Y = p.Y
- }).ToArray();
+ (
+ p.X, p.Y
+ )).ToArray();
var worldCoordinateVectors = new Vector[worldCoordinates.Length - 1];
for (int i = 1; i < worldCoordinates.Length; i++)
{
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/SoilLayer2DReader.cs
===================================================================
diff -u -ra3c8c0cb4384de51a18d77cc7bea487f97ba21e1 -r2b820514696fca02cd9e7a65c0ebf634e3321a11
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/SoilLayer2DReader.cs (.../SoilLayer2DReader.cs) (revision a3c8c0cb4384de51a18d77cc7bea487f97ba21e1)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/SoilLayer2DReader.cs (.../SoilLayer2DReader.cs) (revision 2b820514696fca02cd9e7a65c0ebf634e3321a11)
@@ -222,10 +222,10 @@
try
{
return new Point2D
- {
- X = double.Parse(x.Value, CultureInfo.InvariantCulture),
- Y = double.Parse(y.Value, CultureInfo.InvariantCulture)
- };
+ (
+ double.Parse(x.Value, CultureInfo.InvariantCulture),
+ double.Parse(y.Value, CultureInfo.InvariantCulture)
+ );
}
catch (ArgumentNullException e)
{
Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Point2DTest.cs
===================================================================
diff -u -rdd7a5cfb0343fa2350b4143232b94cbba37612e9 -r2b820514696fca02cd9e7a65c0ebf634e3321a11
--- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Point2DTest.cs (.../Point2DTest.cs) (revision dd7a5cfb0343fa2350b4143232b94cbba37612e9)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Point2DTest.cs (.../Point2DTest.cs) (revision 2b820514696fca02cd9e7a65c0ebf634e3321a11)
@@ -37,21 +37,7 @@
Assert.AreEqual(x, point.X);
Assert.AreEqual(y, point.Y);
}
- [Test]
- public void AutomaticProperties_SetAndGetValuesAgain_ReturnedValueShouldBeSameAsSetValue()
- {
- // Setup
- var point = new Point2D();
- // Call
- point.X = 1.1;
- point.Y = 2.2;
-
- // Assert
- Assert.AreEqual(1.1, point.X);
- Assert.AreEqual(2.2, point.Y);
- }
-
[Test]
public void Equals_ToNull_ReturnsFalse()
{
@@ -97,16 +83,8 @@
public void Equals_OtherWithSameCoordinates_ReturnsTrue(double x, double y)
{
// Setup
- var point = new Point2D
- {
- X = x,
- Y = y,
- };
- var otherPoint = new Point2D
- {
- X = x,
- Y = y,
- };
+ var point = new Point2D ( x, y );
+ var otherPoint = new Point2D ( x, y );
// Call
var result = point.Equals(otherPoint);
@@ -125,16 +103,8 @@
var x = random.NextDouble();
var y = random.NextDouble();
- var point = new Point2D
- {
- X = x,
- Y = y,
- };
- var otherPoint = new Point2D
- {
- X = x + deltaX,
- Y = y + deltaY,
- };
+ var point = new Point2D(x, y);
+ var otherPoint = new Point2D(x + deltaX, y + deltaY);
// Call
var result = point.Equals(otherPoint);
@@ -151,16 +121,8 @@
var x = random.NextDouble();
var y = random.NextDouble();
- var point = new Point2D
- {
- X = x,
- Y = y,
- };
- var otherPoint = new Point2D
- {
- X = x,
- Y = y,
- };
+ var point = new Point2D(x, y);
+ var otherPoint = new Point2D(x, y);
// Call
var result = point.GetHashCode();
@@ -188,16 +150,8 @@
public void SubstractOperation_TwoDifferentPoints_Return2DVector()
{
// Setup
- var point1 = new Point2D
- {
- X = 3.0,
- Y = 4.0
- };
- var point2 = new Point2D
- {
- X = 1.0,
- Y = 1.0
- };
+ var point1 = new Point2D(3.0, 4.0);
+ var point2 = new Point2D(1.0, 1.0);
// Call
Vector vector = point1 - point2;
@@ -211,11 +165,7 @@
private static void DoToString_HasCoordinateValues_PrintCoordinateValuesInLocalCulture()
{
// Setup
- var point = new Point2D
- {
- X = 1.1,
- Y = 2.2,
- };
+ var point = new Point2D(1.1, 2.2);
// Call
var stringRepresentation = point.ToString();
Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/RingtoetsPipingSurfaceLineTest.cs
===================================================================
diff -u -rb4ce929ce35e4770f3d8c12d14174de79cc5bee8 -r2b820514696fca02cd9e7a65c0ebf634e3321a11
--- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/RingtoetsPipingSurfaceLineTest.cs (.../RingtoetsPipingSurfaceLineTest.cs) (revision b4ce929ce35e4770f3d8c12d14174de79cc5bee8)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/RingtoetsPipingSurfaceLineTest.cs (.../RingtoetsPipingSurfaceLineTest.cs) (revision 2b820514696fca02cd9e7a65c0ebf634e3321a11)
@@ -128,7 +128,7 @@
Point2D[] lzCoordinates = surfaceLine.ProjectGeometryToLZ().ToArray();
// Assert
- CollectionAssert.AreEqual(new[]{ new Point2D { X = 0.0, Y = originalZ } }, lzCoordinates);
+ CollectionAssert.AreEqual(new[]{ new Point2D ( 0.0, originalZ ) }, lzCoordinates);
}
[Test]
Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Segment2DTest.cs
===================================================================
diff -u -rdd7a5cfb0343fa2350b4143232b94cbba37612e9 -r2b820514696fca02cd9e7a65c0ebf634e3321a11
--- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Segment2DTest.cs (.../Segment2DTest.cs) (revision dd7a5cfb0343fa2350b4143232b94cbba37612e9)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Segment2DTest.cs (.../Segment2DTest.cs) (revision 2b820514696fca02cd9e7a65c0ebf634e3321a11)
@@ -70,16 +70,8 @@
{
// Setup
var random = new Random(22);
- var firstPoint = new Point2D
- {
- X = firstPointX,
- Y = random.NextDouble()
- };
- var secondPoint = new Point2D
- {
- X = secondPointX,
- Y = random.NextDouble()
- };
+ var firstPoint = new Point2D(firstPointX, random.NextDouble());
+ var secondPoint = new Point2D(secondPointX, random.NextDouble());
var segment = new Segment2D(firstPoint, secondPoint);
// Call
@@ -100,16 +92,8 @@
{
// Setup
var random = new Random(22);
- var firstPoint = new Point2D
- {
- X = firstPointX,
- Y = random.NextDouble()
- };
- var secondPoint = new Point2D
- {
- X = secondPointX,
- Y = random.NextDouble()
- };
+ var firstPoint = new Point2D(firstPointX, random.NextDouble());
+ var secondPoint = new Point2D(secondPointX, random.NextDouble());
var segment = new Segment2D(firstPoint, secondPoint);
// Call
@@ -131,16 +115,8 @@
var random = new Random(22);
var x = random.NextDouble();
var y = random.NextDouble();
- var firstPoint = new Point2D
- {
- X = x,
- Y = y
- };
- var secondPoint = new Point2D
- {
- X = x,
- Y = y+difference
- };
+ var firstPoint = new Point2D(x, y);
+ var secondPoint = new Point2D(x, y + difference);
var segment = new Segment2D(firstPoint, secondPoint);
// Call
Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/Segment2DLoopCollectionHelper.cs
===================================================================
diff -u -rdd7a5cfb0343fa2350b4143232b94cbba37612e9 -r2b820514696fca02cd9e7a65c0ebf634e3321a11
--- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/Segment2DLoopCollectionHelper.cs (.../Segment2DLoopCollectionHelper.cs) (revision dd7a5cfb0343fa2350b4143232b94cbba37612e9)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/Segment2DLoopCollectionHelper.cs (.../Segment2DLoopCollectionHelper.cs) (revision 2b820514696fca02cd9e7a65c0ebf634e3321a11)
@@ -40,10 +40,7 @@
{
foreach (var tuple in AllIndexesOfDigit(lines[lineIndex]))
{
- points.Add(tuple.Item1,new Point2D
- {
- X = tuple.Item2, Y = y
- });
+ points.Add(tuple.Item1, new Point2D(tuple.Item2, y));
}
}
return CreateLoop(points);
Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilLayer2DTest.cs
===================================================================
diff -u -rdd7a5cfb0343fa2350b4143232b94cbba37612e9 -r2b820514696fca02cd9e7a65c0ebf634e3321a11
--- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilLayer2DTest.cs (.../SoilLayer2DTest.cs) (revision dd7a5cfb0343fa2350b4143232b94cbba37612e9)
+++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilLayer2DTest.cs (.../SoilLayer2DTest.cs) (revision 2b820514696fca02cd9e7a65c0ebf634e3321a11)
@@ -241,24 +241,13 @@
OuterLoop = new List
{
new Segment2D(
- new Point2D
- {
- X = 1.0, Y = y1
- },
- new Point2D
- {
- X = 1.2, Y = y2
- }),
-
+ new Point2D(1.0, y1),
+ new Point2D(1.2, y2)
+ ),
new Segment2D(
- new Point2D
- {
- X = 1.2, Y = y2
- },
- new Point2D
- {
- X = 1.0, Y = y1
- })
+ new Point2D(1.2, y2),
+ new Point2D(1.0, y1)
+ )
}
};
double bottom;
@@ -281,24 +270,13 @@
OuterLoop = new List
{
new Segment2D(
- new Point2D
- {
- X = -0.1, Y = expectedZ
- },
- new Point2D
- {
- X = 0.1, Y = expectedZ
- }),
-
+ new Point2D(-0.1, expectedZ),
+ new Point2D(0.1, expectedZ)
+ ),
new Segment2D(
- new Point2D
- {
- X = -0.1, Y = expectedZ
- },
- new Point2D
- {
- X = 0.1, Y = expectedZ
- })
+ new Point2D(-0.1, expectedZ),
+ new Point2D(0.1, expectedZ)
+ )
}
};
double bottom;
Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder2DTest.cs
===================================================================
diff -u -rdd7a5cfb0343fa2350b4143232b94cbba37612e9 -r2b820514696fca02cd9e7a65c0ebf634e3321a11
--- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder2DTest.cs (.../SoilProfileBuilder2DTest.cs) (revision dd7a5cfb0343fa2350b4143232b94cbba37612e9)
+++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Builders/SoilProfileBuilder2DTest.cs (.../SoilProfileBuilder2DTest.cs) (revision 2b820514696fca02cd9e7a65c0ebf634e3321a11)
@@ -101,22 +101,10 @@
// Setup
var profileName = "SomeProfile";
var builder = new SoilProfileBuilder2D(profileName, 0.0);
- var firstPoint = new Point2D
- {
- X = -0.5, Y = 1.0
- };
- var secondPoint = new Point2D
- {
- X = 0.5, Y = 1.0
- };
- var thirdPoint = new Point2D
- {
- X = 0.5, Y = -1.0
- };
- var fourthPoint = new Point2D
- {
- X = -0.5, Y = -1.0
- };
+ var firstPoint = new Point2D(-0.5, 1.0);
+ var secondPoint = new Point2D(0.5, 1.0);
+ var thirdPoint = new Point2D(0.5, -1.0);
+ var fourthPoint = new Point2D(-0.5, -1.0);
builder.Add(new SoilLayer2D
{
OuterLoop = new List