Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryBounds.cs =================================================================== diff -u -r4000 -r4052 --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryBounds.cs (.../GeometryBounds.cs) (revision 4000) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryBounds.cs (.../GeometryBounds.cs) (revision 4052) @@ -21,100 +21,99 @@ using System; -namespace Deltares.DamEngine.Data.Geometry +namespace Deltares.DamEngine.Data.Geometry; + +/// +/// Class holding the boundaries of a geometry object +/// +public class GeometryBounds { /// - /// Class holding the boundaries of a geometry object + /// Initializes a new instance of the class. /// - public class GeometryBounds + public GeometryBounds() : this(0, 0, 0, 0) {} + + /// + /// Initializes a new instance of the class. + /// + /// The left. + /// The right. + /// The bottom. + /// The top. + public GeometryBounds(double left, double right, double bottom, double top) { - /// - /// Initializes a new instance of the class. - /// - public GeometryBounds() : this(0, 0, 0, 0) {} + Left = left; + Right = right; + Bottom = bottom; + Top = top; + } - /// - /// Initializes a new instance of the class. - /// - /// The left. - /// The right. - /// The bottom. - /// The top. - public GeometryBounds(double left, double right, double bottom, double top) - { - Left = left; - Right = right; - Bottom = bottom; - Top = top; - } + /// + /// Gets or sets the left. + /// + /// + /// The left. + /// + public double Left { get; set; } - /// - /// Gets or sets the left. - /// - /// - /// The left. - /// - public double Left { get; set; } + /// + /// Gets or sets the top. + /// + /// + /// The top. + /// + public double Top { get; set; } - /// - /// Gets or sets the top. - /// - /// - /// The top. - /// - public double Top { get; set; } + /// + /// Gets or sets the right. + /// + /// + /// The right. + /// + public double Right { get; set; } - /// - /// Gets or sets the right. - /// - /// - /// The right. - /// - public double Right { get; set; } + /// + /// Gets or sets the bottom. + /// + /// + /// The bottom. + /// + public double Bottom { get; set; } - /// - /// Gets or sets the bottom. - /// - /// - /// The bottom. - /// - public double Bottom { get; set; } + /// + /// Determines whether the boundary contains the specified point. + /// + /// The x. + /// The y. + /// + public bool ContainsPoint(double x, double y) + { + return x >= Left && x <= Right && y >= Bottom && y <= Top; + } - /// - /// Determines whether the boundary contains the specified point. - /// - /// The x. - /// The y. - /// - public bool ContainsPoint(double x, double y) + /// + /// Implements the operator +. + /// + /// The bounds1. + /// The bounds2. + /// + /// The result of the operator. + /// + public static GeometryBounds operator +(GeometryBounds bounds1, GeometryBounds bounds2) + { + if (bounds2 == null) { - return x >= Left && x <= Right && y >= Bottom && y <= Top; + return bounds1; } - /// - /// Implements the operator +. - /// - /// The bounds1. - /// The bounds2. - /// - /// The result of the operator. - /// - public static GeometryBounds operator +(GeometryBounds bounds1, GeometryBounds bounds2) + if (bounds1 == null) { - if (bounds2 == null) - { - return bounds1; - } - - if (bounds1 == null) - { - return bounds2; - } - - return new GeometryBounds(Math.Min(bounds1.Left, bounds2.Left), - Math.Max(bounds1.Right, bounds2.Right), - Math.Min(bounds1.Bottom, bounds2.Bottom), - Math.Max(bounds1.Top, bounds2.Top)); + return bounds2; } + + return new GeometryBounds(Math.Min(bounds1.Left, bounds2.Left), + Math.Max(bounds1.Right, bounds2.Right), + Math.Min(bounds1.Bottom, bounds2.Bottom), + Math.Max(bounds1.Top, bounds2.Top)); } } \ No newline at end of file