KiCad PCB EDA Suite
pcb_inspection_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) 2019-2020 KiCad Developers, see AUTHORS.txt for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22  */
23 
24 #include <bitmaps.h>
25 #include <class_pcb_group.h>
26 #include <tool/tool_manager.h>
27 #include <tools/selection_tool.h>
29 #include <tools/edit_tool.h>
30 #include <pcb_painter.h>
32 #include <profile.h>
34 #include <drc/drc_engine.h>
37 #include "pcb_inspection_tool.h"
38 
39 
41  PCB_TOOL_BASE( "pcbnew.InspectionTool" ),
42  m_frame( nullptr )
43 {
44  m_probingSchToPcb = false;
45  m_lastNetcode = -1;
46  m_dynamicData = nullptr;
47 }
48 
49 
51 {
52 public:
54  {
56  SetTitle( _( "Net Tools" ) );
57 
60  // Add( PCB_ACTIONS::highlightNet );
61  }
62 
63 private:
64  ACTION_MENU* create() const override
65  {
66  return new NET_CONTEXT_MENU();
67  }
68 };
69 
70 
72 {
73  SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
74 
75  auto netSubMenu = std::make_shared<NET_CONTEXT_MENU>();
76  netSubMenu->SetTool( this );
77 
78  static KICAD_T connectedTypes[] = { PCB_TRACE_T, PCB_VIA_T, PCB_ARC_T, PCB_PAD_T,
80 
81  CONDITIONAL_MENU& menu = selectionTool->GetToolMenu().GetMenu();
82 
83  selectionTool->GetToolMenu().AddSubMenu( netSubMenu );
84 
85  menu.AddMenu( netSubMenu.get(), SELECTION_CONDITIONS::OnlyTypes( connectedTypes ), 200 );
87 
88  return true;
89 }
90 
91 
93 {
94  m_frame = getEditFrame<PCB_EDIT_FRAME>();
95 }
96 
97 
99 {
101  dialog.ShowModal();
102  return 0;
103 }
104 
105 
107 {
109  wxString source;
110  ZONE_CONNECTION connection = aZone->GetPadConnection( aPad, &source );
111 
112  r->Report( "" );
113 
114  r->Report( wxString::Format( _( "Zone connection type: %s." ),
115  connectionEnum.ToString( aZone->GetPadConnection() ) ) );
116 
117  if( source != _( "zone" ) )
118  {
119  r->Report( wxString::Format( _( "Overridden by %s; connection type: %s." ),
120  source,
121  connectionEnum.ToString( connection ) ) );
122  }
123 
124  // Resolve complex connection types into simple types
125  if( connection == ZONE_CONNECTION::THT_THERMAL )
126  {
127  if( aPad->GetAttribute() == PAD_ATTRIB_STANDARD )
128  {
129  connection = ZONE_CONNECTION::THERMAL;
130  }
131  else
132  {
133  connection = ZONE_CONNECTION::FULL;
134  r->Report( wxString::Format( _( "Pad is not a PTH pad; connection will be: %s." ),
135  connectionEnum.ToString( ZONE_CONNECTION::FULL ) ) );
136  }
137  }
138 
139  r->Report( "" );
140 
141  // Process simple connection types
142  if( connection == ZONE_CONNECTION::THERMAL )
143  {
144  int gap = aZone->GetThermalReliefGap();
145 
146  r->Report( wxString::Format( _( "Zone thermal relief: %s." ),
147  StringFromValue( r->GetUnits(), gap, true ) ) );
148 
149  gap = aZone->GetThermalReliefGap( aPad, &source );
150 
151  if( source != _( "zone" ) )
152  {
153  r->Report( wxString::Format( _( "Overridden by %s; thermal relief: %s." ),
154  source,
155  StringFromValue( r->GetUnits(), gap, true ) ) );
156  }
157  }
158  else if( connection == ZONE_CONNECTION::NONE )
159  {
160  int clearance = aZone->GetLocalClearance();
161 
162  r->Report( wxString::Format( _( "Zone clearance: %s." ),
163  StringFromValue( r->GetUnits(), clearance, true ) ) );
164 
165  if( aZone->GetThermalReliefGap( aPad ) > clearance )
166  {
167  clearance = aZone->GetThermalReliefGap( aPad, &source );
168 
169  if( source != _( "zone" ) )
170  {
171  r->Report( wxString::Format( _( "Overridden by larger thermal relief from %s;"
172  "clearance: %s." ),
173  source,
174  StringFromValue( r->GetUnits(), clearance, true ) ) );
175  }
176  }
177  }
178  else
179  {
180  r->Report( _( "Clearance is 0." ) );
181  }
182 }
183 
184 
186  BOARD_ITEM* aB, REPORTER* r )
187 {
188  r->Report( "" );
189 
191 
192  try
193  {
194  drcEngine.InitEngine( m_frame->GetDesignRulesPath() );
195  }
196  catch( PARSE_ERROR& pe )
197  {
198  m_frame->ShowBoardSetupDialog( _( "Rules" ), pe.What(), ID_RULES_EDITOR,
199  pe.lineNumber, pe.byteIndex );
200  return;
201  }
202 
203  auto constraint = drcEngine.EvalRulesForItems( DRC_CONSTRAINT_TYPE_CLEARANCE, aA, aB,
204  aLayer, r );
205 
206  if( r )
207  {
208  wxString clearance = StringFromValue( r->GetUnits(), constraint.m_Value.Min(), true );
209 
210  r->Report( "" );
211  r->Report( wxString::Format( _( "Clearance: %s." ), clearance ) );
212  }
213 }
214 
215 
217 {
219  const PCBNEW_SELECTION& selection = selTool->GetSelection();
221 
222  if( selection.Size() != 2 )
223  {
224  m_frame->ShowInfoBarError( _( "Select two items for a clearance resolution report." ) );
225  return 0;
226  }
227 
228  if( m_inspectClearanceDialog == nullptr )
229  {
230  m_inspectClearanceDialog = std::make_unique<DIALOG_HTML_REPORTER>( m_frame );
231  m_inspectClearanceDialog->SetTitle( _( "Clearance Report" ) );
232 
233  m_inspectClearanceDialog->Connect( wxEVT_CLOSE_WINDOW,
235  nullptr, this );
236  }
237 
239  r->SetUnits( m_frame->GetUserUnits() );
240  r->Clear();
241 
242  BOARD_ITEM* a = static_cast<BOARD_ITEM*>( selection.GetItem( 0 ) );
243  BOARD_ITEM* b = static_cast<BOARD_ITEM*>( selection.GetItem( 1 ) );
244 
245  if( a->Type() != PCB_ZONE_AREA_T && b->Type() == PCB_ZONE_AREA_T )
246  std::swap( a, b );
247  else if( !a->IsConnected() && b->IsConnected() )
248  std::swap( a, b );
249 
250  if( !IsCopperLayer( layer ) )
251  {
252  r->Report( wxString::Format( _( "Active layer (%s) is not a copper layer. "
253  "No clearance defined." ),
254  m_frame->GetBoard()->GetLayerName( layer ) ) );
255  }
256  else if( !a->GetLayerSet().test( layer ) )
257  {
258  r->Report( wxString::Format( _( "%s not present on layer %s. No clearance defined." ),
259  a->GetSelectMenuText( r->GetUnits() ),
260  m_frame->GetBoard()->GetLayerName( layer ) ) );
261  }
262  else if( !b->GetLayerSet().test( layer ) )
263  {
264  r->Report( wxString::Format( _( "%s not present on layer %s. No clearance defined." ),
265  b->GetSelectMenuText( r->GetUnits() ),
266  m_frame->GetBoard()->GetLayerName( layer ) ) );
267  }
268  else if( !a->IsConnected() )
269  {
270  r->Report( _( "Items have no electrical connections. No clearance defined." ) );
271  }
272  else
273  {
274  r->Report( _( "<h7>Clearance resolution for:</h7>" ) );
275 
276  r->Report( wxString::Format( _( "<ul><li>Layer %s</li><li>%s</li><li>%s</li></ul>" ),
277  m_frame->GetBoard()->GetLayerName( layer ),
278  a->GetSelectMenuText( r->GetUnits() ),
279  b->GetSelectMenuText( r->GetUnits() ) ) );
280 
281  BOARD_CONNECTED_ITEM* ac = dynamic_cast<BOARD_CONNECTED_ITEM*>( a );
282  BOARD_CONNECTED_ITEM* bc = dynamic_cast<BOARD_CONNECTED_ITEM*>( b );
283 
284  if( ac && bc && ac->GetNetCode() > 0 && ac->GetNetCode() == bc->GetNetCode() )
285  {
286  // Same nets....
287 
288  if( ac->Type() == PCB_ZONE_AREA_T && bc->Type() == PCB_PAD_T )
289  {
290  reportZoneConnection( static_cast<ZONE_CONTAINER*>( ac ),
291  static_cast<D_PAD*>( bc ), r );
292  }
293  else
294  {
295  r->Report( _( "Items belong to the same net. Clearance is 0." ) );
296  }
297  }
298  else if( ac )
299  {
300  // Different nets (or second unconnected)....
301  reportCopperClearance( layer, ac, b, r );
302  }
303  }
304 
305  r->Flush();
306 
307  m_inspectClearanceDialog->Show( true );
308  return 0;
309 }
310 
311 
313 {
315  const PCBNEW_SELECTION& selection = selTool->GetSelection();
316 
317  if( selection.Size() != 1 )
318  {
319  m_frame->ShowInfoBarError( _( "Select an item for a constraints resolution report." ) );
320  return 0;
321  }
322 
323  if( m_inspectConstraintsDialog == nullptr )
324  {
325  m_inspectConstraintsDialog = std::make_unique<DIALOG_CONSTRAINTS_REPORTER>( m_frame );
326  m_inspectConstraintsDialog->SetTitle( _( "Constraints Report" ) );
327 
328  m_inspectConstraintsDialog->Connect( wxEVT_CLOSE_WINDOW,
330  nullptr, this );
331  }
332 
333  m_inspectConstraintsDialog->DeleteAllPages();
334 
335  BOARD_ITEM* item = static_cast<BOARD_ITEM*>( selection.GetItem( 0 ) );
337 
338  try
339  {
340  drcEngine.InitEngine( m_frame->GetDesignRulesPath() );
341  }
342  catch( PARSE_ERROR& pe )
343  {
344  m_frame->ShowBoardSetupDialog( _( "Rules" ), pe.What(), ID_RULES_EDITOR,
345  pe.lineNumber, pe.byteIndex );
346  return 1;
347  }
348 
349  if( item->Type() == PCB_TRACE_T )
350  {
351  WX_HTML_REPORT_BOX* r = m_inspectConstraintsDialog->AddPage( "Track Width" );
352 
353  r->Report( _( "<h7>Track width resolution for:</h7>" ) );
354  r->Report( wxString::Format( _( "<ul><li>%s</li></ul>" ),
355  item->GetSelectMenuText( r->GetUnits() ) ) );
356  r->Report( "" );
357 
358  auto constraint = drcEngine.EvalRulesForItems( DRC_CONSTRAINT_TYPE_TRACK_WIDTH, item,
359  nullptr, UNDEFINED_LAYER, r );
360 
361  wxString min = _( "undefined" );
362  wxString max = _( "undefined" );
363 
364  if( constraint.m_Value.HasMin() )
365  min = StringFromValue( r->GetUnits(), constraint.m_Value.Min(), true );
366 
367  if( constraint.m_Value.HasMax() )
368  max = StringFromValue( r->GetUnits(), constraint.m_Value.Max(), true );
369 
370  r->Report( "" );
371  r->Report( wxString::Format( _( "Width constraints: min %s max %s." ),
372  min,
373  max ) );
374  r->Flush();
375  }
376 
377  if( item->Type() == PCB_VIA_T )
378  {
379  WX_HTML_REPORT_BOX* r = m_inspectConstraintsDialog->AddPage( "Via Diameter" );
380 
381  r->Report( _( "<h7>Via diameter resolution for:</h7>" ) );
382  r->Report( wxString::Format( _( "<ul><li>%s</li></ul>" ),
383  item->GetSelectMenuText( r->GetUnits() ) ) );
384  r->Report( "" );
385 
386  auto constraint = drcEngine.EvalRulesForItems( DRC_CONSTRAINT_TYPE_VIA_DIAMETER, item,
387  nullptr, UNDEFINED_LAYER, r );
388 
389  wxString min = _( "undefined" );
390  wxString max = _( "undefined" );
391 
392  if( constraint.m_Value.HasMin() )
393  min = StringFromValue( r->GetUnits(), constraint.m_Value.Min(), true );
394 
395  if( constraint.m_Value.HasMax() )
396  max = StringFromValue( r->GetUnits(), constraint.m_Value.Max(), true );
397 
398  r->Report( "" );
399  r->Report( wxString::Format( _( "Diameter constraints: min %s max %s." ),
400  min,
401  max ) );
402  r->Flush();
403 
404 
405  r = m_inspectConstraintsDialog->AddPage( "Via Annular Width" );
406 
407  r->Report( _( "<h7>Via annular width resolution for:</h7>" ) );
408  r->Report( wxString::Format( _( "<ul><li>%s</li></ul>" ),
409  item->GetSelectMenuText( r->GetUnits() ) ) );
410  r->Report( "" );
411 
412  constraint = drcEngine.EvalRulesForItems( DRC_CONSTRAINT_TYPE_ANNULAR_WIDTH, item,
413  nullptr, UNDEFINED_LAYER, r );
414 
415  min = _( "undefined" );
416  max = _( "undefined" );
417 
418  if( constraint.m_Value.HasMin() )
419  min = StringFromValue( r->GetUnits(), constraint.m_Value.Min(), true );
420 
421  if( constraint.m_Value.HasMax() )
422  max = StringFromValue( r->GetUnits(), constraint.m_Value.Max(), true );
423 
424  r->Report( "" );
425  r->Report( wxString::Format( _( "Annular width constraints: min %s max %s." ),
426  min,
427  max ) );
428  r->Flush();
429  }
430 
431  if( ( item->Type() == PCB_PAD_T && static_cast<D_PAD*>( item )->GetDrillSize().x > 0 )
432  || item->Type() == PCB_VIA_T )
433  {
434  WX_HTML_REPORT_BOX* r = m_inspectConstraintsDialog->AddPage( "Hole Size" );
435 
436  r->Report( _( "<h7>Hole diameter resolution for:</h7>" ) );
437  r->Report( wxString::Format( _( "<ul><li>%s</li></ul>" ),
438  item->GetSelectMenuText( r->GetUnits() ) ) );
439  r->Report( "" );
440 
441  auto constraint = drcEngine.EvalRulesForItems( DRC_CONSTRAINT_TYPE_HOLE_SIZE, item,
442  nullptr, UNDEFINED_LAYER, r );
443 
444  wxString min = _( "undefined" );
445 
446  if( constraint.m_Value.HasMin() )
447  min = StringFromValue( r->GetUnits(), constraint.m_Value.Min(), true );
448 
449  r->Report( "" );
450  r->Report( wxString::Format( _( "Hole constraint: min %s." ), min ) );
451  r->Flush();
452  }
453 
454  m_inspectConstraintsDialog->FinishInitialization();
455  m_inspectConstraintsDialog->Show( true );
456  return 0;
457 }
458 
459 
461 {
462  // Don't get in an infinite loop PCB -> SCH -> PCB -> SCH -> ...
463  if( m_probingSchToPcb )
464  return 0;
465 
467  const PCBNEW_SELECTION& selection = selTool->GetSelection();
468 
469  if( selection.Size() == 1 )
470  m_frame->SendMessageToEESCHEMA( static_cast<BOARD_ITEM*>( selection.Front() ) );
471  else
472  m_frame->SendMessageToEESCHEMA( nullptr );
473 
474  return 0;
475 }
476 
477 
479 {
480  BOARD_ITEM* item = aEvent.Parameter<BOARD_ITEM*>();
481 
482  m_probingSchToPcb = true; // recursion guard
483  {
485 
486  if( item )
487  m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, (void*) item );
488  }
489  m_probingSchToPcb = false;
490 
491  return 0;
492 }
493 
494 
502  bool PCB_INSPECTION_TOOL::highlightNet( const VECTOR2D& aPosition, bool aUseSelection )
503 {
504  BOARD* board = static_cast<BOARD*>( m_toolMgr->GetModel() );
506 
507  int net = -1;
508  bool enableHighlight = false;
509 
510  if( aUseSelection )
511  {
512  SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
513 
514  const PCBNEW_SELECTION& selection = selectionTool->GetSelection();
515 
516  for( auto item : selection )
517  {
518  if( auto ci = dyn_cast<BOARD_CONNECTED_ITEM*>( item ) )
519  {
520  int item_net = ci->GetNetCode();
521 
522  if( net < 0 )
523  net = item_net;
524  else if( net != item_net ) // more than one net selected: do nothing
525  return false;
526  }
527  }
528 
529  enableHighlight = ( net >= 0 && !settings->GetHighlightNetCodes().count( net ) );
530  }
531 
532  // If we didn't get a net to highlight from the selection, use the cursor
533  if( net < 0 )
534  {
535  auto guide = m_frame->GetCollectorsGuide();
536  GENERAL_COLLECTOR collector;
537 
538  // Find a connected item for which we are going to highlight a net
539  collector.Collect( board, GENERAL_COLLECTOR::PadsOrTracks, (wxPoint) aPosition, guide );
540 
541  if( collector.GetCount() == 0 )
542  collector.Collect( board, GENERAL_COLLECTOR::Zones, (wxPoint) aPosition, guide );
543 
544  // Clear the previous highlight
545  m_frame->SendMessageToEESCHEMA( nullptr );
546 
547  for( int i = 0; i < collector.GetCount(); i++ )
548  {
549  if( ( collector[i]->GetLayerSet() & LSET::AllCuMask() ).none() )
550  collector.Remove( i );
551 
552  if( collector[i]->Type() == PCB_PAD_T )
553  {
554  m_frame->SendMessageToEESCHEMA( static_cast<BOARD_CONNECTED_ITEM*>( collector[i] ) );
555  break;
556  }
557  }
558 
559  enableHighlight = ( collector.GetCount() > 0 );
560 
561  // Obtain net code for the clicked item
562  if( enableHighlight )
563  net = static_cast<BOARD_CONNECTED_ITEM*>( collector[0] )->GetNetCode();
564  }
565 
566  auto& netcodes = settings->GetHighlightNetCodes();
567 
568  // Toggle highlight when the same net was picked
569  if( net > 0 && netcodes.count( net ) )
570  enableHighlight = !settings->IsHighlightEnabled();
571 
572  if( enableHighlight != settings->IsHighlightEnabled()
573  || !netcodes.count( net ) )
574  {
575  if( !netcodes.empty() )
576  m_lastNetcode = *netcodes.begin();
577 
578  settings->SetHighlight( enableHighlight, net );
580  }
581 
582  // Store the highlighted netcode in the current board (for dialogs for instance)
583  if( enableHighlight && net >= 0 )
584  {
585  board->SetHighLightNet( net );
586  board->HighLightON();
587 
588  NETINFO_ITEM* netinfo = board->FindNet( net );
589 
590  if( netinfo )
591  {
592  MSG_PANEL_ITEMS items;
593  netinfo->GetMsgPanelInfo( m_frame, items );
594  m_frame->SetMsgPanel( items );
596  }
597  }
598  else
599  {
603  }
604 
605  return true;
606 }
607 
608 
610 {
611  int netcode = aEvent.Parameter<intptr_t>();
613  const std::set<int>& highlighted = settings->GetHighlightNetCodes();
614 
615  if( netcode > 0 )
616  {
617  m_lastNetcode = highlighted.empty() ? -1 : *highlighted.begin();
618  settings->SetHighlight( true, netcode );
620  }
621  else if( aEvent.IsAction( &PCB_ACTIONS::toggleLastNetHighlight ) )
622  {
623  int temp = highlighted.empty() ? -1 : *highlighted.begin();
624  settings->SetHighlight( true, m_lastNetcode );
626  m_lastNetcode = temp;
627  }
628  else // Highlight the net belonging to the item under the cursor
629  {
630  highlightNet( getViewControls()->GetMousePosition(), false );
631  }
632 
633  return 0;
634 }
635 
636 
638 {
639  BOARD* board = static_cast<BOARD*>( m_toolMgr->GetModel() );
641 
643  settings->SetHighlight( false );
647  return 0;
648 }
649 
650 
652 {
653  std::string tool = aEvent.GetCommandStr().get();
655 
656  // Deactivate other tools; particularly important if another PICKER is currently running
657  Activate();
658 
659  // If the keyboard hotkey was triggered and we are already in the highlight tool, behave
660  // the same as a left-click. Otherwise highlight the net of the selected item(s), or if
661  // there is no selection, then behave like a ctrl-left-click.
663  {
664  bool use_selection = m_frame->IsCurrentTool( PCB_ACTIONS::highlightNetTool );
665  highlightNet( getViewControls()->GetMousePosition(), use_selection );
666  }
667 
668  picker->SetClickHandler(
669  [this] ( const VECTOR2D& pt ) -> bool
670  {
671  highlightNet( pt, false );
672  return true;
673  } );
674 
675  picker->SetLayerSet( LSET::AllCuMask() );
676 
677  m_toolMgr->RunAction( ACTIONS::pickerTool, true, &tool );
678 
679  return 0;
680 }
681 
682 
684 {
685  std::string tool = aEvent.GetCommandStr().get();
687  BOARD* board = getModel<BOARD>();
688  auto& opt = displayOptions();
689 
690  // Deactivate other tools; particularly important if another PICKER is currently running
691  Activate();
692 
693  picker->SetClickHandler(
694  [this, board, opt]( const VECTOR2D& pt ) -> bool
695  {
696  SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
697 
700  PCBNEW_SELECTION& selection = selectionTool->GetSelection();
701 
702  if( selection.Empty() )
703  {
706  selection = selectionTool->GetSelection();
707  }
708 
709  if( selection.Empty() )
710  {
711  // Clear the previous local ratsnest if we click off all items
712  for( MODULE* mod : board->Modules() )
713  {
714  for( D_PAD* pad : mod->Pads() )
715  pad->SetLocalRatsnestVisible( opt.m_ShowGlobalRatsnest );
716  }
717  }
718  else
719  {
720  for( auto item : selection )
721  {
722  if( D_PAD* pad = dyn_cast<D_PAD*>(item) )
723  {
724  pad->SetLocalRatsnestVisible( !pad->GetLocalRatsnestVisible() );
725  }
726  else if( MODULE* mod = dyn_cast<MODULE*>(item) )
727  {
728  if( !mod->Pads().empty() )
729  {
730  bool enable = !( *( mod->Pads().begin() ) )->GetLocalRatsnestVisible();
731 
732  for( auto modpad : mod->Pads() )
733  modpad->SetLocalRatsnestVisible( enable );
734  }
735  }
736  }
737  }
738 
740 
741  return true;
742  } );
743 
744  picker->SetFinalizeHandler(
745  [board, opt] ( int aCondition )
746  {
747  if( aCondition != PCBNEW_PICKER_TOOL::END_ACTIVATE )
748  {
749  for( MODULE* mod : board->Modules() )
750  {
751  for( D_PAD* pad : mod->Pads() )
752  pad->SetLocalRatsnestVisible( opt.m_ShowGlobalRatsnest );
753  }
754  }
755  } );
756 
757  m_toolMgr->RunAction( ACTIONS::pickerTool, true, &tool );
758 
759  return 0;
760 }
761 
762 
764 {
765  VECTOR2I delta;
766 
767  // If we have passed the simple move vector, we can update without recalculation
768  if( aEvent.Parameter<VECTOR2I*>() )
769  {
770  delta = *aEvent.Parameter<VECTOR2I*>();
771  delete aEvent.Parameter<VECTOR2I*>();
772  }
773  else
774  {
775  // We can delete the existing map to force a recalculation
776  delete m_dynamicData;
777  m_dynamicData = nullptr;
778  }
779 
780  auto selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
781  auto& selection = selectionTool->GetSelection();
782  auto connectivity = getModel<BOARD>()->GetConnectivity();
783 
784  if( selection.Empty() )
785  {
786  connectivity->ClearDynamicRatsnest();
787  delete m_dynamicData;
788  m_dynamicData = nullptr;
789  }
790  else
791  {
793  }
794 
795  return 0;
796 }
797 
798 
800 {
801  getModel<BOARD>()->GetConnectivity()->ClearDynamicRatsnest();
802  delete m_dynamicData;
803  m_dynamicData = nullptr;
804 
805  return 0;
806 }
807 
808 
810 {
811  SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
812  SELECTION& selection = selectionTool->GetSelection();
813  std::shared_ptr<CONNECTIVITY_DATA> connectivity = board()->GetConnectivity();
814  std::vector<BOARD_ITEM*> items;
815  std::deque<EDA_ITEM*> queued_items( selection.begin(), selection.end() );
816 
817  for( std::size_t i = 0; i < queued_items.size(); ++i )
818  {
819  BOARD_ITEM* item = static_cast<BOARD_ITEM*>( queued_items[i] );
820 
821  if( item->Type() == PCB_MODULE_T )
822  {
823  for( auto pad : static_cast<MODULE*>( item )->Pads() )
824  {
825  if( pad->GetLocalRatsnestVisible() || displayOptions().m_ShowModuleRatsnest )
826  items.push_back( pad );
827  }
828  }
829  else if( item->Type() == PCB_GROUP_T )
830  {
831  PCB_GROUP *group = static_cast<PCB_GROUP*>( item );
832  group->RunOnDescendants( [ &queued_items ]( BOARD_ITEM *aItem )
833  { queued_items.push_back( aItem );} );
834  }
835  else if( BOARD_CONNECTED_ITEM* boardItem = dyn_cast<BOARD_CONNECTED_ITEM*>( item ) )
836  {
837  if( boardItem->GetLocalRatsnestVisible() || displayOptions().m_ShowModuleRatsnest )
838  items.push_back( boardItem );
839  }
840  }
841 
842  if( items.empty() || std::none_of( items.begin(), items.end(), []( const BOARD_ITEM* aItem )
843  { return( aItem->Type() == PCB_TRACE_T || aItem->Type() == PCB_PAD_T ||
844  aItem->Type() == PCB_ARC_T || aItem->Type() == PCB_ZONE_AREA_T ||
845  aItem->Type() == PCB_MODULE_T || aItem->Type() == PCB_VIA_T ); } ) )
846  {
847  return;
848  }
849 
850  if( !m_dynamicData )
851  {
852  m_dynamicData = new CONNECTIVITY_DATA( items, true );
853  connectivity->BlockRatsnestItems( items );
854  }
855  else
856  {
857  m_dynamicData->Move( aDelta );
858  }
859 
860  connectivity->ComputeDynamicRatsnest( items, m_dynamicData );
861 }
862 
863 
865 {
866  if( m_listNetsDialog == nullptr )
867  {
869  std::make_unique<DIALOG_SELECT_NET_FROM_LIST>( m_frame, m_listNetsDialogSettings );
870 
871  m_listNetsDialog->Connect( wxEVT_CLOSE_WINDOW,
872  wxCommandEventHandler( PCB_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr,
873  this );
874 
875  m_listNetsDialog->Connect( wxEVT_BUTTON,
876  wxCommandEventHandler( PCB_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr,
877  this );
878  }
879 
880  m_listNetsDialog->Show( true );
881  return 0;
882 }
883 
884 
885 void PCB_INSPECTION_TOOL::onListNetsDialogClosed( wxCommandEvent& event )
886 {
888 
889  m_listNetsDialog->Disconnect( wxEVT_CLOSE_WINDOW,
890  wxCommandEventHandler( PCB_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr, this );
891 
892  m_listNetsDialog->Disconnect( wxEVT_BUTTON,
893  wxCommandEventHandler( PCB_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr, this );
894 
895  m_listNetsDialog->Destroy();
896  m_listNetsDialog.release();
897 }
898 
899 
901 {
902  m_inspectClearanceDialog->Disconnect( wxEVT_CLOSE_WINDOW,
903  wxCommandEventHandler( PCB_INSPECTION_TOOL::onInspectClearanceDialogClosed ), nullptr, this );
904 
905  m_inspectClearanceDialog->Destroy();
906  m_inspectClearanceDialog.release();
907 }
908 
909 
911 {
912  m_inspectConstraintsDialog->Disconnect( wxEVT_CLOSE_WINDOW,
913  wxCommandEventHandler( PCB_INSPECTION_TOOL::onInspectConstraintsDialogClosed ), nullptr, this );
914 
915  m_inspectConstraintsDialog->Destroy();
916  m_inspectConstraintsDialog.release();
917 }
918 
919 
921 {
922  doHideNet( aEvent.Parameter<intptr_t>(), true );
923  return 0;
924 }
925 
926 
928 {
929  doHideNet( aEvent.Parameter<intptr_t>(), false );
930  return 0;
931 }
932 
933 
934 void PCB_INSPECTION_TOOL::doHideNet( int aNetCode, bool aHide )
935 {
936  KIGFX::PCB_RENDER_SETTINGS* rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>(
938 
939  SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<SELECTION_TOOL>();
940  SELECTION& selection = selectionTool->GetSelection();
941 
942  if( aNetCode <= 0 && !selection.Empty() )
943  {
944  for( EDA_ITEM* item : selection )
945  {
946  if( BOARD_CONNECTED_ITEM* bci = dynamic_cast<BOARD_CONNECTED_ITEM*>( item ) )
947  {
948  if( bci->GetNetCode() > 0 )
949  doHideNet( bci->GetNetCode(), aHide );
950  }
951  }
952 
953  return;
954  }
955 
956  if( aHide )
957  rs->GetHiddenNets().insert( aNetCode );
958  else
959  rs->GetHiddenNets().erase( aNetCode );
960 
962  m_frame->GetCanvas()->Refresh();
963 }
964 
965 
967 {
971 
975 
980 
988 
991 }
void SetUnits(EDA_UNITS aUnits)
static TOOL_ACTION selectionClear
Clears the current selection.
Definition: pcb_actions.h:62
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:749
void AddMenu(ACTION_MENU *aMenu, const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
Adds a submenu to the menu.
std::set< int > & GetHiddenNets()
Definition: pcb_painter.h:184
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
ZONE_CONNECTION
How pads are covered by copper in zone.
Definition: zones.h:41
int UpdateSelectionRatsnest(const TOOL_EVENT &aEvent)
Updates ratsnest for selected items.
Design Rule Checker object that performs all the DRC tests.
Definition: drc_engine.h:81
ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:61
wxMenuItem * Add(const wxString &aLabel, int aId, const BITMAP_OPAQUE *aIcon)
Adds a wxWidgets-style entry to the menu.
KIGFX::VIEW * GetView() const
Definition: tool_manager.h:289
bool IsCurrentTool(const TOOL_ACTION &aAction) const
static const TOOL_EVENT SelectedEvent
Definition: actions.h:206
int GetNetCode() const
Function GetNetCode.
void SendCrossProbeNetName(const wxString &aNetName)
Sends a net name to eeschema for highlighting.
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
BOARD * board() const
int HighlightNet(const TOOL_EVENT &aEvent)
Highlights net belonging to the item under the cursor.
RENDER_SETTINGS Contains all the knowledge about how graphical objects are drawn on any output surfac...
wxString GetDesignRulesPath()
Returns the absolute path to the design rules file for the currently-loaded board.
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:207
void HighLightON(bool aValue=true)
Enable or disable net highlighting.
Defines the structure of a menu based on ACTIONs.
Definition: action_menu.h:43
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
DIALOG_SELECT_NET_FROM_LIST::SETTINGS m_listNetsDialogSettings
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:109
WX_HTML_REPORT_BOX.
static TOOL_ACTION hideNet
Definition: pcb_actions.h:441
int InspectClearance(const TOOL_EVENT &aEvent)
Show the clearance resolution for two selected items
virtual EDA_UNITS GetUnits() const
Definition: reporter.h:121
static TOOL_ACTION highlightItem
Definition: pcb_actions.h:440
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Function Report is a pure virtual function to override in the derived object.
PCB_GROUP is a set of BOARD_ITEMs (i.e., without duplicates)
void Collect(BOARD_ITEM *aItem, const KICAD_T aScanList[], const wxPoint &aRefPos, const COLLECTORS_GUIDE &aGuide)
Scan a BOARD_ITEM using this class's Inspector method, which does the collection.
Definition: collectors.cpp:580
static TOOL_ACTION boardStatistics
Definition: pcb_actions.h:427
static SELECTION_CONDITION OnlyTypes(const KICAD_T aTypes[])
Creates a functor that tests if the selected items are only of given types.
SELECTION_TOOL.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
int InspectConstraints(const TOOL_EVENT &aEvent)
CONDITIONAL_MENU & GetMenu()
Function GetMenu.
Definition: tool_menu.cpp:46
TOOL_MANAGER * m_toolMgr
Definition: tool_base.h:219
ITER end()
Definition: selection.h:62
static TOOL_ACTION cancelInteractive
Definition: actions.h:65
class ZONE_CONTAINER, a zone area
Definition: typeinfo.h:106
int HighlightNetTool(const TOOL_EVENT &aEvent)
Launches a tool to pick the item whose net is going to be highlighted.
static ENUM_MAP< T > & Instance()
Definition: property.h:517
TOOL_MENU & GetToolMenu()
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:140
void onInspectConstraintsDialogClosed(wxCommandEvent &aEvent)
class ARC, an arc track segment on a copper layer
Definition: typeinfo.h:98
void reportCopperClearance(PCB_LAYER_ID aLayer, BOARD_CONNECTED_ITEM *aA, BOARD_ITEM *aB, REPORTER *r)
int GetLocalClearance(wxString *aSource) const override
Function GetLocalClearance returns any local clearances set in the "classic" (ie: pre-rule) system.
Definition: class_zone.cpp:468
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: class_board.h:515
int CrossProbePcbToSch(const TOOL_EVENT &aEvent)
Notifies eeschema about the selected item.
class D_PAD, a pad in a footprint
Definition: typeinfo.h:90
static const KICAD_T PadsOrTracks[]
A scan list for PADs, TRACKs, or VIAs.
Definition: collectors.h:298
bool highlightNet(const VECTOR2D &aPosition, bool aUseSelection)
Look for a BOARD_CONNECTED_ITEM in a given spot and if one is found - it enables highlight for its ne...
static TOOL_ACTION localRatsnestTool
Definition: pcb_actions.h:445
REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:64
static SELECTION_CONDITION Count(int aNumber)
Creates a functor that tests if the number of selected items is equal to the value given as parameter...
void reportZoneConnection(ZONE_CONTAINER *aZone, D_PAD *aPad, REPORTER *r)
std::unique_ptr< DIALOG_SELECT_NET_FROM_LIST > m_listNetsDialog
static TOOL_ACTION toggleLastNetHighlight
Definition: pcb_actions.h:437
bool Init() override
Function Init() Init() is called once upon a registration of the tool.
BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected and have...
int HideNet(const TOOL_EVENT &aEvent)
Hide the ratsnest for a given net
EDA_ITEM * GetModel() const
Definition: tool_manager.h:296
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
void Go(int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY))
Function Go()
void SetFinalizeHandler(FINALIZE_HANDLER aHandler)
Function SetFinalizeHandler() Sets a handler for the finalize event.
void Remove(int aIndex)
Function Remove removes the item at aIndex (first position is 0);.
Definition: collector.h:130
search types array terminator (End Of Types)
Definition: typeinfo.h:82
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
Definition: typeinfo.h:78
PAINTER * GetPainter() const
Function GetPainter() Returns the painter object used by the view for drawing VIEW_ITEMS.
Definition: view.h:199
PAD_ATTR_T GetAttribute() const
Definition: class_pad.h:335
void RedrawRatsnest()
Forces refresh of the ratsnest visual representation
void onListNetsDialogClosed(wxCommandEvent &aEvent)
int ShowStatisticsDialog(const TOOL_EVENT &aEvent)
Function ShowStatisticDialog()
class TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:96
bool IsAction(const TOOL_ACTION *aAction) const
Function IsAction() Tests if the event contains an action issued upon activation of the given TOOL_AC...
Definition: tool_event.cpp:67
static TOOL_ACTION inspectConstraints
Definition: pcb_actions.h:431
PCBNEW_SELECTION & GetSelection()
Function GetSelection()
void doHideNet(int aNetCode, bool aHide)
static TOOL_ACTION pickerTool
Definition: actions.h:151
virtual PCB_LAYER_ID GetActiveLayer() const
static TOOL_ACTION highlightNetTool
Definition: pcb_actions.h:438
PCB_RENDER_SETTINGS Stores PCB specific render settings.
Definition: pcb_painter.h:64
int GetCount() const
Function GetCount returns the number of objects in the list.
Definition: collector.h:101
ITER begin()
Definition: selection.h:61
class MODULE, a footprint
Definition: typeinfo.h:89
PCB_EDIT_FRAME * m_frame
PCB_LAYER_ID
A quick note on layer IDs:
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide()
Function GetCollectorsGuide.
Generic tool for picking a point.
void ResetNetHighLight()
Reset all high light data to the init state.
pads are covered by copper
const PCBNEW_SELECTION & selection() const
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:29
MODULES & Modules()
Definition: class_board.h:247
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
void MarkTargetDirty(int aTarget)
Function MarkTargetDirty() Sets or clears target 'dirty' flag.
Definition: view.h:569
int lineNumber
at which line number, 1 based index.
Definition: ki_exception.h:125
static void FootprintFilter(const VECTOR2I &, GENERAL_COLLECTOR &aCollector, SELECTION_TOOL *sTool)
Function FootprintFilter() A selection filter which prunes the selection to contain only items of typ...
Definition: edit_tool.cpp:1517
int HighlightItem(const TOOL_EVENT &aEvent)
Performs the appropriate action in response to an eeschema cross-probe.
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
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: class_board.h:343
static const KICAD_T Zones[]
A scan list for zones outlines only.
Definition: collectors.h:277
const wxString & GetNetname() const
Function GetNetname.
Definition: netinfo.h:231
Items that may change while the view stays the same (noncached)
Definition: definitions.h:50
static const TOOL_EVENT ClearedEvent
Definition: actions.h:208
CONNECTIVITY_DATA * m_dynamicData
void calculateSelectionRatsnest(const VECTOR2I &aDelta)
Recalculates dynamic ratsnest for the current selection
void SetHighLightNet(int aNetCode, bool aMulti=false)
Select the netcode to be highlighted.
void ShowInfoBarError(const wxString &aErrorMsg)
virtual KIGFX::VIEW_ITEM * GetItem(unsigned int aIdx) const override
Definition: selection.h:105
static TOOL_ACTION hideDynamicRatsnest
Definition: pcb_actions.h:446
void RunOnDescendants(const std::function< void(BOARD_ITEM *)> &aFunction)
Invokes a function on all descendents of the group.
KIGFX::VIEW * getView() const
Function getView()
Definition: tool_base.cpp:36
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:121
Thermal relief only for THT pads.
static TOOL_ACTION inspectClearance
Definition: pcb_actions.h:430
const PCB_DISPLAY_OPTIONS & displayOptions() const
static TOOL_ACTION clearHighlight
Definition: pcb_actions.h:435
int HideDynamicRatsnest(const TOOL_EVENT &aEvent)
Hides ratsnest for selected items. Called when there are no items selected.
int GetThermalReliefGap() const
Definition: class_zone.h:172
void Reset(RESET_REASON aReason) override
Function Reset() Brings the tool to a known, initial state.
std::unique_ptr< DIALOG_HTML_REPORTER > m_inspectClearanceDialog
OPT< std::string > GetCommandStr() const
Definition: tool_event.h:463
Use thermal relief for pads.
EDA_UNITS GetUnits() const override
void SendMessageToEESCHEMA(BOARD_ITEM *objectToSync)
Function SendMessageToEESCHEMA sends a message to the schematic editor so that it may move its cursor...
virtual RENDER_SETTINGS * GetSettings()=0
Function GetAdapter Returns pointer to current settings that are going to be used when drawing items.
NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:65
static TOOL_ACTION showNet
Definition: pcb_actions.h:442
Struct PARSE_ERROR contains a filename or source description, a problem input line,...
Definition: ki_exception.h:123
void SetTitle(const wxString &aTitle) override
Sets title for the menu.
Definition: action_menu.cpp:89
static TOOL_ACTION highlightNet
Definition: pcb_actions.h:436
static TOOL_ACTION highlightNetSelection
Definition: pcb_actions.h:439
std::unique_ptr< DIALOG_CONSTRAINTS_REPORTER > m_inspectConstraintsDialog
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:201
#define ID_RULES_EDITOR
void setTransitions() override
Bind handlers to corresponding TOOL_ACTIONs
Information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:176
void SetLayerSet(LSET aLayerSet)
Function SetLayerSet() Sets the tool's snap layer set.
int LocalRatsnestTool(const TOOL_EVENT &aEvent)
Shows local ratsnest of a component
#define _(s)
Definition: 3d_actions.cpp:33
static TOOL_ACTION listNets
Definition: pcb_actions.h:331
Used when the right click button is pressed, or when the select tool is in effect.
Definition: collectors.h:240
DIALOG_BOARD_STATISTIC.
virtual wxString GetSelectMenuText(EDA_UNITS aUnits) const
Function GetSelectMenuText returns the text to display to be used in the selection clarification cont...
void AddSubMenu(std::shared_ptr< ACTION_MENU > aSubMenu)
Function CreateSubMenu.
Definition: tool_menu.cpp:52
static void PadFilter(const VECTOR2I &, GENERAL_COLLECTOR &aCollector, SELECTION_TOOL *sTool)
Function PadFilter() A selection filter which prunes the selection to contain only items of type PCB_...
Definition: edit_tool.cpp:1505
static TOOL_ACTION selectItem
Selects an item (specified as the event parameter).
Definition: pcb_actions.h:65
int Size() const
Returns the number of selected parts.
Definition: selection.h:127
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:159
Pads are not covered.
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
Definition: msgpanel.h:102
RESET_REASON
Determines the reason of reset for a tool
Definition: tool_base.h:79
int byteIndex
at which byte offset within the line, 1 based index
Definition: ki_exception.h:126
ZONE_CONNECTION GetPadConnection(D_PAD *aPad, wxString *aSource=nullptr) const
Definition: class_zone.cpp:764
int ListNets(const TOOL_EVENT &aEvent)
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
void Activate()
Function Activate() Runs the tool.
virtual bool IsConnected() const
Function IsConnected() Returns information if the object is derived from BOARD_CONNECTED_ITEM.
class VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:97
void onInspectClearanceDialogClosed(wxCommandEvent &aEvent)
const std::set< int > & GetHighlightNetCodes() const
Function GetHighlightNetCode Returns netcode of currently highlighted net.
static TOOL_ACTION updateLocalRatsnest
Definition: pcb_actions.h:447
BOARD * GetBoard() const
int ClearHighlight(const TOOL_EVENT &aEvent)
Clears all board highlights
KIGFX::VIEW_CONTROLS * getViewControls() const
Function getViewControls()
Definition: tool_base.cpp:42
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Function GetMsgPanelInfo returns the information about the NETINFO_ITEM in aList to display in the me...
void UpdateAllLayersColor()
Function UpdateAllLayersColor() Applies the new coloring scheme to all layers.
Definition: view.cpp:794
void AddItem(const TOOL_ACTION &aAction, const SELECTION_CONDITION &aCondition, int aOrder=ANY_ORDER)
Adds a menu entry to run a TOOL_ACTION on selected items.
void ShowBoardSetupDialog(const wxString &aInitialPage=wxEmptyString, const wxString &aErrorMsg=wxEmptyString, int aErrorCtrlId=-1, int aErrorLine=-1, int aErrorCol=-1)
Function ShowBoardSetupDialog.
wxString StringFromValue(EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol, bool aUseMils, EDA_DATA_TYPE aType)
Function StringFromValue returns the string from aValue according to units (inch, mm ....
Definition: base_units.cpp:233
void Move(const VECTOR2I &aDelta)
Moves the connectivity list anchors.
static TOOL_ACTION selectionCursor
Select a single item under the cursor position.
Definition: pcb_actions.h:59
EDA_UNITS GetUserUnits() const
Return the user units currently in use.
void InitEngine(const wxFileName &aRulePath)
Initializes the DRC engine.
Definition: drc_engine.cpp:367
int ShowNet(const TOOL_EVENT &aEvent)
Show the ratsnest for a given net
virtual LSET GetLayerSet() const
Function GetLayerSet returns a std::bitset of all layers on which the item physically resides.
EDA_ITEM * Front() const
Definition: selection.h:184
Class to handle a set of BOARD_ITEMs.
const wxString & ToString(T value) const
Definition: property.h:537
ACTION_MENU * create() const override
Returns an instance of this class. It has to be overridden in inheriting classes.
KICAD_T Type() const
Function Type()
Definition: base_struct.h:193
const BITMAP_OPAQUE ratsnest_xpm[1]
void SetClickHandler(CLICK_HANDLER aHandler)
Function SetClickHandler() Sets a handler for mouse click event.