KiCad PCB EDA Suite
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-2021 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>
29 using namespace std::placeholders;
30 #include <macros.h>
31 #include <pcb_edit_frame.h>
32 #include <board.h>
33 #include <pcb_track.h>
34 #include <pcb_group.h>
35 #include <pcb_target.h>
36 #include <footprint.h>
37 #include <pad.h>
38 #include <pcb_dimension.h>
39 #include <origin_viewitem.h>
41 #include <pcbnew_settings.h>
42 #include <tool/tool_manager.h>
43 #include <tool/actions.h>
45 #include <tools/pcb_control.h>
48 #include <wx/msgdlg.h>
49 
50 /* Functions to undo and redo edit commands.
51  * commands to undo are stored in CurrentScreen->m_UndoList
52  * commands to redo are stored in CurrentScreen->m_RedoList
53  *
54  * m_UndoList and m_RedoList handle a std::vector of PICKED_ITEMS_LIST
55  * Each PICKED_ITEMS_LIST handle a std::vector of pickers (class ITEM_PICKER),
56  * that store the list of schematic items that are concerned by the command to undo or redo
57  * and is created for each command to undo (handle also a command to redo).
58  * each picker has a pointer pointing to an item to undo or redo (in fact: deleted, added or
59  * modified),
60  * and has a pointer to a copy of this item, when this item has been modified
61  * (the old values of parameters are therefore saved)
62  *
63  * there are 3 cases:
64  * - delete item(s) command
65  * - change item(s) command
66  * - add item(s) command
67  *
68  * Undo command
69  * - delete item(s) command:
70  * => deleted items are moved in undo list
71  *
72  * - change item(s) command
73  * => A copy of item(s) is made (a DrawPickedStruct list of wrappers)
74  * the .m_Link member of each wrapper points the modified item.
75  * the .m_Item member of each wrapper points the old copy of this item.
76  *
77  * - add item(s) command
78  * =>A list of item(s) is made. The .m_Item member of each wrapper points the new item.
79  *
80  * Redo command
81  * - delete item(s) old command:
82  * => deleted items are moved in EEDrawList list, and in
83  *
84  * - change item(s) command
85  * => the copy of item(s) is moved in Undo list
86  *
87  * - add item(s) command
88  * => The list of item(s) is used to create a deleted list in undo list(same as a delete
89  * command)
90  *
91  * Some block operations that change items can be undone without memorize items, just the
92  * coordinates of the transform:
93  * move list of items (undo/redo is made by moving with the opposite move vector)
94  * mirror (Y) and flip list of items (undo/redo is made by mirror or flip items)
95  * so they are handled specifically.
96  *
97  */
98 
99 
113 static bool TestForExistingItem( BOARD* aPcb, BOARD_ITEM* aItem )
114 {
115  for( PCB_TRACK* item : aPcb->Tracks() )
116  {
117  if( aItem == static_cast<BOARD_ITEM*>( item ) )
118  return true;
119  }
120 
121  for( FOOTPRINT* item : aPcb->Footprints() )
122  {
123  if( aItem == static_cast<BOARD_ITEM*>( item ) )
124  return true;
125  }
126 
127  for( BOARD_ITEM* item : aPcb->Drawings() )
128  {
129  if( aItem == static_cast<BOARD_ITEM*>( item ) )
130  return true;
131  }
132 
133  for( ZONE* item : aPcb->Zones() )
134  {
135  if( aItem == static_cast<BOARD_ITEM*>( item ) )
136  return true;
137  }
138 
139  NETINFO_LIST& netInfo = aPcb->GetNetInfo();
140 
141  for( NETINFO_LIST::iterator i = netInfo.begin(); i != netInfo.end(); ++i )
142  {
143  if( aItem == static_cast<BOARD_ITEM*>( *i ) )
144  return true;
145  }
146 
147  for( PCB_GROUP* item : aPcb->Groups() )
148  {
149  if( aItem == static_cast<BOARD_ITEM*>( item ) )
150  return true;
151  }
152 
153  return false;
154 }
155 
156 
157 static void SwapItemData( BOARD_ITEM* aItem, BOARD_ITEM* aImage )
158 {
159  if( aImage == nullptr )
160  return;
161 
162  wxASSERT( aItem->Type() == aImage->Type() );
163 
164  // Remark: to create images of edited items to undo, we are using Clone method
165  // which does not do a deep copy.
166  // So we have to use the current values of these parameters.
167 
168  wxASSERT( aItem->m_Uuid == aImage->m_Uuid );
169 
170  EDA_ITEM* parent = aItem->GetParent();
171 
172  aItem->SwapData( aImage );
173 
174  // Restore pointers to be sure they are not broken
175  aItem->SetParent( parent );
176 }
177 
178 
180 {
181  PICKED_ITEMS_LIST commandToUndo;
182  commandToUndo.PushItem( ITEM_PICKER( nullptr, aItem, aCommandType ) );
183  SaveCopyInUndoList( commandToUndo, aCommandType );
184 }
185 
186 
188  UNDO_REDO aCommandType )
189 {
190  PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST();
191 
192  // First, filter unnecessary stuff from the list (i.e. for multiple pads / labels modified),
193  // take the first occurrence of the footprint (we save copies of footprints when one of its
194  // subitems is changed).
195  for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ )
196  {
197  ITEM_PICKER curr_picker = aItemsList.GetItemWrapper(ii);
198  BOARD_ITEM* item = dynamic_cast<BOARD_ITEM*>( aItemsList.GetPickedItem( ii ) );
199 
200  // For items belonging to footprints, we need to save state of the parent footprint
201  if( item && item->GetParent() && item->GetParent()->Type() == PCB_FOOTPRINT_T )
202  {
203  item = item->GetParent();
204 
205  // Check if the parent footprint has already been saved in another entry
206  bool found = false;
207 
208  for( unsigned j = 0; j < commandToUndo->GetCount(); j++ )
209  {
210  if( commandToUndo->GetPickedItem( j ) == item
211  && commandToUndo->GetPickedItemStatus( j ) == UNDO_REDO::CHANGED )
212  {
213  found = true;
214  break;
215  }
216  }
217 
218  if( !found )
219  {
220  // Create a clean copy of the parent footprint
221  FOOTPRINT* orig = static_cast<FOOTPRINT*>( item );
222  FOOTPRINT* clone = new FOOTPRINT( *orig );
223  clone->SetParent( GetBoard() );
224 
225  // Clear current flags (which can be temporary set by a current edit command)
226  for( BOARD_ITEM* child : clone->GraphicalItems() )
227  child->ClearEditFlags();
228 
229  for( PAD* pad : clone->Pads() )
230  pad->ClearEditFlags();
231 
232  clone->Reference().ClearEditFlags();
233  clone->Value().ClearEditFlags();
234 
235  ITEM_PICKER picker( nullptr, item, UNDO_REDO::CHANGED );
236  picker.SetLink( clone );
237  commandToUndo->PushItem( picker );
238  }
239  else
240  {
241  continue;
242  }
243  }
244  else
245  {
246  // Normal case: all other BOARD_ITEMs, are simply copied to the new list
247  commandToUndo->PushItem( curr_picker );
248  }
249  }
250 
251  for( unsigned ii = 0; ii < commandToUndo->GetCount(); ii++ )
252  {
253  EDA_ITEM* item = aItemsList.GetPickedItem( ii );
254  UNDO_REDO command = commandToUndo->GetPickedItemStatus( ii );
255 
256  if( command == UNDO_REDO::UNSPECIFIED )
257  {
258  command = aCommandType;
259  commandToUndo->SetPickedItemStatus( command, ii );
260  }
261 
262  wxASSERT( item );
263 
264  switch( command )
265  {
266  case UNDO_REDO::CHANGED:
269 
270  /* If needed, create a copy of item, and put in undo list
271  * in the picker, as link
272  * If this link is not null, the copy is already done
273  */
274  if( commandToUndo->GetPickedItemLink( ii ) == nullptr )
275  {
276  EDA_ITEM* cloned = item->Clone();
277  commandToUndo->SetPickedItemLink( cloned, ii );
278  }
279 
280  break;
281 
282  case UNDO_REDO::NEWITEM:
283  case UNDO_REDO::DELETED:
285  case UNDO_REDO::REGROUP:
286  case UNDO_REDO::UNGROUP:
287  break;
288 
289  default:
290  wxFAIL_MSG( wxString::Format( wxT( "SaveCopyInUndoList() error (unknown code %X)" ),
291  command ) );
292  break;
293  }
294  }
295 
296  if( commandToUndo->GetCount() )
297  {
298  /* Save the copy in undo list */
299  PushCommandToUndoList( commandToUndo );
300 
301  /* Clear redo list, because after a new command one cannot redo a command */
302  ClearUndoORRedoList( REDO_LIST );
303  }
304  else
305  {
306  // Should not occur
307  wxASSERT( false );
308  delete commandToUndo;
309  }
310 }
311 
312 
313 void PCB_BASE_EDIT_FRAME::RestoreCopyFromUndoList( wxCommandEvent& aEvent )
314 {
315  if( UndoRedoBlocked() )
316  return;
317 
318  if( GetUndoCommandCount() <= 0 )
319  return;
320 
321  // Inform tools that undo command was issued
322  m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_PRE, AS_GLOBAL } );
323 
324  // Get the old list
325  PICKED_ITEMS_LIST* list = PopCommandFromUndoList();
326 
327  // Undo the command
328  PutDataInPreviousState( list );
329 
330  // Put the old list in RedoList
331  list->ReversePickersListOrder();
332  PushCommandToRedoList( list );
333 
334  OnModify();
335 
336  m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_POST, AS_GLOBAL } );
337  m_toolManager->PostEvent( EVENTS::SelectedItemsModified );
338 
339  GetCanvas()->Refresh();
340 }
341 
342 
343 void PCB_BASE_EDIT_FRAME::RestoreCopyFromRedoList( wxCommandEvent& aEvent )
344 {
345  if( UndoRedoBlocked() )
346  return;
347 
348  if( GetRedoCommandCount() == 0 )
349  return;
350 
351  // Inform tools that redo command was issued
352  m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_PRE, AS_GLOBAL } );
353 
354  // Get the old list
355  PICKED_ITEMS_LIST* list = PopCommandFromRedoList();
356 
357  // Redo the command
358  PutDataInPreviousState( list );
359 
360  // Put the old list in UndoList
361  list->ReversePickersListOrder();
362  PushCommandToUndoList( list );
363 
364  OnModify();
365 
366  m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_POST, AS_GLOBAL } );
367  m_toolManager->PostEvent( EVENTS::SelectedItemsModified );
368 
369  GetCanvas()->Refresh();
370 }
371 
372 
374 {
375  bool not_found = false;
376  bool reBuild_ratsnest = false;
377  bool deep_reBuild_ratsnest = false; // true later if pointers must be rebuilt
378 
379  auto view = GetCanvas()->GetView();
380  auto connectivity = GetBoard()->GetConnectivity();
381 
382  PCB_GROUP* group = nullptr;
383 
384  // Undo in the reverse order of list creation: (this can allow stacked changes
385  // like the same item can be changes and deleted in the same complex command
386 
387  // Restore changes in reverse order
388  for( int ii = aList->GetCount() - 1; ii >= 0 ; ii-- )
389  {
390  EDA_ITEM* eda_item = aList->GetPickedItem( (unsigned) ii );
391 
392  /* Test for existence of item on board.
393  * It could be deleted, and no more on board:
394  * - if a call to SaveCopyInUndoList was forgotten in Pcbnew
395  * - in zones outlines, when a change in one zone merges this zone with an other
396  * This test avoids a Pcbnew crash
397  * Obviously, this test is not made for deleted items
398  */
399  UNDO_REDO status = aList->GetPickedItemStatus( ii );
400 
401  if( status != UNDO_REDO::DELETED
402  && status != UNDO_REDO::DRILLORIGIN // origin markers never on board
403  && status != UNDO_REDO::GRIDORIGIN // origin markers never on board
404  && status != UNDO_REDO::PAGESETTINGS ) // nor are page settings proxy items
405  {
406  if( !TestForExistingItem( GetBoard(), (BOARD_ITEM*) eda_item ) )
407  {
408  // Checking if it ever happens
409  wxASSERT_MSG( false, wxT( "Item in the undo buffer does not exist" ) );
410 
411  // Remove this non existent item
412  aList->RemovePicker( ii );
413  not_found = true;
414 
415  if( aList->GetCount() == 0 )
416  break;
417 
418  continue;
419  }
420  }
421 
422  // see if we must rebuild ratsnets and pointers lists
423  switch( eda_item->Type() )
424  {
425  case PCB_FOOTPRINT_T:
426  deep_reBuild_ratsnest = true; // Pointers on pads can be invalid
428 
429  case PCB_ZONE_T:
430  case PCB_TRACE_T:
431  case PCB_ARC_T:
432  case PCB_VIA_T:
433  case PCB_PAD_T:
434  reBuild_ratsnest = true;
435  break;
436 
437  case PCB_NETINFO_T:
438  reBuild_ratsnest = true;
439  deep_reBuild_ratsnest = true;
440  break;
441 
442  default:
443  break;
444  }
445 
446  switch( aList->GetPickedItemStatus( ii ) )
447  {
448  case UNDO_REDO::CHANGED: /* Exchange old and new data for each item */
449  {
450  BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
451  BOARD_ITEM* image = (BOARD_ITEM*) aList->GetPickedItemLink( ii );
452 
453  // Remove all pads/drawings/texts, as they become invalid
454  // for the VIEW after SwapData() called for footprints
455  view->Remove( item );
456  connectivity->Remove( item );
457 
458  SwapItemData( item, image );
459 
460  view->Add( item );
461  view->Hide( item, false );
462  connectivity->Add( item );
463  item->GetBoard()->OnItemChanged( item );
464  break;
465  }
466 
467  case UNDO_REDO::NEWITEM: /* new items are deleted */
469  GetModel()->Remove( (BOARD_ITEM*) eda_item );
470 
471  if( eda_item->Type() != PCB_NETINFO_T )
472  view->Remove( eda_item );
473 
474  break;
475 
476  case UNDO_REDO::DELETED: /* deleted items are put in List, as new items */
478  GetModel()->Add( (BOARD_ITEM*) eda_item );
479 
480  if( eda_item->Type() != PCB_NETINFO_T )
481  view->Add( eda_item );
482 
483  if( eda_item->Type() == PCB_GROUP_T )
484  group = static_cast<PCB_GROUP*>( eda_item );
485 
486  break;
487 
488  case UNDO_REDO::REGROUP:
490  static_cast<BOARD_ITEM*>( eda_item )->SetParentGroup( nullptr );
491  break;
492 
493  case UNDO_REDO::UNGROUP:
495 
496  if( group )
497  group->AddItem( static_cast<BOARD_ITEM*>( eda_item ) );
498 
499  break;
500 
503  {
504  BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
505  BOARD_ITEM* image = (BOARD_ITEM*) aList->GetPickedItemLink( ii );
506  VECTOR2D origin = image->GetPosition();
507  image->SetPosition( eda_item->GetPosition() );
508 
509  if( aList->GetPickedItemStatus( ii ) == UNDO_REDO::DRILLORIGIN )
510  BOARD_EDITOR_CONTROL::DoSetDrillOrigin( view, this, item, origin );
511  else
512  PCB_CONTROL::DoSetGridOrigin( view, this, item, origin );
513 
514  break;
515  }
516 
518  {
519  // swap current settings with stored settings
520  DS_PROXY_UNDO_ITEM alt_item( this );
521  DS_PROXY_UNDO_ITEM* item = static_cast<DS_PROXY_UNDO_ITEM*>( eda_item );
522  item->Restore( this );
523  *item = alt_item;
524  break;
525  }
526 
527  default:
528  wxFAIL_MSG( wxString::Format( wxT( "PutDataInPreviousState() error (unknown code %X)" ),
529  aList->GetPickedItemStatus( ii ) ) );
530  break;
531  }
532  }
533 
534  if( not_found )
535  wxMessageBox( _( "Incomplete undo/redo operation: some items not found" ) );
536 
537  // Rebuild pointers and connectivity that can be changed.
538  // connectivity can be rebuilt only in the board editor frame
539  if( IsType( FRAME_PCB_EDITOR ) && ( reBuild_ratsnest || deep_reBuild_ratsnest ) )
540  {
541  Compile_Ratsnest( false );
542  }
543 
544  PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool<PCB_SELECTION_TOOL>();
545  selTool->RebuildSelection();
546 
548 }
549 
550 
552 {
553  if( aItemCount == 0 )
554  return;
555 
556  UNDO_REDO_CONTAINER& list = whichList == UNDO_LIST ? m_undoList : m_redoList;
557  unsigned icnt = list.m_CommandsList.size();
558 
559  if( aItemCount > 0 )
560  icnt = aItemCount;
561 
562  for( unsigned ii = 0; ii < icnt; ii++ )
563  {
564  if( list.m_CommandsList.size() == 0 )
565  break;
566 
567  PICKED_ITEMS_LIST* curr_cmd = list.m_CommandsList[0];
568  list.m_CommandsList.erase( list.m_CommandsList.begin() );
569 
570  curr_cmd->ClearListAndDeleteItems();
571  delete curr_cmd; // Delete command
572  }
573 }
574 
575 
577 {
578  PICKED_ITEMS_LIST* undo = PopCommandFromUndoList();
579  PutDataInPreviousState( undo );
580 
581  undo->ClearListAndDeleteItems();
582  delete undo;
583 
584  GetCanvas()->Refresh();
585 }
iterator end() const
Definition: netinfo.h:448
void RollbackFromUndo()
Perform an undo of the last edit without logging a corresponding redo.
Definition: undo_redo.cpp:576
EDA_ITEM * GetPickedItemLink(unsigned int aIdx) const
void RestoreCopyFromUndoList(wxCommandEvent &aEvent)
Undo the last edit:
Definition: undo_redo.cpp:313
void SaveCopyInUndoList(EDA_ITEM *aItemToCopy, UNDO_REDO aTypeCommand) override
Create a new entry in undo list of commands.
Definition: undo_redo.cpp:179
ZONES & Zones()
Definition: board.h:240
static bool TestForExistingItem(BOARD *aPcb, BOARD_ITEM *aItem)
Test if aItem exists somewhere in undo/redo lists of items.
Definition: undo_redo.cpp:113
void ReversePickersListOrder()
Reverse the order of pickers stored in this list.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:49
static void DoSetDrillOrigin(KIGFX::VIEW *aView, PCB_BASE_FRAME *aFrame, EDA_ITEM *aItem, const VECTOR2D &aPoint)
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:108
GROUPS & Groups()
The groups must maintain the following invariants.
Definition: board.h:254
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:50
void Restore(EDA_DRAW_FRAME *aFrame, KIGFX::VIEW *aView=nullptr)
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:97
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:680
void PushItem(const ITEM_PICKER &aItem)
Push aItem to the top of the list.
class PAD, a pad in a footprint
Definition: typeinfo.h:89
#define KI_FALLTHROUGH
The KI_FALLTHROUGH macro is to be used when switch statement cases should purposely fallthrough from ...
Definition: macros.h:83
virtual wxPoint GetPosition() const
Definition: eda_item.h:251
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList)
Used in undo or redo command.
Definition: undo_redo.cpp:373
void SetLink(EDA_ITEM *aItem)
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
static void SwapItemData(BOARD_ITEM *aItem, BOARD_ITEM *aImage)
Definition: undo_redo.cpp:157
unsigned GetCount() const
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:205
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:115
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:83
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
PADS & Pads()
Definition: footprint.h:169
This file contains miscellaneous commonly used macros and functions.
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:499
void RebuildSelection()
Rebuild the selection from the EDA_ITEMs' selection flags.
FP_TEXT & Reference()
Definition: footprint.h:500
virtual void SwapData(BOARD_ITEM *aImage)
Swap data between aItem and aImage.
Definition: board_item.cpp:139
A holder to handle a list of undo (or redo) commands.
static void DoSetGridOrigin(KIGFX::VIEW *aView, PCB_BASE_FRAME *aFrame, EDA_ITEM *originViewItem, const VECTOR2D &aPoint)
std::vector< PICKED_ITEMS_LIST * > m_CommandsList
Container for NETINFO_ITEM elements, which are the nets.
Definition: netinfo.h:322
iterator begin() const
Definition: netinfo.h:443
FOOTPRINTS & Footprints()
Definition: board.h:234
void ClearUndoORRedoList(UNDO_REDO_LIST whichList, int aItemCount=-1) override
Free the undo or redo list from List element.
Definition: undo_redo.cpp:551
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:345
EDA_ITEM * GetPickedItem(unsigned int aIdx) const
#define _(s)
DRAWINGS & GraphicalItems()
Definition: footprint.h:172
Handle a list of polygons defining a copper zone.
Definition: zone.h:56
class ZONE, a copper pour area
Definition: typeinfo.h:105
bool RemovePicker(unsigned aIdx)
Remove one entry (one picker) from the list of picked items.
A holder to handle information on schematic or board items.
class FOOTPRINT, a footprint
Definition: typeinfo.h:88
BOARD * GetBoard()
const KIID m_Uuid
Definition: eda_item.h:474
UNDO_REDO_LIST
Specifies whether we are interacting with the undo or redo stacks.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
ITEM_PICKER GetItemWrapper(unsigned int aIdx) const
bool SetPickedItemStatus(UNDO_REDO aStatus, unsigned aIdx)
Set the type of undo/redo operation for a given picked item.
Global action (toolbar/main menu event, global shortcut)
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:191
void RestoreCopyFromRedoList(wxCommandEvent &aEvent)
Redo the last edit:
Definition: undo_redo.cpp:343
class NETINFO_ITEM, a description of a net
Definition: typeinfo.h:107
void SanitizeNetcodes()
Definition: board.cpp:1905
The selection tool: currently supports:
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:1934
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:99
bool SetPickedItemLink(EDA_ITEM *aLink, unsigned aIdx)
Set the link associated to a given picked item.
UNDO_REDO GetPickedItemStatus(unsigned int aIdx) const
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:36
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
SGLIB_API S3DMODEL * GetModel(SCENEGRAPH *aNode)
Function GetModel creates an S3DMODEL representation of aNode (raw data, no transforms)
Definition: ifsg_api.cpp:338
Definition: pad.h:57
void ClearEditFlags()
Definition: eda_item.h:171
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:136
DRAWINGS & Drawings()
Definition: board.h:237
TRACKS & Tracks()
Definition: board.h:231
void ClearListAndDeleteItems()
Delete the list of pickers AND the data pointed by #m_PickedItem or #m_PickedItemLink according to th...
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112