KiCad PCB EDA Suite
Loading...
Searching...
No Matches
undo_redo.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2012 Jean-Pierre Charras, [email protected]
5 * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
6 * Copyright (C) 2016 CERN
7 * Copyright (C) 2012-2023 KiCad Developers, see AUTHORS.txt for contributors.
8 * @author Maciej Suminski <[email protected]>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, you may find one here:
22 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
23 * or you may search the http://www.gnu.org website for the version 2 license,
24 * or you may write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
26 */
27
28#include <functional>
29using namespace std::placeholders;
30#include <macros.h>
31#include <pcb_edit_frame.h>
32#include <pcb_track.h>
33#include <pcb_group.h>
34#include <pcb_generator.h>
35#include <pcb_target.h>
36#include <footprint.h>
37#include <pad.h>
38#include <origin_viewitem.h>
40#include <tool/tool_manager.h>
41#include <tool/actions.h>
43#include <tools/pcb_control.h>
46#include <wx/msgdlg.h>
47
48/* Functions to undo and redo edit commands.
49 * commands to undo are stored in CurrentScreen->m_UndoList
50 * commands to redo are stored in CurrentScreen->m_RedoList
51 *
52 * m_UndoList and m_RedoList handle a std::vector of PICKED_ITEMS_LIST
53 * Each PICKED_ITEMS_LIST handle a std::vector of pickers (class ITEM_PICKER),
54 * that store the list of schematic items that are concerned by the command to undo or redo
55 * and is created for each command to undo (handle also a command to redo).
56 * each picker has a pointer pointing to an item to undo or redo (in fact: deleted, added or
57 * modified),
58 * and has a pointer to a copy of this item, when this item has been modified
59 * (the old values of parameters are therefore saved)
60 *
61 * there are 3 cases:
62 * - delete item(s) command
63 * - change item(s) command
64 * - add item(s) command
65 *
66 * Undo command
67 * - delete item(s) command:
68 * => deleted items are moved in undo list
69 *
70 * - change item(s) command
71 * => A copy of item(s) is made (a DrawPickedStruct list of wrappers)
72 * the .m_Link member of each wrapper points the modified item.
73 * the .m_Item member of each wrapper points the old copy of this item.
74 *
75 * - add item(s) command
76 * =>A list of item(s) is made. The .m_Item member of each wrapper points the new item.
77 *
78 * Redo command
79 * - delete item(s) old command:
80 * => deleted items are moved in EEDrawList list, and in
81 *
82 * - change item(s) command
83 * => the copy of item(s) is moved in Undo list
84 *
85 * - add item(s) command
86 * => The list of item(s) is used to create a deleted list in undo list(same as a delete
87 * command)
88 *
89 * Some block operations that change items can be undone without memorize items, just the
90 * coordinates of the transform:
91 * move list of items (undo/redo is made by moving with the opposite move vector)
92 * mirror (Y) and flip list of items (undo/redo is made by mirror or flip items)
93 * so they are handled specifically.
94 *
95 */
96
97
99 const PICKED_ITEMS_LIST& aItemsList,
100 UNDO_REDO aCommandType )
101{
102 int preExisting = commandToUndo->GetCount();
103
104 for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ )
105 commandToUndo->PushItem( aItemsList.GetItemWrapper(ii) );
106
107 for( unsigned ii = preExisting; ii < commandToUndo->GetCount(); ii++ )
108 {
109 EDA_ITEM* item = commandToUndo->GetPickedItem( ii );
110 UNDO_REDO command = commandToUndo->GetPickedItemStatus( ii );
111
112 if( command == UNDO_REDO::UNSPECIFIED )
113 {
114 command = aCommandType;
115 commandToUndo->SetPickedItemStatus( command, ii );
116 }
117
118 wxASSERT( item );
119
120 switch( command )
121 {
122 case UNDO_REDO::CHANGED:
123 case UNDO_REDO::DRILLORIGIN:
124 case UNDO_REDO::GRIDORIGIN:
125 // If we don't yet have a copy in the link, set one up
126 if( !commandToUndo->GetPickedItemLink( ii ) )
127 {
128 // Warning: DRILLORIGIN and GRIDORIGIN undo/redo command create EDA_ITEMs
129 // that cannot be casted blindly to BOARD_ITEMs (a BOARD_ITEM is derived from a EDA_ITEM)
130 // Especially SetParentGroup() does not exist in EDA_ITEM
131 EDA_ITEM* clone = static_cast<EDA_ITEM*>( item->Clone() );
132
133 if( BOARD_ITEM* brdclone = dynamic_cast<BOARD_ITEM*>( clone ) )
134 brdclone->SetParentGroup( nullptr );
135
136 commandToUndo->SetPickedItemLink( clone, ii );
137 }
138
139 break;
140
141 case UNDO_REDO::NEWITEM:
142 case UNDO_REDO::DELETED:
143 case UNDO_REDO::PAGESETTINGS:
144 case UNDO_REDO::REGROUP:
145 case UNDO_REDO::UNGROUP:
146 break;
147
148 default:
149 wxFAIL_MSG( wxString::Format( wxT( "Unrecognized undo command: %X" ), command ) );
150 break;
151 }
152 }
153
154 if( commandToUndo->GetCount() )
155 {
156 /* Save the copy in undo list */
157 PushCommandToUndoList( commandToUndo );
158
159 /* Clear redo list, because after a new command one cannot redo a command */
161 }
162 else
163 {
164 // Should not occur
165 wxASSERT( false );
166 delete commandToUndo;
167 }
168}
169
170
172{
173 PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST();
174 PICKED_ITEMS_LIST itemsList;
175
176 itemsList.PushItem( ITEM_PICKER( nullptr, aItem, aCommandType ) );
177 saveCopyInUndoList( commandToUndo, itemsList, aCommandType );
178}
179
180
182 UNDO_REDO aCommandType )
183{
184 PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST();
185 commandToUndo->SetDescription( aItemsList.GetDescription() );
186
187 saveCopyInUndoList( commandToUndo, aItemsList, aCommandType );
188}
189
190
192 UNDO_REDO aCommandType )
193{
194 PICKED_ITEMS_LIST* commandToUndo = PopCommandFromUndoList();
195
196 if( !commandToUndo )
197 {
198 commandToUndo = new PICKED_ITEMS_LIST();
199 commandToUndo->SetDescription( aItemsList.GetDescription() );
200 }
201
202 saveCopyInUndoList( commandToUndo, aItemsList, aCommandType );
203}
204
205
207{
208 if( UndoRedoBlocked() )
209 return;
210
211 if( GetUndoCommandCount() <= 0 )
212 return;
213
214 // Inform tools that undo command was issued
216
217 // Get the old list
219
220 // Undo the command
222
223 // Put the old list in RedoList
225 PushCommandToRedoList( list );
226
227 OnModify();
228
231
232 GetCanvas()->Refresh();
233}
234
235
237{
238 if( UndoRedoBlocked() )
239 return;
240
241 if( GetRedoCommandCount() == 0 )
242 return;
243
244 // Inform tools that redo command was issued
246
247 // Get the old list
249
250 // Redo the command
252
253 // Put the old list in UndoList
255 PushCommandToUndoList( list );
256
257 OnModify();
258
261
262 GetCanvas()->Refresh();
263}
264
265
267{
268 bool not_found = false;
269 bool reBuild_ratsnest = false;
270 bool deep_reBuild_ratsnest = false; // true later if pointers must be rebuilt
271 bool solder_mask_dirty = false;
272
273 auto view = GetCanvas()->GetView();
274 auto connectivity = GetBoard()->GetConnectivity();
275
276 PCB_GROUP* addedGroup = nullptr;
277
278 GetBoard()->IncrementTimeStamp(); // clear caches
279
280 // Undo in the reverse order of list creation: (this can allow stacked changes
281 // like the same item can be changes and deleted in the same complex command
282
283 // Restore changes in reverse order
284 for( int ii = aList->GetCount() - 1; ii >= 0 ; ii-- )
285 {
286 EDA_ITEM* eda_item = aList->GetPickedItem( (unsigned) ii );
287
288 /* Test for existence of item on board.
289 * It could be deleted, and no more on board:
290 * - if a call to SaveCopyInUndoList was forgotten in Pcbnew
291 * - in zones outlines, when a change in one zone merges this zone with an other
292 * This test avoids a Pcbnew crash
293 * Obviously, this test is not made for deleted items
294 */
295 UNDO_REDO status = aList->GetPickedItemStatus( ii );
296
297 if( status != UNDO_REDO::DELETED
298 && status != UNDO_REDO::UNGROUP
299 && status != UNDO_REDO::REGROUP
300 && status != UNDO_REDO::DRILLORIGIN // origin markers never on board
301 && status != UNDO_REDO::GRIDORIGIN // origin markers never on board
302 && status != UNDO_REDO::PAGESETTINGS ) // nor are page settings proxy items
303 {
304 if( GetBoard()->GetItem( eda_item->m_Uuid ) == DELETED_BOARD_ITEM::GetInstance() )
305 {
306 // Checking if it ever happens
307 wxASSERT_MSG( false, wxT( "Item in the undo buffer does not exist" ) );
308
309 // Remove this non existent item
310 aList->RemovePicker( ii );
311 not_found = true;
312
313 if( aList->GetCount() == 0 )
314 break;
315
316 continue;
317 }
318 }
319
320 // see if we must rebuild ratsnets and pointers lists
321 switch( eda_item->Type() )
322 {
323 case PCB_FOOTPRINT_T:
324 deep_reBuild_ratsnest = true; // Pointers on pads can be invalid
326
327 case PCB_ZONE_T:
328 case PCB_TRACE_T:
329 case PCB_ARC_T:
330 case PCB_VIA_T:
331 case PCB_PAD_T:
332 reBuild_ratsnest = true;
333 break;
334
335 case PCB_NETINFO_T:
336 reBuild_ratsnest = true;
337 deep_reBuild_ratsnest = true;
338 break;
339
340 default:
341 break;
342 }
343
344 switch( eda_item->Type() )
345 {
346 case PCB_FOOTPRINT_T:
347 solder_mask_dirty = true;
348 break;
349
350 case PCB_VIA_T:
351 solder_mask_dirty = true;
352 break;
353
354 case PCB_ZONE_T:
355 case PCB_TRACE_T:
356 case PCB_ARC_T:
357 case PCB_PAD_T:
358 case PCB_SHAPE_T:
359 {
360 LSET layers = static_cast<BOARD_ITEM*>( eda_item )->GetLayerSet();
361
362 if( layers.test( F_Mask ) || layers.test( B_Mask ) )
363 solder_mask_dirty = true;
364
365 break;
366 }
367
368 default:
369 break;
370 }
371
372 switch( aList->GetPickedItemStatus( ii ) )
373 {
374 case UNDO_REDO::CHANGED: /* Exchange old and new data for each item */
375 {
376 BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
377 BOARD_ITEM* image = (BOARD_ITEM*) aList->GetPickedItemLink( ii );
378
379 // Remove all pads/drawings/texts, as they become invalid
380 // for the VIEW after SwapItemData() called for footprints
381 view->Remove( item );
382 connectivity->Remove( item );
383
384 item->SwapItemData( image );
385
386 if( PCB_GROUP* group = dynamic_cast<PCB_GROUP*>( item ) )
387 {
388 group->RunOnChildren( [&]( BOARD_ITEM* child )
389 {
390 child->SetParentGroup( group );
391 } );
392 }
393
394 view->Add( item );
395 view->Hide( item, false );
396 connectivity->Add( item );
397 item->GetBoard()->OnItemChanged( item );
398 break;
399 }
400
401 case UNDO_REDO::NEWITEM: /* new items are deleted */
402 aList->SetPickedItemStatus( UNDO_REDO::DELETED, ii );
403 GetModel()->Remove( (BOARD_ITEM*) eda_item );
404
405 if( eda_item->Type() != PCB_NETINFO_T )
406 view->Remove( eda_item );
407
408 break;
409
410 case UNDO_REDO::DELETED: /* deleted items are put in List, as new items */
411 aList->SetPickedItemStatus( UNDO_REDO::NEWITEM, ii );
412 GetModel()->Add( (BOARD_ITEM*) eda_item );
413
414 if( eda_item->Type() != PCB_NETINFO_T )
415 view->Add( eda_item );
416
417 if( PCB_GROUP* group = dynamic_cast<PCB_GROUP*>( eda_item ) )
418 addedGroup = group;
419
420 break;
421
422 case UNDO_REDO::REGROUP:
423 aList->SetPickedItemStatus( UNDO_REDO::UNGROUP, ii );
424
425 if( BOARD_ITEM* boardItem = dynamic_cast<BOARD_ITEM*>( eda_item ) )
426 boardItem->SetParentGroup( nullptr );
427
428 break;
429
430 case UNDO_REDO::UNGROUP:
431 aList->SetPickedItemStatus( UNDO_REDO::REGROUP, ii );
432
433 if( BOARD_ITEM* boardItem = dynamic_cast<BOARD_ITEM*>( eda_item ) )
434 {
435 if( addedGroup )
436 addedGroup->AddItem( boardItem );
437 }
438
439 break;
440
441 case UNDO_REDO::DRILLORIGIN:
442 case UNDO_REDO::GRIDORIGIN:
443 {
444 // Warning: DRILLORIGIN and GRIDORIGIN undo/redo command create EDA_ITEMs
445 // that cannot be casted to BOARD_ITEMs
446 EDA_ITEM* image = aList->GetPickedItemLink( ii );
447 VECTOR2D origin = image->GetPosition();
448 image->SetPosition( eda_item->GetPosition() );
449
450 if( aList->GetPickedItemStatus( ii ) == UNDO_REDO::DRILLORIGIN )
451 BOARD_EDITOR_CONTROL::DoSetDrillOrigin( view, this, eda_item, origin );
452 else
453 PCB_CONTROL::DoSetGridOrigin( view, this, eda_item, origin );
454
455 break;
456 }
457
458 case UNDO_REDO::PAGESETTINGS:
459 {
460 // swap current settings with stored settings
461 DS_PROXY_UNDO_ITEM alt_item( this );
462 DS_PROXY_UNDO_ITEM* item = static_cast<DS_PROXY_UNDO_ITEM*>( eda_item );
463 item->Restore( this );
464 *item = alt_item;
465 break;
466 }
467
468 default:
469 wxFAIL_MSG( wxString::Format( wxT( "PutDataInPreviousState() error (unknown code %X)" ),
470 aList->GetPickedItemStatus( ii ) ) );
471 break;
472 }
473 }
474
475 if( not_found )
476 wxMessageBox( _( "Incomplete undo/redo operation: some items not found" ) );
477
478 if( IsType( FRAME_PCB_EDITOR ) )
479 {
480 if( reBuild_ratsnest || deep_reBuild_ratsnest )
481 Compile_Ratsnest( false );
482
483 if( solder_mask_dirty )
485 }
486
488 selTool->RebuildSelection();
489
491}
492
493
495{
496 if( aItemCount == 0 )
497 return;
498
499 UNDO_REDO_CONTAINER& list = whichList == UNDO_LIST ? m_undoList : m_redoList;
500 unsigned icnt = list.m_CommandsList.size();
501
502 if( aItemCount > 0 )
503 icnt = aItemCount;
504
505 for( unsigned ii = 0; ii < icnt; ii++ )
506 {
507 if( list.m_CommandsList.size() == 0 )
508 break;
509
510 PICKED_ITEMS_LIST* curr_cmd = list.m_CommandsList[0];
511 list.m_CommandsList.erase( list.m_CommandsList.begin() );
512 ClearListAndDeleteItems( curr_cmd );
513 delete curr_cmd; // Delete command
514 }
515}
516
517
519{
521 []( EDA_ITEM* item )
522 {
523 if( BOARD_ITEM* boardItem = dynamic_cast<BOARD_ITEM*>( item ) )
524 boardItem->SetParentGroup( nullptr );
525
526 delete item;
527 } );
528}
529
530
532{
536 delete undo;
537
538 GetCanvas()->Refresh();
539}
static void DoSetDrillOrigin(KIGFX::VIEW *aView, PCB_BASE_FRAME *aFrame, EDA_ITEM *aItem, const VECTOR2D &aPoint)
virtual void Remove(BOARD_ITEM *aItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL)=0
Removes an item from the container.
virtual void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false)=0
Adds an item to the container.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:77
void SetParentGroup(PCB_GROUP *aGroup)
Definition: board_item.h:90
void SwapItemData(BOARD_ITEM *aImage)
Swap data between aItem and aImage.
Definition: board_item.cpp:174
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:45
void OnItemChanged(BOARD_ITEM *aItem)
Notify the board and its listeners that an item on the board has been modified in some way.
Definition: board.cpp:2280
void SanitizeNetcodes()
Definition: board.cpp:2245
void IncrementTimeStamp()
Definition: board.cpp:251
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:441
static DELETED_BOARD_ITEM * GetInstance()
Definition: board_item.h:426
void Restore(EDA_DRAW_FRAME *aFrame, KIGFX::VIEW *aView=nullptr)
virtual void PushCommandToUndoList(PICKED_ITEMS_LIST *aItem)
Add a command to undo in the undo list.
virtual int GetRedoCommandCount() const
UNDO_REDO_CONTAINER m_undoList
UNDO_REDO_LIST
Specifies whether we are interacting with the undo or redo stacks.
virtual PICKED_ITEMS_LIST * PopCommandFromRedoList()
Return the last command to undo and remove it from list, nothing is deleted.
UNDO_REDO_CONTAINER m_redoList
virtual PICKED_ITEMS_LIST * PopCommandFromUndoList()
Return the last command to undo and remove it from list, nothing is deleted.
virtual int GetUndoCommandCount() const
virtual void PushCommandToRedoList(PICKED_ITEMS_LIST *aItem)
Add a command to redo in the redo list.
bool IsType(FRAME_T aType) const
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
virtual VECTOR2I GetPosition() const
Definition: eda_item.h:239
const KIID m_Uuid
Definition: eda_item.h:482
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:82
static const TOOL_EVENT UndoRedoPreEvent
Definition: actions.h:256
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:240
static const TOOL_EVENT UndoRedoPostEvent
Definition: actions.h:257
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:556
void ClearUndoORRedoList(UNDO_REDO_LIST whichList, int aItemCount=-1) override
Free the undo or redo list from List element.
Definition: undo_redo.cpp:494
void RestoreCopyFromUndoList(wxCommandEvent &aEvent)
Undo the last edit:
Definition: undo_redo.cpp:206
void saveCopyInUndoList(PICKED_ITEMS_LIST *commandToUndo, const PICKED_ITEMS_LIST &aItemsList, UNDO_REDO aCommandType)
Definition: undo_redo.cpp:98
void AppendCopyToUndoList(const PICKED_ITEMS_LIST &aItemsList, UNDO_REDO aCommandType) override
As SaveCopyInUndoList, but appends the changes to the last undo item on the stack.
Definition: undo_redo.cpp:191
void SaveCopyInUndoList(EDA_ITEM *aItemToCopy, UNDO_REDO aTypeCommand) override
Create a new entry in undo list of commands.
Definition: undo_redo.cpp:171
void ClearListAndDeleteItems(PICKED_ITEMS_LIST *aList)
Definition: undo_redo.cpp:518
void RollbackFromUndo()
Perform an undo of the last edit without logging a corresponding redo.
Definition: undo_redo.cpp:531
bool UndoRedoBlocked() const
Check if the undo and redo operations are currently blocked.
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList)
Used in undo or redo command.
Definition: undo_redo.cpp:266
void RestoreCopyFromRedoList(wxCommandEvent &aEvent)
Redo the last edit:
Definition: undo_redo.cpp:236
EDA_ITEM * GetItem(const KIID &aId) const override
Fetch an item by KIID.
void OnModify() override
Must be called after a change in order to set the "modify" flag and update other data structures and ...
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
BOARD * GetBoard() const
virtual BOARD_ITEM_CONTAINER * GetModel() const =0
void Compile_Ratsnest(bool aDisplayStatus)
Create the entire board ratsnest.
Definition: ratsnest.cpp:35
static void DoSetGridOrigin(KIGFX::VIEW *aView, PCB_BASE_FRAME *aFrame, EDA_ITEM *originViewItem, const VECTOR2D &aPoint)
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:51
virtual bool AddItem(BOARD_ITEM *aItem)
Add item to group.
Definition: pcb_group.cpp:79
The selection tool: currently supports:
void RebuildSelection()
Rebuild the selection from the EDA_ITEMs' selection flags.
A holder to handle information on schematic or board items.
bool SetPickedItemStatus(UNDO_REDO aStatus, unsigned aIdx)
Set the type of undo/redo operation for a given picked item.
void PushItem(const ITEM_PICKER &aItem)
Push aItem to the top of the list.
void SetDescription(const wxString &aDescription)
UNDO_REDO GetPickedItemStatus(unsigned int aIdx) const
ITEM_PICKER GetItemWrapper(unsigned int aIdx) const
EDA_ITEM * GetPickedItemLink(unsigned int aIdx) const
wxString GetDescription() const
bool RemovePicker(unsigned aIdx)
Remove one entry (one picker) from the list of picked items.
unsigned GetCount() const
void ReversePickersListOrder()
Reverse the order of pickers stored in this list.
bool SetPickedItemLink(EDA_ITEM *aLink, unsigned aIdx)
Set the link associated to a given picked item.
void ClearListAndDeleteItems(std::function< void(EDA_ITEM *)> aItemDeleter)
Delete the list of pickers AND the data pointed by #m_PickedItem or #m_PickedItemLink according to th...
EDA_ITEM * GetPickedItem(unsigned int aIdx) const
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:165
bool ProcessEvent(const TOOL_EVENT &aEvent)
Propagate an event to tools that requested events of matching type(s).
void PostEvent(const TOOL_EVENT &aEvent)
Put an event to the event queue to be processed at the end of event processing cycle.
A holder to handle a list of undo (or redo) commands.
std::vector< PICKED_ITEMS_LIST * > m_CommandsList
#define _(s)
@ FRAME_PCB_EDITOR
Definition: frame_type.h:42
@ B_Mask
Definition: layer_ids.h:107
@ F_Mask
Definition: layer_ids.h:108
This file contains miscellaneous commonly used macros and functions.
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
Class to handle a set of BOARD_ITEMs.
@ AS_GLOBAL
Global action (toolbar/main menu event, global shortcut)
Definition: tool_action.h:48
@ TA_UNDO_REDO_PRE
Definition: tool_event.h:105
@ TA_UNDO_REDO_POST
Definition: tool_event.h:108
@ TC_MESSAGE
Definition: tool_event.h:57
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:88
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:95
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition: typeinfo.h:105
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:87
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:96
@ PCB_NETINFO_T
class NETINFO_ITEM, a description of a net
Definition: typeinfo.h:107
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:94
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...