refactor: extract SpatialQuery from Helper

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 17:46:14 -04:00
parent 2881815c7a
commit 13b01240b1
7 changed files with 635 additions and 633 deletions

View File

@@ -186,8 +186,8 @@ namespace OpenNest.Actions
boxes.Add(part.BoundingBox.Offset(plate.PartSpacing));
var pt = plateView.CurrentPoint;
var vertical = Helper.GetLargestBoxVertically(pt, bounds, boxes);
var horizontal = Helper.GetLargestBoxHorizontally(pt, bounds, boxes);
var vertical = SpatialQuery.GetLargestBoxVertically(pt, bounds, boxes);
var horizontal = SpatialQuery.GetLargestBoxHorizontally(pt, bounds, boxes);
var bestArea = vertical;
if (horizontal.Area() > vertical.Area())

View File

@@ -150,8 +150,8 @@ namespace OpenNest.Actions
private void UpdateSelectedArea()
{
SelectedArea = altSelect
? Helper.GetLargestBoxHorizontally(plateView.CurrentPoint, Bounds, boxes)
: Helper.GetLargestBoxVertically(plateView.CurrentPoint, Bounds, boxes);
? SpatialQuery.GetLargestBoxHorizontally(plateView.CurrentPoint, Bounds, boxes)
: SpatialQuery.GetLargestBoxVertically(plateView.CurrentPoint, Bounds, boxes);
plateView.Invalidate();
}