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-2016 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 <fctsys.h>
31 #include <class_drawpanel.h>
32 #include <class_draw_panel_gal.h>
33 #include <macros.h>
34 
35 #include <pcbnew.h>
36 #include <wxPcbStruct.h>
37 
38 #include <class_board.h>
39 #include <class_track.h>
40 #include <class_drawsegment.h>
41 #include <class_pcb_text.h>
42 #include <class_pcb_target.h>
43 #include <class_module.h>
44 #include <class_dimension.h>
45 #include <class_zone.h>
46 #include <class_edge_mod.h>
47 
48 #include <connectivity_data.h>
49 
50 #include <tools/selection_tool.h>
51 #include <tool/tool_manager.h>
52 
53 #include <view/view.h>
54 
55 /* Functions to undo and redo edit commands.
56  * commands to undo are stored in CurrentScreen->m_UndoList
57  * commands to redo are stored in CurrentScreen->m_RedoList
58  *
59  * m_UndoList and m_RedoList handle a std::vector of PICKED_ITEMS_LIST
60  * Each PICKED_ITEMS_LIST handle a std::vector of pickers (class ITEM_PICKER),
61  * that store the list of schematic items that are concerned by the command to undo or redo
62  * and is created for each command to undo (handle also a command to redo).
63  * each picker has a pointer pointing to an item to undo or redo (in fact: deleted, added or
64  * modified),
65  * and has a pointer to a copy of this item, when this item has been modified
66  * (the old values of parameters are therefore saved)
67  *
68  * there are 3 cases:
69  * - delete item(s) command
70  * - change item(s) command
71  * - add item(s) command
72  * and 3 cases for block:
73  * - move list of items
74  * - mirror (Y) list of items
75  * - Flip list of items
76  *
77  * Undo command
78  * - delete item(s) command:
79  * => deleted items are moved in undo list
80  *
81  * - change item(s) command
82  * => A copy of item(s) is made (a DrawPickedStruct list of wrappers)
83  * the .m_Link member of each wrapper points the modified item.
84  * the .m_Item member of each wrapper points the old copy of this item.
85  *
86  * - add item(s) command
87  * =>A list of item(s) is made. The .m_Item member of each wrapper points the new item.
88  *
89  * Redo command
90  * - delete item(s) old command:
91  * => deleted items are moved in EEDrawList list, and in
92  *
93  * - change item(s) command
94  * => the copy of item(s) is moved in Undo list
95  *
96  * - add item(s) command
97  * => The list of item(s) is used to create a deleted list in undo list(same as a delete
98  * command)
99  *
100  * Some block operations that change items can be undone without memorize items, just the
101  * coordinates of the transform:
102  * move list of items (undo/redo is made by moving with the opposite move vector)
103  * mirror (Y) and flip list of items (undo/redo is made by mirror or flip items)
104  * so they are handled specifically.
105  *
106  */
107 
108 
125 static bool TestForExistingItem( BOARD* aPcb, BOARD_ITEM* aItem )
126 {
127  static std::list<BOARD_ITEM*> itemsList;
128 
129  if( aItem == NULL ) // Build list
130  {
131  // Count items to store in itemsList:
132  BOARD_ITEM* item;
133  itemsList.clear();
134 
135  // Store items in list:
136  // Append tracks:
137  for( item = aPcb->m_Track; item != NULL; item = item->Next() )
138  itemsList.push_back( item );
139 
140  // Append modules:
141  for( item = aPcb->m_Modules; item != NULL; item = item->Next() )
142  itemsList.push_back( item );
143 
144  // Append drawings
145  for( auto ditem : aPcb->Drawings() )
146  itemsList.push_back( ditem );
147 
148  // Append zones outlines
149  for( int ii = 0; ii < aPcb->GetAreaCount(); ii++ )
150  itemsList.push_back( aPcb->GetArea( ii ) );
151 
152  // Append zones segm:
153  for( item = aPcb->m_Zone; item != NULL; item = item->Next() )
154  itemsList.push_back( item );
155 
156  NETINFO_LIST& netInfo = aPcb->GetNetInfo();
157 
158  for( NETINFO_LIST::iterator i = netInfo.begin(); i != netInfo.end(); ++i )
159  itemsList.push_back( *i );
160 
161  // Sort list
162  itemsList.sort();
163 
164  return false;
165  }
166 
167  // search in list:
168  return std::binary_search( itemsList.begin(), itemsList.end(), aItem );
169 }
170 
171 static void SwapItemData( BOARD_ITEM* aItem, BOARD_ITEM* aImage )
172 {
173  if( aImage == NULL )
174  return;
175 
176  wxASSERT( aItem->Type() == aImage->Type() );
177 
178  // Remark: to create images of edited items to undo, we are using Clone method
179  // which can duplication of items foe copy, but does not clone all members
180  // mainly pointers in chain and time stamp, which is set to new, unique value.
181  // So we have to use the current values of these parameters.
182 
183  EDA_ITEM* pnext = aItem->Next();
184  EDA_ITEM* pback = aItem->Back();
185  DHEAD* mylist = aItem->GetList();
186  time_t timestamp = aItem->GetTimeStamp();
187  EDA_ITEM* parent = aItem->GetParent();
188 
189  aItem->SwapData( aImage );
190 
191  // Restore pointers and time stamp, to be sure they are not broken
192  aItem->SetNext( pnext );
193  aItem->SetBack( pback );
194  aItem->SetList( mylist );
195  aItem->SetTimeStamp( timestamp );
196  aItem->SetParent( parent );
197 }
198 
200  const wxPoint& aTransformPoint )
201 {
202  PICKED_ITEMS_LIST commandToUndo;
203  commandToUndo.PushItem( ITEM_PICKER( aItem, aCommandType ) );
204  SaveCopyInUndoList( commandToUndo, aCommandType, aTransformPoint );
205 }
206 
207 
209  UNDO_REDO_T aTypeCommand, const wxPoint& aTransformPoint )
210 {
211  PICKED_ITEMS_LIST* commandToUndo = new PICKED_ITEMS_LIST();
212 
213  commandToUndo->m_TransformPoint = aTransformPoint;
214 
215  // First, filter unnecessary stuff from the list (i.e. for multiple pads / labels modified),
216  // take the first occurence of the module (we save copies of modules when one of its subitems
217  // is changed).
218  for( unsigned ii = 0; ii < aItemsList.GetCount(); ii++ )
219  {
220  ITEM_PICKER curr_picker = aItemsList.GetItemWrapper(ii);
221  BOARD_ITEM* item = (BOARD_ITEM*) aItemsList.GetPickedItem( ii );
222 
223  // For items belonging to modules, we need to save state of the parent module
224  if( item->Type() == PCB_MODULE_TEXT_T || item->Type() == PCB_MODULE_EDGE_T
225  || item->Type() == PCB_PAD_T )
226  {
227  // Item to be stored in the undo buffer is the parent module
228  item = item->GetParent();
229  wxASSERT( item && item->Type() == PCB_MODULE_T );
230 
231  if( item == NULL )
232  continue;
233 
234  // Check if the parent module has already been saved in another entry
235  bool found = false;
236 
237  for( unsigned j = 0; j < commandToUndo->GetCount(); j++ )
238  {
239  if( commandToUndo->GetPickedItem( j ) == item && commandToUndo->GetPickedItemStatus( j ) == UR_CHANGED )
240  {
241  found = true;
242  break;
243  }
244  }
245 
246  if( !found )
247  {
248  // Create a clean copy of the parent module
249  MODULE* orig = static_cast<MODULE*>( item );
250  MODULE* clone = new MODULE( *orig );
251  clone->SetParent( GetBoard() );
252 
253  // Clear current flags (which can be temporary set by a current edit command)
254  for( EDA_ITEM* loc_item = clone->GraphicalItemsList(); loc_item;
255  loc_item = loc_item->Next() )
256  loc_item->ClearFlags();
257 
258  for( D_PAD* pad = clone->PadsList(); pad; pad = pad->Next() )
259  pad->ClearFlags();
260 
261  clone->Reference().ClearFlags();
262  clone->Value().ClearFlags();
263 
264  ITEM_PICKER picker( item, UR_CHANGED );
265  picker.SetLink( clone );
266  commandToUndo->PushItem( picker );
267 
268  orig->SetLastEditTime();
269  }
270  else
271  {
272  continue;
273  }
274  }
275  else
276  {
277  // Normal case: all other BOARD_ITEMs, are simply copied to the new list
278  commandToUndo->PushItem( curr_picker );
279  }
280  }
281 
282  for( unsigned ii = 0; ii < commandToUndo->GetCount(); ii++ )
283  {
284  BOARD_ITEM* item = (BOARD_ITEM*) commandToUndo->GetPickedItem( ii );
285  UNDO_REDO_T command = commandToUndo->GetPickedItemStatus( ii );
286 
287  if( command == UR_UNSPECIFIED )
288  {
289  command = aTypeCommand;
290  commandToUndo->SetPickedItemStatus( command, ii );
291  }
292 
293  wxASSERT( item );
294 
295  switch( command )
296  {
297  case UR_CHANGED:
298 
299  /* If needed, create a copy of item, and put in undo list
300  * in the picker, as link
301  * If this link is not null, the copy is already done
302  */
303  if( commandToUndo->GetPickedItemLink( ii ) == NULL )
304  {
305  EDA_ITEM* cloned = item->Clone();
306  commandToUndo->SetPickedItemLink( cloned, ii );
307  }
308  break;
309 
310  case UR_MOVED:
311  case UR_ROTATED:
313  case UR_FLIPPED:
314  case UR_NEW:
315  case UR_DELETED:
316  break;
317 
318  default:
319  {
320  wxString msg;
321  msg.Printf( wxT( "SaveCopyInUndoList() error (unknown code %X)" ), command );
322  wxMessageBox( msg );
323  }
324  break;
325 
326  }
327  }
328 
329  if( commandToUndo->GetCount() )
330  {
331  /* Save the copy in undo list */
332  GetScreen()->PushCommandToUndoList( commandToUndo );
333 
334  /* Clear redo list, because after a new command one cannot redo a command */
335  GetScreen()->ClearUndoORRedoList( GetScreen()->m_RedoList );
336  }
337  else
338  {
339  // Should not occur
340  wxASSERT( false );
341  delete commandToUndo;
342  }
343 }
344 
345 
346 void PCB_BASE_EDIT_FRAME::RestoreCopyFromUndoList( wxCommandEvent& aEvent )
347 {
348  if( UndoRedoBlocked() )
349  return;
350 
351  if( GetScreen()->GetUndoCommandCount() <= 0 )
352  return;
353 
354  // Inform tools that undo command was issued
355  m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_PRE, AS_GLOBAL } );
356 
357  // Get the old list
358  PICKED_ITEMS_LIST* List = GetScreen()->PopCommandFromUndoList();
359 
360  // Undo the command
361  PutDataInPreviousState( List, false );
362 
363  // Put the old list in RedoList
364  List->ReversePickersListOrder();
365  GetScreen()->PushCommandToRedoList( List );
366 
367  OnModify();
368 
369  m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_POST, AS_GLOBAL } );
370 
371  m_canvas->Refresh();
372 }
373 
374 
375 void PCB_BASE_EDIT_FRAME::RestoreCopyFromRedoList( wxCommandEvent& aEvent )
376 {
377  if( UndoRedoBlocked() )
378  return;
379 
380  if( GetScreen()->GetRedoCommandCount() == 0 )
381  return;
382 
383  // Inform tools that redo command was issued
384  m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_PRE, AS_GLOBAL } );
385 
386  // Get the old list
387  PICKED_ITEMS_LIST* List = GetScreen()->PopCommandFromRedoList();
388 
389  // Redo the command
390  PutDataInPreviousState( List, true );
391 
392  // Put the old list in UndoList
393  List->ReversePickersListOrder();
394  GetScreen()->PushCommandToUndoList( List );
395 
396  OnModify();
397 
398  m_toolManager->ProcessEvent( { TC_MESSAGE, TA_UNDO_REDO_POST, AS_GLOBAL } );
399 
400  m_canvas->Refresh();
401 }
402 
403 
405  bool aRebuildRatsnet )
406 {
407  BOARD_ITEM* item;
408  bool not_found = false;
409  bool reBuild_ratsnest = false;
410  bool deep_reBuild_ratsnest = false; // true later if pointers must be rebuilt
411 
412  auto view = GetGalCanvas()->GetView();
413  auto connectivity = GetBoard()->GetConnectivity();
414 
415  // Undo in the reverse order of list creation: (this can allow stacked changes
416  // like the same item can be changes and deleted in the same complex command
417 
418  bool build_item_list = true; // if true the list of existing items must be rebuilt
419 
420  // Restore changes in reverse order
421  for( int ii = aList->GetCount() - 1; ii >= 0 ; ii-- )
422  {
423  item = (BOARD_ITEM*) aList->GetPickedItem( ii );
424  wxASSERT( item );
425 
426  /* Test for existence of item on board.
427  * It could be deleted, and no more on board:
428  * - if a call to SaveCopyInUndoList was forgotten in Pcbnew
429  * - in zones outlines, when a change in one zone merges this zone with an other
430  * This test avoids a Pcbnew crash
431  * Obviously, this test is not made for deleted items
432  */
433  UNDO_REDO_T status = aList->GetPickedItemStatus( ii );
434 
435  if( status != UR_DELETED )
436  {
437  if( build_item_list )
438  // Build list of existing items, for integrity test
439  TestForExistingItem( GetBoard(), NULL );
440 
441  build_item_list = false;
442 
443  if( !TestForExistingItem( GetBoard(), item ) )
444  {
445  // Checking if it ever happens
446  wxASSERT_MSG( false, "Item in the undo buffer does not exist" );
447 
448  // Remove this non existent item
449  aList->RemovePicker( ii );
450  ii++; // the current item was removed, ii points now the next item
451  // decrement it because it will be incremented later
452  not_found = true;
453  continue;
454  }
455  }
456 
457  item->ClearFlags();
458 
459  // see if we must rebuild ratsnets and pointers lists
460  switch( item->Type() )
461  {
462  case PCB_MODULE_T:
463  deep_reBuild_ratsnest = true; // Pointers on pads can be invalid
464  // Fall through
465  case PCB_ZONE_AREA_T:
466  case PCB_TRACE_T:
467  case PCB_VIA_T:
468  reBuild_ratsnest = true;
469  break;
470 
471  case PCB_NETINFO_T:
472  reBuild_ratsnest = true;
473  deep_reBuild_ratsnest = true;
474  break;
475 
476  default:
477  break;
478  }
479 
480  // It is possible that we are going to replace the selected item, so clear it
481  SetCurItem( NULL );
482 
483  switch( aList->GetPickedItemStatus( ii ) )
484  {
485  case UR_CHANGED: /* Exchange old and new data for each item */
486  {
487  BOARD_ITEM* image = (BOARD_ITEM*) aList->GetPickedItemLink( ii );
488 
489  // Remove all pads/drawings/texts, as they become invalid
490  // for the VIEW after SwapData() called for modules
491  view->Remove( item );
492  connectivity->Remove( item );
493 
494  SwapItemData( item, image );
495 
496  // Update all pads/drawings/texts, as they become invalid
497  // for the VIEW after SwapData() called for modules
498  if( item->Type() == PCB_MODULE_T )
499  {
500  MODULE* newModule = static_cast<MODULE*>( item );
501  newModule->RunOnChildren( std::bind( &BOARD_ITEM::ClearFlags, _1, EDA_ITEM_ALL_FLAGS ));
502  }
503 
504  view->Add( item );
505  connectivity->Add( item );
506  item->ClearFlags();
507 
508  }
509  break;
510 
511  case UR_NEW: /* new items are deleted */
512  aList->SetPickedItemStatus( UR_DELETED, ii );
513  GetModel()->Remove( item );
514  view->Remove( item );
515  break;
516 
517  case UR_DELETED: /* deleted items are put in List, as new items */
518  aList->SetPickedItemStatus( UR_NEW, ii );
519  GetModel()->Add( item );
520  view->Add( item );
521  build_item_list = true;
522  break;
523 
524  case UR_MOVED:
525  item->Move( aRedoCommand ? aList->m_TransformPoint : -aList->m_TransformPoint );
526  view->Update( item, KIGFX::GEOMETRY );
527  connectivity->Update( item );
528  break;
529 
530  case UR_ROTATED:
531  item->Rotate( aList->m_TransformPoint,
532  aRedoCommand ? m_rotationAngle : -m_rotationAngle );
533  view->Update( item, KIGFX::GEOMETRY );
534  connectivity->Update( item );
535  break;
536 
538  item->Rotate( aList->m_TransformPoint,
539  aRedoCommand ? -m_rotationAngle : m_rotationAngle );
540  view->Update( item, KIGFX::GEOMETRY );
541  connectivity->Update( item );
542  break;
543 
544  case UR_FLIPPED:
545  item->Flip( aList->m_TransformPoint );
546  view->Update( item, KIGFX::LAYERS );
547  connectivity->Update( item );
548  break;
549 
550  default:
551  {
552  wxString msg;
553  msg.Printf( wxT( "PutDataInPreviousState() error (unknown code %X)" ),
554  aList->GetPickedItemStatus( ii ) );
555  wxMessageBox( msg );
556  }
557  break;
558  }
559  }
560 
561  if( not_found )
562  wxMessageBox( wxT( "Incomplete undo/redo operation: some items not found" ) );
563 
564  // Rebuild pointers and connectivity that can be changed.
565  // connectivity can be rebuilt only in the board editor frame
566  if( IsType( FRAME_PCB ) && ( reBuild_ratsnest || deep_reBuild_ratsnest ) )
567  {
568  Compile_Ratsnest( NULL, false );
569  }
570 }
571 
572 
573 
574 
576 {
577  if( aItemCount == 0 )
578  return;
579 
580  unsigned icnt = aList.m_CommandsList.size();
581 
582  if( aItemCount > 0 )
583  icnt = aItemCount;
584 
585  for( unsigned ii = 0; ii < icnt; ii++ )
586  {
587  if( aList.m_CommandsList.size() == 0 )
588  break;
589 
590  PICKED_ITEMS_LIST* curr_cmd = aList.m_CommandsList[0];
591  aList.m_CommandsList.erase( aList.m_CommandsList.begin() );
592 
593  curr_cmd->ClearListAndDeleteItems();
594  delete curr_cmd; // Delete command
595  }
596 }
DHEAD * GetList() const
Definition: base_struct.h:223
KICAD_T Type() const
Function Type()
Definition: base_struct.h:212
Wrapper class, so you can iterate through NETINFO_ITEM*s, not std::pair
void RestoreCopyFromUndoList(wxCommandEvent &aEvent)
Function RestoreCopyFromUndoList Undo the last edition:
Definition: undo_redo.cpp:346
BOARD_ITEM_CONTAINER * GetParent() const
void RunOnChildren(std::function< void(BOARD_ITEM *)> aFunction)
Function RunOnChildren.
TEXTE_MODULE & Reference()
Definition: class_module.h:483
TEXTE_PCB class definition.
static bool TestForExistingItem(BOARD *aPcb, BOARD_ITEM *aItem)
Function TestForExistingItem test if aItem exists somewhere in lists of items This is a function used...
Definition: undo_redo.cpp:125
void SetBack(EDA_ITEM *aBack)
Definition: base_struct.h:226
Class DHEAD is only for use by template class DLIST, use that instead.
Definition: dlist.h:40
void ReversePickersListOrder()
Function ReversePickersListOrder reverses the order of pickers stored in this list.
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
virtual EDA_ITEM * Clone() const
Function Clone creates a duplicate of this item with linked list members set to NULL.
Class BOARD to handle a board.
class ZONE_CONTAINER, a zone area
Definition: typeinfo.h:102
Classes to handle copper zones.
DLIST< SEGZONE > m_Zone
Definition: class_board.h:247
void PushItem(const ITEM_PICKER &aItem)
Function PushItem pushes aItem to the top of the list.
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
void SetList(DHEAD *aList)
Definition: base_struct.h:228
void SetLastEditTime(time_t aTime)
Definition: class_module.h:302
void SetLink(EDA_ITEM *aItem)
#define EDA_ITEM_ALL_FLAGS
Definition: base_struct.h:156
UNDO_REDO_T GetPickedItemStatus(unsigned int aIdx) const
Function GetPickedItemStatus.
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
static void SwapItemData(BOARD_ITEM *aItem, BOARD_ITEM *aImage)
Definition: undo_redo.cpp:171
EDA_ITEM * GetPickedItemLink(unsigned int aIdx) const
Function GetPickedItemLink.
void SetTimeStamp(time_t aNewTimeStamp)
Definition: base_struct.h:217
Functions relatives to tracks, vias and segments used to fill zones.
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
This file contains miscellaneous commonly used macros and functions.
BOARD_ITEM * Next() const
DIMENSION class definition.
virtual void SwapData(BOARD_ITEM *aImage)
Swap data between aItem and aImage.
UNDO_REDO_T
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
Class UNDO_REDO_CONTAINER is a holder to handle alist of undo (or redo) command.
class MODULE, a footprint
Definition: typeinfo.h:89
void PutDataInPreviousState(PICKED_ITEMS_LIST *aList, bool aRedoCommand, bool aRebuildRatsnet=true)
Function PutDataInPreviousState Used in undo or redo command.
Definition: undo_redo.cpp:404
std::vector< PICKED_ITEMS_LIST * > m_CommandsList
void SetParent(EDA_ITEM *aParent)
Definition: base_struct.h:227
Class NETINFO_LIST is a container class for NETINFO_ITEM elements, which are the nets.
virtual void Move(const wxPoint &aMoveVector)
Function Move move this object.
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:482
D_PAD * Next() const
Definition: class_pad.h:160
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:1011
virtual void Rotate(const wxPoint &aRotCentre, double aAngle)
Function Rotate Rotate this object.
bool RemovePicker(unsigned aIdx)
Function RemovePicker removes one entry (one picker) from the list of picked items.
Class PICKED_ITEMS_LIST is a holder to handle information on schematic or board items.
void SaveCopyInUndoList(BOARD_ITEM *aItemToCopy, UNDO_REDO_T aTypeCommand, const wxPoint &aTransformPoint=wxPoint(0, 0)) override
Function SaveCopyInUndoList Creates a new entry in undo list of commands.
Definition: undo_redo.cpp:199
All active tools
Definition: tool_event.h:138
NETINFO_LIST & GetNetInfo()
Definition: class_board.h:743
time_t GetTimeStamp() const
Definition: base_struct.h:218
unsigned GetCount() const
Function GetCount.
BOARD * GetBoard()
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
virtual void Flip(const wxPoint &aCentre)
Function Flip Flip this object, i.e.
iterator begin() const
void SetNext(EDA_ITEM *aNext)
Definition: base_struct.h:225
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:982
bool SetPickedItemStatus(UNDO_REDO_T aStatus, unsigned aIdx)
Function SetPickedItemStatus sets the type of undo/redo operation for a given picked item...
Class to handle a graphic segment.
EDA_ITEM * GetPickedItem(unsigned int aIdx) const
Function GetPickedItem.
iterator end() const
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:169
DLIST< MODULE > m_Modules
Definition: class_board.h:245
void RestoreCopyFromRedoList(wxCommandEvent &aEvent)
Function RestoreCopyFromRedoList Redo the last edition:
Definition: undo_redo.cpp:375
class NETINFO_ITEM, a description of a net
Definition: typeinfo.h:104
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:165
bool SetPickedItemLink(EDA_ITEM *aLink, unsigned aIdx)
Function SetPickedItemLink set the link associated to a given picked item.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: base_struct.h:268
Position or shape has changed.
Definition: view_item.h:58
PCB_TARGET class definition.
DLIST< BOARD_ITEM > & GraphicalItemsList()
Definition: class_module.h:157
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
DLIST< D_PAD > & PadsList()
Definition: class_module.h:154
DLIST< TRACK > m_Track
Definition: class_board.h:246
Module description (excepted pads)
SGLIB_API S3DMODEL * GetModel(SCENEGRAPH *aNode)
Function GetModel creates an S3DMODEL representation of aNode (raw data, no transforms) ...
Definition: ifsg_api.cpp:471
EDGE_MODULE class definition.
void ClearUndoORRedoList(UNDO_REDO_CONTAINER &aList, int aItemCount=-1) override
Function ClearUndoORRedoList free the undo or redo list from List element Wrappers are deleted...
Definition: undo_redo.cpp:575
ITEM_PICKER GetItemWrapper(unsigned int aIdx) const
Function GetItemWrapper.
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Function GetConnectivity() returns list of missing connections between components/tracks.
Definition: class_board.h:290
BOARD_ITEM * Back() const
void ClearListAndDeleteItems()
Function ClearListAndDeleteItems deletes the list of pickers, AND the data pointed by m_PickedItem or...
DLIST_ITERATOR_WRAPPER< BOARD_ITEM > Drawings()
Definition: class_board.h:251
Color has changed.
Definition: view_item.h:57