refactor: merge DxfImporter and DxfExporter into single static Dxf class

Consolidated two stateless classes into one unified API: Dxf.Import(),
Dxf.GetGeometry(), Dxf.ExportPlate(), Dxf.ExportProgram(). Export
state moved into a private ExportContext. Removed bool+out pattern
from GetGeometry in favor of returning empty list on failure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 08:17:49 -04:00
parent e92208b8c0
commit 250fdefaea
20 changed files with 405 additions and 505 deletions
+3 -5
View File
@@ -362,9 +362,8 @@ namespace OpenNest.Forms
{
if (dlg.FilterIndex == 1)
{
var exporter = new DxfExporter();
var success = exporter.ExportPlate(PlateView.Plate, dlg.FileName);
return success;
Dxf.ExportPlate(PlateView.Plate, dlg.FileName);
return true;
}
else if (dlg.FilterIndex == 2)
{
@@ -540,8 +539,7 @@ namespace OpenNest.Forms
var plate = PlateView.Plate;
var name = string.Format("{0}-P{1}.dxf", Nest.Name, PlateManager.CurrentIndex + 1);
var path = Path.Combine(Path.GetTempPath(), name);
var exporter = new DxfExporter();
exporter.ExportPlate(plate, path);
Dxf.ExportPlate(plate, path);
Process.Start(path);
}