44 Commits

Author SHA1 Message Date
Jeff Young
4d7cbed3a9 Remove over-zealous assert (KICAD-SJZ).
Items can be deleted more than once (for instance, a
global deletion of all zone will still try to
clean-up teardrops at the end, deleting them a
second time).
2025-07-12 15:26:30 +01:00
Jeff Young
7fbf51b17c Be more pedantic about RECURSE_MODE.
Also fixes an invalid iterator bug.

Also adds mirroring support for PCB_GROUPs.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/21107
2025-06-12 11:21:28 +01: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
b30690664f commit: clear group membership from abandoned commit item copies 2025-05-13 10:41:32 -04:00
Mike Williams
0ba6882c47 commit: when deleting extra copy of double staged item, remove group 2025-04-15 10:14:40 -04:00
Wayne Stambaugh
5c8f4697ca Common folder housekeeping part 1. 2025-01-12 12:06:45 -05: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
a724b3d8b1 Handle DXF files with out of bounds values
First, ensure that we calculate the bbox of the imported elements.

If the total BBOX is outside our allowed value, refused to import.  This
needs to be scaled or addressed in an external editor

If the bbox fits, then make sure that we clamp it such that the largest
element is still within our bounds

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18523
2024-08-14 13:06:18 -07:00
Tomasz Wlostowski
7315d8e47b common: COMMIT now throws an assertion if an item is added/deleted multiple times 2024-08-13 22:50:26 +02:00
Jeff Young
a52da69c03 Fix overly agressive assert.
An item can be added for group/ungroup and add/delete.
2023-12-16 16:20:36 +00:00
Jeff Young
9fb06f95a0 Fix msys2 build. 2023-12-16 16:17:24 +00:00
Jeff Young
ea3c87f243 Move group/ungroup to COMMIT infrastructure. 2023-12-16 14:17:25 +00:00
Jeff Young
e7fca68384 Don't double-delete unused nets (or anything else, for that matter).
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15979
2023-10-31 12:10:21 +00:00
John Beard
10d32bb1d6 Explain wxASSERT in COMMIT::Stage 2023-07-06 21:11:51 +01:00
Jeff Young
5195bc28fe Don't prune already-added items from the COMMIT.
We perform undo/redo backwards from each other specificially to allow
multiple entries (for instance, a wire is modified and then deleted).

This bus is almost certainly in 7.0 as well, but it comes up mostly
in schematics where 7.0 doesn't use COMMIT.  It's also possible that it
will cause unwanted effects in some cases, so I'm leaving it only in
master.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15032
2023-06-24 15:08:26 +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
Seth Hillbrand
f4b43617e7 Add COMMIT structure to Schematic and Symbol editors
Provides a single-point access for modifying the schematic and symbol
elements that allows chaining updates and reverting partial changes.
Standardizes the undo hierarchy between pcb and schematic editors

As this is another layer on the existing undo/redo structure, the
initial commit does not replace all undo/redo calls currently existing.
These will be handled in a series of follow-on commits
2023-04-28 17:05:47 -07:00
Jeff Young
13f5c78e89 More tightening of group parent lifecycles.
Fixes https://gitlab.com/kicad/code/kicad/issues/12908
2022-11-16 00:42:38 +00:00
Seth Hillbrand
a852286eb5 Cleanup compile warnings 2022-06-21 17:04:56 -07:00
Jeff Young
f606679164 Proper numeric sorting for intersheet refs.
Also expunges the horrifically named std::remove and std::remove_if
(neither of which remove anything).
2021-10-01 18:29:21 +01:00
Wayne Stambaugh
bcd6bddfd4 Start expunging NULL.
Given that KiCad is a C++ project, we should really be using nullptr
instead of NULL.
2021-07-15 15:44:45 -04:00
Michal Schulz
44978f00e3 Use compiler-agnostic designation of fall-through in switch/case. 2021-06-14 14:52:37 +00:00
Jon Evans
247da631f9 Revert "Fix typo and clean up leftover tracks"
This reverts commit ed66c0f14dcd17947ddd339094593de104615f12.

Revert "Clean up co-linear tracks after finishing routing"

This reverts commit 1a102f03c0a59cdac37cdaa740d845eb3c29730e.

More complex solution needed

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8526
2021-06-01 11:18:00 -04:00
Jon Evans
1a102f03c0 Clean up co-linear tracks after finishing routing
This involved adding some extra infrastructure to be able
to handle the case where a track that is sitting in the
router's commit waiting to be added to the board actually
needs to be deleted instead.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8419
2021-05-31 17:36:38 -04:00
Seth Hillbrand
8c2fe42ef0 More Undo/Redo Cleanup.
Don't need the reference point or container action type.  Clearing this
command signatures to prevent future confusion/use
2021-02-12 11:26:48 -08:00
Seth Hillbrand
d244c09680 Cleanup undo/redo
Mirror/Rotate/etc were all just "Change" items in the undo/redo stack.
This removes the old calls
2021-02-12 10:25:14 -08:00
Marek Roszko
b2e9f6987d Split base_struct into eda_item and eda_rect 2020-10-13 21:24:50 -04:00
Mark Roszko
1082402b33 Convert UNDO_REDO_T to an enum class 2020-08-26 18:04:32 +00:00
jean-pierre charras
bc5dcf182f keepout in footprint: fix some crashes and issues. Create a specific type (PCB_MODULE_ZONE_AREA_T) for zones in footprint. The new class (MODULE_ZONE_CONTAINER) is the same as ZONE_CONTAINER, but the type ID is PCB_MODULE_ZONE_AREA_T instead of PCB_ZONE_AREA_T.
This is mandatory because these zones must be handled differently in many functions.
2019-10-29 11:24:57 +01:00
Seth Hillbrand
c84752b9a7 commit: protect against un-copyable error
This creates early asserts for issues where we haven't fully implemented
a Clone() function for items or haven't correctly filtered them before
creating the undo/redo commit.
2019-02-16 13:28:45 -08:00
Seth Hillbrand
76f151b4d8 Fix issue with prev d83cff63f
Corrected the new/delete idiom
2018-06-27 16:40:57 -07:00
Seth Hillbrand
d83cff63f6 fix memory leak
When staging a commit for an object that has already been modified,
there is a Clone() made for the hypothetical entry.  We need to free it
if we are not storing a new entry.
2018-06-27 16:15:27 -07:00
Tomasz Włostowski
9932ff32ae refactoring: wrapped boost::optional in OPT<> class for the purpose of easier transition to C++17 in the future 2017-11-03 23:59:02 +01:00
Maciej Suminski
fe89fdfb24 Removed incorrectly defined assert 2017-07-19 13:05:30 +02:00
Maciej Suminski
984ac70106 Added COMMIT::GetStatus() and minor refactor
Moved duplicated code to a new function and added
an assert to warn against possible memory leak.
2017-07-19 10:46:10 +02:00
Tomasz Włostowski
5c0edbabab Fixes for the connectivity & board cleanup algorithms 2017-06-23 11:12:38 +02:00
Maciej Suminski
74b5858665 Fixed a crash when removing zones using the Global Deletion dialog
Fixes: lp:1635266
* https://bugs.launchpad.net/kicad/+bug/1635266
2016-10-20 17:15:50 +02:00
Maciej Suminski
6481ff75c9 Changed one of COMMIT::Stage() methods to COMMIT::Modified() 2016-09-12 13:45:57 +02:00
Maciej Suminski
65b1225231 Added CHT_DONE flag to COMMIT::Stage to skip add/remove step 2016-09-12 13:45:57 +02:00
Maciej Suminski
940765f4b3 COMMIT class: removed m_committed flag, added clear() and Empty() methods. 2016-09-12 11:50:06 +02:00
Maciej Suminski
b8350f037b COMMIT: Added an interface to store items that already have a copy created. 2016-09-12 11:50:06 +02:00
Maciej Suminski
0223425d30 COMMIT: changed BOOST_FOREACH to for. 2016-09-12 11:50:06 +02:00
Maciej Suminski
dac7c5aa1f Store parent object when creating a COMMIT. 2016-09-12 11:50:06 +02:00
Tomasz Wlostowski
9588a7974c Added classes COMMIT & BOARD_COMMIT. 2016-09-12 11:50:06 +02:00