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 {
42  m_toolMgr = aTool->GetManager();
43  m_isFootprintEditor = aTool->IsFootprintEditor();
44 }
45 
46 
48 {
49  m_toolMgr = aFrame->GetToolManager();
50  m_isFootprintEditor = aFrame->IsType( FRAME_FOOTPRINT_EDITOR );
51 }
52 
53 
55 {
56 }
57 
58 
60 {
61  // if aItem belongs a footprint, the full footprint will be saved
62  // because undo/redo does not handle "sub items" modifications
63  if( aItem && aItem->Type() != PCB_FOOTPRINT_T && aChangeType == CHT_MODIFY )
64  {
65  EDA_ITEM* item = aItem->GetParent();
66 
67  if( item && item->Type() == PCB_FOOTPRINT_T ) // means aItem belongs a footprint
68  aItem = item;
69  }
70 
71  return COMMIT::Stage( aItem, aChangeType );
72 }
73 
74 
75 COMMIT& BOARD_COMMIT::Stage( std::vector<EDA_ITEM*>& container, CHANGE_TYPE aChangeType )
76 {
77  return COMMIT::Stage( container, aChangeType );
78 }
79 
80 
82 {
83  return COMMIT::Stage( aItems, aModFlag );
84 }
85 
86 
87 void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool aSetDirtyBit )
88 {
89  // Objects potentially interested in changes:
90  PICKED_ITEMS_LIST undoList;
91  KIGFX::VIEW* view = m_toolMgr->GetView();
92  BOARD* board = (BOARD*) m_toolMgr->GetModel();
93  PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) m_toolMgr->GetToolHolder();
94  auto connectivity = board->GetConnectivity();
95  std::set<EDA_ITEM*> savedModules;
96  PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
97  bool itemsDeselected = false;
98 
99  std::vector<BOARD_ITEM*> bulkAddedItems;
100  std::vector<BOARD_ITEM*> bulkRemovedItems;
101  std::vector<BOARD_ITEM*> itemsChanged;
102 
103  if( Empty() )
104  return;
105 
106  for( COMMIT_LINE& ent : m_changes )
107  {
108  int changeType = ent.m_type & CHT_TYPE;
109  int changeFlags = ent.m_type & CHT_FLAGS;
110  BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( ent.m_item );
111 
112  // Module items need to be saved in the undo buffer before modification
113  if( m_isFootprintEditor )
114  {
115  // Be sure that we are storing a footprint
116  if( ent.m_item->Type() != PCB_FOOTPRINT_T )
117  ent.m_item = ent.m_item->GetParent();
118 
119  // We have not saved the footprint yet, so let's create an entry
120  if( savedModules.count( ent.m_item ) == 0 )
121  {
122  if( !ent.m_copy )
123  {
124  wxASSERT( changeType != CHT_MODIFY ); // too late to make a copy..
125  ent.m_copy = ent.m_item->Clone();
126  }
127 
128  wxASSERT( ent.m_item->Type() == PCB_FOOTPRINT_T );
129  wxASSERT( ent.m_copy->Type() == PCB_FOOTPRINT_T );
130 
131  if( aCreateUndoEntry )
132  {
133  ITEM_PICKER itemWrapper( nullptr, ent.m_item, UNDO_REDO::CHANGED );
134  itemWrapper.SetLink( ent.m_copy );
135  undoList.PushItem( itemWrapper );
136  frame->SaveCopyInUndoList( undoList, UNDO_REDO::CHANGED );
137  }
138 
139  savedModules.insert( ent.m_item );
140  static_cast<FOOTPRINT*>( ent.m_item )->SetLastEditTime();
141  }
142  }
143 
144  switch( changeType )
145  {
146  case CHT_ADD:
147  {
148  if( m_isFootprintEditor )
149  {
150  // footprints inside footprints are not supported yet
151  wxASSERT( boardItem->Type() != PCB_FOOTPRINT_T );
152 
153  boardItem->SetParent( board->Footprints().front() );
154 
155  if( !( changeFlags & CHT_DONE ) )
156  board->Footprints().front()->Add( boardItem );
157  }
158  else if( boardItem->Type() == PCB_FP_TEXT_T ||
159  boardItem->Type() == PCB_FP_SHAPE_T ||
160  boardItem->Type() == PCB_FP_ZONE_T )
161  {
162  wxASSERT( boardItem->GetParent() &&
163  boardItem->GetParent()->Type() == PCB_FOOTPRINT_T );
164  }
165  else
166  {
167  if( aCreateUndoEntry )
168  undoList.PushItem( ITEM_PICKER( nullptr, boardItem, UNDO_REDO::NEWITEM ) );
169 
170  if( !( changeFlags & CHT_DONE ) )
171  {
172  board->Add( boardItem, ADD_MODE::BULK_INSERT ); // handles connectivity
173  bulkAddedItems.push_back( boardItem );
174  }
175  }
176 
177  if( boardItem->Type() != PCB_NETINFO_T )
178  view->Add( boardItem );
179 
180  break;
181  }
182 
183  case CHT_REMOVE:
184  {
185  PCB_GROUP* parentGroup = boardItem->GetParentGroup();
186 
187  if( !m_isFootprintEditor && aCreateUndoEntry )
188  undoList.PushItem( ITEM_PICKER( nullptr, boardItem, UNDO_REDO::DELETED ) );
189 
190  if( boardItem->IsSelected() )
191  {
192  selTool->RemoveItemFromSel( boardItem, true /* quiet mode */ );
193  itemsDeselected = true;
194  }
195 
196  switch( boardItem->Type() )
197  {
198  // Footprint items
199  case PCB_PAD_T:
200  case PCB_FP_SHAPE_T:
201  case PCB_FP_TEXT_T:
202  case PCB_FP_ZONE_T:
203  // This level can only handle footprint children in the footprint editor as
204  // only in that case has the entire footprint (and all its children) already
205  // been saved for undo.
206  wxASSERT( m_isFootprintEditor );
207 
208  if( boardItem->Type() == PCB_FP_TEXT_T )
209  {
210  FP_TEXT* text = static_cast<FP_TEXT*>( boardItem );
211 
212  // don't allow deletion of Reference or Value
213  if( text->GetType() != FP_TEXT::TEXT_is_DIVERS )
214  break;
215  }
216 
217  if( parentGroup && !( parentGroup->GetFlags() & STRUCT_DELETED ) )
218  parentGroup->RemoveItem( boardItem );
219 
220  view->Remove( boardItem );
221 
222  if( !( changeFlags & CHT_DONE ) )
223  {
224  FOOTPRINT* footprint = static_cast<FOOTPRINT*>( boardItem->GetParent() );
225  wxASSERT( footprint && footprint->Type() == PCB_FOOTPRINT_T );
226  footprint->Delete( boardItem );
227  }
228 
229  break;
230 
231  // Board items
232  case PCB_SHAPE_T: // a shape (normally not on copper layers)
233  case PCB_TEXT_T: // a text on a layer
234  case PCB_TRACE_T: // a track segment (segment on a copper layer)
235  case PCB_ARC_T: // an arced track segment (segment on a copper layer)
236  case PCB_VIA_T: // a via (like track segment on a copper layer)
237  case PCB_DIM_ALIGNED_T: // a dimension (graphic item)
238  case PCB_DIM_CENTER_T:
240  case PCB_DIM_LEADER_T: // a leader dimension
241  case PCB_TARGET_T: // a target (graphic item)
242  case PCB_MARKER_T: // a marker used to show something
243  case PCB_ZONE_T:
244  view->Remove( boardItem );
245 
246  if( !( changeFlags & CHT_DONE ) )
247  {
248  board->Remove( boardItem, REMOVE_MODE::BULK );
249  bulkRemovedItems.push_back( boardItem );
250  }
251 
252  break;
253 
254  case PCB_FOOTPRINT_T:
255  {
256  // No support for nested footprints (yet)
257  wxASSERT( !m_isFootprintEditor );
258 
259  FOOTPRINT* footprint = static_cast<FOOTPRINT*>( boardItem );
260  view->Remove( footprint );
261  footprint->ClearFlags();
262 
263  if( !( changeFlags & CHT_DONE ) )
264  {
265  board->Remove( footprint, REMOVE_MODE::BULK ); // handles connectivity
266  bulkRemovedItems.push_back( footprint );
267  }
268  }
269  break;
270 
271  case PCB_GROUP_T:
272  view->Remove( boardItem );
273 
274  if( !( changeFlags & CHT_DONE ) )
275  {
276  if( m_isFootprintEditor )
277  board->GetFirstFootprint()->Remove( boardItem );
278  else
279  {
280  board->Remove( boardItem, REMOVE_MODE::BULK );
281  bulkRemovedItems.push_back( boardItem );
282  }
283  }
284  break;
285 
286  // Metadata items
287  case PCB_NETINFO_T:
288  board->Remove( boardItem, REMOVE_MODE::BULK );
289  bulkRemovedItems.push_back( boardItem );
290  break;
291 
292  default: // other types do not need to (or should not) be handled
293  wxASSERT( false );
294  break;
295  }
296 
297  break;
298  }
299 
300  case CHT_MODIFY:
301  {
302  if( !m_isFootprintEditor && aCreateUndoEntry )
303  {
304  ITEM_PICKER itemWrapper( nullptr, boardItem, UNDO_REDO::CHANGED );
305  wxASSERT( ent.m_copy );
306  itemWrapper.SetLink( ent.m_copy );
307  undoList.PushItem( itemWrapper );
308  }
309 
310  if( ent.m_copy )
311  connectivity->MarkItemNetAsDirty( static_cast<BOARD_ITEM*>( ent.m_copy ) );
312 
313  connectivity->Update( boardItem );
314  view->Update( boardItem );
315 
316  if( m_isFootprintEditor )
317  {
318  static_cast<FOOTPRINT*>( boardItem )->RunOnChildren(
319  [&]( BOARD_ITEM* aChild )
320  {
321  view->Update( aChild );
322  });
323  }
324 
325  itemsChanged.push_back( boardItem );
326 
327  // if no undo entry is needed, the copy would create a memory leak
328  if( !aCreateUndoEntry )
329  delete ent.m_copy;
330 
331  break;
332  }
333 
334  default:
335  wxASSERT( false );
336  break;
337  }
338  }
339 
340  if( bulkAddedItems.size() > 0 )
341  board->FinalizeBulkAdd( bulkAddedItems );
342 
343  if( bulkRemovedItems.size() > 0 )
344  board->FinalizeBulkRemove( bulkRemovedItems );
345 
346  if( itemsChanged.size() > 0 )
347  board->OnItemsChanged( itemsChanged );
348 
349  if( !m_isFootprintEditor )
350  {
351  size_t num_changes = m_changes.size();
352 
353  connectivity->RecalculateRatsnest( this );
354  connectivity->ClearDynamicRatsnest();
355  frame->GetCanvas()->RedrawRatsnest();
356 
357  if( m_changes.size() > num_changes )
358  {
359  for( size_t i = num_changes; i < m_changes.size(); ++i )
360  {
361  COMMIT_LINE& ent = m_changes[i];
362 
363  // This should only be modifications from the connectivity algo
364  wxASSERT( ( ent.m_type & CHT_TYPE ) == CHT_MODIFY );
365 
366  auto boardItem = static_cast<BOARD_ITEM*>( ent.m_item );
367 
368  if( aCreateUndoEntry )
369  {
370  ITEM_PICKER itemWrapper( nullptr, boardItem, UNDO_REDO::CHANGED );
371  wxASSERT( ent.m_copy );
372  itemWrapper.SetLink( ent.m_copy );
373  undoList.PushItem( itemWrapper );
374  }
375  else
376  {
377  delete ent.m_copy;
378  }
379 
380  view->Update( boardItem );
381  }
382  }
383  }
384 
385  if( !m_isFootprintEditor && aCreateUndoEntry )
386  frame->SaveCopyInUndoList( undoList, UNDO_REDO::UNSPECIFIED );
387 
388  m_toolMgr->PostEvent( { TC_MESSAGE, TA_MODEL_CHANGE, AS_GLOBAL } );
389 
390  if( itemsDeselected )
391  m_toolMgr->PostEvent( EVENTS::UnselectedEvent );
392 
393  if( aSetDirtyBit )
394  frame->OnModify();
395  else
396  frame->Update3DView( true );
397 
398  clear();
399 }
400 
401 
403 {
404  switch( aItem->Type() )
405  {
406  case PCB_PAD_T:
407  case PCB_FP_SHAPE_T:
408  case PCB_FP_TEXT_T:
409  case PCB_FP_ZONE_T:
410  return aItem->GetParent();
411 
412  case PCB_ZONE_T:
413  wxASSERT( !dynamic_cast<FOOTPRINT*>( aItem->GetParent() ) );
414  return aItem;
415 
416  default:
417  break;
418  }
419 
420  return aItem;
421 }
422 
423 
425 {
426  PICKED_ITEMS_LIST undoList;
427  KIGFX::VIEW* view = m_toolMgr->GetView();
428  BOARD* board = (BOARD*) m_toolMgr->GetModel();
429  auto connectivity = board->GetConnectivity();
430 
431  std::vector<BOARD_ITEM*> bulkAddedItems;
432  std::vector<BOARD_ITEM*> bulkRemovedItems;
433  std::vector<BOARD_ITEM*> itemsChanged;
434 
435  for( auto it = m_changes.rbegin(); it != m_changes.rend(); ++it )
436  {
437  COMMIT_LINE& ent = *it;
438  BOARD_ITEM* item = static_cast<BOARD_ITEM*>( ent.m_item );
439  BOARD_ITEM* copy = static_cast<BOARD_ITEM*>( ent.m_copy );
440  int changeType = ent.m_type & CHT_TYPE;
441  int changeFlags = ent.m_type & CHT_FLAGS;
442 
443  switch( changeType )
444  {
445  case CHT_ADD:
446  if( !( changeFlags & CHT_DONE ) )
447  break;
448 
449  view->Remove( item );
450  connectivity->Remove( item );
451  board->Remove( item, REMOVE_MODE::BULK );
452  bulkRemovedItems.push_back( item );
453  break;
454 
455  case CHT_REMOVE:
456  if( !( changeFlags & CHT_DONE ) )
457  break;
458 
459  view->Add( item );
460  connectivity->Add( item );
461  board->Add( item, ADD_MODE::INSERT );
462  bulkAddedItems.push_back( item );
463  break;
464 
465  case CHT_MODIFY:
466  {
467  view->Remove( item );
468  connectivity->Remove( item );
469 
470  item->SwapData( copy );
471 
472  view->Add( item );
473  connectivity->Add( item );
474  board->OnItemChanged( item );
475  itemsChanged.push_back( item );
476 
477  delete copy;
478  break;
479  }
480 
481  default:
482  wxASSERT( false );
483  break;
484  }
485  }
486 
487  if( bulkAddedItems.size() > 0 )
488  board->FinalizeBulkAdd( bulkAddedItems );
489 
490  if( bulkRemovedItems.size() > 0 )
491  board->FinalizeBulkRemove( bulkRemovedItems );
492 
493  if( itemsChanged.size() > 0 )
494  board->OnItemsChanged( itemsChanged );
495 
496  if ( !m_isFootprintEditor )
497  connectivity->RecalculateRatsnest();
498 
499  PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
500  selTool->RebuildSelection();
501 
502  clear();
503 }
504 
PCB_GROUP * GetParentGroup() const
Definition: board_item.h:93
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
class FP_TEXT, text in a footprint
Definition: typeinfo.h:92
bool IsSelected() const
Definition: eda_item.h:172
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:210
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
virtual void Update3DView(bool aReloadRequest, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
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:351
void Remove(BOARD_ITEM *aItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
Definition: footprint.cpp:520
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
BOARD_COMMIT(EDA_DRAW_FRAME *aFrame)
The base class for create windows for drawing purpose.
virtual ~BOARD_COMMIT()
void SetLink(EDA_ITEM *aItem)
UNDO_REDO
Undo Redo considerations: Basically we have 3 cases New item Deleted item Modified item there is also...
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:165
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
FOOTPRINT * GetFirstFootprint() const
Gets the first footprint on the board or nullptr.
Definition: board.h:380
TOOL_TYPE m_type
Unique identifier for the tool, assigned by a TOOL_MANAGER instance.
Definition: tool_base.h:207
TEXT_TYPE GetType() const
Definition: fp_text.h:141
FOOTPRINTS & Footprints()
Definition: board.h:303
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:414
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:1978
EDA_ITEM * GetParent() const
Definition: eda_item.h:164
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:115
A holder to handle information on schematic or board items.
Global action (toolbar/main menu event, global shortcut)
Definition: tool_event.h:151
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
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
class NETINFO_ITEM, a description of a net
Definition: typeinfo.h:107
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:1972
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:149
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:203
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:321
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:204
BOARD_ITEM_CONTAINER * GetParent() const
Definition: board_item.h:168
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:1508
COMMIT & Stage(EDA_ITEM *aItem, CHANGE_TYPE aChangeType) override
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:162