Files
OpenNest/OpenNest.Engine/Jobs/PlateNesterFactory.cs
T

27 lines
955 B
C#

using System;
using OpenNest.Engine.Jobs.Placement;
namespace OpenNest.Engine.Jobs;
/// <summary>
/// Instance-scoped strategy resolution for the whole-job runner. All four built-in strategies
/// resolve directly to filler-backed plate nesters. The process-global NestEngineRegistry
/// (including plugin registrations and ActiveEngineName) is neither read nor modified.
/// Unknown keys reject.
/// </summary>
public static class PlateNesterFactory
{
public static IPlateNester Create(string strategy)
{
ArgumentNullException.ThrowIfNull(strategy);
return strategy switch
{
"Default" => new DefaultPlateNester(),
"Strip" => new StripPlateNester(),
"Vertical Remnant" => RemnantPlateNester.Vertical(),
"Horizontal Remnant" => RemnantPlateNester.Horizontal(),
_ => throw new NotSupportedException($"Unknown placement strategy: {strategy}."),
};
}
}