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