ZoomWindowTool and MeasureAreaTool port the WinForms Zoom Window and Select
Area actions onto the shared plate tool framework; PartHoverTip is the plate
view's delayed drawing-name tooltip; PlateZoom gives the Zoom To areas.
ViewTransform now scales with the viewport on resize as DrawControl does and
zooms about its center by the menu's 1.5 step.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PlateArrange ports the WinForms Arrange commands, each one undo step
under its WinForms label: Align Left/Right/Top/Bottom, Horizontally and
Vertically (lined up with the first selected part), Evenly Space
Horizontally/Vertically, Center Parts, Join Common Line (facing edges up
to four part spacings, at least an inch, apart), Remove Common Line and
Cut Common Lines Twice/Once. It also decides which common-line commands
the part right-click menu enables.
Expand Spacing and Fix Spacing take a runner for the search, so a front
end can run it off the UI thread behind a Cancel window; the step opens
before the search (it moves the live parts when it finishes), and a
canceled run moves nothing and records nothing. They return the parts
to redraw and the status line WinForms shows.
The WinForms plate view, selection manager and part menu now delegate
to it with unchanged behavior; Center Parts keeps its own loop, which
moves the view's layout parts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Route the four identical even-odd ray casts through RingContainment.Contains and share the arc-intersection, span-pairing, overlap-region, lead-in, plate-offset, leader-edge, entity-copy and path-perimeter duplicates. Expressions and loop order are unchanged, so results are bit-identical.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Roslyn Bridge's duplicate scan found helpers copied verbatim between
projects, so a fix to one copy could silently miss the other. Each copy
now calls a single implementation with the same body:
- boundary nearest point: ClipperBridge.NearestBoundaryPoint (ErodedPierce,
ScrapPierceSearch)
- nesting profile of a part: NestLayoutCheck.Profile (CommonLinePair)
- part label points: PartLabels in OpenNest.Desktop (WinForms LayoutPart)
- copied common-line groups: CommonLineGroup.AmongParts (ActionClone,
PlaceTool)
- shared saved cutting parameters: CuttingParametersSerializer.SharedBy
(MCP, Console)
- bounding box of boxes: generic BoundingBox.GetBoundingBox<T> (rectangle
packing items)
- box proximity: Clearance.BoxesWithin (Expander)
Behavior is unchanged: every moved body is identical to the copies it
replaces, so the fill change in Expander and rectangle packing skips the
problem-nest corpus. Core, IO, Desktop and Engine suites and the label,
clone and common-line WinForms tests pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DrawingPlacement.AddPart is the WinForms drop of a dragged drawing on the
plate: one part with its bounding box centred on the drop point, as one
Add Part step, refused without a plate or while edits are locked. As in
WinForms it leaves the cut-offs as they are. CreatePlaceTool starts the
place tool with one new part of a drawing.
DrawingPickup is the drawing list's pick-up: a single press arms it, the
plate view taking the keyboard takes the drawing then selected (staying
armed when none is), and a drop, double-click or Undo puts it down.
Port the WinForms Clone Parts action as the toolkit-neutral PlaceTool:
copies of the sources follow the pointer by their lower-left corner (a
move to the same screen point is ignored, keeping arrow-key nudges), and
each left click places another copy as one Add Part/Add Parts step.
Shift settles toward the quadrant corner on geometry, Ctrl alone on
bounding boxes, reading the placement order at each click. Copied
common-line groups are joined again among the copies and cut-offs are
rebuilt. Delete removes the sources plus selected plate parts in one
Delete step, recorded (and cut-offs rebuilt) only when any were on the
plate. Settling runs before the step opens, so a failure there leaves
nothing to roll back; the copy does not follow the pointer while edits
are locked, as WinForms raises no mouse move then.
PlateClipboard.Copy/Cut start the tool with the selected parts; Cut then
removes the sources as one Cut step without rebuilding cut-offs, as
WinForms does.
While placing, PlateEdits nudges, steps, pushes and rotates the previews
instead of the selection. Unlike WinForms, which records an empty undo
step there, these edits open no undo step, and they never rebuild
cut-offs since the previews are not on the plate.
PlateEdits ports the WinForms plate view's edits of the selection, with
its undo labels and coalescing: Delete (parts and cut-offs, cut-offs
regenerated once when the plate has any), Nudge by the offset increment
or one repeat step, Push to contact, Rotate about the selection's
centre keeping its lower-left corner (a quarter turn, or by wheel
notches at 10 degrees or a tenth of that), repeated nudges and wheel
turns undoing as one step.
The Select tool drags the selection as one Move step. Cut-offs
regenerate when a drag actually moved parts (WinForms also does it on a
plain click, adding an extra undo step); the regeneration runs before
the step completes, so a failure rolls the drag back, and a view that
loses the pointer mid-drag ends the move as a release would, keeping
the selection.
A plate tool host now has to supply its undo wiring, the nest's cut-off
settings and an edits lock (WinForms EditsLocked): while locked no edit
runs and no press selects or starts a move.
PlateToolManager keeps one active tool with the WinForms action rules
(Escape cancels, then returns to Select, then resumes the ended tool) and
status text. SelectTool selects by click, Ctrl+click and window
(contains/intersect), takes common-line groups together and picks
cut-offs by their strokes. PlateHitTester hit-tests the shared display
geometry; PlateSelection reads and sets by part index.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>