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  * @author Maciej Suminski <maciej.suminski@cern.ch>
8  * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
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 <track.h>
34 #include <pcb_target.h>
35 #include <footprint.h>
36 #include <dimension.h>
37 #include <origin_viewitem.h>
39 #include <pcbnew_settings.h>
40 #include <tool/tool_manager.h>
41 #include <tool/actions.h>
43 #include <tools/pcb_control.h>
46 
47 /* Functions to undo and redo edit commands.
48  * commands to undo are stored in CurrentScreen->m_UndoList
49  * commands to redo are stored in CurrentScreen->m_RedoList
50  *
51  * m_UndoList and m_RedoList handle a std::vector of PICKED_ITEMS_LIST
52  * Each PICKED_ITEMS_LIST handle a std::vector of pickers (class ITEM_PICKER),
53  * that store the list of schematic items that are concerned by the command to undo or redo
54  * and is created for each command to undo (handle also a command to redo).
55  * each picker has a pointer pointing to an item to undo or redo (in fact: deleted, added or
56  * modified),
57  * and has a pointer to a copy of this item, when this item has been modified
58  * (the old values of parameters are therefore saved)
59  *
60  * there are 3 cases:
61  * - delete item(s) command
62  * - change item(s) command
63  * - add item(s) command
64  *
65  * Undo command
66  * - delete item(s) command:
67  * => deleted items are moved in undo list
68  *
69  * - change item(s) command
70  * => A copy of item(s) is made (a DrawPickedStruct list of wrappers)
71  * the .m_Link member of each wrapper points the modified item.
72  * the .m_Item member of each wrapper points the old copy of this item.
73  *
74  * - add item(s) command
75  * =>A list of item(s) is made. The .m_Item member of each wrapper points the new item.
76  *
77  * Redo command
78  * - delete item(s) old command:
79  * => deleted items are moved in EEDrawList list, and in
80  *
81  * - change item(s) command
82  * => the copy of item(s) is moved in Undo list
83  *
84  * - add item(s) command
85  * => The list of item(s) is used to create a deleted list in undo list(same as a delete
86  * command)
87  *
88  * Some block operations that change items can be undone without memorize items, just the
89  * coordinates of the transform:
90  * move list of items (undo/redo is made by moving with the opposite move vector)
91  * mirror (Y) and flip list of items (undo/redo is made by mirror or flip items)
92  * so they are handled specifically.
93  *
94  */
95 
96 
111 static bool TestForExistingItem( BOARD* aPcb, BOARD_ITEM* aItem )
112 {
113  for( TRACK* item : aPcb->Tracks() )
114  {
115  if( aItem == static_cast<BOARD_ITEM*>( item ) )
116  return true;
117  }
118 
119  for( FOOTPRINT* item : aPcb->Footprints() )
120  {
121  if( aItem == static_cast<BOARD_ITEM*>( item ) )
122  return true;
123  }
124 
125  for( BOARD_ITEM* item : aPcb->Drawings() )
126  {
127  if( aItem == static_cast<BOARD_ITEM*>( item ) )
128  return true;
129  }
130 
131  for( ZONE* item : aPcb->Zones() )
132  {
133  if( aItem == static_cast<BOARD_ITEM*>( item ) )
134  return true;
135  }
136 
137  NETINFO_LIST& netInfo = aPcb->GetNetInfo();
138 
139  for( NETINFO_LIST::iterator i = netInfo.begin(); i != netInfo.end(); ++i )
140  {
141  if( aItem == static_cast<BOARD_ITEM*>( *i ) )
142  return true;
143  }
144 
145  for( PCB_GROUP* item : aPcb->Groups() )
146  {
147  if( aItem == static_cast<BOARD_ITEM*>( item ) )
148  return true;
149  }
150 
151  return false;
152 }
153 
154 
155 static void SwapItemData( BOARD_ITEM* aItem, BOARD_ITEM* aImage )
156 {
157  if( aImage == NULL )
158  return;
159 
160  wxASSERT( aItem->Type() == aImage->Type() );
161 
162  // Remark: to create images of edited items to undo, we are using Clone method
163  // which does not do a deep copy.
164  // So we have to use the current values of these parameters.
165 
166  wxASSERT( aItem->m_Uuid == aImage->m_Uuid );
167 
168  EDA_ITEM* parent = aItem->GetParent();
169 
170  aItem->SwapData( aImage );
171 
172  // Restore pointers to be sure they are not broken
173  aItem->SetParent( parent );
174 }
175 
176 
178 {
179  PICKED_ITEMS_LIST commandToUndo;
180  commandToUndo.PushItem( ITEM_PICKER( nullptr, aItem, aCommandType ) );
181  SaveCopyInUndoList( commandToUndo, aCommandType );
182 }
183 
184 
186  UNDO_REDO aCommandType )
187 {
188  PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST();
189 
190  // First, filter unnecessary stuff from the list (i.e. for multiple pads / labels modified),
191  // take the first occurence of the footprint (we save copies of footprints when one of its
192  // subitems is changed).
193  for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ )
194  {
195  ITEM_PICKER curr_picker = aItemsList.GetItemWrapper(ii);
196  BOARD_ITEM* item = dynamic_cast<BOARD_ITEM*>( aItemsList.GetPickedItem( ii ) );
197 
198  // For items belonging to footprints, we need to save state of the parent footprint
199  if( item && item->GetParent() && item->GetParent()->Type() == PCB_FOOTPRINT_T )
200  {
201  item = item->GetParent();
202 
203  // Check if the parent footprint has already been saved in another entry
204  bool found = false;
205 
206  for( unsigned j = 0; j < commandToUndo->GetCount(); j++ )
207  {
208  if( commandToUndo->GetPickedItem( j ) == item
209  && commandToUndo->GetPickedItemStatus( j ) == UNDO_REDO::CHANGED )
210  {
211  found = true;
212  break;
213  }
214  }
215 
216  if( !found )
217  {
218  // Create a clean copy of the parent footprint
219  FOOTPRINT* orig = static_cast<FOOTPRINT*>( item );
220  FOOTPRINT* clone = new FOOTPRINT( *orig );
221  clone->SetParent( GetBoard() );
222 
223  // Clear current flags (which can be temporary set by a current edit command)
224  for( auto child : clone->GraphicalItems() )
225  child->ClearEditFlags();
226 
227  for( auto pad : clone->Pads() )
228  pad->ClearEditFlags();
229 
230  clone->Reference().ClearEditFlags();
231  clone->Value().ClearEditFlags();
232 
233  ITEM_PICKER picker( nullptr, item, UNDO_REDO::CHANGED );
234  picker.SetLink( clone );
235  commandToUndo->PushItem( picker );
236 
237  orig->SetLastEditTime();
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 ) == NULL )
275  {
276  EDA_ITEM* cloned = item->Clone();
277  commandToUndo->SetPickedItemLink( cloned, ii );
278  }
279  break;
280 
281  case UNDO_REDO::NEWITEM:
282  case UNDO_REDO::DELETED:
284  case UNDO_REDO::GROUP:
285  case UNDO_REDO::UNGROUP:
286  break;
287 
288  default:
289  {
290  wxFAIL_MSG( wxString::Format( "SaveCopyInUndoList() error (unknown code %X)",
291  command ) );
292  }
293  break;
294 
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 
340  GetCanvas()->Refresh();
341 }
342 
343 
344 void PCB_BASE_EDIT_FRAME::RestoreCopyFromRedoList( wxCommandEvent& aEvent )
345 {
346  if( UndoRedoBlocked() )
347  return;
348 
349  if( GetRedoCommandCount() == 0 )
350  return;
351 
352  // Inform tools that redo command was issued
353  m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_PRE, AS_GLOBAL } );
354 
355  // Get the old list
356  PICKED_ITEMS_LIST* list = PopCommandFromRedoList();
357 
358  // Redo the command
359  PutDataInPreviousState( list );
360 
361  // Put the old list in UndoList
362  list->ReversePickersListOrder();
363  PushCommandToUndoList( list );
364 
365  OnModify();
366 
367  m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_POST, AS_GLOBAL } );
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, "Item in the undo buffer does not exist" );
410 
411  // Remove this non existent item
412  aList->RemovePicker( ii );
413  ii++; // the current item was removed, ii points now the next item
414  // decrement it because it will be incremented later
415  not_found = true;
416 
417  if( aList->GetCount() == 0 )
418  break;
419 
420  continue;
421  }
422  }
423 
424  // see if we must rebuild ratsnets and pointers lists
425  switch( eda_item->Type() )
426  {
427  case PCB_FOOTPRINT_T:
428  deep_reBuild_ratsnest = true; // Pointers on pads can be invalid
430 
431  case PCB_ZONE_T:
432  case PCB_TRACE_T:
433  case PCB_ARC_T:
434  case PCB_VIA_T:
435  case PCB_PAD_T:
436  reBuild_ratsnest = true;
437  break;
438 
439  case PCB_NETINFO_T:
440  reBuild_ratsnest = true;
441  deep_reBuild_ratsnest = true;
442  break;
443 
444  default:
445  break;
446  }
447 
448  switch( aList->GetPickedItemStatus( ii ) )
449  {
450  case UNDO_REDO::CHANGED: /* Exchange old and new data for each item */
451  {
452  BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
453  BOARD_ITEM* image = (BOARD_ITEM*) aList->GetPickedItemLink( ii );
454 
455  // Remove all pads/drawings/texts, as they become invalid
456  // for the VIEW after SwapData() called for footprints
457  view->Remove( item );
458  connectivity->Remove( item );
459 
460  SwapItemData( item, image );
461 
462  view->Add( item );
463  view->Hide( item, false );
464  connectivity->Add( item );
465  item->GetBoard()->OnItemChanged( item );
466  }
467  break;
468 
469  case UNDO_REDO::NEWITEM: /* new items are deleted */
471  GetModel()->Remove( (BOARD_ITEM*) eda_item );
472 
473  if( eda_item->Type() != PCB_NETINFO_T )
474  view->Remove( eda_item );
475 
476  break;
477 
478  case UNDO_REDO::DELETED: /* deleted items are put in List, as new items */
480  GetModel()->Add( (BOARD_ITEM*) eda_item );
481 
482  if( eda_item->Type() != PCB_NETINFO_T )
483  view->Add( eda_item );
484 
485  if( eda_item->Type() == PCB_GROUP_T )
486  group = static_cast<PCB_GROUP*>( eda_item );
487 
488  break;
489 
490  case UNDO_REDO::GROUP:
492  static_cast<BOARD_ITEM*>( eda_item )->SetParentGroup( nullptr );
493  break;
494 
495  case UNDO_REDO::UNGROUP:
497 
498  if( group )
499  group->AddItem( static_cast<BOARD_ITEM*>( eda_item ) );
500 
501  break;
502 
505  {
506  BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
507  BOARD_ITEM* image = (BOARD_ITEM*) aList->GetPickedItemLink( ii );
508  VECTOR2D origin = image->GetPosition();
509  image->SetPosition( eda_item->GetPosition() );
510 
511  if( aList->GetPickedItemStatus( ii ) == UNDO_REDO::DRILLORIGIN )
512  BOARD_EDITOR_CONTROL::DoSetDrillOrigin( view, this, item, origin );
513  else
514  PCB_CONTROL::DoSetGridOrigin( view, this, item, origin );
515  }
516  break;
517 
519  {
520  // swap current settings with stored settings
521  DS_PROXY_UNDO_ITEM alt_item( this );
522  DS_PROXY_UNDO_ITEM* item = static_cast<DS_PROXY_UNDO_ITEM*>( eda_item );
523  item->Restore( this );
524  *item = alt_item;
525  }
526  break;
527 
528  default:
529  wxFAIL_MSG( wxString::Format( "PutDataInPreviousState() error (unknown code %X)",
530  aList->GetPickedItemStatus( ii ) ) );
531  break;
532  }
533  }
534 
535  if( not_found )
536  wxMessageBox( _( "Incomplete undo/redo operation: some items not found" ) );
537 
538  // Rebuild pointers and connectivity that can be changed.
539  // connectivity can be rebuilt only in the board editor frame
540  if( IsType( FRAME_PCB_EDITOR ) && ( reBuild_ratsnest || deep_reBuild_ratsnest ) )
541  {
542  Compile_Ratsnest( false );
543  }
544 
545  PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool<PCB_SELECTION_TOOL>();
546  selTool->RebuildSelection();
547 
549 }
550 
551 
553 {
554  if( aItemCount == 0 )
555  return;
556 
557  UNDO_REDO_CONTAINER& list = whichList == UNDO_LIST ? m_undoList : m_redoList;
558  unsigned icnt = list.m_CommandsList.size();
559 
560  if( aItemCount > 0 )
561  icnt = aItemCount;
562 
563  for( unsigned ii = 0; ii < icnt; ii++ )
564  {
565  if( list.m_CommandsList.size() == 0 )
566  break;
567 
568  PICKED_ITEMS_LIST* curr_cmd = list.m_CommandsList[0];
569  list.m_CommandsList.erase( list.m_CommandsList.begin() );
570 
571  curr_cmd->ClearListAndDeleteItems();
572  delete curr_cmd; // Delete command
573  }
574 }
575 
576 
578 {
579  PICKED_ITEMS_LIST* undo = PopCommandFromUndoList();
580  PutDataInPreviousState( undo );
581 
582  undo->ClearListAndDeleteItems();
583  delete undo;
584 
585  GetCanvas()->Refresh();
586 }
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:577
EDA_ITEM * GetPickedItemLink(unsigned int aIdx) const
void RestoreCopyFromUndoList(wxCommandEvent &aEvent)
Undo the last edit:
Definition: undo_redo.cpp:315
bool AddItem(BOARD_ITEM *aItem)
Add item to group.
Definition: pcb_group.cpp:38
void SaveCopyInUndoList(EDA_ITEM *aItemToCopy, UNDO_REDO aTypeCommand) override
Create a new entry in undo list of commands.
Definition: undo_redo.cpp:177
ZONES & Zones()
Definition: board.h:302
static bool TestForExistingItem(BOARD *aPcb, BOARD_ITEM *aItem)
Function TestForExistingItem Test if aItem exists somewhere in undo/redo lists of items.
Definition: undo_redo.cpp:111
void ReversePickersListOrder()
Reverse the order of pickers stored in this list.
virtual void SetPosition(const wxPoint &aPos)
Definition: eda_item.h:302
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
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:316
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 ARC, an arc track segment on a copper layer
Definition: typeinfo.h:97
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:745
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:301
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:155
unsigned GetCount() const
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:165
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:97
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
PADS & Pads()
Definition: footprint.h:164
This file contains miscellaneous commonly used macros and functions.
FP_TEXT & Value()
read/write accessors:
Definition: footprint.h:459
void RebuildSelection()
Rebuild the selection from the EDA_ITEMs' selection flags.
FP_TEXT & Reference()
Definition: footprint.h:460
virtual void SwapData(BOARD_ITEM *aImage)
Swap data between aItem and aImage.
Definition: board_item.cpp:124
A holder to handle a list of undo (or redo) commands.
#define NULL
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:296
void ClearUndoORRedoList(UNDO_REDO_LIST whichList, int aItemCount=-1) override
Free the undo or redo list from List element.
Definition: undo_redo.cpp:552
virtual BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:46
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:407
EDA_ITEM * GetPickedItem(unsigned int aIdx) const
DRAWINGS & GraphicalItems()
Definition: footprint.h:167
ZONE handles 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.
Global action (toolbar/main menu event, global shortcut)
Definition: tool_event.h:151
class FOOTPRINT, a footprint
Definition: typeinfo.h:88
BOARD * GetBoard()
const KIID m_Uuid
Definition: eda_item.h:524
UNDO_REDO_LIST
Remove the aItemCount of old commands from aList and delete commands, pickers and picked items if nee...
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.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:189
#define _(s)
Definition: 3d_actions.cpp:33
void SetLastEditTime(timestamp_t aTime)
Definition: footprint.h:327
void RestoreCopyFromRedoList(wxCommandEvent &aEvent)
Redo the last edit:
Definition: undo_redo.cpp:344
class NETINFO_ITEM, a description of a net
Definition: typeinfo.h:107
void SanitizeNetcodes()
Definition: board.cpp:1943
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:1972
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:149
bool SetPickedItemLink(EDA_ITEM *aLink, unsigned aIdx)
Set the link associated to a given picked item.
UNDO_REDO GetPickedItemStatus(unsigned int aIdx) const
class 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
void ClearEditFlags()
Definition: eda_item.h:221
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:168
DRAWINGS & Drawings()
Definition: board.h:299
TRACKS & Tracks()
Definition: board.h:293
Definition: track.h:83
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:162