Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Helpers/FailureMechanismSectionPresentationHelper.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/Helpers/FailureMechanismSectionPresentationHelper.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Helpers/FailureMechanismSectionPresentationHelper.cs (revision 4b48a3e7866946bb18c5bfe15b04bd51183fd335) @@ -0,0 +1,65 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Ringtoets.Common.Data.FailureMechanism; + +namespace Ringtoets.Common.Forms.Helpers +{ + /// + /// Helper class for displaying . + /// + public static class FailureMechanismSectionPresentationHelper + { + /// + /// Creates presentation objects for the provided , + /// taking into account the start and the end of the sections in relation to the beginning of + /// the reference line. + /// + /// The type of the presentation objects. + /// The failure mechanism sections to create presentation + /// objects for. + /// + /// for creating the presentation objects of type , in which: + /// + /// - T1 represents the failure mechanism section at stake; + /// - T2 represents the start of the section in relation to the beginning of the reference line; + /// - T3 represents the end of the section in relation to the beginning of the reference line. + /// + /// + /// The created presentation objects. + public static IEnumerable CreatePresentableFailureMechanismSections(IEnumerable failureMechanismSections, + Func createPresentableFailureMechanismSection) + { + double start = 0; + + foreach (FailureMechanismSection failureMechanismSection in failureMechanismSections) + { + double end = start + failureMechanismSection.Length; + + yield return createPresentableFailureMechanismSection(failureMechanismSection, start, end); + + start = end; + } + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj =================================================================== diff -u -r99c27ad8eff584aeedf3530027726af5474da4fe -r4b48a3e7866946bb18c5bfe15b04bd51183fd335 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision 99c27ad8eff584aeedf3530027726af5474da4fe) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision 4b48a3e7866946bb18c5bfe15b04bd51183fd335) @@ -51,6 +51,7 @@ +