KiCad PCB EDA Suite
board_commit.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) 2016 CERN
5  * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #include <board.h>
26 #include <footprint.h>
27 #include <pcb_edit_frame.h>
28 #include <tool/tool_manager.h>
30 #include <view/view.h>
31 #include <board_commit.h>
32 #include <tools/pcb_tool_base.h>
33 #include <tools/pcb_actions.h>
35 
36 #include <functional>
37 using namespace std::placeholders;
38 
39 
41  m_resolveNetConflicts( false )
42 {
43  m_toolMgr = aTool->GetManager();
45 }
46 
47 
49  m_resolveNetConflicts( false )
50 {
51  m_toolMgr = aFrame->GetToolManager();
53 }
54 
55 
57 {
58 }
59 
60 
62 {
63  // if aItem belongs a footprint, the full footprint will be saved
64  // because undo/redo does not handle "sub items" modifications
65  if( aItem && aItem->Type() != PCB_FOOTPRINT_T && aChangeType == CHT_MODIFY )
66  {
67  EDA_ITEM* item = aItem->GetParent();
68 
69  if( item && item->Type() == PCB_FOOTPRINT_T ) // means aItem belongs a footprint
70  aItem = item;
71  }
72 
73  return COMMIT::Stage( aItem, aChangeType );
74 }
75 
76 
77 COMMIT& BOARD_COMMIT::Stage( std::vector<EDA_ITEM*>& container, CHANGE_TYPE aChangeType )
78 {
79  return COMMIT::Stage( container, aChangeType );
80 }
81 
82 
84 {
85  return COMMIT::Stage( aItems, aModFlag );
86 }
87 
88 
89 void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool aSetDirtyBit )
90 {
91  // Objects potentially interested in changes:
92  PICKED_ITEMS_LIST undoList;
93  KIGFX::VIEW* view = m_toolMgr->GetView();
94  BOARD* board = (BOARD*) m_toolMgr->GetModel();
96  auto connectivity = board->GetConnectivity();
97  std::set<EDA_ITEM*> savedModules;
99  bool itemsDeselected = false;
100 
101  std::vector<BOARD_ITEM*> bulkAddedItems;
102  std::vector<BOARD_ITEM*> bulkRemovedItems;
103  std::vector<BOARD_ITEM*> itemsChanged;
104 
105  if( Empty() )
106  return;
107 
108  for( COMMIT_LINE& ent : m_changes )
109  {
110  int changeType = ent.m_type & CHT_TYPE;
111  int changeFlags = ent.m_type & CHT_FLAGS;
112  BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( ent.m_item );
113 
114  // Module items need to be saved in the undo buffer before modification
115  if( m_isFootprintEditor )
116  {
117  // Be sure that we are storing a footprint
118  if( ent.m_item->Type() != PCB_FOOTPRINT_T )
119  ent.m_item = ent.m_item->GetParent();
120 
121  // We have not saved the footprint yet, so let's create an entry
122  if( savedModules.count( ent.m_item ) == 0 )
123  {
124  if( !ent.m_copy )
125  {
126  wxASSERT( changeType != CHT_MODIFY ); // too late to make a copy..
127  ent.m_copy = ent.m_item->Clone();
128  }
129 
130  wxASSERT( ent.m_item->Type() == PCB_FOOTPRINT_T );
131  wxASSERT( ent.m_copy->Type() == PCB_FOOTPRINT_T );
132 
133  if( aCreateUndoEntry )
134  {
135  ITEM_PICKER itemWrapper( nullptr, ent.m_item, UNDO_REDO::CHANGED );
136  itemWrapper.SetLink( ent.m_copy );
137  undoList.PushItem( itemWrapper );
138  frame->SaveCopyInUndoList( undoList, UNDO_REDO::CHANGED );
139  }
140 
141  savedModules.insert( ent.m_item );
142  static_cast<FOOTPRINT*>( ent.m_item )->SetLastEditTime();
143  }
144  }
145 
146  switch( changeType )
147  {
148  case CHT_ADD:
149  {
150  if( m_isFootprintEditor )
151  {
152  // footprints inside footprints are not supported yet
153  wxASSERT( boardItem->Type() != PCB_FOOTPRINT_T );
154 
155  boardItem->SetParent( board->Footprints().front() );
156 
157  if( !( changeFlags & CHT_DONE ) )
158  board->Footprints().front()->Add( boardItem );
159  }
160  else if( boardItem->Type() == PCB_PAD_T ||
161  boardItem->Type() == PCB_FP_TEXT_T ||
162  boardItem->Type() == PCB_FP_SHAPE_T ||
163  boardItem->Type() == PCB_FP_ZONE_T )
164  {
165  wxASSERT( boardItem->GetParent() &&
166  boardItem->GetParent()->Type() == PCB_FOOTPRINT_T );
167  }
168  else
169  {
170  if( aCreateUndoEntry )
171  undoList.PushItem( ITEM_PICKER( nullptr, boardItem, UNDO_REDO::NEWITEM ) );
172 
173  if( !( changeFlags & CHT_DONE ) )
174  {
175  board->Add( boardItem, ADD_MODE::BULK_INSERT ); // handles connectivity
176  bulkAddedItems.push_back( boardItem );
177  }
178  }
179 
180  if( boardItem->Type() != PCB_NETINFO_T )
181  view->Add( boardItem );
182 
183  break;
184  }
185 
186  case CHT_REMOVE:
187  {
188  PCB_GROUP* parentGroup = boardItem->GetParentGroup();
189 
190  if( !m_isFootprintEditor && aCreateUndoEntry )
191  undoList.PushItem( ITEM_PICKER( nullptr, boardItem, UNDO_REDO::DELETED ) );
192 
193  if( boardItem->IsSelected() )
194  {
195  selTool->RemoveItemFromSel( boardItem, true /* quiet mode */ );
196  itemsDeselected = true;
197  }
198 
199  switch( boardItem->Type() )
200  {
201  // Footprint items
202  case PCB_PAD_T:
203  case PCB_FP_SHAPE_T:
204  case PCB_FP_TEXT_T:
205  case PCB_FP_ZONE_T:
206  // This level can only handle footprint children in the footprint editor as
207  // only in that case has the entire footprint (and all its children) already
208  // been saved for undo.
209  wxASSERT( m_isFootprintEditor );
210 
211  if( boardItem->Type() == PCB_FP_TEXT_T )
212  {
213  FP_TEXT* text = static_cast<FP_TEXT*>( boardItem );
214 
215  // don't allow deletion of Reference or Value
216  if( text->GetType() != FP_TEXT::TEXT_is_DIVERS )
217  break;
218  }
219 
220  if( parentGroup && !( parentGroup->GetFlags() & STRUCT_DELETED ) )
221  parentGroup->RemoveItem( boardItem );
222 
223  view->Remove( boardItem );
224 
225  if( !( changeFlags & CHT_DONE ) )
226  {
227  FOOTPRINT* footprint = static_cast<FOOTPRINT*>( boardItem->GetParent() );
228  wxASSERT( footprint && footprint->Type() == PCB_FOOTPRINT_T );
229  footprint->Delete( boardItem );
230  }
231 
232  break;
233 
234  // Board items
235  case PCB_SHAPE_T: // a shape (normally not on copper layers)
236  case PCB_TEXT_T: // a text on a layer
237  case PCB_TRACE_T: // a track segment (segment on a copper layer)
238  case PCB_ARC_T: // an arced track segment (segment on a copper layer)
239  case PCB_VIA_T: // a via (like track segment on a copper layer)
240  case PCB_DIM_ALIGNED_T: // a dimension (graphic item)
241  case PCB_DIM_CENTER_T:
243  case PCB_DIM_LEADER_T: // a leader dimension
244  case PCB_TARGET_T: // a target (graphic item)
245  case PCB_MARKER_T: // a marker used to show something
246  case PCB_ZONE_T:
247  view->Remove( boardItem );
248 
249  if( !( changeFlags & CHT_DONE ) )
250  {
251  board->Remove( boardItem, REMOVE_MODE::BULK );
252  bulkRemovedItems.push_back( boardItem );
253  }
254 
255  break;
256 
257  case PCB_FOOTPRINT_T:
258  {
259  // No support for nested footprints (yet)
260  wxASSERT( !m_isFootprintEditor );
261 
262  FOOTPRINT* footprint = static_cast<FOOTPRINT*>( boardItem );
263  view->Remove( footprint );
264  footprint->ClearFlags();
265 
266  if( !( changeFlags & CHT_DONE ) )
267  {
268  board->Remove( footprint, REMOVE_MODE::BULK ); // handles connectivity
269  bulkRemovedItems.push_back( footprint );
270  }
271  }
272  break;
273 
274  case PCB_GROUP_T:
275  view->Remove( boardItem );
276 
277  if( !( changeFlags & CHT_DONE ) )
278  {
279  if( m_isFootprintEditor )
280  board->GetFirstFootprint()->Remove( boardItem );
281  else
282  {
283  board->Remove( boardItem, REMOVE_MODE::BULK );
284  bulkRemovedItems.push_back( boardItem );
285  }
286  }
287  break;
288 
289  // Metadata items
290  case PCB_NETINFO_T:
291  board->Remove( boardItem, REMOVE_MODE::BULK );
292  bulkRemovedItems.push_back( boardItem );
293  break;
294 
295  default: // other types do not need to (or should not) be handled
296  wxASSERT( false );
297  break;
298  }
299 
300  break;
301  }
302 
303  case CHT_MODIFY:
304  {
305  if( !m_isFootprintEditor && aCreateUndoEntry )
306  {
307  ITEM_PICKER itemWrapper( nullptr, boardItem, UNDO_REDO::CHANGED );
308  wxASSERT( ent.m_copy );
309  itemWrapper.SetLink( ent.m_copy );
310  undoList.PushItem( itemWrapper );
311  }
312 
313  if( ent.m_copy )
314  connectivity->MarkItemNetAsDirty( static_cast<BOARD_ITEM*>( ent.m_copy ) );
315 
316  connectivity->Update( boardItem );
317  view->Update( boardItem );
318 
319  if( m_isFootprintEditor )
320  {
321  static_cast<FOOTPRINT*>( boardItem )->RunOnChildren(
322  [&]( BOARD_ITEM* aChild )
323  {
324  view->Update( aChild );
325  });
326  }
327 
328  itemsChanged.push_back( boardItem );
329 
330  // if no undo entry is needed, the copy would create a memory leak
331  if( !aCreateUndoEntry )
332  delete ent.m_copy;
333 
334  break;
335  }
336 
337  default:
338  wxASSERT( false );
339  break;
340  }
341  }
342 
343  if( bulkAddedItems.size() > 0 )
344  board->FinalizeBulkAdd( bulkAddedItems );
345 
346  if( bulkRemovedItems.size() > 0 )
347  board->FinalizeBulkRemove( bulkRemovedItems );
348 
349  if( itemsChanged.size() > 0 )
350  board->OnItemsChanged( itemsChanged );
351 
352  if( !m_isFootprintEditor )
353  {
354  size_t num_changes = m_changes.size();
355 
357  connectivity->PropagateNets( this, PROPAGATE_MODE::RESOLVE_CONFLICTS );
358 
359  connectivity->RecalculateRatsnest( this );
360  connectivity->ClearDynamicRatsnest();
361  frame->GetCanvas()->RedrawRatsnest();
362 
363  if( m_changes.size() > num_changes )
364  {
365  for( size_t i = num_changes; i < m_changes.size(); ++i )
366  {
367  COMMIT_LINE& ent = m_changes[i];
368 
369  // This should only be modifications from the connectivity algo
370  wxASSERT( ( ent.m_type & CHT_TYPE ) == CHT_MODIFY );
371 
372  auto boardItem = static_cast<BOARD_ITEM*>( ent.m_item );
373 
374  if( aCreateUndoEntry )
375  {
376  ITEM_PICKER itemWrapper( nullptr, boardItem, UNDO_REDO::CHANGED );
377  wxASSERT( ent.m_copy );
378  itemWrapper.SetLink( ent.m_copy );
379  undoList.PushItem( itemWrapper );
380  }
381  else
382  {
383  delete ent.m_copy;
384  }
385 
386  view->Update( boardItem );
387  }
388  }
389  }
390 
391  if( !m_isFootprintEditor && aCreateUndoEntry )
392  frame->SaveCopyInUndoList( undoList, UNDO_REDO::UNSPECIFIED );
393 
395 
396  if( itemsDeselected )
398 
399  if( aSetDirtyBit )
400  frame->OnModify();
401  else
402  frame->Update3DView( true, frame->GetDisplayOptions().m_Live3DRefresh );
403 
404  clear();
405 }
406 
407 
409 {
410  switch( aItem->Type() )
411  {
412  case PCB_PAD_T:
413  case PCB_FP_SHAPE_T:
414  case PCB_FP_TEXT_T:
415  case PCB_FP_ZONE_T:
416  return aItem->GetParent();
417 
418  case PCB_ZONE_T:
419  wxASSERT( !dynamic_cast<FOOTPRINT*>( aItem->GetParent() ) );
420  return aItem;
421 
422  default:
423  break;
424  }
425 
426  return aItem;
427 }
428 
429 
431 {
432  PICKED_ITEMS_LIST undoList;
433  KIGFX::VIEW* view = m_toolMgr->GetView();
434  BOARD* board = (BOARD*) m_toolMgr->GetModel();
435  auto connectivity = board->GetConnectivity();
436 
437  std::vector<BOARD_ITEM*> bulkAddedItems;
438  std::vector<BOARD_ITEM*> bulkRemovedItems;
439  std::vector<BOARD_ITEM*> itemsChanged;
440 
441  for( auto it = m_changes.rbegin(); it != m_changes.rend(); ++it )
442  {
443  COMMIT_LINE& ent = *it;
444  BOARD_ITEM* item = static_cast<BOARD_ITEM*>( ent.m_item );
445  BOARD_ITEM* copy = static_cast<BOARD_ITEM*>( ent.m_copy );
446  int changeType = ent.m_type & CHT_TYPE;
447  int changeFlags = ent.m_type & CHT_FLAGS;
448 
449  switch( changeType )
450  {
451  case CHT_ADD:
452  if( !( changeFlags & CHT_DONE ) )
453  break;
454 
455  view->Remove( item );
456  connectivity->Remove( item );
457  board->Remove( item, REMOVE_MODE::BULK );
458  bulkRemovedItems.push_back( item );
459  break;
460 
461  case CHT_REMOVE:
462  if( !( changeFlags & CHT_DONE ) )
463  break;
464 
465  view->Add( item );
466  connectivity->Add( item );
467  board->Add( item, ADD_MODE::INSERT );
468  bulkAddedItems.push_back( item );
469  break;
470 
471  case CHT_MODIFY:
472  {
473  view->Remove( item );
474  connectivity->Remove( item );
475 
476  item->SwapData( copy );
477 
478  view->Add( item );
479  connectivity->Add( item );
480  board->OnItemChanged( item );
481  itemsChanged.push_back( item );
482 
483  delete copy;
484  break;
485  }
486 
487  default:
488  wxASSERT( false );
489  break;
490  }
491  }
492 
493  if( bulkAddedItems.size() > 0 )
494  board->FinalizeBulkAdd( bulkAddedItems );
495 
496  if( bulkRemovedItems.size() > 0 )
497  board->FinalizeBulkRemove( bulkRemovedItems );
498 
499  if( itemsChanged.size() > 0 )
500  board->OnItemsChanged( itemsChanged );
501 
502  if ( !m_isFootprintEditor )
503  connectivity->RecalculateRatsnest();
504 
506  selTool->RebuildSelection();
507 
508  clear();
509 }
510 
PCB_GROUP * GetParentGroup() const
Definition: board_item.h:93
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:289
virtual COMMIT & Stage(EDA_ITEM *aItem, CHANGE_TYPE aChangeType)
Definition: commit.cpp:46
class ALIGNED_DIMENSION, a linear dimension (graphic item)
Definition: typeinfo.h:100
class LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:101
void clear()
Definition: commit.h:157
class FP_TEXT, text in a footprint
Definition: typeinfo.h:92
bool IsSelected() const
Definition: eda_item.h:173
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:202
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:108
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:50
class CENTER_DIMENSION, a center point marking (graphic item)
Definition: typeinfo.h:102
Flag to indicate the change is already applied, just notify observers (not compatible with CHT_MODIFY...
Definition: commit.h:43
virtual void Revert() override
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
CHANGE_TYPE m_type
Modification type.
Definition: commit.h:153
Definition: commit.h:40
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
Definition: view.cpp:352
void Remove(BOARD_ITEM *aItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition: footprint.cpp:521
bool m_isFootprintEditor
Definition: board_commit.h:69
class PCB_TEXT, text on a layer
Definition: typeinfo.h:91
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:97
Represent a set of changes (additions, deletions or modifications) of a data model (e....
Definition: commit.h:71
void PushItem(const ITEM_PICKER &aItem)
Push aItem to the top of the list.
class FP_SHAPE, a footprint edge
Definition: typeinfo.h:93
class PAD, a pad in a footprint
Definition: typeinfo.h:89
EDA_ITEM * m_item
Main item that is added/deleted/modified.
Definition: commit.h:151
TOOL_MANAGER * m_toolMgr
Definition: board_commit.h:68
BOARD_COMMIT(EDA_DRAW_FRAME *aFrame)
The base class for create windows for drawing purpose.
virtual ~BOARD_COMMIT()
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
void SetLink(EDA_ITEM *aItem)
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
EDA_ITEM * GetModel() const
Definition: tool_manager.h:296
Clusters with conflicting drivers are not updated (default)
virtual EDA_ITEM * parentObject(EDA_ITEM *aItem) const override
void RedrawRatsnest()
Return the bounding box of the view that should be used if model is not valid.
virtual void SetParent(EDA_ITEM *aParent)
Definition: eda_item.h:166
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
void FinalizeBulkRemove(std::vector< BOARD_ITEM * > &aRemovedItems)
Must be used if Remove() is used using a BULK_x REMOVE_MODE to generate a change event for listeners.
Definition: board.cpp:659
TOOL_MANAGER * GetManager() const
Return the instance of TOOL_MANAGER that takes care of the tool.
Definition: tool_base.h:144
void RebuildSelection()
Rebuild the selection from the EDA_ITEMs' selection flags.
virtual void SwapData(BOARD_ITEM *aImage)
Swap data between aItem and aImage.
Definition: board_item.cpp:124
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Adds an item to the container.
Definition: board.cpp:563
bool m_resolveNetConflicts
Definition: board_commit.h:70
FOOTPRINT * GetFirstFootprint() const
Gets the first footprint on the board or nullptr.
Definition: board.h:382
TOOL_TYPE m_type
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:207
FOOTPRINTS & Footprints()
Definition: board.h:305
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:416
void OnItemsChanged(std::vector< BOARD_ITEM * > &aItems)
Notify the board and its listeners that an item on the board has been modified in some way.
Definition: board.cpp:2041
EDA_ITEM * GetParent() const
Definition: eda_item.h:165
bool RemoveItem(BOARD_ITEM *aItem)
Remove item from group.
Definition: pcb_group.cpp:50
class ZONE, a copper pour area
Definition: typeinfo.h:105
#define STRUCT_DELETED
flag indication structures to be erased
Definition: eda_item.h:116
A holder to handle information on schematic or board items.
Global action (toolbar/main menu event, global shortcut)
Definition: tool_event.h:151
bool Empty() const
Returns status of an item.
Definition: commit.h:140
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:104
class FOOTPRINT, a footprint
Definition: typeinfo.h:88
void FinalizeBulkAdd(std::vector< BOARD_ITEM * > &aNewItems)
Must be used if Add() is used using a BULK_x ADD_MODE to generate a change event for listeners.
Definition: board.cpp:653
TOOLS_HOLDER * GetToolHolder() const
Definition: tool_manager.h:300
CHANGE_TYPE
Types of changes.
Definition: commit.h:39
virtual void OnModify()
Must be called after a change in order to set the "modify" flag of the current screen and update the ...
class MARKER_PCB, a marker used to show something
Definition: typeinfo.h:98
bool IsType(FRAME_T aType) const
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
bool m_Live3DRefresh
If true, 3D viewer will redraw on every modification operation.
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
class NETINFO_ITEM, a description of a net
Definition: typeinfo.h:107
std::vector< COMMIT_LINE > m_changes
Definition: commit.h:179
class ZONE, managed by a footprint
Definition: typeinfo.h:94
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
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition: board.cpp:665
bool IsFootprintEditor() const
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Revert the commit by restoring the modified items state.
virtual void SaveCopyInUndoList(EDA_ITEM *aItemToCopy, UNDO_REDO aTypeCommand)=0
Create a new entry in undo list of commands.
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
Definition: eda_item.h:204
virtual void Delete(BOARD_ITEM *aItem)
Removes an item from the container and deletes it.
class ORTHOGONAL_DIMENSION, a linear dimension constrained to x/y
Definition: typeinfo.h:103
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:322
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
EDA_ITEM * m_copy
Optional copy of the item.
Definition: commit.h:152
void RemoveItemFromSel(BOARD_ITEM *aItem, bool aQuietMode=false)
Multiple item unselection event handler.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:67
STATUS_FLAGS GetFlags() const
Definition: eda_item.h:205
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:168
void PostEvent(const TOOL_EVENT &aEvent)
Put an event to the event queue to be processed at the end of event processing cycle.
Definition: tool_manager.h:267
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:90
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
Definition: view.cpp:1503
COMMIT & Stage(EDA_ITEM *aItem, CHANGE_TYPE aChangeType) override
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:163