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, jean-pierre.charras@ujf-grenoble.fr
5  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 2016 CERN
7  * Copyright (C) 2012-2021 KiCad Developers, see AUTHORS.txt for contributors.
8  * @author Maciej Suminski <maciej.suminski@cern.ch>
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  orig->SetLastEditTime();
240  }
241  else
242  {
243  continue;
244  }
245  }
246  else
247  {
248  // Normal case: all other BOARD_ITEMs, are simply copied to the new list
249  commandToUndo->PushItem( curr_picker );
250  }
251  }
252 
253  for( unsigned ii = 0; ii < commandToUndo->GetCount(); ii++ )
254  {
255  EDA_ITEM* item = aItemsList.GetPickedItem( ii );
256  UNDO_REDO command = commandToUndo->GetPickedItemStatus( ii );
257 
258  if( command == UNDO_REDO::UNSPECIFIED )
259  {
260  command = aCommandType;
261  commandToUndo->SetPickedItemStatus( command, ii );
262  }
263 
264  wxASSERT( item );
265 
266  switch( command )
267  {
268  case UNDO_REDO::CHANGED:
271 
272  /* If needed, create a copy of item, and put in undo list
273  * in the picker, as link
274  * If this link is not null, the copy is already done
275  */
276  if( commandToUndo->GetPickedItemLink( ii ) == nullptr )
277  {
278  EDA_ITEM* cloned = item->Clone();
279  commandToUndo->SetPickedItemLink( cloned, ii );
280  }
281 
282  break;
283 
284  case UNDO_REDO::NEWITEM:
285  case UNDO_REDO::DELETED:
287  case UNDO_REDO::GROUP:
288  case UNDO_REDO::UNGROUP:
289  break;
290 
291  default:
292  wxFAIL_MSG( wxString::Format( "SaveCopyInUndoList() error (unknown code %X)",
293  command ) );
294  break;
295  }
296  }
297 
298  if( commandToUndo->GetCount() )
299  {
300  /* Save the copy in undo list */
301  PushCommandToUndoList( commandToUndo );
302 
303  /* Clear redo list, because after a new command one cannot redo a command */
304  ClearUndoORRedoList( REDO_LIST );
305  }
306  else
307  {
308  // Should not occur
309  wxASSERT( false );
310  delete commandToUndo;
311  }
312 }
313 
314 
315 void PCB_BASE_EDIT_FRAME::RestoreCopyFromUndoList( wxCommandEvent& aEvent )
316 {
317  if( UndoRedoBlocked() )
318  return;
319 
320  if( GetUndoCommandCount() <= 0 )
321  return;
322 
323  // Inform tools that undo command was issued
324  m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_PRE, AS_GLOBAL } );
325 
326  // Get the old list
327  PICKED_ITEMS_LIST* list = PopCommandFromUndoList();
328 
329  // Undo the command
330  PutDataInPreviousState( list );
331 
332  // Put the old list in RedoList
333  list->ReversePickersListOrder();
334  PushCommandToRedoList( list );
335 
336  OnModify();
337 
338  m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_POST, AS_GLOBAL } );
339  m_toolManager->PostEvent( EVENTS::SelectedItemsModified );
340 
341  GetCanvas()->Refresh();
342 }
343 
344 
345 void PCB_BASE_EDIT_FRAME::RestoreCopyFromRedoList( wxCommandEvent& aEvent )
346 {
347  if( UndoRedoBlocked() )
348  return;
349 
350  if( GetRedoCommandCount() == 0 )
351  return;
352 
353  // Inform tools that redo command was issued
354  m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_PRE, AS_GLOBAL } );
355 
356  // Get the old list
357  PICKED_ITEMS_LIST* list = PopCommandFromRedoList();
358 
359  // Redo the command
360  PutDataInPreviousState( list );
361 
362  // Put the old list in UndoList
363  list->ReversePickersListOrder();
364  PushCommandToUndoList( list );
365 
366  OnModify();
367 
368  m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_POST, AS_GLOBAL } );
369  m_toolManager->PostEvent( EVENTS::SelectedItemsModified );
370 
371  GetCanvas()->Refresh();
372 }
373 
374 
376 {
377  bool not_found = false;
378  bool reBuild_ratsnest = false;
379  bool deep_reBuild_ratsnest = false; // true later if pointers must be rebuilt
380 
381  auto view = GetCanvas()->GetView();
382  auto connectivity = GetBoard()->GetConnectivity();
383 
384  PCB_GROUP* group = nullptr;
385 
386  // Undo in the reverse order of list creation: (this can allow stacked changes
387  // like the same item can be changes and deleted in the same complex command
388 
389  // Restore changes in reverse order
390  for( int ii = aList->GetCount() - 1; ii >= 0 ; ii-- )
391  {
392  EDA_ITEM* eda_item = aList->GetPickedItem( (unsigned) ii );
393 
394  /* Test for existence of item on board.
395  * It could be deleted, and no more on board:
396  * - if a call to SaveCopyInUndoList was forgotten in Pcbnew
397  * - in zones outlines, when a change in one zone merges this zone with an other
398  * This test avoids a Pcbnew crash
399  * Obviously, this test is not made for deleted items
400  */
401  UNDO_REDO status = aList->GetPickedItemStatus( ii );
402 
403  if( status != UNDO_REDO::DELETED
404  && status != UNDO_REDO::DRILLORIGIN // origin markers never on board
405  && status != UNDO_REDO::GRIDORIGIN // origin markers never on board
406  && status != UNDO_REDO::PAGESETTINGS ) // nor are page settings proxy items
407  {
408  if( !TestForExistingItem( GetBoard(), (BOARD_ITEM*) eda_item ) )
409  {
410  // Checking if it ever happens
411  wxASSERT_MSG( false, "Item in the undo buffer does not exist" );
412 
413  // Remove this non existent item
414  aList->RemovePicker( ii );
415  ii++; // the current item was removed, ii points now the next item
416  // decrement it because it will be incremented later
417  not_found = true;
418 
419  if( aList->GetCount() == 0 )
420  break;
421 
422  continue;
423  }
424  }
425 
426  // see if we must rebuild ratsnets and pointers lists
427  switch( eda_item->Type() )
428  {
429  case PCB_FOOTPRINT_T:
430  deep_reBuild_ratsnest = true; // Pointers on pads can be invalid
432 
433  case PCB_ZONE_T:
434  case PCB_TRACE_T:
435  case PCB_ARC_T:
436  case PCB_VIA_T:
437  case PCB_PAD_T:
438  reBuild_ratsnest = true;
439  break;
440 
441  case PCB_NETINFO_T:
442  reBuild_ratsnest = true;
443  deep_reBuild_ratsnest = true;
444  break;
445 
446  default:
447  break;
448  }
449 
450  switch( aList->GetPickedItemStatus( ii ) )
451  {
452  case UNDO_REDO::CHANGED: /* Exchange old and new data for each item */
453  {
454  BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
455  BOARD_ITEM* image = (BOARD_ITEM*) aList->GetPickedItemLink( ii );
456 
457  // Remove all pads/drawings/texts, as they become invalid
458  // for the VIEW after SwapData() called for footprints
459  view->Remove( item );
460  connectivity->Remove( item );
461 
462  SwapItemData( item, image );
463 
464  view->Add( item );
465  view->Hide( item, false );
466  connectivity->Add( item );
467  item->GetBoard()->OnItemChanged( item );
468  break;
469  }
470 
471  case UNDO_REDO::NEWITEM: /* new items are deleted */
473  GetModel()->Remove( (BOARD_ITEM*) eda_item );
474 
475  if( eda_item->Type() != PCB_NETINFO_T )
476  view->Remove( eda_item );
477 
478  break;
479 
480  case UNDO_REDO::DELETED: /* deleted items are put in List, as new items */
482  GetModel()->Add( (BOARD_ITEM*) eda_item );
483 
484  if( eda_item->Type() != PCB_NETINFO_T )
485  view->Add( eda_item );
486 
487  if( eda_item->Type() == PCB_GROUP_T )
488  group = static_cast<PCB_GROUP*>( eda_item );
489 
490  break;
491 
492  case UNDO_REDO::GROUP:
494  static_cast<BOARD_ITEM*>( eda_item )->SetParentGroup( nullptr );
495  break;
496 
497  case UNDO_REDO::UNGROUP:
499 
500  if( group )
501  group->AddItem( static_cast<BOARD_ITEM*>( eda_item ) );
502 
503  break;
504 
507  {
508  BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
509  BOARD_ITEM* image = (BOARD_ITEM*) aList->GetPickedItemLink( ii );
510  VECTOR2D origin = image->GetPosition();
511  image->SetPosition( eda_item->GetPosition() );
512 
513  if( aList->GetPickedItemStatus( ii ) == UNDO_REDO::DRILLORIGIN )
514  BOARD_EDITOR_CONTROL::DoSetDrillOrigin( view, this, item, origin );
515  else
516  PCB_CONTROL::DoSetGridOrigin( view, this, item, origin );
517 
518  break;
519  }
520 
522  {
523  // swap current settings with stored settings
524  DS_PROXY_UNDO_ITEM alt_item( this );
525  DS_PROXY_UNDO_ITEM* item = static_cast<DS_PROXY_UNDO_ITEM*>( eda_item );
526  item->Restore( this );
527  *item = alt_item;
528  break;
529  }
530 
531  default:
532  wxFAIL_MSG( wxString::Format( "PutDataInPreviousState() error (unknown code %X)",
533  aList->GetPickedItemStatus( ii ) ) );
534  break;
535  }
536  }
537 
538  if( not_found )
539  wxMessageBox( _( "Incomplete undo/redo operation: some items not found" ) );
540 
541  // Rebuild pointers and connectivity that can be changed.
542  // connectivity can be rebuilt only in the board editor frame
543  if( IsType( FRAME_PCB_EDITOR ) && ( reBuild_ratsnest || deep_reBuild_ratsnest ) )
544  {
545  Compile_Ratsnest( false );
546  }
547 
548  PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool<PCB_SELECTION_TOOL>();
549  selTool->RebuildSelection();
550 
552 }
553 
554 
556 {
557  if( aItemCount == 0 )
558  return;
559 
560  UNDO_REDO_CONTAINER& list = whichList == UNDO_LIST ? m_undoList : m_redoList;
561  unsigned icnt = list.m_CommandsList.size();
562 
563  if( aItemCount > 0 )
564  icnt = aItemCount;
565 
566  for( unsigned ii = 0; ii < icnt; ii++ )
567  {
568  if( list.m_CommandsList.size() == 0 )
569  break;
570 
571  PICKED_ITEMS_LIST* curr_cmd = list.m_CommandsList[0];
572  list.m_CommandsList.erase( list.m_CommandsList.begin() );
573 
574  curr_cmd->ClearListAndDeleteItems();
575  delete curr_cmd; // Delete command
576  }
577 }
578 
579 
581 {
582  PICKED_ITEMS_LIST* undo = PopCommandFromUndoList();
583  PutDataInPreviousState( undo );
584 
585  undo->ClearListAndDeleteItems();
586  delete undo;
587 
588  GetCanvas()->Refresh();
589 }
iterator end() const
Definition: netinfo.h:441
void RollbackFromUndo()
Perform an undo of the last edit without logging a corresponding redo.
Definition: undo_redo.cpp:580
EDA_ITEM * GetPickedItemLink(unsigned int aIdx) const
void RestoreCopyFromUndoList(wxCommandEvent &aEvent)
Undo the last edit:
Definition: undo_redo.cpp:315
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:239
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:80
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:253
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:684
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:252
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList)
Used in undo or redo command.
Definition: undo_redo.cpp:375
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:204
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:116
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:159
This file contains miscellaneous commonly used macros and functions.
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:457
void RebuildSelection()
Rebuild the selection from the EDA_ITEMs' selection flags.
FP_TEXT & Reference()
Definition: footprint.h:458
virtual void SwapData(BOARD_ITEM *aImage)
Swap data between aItem and aImage.
Definition: board_item.cpp:138
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:315
iterator begin() const
Definition: netinfo.h:436
FOOTPRINTS & Footprints()
Definition: board.h:233
void ClearUndoORRedoList(UNDO_REDO_LIST whichList, int aItemCount=-1) override
Free the undo or redo list from List element.
Definition: undo_redo.cpp:555
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:51
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:344
EDA_ITEM * GetPickedItem(unsigned int aIdx) const
#define _(s)
DRAWINGS & GraphicalItems()
Definition: footprint.h:162
Handle a list of polygons defining a copper zone.
Definition: zone.h:57
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:475
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:190
void SetLastEditTime(timestamp_t aTime)
Definition: footprint.h:325
void RestoreCopyFromRedoList(wxCommandEvent &aEvent)
Redo the last edit:
Definition: undo_redo.cpp:345
class NETINFO_ITEM, a description of a net
Definition: typeinfo.h:107
void SanitizeNetcodes()
Definition: board.cpp:1979
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:2008
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
bool SetPickedItemLink(EDA_ITEM *aLink, unsigned aIdx)
Set the link associated to a given picked item.
UNDO_REDO GetPickedItemStatus(unsigned int aIdx) const
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:336
Definition: pad.h:57
void ClearEditFlags()
Definition: eda_item.h:172
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:166
DRAWINGS & Drawings()
Definition: board.h:236
TRACKS & Tracks()
Definition: board.h:230
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:113