Commit Graph

79 Commits

Author SHA1 Message Date
Jeff Young ec980e8696 Move "parent" property from PAD to BOARD_ITEM. 2023-08-18 22:20:09 +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
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
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 ddd2cb005b Don't allow setting a pad width or height of 0.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14278
2023-05-31 23:41:43 +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
jean-pierre charras 152f6d80e5 Use operator at() instead of [] to access a std::array item
It helps debug.
2023-05-03 16:40:40 +02:00
Jeff Young 3b63d70d01 Centralize NPTH has-annulus processing.
Fixes https://gitlab.com/kicad/code/kicad/issues/13437
2023-04-08 15:06:49 +01:00
Jeff Young 7286555529 Fix some issues editing pads via Pad Properties dialog.
The offsets and orientations were being incorrectly handled.
2023-04-03 13:17:52 +01: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
Nimish Telang 8ea357f04d Fix Doxygen directives in numerous headers 2023-03-24 13:02:13 +00: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
Alex b71fa91bc4 Don't write outside of overrides array on pad zone_layer_connections.
Use std::array to catch future errors in Debug.

Fixes https://gitlab.com/kicad/code/kicad/issues/13803
2023-02-08 01:32:52 +03:00
Jeff Young f2f54fe926 Improve zone-layer-connections terminology and comments.
This makes it clearer that the overrides are not inverses of each
other -- one overrides the flashing state and the other overrides
the connection state (to other zones, not to everything).

Also fixes a bug where we were failing to check the force-no-connect
for pads.
2023-02-05 17:39:42 +00:00
Jeff Young 00e2bbac5a Special-case net-ties for solder mask bridging.
Fixes https://gitlab.com/kicad/code/kicad/issues/13646
2023-01-24 11:33:08 +00:00
Jeff Young 0c8f95aa02 Make sure tesselate_lambda has lock before modifying zone.
Also implements locking for upating pad & tracks' zoneConnectionCaches.

Fixes https://gitlab.com/kicad/code/kicad/issues/13531
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
Jeff Young e509fa0fc9 Don't depend on a pad being connected to a non-zone when filling zones.
If the pad hasn't already been owned by another zone, and the zone we're
currently filling can connect to it, then we want to try to flash it even
if it's not connected to anything else.

Fixes https://gitlab.com/kicad/code/kicad/issues/13415
2023-01-07 19:34:32 +00:00
Jon Evans 308576b78d Properties: Use parent footprint references instead of UUIDs
Also remove redundant Net Name property (Net is used)

Fixes https://gitlab.com/kicad/code/kicad/-/issues/12334
2022-11-24 22:40:45 -05:00
Jeff Young b42d5da07d Check keepTopBottom when determining whether or not to flash a pad/via.
Fixes https://gitlab.com/kicad/code/kicad/issues/12961
2022-11-22 18:18:43 +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
Jeff Young d16b23d16e Name shortening and line-break reduction. 2022-10-21 18:41:39 +01:00
Jeff Young 437d2c4589 Overhaul of remove-unconnected's zone filling and drawing strategies.
1) The highest priority zone that a via/pad collides with "owns" its
connectivity state.  Once set, lower priority zones cannot change it --
and in fact, if they would have connected to it are forced not to.

2) The connectivity state goes with the zone fill state, and therefore
must be saved in the file.

3) Display of remove-unconnected's pads is no longer done in GetViewLOD()
(which isn't called for selected items), and is instead done in PCB_PAINTER.
This allows us to draw the full pad in outline mode when a via/pad is
selected which would otherwise only show the hole.

4) Note that in some cases this will still generate DRC errors -- in
particular when a via nearly collides with a higher priority zone it
won't get "owned" by that zone and may therefore have insufficient
clearance if said zone concludes it's unconnected and a subsequent
(lower priority) zone connects to it (causing it to now become flashed).

Fixes https://gitlab.com/kicad/code/kicad/issues/11299
2022-10-18 13:05:42 +01:00
Jeff Young d1450e1802 Commenting. 2022-10-13 13:05:51 +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 3d5913c825 Remove convert_to_biu.h, merge contents to base_units.h 2022-09-16 21:09:28 -04:00
Jeff Young 281b9d405a ADDED ability to specify where pad number (& net name) go on custom shaped pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/6627
2022-09-14 11:37:20 +01:00
Jeff Young 16b4f96405 Centralize no-connect- and free-pad processing.
Also makes the track-net-names less squirrelly around the viewport
edges.
2022-09-06 13:59:52 +01: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 e0f6a6e475 Run hole-to-hole checks on Edge_Cuts layer.
Also makes the flashing logic inside PAD::GetEffectiveShape() easier
to understand.

Fixes https://gitlab.com/kicad/code/kicad/issues/12296
2022-08-29 17:37:49 +01:00
Maciej Suminski 7f00efe6cf Properties: Fixed conditional properties using enum values in the conditions
When wxAny holds an enum, it cannot be compared with an integer due to a
missing conversion function. In such case, conditional properties
compare a raw value rather than wxAny.
2022-08-22 21:32:32 -04: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
Jeff Young 015bde8cb0 Test pad:hole violations in footprints as long as not same pad number.
Fixes https://gitlab.com/kicad/code/kicad/issues/12124
2022-08-07 19:49:39 +01:00
Jeff Young bf5e649e44 Fix log errors in new solder masking checking code. 2022-07-23 09:26:04 +01:00
Jeff Young f41af10007 Clean up hole shapes for safety (smart pointer) and consistency. 2022-07-22 23:06:07 +01:00
Jeff Young 2de10080cd Add edge and margin clearances to message panel. 2022-07-15 16:14:32 +01:00
Jeff Young 90af5a36d2 Show hole clearance lines around NPTH pads.
Also make the clearance line NONPLATED_HOLES colour, not the PADS_TH
colour.
2022-04-04 10:28:33 +01:00
Seth Hillbrand 442aae19d9 Separate flashing check for connectivity
When building the connectivity database, we should not be using the
connectivity to check for shapes.

To make this deterministic, we introduce two flags (ALWAYS_FLASH and
NEVER_FLASH) that are used with connectivity building to determine
whether a pad is flashed for connectivity or not.  ZONE <-> PAD/VIA
connectivity will be checked with ALWAYS_FLASHED and all other
connectivity will be checked with NEVER_FLASHED if they are marked for
potential annular ring removal.  If they are not marked for removal,
they will be checked ALWAYS_FLASHED.

Fixes https://gitlab.com/kicad/code/kicad/issues/11114
2022-03-16 17:30:01 -07:00
Jeff Young 2ec21c7720 Don't check for board edge collision on castellated pads.
Fixes https://gitlab.com/kicad/code/kicad/issues/10970
2022-03-14 20:19:09 +00:00
Jeff Young 1ee3ce45e8 Don't ask for layer of multi-layer objects. 2022-02-18 14:19:13 +00:00
Jeff Young 5efa354f0f Add asserts to flush out incorrect uses of GetLayer(). 2022-02-18 12:14:38 +00:00
Jeff Young e84c574830 Some more EDA_ANGLE cleanup. 2022-01-16 19:16:18 +00:00
Seth Hillbrand 22a77d3556 Move EDA_ANGLE to KiMath lib
KiMath should only depend on itself not on other elements in the tree
2022-01-14 17:12:24 -08:00
Jeff Young c9487bad18 Move BOARD_ITEM::Rotate() to EDA_ANGLE. 2022-01-14 16:08:19 +00:00
Jeff Young d485eb2514 Move pads to EDA_ANGLE. 2022-01-14 16:08:18 +00:00
Marek Roszko e4dbfcd92d Swap out some wxSize for VECTOR2I 2022-01-04 20:42:27 -05:00
Marek Roszko c4c56de708 Neurotically update position wxPoint usages 2022-01-01 11:55:51 -05:00