Commit Graph

156 Commits

Author SHA1 Message Date
dsa-t cb41b53ab7 Use MurmurHash3_x64_128 (MMH3_HASH) for polygon checksum.
Improves performance when moving footprints.

See https://gitlab.com/kicad/code/kicad/-/issues/18148
2024-06-24 21:19:43 +00:00
Jeff Young 694a7db457 Performance improvements.
Don't construct a wxString or a LSEQ when you don't
have to.  They're both more expensive than you might
think.
2024-06-12 11:06:10 +01:00
Marek Roszko 94847e89c3 Static cast some more enum usage 2024-04-13 15:15:39 -04:00
Marek Roszko 96cdfc7fa7 Update equality overloads for C++20
C++20 added new reverse and rewritten candidates. This can confuse the compiler because it'll test both A==B and B==A for overloads.
Because we were defining parent class equality overloads, A==B and B==A was considered ambigious due to both being compatible in casting.

So we needed to add explicit child class equality operator overloads
2024-04-12 23:05:58 -04:00
Jeff Young 06a8517818 Further improvements to cache locking.
In particular, don't hold cache lock while doing computations.
2024-03-07 13:20:20 +00:00
Armin Schoisswohl 4dcec60bf4 add include <mutex> to fix compilation under linux 2024-03-07 13:20:16 +00:00
Armin Schoisswohl bb9448edcb change m_CachesMutex to shared_mutex and do shared locking for read access in zone BBox calculations 2024-03-07 13:20:13 +00:00
Armin Schoisswohl 991ff71f33 fix deadlock in DRC "Checking keeopouts & disallow constraints" 2024-03-07 13:20:10 +00:00
Armin Schoisswohl 4590455ab2 protect cache lookups in pcbnew/zone by locking the mutex before calling find, fix #17237 2024-03-07 13:20:06 +00:00
Jeff Young ee3be0802c Move PCBNew overrides to nullable properties.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5562
2024-02-24 20:05:51 +00:00
Jeff Young da46a96623 Update a few strings based on new string freeze policy. 2024-02-05 15:49:57 +00:00
Jeff Young 77c19fa99a Fill in missing zone properties.
Also fixes some bugs with hatch properties being available
on rule areas.
2024-02-04 23:01:31 +00:00
Jeff Young 4e0b48a03a ZONE_SETTINGS init belongs in ZONE_SETTINGS's ctor.
(Not in ZONE's ctor.)
2024-02-03 20:17:31 +00:00
Jeff Young 5379a1d863 Nullptr protection. 2024-02-03 20:17:31 +00:00
Jeff Young 0890ac57dd Improve clarity of default zone settings. 2024-02-03 13:22:16 +00:00
Jeff Young 78c46e5f4e Improved clarity and comments. 2023-11-17 18:36:33 +00: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 0ea85ec9f5 Restore fill polygons on proper layers when flipping zones. 2023-10-12 02:21:47 +03:00
Alex Shvartzkop d7863b09c5 Move CORNER_STRATEGY out of SHAPE_POLY_SET. 2023-10-06 15:42:50 +03:00
Marek Roszko 812143ac69 ADDED: Run PCB DRC via cli 2023-08-10 20:20:40 -04:00
Mark Roszko 214c74b89b Update file zone.cpp 2023-08-10 15:15:37 +00:00
Mark Roszko f88148e4e8 Fix printf assert in ZONE::GetMsgPanelInfo 2023-08-10 02:49:09 +00:00
Jeff Young 8bb895373a Allow GetLayer() to be used with single-layer zones.
Also fixes a bug in GetFirstLayer() where we were checking
m_layerSet.size() (which is always 60) rather than
m_layerSet.count() (which is the number of set layers).

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15233
2023-08-08 12:43:22 +01:00
Jeff Young c697a934b2 Update layer names to current terminology.
Also fixes some out-of-date tooltips/names.
2023-08-04 11:37:46 +01:00
Jeff Young 9e019a1ad1 Don't conclude we're unconnected if only connected to isolated island.
Also adds the layer name to the "thermal connection incomplete" DRC
error message.

Also improves zone layer description to not say "X and 1 more" (which
takes as much room as saying "X and Y").

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15279
2023-08-03 16:30:52 +01: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
Kuba Sunderland-Ober 3b261256e7 Use static casts between related classes. 2023-07-05 10:20:18 +00:00
Jeff Young f5791f5dc6 Left some fixes out of previous commit. 2023-05-29 16:22:24 +01:00
Jeff Young 65e53b8ecd Move SHAPE_POLY_SET::Inflate's error spec from a seg-count to a max-deviation.
1) Also reorders parameters to make sure the compiler helps out.

2) This also makes it harder to mess up the discrepency between
   BOX2I/wxRECT/etc::Inflate() and SHAPE_POLY_SET::Inflate.

3) Also fixes a couple of bugs where the corner strategy was passed
   in as a segCount.

4) Also fixes a couple of bugs where the error wasn't forced to the
   outside to match the ERROR_LOCATION.

5) Also fixes a couple of bugs where the seg count was specified
   without regard to an already passed-in max deviation
2023-05-29 15:29:03 +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 bbd6c80507 Collapse FP_* down into their PCB_* equivalents. 2023-03-31 22:57:46 +01:00
Jon Evans 65193487a6 Properties: Rename methods to better reflect their purposes 2023-03-26 19:43:16 -04:00
Jeff Young ee1d9c561c Improve zone & rule area reporting.
Also removes a bunch of "wxEmptyString" where it was degrading readability.

Also fixes a bug where footprint zones were getting sorted incorrectly
due to rotation of coordinates.

Fixes https://gitlab.com/kicad/code/kicad/issues/14322
2023-03-17 13:28:29 +00:00
Seth Hillbrand 9146e38af4 Handle fully-nested zones
The logic to handle divots needs to account for fully nested, same net
zones.  The process of subtracting led to us considering the inner zone
to be a zone knock-out (negative polygon).  To avoid this, we need to
check if the inner, higher priority zone has any connection to the outer
zone.  If it does not, then we can treat it as an isolated zone without
worrying about divots to the outer zone.
2023-03-08 10:36:53 -08:00
Seth Hillbrand ffcc0e50b7 Handle excessively large values when hatching
While unusual, ensure that hatched zones don't break KiCad if they are
close to the integer limit

Fixes https://gitlab.com/kicad/code/kicad/issues/14066
2023-02-23 14:40:57 -08: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 eb240fda9a Properties: introduce validators; re-enable zone hatch settings 2023-02-11 11:44:58 -05:00
Jon Evans 254168c788 Properties: introduce method chaining for initialization 2023-02-11 11:44:58 -05:00
Jon Evans e066454c61 Zones: use metric defaults and limits instead of mixed units
Update testcases to reflect new defaults
2023-02-11 07:39:29 -05:00
Jon Evans 92a61b187f Properties: Hide zone fill type settings for now
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13811
2023-02-08 21:56:15 -05:00
jean-pierre charras 737318a24d struct ZONE_DESC: ensure ENUM_MAP<PCB_LAYER_ID> is initialized before use it.
ENUM_MAP<PCB_LAYER_ID> is tested initialized in some other XXX_DESC,
but not in ZONE_DESC
Fixes #13699
https://gitlab.com/kicad/code/kicad/issues/13699
2023-02-02 09:11:27 +01:00
Jeff Young bf4b9ef6e2 Remove sorting by priority before filling.
We can't fill lower-priority zones until the higher-priority ones
have been tesselated, and as the tesselation step always gets pushed
to the back of the queue after the fill finishes having them sorted
by priority accomplishes little.  (We're also going to push all other
layers of the high-priority zone to the back as the first layer will
have the lock, further degrading the usefulness of sorting.)
2023-01-15 15:52:24 +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
qu1ck 2654279678 Cleanup zone bbox cache in destructor 2023-01-12 00:21:51 +00:00
Jon Evans 5eb3f5d3e7 Use correct translation macro for group names
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13277
2022-12-26 20:11:20 -05:00
Jon Evans fbaf4af489 Properties: Allow dynamic update of read-only state 2022-12-25 20:35:44 -05:00
Jon Evans 435651237c Properties: Support overridden availability functions 2022-12-08 00:09:51 -05:00
Jon Evans 4134db3c47 GCC fixes 2022-12-02 22:38:15 -05:00
Jon Evans 050d282c12 Properties: Hide some copper-only properties from non-copper zones 2022-12-02 21:59:17 -05:00
Jon Evans 3b25fdc212 Properties: Fix zones stomping on position props for other items 2022-12-01 16:55:12 -05:00