kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #11844
BOARD_ITEMs removal
I am digging through the code responsible for BOARD_ITEMs removal and I
have a few questions that are probably easy to answer for people, who
know the source code better than I do.
I have found two places where removal happens:
- void PCB_EDIT_FRAME::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
called when there is only one item to remove (user pressed the Delete
key when an item was under the cursor)
- void PCB_EDIT_FRAME::Block_Delete()
used for removal of block of items (user selected a block of items,
right-clicked and chose "Delete block")
Why are they handled in a different way? Is it only to avoid multiple
ratsnest compilations or refreshing the whole canvas vs xoring single
items to erase?
There are also various way to remove items:
- void BOARD_ITEM::UnLink() & void BOARD_ITEM::DeleteStructure()
- BOARD_ITEM* BOARD::Remove( BOARD_ITEM* aBoardItem ) & void
BOARD::Delete( BOARD_ITEM* aBoardItem )
I can easily say the difference between BOARD_ITEM::Unlink &
DeleteStructure or BOARD::Remove & BOARD::Delete, but I am not able to
say why BOARD_ITEM::Unlink() and BOARD::Remove() coexist. Do not they
simply remove items from DLISTs stored in the BOARD class?
Thanks in advance,
Orson
Follow ups