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 <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( NULL ),
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  // Restore previous properties of selected items and remove them from containers
179  clearSelection();
180 
181  // Reinsert the VIEW_GROUP, in case it was removed from the VIEW
182  getView()->Remove( &m_selection );
183  getView()->Add( &m_selection );
184 }
185 
186 
188 {
189  // Main loop: keep receiving events
190  while( TOOL_EVENT* evt = Wait() )
191  {
192  if( m_frame->ToolStackIsEmpty() )
194 
196 
197  if( evt->Modifier( MD_SHIFT ) && evt->Modifier( MD_CTRL ) )
198  m_subtractive = true;
199  else if( evt->Modifier( MD_SHIFT ) )
200  m_additive = true;
201  else if( evt->Modifier( MD_CTRL ) )
202  m_exclusive_or = true;
203 
204  // single click? Select single object
205  if( evt->IsClick( BUT_LEFT ) )
206  {
207  selectPoint( evt->Position() );
208  }
209  // right click? if there is any object - show the context menu
210  else if( evt->IsClick( BUT_RIGHT ) )
211  {
212  if( m_selection.Empty() )
213  {
214  selectPoint( evt->Position() );
215  m_selection.SetIsHover( true );
216  }
217 
219  }
220  // Middle double click? Do zoom to fit
221  else if( evt->IsDblClick( BUT_MIDDLE ) )
222  {
224  }
225  else if( evt->IsCancel() || evt->Action() == TA_UNDO_REDO_PRE )
226  {
227  clearSelection();
228  }
229  else
230  {
231  evt->SetPassEvent();
232  }
233  }
234 
235  return 0;
236 }
237 
238 
240 {
241  return m_selection;
242 }
243 
244 
245 bool GERBVIEW_SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag )
246 {
247  EDA_ITEM* item = NULL;
248  GERBER_COLLECTOR collector;
249  EDA_ITEM* model = getModel<EDA_ITEM>();
250 
251  collector.Collect( model, GERBER_COLLECTOR::AllItems, wxPoint( aWhere.x, aWhere.y ) );
252 
253  // Remove unselectable items
254  for( int i = collector.GetCount() - 1; i >= 0; --i )
255  {
256  if( !selectable( collector[i] ) )
257  collector.Remove( i );
258  }
259 
260  if( collector.GetCount() > 1 )
261  {
262  if( aOnDrag )
264 
265  item = disambiguationMenu( &collector );
266 
267  if( item )
268  {
269  collector.Empty();
270  collector.Append( item );
271  }
272  }
273 
275  clearSelection();
276 
277  if( collector.GetCount() == 1 )
278  {
279  item = collector[ 0 ];
280 
281  if( m_subtractive || ( m_exclusive_or && item->IsSelected() ) )
282  {
283  unselect( item );
285  return false;
286  }
287  else
288  {
289  select( item );
291  return true;
292  }
293  }
294 
295  return false;
296 }
297 
298 
299 bool GERBVIEW_SELECTION_TOOL::selectCursor( bool aSelectAlways )
300 {
301  if( aSelectAlways || m_selection.Empty() )
302  {
303  clearSelection();
304  selectPoint( getViewControls()->GetCursorPosition( false ) );
305  }
306 
307  return !m_selection.Empty();
308 }
309 
310 
312 {
318 }
319 
320 
322 {
323  clearSelection();
324 
325  return 0;
326 }
327 
328 
330 {
331  std::vector<EDA_ITEM*>* items = aEvent.Parameter<std::vector<EDA_ITEM*>*>();
332 
333  if( items )
334  {
335  // Perform individual selection of each item before processing the event.
336  for( EDA_ITEM* item : *items )
337  select( item );
338 
340  }
341 
342  return 0;
343 }
344 
345 
347 {
348  // Check if there is an item to be selected
349  EDA_ITEM* item = aEvent.Parameter<EDA_ITEM*>();
350 
351  if( item )
352  {
353  select( item );
354 
355  // Inform other potentially interested tools
357  }
358 
359  return 0;
360 }
361 
362 
364 {
365  std::vector<EDA_ITEM*>* items = aEvent.Parameter<std::vector<EDA_ITEM*>*>();
366 
367  if( items )
368  {
369  // Perform individual unselection of each item before processing the event
370  for( EDA_ITEM* item : *items )
371  unselect( item );
372 
374  }
375 
376  return 0;
377 }
378 
379 
381 {
382  // Check if there is an item to be selected
383  EDA_ITEM* item = aEvent.Parameter<EDA_ITEM*>();
384 
385  if( item )
386  {
387  unselect( item );
388 
389  // Inform other potentially interested tools
391  }
392 
393  return 0;
394 }
395 
396 
398 {
399  if( m_selection.Empty() )
400  return;
401 
402  for( EDA_ITEM* item : m_selection )
403  unselectVisually( item );
404 
405  m_selection.Clear();
406 
407  // Inform other potentially interested tools
409 }
410 
411 
413 {
414  EDA_ITEM* current = NULL;
415  KIGFX::VIEW_GROUP highlightGroup;
416  ACTION_MENU menu( true );
417 
418  highlightGroup.SetLayer( LAYER_SELECT_OVERLAY );
419  getView()->Add( &highlightGroup );
420 
421  int limit = std::min( 10, aCollector->GetCount() );
422 
423  for( int i = 0; i < limit; ++i )
424  {
425  wxString text;
426  EDA_ITEM* item = ( *aCollector )[i];
428  menu.Add( text, i + 1, item->GetMenuImage() );
429  }
430 
431  if( aCollector->m_MenuTitle.Length() )
432  {
433  menu.SetTitle( aCollector->m_MenuTitle );
434  menu.SetIcon( BITMAPS::info );
435  menu.DisplayTitle( true );
436  }
437  else
438  {
439  menu.DisplayTitle( false );
440  }
441 
442  SetContextMenu( &menu, CMENU_NOW );
443 
444  while( TOOL_EVENT* evt = Wait() )
445  {
446  if( evt->Action() == TA_CHOICE_MENU_UPDATE )
447  {
448  if( current )
449  {
450  current->ClearBrightened();
451  getView()->Hide( current, false );
452  highlightGroup.Remove( current );
454  }
455 
456  int id = *evt->GetCommandId();
457 
458  // User has pointed an item, so show it in a different way
459  if( id > 0 && id <= limit )
460  {
461  current = ( *aCollector )[id - 1];
462  current->SetBrightened();
463  getView()->Hide( current, true );
464  highlightGroup.Add( current );
466  }
467  else
468  {
469  current = NULL;
470  }
471  }
472  else if( evt->Action() == TA_CHOICE_MENU_CHOICE )
473  {
474  OPT<int> id = evt->GetCommandId();
475 
476  // User has selected an item, so this one will be returned
477  if( id && ( *id > 0 ) )
478  current = ( *aCollector )[*id - 1];
479  else
480  current = NULL;
481 
482  break;
483  }
484  }
485 
486  if( current && current->IsBrightened() )
487  {
488  current->ClearBrightened();
489  getView()->Hide( current, false );
491  }
492 
493  getView()->Remove( &highlightGroup );
494 
495  return current;
496 }
497 
498 
500 {
501  GERBVIEW_FRAME* frame = getEditFrame<GERBVIEW_FRAME>();
502  const GERBER_DRAW_ITEM* item = static_cast<const GERBER_DRAW_ITEM*>( aItem );
503  int layer = item->GetLayer();
504 
505 
506  if( item->GetLayerPolarity() )
507  {
508  // Don't allow selection of invisible negative items
509  auto rs = static_cast<KIGFX::GERBVIEW_RENDER_SETTINGS*>( getView()->GetPainter()->GetSettings() );
510  if( !rs->IsShowNegativeItems() )
511  return false;
512  }
513 
514  // We do not want to select items that are in the background
515  if( frame->GetDisplayOptions().m_HighContrastMode && layer != frame->GetActiveLayer() )
516  return false;
517 
518  return frame->IsLayerVisible( layer );
519 }
520 
521 
523 {
524  if( aItem->IsSelected() )
525  return;
526 
527  m_selection.Add( aItem );
528  getView()->Add( &m_selection, std::numeric_limits<int>::max() );
529  selectVisually( aItem );
530 }
531 
532 
534 {
535  if( !aItem->IsSelected() )
536  return;
537 
538  unselectVisually( aItem );
539  m_selection.Remove( aItem );
540 
541  if( m_selection.Empty() )
542  getView()->Remove( &m_selection );
543 }
544 
545 
547 {
548  // Move the item's layer to the front
549  int layer = static_cast<GERBER_DRAW_ITEM*>( aItem )->GetLayer();
550  m_frame->SetActiveLayer( layer, true );
551 
552  // Hide the original item, so it is shown only on overlay
553  aItem->SetSelected();
554  getView()->Hide( aItem, true );
555 
556  getView()->Update( &m_selection );
557 }
558 
559 
561 {
562  // Restore original item visibility
563  aItem->ClearSelected();
564  getView()->Hide( aItem, false );
565  getView()->Update( aItem, KIGFX::ALL );
566 
567  getView()->Update( &m_selection );
568 }
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:201
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.
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:173
Model changes (required full reload)
Definition: tool_base.h:81
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:202
Defines the structure of a menu based on ACTIONs.
Definition: action_menu.h:47
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 SetIcon(BITMAPS aIcon)
Assign an icon for the entry.
Definition: action_menu.cpp:72
void update() override
Update menu state stub.
void ClearSelected()
Definition: eda_item.h:182
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:352
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:180
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:176
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:67
virtual void Add(EDA_ITEM *aItem)
Definition: selection.h:77
void ClearBrightened()
Definition: eda_item.h:183
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:179
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
int m_Num_Dcode
D code value ( >= 10 )
Definition: dcode.h:96
Generic, UI-independent tool event.
Definition: tool_event.h:173
bool ToolStackIsEmpty()
Definition: tools_holder.h:117
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:203
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
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:90
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:151
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:107
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:206
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.
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:150
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)
static TOOL_ACTION highlightDCode
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
Definition: view.cpp:322
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.
static TOOL_ACTION highlightComponent
virtual void Remove(EDA_ITEM *aItem)
Definition: selection.h:88