Commit Graph

2839 Commits

Author SHA1 Message Date
John Beard 8e0e9ce752 Generalise fillet tool
Describe the actions of the fillet tools is a generic way, so that the
same general pattern can be used for other tools that modify shapes on
the BOARD.

Basically, an "ITEM_MODIFICATION_ROUTINE" is defined, which is
configured and called multiple times, calling back to the EDIT_TOOL when
it modifies or creates an item.

The motivation here is to make it easier to slot in new line-based
tools like chamfer, extend and so on without having to redo the
complicated item, selection and commit handling each time, and keep the
core "routines" simple and decoupled from the EDIT_TOOL's
internals.

This also resolves #15094 because the new commit handling does the right
thing when items were "conjured up" for the fillet (e.g. when a
rectangle is decomposed into lines).

Fixes: #15094
2023-07-12 19:21:26 +01:00
Jeff Young be63e1824e Create filled polygons when centerline is chosen. 2023-07-12 10:41:46 +01:00
Jeff Young c3d10084b9 ADDED footprint associations dialog. 2023-07-11 14:52:05 +01:00
Ian McInerney aab8d2b036 Give autocomplete routing a default parameter
Fixes KICAD-2M4
2023-07-10 19:41:03 +01:00
jean-pierre charras bdaad32dc8 Pcbnew: fix crash when trying to delete a DIMENSION living in a footprint
Fixes #15156
https://gitlab.com/kicad/code/kicad/-/issues/15156
2023-07-09 20:02:56 +02:00
StuartTylerRelytDesigns d26aa7dc20 Pcbnew moveIndividually ctrl-M mangles 2+ tracks
CHANGED: moveIndividually ctrl-M not mangle tracks and add grid snapping

Fixes https://gitlab.com/kicad/code/kicad/issues/15124
2023-07-08 09:11:53 +00:00
jean-pierre charras 27072e52f7 Fix a compil and Coverity warnings 2023-07-07 10:28:01 +02:00
John Beard ef8cf2d12b Avoid inheriting for POSITIONING_TOOLS_MENU
This only uses the public interface of CONDITIONAL_MENU,
so we can just make on of those and save declaring a wrapper
type.
2023-07-06 21:11:51 +01:00
Mike Williams efb452df37 PCB: selectionCursor can optionally take a filter list
Make sure we pass a default nullptr parameter if we want everything.
2023-07-06 11:25:53 -04:00
Ian McInerney 50e0a3a500 Move layer ID to action mapping to PCB_ACTIONS
This mapping function is better suited for a method of the actions
itself rather than just a helper function in one file.
2023-07-05 11:09:34 +01:00
Jeff Young 9ff33e5ec6 Remove BOARD_COMMIT( TOOL_MANAGER ).
It initializes both m_isFootprintEditor and m_isBoardEditor to false,
causing all sorts of trouble.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15072
2023-07-01 11:52:46 +01:00
Jeff Young 7ed5963b4f Disable positioning tools when a move is in progress.
Also fixes a typo in EDIT_TOOL::doMoveSelection().

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15090
2023-06-30 20:37:03 +01:00
Jeff Young 773e1a1ab6 Actions with a COMMIT must be run synchronously.
Note that "immediate" doesn't mean quite the same thing: while it will
enter the tool immediately, it won't necessarily finish the tool during
the call if the tool has an event loop.  So for something like Rotate
"immediate" and "synchronous" have the same behaviour, but for something
like Move they do not.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15085
2023-06-30 18:57:37 +01:00
Ian McInerney 30f20a694d Give default parameter to net highlight/selection events
Fixes KICAD-2C7
Fixes KICAD-2C3
2023-06-29 00:17:12 +01:00
Ian McInerney 0de6fb03ba Give updateLocalRatsnest action a default parameter
Fixes KICAD-2BX
2023-06-29 00:17:12 +01:00
Ian McInerney 459e6e192a Give placeFootprint action a default nullptr parameter
Fixes KICAD-2BT
2023-06-29 00:17:12 +01:00
Jeff Young 1411b09178 Remove EDIT_TOOL's quasi-global BOARD_COMMIT.
It had several encapsulation leakage issues, as well as poorly-defined
behaviour of undo for chained-actions (append-to-board, and then rotate
while moving, for instance).
2023-06-27 17:04:18 +01: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
Jeff Young 493828cc6b Eradicate a bunch of calls to dyn_cast.
Also deletes PAD::GetParent() which fails to look for parent footprint
through groups.
2023-06-25 11:10:07 +01:00
Jeff Young 300a60e88e Eradicate a bunch of calls to dyn_cast. 2023-06-25 11:10:05 +01:00
Jon Evans 3a0f8214fa ADDED: Properties panel for schematic editor
Initial infrastructure work; follow-ons will add more
properties for schematic items.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6351
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14105
2023-06-22 22:32:24 -04:00
Ian McInerney f14feafc6b Convert selection vector to EDA_ITEMS for base tool call
The base tool expects a generic EDA_ITEMS, but the existing vector
doesn't easily cast, so add a temporary one.
2023-06-20 21:52:50 +01:00
Ian McInerney f899d9676f Remove unneeded parameter from tool call 2023-06-20 21:52:50 +01:00
Ian McInerney 0a3b6c2d23 Fix call to properties when editing newly placed dimension
The edit is intended to be on the newly placed dimension, but the actual
properties tool doesn't take an item, so it was always looking up the
item to edit using the current selection/cursor position. Make this more
robust by just calling the edit properties directly on the item.
2023-06-20 21:52:50 +01:00
Ian McInerney 3c24ddd8cc Fix passing CLIENT_SELECTION_FILTER through the tool framework 2023-06-20 21:52:50 +01:00
Ian McInerney 480223f67c More RunAction specialization 2023-06-20 21:52:50 +01:00
Ian McInerney 3718ecfcd8 Simplify forcing action parameters to have a specific type 2023-06-20 21:52:50 +01:00
Ian McInerney 07cc85e76c Fix more places where casts into RunAction were happening 2023-06-20 21:52:50 +01:00
Ian McInerney 8f3d159905 Update the net highlight action to properly use the action parameters 2023-06-20 21:52:50 +01:00
Ian McInerney 8b833211b5 Add parameter to repair board action
The tool checks for a boolean action, so default to giving false (which
makes it run in interactive mode).
2023-06-20 21:52:50 +01:00
Ian McInerney b04e54dbea Switch TOOL_EVENT and TOOL_ACTION to have a std::any parameter
Using std::any from C++17 allows for proper type handling in the
parameter field, removing the need for casting to void* and then casting
the void* to the desired type.
2023-06-20 21:52:50 +01:00
Mike Williams 6d93950dcc PCB: abolish TEXT_TYPE::TEXT_is_*
PCB_TEXT is now always what was formerly TEXT_is_DIVERS and PCB_FIELDs
now what mandatory field type they are already.
2023-06-20 18:34:52 +00:00
Mike Williams 37837dc392 PCB: introduce PCB_FIELD_T 2023-06-20 18:34:52 +00:00
Mike Williams a859b25d2c PCB: convert footprints to use PCB_FIELDs for fields from schematics 2023-06-20 18:34:52 +00:00
Jeff Young 30336b2fe3 Unify go-back-one-step processing for drawing tools (and router).
Also warps mouse on all go-back-one-step operations for better feedback.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14981

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9985
2023-06-19 17:14:32 +01:00
Jon Evans b424dc11e1 Hotkey feedback for inactive layer display mode 2023-06-17 23:47:26 -04:00
Jeff Young ef6866757e Treat undo as backspace and/or escape when drawing. Ignore redo.
Undo == backspace when drawing a polygon or chained lines.  Otherwise
it's an escape.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14961
2023-06-16 22:08:21 +01:00
Jeff Young 9ed2458f00 Reset session drawing props after Board Setup.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14932
2023-06-13 11:06:10 +01:00
Jeff Young 93789e75b9 Re-create missing exclusion markers if DRC was cancelled.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14919
2023-06-11 12:14:27 +01:00
Jeff Young 96a221ceba Refresh delete immediately; don't wait for next mouse motion. 2023-06-10 21:11:05 +01:00
Jeff Young 111d0a2c14 Check for proxy references and values in Selectable().
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14911
2023-06-10 17:47:29 +01:00
Marek Roszko b41606ecf7 Use the correct printf format for the move individually status text
Fixes sentry KICAD-1ZT
2023-06-04 21:08:13 -04:00
Wayne Stambaugh bdee545841 Coverity warning fixes. 2023-06-03 07:28:17 -04: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 c71cf21e2f Use rendered text to generate bounding box for knockout text.
Don't open-code knockout text shape generation in several different
places.

Make sure triangulated knockout text gets clearance added when
specified.

Collapse duplicated footprint text item plot routine (they're no
longer any different from plotting pcb text items).
2023-05-28 17:20:11 +01:00
Jeff Young 14f004d2a5 Hook up text variable auto-complete for PCBNew.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14777
2023-05-25 10:24:50 +01:00
Jeff Young 2ac3f4cc9e Undo strategy based on being in a footprint, not footprint editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14799
2023-05-23 17:56:12 +01:00
Jeff Young 8b1fd62d35 Make pad & via teardrops 1st-class citizens (props of the pad/via)
Change teardrop generation to rely more heavily on BOARD_CONNECTIVITY
for improved performance.

Add updating of teardrops on BOARD_COMMIT::Push().

Also converts m_CopperItemRTreeCache to std::shared_ptr.
We don't copy it around anyway, and having to create a new set
of std::unique_ptr's for each operation is likely to be more
expensive than std::shared_ptr's overhead.
2023-05-19 18:02:03 +01:00
Jeff Young daa3a1aae9 Revert addition of update-teardrops checkbox to DRC dialog. 2023-05-11 14:53:28 +01:00
Mike Williams 04a53ea40d Picker Tools: make sure we know what tool we are
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/14621
2023-05-01 12:43:09 -04:00