Files
OpenNest/OpenNest/PostProcessorMaterials.cs
T
aj c6f544c5d7 feat(ui): populate material combobox from post processors
Replaces the material textbox on EditNestInfoForm with a combobox whose
items are aggregated from every loaded post processor that implements the
new IMaterialProvidingPostProcessor interface. CincinnatiPostProcessor
exposes its configured MaterialLibraries entries. Free-text entry still
works so custom materials remain usable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 06:12:54 -04:00

31 lines
803 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
namespace OpenNest
{
public static class PostProcessorMaterials
{
private static readonly List<string> materials = new();
public static IReadOnlyList<string> Names => materials;
public static void AddFrom(IMaterialProvidingPostProcessor provider)
{
if (provider == null)
return;
foreach (var name in provider.GetMaterialNames())
{
if (!string.IsNullOrWhiteSpace(name)
&& !materials.Contains(name, StringComparer.OrdinalIgnoreCase))
{
materials.Add(name);
}
}
materials.Sort(StringComparer.OrdinalIgnoreCase);
}
}
}