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-2021 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 <bitmaps.h>
26 #include <eda_item.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_group.h>
32 #include <painter.h>
33 #include <tool/tool_event.h>
34 #include <tool/tool_manager.h>
35 #include <gerbview_id.h>
36 #include <gerbview_painter.h>
38 #include "gerbview_actions.h"
39 
40 
42 {
43 public:
45  ACTION_MENU( true )
46  {
48  SetTitle( _( "Highlight" ) );
49  }
50 
51 private:
52 
53  void update() override
54  {
55  bool addSeparator = false;
56 
57  Clear();
58 
59  const auto& selection = getToolManager()->GetTool<GERBVIEW_SELECTION_TOOL>()->GetSelection();
60 
61  if( selection.Size() == 1 )
62  {
63  auto item = static_cast<GERBER_DRAW_ITEM*>( selection[0] );
64  const auto& net_attr = item->GetNetAttributes();
65 
66  if( ( net_attr.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_PAD ) ||
67  ( net_attr.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_CMP ) )
68  {
69  auto menuEntry = Add( GERBVIEW_ACTIONS::highlightComponent );
70  menuEntry->SetItemLabel( wxString::Format( _( "Highlight Items of Component \"%s\"" ),
71  net_attr.m_Cmpref ) );
72  addSeparator = true;
73  }
74 
75  if( ( net_attr.m_NetAttribType & GBR_NETLIST_METADATA::GBR_NETINFO_NET ) )
76  {
77  auto menuEntry = Add( GERBVIEW_ACTIONS::highlightNet );
78  menuEntry->SetItemLabel( wxString::Format( _( "Highlight Items of Net \"%s\"" ),
79  UnescapeString( net_attr.m_Netname ) ) );
80  addSeparator = true;
81  }
82 
83  D_CODE* apertDescr = item->GetDcodeDescr();
84 
85  if( apertDescr && !apertDescr->m_AperFunction.IsEmpty() )
86  {
87  auto menuEntry = Add( GERBVIEW_ACTIONS::highlightAttribute );
88  menuEntry->SetItemLabel( wxString::Format( _( "Highlight Aperture Type \"%s\"" ),
89  apertDescr->m_AperFunction ) );
90  addSeparator = true;
91  }
92 
93  if( apertDescr )
94  {
95  auto menuEntry = Add( GERBVIEW_ACTIONS::highlightDCode );
96  menuEntry->SetItemLabel( wxString::Format( _( "Highlight DCode D%d" ),
97  apertDescr->m_Num_Dcode ) );
98  addSeparator = true;
99  }
100  }
101 
102  if( addSeparator )
103  AppendSeparator();
104 
106  }
107 
108  ACTION_MENU* create() const override
109  {
110  return new HIGHLIGHT_MENU();
111  }
112 };
113 
114 
116  TOOL_INTERACTIVE( "gerbview.InteractiveSelection" ),
117  m_frame( nullptr ),
118  m_additive( false ),
119  m_subtractive( false ),
120  m_exclusive_or( false )
121 {
122  m_preliminary = true;
123 }
124 
125 
127 {
128  ACTION_MENU* actionMenu = aEvent.Parameter<ACTION_MENU*>();
129  CONDITIONAL_MENU* conditionalMenu = dynamic_cast<CONDITIONAL_MENU*>( actionMenu );
130 
131  if( conditionalMenu )
132  conditionalMenu->Evaluate( m_selection );
133 
134  if( actionMenu )
135  actionMenu->UpdateAll();
136 
137  return 0;
138 }
139 
140 
142 {
143  getView()->Remove( &m_selection );
144 }
145 
146 
148 {
149  auto selectMenu = std::make_shared<HIGHLIGHT_MENU>();
150  selectMenu->SetTool( this );
151  m_menu.AddSubMenu( selectMenu );
152 
153  auto& menu = m_menu.GetMenu();
154 
155  menu.AddMenu( selectMenu.get() );
156  menu.AddSeparator( 1000 );
157 
158  getEditFrame<GERBVIEW_FRAME>()->AddStandardSubMenus( m_menu );
159 
160  return true;
161 }
162 
163 
165 {
166  m_frame = getEditFrame<GERBVIEW_FRAME>();
167  m_preliminary = true;
168 
169  if( aReason == TOOL_BASE::MODEL_RELOAD )
170  {
171  // Remove pointers to the selected items from containers
172  // without changing their properties (as they are already deleted
173  // while a new file is loaded)
174  m_selection.Clear();
175  getView()->GetPainter()->GetSettings()->SetHighlight( false );
176  }
177  else
178  {
179  // Restore previous properties of selected items and remove them from containers
180  clearSelection();
181  }
182 
183  // Reinsert the VIEW_GROUP, in case it was removed from the VIEW
184  getView()->Remove( &m_selection );
185  getView()->Add( &m_selection );
186 }
187 
188 
190 {
191  // Main loop: keep receiving events
192  while( TOOL_EVENT* evt = Wait() )
193  {
194  if( m_frame->ToolStackIsEmpty() )
196 
198 
199  if( evt->Modifier( MD_SHIFT ) && evt->Modifier( MD_CTRL ) )
200  m_subtractive = true;
201  else if( evt->Modifier( MD_SHIFT ) )
202  m_additive = true;
203  else if( evt->Modifier( MD_CTRL ) )
204  m_exclusive_or = true;
205 
206  // single click? Select single object
207  if( evt->IsClick( BUT_LEFT ) )
208  {
209  selectPoint( evt->Position() );
210  }
211  else if( evt->IsClick( BUT_RIGHT ) )
212  {
213  // right click? if there is any object - show the context menu
214  if( m_selection.Empty() )
215  {
216  selectPoint( evt->Position() );
217  m_selection.SetIsHover( true );
218  }
219 
221  }
222  else if( evt->IsDblClick( BUT_MIDDLE ) )
223  {
224  // Middle double click? Do zoom to fit
226  }
227  else if( evt->IsCancel() || evt->Action() == TA_UNDO_REDO_PRE )
228  {
229  clearSelection();
230  }
231  else
232  {
233  evt->SetPassEvent();
234  }
235  }
236 
237  return 0;
238 }
239 
240 
242 {
243  return m_selection;
244 }
245 
246 
247 bool GERBVIEW_SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag )
248 {
249  EDA_ITEM* item = nullptr;
250  GERBER_COLLECTOR collector;
251  EDA_ITEM* model = getModel<EDA_ITEM>();
252 
253  collector.Collect( model, GERBER_COLLECTOR::AllItems, wxPoint( aWhere.x, aWhere.y ) );
254 
255  // Remove unselectable items
256  for( int i = collector.GetCount() - 1; i >= 0; --i )
257  {
258  if( !selectable( collector[i] ) )
259  collector.Remove( i );
260  }
261 
262  if( collector.GetCount() > 1 )
263  {
264  if( aOnDrag )
266 
267  item = disambiguationMenu( &collector );
268 
269  if( item )
270  {
271  collector.Empty();
272  collector.Append( item );
273  }
274  }
275 
277  clearSelection();
278 
279  if( collector.GetCount() == 1 )
280  {
281  item = collector[ 0 ];
282 
283  if( m_subtractive || ( m_exclusive_or && item->IsSelected() ) )
284  {
285  unselect( item );
287  return false;
288  }
289  else
290  {
291  select( item );
293  return true;
294  }
295  }
296 
297  return false;
298 }
299 
300 
301 bool GERBVIEW_SELECTION_TOOL::selectCursor( bool aSelectAlways )
302 {
303  if( aSelectAlways || m_selection.Empty() )
304  {
305  clearSelection();
306  selectPoint( getViewControls()->GetCursorPosition( false ) );
307  }
308 
309  return !m_selection.Empty();
310 }
311 
312 
314 {
320 }
321 
322 
324 {
325  clearSelection();
326 
327  return 0;
328 }
329 
330 
332 {
333  std::vector<EDA_ITEM*>* items = aEvent.Parameter<std::vector<EDA_ITEM*>*>();
334 
335  if( items )
336  {
337  // Perform individual selection of each item before processing the event.
338  for( EDA_ITEM* item : *items )
339  select( item );
340 
342  }
343 
344  return 0;
345 }
346 
347 
349 {
350  // Check if there is an item to be selected
351  EDA_ITEM* item = aEvent.Parameter<EDA_ITEM*>();
352 
353  if( item )
354  {
355  select( item );
356 
357  // Inform other potentially interested tools
359  }
360 
361  return 0;
362 }
363 
364 
366 {
367  std::vector<EDA_ITEM*>* items = aEvent.Parameter<std::vector<EDA_ITEM*>*>();
368 
369  if( items )
370  {
371  // Perform individual unselection of each item before processing the event
372  for( EDA_ITEM* item : *items )
373  unselect( item );
374 
376  }
377 
378  return 0;
379 }
380 
381 
383 {
384  // Check if there is an item to be selected
385  EDA_ITEM* item = aEvent.Parameter<EDA_ITEM*>();
386 
387  if( item )
388  {
389  unselect( item );
390 
391  // Inform other potentially interested tools
393  }
394 
395  return 0;
396 }
397 
398 
400 {
401  if( m_selection.Empty() )
402  return;
403 
404  for( EDA_ITEM* item : m_selection )
405  unselectVisually( item );
406 
407  m_selection.Clear();
408 
409  // Inform other potentially interested tools
411 }
412 
413 
415 {
416  EDA_ITEM* current = nullptr;
417  KIGFX::VIEW_GROUP highlightGroup;
418  ACTION_MENU menu( true );
419 
420  highlightGroup.SetLayer( LAYER_SELECT_OVERLAY );
421  getView()->Add( &highlightGroup );
422 
423  int limit = std::min( 10, aCollector->GetCount() );
424 
425  for( int i = 0; i < limit; ++i )
426  {
427  wxString text;
428  EDA_ITEM* item = ( *aCollector )[i];
430  menu.Add( text, i + 1, item->GetMenuImage() );
431  }
432 
433  if( aCollector->m_MenuTitle.Length() )
434  {
435  menu.SetTitle( aCollector->m_MenuTitle );
436  menu.SetIcon( BITMAPS::info );
437  menu.DisplayTitle( true );
438  }
439  else
440  {
441  menu.DisplayTitle( false );
442  }
443 
444  SetContextMenu( &menu, CMENU_NOW );
445 
446  while( TOOL_EVENT* evt = Wait() )
447  {
448  if( evt->Action() == TA_CHOICE_MENU_UPDATE )
449  {
450  if( current )
451  {
452  current->ClearBrightened();
453  getView()->Hide( current, false );
454  highlightGroup.Remove( current );
456  }
457 
458  int id = *evt->GetCommandId();
459 
460  // User has pointed an item, so show it in a different way
461  if( id > 0 && id <= limit )
462  {
463  current = ( *aCollector )[id - 1];
464  current->SetBrightened();
465  getView()->Hide( current, true );
466  highlightGroup.Add( current );
468  }
469  else
470  {
471  current = nullptr;
472  }
473  }
474  else if( evt->Action() == TA_CHOICE_MENU_CHOICE )
475  {
476  OPT<int> id = evt->GetCommandId();
477 
478  // User has selected an item, so this one will be returned
479  if( id && ( *id > 0 ) )
480  current = ( *aCollector )[*id - 1];
481  else
482  current = nullptr;
483 
484  break;
485  }
486  }
487 
488  if( current && current->IsBrightened() )
489  {
490  current->ClearBrightened();
491  getView()->Hide( current, false );
493  }
494 
495  getView()->Remove( &highlightGroup );
496 
497  return current;
498 }
499 
500 
502 {
503  GERBVIEW_FRAME* frame = getEditFrame<GERBVIEW_FRAME>();
504  const GERBER_DRAW_ITEM* item = static_cast<const GERBER_DRAW_ITEM*>( aItem );
505  int layer = item->GetLayer();
506 
507 
508  if( item->GetLayerPolarity() )
509  {
510  // Don't allow selection of invisible negative items
511  auto rs = static_cast<KIGFX::GERBVIEW_RENDER_SETTINGS*>( getView()->GetPainter()->GetSettings() );
512 
513  if( !rs->IsShowNegativeItems() )
514  return false;
515  }
516 
517  // We do not want to select items that are in the background
518  if( frame->GetDisplayOptions().m_HighContrastMode && layer != frame->GetActiveLayer() )
519  return false;
520 
521  return frame->IsLayerVisible( layer );
522 }
523 
524 
526 {
527  if( aItem->IsSelected() )
528  return;
529 
530  m_selection.Add( aItem );
531  getView()->Add( &m_selection, std::numeric_limits<int>::max() );
532  selectVisually( aItem );
533 }
534 
535 
537 {
538  if( !aItem->IsSelected() )
539  return;
540 
541  unselectVisually( aItem );
542  m_selection.Remove( aItem );
543 
544  if( m_selection.Empty() )
545  getView()->Remove( &m_selection );
546 }
547 
548 
550 {
551  // Move the item's layer to the front
552  int layer = static_cast<GERBER_DRAW_ITEM*>( aItem )->GetLayer();
553  m_frame->SetActiveLayer( layer, true );
554 
555  // Hide the original item, so it is shown only on overlay
556  aItem->SetSelected();
557  getView()->Hide( aItem, true );
558 
559  getView()->Update( &m_selection );
560 }
561 
562 
564 {
565  // Restore original item visibility
566  aItem->ClearSelected();
567  getView()->Hide( aItem, false );
568  getView()->Update( aItem, KIGFX::ALL );
569 
570  getView()->Update( &m_selection );
571 }
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:1470
void AddMenu(ACTION_MENU *aMenu, const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
Add a submenu to the menu.
static TOOL_ACTION selectionClear
Clear the current selection.
static const TOOL_EVENT SelectedEvent
Definition: actions.h:199
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:82
bool Init() override
Init() is called once upon a registration of the tool.
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
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:123
Model changes (required full reload)
Definition: tool_base.h:80
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:200
Defines the structure of a menu based on ACTIONs.
Definition: action_menu.h:48
print info associated to a component (TO.C attribute)
virtual void Add(EDA_ITEM *aItem)
Definition: selection.cpp:31
bool selectable(const EDA_ITEM *aItem) const
Check conditions for an item to be selected.
void SetIcon(BITMAPS aIcon)
Assign an icon for the entry.
Definition: action_menu.cpp:73
void update() override
Update menu state stub.
void ClearSelected()
Definition: eda_item.h:132
Use when the right click button is pressed or when the select tool is in effect.
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:214
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:130
static TOOL_ACTION zoomFitScreen
Definition: actions.h:96
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:143
int Main(const TOOL_EVENT &aEvent)
The main loop.
const GBR_DISPLAY_OPTIONS & GetDisplayOptions() const
bool IsBrightened() const
Definition: eda_item.h:126
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
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:68
void ClearBrightened()
Definition: eda_item.h:133
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.
void Collect(EDA_ITEM *aItem, const KICAD_T aScanList[], const wxPoint &aRefPos)
Scan an EDA_ITEM using this class's Inspector method, which does the collection.
void SetSelected()
Definition: eda_item.h:129
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
Definition: view.h:572
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:427
int m_Num_Dcode
D code value ( >= 10 )
Definition: dcode.h:190
Generic, UI-independent tool event.
Definition: tool_event.h:152
bool ToolStackIsEmpty()
Definition: tools_holder.h:116
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
#define _(s)
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:201
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:167
virtual void Add(VIEW_ITEM *aItem)
Add an item to the group.
Definition: view_group.cpp:56
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:97
wxString m_MenuTitle
Definition: collector.h:250
wxString m_AperFunction
the aperture attribute (created by a TA.AperFunction command).
Definition: dcode.h:200
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:87
A gerber DCODE (also called Aperture) definition.
Definition: dcode.h:80
void SetHighlight(bool aEnabled, int aNetcode=-1, bool aMulti=false)
Turns on/off highlighting.
static TOOL_ACTION highlightClear
int UnselectItems(const TOOL_EVENT &aEvent)
Sets up handlers for various events.
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:222
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:109
static TOOL_ACTION selectionActivate
Activation of the selection tool.
static TOOL_ACTION unselectItem
Unselects an item (specified as the event parameter).
virtual BITMAPS GetMenuImage() const
Return a pointer to an image to be used in menus.
Definition: eda_item.cpp:211
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.
virtual void Remove(EDA_ITEM *aItem)
Definition: selection.cpp:43
wxMenuItem * Add(const wxString &aLabel, int aId, BITMAPS aIcon)
Add a wxWidgets-style entry to the menu.
currently selected items overlay
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:77
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)
static TOOL_ACTION highlightDCode
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.
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:1503
void DisplayTitle(bool aDisplay=true)
Decide whether a title for a pop up menu should be displayed.
Definition: action_menu.cpp:98
static TOOL_ACTION highlightComponent