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 <[email protected]>
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 <string_utils.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 {
119  m_preliminary = true;
120 }
121 
122 
124 {
125  ACTION_MENU* actionMenu = aEvent.Parameter<ACTION_MENU*>();
126  CONDITIONAL_MENU* conditionalMenu = dynamic_cast<CONDITIONAL_MENU*>( actionMenu );
127 
128  if( conditionalMenu )
129  conditionalMenu->Evaluate( m_selection );
130 
131  if( actionMenu )
132  actionMenu->UpdateAll();
133 
134  return 0;
135 }
136 
137 
139 {
140  getView()->Remove( &m_selection );
141 }
142 
143 
145 {
146  auto selectMenu = std::make_shared<HIGHLIGHT_MENU>();
147  selectMenu->SetTool( this );
148  m_menu.AddSubMenu( selectMenu );
149 
150  auto& menu = m_menu.GetMenu();
151 
152  menu.AddMenu( selectMenu.get() );
153  menu.AddSeparator( 1000 );
154 
155  getEditFrame<GERBVIEW_FRAME>()->AddStandardSubMenus( m_menu );
156 
157  return true;
158 }
159 
160 
162 {
163  m_frame = getEditFrame<GERBVIEW_FRAME>();
164  m_preliminary = true;
165 
166  if( aReason == TOOL_BASE::MODEL_RELOAD )
167  {
168  // Remove pointers to the selected items from containers
169  // without changing their properties (as they are already deleted
170  // while a new file is loaded)
171  m_selection.Clear();
172  getView()->GetPainter()->GetSettings()->SetHighlight( false );
173  }
174  else
175  {
176  // Restore previous properties of selected items and remove them from containers
177  clearSelection();
178  }
179 
180  // Reinsert the VIEW_GROUP, in case it was removed from the VIEW
181  getView()->Remove( &m_selection );
182  getView()->Add( &m_selection );
183 }
184 
185 
187 {
188  // Main loop: keep receiving events
189  while( TOOL_EVENT* evt = Wait() )
190  {
191  if( m_frame->ToolStackIsEmpty() )
193 
194  // on left click, a selection is made, depending on modifiers ALT, SHIFT, CTRL:
195  setModifiersState( evt->Modifier( MD_SHIFT ), evt->Modifier( MD_CTRL ),
196  evt->Modifier( MD_ALT ) );
197 
198  // single click? Select single object
199  if( evt->IsClick( BUT_LEFT ) )
200  {
201  selectPoint( evt->Position() );
202  }
203  else if( evt->IsClick( BUT_RIGHT ) )
204  {
205  // right click? if there is any object - show the context menu
206  if( m_selection.Empty() )
207  {
208  selectPoint( evt->Position() );
209  m_selection.SetIsHover( true );
210  }
211 
213  }
214  else if( evt->IsDblClick( BUT_MIDDLE ) )
215  {
216  // Middle double click? Do zoom to fit
218  }
219  else if( evt->IsCancel() || evt->Action() == TA_UNDO_REDO_PRE )
220  {
221  clearSelection();
222  }
223  else
224  {
225  evt->SetPassEvent();
226  }
227  }
228 
229  return 0;
230 }
231 
232 
234 {
235  return m_selection;
236 }
237 
238 
239 bool GERBVIEW_SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag )
240 {
241  EDA_ITEM* item = nullptr;
242  GERBER_COLLECTOR collector;
243  EDA_ITEM* model = getModel<EDA_ITEM>();
244 
245  collector.Collect( model, GERBER_COLLECTOR::AllItems, wxPoint( aWhere.x, aWhere.y ) );
246 
247  // Remove unselectable items
248  for( int i = collector.GetCount() - 1; i >= 0; --i )
249  {
250  if( !selectable( collector[i] ) )
251  collector.Remove( i );
252  }
253 
254  if( collector.GetCount() > 1 )
255  {
256  if( aOnDrag )
258 
259  item = disambiguationMenu( &collector );
260 
261  if( item )
262  {
263  collector.Empty();
264  collector.Append( item );
265  }
266  }
267 
269  clearSelection();
270 
271  if( collector.GetCount() == 1 )
272  {
273  item = collector[ 0 ];
274 
275  if( m_subtractive || ( m_exclusive_or && item->IsSelected() ) )
276  {
277  unselect( item );
279  return false;
280  }
281  else
282  {
283  select( item );
285  return true;
286  }
287  }
288 
289  return false;
290 }
291 
292 
293 bool GERBVIEW_SELECTION_TOOL::selectCursor( bool aSelectAlways )
294 {
295  if( aSelectAlways || m_selection.Empty() )
296  {
297  clearSelection();
298  selectPoint( getViewControls()->GetCursorPosition( false ) );
299  }
300 
301  return !m_selection.Empty();
302 }
303 
304 
306 {
312 }
313 
314 
316 {
317  clearSelection();
318 
319  return 0;
320 }
321 
322 
324 {
325  std::vector<EDA_ITEM*>* items = aEvent.Parameter<std::vector<EDA_ITEM*>*>();
326 
327  if( items )
328  {
329  // Perform individual selection of each item before processing the event.
330  for( EDA_ITEM* item : *items )
331  select( item );
332 
334  }
335 
336  return 0;
337 }
338 
339 
341 {
342  // Check if there is an item to be selected
343  EDA_ITEM* item = aEvent.Parameter<EDA_ITEM*>();
344 
345  if( item )
346  {
347  select( item );
348 
349  // Inform other potentially interested tools
351  }
352 
353  return 0;
354 }
355 
356 
358 {
359  std::vector<EDA_ITEM*>* items = aEvent.Parameter<std::vector<EDA_ITEM*>*>();
360 
361  if( items )
362  {
363  // Perform individual unselection of each item before processing the event
364  for( EDA_ITEM* item : *items )
365  unselect( item );
366 
368  }
369 
370  return 0;
371 }
372 
373 
375 {
376  // Check if there is an item to be selected
377  EDA_ITEM* item = aEvent.Parameter<EDA_ITEM*>();
378 
379  if( item )
380  {
381  unselect( item );
382 
383  // Inform other potentially interested tools
385  }
386 
387  return 0;
388 }
389 
390 
392 {
393  if( m_selection.Empty() )
394  return;
395 
396  for( EDA_ITEM* item : m_selection )
397  unselectVisually( item );
398 
399  m_selection.Clear();
400 
401  // Inform other potentially interested tools
403 }
404 
405 
407 {
408  EDA_ITEM* current = nullptr;
409  KIGFX::VIEW_GROUP highlightGroup;
410  ACTION_MENU menu( true );
411 
412  highlightGroup.SetLayer( LAYER_SELECT_OVERLAY );
413  getView()->Add( &highlightGroup );
414 
415  int limit = std::min( 10, aCollector->GetCount() );
416 
417  for( int i = 0; i < limit; ++i )
418  {
419  wxString text;
420  EDA_ITEM* item = ( *aCollector )[i];
422  menu.Add( text, i + 1, item->GetMenuImage() );
423  }
424 
425  if( aCollector->m_MenuTitle.Length() )
426  {
427  menu.SetTitle( aCollector->m_MenuTitle );
428  menu.SetIcon( BITMAPS::info );
429  menu.DisplayTitle( true );
430  }
431  else
432  {
433  menu.DisplayTitle( false );
434  }
435 
436  SetContextMenu( &menu, CMENU_NOW );
437 
438  while( TOOL_EVENT* evt = Wait() )
439  {
440  if( evt->Action() == TA_CHOICE_MENU_UPDATE )
441  {
442  if( current )
443  {
444  current->ClearBrightened();
445  getView()->Hide( current, false );
446  highlightGroup.Remove( current );
448  }
449 
450  int id = *evt->GetCommandId();
451 
452  // User has pointed an item, so show it in a different way
453  if( id > 0 && id <= limit )
454  {
455  current = ( *aCollector )[id - 1];
456  current->SetBrightened();
457  getView()->Hide( current, true );
458  highlightGroup.Add( current );
460  }
461  else
462  {
463  current = nullptr;
464  }
465  }
466  else if( evt->Action() == TA_CHOICE_MENU_CHOICE )
467  {
468  OPT<int> id = evt->GetCommandId();
469 
470  // User has selected an item, so this one will be returned
471  if( id && ( *id > 0 ) )
472  current = ( *aCollector )[*id - 1];
473  else
474  current = nullptr;
475 
476  break;
477  }
478  }
479 
480  if( current && current->IsBrightened() )
481  {
482  current->ClearBrightened();
483  getView()->Hide( current, false );
485  }
486 
487  getView()->Remove( &highlightGroup );
488 
489  return current;
490 }
491 
492 
494 {
495  GERBVIEW_FRAME* frame = getEditFrame<GERBVIEW_FRAME>();
496  const GERBER_DRAW_ITEM* item = static_cast<const GERBER_DRAW_ITEM*>( aItem );
497  int layer = item->GetLayer();
498 
499 
500  if( item->GetLayerPolarity() )
501  {
502  // Don't allow selection of invisible negative items
503  auto rs = static_cast<KIGFX::GERBVIEW_RENDER_SETTINGS*>( getView()->GetPainter()->GetSettings() );
504 
505  if( !rs->IsShowNegativeItems() )
506  return false;
507  }
508 
509  // We do not want to select items that are in the background
510  if( frame->GetDisplayOptions().m_HighContrastMode && layer != frame->GetActiveLayer() )
511  return false;
512 
513  return frame->IsLayerVisible( layer );
514 }
515 
516 
518 {
519  if( aItem->IsSelected() )
520  return;
521 
522  m_selection.Add( aItem );
523  getView()->Add( &m_selection, std::numeric_limits<int>::max() );
524  selectVisually( aItem );
525 }
526 
527 
529 {
530  if( !aItem->IsSelected() )
531  return;
532 
533  unselectVisually( aItem );
534  m_selection.Remove( aItem );
535 
536  if( m_selection.Empty() )
537  getView()->Remove( &m_selection );
538 }
539 
540 
542 {
543  // Move the item's layer to the front
544  int layer = static_cast<GERBER_DRAW_ITEM*>( aItem )->GetLayer();
545  m_frame->SetActiveLayer( layer, true );
546 
547  // Hide the original item, so it is shown only on overlay
548  aItem->SetSelected();
549  getView()->Hide( aItem, true );
550 
551  getView()->Update( &m_selection );
552 }
553 
554 
556 {
557  // Restore original item visibility
558  aItem->ClearSelected();
559  getView()->Hide( aItem, false );
560  getView()->Update( aItem, KIGFX::ALL );
561 
562  getView()->Update( &m_selection );
563 }
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:90
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hide the item in the view (e.g.
Definition: view.cpp:1479
void AddMenu(ACTION_MENU *aMenu, const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
Add a submenu to the menu.
currently selected items overlay
Definition: layer_ids.h:215
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:83
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:32
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:348
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:53
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:110
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:208
void SetIsHover(bool aIsHover)
Definition: selection.h:69
void setModifiersState(bool aShiftState, bool aCtrlState, bool aAltState)
Set the configuration of m_additive, m_subtractive, m_exclusive_or, m_skip_heuristics from the state ...
void ClearBrightened()
Definition: eda_item.h:133
void Append(EDA_ITEM *item)
Add an item to the end of the list.
Definition: collector.h:100
int GetCount() const
Return the number of objects in the list.
Definition: collector.h:82
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:609
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:432
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:63
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:57
virtual void SetLayer(int aLayer)
Set layer used to draw the group.
Definition: view_group.h:98
KIGFX::VIEW * getView() const
Returns the instance of #VIEW object used in the application.
Definition: tool_base.cpp:36
wxString UnescapeString(const wxString &aSource)
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:98
wxString m_MenuTitle
Definition: collector.h:243
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.
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:44
wxMenuItem * Add(const wxString &aLabel, int aId, BITMAPS aIcon)
Add a wxWidgets-style entry to the menu.
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:318
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:1512
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