164 Commits

Author SHA1 Message Date
John Beard
b2be0d39bd Snapping: Add construction geometry snapping
This is a pretty major rework of the snapping system.
The GRID_HELPERs now have a separate CONSTRUCTION_MANAGER
which handles some of the state involving "construction
geometry".

This is fed with 'extended' geometry (e.g. "infinite" lines from
segments) for use in generating things like intersection points.
It also handles adding this geoemtry to a GAL view item
(CONSTRUCTION_GEOM) for display to the user.

The process is:

* A TOOL creates a GRID_HELPER
* Optionally, it pre-loads a "persistent" batch of construction
  geometry (e.g. for an item's original position)
* The grid helper finds useful snap 'anchors' as before, including
  those involving the construction items.
* Other items on the board can be 'activated' by snapping to one
  of their main points. Then, if it has construction geometry,
  it will be added to the display. At most 2 items of this kind of
  geometry are shown, plus the original item, to reduce avoid
  too much clutter.

The dashed snap lines state machine is also handled in the
CONSTRUCTION_MANAGER and displayed in the CONSTRUCTION_GEOM item.
2024-09-11 22:35:35 +01:00
John Beard
72e48aed52 Trigo: Add a GetRotated function to get a rotated VECTOR2I
This makes it easier to use value semantics and consts when
constructing geometry.
2024-09-11 22:08:36 +01:00
John Beard
5925f9c374 Break out some geom functions from dimension text adjustment
Put these in a separate header - they don't need to be available
whenever VECTOR2 is, but they are generic, reusable functions that
can have the corner cases defined and tested.
2024-09-11 22:08:36 +01:00
John Beard
45bc23a8a5 Pcbnew: keep dimension text aligned when dragging points
This is quite fiddly to do in a way that doesn't have wierd
effects, and is shared between ALIGNED and ORTHOGONAL dimensions,
so break it out to a little helper class that handles the
stored state and fiddling with the geometry.
2024-09-06 20:33:08 +01:00
Jeff Young
e6a5669d02 Use ORIGIN_TRANSFORMS in Mover Corner To... dialog.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/18479
2024-08-18 13:01:38 -06:00
Jeff Young
0682987eb9 Cleanup atrophied code. 2024-07-08 14:27:25 +01:00
Seth Hillbrand
bcf6b620a8 Large rework of BEZIER_POLY
Add direct handling of quadratic beziers to save compute time and number
of points.  Update cubic interpolation to reduce number of points
generated for a given smoothness

Cache data on open and used cached data to avoid multiple re-calcs

Remove minimum line length and number of segments and replace with
standard max error level.  Allows us to specify the tolerance of bezier
interpolation
2024-06-18 17:55:41 -07:00
Seth Hillbrand
e8c96a8a20 Fixups for a9ae86ee
Correcting a couple mistakes and clarifying rounding
2024-05-31 17:31:50 -07:00
Seth Hillbrand
a9ae86eefd Cleanup geometry functions
Added Distance(VECTOR2) function that returns a double.  Removed
superfluous EuclideanNorm, GetLineLength, integer constructor for
EDA_ANGLE (this promotes to double in the CTOR), DistanceLinePoint and
HitTestPoints

Also extended the size for arc calculations that get distances to center
points to avoid overflow
2024-05-31 12:26:37 -07:00
Jeff Young
d761b4f22f RIP LIB_TEXTBOX and LIB_SHAPE. 2024-04-16 16:31:16 +01:00
Jeff Young
e445249720 ADDED: PCB tables. 2024-02-24 20:05:51 +00:00
Alex
3eb3fc9d1e Fix PCB arc edit point order. 2024-01-18 13:51:32 +03:00
Jeff Young
455fae45d8 Support point editing of inverted rectangles.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16595
2024-01-17 15:27:48 +00:00
Alex Shvartzkop
f99505e190 Fix arc editing bugs when endpoints match.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16532
2024-01-16 16:17:45 +03:00
Jeff Young
2661e7a8ee Fix over-zealous copy/paste and add a few more comments. 2023-12-06 13:08:22 +00:00
Jeff Young
b13590f4c0 Use preview items instead of highlightNets & status popup
The router preview item can be specific to the part that is being
tuned, rather than the whole net.  It's also less visually noisy as
it doesn't dim/undim the rest of the board.

Using kigfx preview items for the status keeps us from having a bunch
of focus issues with the status popup window.
2023-12-02 16:15:43 +00:00
Jeff Young
791aa64950 Functionally it's a "reference image".
The implementation happens to be a "bitmap".

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15932
2023-10-24 15:44:21 +01:00
Jeff Young
ad676e22b8 Don't push a commit we don't own. 2023-10-22 20:35:14 +01:00
Jeff Young
16ec0faa7a Reduce line-breaking.
Also simplifies handling of generator properties dialogs.
2023-10-19 11:19:57 +01:00
Jeff Young
89011e888c More modern look & feel for tuning status popup.
(Also includes min and max info, and move string processing out
of router.)
2023-10-17 13:30:58 +01:00
Jeff Young
390bd44f18 Cleanup. 2023-10-17 13:30:58 +01:00
Jeff Young
d916e650f1 Tuning status popup for point editor. 2023-10-10 11:55:57 +01:00
Alex Shvartzkop
be72e07e61 Introduce PCB_GENERATOR. 2023-10-08 02:41:17 +00:00
Alex Shvartzkop
280fe976c4 Add a re-entrancy guard to PCB_POINT_EDITOR. 2023-10-07 03:51:52 +03:00
Marek Roszko
22b733209d Fail GAL on its header leaking audit
Maybe we should rethink directly accessing GAL so much, but at least 600 files didn't need GAL leaked into them due to view_overlay.h
2023-09-18 19:52:27 -04:00
Jeff Young
d6b75c64e1 ADDED: custom-shaped pad spoke templates. 2023-09-13 23:34:25 +01:00
Jeff Young
69a1b30b8a Implement undo/redo around Pad Edit Mode changes. 2023-09-01 18:48:46 +01:00
Mike Williams
d9c2e0ab54 PCB: start of grid overrides
Only works for moves.
2023-08-24 10:29:09 -04:00
Jeff Young
0413270012 ADDED: Move Corner To... and Move Midpoint To...
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5012
2023-08-05 16:43:55 +01:00
jean-pierre charras
a16ab0aae1 Replace SHAPE_T::RECT by SHAPE_T::RECTANGLE: RECT creates a collision name
issue with a Windows header on msys2.
Change very similar to the commit 9a47b344 about class PAD_SHAPE.
No actual code change
2023-07-25 09:11:55 +02:00
Ian McInerney
2fb6f19a84 Separate immediate and delayed action dispatch
Using a boolean argument just leads to a lot of trailing booleans in the
function calls and is not user friendly. Instead, introduce PostAction()
to send an action that runs after the coroutine (equivalent to passing
false or the default argument), and leave RunAction as the immediate
execution function.
2023-06-27 00:57:59 +01:00
jean-pierre charras
9a47b34499 Replace PAD_SHAPE::RECT by PAD_SHAPE::RECTANGLE to avoid a collision NAME with a windows header on MSYS2, creating many compil warnings. No actual code change. 2023-06-02 12:18:24 +02:00
Jeff Young
28028c941e Retire Local/Draw coords distinction from PAD (the last object to have it). 2023-04-02 18:02:41 +01:00
Jeff Young
bbd6c80507 Collapse FP_* down into their PCB_* equivalents. 2023-03-31 22:57:46 +01:00
Jeff Young
23accffc6d Add Property Inspector support for dimension objects.
Includes changing the class hierarchy so that dimension objects inherit
from PCB_TEXT rather than containing a PCB_TEXT member variable.
2023-03-04 23:16:46 +00:00
Marek Roszko
aacc9746e3 Yeet the last of wxSize/wxPoint to stop leaking gdicmn everywhere 2023-02-18 22:57:18 -05:00
jean-pierre charras
e8114dc49a Minor compil and Coverity warnings fixes. 2023-01-02 10:21:42 +01:00
Jon Evans
ee0a41e3bc Remove excess calls to SelectedItemsModified
We really don't want to post these events unless the *selected* items
were actually modified, since it results in a redraw of the properties
panel (which disturbs edit state and causes flicker on MSW).

Now the COMMIT system is responsible for sending this event iff the
commit touches items that are selected.

Side note: UpdateMsgPanel is useless on every app except pl_editor, so
it can probably be refactored/removed at some point.
2022-12-26 20:57:58 -05:00
Alex
5e8227b54a pcbnew: Support dragging arc center in "Keep endpoints" mode. 2022-12-12 13:00:44 +03:00
Alex
3eb31befed Fix a delay when dragging arc endpoints in pcbnew. 2022-12-12 09:39:56 +03:00
Alex
da1e5a80a8 Restore removeCorner transition in PCB editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/13133
2022-12-12 07:04:20 +03:00
Alex
6d513e7ecf Expose changing arc edit mode in arc button context menu and Preferences
Ctrl+Space can still be used to cycle through modes.

Fixes https://gitlab.com/kicad/code/kicad/issues/5412
2022-12-05 21:28:16 +03:00
Jeff Young
9724f6e736 Don't allow zone filling during other editing operations.
It's a very heavy op, and is likely to violate all manner of
assumptions the other ops make.

Fixes https://gitlab.com/kicad/code/kicad/issues/12736
2022-11-14 23:39:49 +00:00
jean-pierre charras
248181e62d Fix Coverity and compil warnings. 2022-11-12 16:02:24 +01:00
Alex
0b4fc8f50d Fix bugs in PCB arc editing. 2022-11-11 15:00:36 +05:00
Alex
46d4861187 Use the 45-degree limit button to apply alternative constraint. 2022-11-11 15:00:36 +05:00
Alex
8b0f3f1ee7 Set keeping the center as the default arc editing mode. 2022-11-11 15:00:36 +05:00
Seth Hillbrand
056f45cd70 Fixup most intersecting polygon points
Remaining is the intersecting complex pad, so this keeps the error
message when drawing

Fixes https://gitlab.com/kicad/code/kicad/issues/12806
2022-11-08 16:05:04 -08:00
dsa-t
0b3ecdd968 Revert "Fix handling of self-intersecting polygons"
This reverts commit ed309e20da062d2c09be28c1ba434bfe637b659f
2022-11-07 09:41:56 +00:00
Jeff Young
bb618f2d55 Update pointEditor after cancelled move. 2022-11-05 16:50:54 +00:00