Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryLoop.cs =================================================================== diff -u -r6253 -r6404 --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryLoop.cs (.../GeometryLoop.cs) (revision 6253) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryLoop.cs (.../GeometryLoop.cs) (revision 6404) @@ -1,4 +1,4 @@ -// Copyright (C) Stichting Deltares 2024. All rights reserved. +// Copyright (C) Stichting Deltares 2025. All rights reserved. // // This file is part of the Dam Engine. // @@ -21,7 +21,6 @@ using System; using System.Collections.Generic; -using Deltares.DamEngine.Data.Standard; namespace Deltares.DamEngine.Data.Geometry; @@ -101,7 +100,7 @@ { sum += points[i - 1].X * points[i].Z - points[i - 1].Z * points[i].X; } - + return Math.Abs(sum) > 1e-6; } @@ -158,6 +157,25 @@ } /// + /// Determines if all curves in the loop are equal to the curves of the given geometry loop. + /// The order of the curves does not matter, nor their direction. + /// + /// + /// true when there are curves and they are equal, else false + public bool HasSameCurves(GeometryLoop geometryLoop) + { + foreach (GeometryCurve geometryCurve in CurveList) + { + if (!geometryLoop.HasSameCurveAtLocation(geometryCurve)) // .CurveList.Contains(geometryCurve)) + { + return false; + } + } + + return CurveList.Count > 2 && CurveList.Count == geometryLoop.CurveList.Count; + } + + /// /// Creates a clone of the geometry loop /// /// The cloned GeometryLoop @@ -238,25 +256,6 @@ } } - /// - /// Determines if all curves in the loop are equal to the curves of the given geometry loop. - /// The order of the curves does not matter, nor their direction. - /// - /// - /// true when there are curves and they are equal, else false - public bool HasSameCurves(GeometryLoop geometryLoop) - { - foreach (GeometryCurve geometryCurve in CurveList) - { - if (!geometryLoop.HasSameCurveAtLocation(geometryCurve)) // .CurveList.Contains(geometryCurve)) - { - return false; - } - } - - return CurveList.Count > 2 && CurveList.Count == geometryLoop.CurveList.Count; - } - private bool HasSameCurveAtLocation(GeometryCurve geometryCurve) { foreach (GeometryCurve curve in CurveList) @@ -269,7 +268,7 @@ return false; } - + /// /// Helper class NotEnoughUniquePointsException ///