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  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  }
469  break;
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 
521  {
522  // swap current settings with stored settings
523  DS_PROXY_UNDO_ITEM alt_item( this );
524  DS_PROXY_UNDO_ITEM* item = static_cast<DS_PROXY_UNDO_ITEM*>( eda_item );
525  item->Restore( this );
526  *item = alt_item;
527  }
528  break;
529 
530  default:
531  wxFAIL_MSG( wxString::Format( "PutDataInPreviousState() error (unknown code %X)",
532  aList->GetPickedItemStatus( ii ) ) );
533  break;
534  }
535  }
536 
537  if( not_found )
538  wxMessageBox( _( "Incomplete undo/redo operation: some items not found" ) );
539 
540  // Rebuild pointers and connectivity that can be changed.
541  // connectivity can be rebuilt only in the board editor frame
542  if( IsType( FRAME_PCB_EDITOR ) && ( reBuild_ratsnest || deep_reBuild_ratsnest ) )
543  {
544  Compile_Ratsnest( false );
545  }
546 
547  PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool<PCB_SELECTION_TOOL>();
548  selTool->RebuildSelection();
549 
551 }
552 
553 
555 {
556  if( aItemCount == 0 )
557  return;
558 
559  UNDO_REDO_CONTAINER& list = whichList == UNDO_LIST ? m_undoList : m_redoList;
560  unsigned icnt = list.m_CommandsList.size();
561 
562  if( aItemCount > 0 )
563  icnt = aItemCount;
564 
565  for( unsigned ii = 0; ii < icnt; ii++ )
566  {
567  if( list.m_CommandsList.size() == 0 )
568  break;
569 
570  PICKED_ITEMS_LIST* curr_cmd = list.m_CommandsList[0];
571  list.m_CommandsList.erase( list.m_CommandsList.begin() );
572 
573  curr_cmd->ClearListAndDeleteItems();
574  delete curr_cmd; // Delete command
575  }
576 }
577 
578 
580 {
581  PICKED_ITEMS_LIST* undo = PopCommandFromUndoList();
582  PutDataInPreviousState( undo );
583 
584  undo->ClearListAndDeleteItems();
585  delete undo;
586 
587  GetCanvas()->Refresh();
588 }
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:579
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:177
ZONES & Zones()
Definition: board.h:311
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.
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:325
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:754
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:302
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:155
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:206
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:166
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
Definition: eda_item.cpp:81
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:462
void RebuildSelection()
Rebuild the selection from the EDA_ITEMs' selection flags.
FP_TEXT & Reference()
Definition: footprint.h:463
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:305
void ClearUndoORRedoList(UNDO_REDO_LIST whichList, int aItemCount=-1) override
Free the undo or redo list from List element.
Definition: undo_redo.cpp:554
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:416
EDA_ITEM * GetPickedItem(unsigned int aIdx) const
DRAWINGS & GraphicalItems()
Definition: footprint.h:167
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.
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:525
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:190
#define _(s)
Definition: 3d_actions.cpp:33
void SetLastEditTime(timestamp_t aTime)
Definition: footprint.h:330
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:2006
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:2035
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:150
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:222
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:168
DRAWINGS & Drawings()
Definition: board.h:308
TRACKS & Tracks()
Definition: board.h:302
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:163