// 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 Core.Components.Gis.Features;
using Ringtoets.Common.Util;
using RingtoetsCommonUtilResources = Ringtoets.Common.Util.Properties.Resources;
namespace Ringtoets.GrassCoverErosionOutwards.Util
{
///
/// Factory for creating collections of for
/// .
///
public static class GrassCoverErosionOutwardsHydraulicBoundaryLocationMapDataFeaturesFactory
{
///
/// Creates a hydraulic boundary location feature based on the given .
///
/// The location to create the feature for.
/// The provider of the labels.
/// A feature based on the given .
/// Thrown when all parameters are null.
public static MapFeature CreateHydraulicBoundaryLocationFeature(GrassCoverErosionOutwardsAggregatedHydraulicBoundaryLocation location,
IGrassCoverErosionOutwardsHydraulicBoundaryLocationMetaDataAttributeNameProvider nameProvider)
{
if (location == null)
{
throw new ArgumentNullException(nameof(location));
}
if (nameProvider == null)
{
throw new ArgumentNullException(nameof(nameProvider));
}
MapFeature feature = RingtoetsMapDataFeaturesFactoryHelper.CreateSinglePointMapFeature(location.Location);
feature.MetaData[RingtoetsCommonUtilResources.MetaData_ID] = location.Id;
feature.MetaData[RingtoetsCommonUtilResources.MetaData_Name] = location.Name;
feature.MetaData[nameProvider.WaterLevelCalculationForMechanismSpecificFactorizedSignalingNormAttributeName] = location.WaterLevelCalculationForMechanismSpecificFactorizedSignalingNorm;
feature.MetaData[nameProvider.WaterLevelCalculationForMechanismSpecificSignalingNormAttributeName] = location.WaterLevelCalculationForMechanismSpecificSignalingNorm;
feature.MetaData[nameProvider.WaterLevelCalculationForMechanismSpecificLowerLimitNormAttributeName] = location.WaterLevelCalculationForMechanismSpecificLowerLimitNorm;
feature.MetaData[nameProvider.WaterLevelCalculationForLowerLimitNormAttributeName] = location.WaterLevelCalculationForLowerLimitNorm;
feature.MetaData[nameProvider.WaterLevelCalculationForFactorizedLowerLimitNormAttributeName] = location.WaterLevelCalculationForFactorizedLowerLimitNorm;
feature.MetaData[nameProvider.WaveHeightCalculationForMechanismSpecificFactorizedSignalingNormAttributeName] = location.WaveHeightCalculationForMechanismSpecificFactorizedSignalingNorm;
feature.MetaData[nameProvider.WaveHeightCalculationForMechanismSpecificSignalingNormAttributeName] = location.WaveHeightCalculationForMechanismSpecificSignalingNorm;
feature.MetaData[nameProvider.WaveHeightCalculationForMechanismSpecificLowerLimitNormAttributeName] = location.WaveHeightCalculationForMechanismSpecificLowerLimitNorm;
feature.MetaData[nameProvider.WaveHeightCalculationForLowerLimitNormAttributeName] = location.WaveHeightCalculationForLowerLimitNorm;
feature.MetaData[nameProvider.WaveHeightCalculationForFactorizedLowerLimitNormAttributeName] = location.WaveHeightCalculationForFactorizedLowerLimitNorm;
return feature;
}
}
}