94 std::shared_ptr<NET_CONTEXT_MENU> netSubMenu = std::make_shared<NET_CONTEXT_MENU>();
95 netSubMenu->SetTool(
this );
98 auto showNetMenuFunc =
101 if( aSelection.Empty() )
104 for(
const EDA_ITEM* item : aSelection )
106 switch( item->Type() )
117 if( !
static_cast<const PCB_SHAPE*
>( item )->IsOnCopperLayer() )
135 menu.
AddMenu( netSubMenu.get(), showNetMenuFunc, 100 );
156 bool* aCourtyardError )
158 auto engine = std::make_unique<DRC_ENGINE>(
m_frame->GetBoard(),
159 &
m_frame->GetBoard()->GetDesignSettings() );
163 engine->InitEngine(
m_frame->GetDesignRulesPath() );
168 *aCompileError =
true;
172 zone->CacheBoundingBox();
177 zone->CacheBoundingBox();
182 *aCourtyardError =
true;
209 + wxString::Format(
_(
"[netclass %s]" ),
220 std::vector<BOARD_ITEM*> toAdd;
222 for(
int i = 0; i < aCollector.
GetCount(); ++i )
228 group->RunOnChildren(
237 toAdd.push_back( child );
243 if(
pad->HitTest( aPos ) )
244 toAdd.push_back(
pad );
253 aCollector.
Append( item );
255 bool hasPadOrTrack =
false;
257 for(
int i = 0; i < aCollector.
GetCount(); ++i )
259 KICAD_T type = aCollector[i]->Type();
264 hasPadOrTrack =
true;
269 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
286 const wxString& aPrompt,
287 const std::vector<KICAD_T>& aTypes,
297 statusPopup.SetText( aPrompt );
300 picker->SetSnapping(
false );
301 picker->ClearHandlers();
303 picker->SetClickHandler(
304 [&](
const VECTOR2D& aPoint ) ->
bool
313 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
327 pickedItem = collector[0];
333 picker->SetMotionHandler(
343 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
356 if( highlightedItem != item )
358 if( highlightedItem && highlightedItem != aLockedHighlight )
361 highlightedItem = item;
363 if( highlightedItem && highlightedItem != aLockedHighlight )
368 picker->SetCancelHandler(
371 if( highlightedItem && highlightedItem != aLockedHighlight )
374 highlightedItem =
nullptr;
379 picker->SetFinalizeHandler(
380 [&](
const int& aFinalState )
382 if( highlightedItem && highlightedItem != aLockedHighlight )
385 highlightedItem =
nullptr;
393 m_frame->GetCanvas()->SetStatusPopup( statusPopup.GetPanel() );
397 while( !done && !pickedItem )
405 picker->ClearHandlers();
406 m_frame->GetCanvas()->SetStatusPopup(
nullptr );
415 r->
Report(
_(
"Report incomplete: could not compile custom design rules." )
416 + wxS(
" " )
417 + wxS(
"<a href='$CUSTOM_RULES'>" ) +
_(
"Show design rules." ) + wxS(
"</a>" ) );
440 wxString layerStr =
_(
"Layer" ) + wxS(
" " ) +
m_frame->GetBoard()->GetLayerName( aLayer );
454 return wxT(
"<i>" ) +
_(
"undefined" ) + wxT(
"</i>" );
463 return wxT(
"<i>" ) +
_(
"undefined" ) + wxT(
"</i>" );
472 return wxT(
"<i>" ) +
_(
"undefined" ) + wxT(
"</i>" );
506 return wxEmptyString;
514 wxCHECK( drcTool &&
m_frame, );
535 bool compileError =
false;
536 bool courtyardError =
false;
537 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
542 wxString clearanceStr;
544 switch( aDRCItem->GetErrorCode() )
548 for(
KIID id : aDRCItem->GetIDs() )
557 reportHeader(
_(
"Diff pair uncoupled length resolution for:" ), ac, bc, r );
565 r->
Report( wxString::Format(
_(
"Resolved max uncoupled length: %s." ),
580 r->
Report( wxString::Format(
_(
"Resolved height constraints: min %s; max %s." ),
595 r->
Report( wxString::Format(
_(
"Resolved thickness constraints: min %s; max %s." ),
610 r->
Report( wxString::Format(
_(
"Resolved width constraints: min %s; max %s." ),
625 r->
Report( wxString::Format(
_(
"Resolved angle constraints: min %s; max %s." ),
632 reportHeader(
_(
"Track segment length resolution for:" ), a, r );
640 r->
Report( wxString::Format(
_(
"Resolved segment length constraints: min %s; max %s." ),
647 reportHeader(
_(
"Connection width resolution for:" ), a, b, r );
655 r->
Report( wxString::Format(
_(
"Resolved min connection width: %s." ),
669 r->
Report( wxString::Format(
_(
"Resolved diameter constraints: min %s; max %s." ),
676 reportHeader(
_(
"Via annular width resolution for:" ), a, r );
684 r->
Report( wxString::Format(
_(
"Resolved annular width constraints: min %s; max %s." ),
700 r->
Report( wxString::Format(
_(
"Resolved hole size constraints: min %s; max %s." ),
707 reportHeader(
_(
"Hole clearance resolution for:" ), a, b, r );
715 r->
Report(
_(
"Items belong to the same net. Clearance is 0." ) );
724 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
730 reportHeader(
_(
"Physical hole clearance resolution for:" ), a, b, layer, r );
739 r->
Report(
_(
"No 'physical_hole_clearance' constraints defined." ) );
744 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
751 reportHeader(
_(
"Hole-to-hole clearance resolution for:" ), a, b, r );
761 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
766 reportHeader(
_(
"Edge clearance resolution for:" ), a, b, r );
776 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
810 reportHeader(
_(
"Clearance resolution for:" ), a, b, layer, r );
818 r->
Report(
_(
"Items belong to the same net. Clearance is 0." ) );
827 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
833 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, layer, r );
842 r->
Report(
_(
"No 'physical_clearance' constraints defined." ) );
847 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
859 drcEngine->ProcessAssertions( a, [](
const DRC_CONSTRAINT* c ){}, r );
869 dialog->
Show(
true );
879 wxCHECK( selTool, 0 );
887 if( !
selection.GetItem( 0 )->IsBOARD_ITEM() || !
selection.GetItem( 1 )->IsBOARD_ITEM() )
902 static const std::vector<KICAD_T> clearanceTypes = {
918 _(
"Select first item for clearance resolution..." ),
919 clearanceTypes,
nullptr );
929 _(
"Select second item for clearance resolution..." ),
930 clearanceTypes, firstItem );
937 if( firstItem == secondItem )
939 m_frame->ShowInfoBarError(
_(
"Select two different items for clearance resolution." ) );
951 wxCHECK(
m_frame && aItemA && aItemB, );
962 m_frame->ShowInfoBarError(
_(
"Cannot generate clearance report on empty group." ) );
975 m_frame->ShowInfoBarError(
_(
"Cannot generate clearance report on empty group." ) );
985 auto checkFootprint =
988 PAD* foundPad =
nullptr;
992 if( !foundPad ||
pad->SameLogicalPadAs( foundPad ) )
1005 a = checkFootprint(
static_cast<FOOTPRINT*
>( a ) );
1008 b = checkFootprint(
static_cast<FOOTPRINT*
>( b ) );
1030 ZONE* zone =
dynamic_cast<ZONE*
>( a );
1037 bool compileError =
false;
1038 bool courtyardError =
false;
1039 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
1041 if( copperIntersection.any() && zone &&
pad && zone->
GetNetCode() ==
pad->GetNetCode() )
1051 reportHeader(
_(
"Zone connection resolution for:" ), a, b, layer, r );
1053 constraint = drcEngine->EvalZoneConnection(
pad, zone, layer, r );
1059 reportHeader(
_(
"Thermal-relief gap resolution for:" ), a, b, layer, r );
1068 r->
Report( wxString::Format(
_(
"Resolved thermal relief gap: %s." ),
1069 m_frame->StringFromValue( gap,
true ) ) );
1073 reportHeader(
_(
"Thermal-relief spoke width resolution for:" ), a, b, layer, r );
1082 r->
Report( wxString::Format(
_(
"Resolved spoke width: %s." ),
1083 m_frame->StringFromValue( width,
true ) ) );
1087 reportHeader(
_(
"Thermal-relief min spoke count resolution for:" ), a, b, layer, r );
1096 r->
Report( wxString::Format(
_(
"Resolved min spoke count: %d." ),
1099 std::shared_ptr<CONNECTIVITY_DATA> connectivity =
pad->GetBoard()->GetConnectivity();
1105 reportHeader(
_(
"Zone clearance resolution for:" ), a, b, layer, r );
1109 r->
Report( wxString::Format(
_(
"Zone clearance: %s." ),
1119 r->
Report( wxString::Format(
_(
"Overridden by larger physical clearance from %s;"
1125 if( !
pad->FlashLayer( layer ) )
1135 r->
Report( wxString::Format(
_(
"Overridden by larger physical hole clearance "
1136 "from %s; clearance: %s." ),
1146 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1153 reportHeader(
_(
"Zone clearance resolution for:" ), a, b, layer, r );
1159 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1160 m_frame->StringFromValue( 0,
true ) ) );
1165 else if( copperIntersection.any() && !aFP && !bFP )
1169 if( !copperIntersection.test( layer ) )
1170 layer = copperIntersection.
Seq().front();
1173 reportHeader(
_(
"Clearance resolution for:" ), a, b, layer, r );
1177 r->
Report(
_(
"Items belong to the same net. Min clearance is 0." ) );
1189 if( constraint.
IsNull() )
1191 r->
Report(
_(
"Min clearance is 0." ) );
1195 r->
Report( wxString::Format(
_(
"Resolved clearance: %s; clearance will not be "
1201 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1212 wxString coupledNet;
1219 reportHeader(
_(
"Diff-pair gap resolution for:" ), ac, bc, active, r );
1224 r->
Report( wxString::Format(
_(
"Resolved gap constraints: min %s; opt %s; max %s." ),
1232 reportHeader(
_(
"Diff-pair max uncoupled length resolution for:" ), ac, bc,
1238 r->
Report(
_(
"No 'diff_pair_uncoupled' constraints defined." ) );
1245 r->
Report( wxString::Format(
_(
"Resolved max uncoupled length: %s." ),
1253 auto isOnCorrespondingLayer=
1265 if( aItem->
IsOnLayer( correspondingMask ) )
1268 if( aItem->
IsTented( correspondingMask ) && aItem->
IsOnLayer( correspondingCopper ) )
1270 *aWarning = wxString::Format(
_(
"Note: %s is tented; clearance will only be "
1271 "applied to holes." ),
1283 if( ( a->
IsOnLayer( layer ) && isOnCorrespondingLayer( b, layer, &warning ) )
1284 || ( b->
IsOnLayer( layer ) && isOnCorrespondingLayer( a, layer, &warning ) ) )
1287 reportHeader(
_(
"Silkscreen clearance resolution for:" ), a, b, layer, r );
1297 if( !warning.IsEmpty() )
1300 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1312 if( aCourtyard && bCourtyard )
1315 reportHeader(
_(
"Courtyard clearance resolution for:" ), a, b, layer, r );
1324 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1334 bool pageAdded =
false;
1350 reportHeader(
_(
"Hole clearance resolution for:" ), a, b, layer, r );
1359 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1379 reportHeader(
_(
"Hole-to-hole clearance resolution for:" ), a, b, r );
1388 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1416 wxString layerName =
m_frame->GetBoard()->GetLayerName( edgeLayer );
1417 r = dialog->
AddHTMLPage( layerName + wxS(
" " ) +
_(
"Clearance" ) );
1418 reportHeader(
_(
"Edge clearance resolution for:" ), a, b, layer, r );
1427 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1443 r->
Report(
_(
"No 'physical_clearance' constraints defined." ) );
1447 LSET reportLayers = layerIntersection;
1448 bool reported =
false;
1454 reportLayers |= edgeInteractingLayers;
1461 reportLayers |= edgeInteractingLayers;
1467 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, layer, r );
1472 if( constraint.
IsNull() )
1475 r->
Report( wxString::Format(
_(
"No 'physical_clearance' constraints in effect on %s." ),
1476 m_frame->GetBoard()->GetLayerName( layer ) ) );
1481 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1492 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, r );
1494 r->
Report(
_(
"Items share no relevant layers. No 'physical_clearance' constraints will "
1512 reportHeader(
_(
"Physical hole clearance resolution for:" ), a, b, layer, r );
1524 r->
Report(
_(
"No 'physical_hole_clearance' constraints defined." ) );
1529 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1537 dialog->
Show(
true );
1543#define EVAL_RULES( constraint, a, b, layer, r ) drcEngine->EvalRules( constraint, a, b, layer, r )
1549 wxCHECK( selTool, 0 );
1560 static const std::vector<KICAD_T> constraintTypes = {
1577 constraintTypes,
nullptr );
1584 m_frame->ShowInfoBarError(
_(
"Select a single item for a constraints resolution report." ) );
1590 wxCHECK( dialog, 0 );
1595 bool compileError =
false;
1596 bool courtyardError =
false;
1597 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
1604 reportHeader(
_(
"Track width resolution for:" ), item, r );
1612 r->
Report( wxString::Format(
_(
"Resolved width constraints: min %s; opt %s; max %s." ),
1623 reportHeader(
_(
"Via diameter resolution for:" ), item, r );
1632 r->
Report( wxString::Format(
_(
"Resolved diameter constraints: min %s; opt %s; max %s." ),
1640 reportHeader(
_(
"Via annular width resolution for:" ), item, r );
1649 r->
Report( wxString::Format(
_(
"Resolved annular width constraints: min %s; opt %s; max %s." ),
1669 r->
Report( wxString::Format(
_(
"Resolved hole size constraints: min %s; opt %s; max %s." ),
1680 reportHeader(
_(
"Solder mask expansion resolution for:" ), item, r );
1688 r->
Report( wxString::Format(
_(
"Resolved solder mask expansion: %s." ),
1697 reportHeader(
_(
"Solder paste absolute clearance resolution for:" ), item, r );
1705 r->
Report( wxString::Format(
_(
"Resolved solder paste absolute clearance: %s." ),
1708 reportHeader(
_(
"Solder paste relative clearance resolution for:" ), item, r );
1718 r->
Report( wxString::Format(
_(
"Resolved solder paste relative clearance: %s." ),
1727 reportHeader(
_(
"Text height resolution for:" ), item, r );
1735 r->
Report( wxString::Format(
_(
"Resolved height constraints: min %s; opt %s; max %s." ),
1743 reportHeader(
_(
"Text thickness resolution for:" ), item, r );
1751 r->
Report( wxString::Format(
_(
"Resolved thickness constraints: min %s; opt %s; max %s." ),
1767 if( courtyardError )
1770 r->
Report(
_(
"Report may be incomplete: some footprint courtyards are malformed." )
1771 + wxS(
" " )
1772 + wxS(
"<a href='$DRC'>" ) +
_(
"Run DRC for a full analysis." )
1779 r->
Report(
_(
"Item <b>disallowed</b> at current location." ) );
1781 r->
Report(
_(
"Item allowed at current location." ) );
1791 if( courtyardError )
1794 r->
Report(
_(
"Report may be incomplete: some footprint courtyards are malformed." )
1795 + wxS(
" " )
1796 + wxS(
"<a href='$DRC'>" ) +
_(
"Run DRC for a full analysis." )
1800 drcEngine->ProcessAssertions( item, [](
const DRC_CONSTRAINT* c ){}, r );
1804 dialog->
Show(
true );
1815 wxCHECK( selTool, 0 );
1821 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
1826 aCollector.
Remove( item );
1833 m_frame->ShowInfoBarError(
_(
"Select a footprint to diff with its library equivalent." ) );
1845 wxCHECK( selTool, 0 );
1851 m_frame->ShowInfoBarError(
_(
"Select a footprint for a footprint associations report." ) );
1879 r->
Report( wxS(
"<h7>" ) +
_(
"Board vs library diff for:" ) + wxS(
"</h7>" ) );
1881 + wxS(
"<li>" ) +
_(
"Library: " ) +
EscapeHTML( libName ) + wxS(
"</li>" )
1882 + wxS(
"<li>" ) +
_(
"Library item: " ) +
EscapeHTML( fpName ) + wxS(
"</li></ul>" ) );
1891 r->
Report(
_(
"The library is not included in the current configuration." )
1892 + wxS(
"  " )
1893 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Footprint Libraries" )
1897 else if( !adapter->
HasLibrary( libName,
true ) )
1899 r->
Report(
_(
"The library is not enabled in the current configuration." )
1900 + wxS(
"  " )
1901 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Footprint Libraries" )
1907 std::shared_ptr<FOOTPRINT> libFootprint;
1911 libFootprint.reset( adapter->
LoadFootprint( libName, fpName,
true ) );
1919 r->
Report( wxString::Format(
_(
"The library no longer contains the item %s." ),
1925 r->
Report(
_(
"No relevant differences detected." ) );
1941 dialog->
Show(
true );
1947 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
1951 sizer->Add( diffWidget, 1, wxEXPAND | wxALL, 5 );
1952 aParentPanel->SetSizer( sizer );
1953 aParentPanel->Layout();
1963 m_frame->m_ProbingSchToPcb =
true;
1970 m_frame->m_ProbingSchToPcb =
false;
1972 bool request3DviewRedraw =
frame()->GetPcbNewSettings()->m_Display.m_Live3DRefresh;
1975 request3DviewRedraw =
false;
1978 if( request3DviewRedraw )
1979 m_frame->Update3DView(
false,
true );
1992 bool enableHighlight =
false;
1997 std::set<int> netcodes;
2002 netcodes.insert( ci->GetNetCode() );
2005 enableHighlight = !netcodes.empty();
2007 if( enableHighlight && netcodes.size() > 1 )
2012 board->ResetNetHighLight();
2014 for(
int multiNet : netcodes )
2015 board->SetHighLightNet( multiNet,
true );
2017 board->HighLightON();
2018 m_toolMgr->GetView()->UpdateAllLayersColor();
2022 else if( enableHighlight )
2024 net = *netcodes.begin();
2049 bool saved =
filter.lockedItems;
2050 filter.lockedItems =
true;
2054 filter.lockedItems = saved;
2062 for(
int i = collector.
GetCount() - 1; i >= 0; i-- )
2064 LSET itemLayers = collector[i]->GetLayerSet();
2067 ( highContrast && !itemLayers.
Contains( contrastLayer ) ) )
2074 enableHighlight = ( collector.
GetCount() > 0 );
2077 if( enableHighlight )
2082 m_frame->SendCrossProbeItem( targetItem );
2091 if( !aUseSelection && netcodes.size() == 1 && netcodes.contains( net ) )
2096 if( !netcodes.empty() )
2100 m_toolMgr->GetView()->UpdateAllLayersColor();
2104 if( enableHighlight && net >= 0 )
2107 board->SetHighLightNet( net );
2108 board->HighLightON();
2114 std::vector<MSG_PANEL_ITEM> items;
2116 m_frame->SetMsgPanel( items );
2123 board->ResetNetHighLight();
2125 m_frame->SendCrossProbeNetName(
"" );
2136 const std::set<int>& highlighted = settings->GetHighlightNetCodes();
2141 settings->SetHighlight(
true, netcode );
2142 m_toolMgr->GetView()->UpdateAllLayersColor();
2153 std::set<int> temp = highlighted;
2155 m_toolMgr->GetView()->UpdateAllLayersColor();
2163 m_toolMgr->GetView()->UpdateAllLayersColor();
2182 board->ResetNetHighLight();
2184 m_toolMgr->GetView()->UpdateAllLayersColor();
2186 m_frame->SendCrossProbeNetName(
"" );
2203 [
this](
const VECTOR2D& pt ) ->
bool
2209 EDIT_TOOL::PadFilter );
2216 EDIT_TOOL::FootprintFilter );
2225 for(
PAD*
pad : fp->Pads() )
2235 pad->SetLocalRatsnestVisible( !
pad->GetLocalRatsnestVisible() );
2239 if( !fp->Pads().empty() )
2241 bool enable = !fp->Pads()[0]->GetLocalRatsnestVisible();
2243 for(
PAD* childPad : fp->Pads() )
2244 childPad->SetLocalRatsnestVisible( enable );
2256 [
this](
int aCondition )
2262 for(
PAD*
pad : fp->Pads() )
2286 auto&
selection = selectionTool->GetSelection();
2291 connectivity->ClearLocalRatsnest();
2319 std::vector<BOARD_ITEM*> items;
2322 for( std::size_t i = 0; i < queued_items.size(); ++i )
2324 if( !queued_items[i]->IsBOARD_ITEM() )
2329 wxCHECK2( item,
continue );
2336 items.push_back(
pad );
2343 queued_items.push_back( aItem );
2349 if( boardItem->GetLocalRatsnestVisible() ||
displayOptions().m_ShowModuleRatsnest )
2350 items.push_back( boardItem );
2354 if( items.empty() || std::none_of( items.begin(), items.end(),
2357 return( aItem->Type() == PCB_TRACE_T
2358 || aItem->Type() == PCB_PAD_T
2359 || aItem->Type() == PCB_ARC_T
2360 || aItem->Type() == PCB_ZONE_T
2361 || aItem->Type() == PCB_FOOTPRINT_T
2362 || aItem->Type() == PCB_VIA_T
2363 || aItem->Type() == PCB_SHAPE_T );
2372 connectivity->BlockRatsnestItems( items );
2400 m_toolMgr->GetView()->GetPainter()->GetSettings() );
2405 if( aNetCode <= 0 && !
selection.Empty() )
2411 if( bci->GetNetCode() > 0 )
2424 if( !
m_frame->GetAppearancePanel()->IsTogglingNetclassRatsnestVisibility() )
2426 m_frame->GetCanvas()->RedrawRatsnest();
2427 m_frame->GetCanvas()->Refresh();
2429 m_frame->GetAppearancePanel()->OnNetVisibilityChanged( aNetCode, !aHide );
std::function< void(const VECTOR2I &, GENERAL_COLLECTOR &, PCB_SELECTION_TOOL *)> CLIENT_SELECTION_FILTER
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
static TOOL_ACTION selectionCursor
Select a single item under the cursor position.
static TOOL_ACTION pickerTool
static TOOL_ACTION selectionClear
Clear the current selection.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
virtual NETCLASS * GetEffectiveNetClass() const
Return the NETCLASS for this item.
wxString GetNetname() const
NETINFO_ITEM * GetNet() const
Return #NET_INFO object for a given item.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual bool IsConnected() const
Returns information if the object is derived from BOARD_CONNECTED_ITEM.
virtual void Move(const VECTOR2I &aMoveVector)
Move this object.
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
virtual bool IsTented(PCB_LAYER_ID aLayer) const
Checks if the given object is tented (its copper shape is covered by solder mask) on a given side of ...
virtual void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction, RECURSE_MODE aMode) const
Invoke a function on all children.
virtual bool HasDrilledHole() const
virtual bool IsOnCopperLayer() const
virtual bool HasHole() const
Information pertinent to a Pcbnew printed circuit board.
PROJECT * GetProject() const
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
int GetCount() const
Return the number of objects in the list.
void Remove(int aIndex)
Remove the item at aIndex (first position is 0).
void Append(EDA_ITEM *item)
Add an item to the end of the list.
Dialog to show common board info.
wxPanel * AddBlankPage(const wxString &aTitle)
WX_HTML_REPORT_BOX * AddHTMLPage(const wxString &aTitle)
void SetUserItemID(const KIID &aID)
bool Show(bool show) override
ZONE_CONNECTION m_ZoneConnection
static int MatchDpSuffix(const wxString &aNetName, wxString &aComplementNet, wxString &aBaseDpName)
Check if the given net is a diff pair, returning its polarity and complement if so.
std::unordered_set< EDA_ITEM * > & GetItems()
A base class for most all the KiCad significant classes used in schematics and boards.
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const
Return a user-visible description string of this item.
KICAD_T Type() const
Returns the type of object.
virtual bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const
Test if aPosition is inside or on the boundary of this item.
A general implementation of a COLLECTORS_GUIDE.
void SetIgnoreZoneFills(bool ignore)
void SetPreferredLayer(PCB_LAYER_ID aLayer)
void SetIgnoreNoNets(bool ignore)
Used when the right click button is pressed, or when the select tool is in effect.
void Collect(BOARD_ITEM *aItem, const std::vector< KICAD_T > &aScanList, const VECTOR2I &aRefPos, const COLLECTORS_GUIDE &aGuide)
Scan a BOARD_ITEM using this class's Inspector method, which does the collection.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
std::set< int > & GetHiddenNets()
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
const std::set< int > & GetHighlightNetCodes() const
Return the netcode of currently highlighted net.
PCB_LAYER_ID GetPrimaryHighContrastLayer() const
Return the board layer which is in high-contrast mode.
bool IsHighlightEnabled() const
Return current highlight setting.
bool GetHighContrast() const
void SetHighlight(bool aEnabled, int aNetcode=-1, bool aMulti=false)
Turns on/off highlighting.
virtual int GetTopLayer() const
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
bool HasLibrary(const wxString &aNickname, bool aCheckEnabled=false) const
Test for the existence of aNickname in the library tables.
A logical library item identifier and consists of various portions much like a URI.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static const LSET & PhysicalLayersMask()
Return a mask holding all layers which are physically realized.
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
const wxString GetHumanReadableName() const
Gets the consolidated name of this netclass (which may be an aggregate).
Handle the data for a net.
const wxString & GetNetname() const
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Return the information about the NETINFO_ITEM in aList to display in the message panel.
const VECTOR2I & GetDrillSize() const
PAD_ATTRIB GetAttribute() const
static TOOL_ACTION highlightItem
static TOOL_ACTION toggleNetHighlight
static TOOL_ACTION highlightNet
static TOOL_ACTION hideNetInRatsnest
static TOOL_ACTION hideLocalRatsnest
static TOOL_ACTION showNetInRatsnest
static TOOL_ACTION toggleLastNetHighlight
static TOOL_ACTION inspectConstraints
static TOOL_ACTION clearHighlight
static TOOL_ACTION inspectClearance
static TOOL_ACTION updateLocalRatsnest
static TOOL_ACTION diffFootprint
static TOOL_ACTION showFootprintAssociations
static TOOL_ACTION highlightNetSelection
static TOOL_ACTION boardStatistics
static TOOL_ACTION localRatsnestTool
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
A set of BOARD_ITEMs (i.e., without duplicates).
static FOOTPRINT_LIBRARY_ADAPTER * FootprintLibAdapter(PROJECT *aProject)
Container for project specific data.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
bool IsEmpty() const
Return true if the set is empty (no polygons at all)
wxString StringFromValue(double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aValue in internal units into a united string.
A slimmed down version of WX_HTML_REPORT_PANEL.
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED) override
Report a string with a given severity.
void Flush()
Build the HTML messages page.
Handle a list of polygons defining a copper zone.
std::optional< int > GetLocalClearance() const override
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Test to see if this object is on the given layer.
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
@ DRCE_DRILL_OUT_OF_RANGE
@ DRCE_TRACK_SEGMENT_LENGTH
@ DRCE_DRILLED_HOLES_TOO_CLOSE
@ DRCE_DIFF_PAIR_UNCOUPLED_LENGTH_TOO_LONG
@ DRCE_MICROVIA_DRILL_OUT_OF_RANGE
@ DRCE_LIB_FOOTPRINT_MISMATCH
@ ANNULAR_WIDTH_CONSTRAINT
@ COURTYARD_CLEARANCE_CONSTRAINT
@ VIA_DIAMETER_CONSTRAINT
@ DIFF_PAIR_GAP_CONSTRAINT
@ SILK_CLEARANCE_CONSTRAINT
@ EDGE_CLEARANCE_CONSTRAINT
@ MIN_RESOLVED_SPOKES_CONSTRAINT
@ TRACK_SEGMENT_LENGTH_CONSTRAINT
@ TEXT_THICKNESS_CONSTRAINT
@ PHYSICAL_HOLE_CLEARANCE_CONSTRAINT
@ THERMAL_SPOKE_WIDTH_CONSTRAINT
@ CONNECTION_WIDTH_CONSTRAINT
@ THERMAL_RELIEF_GAP_CONSTRAINT
@ MAX_UNCOUPLED_CONSTRAINT
@ HOLE_CLEARANCE_CONSTRAINT
@ SOLDER_PASTE_ABS_MARGIN_CONSTRAINT
@ SOLDER_MASK_EXPANSION_CONSTRAINT
@ PHYSICAL_CLEARANCE_CONSTRAINT
@ SOLDER_PASTE_REL_MARGIN_CONSTRAINT
@ HOLE_TO_HOLE_CONSTRAINT
#define MALFORMED_COURTYARDS
bool IsFrontLayer(PCB_LAYER_ID aLayerId)
Layer classification: check if it's a front layer.
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
@ TARGET_OVERLAY
Items that may change while the view stays the same (noncached)
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
@ SMD
Smd pad, appears on the solder paste layer (default)
Class to handle a set of BOARD_ITEMs.
std::vector< FAB_LAYER_COLOR > dummy
wxString EscapeHTML(const wxString &aString)
Return a new wxString escaped for embedding in HTML.
A filename or source description, a problem input line, a line number, a byte offset,...
This file contains data structures that are saved in the project file or project local settings file ...
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Casted dyn_cast(From aObject)
A lightweight dynamic downcast.
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D
@ THERMAL
Use thermal relief for pads.
@ NONE
Pads are not covered.