68 Commits

Author SHA1 Message Date
Jeff Young
3f85071f91 Don't double mirror groups.
Also removes previous fix, which had side-effects.

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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20465
2025-08-21 12:29:34 +01:00
John Beard
299a6c6c7b Netinfo: avoid transitive string_utils.h include
Put the string manipuuation utils in the cpp, and
remove string_utils.h from the includes of netinfo.h.

This spams that header into about 350 files, not all of which
need it. Then go round and tidy up the places (most exporters
and dialogs) where CPP files weren't including string_utils.h
when they used it, as well as some other order-sensitive
include issues that turned up.
2025-08-12 20:00:15 +08:00
Andrzej Wolski
c73d555fe2 ADDED: Lasso selection in pcbnew
Adds a lasso or freeform selection tool to KiCad in addition to standard
rectangular selection.  Adds supporting HitTest routines

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/1977
2025-08-06 16:06:40 -07:00
Jon Evans
0997205ffb Minor code style fixes 2025-06-25 21:25:45 -04:00
Seegong
66d8a133e2 Implement PCB_GROUP serialization and deserialization methods 2025-06-25 21:22:02 -04:00
Jeff Young
f58fc0b952 Rewrite GROUP undo based on uuids.
This also removes the GROUP/UNGROUP-specific undo actions.

This also fixes a bunch of undo bugs when duplicating
group members, creating pins, etc.

This also fixes some undo bugs when dividing wires etc.

This also fixes some bugs with new sch items not
being created within an entered group.
2025-05-21 14:24:59 +01:00
Mike Williams
8e480445bc groups: add search handlers 2025-05-13 14:42:27 -04:00
Jeff Young
fc969ae501 Fix group ownership issue. 2025-04-29 18:10:41 +01:00
Jeff Young
199a7a34ea Don't leak PCB_GROUP internals into BOARD_COMMIT.
(This also fixes a potential bug where the image
group's children didn't get the image as a parent.)
2025-04-21 18:24:30 +01:00
Mike Williams
05e9772d54 groups: extract common class methods into EDA_GROUP base class 2025-04-01 14:34:20 -04:00
Mike Williams
a90b8ec57a pcb: merge RunOnChildren/Descendants into one function with a mode 2025-03-27 13:16:09 -04:00
John Beard
520a7cf62c GAL: ViewGetLOD should not be able to change the VIEW
Make the VIEW* parameter const. Since PCB_TEXT does a null-check,
it's not very clear if this can ever be null (and if it is,
why don't the other VIEW_ITEMs check?), so don't make them
all references too at this time.

Also dereference a few pointers a bit earlier to make non-null
promises sooner rather than later.
2025-01-02 22:59:31 +08:00
John Beard
527faddbfd GAL: provide constants for LoD HIDE/SHOW and a scale helper
Saves a mishmash of local HIDE/SHOW defs along with various literals.

Also provide a function that computes the scale at which a given
IU size becomes (notionally) a certain size on screen. While this
is a simple division, it's a bit opaque in terms of meaning.

Also it means the divide by zero case can be more universally
defended-against, which has traditionally been a bug opportunity.
2025-01-02 22:59:31 +08:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
Seth Hillbrand
9dfcb6a362 Cleanup ViewGetLayers()
Old style c-array replaced with vector returns
2024-11-21 13:18:36 -08:00
Denis Latyshev
260014710a Pcbnew: Add differential and single line length/skew mirroring
ADDED: Added functionality for mirroring differential and single line length, as well as skew adjustment elements.

Fixes https://gitlab.com/kicad/code/kicad/issues/18469
2024-10-16 19:21:03 +00:00
John Beard
215533f31a Unify flip direction handling
There was a gentle mish-mash of booleans, some with
true being left/right and some up/down, and some functions that
can flip in both axes (which is never actually done, and doesn't
really make geometric sense).

Replace all this with the FLIP_DIRECTION enum class, which makes
the intention completely unambiguous.

This also then allows a small scattering of simplifications,
because everything takes the same type and you don't have to
fiddle booleans to fit.
2024-09-27 17:13:13 +01:00
JamesJCode
903c743a60 Fix deep cloning and RunOnDescendants for groups containing generators
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17710
2024-09-26 18:58:44 +01:00
Mike Williams
867cb58175 feature removal: remove Show Hidden Text
Does not work properly since 8.0 introduction of footprint fields.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18656
2024-09-19 15:41:44 -04:00
Jeff Young
9d03a92738 Get rid of C++20 compiler warnings. 2024-07-03 13:32:44 +01:00
Jeff Young
16340e6cf4 Support both short and long item descriptions. 2024-06-28 22:10:22 +01:00
Jeff Young
82c851a4a7 Expose groups to property manager.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/17496
2024-03-20 20:19:21 +00:00
Jeff Young
e445249720 ADDED: PCB tables. 2024-02-24 20:05:51 +00:00
Jeff Young
d47a000564 Make sure group items get added to commit.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16705
2024-01-22 23:34:34 +00:00
Jeff Young
cc721c4907 Improve encapsulation of group internals.
(It's still leaking into BOARD_COMMIT and some other places, but at
least it no longer leaks into all the edit tools.)

Also fixes some bugs when moving/copying/pasting multiple selections
containing length-tuning patterns.
2023-11-09 14:05:35 +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
Seth Hillbrand
d99641be40 ADDED: Git integration support
Adds support for project-based git integration, branch support, commit,
revert and updates

Fixes https://gitlab.com/kicad/code/kicad/issues/10441
2023-10-20 12:51:47 +00:00
Alex Shvartzkop
be72e07e61 Introduce PCB_GENERATOR. 2023-10-08 02:41:17 +00:00
Seth Hillbrand
f3d65b5156 Revise method of selecting footprints in contrast
When working in high contrast mode, we want to be able to select a
footprint with only elements in, e.g. silk and fab layers.

The previous design for footprint IsOnLayer had one behavior of every
other element and a different behavior for footprints.  This leads to
multiple bugs as new features use the overloaded IsOnLayer expecting it
to report if the element exists on a layer or not.

For footprints, we need a different routine to determine whether or not
to select the footprint when clicking on it.  IsOnLayer will report if
the footprint has any elements on a specific layer but we don't want to
use the bbox for a hittest because large footprints with through hole
pads will exist on every layer and have an enormous bbox.  Instead, we
filter footprints based on the hittest of each element.  This behaves in
a more logical fashion, allowing you to select a footprint by clicking
on a visible element of that footprint.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15284
2023-08-01 10:43:13 -07:00
Mike Williams
37837dc392 PCB: introduce PCB_FIELD_T 2023-06-20 18:34:52 +00:00
Jeff Young
bbd6c80507 Collapse FP_* down into their PCB_* equivalents. 2023-03-31 22:57:46 +01:00
Jeff Young
362d85ef50 Special selection mode when in high-contrast with courtyard layer active.
Fixes https://gitlab.com/kicad/code/kicad/issues/13521
2023-02-11 21:11:07 +00:00
Jon Evans
c530bdb5a1 Rename GetSelectMenuText to GetItemDescription
This descriptive text is used for many more things than
just the select menu these days.
2023-01-11 22:27:44 -05:00
Seth Hillbrand
137b4de1c2 Allow groups in groups
This was allowed in the qa test, so we allow it going forward
2022-11-28 11:28:31 -08:00
Seth Hillbrand
259e41be2d Don't add non-groupable items to the group
Things like markers and netinfo should never get added to the group,
even if we are inside the group while adding the items

Fixes https://gitlab.com/kicad/code/kicad/issues/13026
2022-11-28 09:11:20 -08:00
Jeff Young
11dddefd05 Implement GetEffectiveShape for groups.
Fixes https://gitlab.com/kicad/code/kicad/issues/12940
2022-11-18 21:13:23 +00:00
Jeff Young
138f835672 Retire group bbox cache.
It's too hard to maintain when changes to other items (the groups
members) affect it.
2022-11-11 20:31:31 +00:00
Jeff Young
03ba14c6d3 Tighten lifecycle management of parent group pointers.
Also adds some debugging to try to catch dangling pointers.

Also adds a cache for group bounding boxes (which will be expensive
to calculate for large groups).

Fixes https://gitlab.com/kicad/code/kicad/issues/12875
2022-11-11 17:27:28 +00:00
Alex
67985510a8 Fix selecting pads of footprints in groups. 2022-10-21 17:13:24 +03:00
Alex
0fea6f5ac3 Fix selection and entering in nested groups.
Fixes https://gitlab.com/kicad/code/kicad/issues/12586
2022-10-06 21:02:36 +03:00
Jeff Young
2372f24cb0 Don't include hidden text in group boundingbox.
Fixes https://gitlab.com/kicad/code/kicad/issues/12541
2022-09-30 13:02:08 +01:00
Jeff Young
64a6fc0fd4 Push UNITS_PROVIDER down into a low-level mixin.
This allows us to also construct cheap UNIT_PROVIDERs for specific
tasks when necessary.
2022-09-19 17:10:59 +01:00
Marek Roszko
a8613ee80f Combine Iu2Millimeter & remove PcbMm2iu 2022-09-16 21:09:26 -04:00
Jeff Young
f17a865593 Move EDA_ITEM hitTest to BOX2I. 2022-08-31 17:18:45 +01:00
Jeff Young
2dc6300501 Move EDA_ITEM bounding boxes to BOX2I. 2022-08-31 10:16:55 +01:00
Jeff Young
4f0136db3b Attempt to fix std::initializer_list lifetime issue. 2022-08-21 20:54:41 +01:00
Jeff Young
aa2ad3b44c Move KICAD_T[] to std::initializer_list<KICAD_T>. 2022-08-20 10:28:11 +01:00
Seth Hillbrand
35ac39844f Clean up some auto usage
Don't make new copies of shared_ptr if we can use references.  Keep auto
usage down to hard-to-type-out sequences
2022-08-15 11:29:45 -07:00
Marek Roszko
a8505d9c76 SEARCH_RESULT -> INSPECT_RESULT
To fix the name squatting it's doing for future functionality
2022-07-29 20:01:10 -04:00
Jeff Young
7ccac79192 More wxString wide literals. 2022-02-05 21:29:34 +00:00