Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Common/HydraRingDikeSection.cs =================================================================== diff -u --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Common/HydraRingDikeSection.cs (revision 0) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Common/HydraRingDikeSection.cs (revision a86ee48c248b3095d7db43023c64780534dd2e59) @@ -0,0 +1,161 @@ +// Copyright (C) Stichting Deltares 2016. 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. + +namespace Ringtoets.HydraRing.Calculation.Common +{ + /// + /// Container for Hydra-Ring dike (cross) section data. + /// + public class HydraRingDikeSection + { + private readonly int sectionId; + private readonly string sectionName; + private readonly double sectionBeginCoordinate; + private readonly double sectionEndCoordinate; + private readonly double sectionLength; + private readonly double crossSectionXCoordinate; + private readonly double crossSectionYCoordinate; + private readonly double crossSectionNormal; + + /// + /// Creates a new instance of the class. + /// + /// The id of the dike section. + /// The name of the dike section. + /// The begin coordinate of the dike section. + /// The end coordinate of the dike section. + /// The length of the dike section. + /// The x coordinate of the dike cross section. + /// the y coordinate of the dike cross section. + /// The normal of the dike cross section. + public HydraRingDikeSection(int sectionId, string sectionName, double sectionBeginCoordinate, double sectionEndCoordinate, double sectionLength, double crossSectionXCoordinate, double crossSectionYCoordinate, double crossSectionNormal) + { + this.sectionId = sectionId; + this.sectionName = sectionName; + this.sectionBeginCoordinate = sectionBeginCoordinate; + this.sectionEndCoordinate = sectionEndCoordinate; + this.sectionLength = sectionLength; + this.crossSectionXCoordinate = crossSectionXCoordinate; + this.crossSectionYCoordinate = crossSectionYCoordinate; + this.crossSectionNormal = crossSectionNormal; + } + + /// + /// Gets the id of the dike section. + /// + public int SectionId + { + get + { + return sectionId; + } + } + + /// + /// Gets the name of the dike section. + /// + /// + /// This name is used in the input file and the output file of Hydra-Ring calculations. + /// + public string SectionName + { + get + { + return sectionName; + } + } + + /// + /// Gets the begin coordinate of the dike section. + /// + /// + /// If only a dike cross section is considered, this property should be set equal to . + /// + public double SectionBeginCoordinate + { + get + { + return sectionBeginCoordinate; + } + } + + /// + /// Gets the end coordinate of the dike section. + /// + /// + /// If only a dike cross section is considered, this property should be set equal to . + /// + public double SectionEndCoordinate + { + get + { + return sectionEndCoordinate; + } + } + + /// + /// Gets the length of the dike section. + /// + public double SectionLength + { + get + { + return sectionLength; + } + } + + /// + /// Gets the x coordinate of the dike cross section. + /// + public double CrossSectionXCoordinate + { + get + { + return crossSectionXCoordinate; + } + } + + /// + /// Gets the y coordinate of the dike cross section. + /// + public double CrossSectionYCoordinate + { + get + { + return crossSectionYCoordinate; + } + } + + /// + /// Gets the normal of the dike cross section. + /// + /// + /// The normal corresponds to the angle of the straight line perpendicular to the dike stretch at the location of the dike cross section (with respect to the north). + /// + public double CrossSectionNormal + { + get + { + return crossSectionNormal; + } + } + } +} Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj =================================================================== diff -u -r6241d8b1d8a7329857bc6dc8ef1648893f8365dd -ra86ee48c248b3095d7db43023c64780534dd2e59 --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision 6241d8b1d8a7329857bc6dc8ef1648893f8365dd) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision a86ee48c248b3095d7db43023c64780534dd2e59) @@ -39,6 +39,7 @@ Properties\GlobalAssembly.cs + Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Common/HydraRingDikeSectionTest.cs =================================================================== diff -u --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Common/HydraRingDikeSectionTest.cs (revision 0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Common/HydraRingDikeSectionTest.cs (revision a86ee48c248b3095d7db43023c64780534dd2e59) @@ -0,0 +1,47 @@ +// Copyright (C) Stichting Deltares 2016. 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 NUnit.Framework; +using Ringtoets.HydraRing.Calculation.Common; + +namespace Ringtoets.HydraRing.Calculation.Test.Common +{ + [TestFixture] + public class HydraRingDikeSectionTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Call + var hydraRingDikeSection = new HydraRingDikeSection(1, "Name", 2.2, 3.3, 4.4, 5.5, 6.6, 7.7); + + // Assert + Assert.AreEqual(1, hydraRingDikeSection.SectionId); + Assert.AreEqual("Name", hydraRingDikeSection.SectionName); + Assert.AreEqual(2.2, hydraRingDikeSection.SectionBeginCoordinate); + Assert.AreEqual(3.3, hydraRingDikeSection.SectionEndCoordinate); + Assert.AreEqual(4.4, hydraRingDikeSection.SectionLength); + Assert.AreEqual(5.5, hydraRingDikeSection.CrossSectionXCoordinate); + Assert.AreEqual(6.6, hydraRingDikeSection.CrossSectionYCoordinate); + Assert.AreEqual(7.7, hydraRingDikeSection.CrossSectionNormal); + } + } +} Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj =================================================================== diff -u -r8693789d18f77ae54b04670ed135a10ea4ad1a8d -ra86ee48c248b3095d7db43023c64780534dd2e59 --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision 8693789d18f77ae54b04670ed135a10ea4ad1a8d) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision a86ee48c248b3095d7db43023c64780534dd2e59) @@ -50,6 +50,7 @@ +