Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/Point2D.cs
===================================================================
diff -u -r4000 -r4052
--- DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/Point2D.cs (.../Point2D.cs) (revision 4000)
+++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/Point2D.cs (.../Point2D.cs) (revision 4052)
@@ -23,89 +23,88 @@
using System.ComponentModel;
using Deltares.DamEngine.Data.Standard;
-namespace Deltares.DamEngine.Data.Geometry
+namespace Deltares.DamEngine.Data.Geometry;
+
+///
+/// Class for pure X,Z coors, to be used in calculation
+///
+[TypeConverter(typeof(ExpandableObjectConverter))]
+public class Point2D : IComparable
{
///
- /// Class for pure X,Z coors, to be used in calculation
+ /// Initializes a new instance of the class.
///
- [TypeConverter(typeof(ExpandableObjectConverter))]
- public class Point2D : IComparable
+ public Point2D() {}
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The x.
+ /// The z.
+ public Point2D(double x, double z)
{
- ///
- /// Initializes a new instance of the class.
- ///
- public Point2D() {}
+ X = x;
+ Z = z;
+ }
- ///
- /// Initializes a new instance of the class.
- ///
- /// The x.
- /// The z.
- public Point2D(double x, double z)
- {
- X = x;
- Z = z;
- }
+ ///
+ /// The x
+ ///
+ public double X { get; set; }
- ///
- /// The x
- ///
- public double X { get; set; }
+ ///
+ /// The z
+ ///
+ public double Z { get; set; }
- ///
- /// The z
- ///
- public double Z { get; set; }
+ ///
+ /// Determines whether the location of the given point and this one are the same.
+ ///
+ /// The other.
+ ///
+ public bool LocationEquals(Point2D other)
+ {
+ return LocationEquals(other, GeometryConstants.Accuracy);
+ }
- ///
- /// Determines whether the location of the given point and this one are the same.
- ///
- /// The other.
- ///
- public bool LocationEquals(Point2D other)
+ ///
+ /// Determines whether the difference between the location of the given point and
+ /// this one are within the given precision.
+ ///
+ /// The other.
+ /// The precision.
+ ///
+ public bool LocationEquals(Point2D other, double precision)
+ {
+ if (ReferenceEquals(other, null))
{
- return LocationEquals(other, GeometryConstants.Accuracy);
+ return false;
}
- ///
- /// Determines whether the difference between the location of the given point and
- /// this one are within the given precision.
- ///
- /// The other.
- /// The precision.
- ///
- public bool LocationEquals(Point2D other, double precision)
+ if (ReferenceEquals(other, this))
{
- if (ReferenceEquals(other, null))
- {
- return false;
- }
-
- if (ReferenceEquals(other, this))
- {
- return true;
- }
-
- return X.AlmostEquals(other.X, precision) &&
- Z.AlmostEquals(other.Z, precision);
+ return true;
}
- ///
- /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
- ///
- /// An object to compare with this instance.
- ///
- /// A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes in the sort order. Zero This instance occurs in the same position in the sort order as . Greater than zero This instance follows in the sort order.
- ///
- public int CompareTo(object obj)
- {
- var point = obj as Point2D;
- if (point != null)
- {
- return X.CompareTo(point.X);
- }
+ return X.AlmostEquals(other.X, precision) &&
+ Z.AlmostEquals(other.Z, precision);
+ }
- return String.Compare(ToString(), obj.ToString(), StringComparison.Ordinal);
+ ///
+ /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
+ ///
+ /// An object to compare with this instance.
+ ///
+ /// A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes in the sort order. Zero This instance occurs in the same position in the sort order as . Greater than zero This instance follows in the sort order.
+ ///
+ public int CompareTo(object obj)
+ {
+ var point = obj as Point2D;
+ if (point != null)
+ {
+ return X.CompareTo(point.X);
}
+
+ return String.Compare(ToString(), obj.ToString(), StringComparison.Ordinal);
}
}
\ No newline at end of file