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(
75  _( "Highlight Items of Component \"%s\"" ), 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(
93  _( "Highlight Aperture Type \"%s\"" ), 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 
206  // right click? if there is any object - show the context menu
207  else if( evt->IsClick( BUT_RIGHT ) )
208  {
209  if( m_selection.Empty() )
210  {
211  selectPoint( evt->Position() );
212  m_selection.SetIsHover( true );
213  }
214 
216  }
217 
218  // Middle double click? Do zoom to fit
219  else if( evt->IsDblClick( BUT_MIDDLE ) )
220  {
222  }
223 
224  else if( evt->IsCancel() || evt->Action() == TA_UNDO_REDO_PRE )
225  {
226  clearSelection();
227  }
228 
229  else
230  evt->SetPassEvent();
231  }
232 
233  return 0;
234 }
235 
236 
238 {
239  return m_selection;
240 }
241 
242 
243 bool GERBVIEW_SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag )
244 {
245  EDA_ITEM* item = NULL;
246  GERBER_COLLECTOR collector;
247  EDA_ITEM* model = getModel<EDA_ITEM>();
248 
249  collector.Collect( model, GERBER_COLLECTOR::AllItems, wxPoint( aWhere.x, aWhere.y ) );
250 
251  // Remove unselectable items
252  for( int i = collector.GetCount() - 1; i >= 0; --i )
253  {
254  if( !selectable( collector[i] ) )
255  collector.Remove( i );
256  }
257 
258  if( collector.GetCount() > 1 )
259  {
260  if( aOnDrag )
262 
263  item = disambiguationMenu( &collector );
264 
265  if( item )
266  {
267  collector.Empty();
268  collector.Append( item );
269  }
270  }
271 
273  clearSelection();
274 
275  if( collector.GetCount() == 1 )
276  {
277  item = collector[ 0 ];
278 
279  if( m_subtractive || ( m_exclusive_or && item->IsSelected() ) )
280  {
281  unselect( item );
283  return false;
284  }
285  else
286  {
287  select( item );
289  return true;
290  }
291  }
292 
293  return false;
294 }
295 
296 
297 bool GERBVIEW_SELECTION_TOOL::selectCursor( bool aSelectAlways )
298 {
299  if( aSelectAlways || m_selection.Empty() )
300  {
301  clearSelection();
302  selectPoint( getViewControls()->GetCursorPosition( false ) );
303  }
304 
305  return !m_selection.Empty();
306 }
307 
308 
310 {
316 }
317 
318 
320 {
321  clearSelection();
322 
323  return 0;
324 }
325 
326 
328 {
329  std::vector<EDA_ITEM*>* items = aEvent.Parameter<std::vector<EDA_ITEM*>*>();
330 
331  if( items )
332  {
333  // Perform individual selection of each item before processing the event.
334  for( auto item : *items )
335  select( item );
336 
338  }
339 
340  return 0;
341 }
342 
343 
345 {
346  // Check if there is an item to be selected
347  EDA_ITEM* item = aEvent.Parameter<EDA_ITEM*>();
348 
349  if( item )
350  {
351  select( item );
352 
353  // Inform other potentially interested tools
355  }
356 
357  return 0;
358 }
359 
360 
362 {
363  std::vector<EDA_ITEM*>* items = aEvent.Parameter<std::vector<EDA_ITEM*>*>();
364 
365  if( items )
366  {
367  // Perform individual unselection of each item before processing the event
368  for( auto item : *items )
369  unselect( item );
370 
372  }
373 
374  return 0;
375 }
376 
377 
379 {
380  // Check if there is an item to be selected
381  EDA_ITEM* item = aEvent.Parameter<EDA_ITEM*>();
382 
383  if( item )
384  {
385  unselect( item );
386 
387  // Inform other potentially interested tools
389  }
390 
391  return 0;
392 }
393 
394 
396 {
397  if( m_selection.Empty() )
398  return;
399 
400  for( auto item : m_selection )
401  unselectVisually( static_cast<EDA_ITEM*>( item ) );
402 
403  m_selection.Clear();
404 
405  // Inform other potentially interested tools
407 }
408 
409 
411 {
412  EDA_ITEM* current = NULL;
413  KIGFX::VIEW_GROUP highlightGroup;
414  ACTION_MENU menu( true );
415 
416  highlightGroup.SetLayer( LAYER_SELECT_OVERLAY );
417  getView()->Add( &highlightGroup );
418 
419  int limit = std::min( 10, aCollector->GetCount() );
420 
421  for( int i = 0; i < limit; ++i )
422  {
423  wxString text;
424  EDA_ITEM* item = ( *aCollector )[i];
425  text = item->GetSelectMenuText( m_frame->GetUserUnits() );
426  menu.Add( text, i + 1, item->GetMenuImage() );
427  }
428 
429  menu.SetTitle( _( "Clarify selection" ) );
430  menu.SetIcon( info_xpm );
431  menu.DisplayTitle( true );
432  SetContextMenu( &menu, CMENU_NOW );
433 
434  while( TOOL_EVENT* evt = Wait() )
435  {
436  if( evt->Action() == TA_CHOICE_MENU_UPDATE )
437  {
438  if( current )
439  {
440  current->ClearBrightened();
441  getView()->Hide( current, false );
442  highlightGroup.Remove( current );
444  }
445 
446  int id = *evt->GetCommandId();
447 
448  // User has pointed an item, so show it in a different way
449  if( id > 0 && id <= limit )
450  {
451  current = ( *aCollector )[id - 1];
452  current->SetBrightened();
453  getView()->Hide( current, true );
454  highlightGroup.Add( current );
456  }
457  else
458  {
459  current = NULL;
460  }
461  }
462  else if( evt->Action() == TA_CHOICE_MENU_CHOICE )
463  {
464  OPT<int> id = evt->GetCommandId();
465 
466  // User has selected an item, so this one will be returned
467  if( id && ( *id > 0 ) )
468  current = ( *aCollector )[*id - 1];
469  else
470  current = NULL;
471 
472  break;
473  }
474  }
475 
476  if( current && current->IsBrightened() )
477  {
478  current->ClearBrightened();
479  getView()->Hide( current, false );
481  }
482 
483  getView()->Remove( &highlightGroup );
484 
485  return current;
486 }
487 
488 
490 {
491  GERBVIEW_FRAME* frame = getEditFrame<GERBVIEW_FRAME>();
492  const GERBER_DRAW_ITEM* item = static_cast<const GERBER_DRAW_ITEM*>( aItem );
493  int layer = item->GetLayer();
494 
495 
496  if( item->GetLayerPolarity() )
497  {
498  // Don't allow selection of invisible negative items
499  auto rs = static_cast<KIGFX::GERBVIEW_RENDER_SETTINGS*>( getView()->GetPainter()->GetSettings() );
500  if( !rs->IsShowNegativeItems() )
501  return false;
502  }
503 
504  // We do not want to select items that are in the background
505  if( frame->GetDisplayOptions().m_HighContrastMode && layer != frame->GetActiveLayer() )
506  return false;
507 
508  return frame->IsLayerVisible( layer );
509 }
510 
511 
513 {
514  if( aItem->IsSelected() )
515  return;
516 
517  m_selection.Add( aItem );
518  getView()->Add( &m_selection, std::numeric_limits<int>::max() );
519  selectVisually( aItem );
520 }
521 
522 
524 {
525  if( !aItem->IsSelected() )
526  return;
527 
528  unselectVisually( aItem );
529  m_selection.Remove( aItem );
530 
531  if( m_selection.Empty() )
532  getView()->Remove( &m_selection );
533 }
534 
535 
537 {
538  // Move the item's layer to the front
539  int layer = static_cast<GERBER_DRAW_ITEM*>( aItem )->GetLayer();
540  m_frame->SetActiveLayer( layer, true );
541 
542  // Hide the original item, so it is shown only on overlay
543  aItem->SetSelected();
544  getView()->Hide( aItem, true );
545 
546  getView()->Update( &m_selection );
547 }
548 
549 
551 {
552  // Restore original item visibility
553  aItem->ClearSelected();
554  getView()->Hide( aItem, false );
555  getView()->Update( aItem, KIGFX::ALL );
556 
557  getView()->Update( &m_selection );
558 }
ACTION_MENU * create() const override
Returns an instance of this class. It has to be overridden in inheriting classes.
void Empty()
Function Empty sets the list to empty.
Definition: collector.h:113
void Hide(VIEW_ITEM *aItem, bool aHide=true)
Temporarily hides the item in the view (e.g.
Definition: view.cpp:1480
void AddMenu(ACTION_MENU *aMenu, const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
Adds a submenu to the menu.
wxMenuItem * Add(const wxString &aLabel, int aId, const BITMAP_OPAQUE *aIcon)
Adds a wxWidgets-style entry to the menu.
static TOOL_ACTION selectionClear
Clears the current selection.
static const TOOL_EVENT SelectedEvent
Definition: actions.h:208
TOOL_MENU m_menu
functions below are not yet implemented - their interface may change
virtual void Clear() override
Function Clear() Removes all the stored items from the group.
Definition: selection.h:94
bool Init() override
Function Init() Init() is called once upon a registration of the tool.
TOOL_EVENT * Wait(const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY))
Function Wait()
bool selectPoint(const VECTOR2I &aWhere, bool aOnDrag=false)
Function selectPoint() Selects an item pointed by the parameter aWhere.
bool IsSelected() const
Definition: eda_item.h:191
Model changes (required full reload)
Definition: tool_base.h:82
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:209
Defines the structure of a menu based on ACTIONs.
Definition: action_menu.h:43
print info associated to a component (TO.C attribute)
bool selectable(const EDA_ITEM *aItem) const
Function selectable() Checks conditions for an item to be selected.
void update() override
Update menu state stub.
void ClearSelected()
Definition: eda_item.h:199
VIEW_CONTROLS class definition.
GERBER_COLLECTOR is intended for use when the right click button is pressed, or when the plain "arrow...
EDA_ITEM * disambiguationMenu(GERBER_COLLECTOR *aItems)
Function disambiguationMenu() Handles the menu that allows one to select one of many items in case th...
CONDITIONAL_MENU & GetMenu()
Function GetMenu.
Definition: tool_menu.cpp:46
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
int GetLayer() const
Function GetLayer returns the layer this item is on.
virtual void Remove(VIEW_ITEM *aItem)
Function Remove() Removes a VIEW_ITEM from the view.
Definition: view.cpp:357
void SetActiveLayer(int aLayer, bool doLayerWidgetUpdate=true)
Function SetActiveLayer will change the currently active layer to aLayer and update the GERBER_LAYER_...
void SetBrightened()
Definition: eda_item.h:197
static TOOL_ACTION zoomFitScreen
Definition: actions.h:94
void selectVisually(EDA_ITEM *aItem)
Function selectVisually() Marks 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)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:141
int Main(const TOOL_EVENT &aEvent)
Function Main()
const GBR_DISPLAY_OPTIONS & GetDisplayOptions() const
bool IsBrightened() const
Definition: eda_item.h:193
void UpdateAll()
Runs 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)
Function SetContextMenu()
Item needs to be redrawn.
Definition: view_item.h:63
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))
Function Go()
void Remove(int aIndex)
Function Remove removes the item at aIndex (first position is 0);.
Definition: collector.h:133
void SetCurrentCursor(KICURSOR cursor)
Function SetCurrentCursor Set the current cursor shape for this panel.
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:201
void SetIsHover(bool aIsHover)
Definition: selection.h:65
virtual void Add(EDA_ITEM *aItem)
Definition: selection.h:75
void ClearBrightened()
Definition: eda_item.h:200
void Append(EDA_ITEM *item)
Function Append adds an item to the end of the list.
Definition: collector.h:123
int GetCount() const
Function GetCount returns the number of objects in the list.
Definition: collector.h:104
int UnselectItem(const TOOL_EVENT &aEvent)
void setTransitions() override
Sets up handlers for various events.
void Reset(RESET_REASON aReason) override
Function Reset() Brings 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:196
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target 'dirty' flag.
Definition: view.h:571
bool ProcessEvent(const TOOL_EVENT &aEvent)
Propagates an event to tools that requested events of matching type(s).
static TOOL_ACTION highlightAttribute
T Parameter() const
Function Parameter() Returns a non-standard parameter assigned to the event.
Definition: tool_event.h:435
void SetIcon(const BITMAP_OPAQUE *aIcon)
Assigns an icon for the entry.
Definition: action_menu.cpp:71
TOOL_EVENT.
Definition: tool_event.h:171
bool ToolStackIsEmpty()
Definition: tools_holder.h:136
const BITMAP_OPAQUE net_highlight_schematic_xpm[1]
Items that may change while the view stays the same (noncached)
Definition: definitions.h:50
virtual void Remove(VIEW_ITEM *aItem)
Function Remove() Removes an item from the group.
Definition: view_group.cpp:61
VIEW_GROUP extends VIEW_ITEM by possibility of grouping items into a single object.
static const TOOL_EVENT ClearedEvent
Definition: actions.h:210
void unselect(EDA_ITEM *aItem)
Function unselect() Takes necessary action mark an item as unselected.
int UpdateMenu(const TOOL_EVENT &aEvent)
void unselectVisually(EDA_ITEM *aItem)
Function unselectVisually() Marks item as selected, but does not add it to the ITEMS_PICKED_LIST.
GERBVIEW_SELECTION & GetSelection()
Function GetSelection()
static TOOL_ACTION updateMenu
Definition: actions.h:167
virtual void Add(VIEW_ITEM *aItem)
Function Add() Adds an item to the group.
Definition: view_group.cpp:55
const BITMAP_OPAQUE info_xpm[1]
Definition: info.cpp:75
virtual void SetLayer(int aLayer)
Function SetLayer() Sets layer used to draw the group.
Definition: view_group.h:115
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:120
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)
Function Format outputs 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
Function GetAdapter Returns pointer to current settings that are going to be used when drawing items.
int GetActiveLayer() const
Function SetActiveLayer returns the active layer.
GERBVIEW_SELECTION_TOOL.
void SetTitle(const wxString &aTitle) override
Sets 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)
Function SetHighlight Turns on/off highlighting - it may be done for the active layer or the specifie...
static TOOL_ACTION highlightClear
#define _(s)
Definition: 3d_actions.cpp:33
int UnselectItems(const TOOL_EVENT &aEvent)
wxString UnescapeString(const wxString &aSource)
Definition: string.cpp:152
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
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)
Function CreateSubMenu.
Definition: tool_menu.cpp:52
bool selectCursor(bool aSelectAlways=false)
Function selectCursor() Selects an item under the cursor unless there is something already selected o...
currently selected items overlay
EDA_ITEM is a base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:148
RESET_REASON
Determines the reason of reset for a tool
Definition: tool_base.h:79
void select(EDA_ITEM *aItem)
Function select() Takes necessary action mark an item as selected.
boost::optional< T > OPT
Definition: optional.h:7
void clearSelection()
Function clearSelection() Clears the current selection.
print info associated to a flashed pad (TO.P attribute)
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:327
int ClearSelection(const TOOL_EVENT &aEvent)
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
bool IsLayerVisible(int aLayer) const
Function IsLayerVisible tests whether a given layer is visible.
virtual BITMAP_DEF GetMenuImage() const
Function GetMenuImage returns a pointer to an image to be used in menus.
Definition: eda_item.cpp:221
print info associated to a net (TO.N attribute)
bool GetLayerPolarity() const
void ShowContextMenu(SELECTION &aSelection)
Function ShowContextMenu.
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, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1513
void DisplayTitle(bool aDisplay=true)
Decides whether a title for a pop up menu should be displayed.
static TOOL_ACTION highlightComponent
virtual void Remove(EDA_ITEM *aItem)
Definition: selection.h:86