Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryLoop.cs =================================================================== diff -u -r5527 -r5618 --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryLoop.cs (.../GeometryLoop.cs) (revision 5527) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/GeometryLoop.cs (.../GeometryLoop.cs) (revision 5618) @@ -236,7 +236,7 @@ private bool AddEitherHeadOrEndPointOfCurveToCalcPoints(int index) { - // Compare by reference (is faster then by value) + // Compare by reference (is faster than by value) if (CurveList[index].HeadPoint == calcPoints[calcPoints.Count - 1]) { calcPoints.Add(CurveList[index].EndPoint); @@ -264,6 +264,24 @@ } /// + /// Determines if all curves in the loop are equal (by reference) to the curves of the given geometry loop. + /// + /// + /// true when there are curves and they are equal, else false + public bool HasSameCurvesByReference(GeometryLoop geometryLoop) + { + foreach (GeometryCurve geometryCurve in CurveList) + { + if (!geometryLoop.CurveList.Contains(geometryCurve)) + { + return false; + } + } + + return CurveList.Count > 2 && CurveList.Count == geometryLoop.CurveList.Count; + } + + /// /// Helper class NotEnoughUniquePointsException /// public class NotEnoughUniquePointsException : InvalidOperationException