KiCad PCB EDA Suite
gerbview_selection_tool.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) 2017 Jon Evans <jon@craftyjon.com>
5  * Copyright (C) 2017-2019 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #include <limits>
22 #include <functional>
23 using namespace std::placeholders;
24 
25 #include <eda_item.h>
26 #include <bitmaps.h>
27 #include <gerber_collectors.h>
28 #include <class_draw_panel_gal.h>
29 #include <kicad_string.h>
30 #include <view/view.h>
31 #include <view/view_controls.h>
32 #include <view/view_group.h>
33 #include <painter.h>
34 #include <bitmaps.h>
35 #include <tool/tool_event.h>
36 #include <tool/tool_manager.h>
39 #include <gerbview_id.h>
40 #include <gerbview_painter.h>
42 #include "gerbview_actions.h"
43 
44 
46 {
47 public:
49  ACTION_MENU( true )
50  {
51  SetIcon( net_highlight_schematic_xpm );
52  SetTitle( _( "Highlight" ) );
53  }
54 
55 private:
56 
57  void update() override
58  {
59  bool addSeparator = false;
60 
61  Clear();
62 
63  const auto& selection = getToolManager()->GetTool<GERBVIEW_SELECTION_TOOL>()->GetSelection();
64 
65  if( selection.Size() == 1 )
66  {
67  auto item = static_cast<GERBER_DRAW_ITEM*>( selection[0] );
68  const auto& net_attr = item->GetNetAttributes();
69 
70  if( ( net_attr.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_PAD ) ||
71  ( net_attr.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_CMP ) )
72  {
73  auto menuEntry = Add( GERBVIEW_ACTIONS::highlightComponent );
74  menuEntry->SetItemLabel( wxString::Format( _( "Highlight Items of Component \"%s\"" ),
75  net_attr.m_Cmpref ) );
76  addSeparator = true;
77  }
78 
79  if( ( net_attr.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_NET ) )
80  {
81  auto menuEntry = Add( GERBVIEW_ACTIONS::highlightNet );
82  menuEntry->SetItemLabel( wxString::Format( _( "Highlight Items of Net \"%s\"" ),
83  UnescapeString( net_attr.m_Netname ) ) );
84  addSeparator = true;
85  }
86 
87  D_CODE* apertDescr = item->GetDcodeDescr();
88 
89  if( apertDescr && !apertDescr->m_AperFunction.IsEmpty() )
90  {
91  auto menuEntry = Add( GERBVIEW_ACTIONS::highlightAttribute );
92  menuEntry->SetItemLabel( wxString::Format( _( "Highlight Aperture Type \"%s\"" ),
93  apertDescr->m_AperFunction ) );
94  addSeparator = true;
95  }
96  }
97 
98  if( addSeparator )
99  AppendSeparator();
100 
102  }
103 
104  ACTION_MENU* create() const override
105  {
106  return new HIGHLIGHT_MENU();
107  }
108 };
109 
110 
112  TOOL_INTERACTIVE( "gerbview.InteractiveSelection" ),
113  m_frame( NULL ),
114  m_additive( false ),
115  m_subtractive( false ),
116  m_exclusive_or( false )
117 {
118  m_preliminary = true;
119 }
120 
121 
123 {
124  ACTION_MENU* actionMenu = aEvent.Parameter<ACTION_MENU*>();
125  CONDITIONAL_MENU* conditionalMenu = dynamic_cast<CONDITIONAL_MENU*>( actionMenu );
126 
127  if( conditionalMenu )
128  conditionalMenu->Evaluate( m_selection );
129 
130  if( actionMenu )
131  actionMenu->UpdateAll();
132 
133  return 0;
134 }
135 
136 
138 {
139  getView()->Remove( &m_selection );
140 }
141 
142 
144 {
145  auto selectMenu = std::make_shared<HIGHLIGHT_MENU>();
146  selectMenu->SetTool( this );
147  m_menu.AddSubMenu( selectMenu );
148 
149  auto& menu = m_menu.GetMenu();
150 
151  menu.AddMenu( selectMenu.get() );
152  menu.AddSeparator( 1000 );
153 
154  getEditFrame<GERBVIEW_FRAME>()->AddStandardSubMenus( m_menu );
155 
156  return true;
157 }
158 
159 
161 {
162  m_frame = getEditFrame<GERBVIEW_FRAME>();
163  m_preliminary = true;
164 
165  if( aReason == TOOL_BASE::MODEL_RELOAD )
166  {
167  // Remove pointers to the selected items from containers
168  // without changing their properties (as they are already deleted
169  // while a new file is loaded)
170  m_selection.Clear();
171  getView()->GetPainter()->GetSettings()->SetHighlight( false );
172  }
173  else
174  // Restore previous properties of selected items and remove them from containers
175  clearSelection();
176 
177  // Reinsert the VIEW_GROUP, in case it was removed from the VIEW
178  getView()->Remove( &m_selection );
179  getView()->Add( &m_selection );
180 }
181 
182 
184 {
185  // Main loop: keep receiving events
186  while( TOOL_EVENT* evt = Wait() )
187  {
188  if( m_frame->ToolStackIsEmpty() )
190 
192 
193  if( evt->Modifier( MD_SHIFT ) && evt->Modifier( MD_CTRL ) )
194  m_subtractive = true;
195  else if( evt->Modifier( MD_SHIFT ) )
196  m_additive = true;
197  else if( evt->Modifier( MD_CTRL ) )
198  m_exclusive_or = true;
199 
200  // single click? Select single object
201  if( evt->IsClick( BUT_LEFT ) )
202  {
203  selectPoint( evt->Position() );
204  }
205  // right click? if there is any object - show the context menu
206  else if( evt->IsClick( BUT_RIGHT ) )
207  {
208  if( m_selection.Empty() )
209  {
210  selectPoint( evt->Position() );
211  m_selection.SetIsHover( true );
212  }
213 
215  }
216  // Middle double click? Do zoom to fit
217  else if( evt->IsDblClick( BUT_MIDDLE ) )
218  {
220  }
221  else if( evt->IsCancel() || evt->Action() == TA_UNDO_REDO_PRE )
222  {
223  clearSelection();
224  }
225  else
226  {
227  evt->SetPassEvent();
228  }
229  }
230 
231  return 0;
232 }
233 
234 
236 {
237  return m_selection;
238 }
239 
240 
241 bool GERBVIEW_SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag )
242 {
243  EDA_ITEM* item = NULL;
244  GERBER_COLLECTOR collector;
245  EDA_ITEM* model = getModel<EDA_ITEM>();
246 
247  collector.Collect( model, GERBER_COLLECTOR::AllItems, wxPoint( aWhere.x, aWhere.y ) );
248 
249  // Remove unselectable items
250  for( int i = collector.GetCount() - 1; i >= 0; --i )
251  {
252  if( !selectable( collector[i] ) )
253  collector.Remove( i );
254  }
255 
256  if( collector.GetCount() > 1 )
257  {
258  if( aOnDrag )
260 
261  item = disambiguationMenu( &collector );
262 
263  if( item )
264  {
265  collector.Empty();
266  collector.Append( item );
267  }
268  }
269 
271  clearSelection();
272 
273  if( collector.GetCount() == 1 )
274  {
275  item = collector[ 0 ];
276 
277  if( m_subtractive || ( m_exclusive_or && item->IsSelected() ) )
278  {
279  unselect( item );
281  return false;
282  }
283  else
284  {
285  select( item );
287  return true;
288  }
289  }
290 
291  return false;
292 }
293 
294 
295 bool GERBVIEW_SELECTION_TOOL::selectCursor( bool aSelectAlways )
296 {
297  if( aSelectAlways || m_selection.Empty() )
298  {
299  clearSelection();
300  selectPoint( getViewControls()->GetCursorPosition( false ) );
301  }
302 
303  return !m_selection.Empty();
304 }
305 
306 
308 {
314 }
315 
316 
318 {
319  clearSelection();
320 
321  return 0;
322 }
323 
324 
326 {
327  std::vector<EDA_ITEM*>* items = aEvent.Parameter<std::vector<EDA_ITEM*>*>();
328 
329  if( items )
330  {
331  // Perform individual selection of each item before processing the event.
332  for( EDA_ITEM* item : *items )
333  select( item );
334 
336  }
337 
338  return 0;
339 }
340 
341 
343 {
344  // Check if there is an item to be selected
345  EDA_ITEM* item = aEvent.Parameter<EDA_ITEM*>();
346 
347  if( item )
348  {
349  select( item );
350 
351  // Inform other potentially interested tools
353  }
354 
355  return 0;
356 }
357 
358 
360 {
361  std::vector<EDA_ITEM*>* items = aEvent.Parameter<std::vector<EDA_ITEM*>*>();
362 
363  if( items )
364  {
365  // Perform individual unselection of each item before processing the event
366  for( EDA_ITEM* item : *items )
367  unselect( item );
368 
370  }
371 
372  return 0;
373 }
374 
375 
377 {
378  // Check if there is an item to be selected
379  EDA_ITEM* item = aEvent.Parameter<EDA_ITEM*>();
380 
381  if( item )
382  {
383  unselect( item );
384 
385  // Inform other potentially interested tools
387  }
388 
389  return 0;
390 }
391 
392 
394 {
395  if( m_selection.Empty() )
396  return;
397 
398  for( EDA_ITEM* item : m_selection )
399  unselectVisually( item );
400 
401  m_selection.Clear();
402 
403  // Inform other potentially interested tools
405 }
406 
407 
409 {
410  EDA_ITEM* current = NULL;
411  KIGFX::VIEW_GROUP highlightGroup;
412  ACTION_MENU menu( true );
413 
414  highlightGroup.SetLayer( LAYER_SELECT_OVERLAY );
415  getView()->Add( &highlightGroup );
416 
417  int limit = std::min( 10, aCollector->GetCount() );
418 
419  for( int i = 0; i < limit; ++i )
420  {
421  wxString text;
422  EDA_ITEM* item = ( *aCollector )[i];
423  text = item->GetSelectMenuText( m_frame->GetUserUnits() );
424  menu.Add( text, i + 1, item->GetMenuImage() );
425  }
426 
427  if( aCollector->m_MenuTitle.Length() )
428  {
429  menu.SetTitle( aCollector->m_MenuTitle );
430  menu.SetIcon( info_xpm );
431  menu.DisplayTitle( true );
432  }
433  else
434  {
435  menu.DisplayTitle( false );
436  }
437 
438  SetContextMenu( &menu, CMENU_NOW );
439 
440  while( TOOL_EVENT* evt = Wait() )
441  {
442  if( evt->Action() == TA_CHOICE_MENU_UPDATE )
443  {
444  if( current )
445  {
446  current->ClearBrightened();
447  getView()->Hide( current, false );
448  highlightGroup.Remove( current );
450  }
451 
452  int id = *evt->GetCommandId();
453 
454  // User has pointed an item, so show it in a different way
455  if( id > 0 && id <= limit )
456  {
457  current = ( *aCollector )[id - 1];
458  current->SetBrightened();
459  getView()->Hide( current, true );
460  highlightGroup.Add( current );
462  }
463  else
464  {
465  current = NULL;
466  }
467  }
468  else if( evt->Action() == TA_CHOICE_MENU_CHOICE )
469  {
470  OPT<int> id = evt->GetCommandId();
471 
472  // User has selected an item, so this one will be returned
473  if( id && ( *id > 0 ) )
474  current = ( *aCollector )[*id - 1];
475  else
476  current = NULL;
477 
478  break;
479  }
480  }
481 
482  if( current && current->IsBrightened() )
483  {
484  current->ClearBrightened();
485  getView()->Hide( current, false );
487  }
488 
489  getView()->Remove( &highlightGroup );
490 
491  return current;
492 }
493 
494 
496 {
497  GERBVIEW_FRAME* frame = getEditFrame<GERBVIEW_FRAME>();
498  const GERBER_DRAW_ITEM* item = static_cast<const GERBER_DRAW_ITEM*>( aItem );
499  int layer = item->GetLayer();
500 
501 
502  if( item->GetLayerPolarity() )
503  {
504  // Don't allow selection of invisible negative items
505  auto rs = static_cast<KIGFX::GERBVIEW_RENDER_SETTINGS*>( getView()->GetPainter()->GetSettings() );
506  if( !rs->IsShowNegativeItems() )
507  return false;
508  }
509 
510  // We do not want to select items that are in the background
511  if( frame->GetDisplayOptions().m_HighContrastMode && layer != frame->GetActiveLayer() )
512  return false;
513 
514  return frame->IsLayerVisible( layer );
515 }
516 
517 
519 {
520  if( aItem->IsSelected() )
521  return;
522 
523  m_selection.Add( aItem );
524  getView()->Add( &m_selection, std::numeric_limits<int>::max() );
525  selectVisually( aItem );
526 }
527 
528 
530 {
531  if( !aItem->IsSelected() )
532  return;
533 
534  unselectVisually( aItem );
535  m_selection.Remove( aItem );
536 
537  if( m_selection.Empty() )
538  getView()->Remove( &m_selection );
539 }
540 
541 
543 {
544  // Move the item's layer to the front
545  int layer = static_cast<GERBER_DRAW_ITEM*>( aItem )->GetLayer();
546  m_frame->SetActiveLayer( layer, true );
547 
548  // Hide the original item, so it is shown only on overlay
549  aItem->SetSelected();
550  getView()->Hide( aItem, true );
551 
552  getView()->Update( &m_selection );
553 }
554 
555 
557 {
558  // Restore original item visibility
559  aItem->ClearSelected();
560  getView()->Hide( aItem, false );
561  getView()->Update( aItem, KIGFX::ALL );
562 
563  getView()->Update( &m_selection );
564 }
ACTION_MENU * create() const override
< Return an instance of this class. It has to be overridden in inheriting classes.
void Empty()
Clear the list.
Definition: collector.h:95
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hide the item in the view (e.g.
Definition: view.cpp:1475
void AddMenu(ACTION_MENU *aMenu, const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
Add a submenu to the menu.
wxMenuItem * Add(const wxString &aLabel, int aId, const BITMAP_OPAQUE *aIcon)
Add a wxWidgets-style entry to the menu.
static TOOL_ACTION selectionClear
Clear the current selection.
static const TOOL_EVENT SelectedEvent
Definition: actions.h:209
TOOL_MENU m_menu
The functions below are not yet implemented - their interface may change.
virtual void Clear() override
Remove all the stored items from the group.
Definition: selection.h:96
bool Init() override
Init() is called once upon a registration of the tool.
TOOL_EVENT * Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Suspend execution of the tool until an event specified in aEventList arrives.
bool selectPoint(const VECTOR2I &aWhere, bool aOnDrag=false)
Select an item pointed by the parameter aWhere.
bool IsSelected() const
Definition: eda_item.h:172
Model changes (required full reload)
Definition: tool_base.h:81
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:210
Defines the structure of a menu based on ACTIONs.
Definition: action_menu.h:45
print info associated to a component (TO.C attribute)
bool selectable(const EDA_ITEM *aItem) const
Check conditions for an item to be selected.
void update() override
Update menu state stub.
void ClearSelected()
Definition: eda_item.h:181
GERBER_COLLECTOR is intended for use when the right click button is pressed, or when the plain "arrow...
EDA_ITEM * disambiguationMenu(GERBER_COLLECTOR *aItems)
Handle the menu that allows one to select one of many items in case there is more than one item at th...
CONDITIONAL_MENU & GetMenu()
Definition: tool_menu.cpp:46
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:215
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
int GetLayer() const
Return the layer this item is on.
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
Definition: view.cpp:351
void SetActiveLayer(int aLayer, bool doLayerWidgetUpdate=true)
change the currently active layer to aLayer and update the GERBER_LAYER_WIDGET.
void SetBrightened()
Definition: eda_item.h:179
static TOOL_ACTION zoomFitScreen
Definition: actions.h:99
void selectVisually(EDA_ITEM *aItem)
Mark item as selected, but does not add it to the #ITEMS_PICKED_LIST.
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Run the specified action.
Definition: tool_manager.h:141
int Main(const TOOL_EVENT &aEvent)
The main loop.
const GBR_DISPLAY_OPTIONS & GetDisplayOptions() const
bool IsBrightened() const
Definition: eda_item.h:175
void UpdateAll()
Run update handlers for the menu and its submenus.
bool m_HighContrastMode
High contrast mode (dim un-highlighted objects)
void SetContextMenu(ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger=CMENU_BUTTON)
Assign a context menu and tells when it should be activated.
All except INITIAL_ADD.
Definition: view_item.h:58
static TOOL_ACTION selectItem
Selects an item (specified as the event parameter).
static const KICAD_T AllItems[]
A scan list for all selectable gerber items.
static TOOL_ACTION highlightNet
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Define which state (aStateFunc) to go when a certain event arrives (aConditions).
void Remove(int aIndex)
Remove the item at aIndex (first position is 0).
Definition: collector.h:115
void SetCurrentCursor(KICURSOR cursor)
Set the current cursor shape for this panel.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:207
void SetIsHover(bool aIsHover)
Definition: selection.h:67
virtual void Add(EDA_ITEM *aItem)
Definition: selection.h:77
void ClearBrightened()
Definition: eda_item.h:182
void Append(EDA_ITEM *item)
Add an item to the end of the list.
Definition: collector.h:105
int GetCount() const
Return the number of objects in the list.
Definition: collector.h:87
int UnselectItem(const TOOL_EVENT &aEvent)
void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
#define NULL
void Collect(EDA_ITEM *aItem, const KICAD_T aScanList[], const wxPoint &aRefPos)
Function Collect scans an EDA_ITEM using this class's Inspector method, which does the collection.
void SetSelected()
Definition: eda_item.h:178
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:574
bool ProcessEvent(const TOOL_EVENT &aEvent)
Propagate an event to tools that requested events of matching type(s).
static TOOL_ACTION highlightAttribute
T Parameter() const
Return a non-standard parameter assigned to the event.
Definition: tool_event.h:443
void SetIcon(const BITMAP_OPAQUE *aIcon)
Assign an icon for the entry.
Definition: action_menu.cpp:71
Generic, UI-independent tool event.
Definition: tool_event.h:173
bool ToolStackIsEmpty()
Definition: tools_holder.h:117
const BITMAP_OPAQUE net_highlight_schematic_xpm[1]
Extend VIEW_ITEM by possibility of grouping items into a single object.
Definition: view_group.h:46
Items that may change while the view stays the same (noncached)
Definition: definitions.h:50
virtual void Remove(VIEW_ITEM *aItem)
Remove an item from the group.
Definition: view_group.cpp:62
static const TOOL_EVENT ClearedEvent
Selected item had a property changed (except movement)
Definition: actions.h:211
void unselect(EDA_ITEM *aItem)
Take necessary action mark an item as unselected.
int UpdateMenu(const TOOL_EVENT &aEvent)
void unselectVisually(EDA_ITEM *aItem)
Mark item as selected, but does not add it to the #ITEMS_PICKED_LIST.
GERBVIEW_SELECTION & GetSelection()
Return the set of currently selected items.
static TOOL_ACTION updateMenu
Definition: actions.h:170
virtual void Add(VIEW_ITEM *aItem)
Add an item to the group.
Definition: view_group.cpp:56
const BITMAP_OPAQUE info_xpm[1]
Definition: info.cpp:36
virtual void SetLayer(int aLayer)
Set layer used to draw the group.
Definition: view_group.h:108
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:122
wxString m_MenuTitle
Definition: collector.h:250
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command) attached to the D_CODE
Definition: dcode.h:105
int SelectItems(const TOOL_EVENT &aEvent)
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
int SelectItem(const TOOL_EVENT &aEvent)
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
int GetActiveLayer() const
Return the active layer.
Selection tool for GerbView, based on the one in Pcbnew.
void SetTitle(const wxString &aTitle) override
Set title for the menu.
Definition: action_menu.cpp:89
D_CODE holds a gerber DCODE (also called Aperture) definition.
Definition: dcode.h:82
void SetHighlight(bool aEnabled, int aNetcode=-1, bool aMulti=false)
Turns on/off highlighting.
static TOOL_ACTION highlightClear
#define _(s)
Definition: 3d_actions.cpp:33
int UnselectItems(const TOOL_EVENT &aEvent)
Sets up handlers for various events.
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:150
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Return the text to display to be used in the selection clarification context menu when multiple items...
Definition: eda_item.cpp:123
static TOOL_ACTION selectionActivate
Activation of the selection tool.
static TOOL_ACTION unselectItem
Unselects an item (specified as the event parameter).
void AddSubMenu(std::shared_ptr< ACTION_MENU > aSubMenu)
Store a submenu of this menu model.
Definition: tool_menu.cpp:52
bool selectCursor(bool aSelectAlways=false)
Select an item under the cursor unless there is something already selected or aSelectAlways is true.
currently selected items overlay
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:149
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:78
void select(EDA_ITEM *aItem)
Take necessary action mark an item as selected.
boost::optional< T > OPT
Definition: optional.h:7
void clearSelection()
Clear the current selection.
print info associated to a flashed pad (TO.P attribute)
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:321
int ClearSelection(const TOOL_EVENT &aEvent)
KIGFX::VIEW_CONTROLS * getViewControls() const
Return the instance of VIEW_CONTROLS object used in the application.
Definition: tool_base.cpp:42
bool IsLayerVisible(int aLayer) const
Test whether a given layer is visible.
virtual BITMAP_DEF GetMenuImage() const
Return a pointer to an image to be used in menus.
Definition: eda_item.cpp:222
print info associated to a net (TO.N attribute)
bool GetLayerPolarity() const
void ShowContextMenu(SELECTION &aSelection)
Helper function to set and immediately show a CONDITIONAL_MENU in concert with the given SELECTION.
Definition: tool_menu.cpp:59
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
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
void DisplayTitle(bool aDisplay=true)
Decide whether a title for a pop up menu should be displayed.
static TOOL_ACTION highlightComponent
virtual void Remove(EDA_ITEM *aItem)
Definition: selection.h:88