Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryPoint.cs
===================================================================
diff -u -r4000 -r4052
--- DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryPoint.cs (.../GeometryPoint.cs) (revision 4000)
+++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryPoint.cs (.../GeometryPoint.cs) (revision 4052)
@@ -23,165 +23,164 @@
using System.ComponentModel;
using Deltares.DamEngine.Data.Standard;
-namespace Deltares.DamEngine.Data.Geometry
+namespace Deltares.DamEngine.Data.Geometry;
+
+///
+/// Class to manage a geometry point.
+///
+[Serializable]
+[TypeConverter(typeof(ExpandableObjectConverter))]
+public class GeometryPoint : GeometryObject, ICloneable, IComparable
{
///
- /// Class to manage a geometry point.
+ /// The precision
///
- [Serializable]
- [TypeConverter(typeof(ExpandableObjectConverter))]
- public class GeometryPoint : GeometryObject, ICloneable, IComparable
- {
- ///
- /// The precision
- ///
- public const double Precision = GeometryConstants.Accuracy;
+ public const double Precision = GeometryConstants.Accuracy;
- private object owner;
+ private object owner;
- ///
- /// Initializes a new instance of the class.
- ///
- public GeometryPoint() : this(0.0, 0.0) {}
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public GeometryPoint() : this(0.0, 0.0) {}
- ///
- /// Initializes a new instance of the class.
- ///
- /// A point.
- public GeometryPoint(GeometryPoint aPoint) : this(aPoint.X, aPoint.Z) {}
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// A point.
+ public GeometryPoint(GeometryPoint aPoint) : this(aPoint.X, aPoint.Z) {}
- ///
- /// Initializes a new instance of the class.
- ///
- /// A x.
- /// A z.
- public GeometryPoint(double aX, double aZ)
- {
- X = aX;
- Z = aZ;
- }
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// A x.
+ /// A z.
+ public GeometryPoint(double aX, double aZ)
+ {
+ X = aX;
+ Z = aZ;
+ }
- ///
- /// Gets or sets the X coordinate of GeometryPoint
- ///
- public virtual double X { get; set; }
+ ///
+ /// Gets or sets the X coordinate of GeometryPoint
+ ///
+ public virtual double X { get; set; }
- ///
- /// Gets or sets the Y coordinate of GeometryPoint
- ///
- public virtual double Y { get; set; }
+ ///
+ /// Gets or sets the Y coordinate of GeometryPoint
+ ///
+ public virtual double Y { get; set; }
- ///
- /// Gets or sets the Z coordinate of GeometryPoint
- ///
- public virtual double Z { get; set; }
+ ///
+ /// Gets or sets the Z coordinate of GeometryPoint
+ ///
+ public virtual double Z { get; set; }
- ///
- /// Identifies the object which owns this point.
- ///
- ///
- /// Usually set by a delegated list, such as in .
- ///
- public object Owner
+ ///
+ /// Identifies the object which owns this point.
+ ///
+ ///
+ /// Usually set by a delegated list, such as in .
+ ///
+ public object Owner
+ {
+ get
{
- get
- {
- return owner;
- }
- set
- {
- owner = value;
- }
+ return owner;
}
-
- ///
- /// Determines whether the location of the given point and this one are the same.
- ///
- /// The other.
- ///
- public bool LocationEquals(GeometryPoint other)
+ set
{
- return LocationEquals(other, Precision);
+ owner = value;
}
+ }
- ///
- /// 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(GeometryPoint other, double precision)
- {
- if (ReferenceEquals(other, null))
- {
- return false;
- }
+ ///
+ /// Determines whether the location of the given point and this one are the same.
+ ///
+ /// The other.
+ ///
+ public bool LocationEquals(GeometryPoint other)
+ {
+ return LocationEquals(other, Precision);
+ }
- if (ReferenceEquals(other, this))
- {
- return true;
- }
-
- return X.AlmostEquals(other.X, precision) &&
- Z.AlmostEquals(other.Z, precision);
- }
-
- ///
- /// Gets the geometry bounds.
- ///
- ///
- public override GeometryBounds GetGeometryBounds()
+ ///
+ /// 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(GeometryPoint other, double precision)
+ {
+ if (ReferenceEquals(other, null))
{
- return new GeometryBounds(X, X, Z, Z);
+ return false;
}
- ///
- /// Returns a that represents this instance.
- ///
- ///
- /// A that represents this instance.
- ///
- public override string ToString()
+ if (ReferenceEquals(other, this))
{
- return "(" + X.ToString("F3") + ";" + Z.ToString("F3") + ")";
+ return true;
}
- #region ICloneable Members
+ return X.AlmostEquals(other.X, precision) &&
+ Z.AlmostEquals(other.Z, precision);
+ }
- ///
- /// Clones this instance.
- ///
- /// Only copies and .
- public virtual object Clone()
- {
- return new GeometryPoint(this);
- }
+ ///
+ /// Gets the geometry bounds.
+ ///
+ ///
+ public override GeometryBounds GetGeometryBounds()
+ {
+ return new GeometryBounds(X, X, Z, Z);
+ }
- #endregion
+ ///
+ /// Returns a that represents this instance.
+ ///
+ ///
+ /// A that represents this instance.
+ ///
+ public override string ToString()
+ {
+ return "(" + X.ToString("F3") + ";" + Z.ToString("F3") + ")";
+ }
- #region IComparable Members
+ #region ICloneable Members
- ///
- /// Compares the current instance with another object of the same type
- /// Eventhough this method does not seem to be used it is! (via GPstring which is a delegated list, using a Sort which needs this).
- /// So do NOT delete this as long as GPS stays a delegated list.
- ///
- /// An object to compare with this instance.
- ///
- /// Result of comparing the X values
- ///
- public int CompareTo(object obj)
- {
- var point = obj as GeometryPoint;
- if (point != null)
- {
- return X.CompareTo(point.X);
- }
+ ///
+ /// Clones this instance.
+ ///
+ /// Only copies and .
+ public virtual object Clone()
+ {
+ return new GeometryPoint(this);
+ }
- return ToString().CompareTo(obj.ToString());
+ #endregion
+
+ #region IComparable Members
+
+ ///
+ /// Compares the current instance with another object of the same type
+ /// Eventhough this method does not seem to be used it is! (via GPstring which is a delegated list, using a Sort which needs this).
+ /// So do NOT delete this as long as GPS stays a delegated list.
+ ///
+ /// An object to compare with this instance.
+ ///
+ /// Result of comparing the X values
+ ///
+ public int CompareTo(object obj)
+ {
+ var point = obj as GeometryPoint;
+ if (point != null)
+ {
+ return X.CompareTo(point.X);
}
- #endregion
+ return ToString().CompareTo(obj.ToString());
}
+
+ #endregion
}
\ No newline at end of file