Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/RingtoetsMapDataFeaturesFactory.cs
===================================================================
diff -u -rb7bfa326e697eed7d8c203b678f20dfc55e1c7ff -r86b6ce2b77450d63016858e8e18796c02bdaad52
--- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/RingtoetsMapDataFeaturesFactory.cs (.../RingtoetsMapDataFeaturesFactory.cs) (revision b7bfa326e697eed7d8c203b678f20dfc55e1c7ff)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/RingtoetsMapDataFeaturesFactory.cs (.../RingtoetsMapDataFeaturesFactory.cs) (revision 86b6ce2b77450d63016858e8e18796c02bdaad52)
@@ -19,6 +19,7 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System;
using System.Collections.Generic;
using System.Linq;
using Core.Common.Base.Data;
@@ -73,15 +74,13 @@
}
///
- /// Create hydraulic boundary database location features based on the provided
- /// with default labels for design
- /// water level and wave height.
+ /// Create hydraulic boundary database location features based on the provided ..
///
/// The
/// to create the location features for.
/// An array of features or an empty array when
/// is null.
- public static MapFeature[] CreateHydraulicBoundaryDatabaseFeaturesWithDefaultLabels(HydraulicBoundaryDatabase hydraulicBoundaryDatabase)
+ public static MapFeature[] CreateHydraulicBoundaryDatabaseFeatures(HydraulicBoundaryDatabase hydraulicBoundaryDatabase)
{
return CreateHydraulicBoundaryLocationFeatures(hydraulicBoundaryDatabase != null
? hydraulicBoundaryDatabase.Locations.ToArray()
@@ -91,19 +90,48 @@
}
///
- /// Create hydraulic boundary location features based on the provided
- /// with optional labels for design
- /// water level and wave height.
+ /// Create hydraulic boundary database location features based on the provided
+ /// .
///
- /// The array of
- /// to create the location features for.
- /// An array of features or an empty array when
- /// is null or empty.
- public static MapFeature[] CreateHydraulicBoundaryLocationFeaturesWithOptionalLabels(HydraulicBoundaryLocation[] hydraulicBoundaryLocations)
+ /// The locations to create the features for.
+ /// The name of the design water level attribute.
+ /// The name of the wave height attribute.
+ /// An array of features or an empty array when
+ /// is empty.
+ /// Thrown when any is null.
+ public static MapFeature[] CreateHydraulicBoundaryLocationFeatures(HydraulicBoundaryLocation[] hydraulicBoundaryLocations,
+ string designWaterLevelAttributeName,
+ string waveHeightAttributeName)
{
- return CreateHydraulicBoundaryLocationFeatures(hydraulicBoundaryLocations ?? new HydraulicBoundaryLocation[0],
- Resources.MetaData_DesignWaterLevel_GrassOutwards,
- Resources.MetaData_WaveHeight_GrassOutwards);
+ if (hydraulicBoundaryLocations == null)
+ {
+ throw new ArgumentNullException("hydraulicBoundaryLocations");
+ }
+ if (designWaterLevelAttributeName == null)
+ {
+ throw new ArgumentNullException("designWaterLevelAttributeName");
+ }
+ if (waveHeightAttributeName == null)
+ {
+ throw new ArgumentNullException("waveHeightAttributeName");
+ }
+
+ var features = new MapFeature[hydraulicBoundaryLocations.Length];
+
+ for (int i = 0; i < hydraulicBoundaryLocations.Length; i++)
+ {
+ HydraulicBoundaryLocation location = hydraulicBoundaryLocations[i];
+ var feature = GetAsSingleMapFeature(location.Location);
+
+ feature.MetaData[Resources.MetaData_ID] = location.Id;
+ feature.MetaData[Resources.MetaData_Name] = location.Name;
+ feature.MetaData[designWaterLevelAttributeName] = location.DesignWaterLevel;
+ feature.MetaData[waveHeightAttributeName] = location.WaveHeight;
+
+ features[i] = feature;
+ }
+
+ return features;
}
///
@@ -284,28 +312,6 @@
return feature;
}
- private static MapFeature[] CreateHydraulicBoundaryLocationFeatures(HydraulicBoundaryLocation[] hydraulicBoundaryLocations,
- string designWaterLevelAttributeName,
- string waveheightAttributeName)
- {
- var features = new MapFeature[hydraulicBoundaryLocations.Length];
-
- for (int i = 0; i < hydraulicBoundaryLocations.Length; i++)
- {
- HydraulicBoundaryLocation location = hydraulicBoundaryLocations[i];
- var feature = GetAsSingleMapFeature(location.Location);
-
- feature.MetaData[Resources.MetaData_ID] = location.Id;
- feature.MetaData[Resources.MetaData_Name] = location.Name;
- feature.MetaData[designWaterLevelAttributeName] = location.DesignWaterLevel;
- feature.MetaData[waveheightAttributeName] = location.WaveHeight;
-
- features[i] = feature;
- }
-
- return features;
- }
-
private static Point2D[] GetWorldPoints(DikeProfile dikeProfile)
{
return AdvancedMath2D.FromXToXY(