Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SurfaceLine2Validator.cs =================================================================== diff -u -r5019 -r5444 --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SurfaceLine2Validator.cs (.../SurfaceLine2Validator.cs) (revision 5019) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geotechnics/SurfaceLine2Validator.cs (.../SurfaceLine2Validator.cs) (revision 5444) @@ -77,7 +77,7 @@ } /// - /// Ares all characteristic points x coordinates ascending. + /// Are all characteristic points x coordinates ascending. /// /// The line. /// @@ -86,8 +86,19 @@ CharacteristicPoint[] points = line.GetCharacteristicPointsRequiringAscendingX().ToArray(); return AreGeometryPointsXCoordinatesAscending(points); } - + /// + /// Are all points x coordinates ascending. + /// + /// + /// + public static bool AreAllPointsXCoordinatesAscending(SurfaceLine2 line) + { + line.Geometry.SyncPoints(); + return AreGeometryPointsXCoordinatesAscending(line.Geometry.Points); + } + + /// /// Determines whether all characteristic points are in correct shape. /// /// true if all characteristic are in correct shape, otherwise false @@ -134,12 +145,12 @@ { if (points[i].X < points[i - 1].X + GeometryConstants.Accuracy) { - // #Bka: if fact we now should return FALSE immediately but there is a snag. Due to faults with adding characteristic + // #Bka: in fact we now should return FALSE immediately but there is a snag. Due to faults with adding characteristic // points to a surface line, some surface lines can have identical points (in Location) but with different // characteristic (e.g. diketop and trafficload combined). These points should use the same reference to the point // but it occurs that TWO fysical (and identical) points are added. // So these points must now be ignored (so identical points must be seen as OK). This is in fact ok for the purpose - // of the validation ast the main problem is that points may never give a vertical part in the geometry. + // of the validation as the main problem is that points may never give a vertical part in the geometry. if ((Math.Abs(points[i].X - points[i - 1].X) < GeometryConstants.Accuracy) && (Math.Abs(points[i].Z - points[i - 1].Z) < GeometryConstants.Accuracy)) { // Make sure points are made identical