Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryLoop.cs =================================================================== diff -u -r5618 -r5634 --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryLoop.cs (.../GeometryLoop.cs) (revision 5618) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryLoop.cs (.../GeometryLoop.cs) (revision 5634) @@ -264,15 +264,16 @@ } /// - /// Determines if all curves in the loop are equal (by reference) to the curves of the given geometry loop. + /// 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 HasSameCurvesByReference(GeometryLoop geometryLoop) + public bool HasSameCurves(GeometryLoop geometryLoop) { foreach (GeometryCurve geometryCurve in CurveList) { - if (!geometryLoop.CurveList.Contains(geometryCurve)) + if (!geometryLoop.HasSameCurveAtLocation(geometryCurve)) // .CurveList.Contains(geometryCurve)) { return false; } @@ -281,6 +282,19 @@ return CurveList.Count > 2 && CurveList.Count == geometryLoop.CurveList.Count; } + private bool HasSameCurveAtLocation(GeometryCurve geometryCurve) + { + foreach (GeometryCurve curve in CurveList) + { + if (curve.LocationEquals(geometryCurve)) + { + return true; + } + } + + return false; + } + /// /// Helper class NotEnoughUniquePointsException ///