91 std::shared_ptr<NET_CONTEXT_MENU> netSubMenu = std::make_shared<NET_CONTEXT_MENU>();
92 netSubMenu->SetTool(
this );
95 auto showNetMenuFunc =
98 if( aSelection.Empty() )
101 for(
const EDA_ITEM* item : aSelection )
103 switch( item->Type() )
114 if( !
static_cast<const PCB_SHAPE*
>( item )->IsOnCopperLayer() )
132 menu.
AddMenu( netSubMenu.get(), showNetMenuFunc, 100 );
153 bool* aCourtyardError )
155 auto engine = std::make_unique<DRC_ENGINE>(
m_frame->GetBoard(),
156 &
m_frame->GetBoard()->GetDesignSettings() );
160 engine->InitEngine(
m_frame->GetDesignRulesPath() );
165 *aCompileError =
true;
169 zone->CacheBoundingBox();
174 zone->CacheBoundingBox();
179 *aCourtyardError =
true;
206 + wxString::Format(
_(
"[netclass %s]" ),
217 std::vector<BOARD_ITEM*> toAdd;
219 for(
int i = 0; i < aCollector.
GetCount(); ++i )
225 group->RunOnChildren(
234 toAdd.push_back( child );
240 if(
pad->HitTest( aPos ) )
241 toAdd.push_back(
pad );
250 aCollector.
Append( item );
252 bool hasPadOrTrack =
false;
254 for(
int i = 0; i < aCollector.
GetCount(); ++i )
256 KICAD_T type = aCollector[i]->Type();
261 hasPadOrTrack =
true;
266 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
283 const wxString& aPrompt,
284 const std::vector<KICAD_T>& aTypes,
294 statusPopup.SetText( aPrompt );
297 picker->SetSnapping(
false );
298 picker->ClearHandlers();
300 picker->SetClickHandler(
301 [&](
const VECTOR2D& aPoint ) ->
bool
310 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
324 pickedItem = collector[0];
330 picker->SetMotionHandler(
340 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
353 if( highlightedItem != item )
355 if( highlightedItem && highlightedItem != aLockedHighlight )
358 highlightedItem = item;
360 if( highlightedItem && highlightedItem != aLockedHighlight )
365 picker->SetCancelHandler(
368 if( highlightedItem && highlightedItem != aLockedHighlight )
371 highlightedItem =
nullptr;
376 picker->SetFinalizeHandler(
377 [&](
const int& aFinalState )
379 if( highlightedItem && highlightedItem != aLockedHighlight )
382 highlightedItem =
nullptr;
390 m_frame->GetCanvas()->SetStatusPopup( statusPopup.GetPanel() );
394 while( !done && !pickedItem )
402 picker->ClearHandlers();
403 m_frame->GetCanvas()->SetStatusPopup(
nullptr );
412 r->
Report(
_(
"Report incomplete: could not compile custom design rules." )
413 + wxS(
" " )
414 + wxS(
"<a href='$CUSTOM_RULES'>" ) +
_(
"Show design rules." ) + wxS(
"</a>" ) );
437 wxString layerStr =
_(
"Layer" ) + wxS(
" " ) +
m_frame->GetBoard()->GetLayerName( aLayer );
451 return wxT(
"<i>" ) +
_(
"undefined" ) + wxT(
"</i>" );
460 return wxT(
"<i>" ) +
_(
"undefined" ) + wxT(
"</i>" );
469 return wxT(
"<i>" ) +
_(
"undefined" ) + wxT(
"</i>" );
503 return wxEmptyString;
511 wxCHECK( drcTool &&
m_frame, );
532 bool compileError =
false;
533 bool courtyardError =
false;
534 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
539 wxString clearanceStr;
541 switch( aDRCItem->GetErrorCode() )
545 for(
KIID id : aDRCItem->GetIDs() )
554 reportHeader(
_(
"Diff pair uncoupled length resolution for:" ), ac, bc, r );
562 r->
Report( wxString::Format(
_(
"Resolved max uncoupled length: %s." ),
577 r->
Report( wxString::Format(
_(
"Resolved height constraints: min %s; max %s." ),
592 r->
Report( wxString::Format(
_(
"Resolved thickness constraints: min %s; max %s." ),
607 r->
Report( wxString::Format(
_(
"Resolved width constraints: min %s; max %s." ),
622 r->
Report( wxString::Format(
_(
"Resolved angle constraints: min %s; max %s." ),
629 reportHeader(
_(
"Track segment length resolution for:" ), a, r );
637 r->
Report( wxString::Format(
_(
"Resolved segment length constraints: min %s; max %s." ),
644 reportHeader(
_(
"Connection width resolution for:" ), a, b, r );
652 r->
Report( wxString::Format(
_(
"Resolved min connection width: %s." ),
666 r->
Report( wxString::Format(
_(
"Resolved diameter constraints: min %s; max %s." ),
673 reportHeader(
_(
"Via annular width resolution for:" ), a, r );
681 r->
Report( wxString::Format(
_(
"Resolved annular width constraints: min %s; max %s." ),
697 r->
Report( wxString::Format(
_(
"Resolved hole size constraints: min %s; max %s." ),
704 reportHeader(
_(
"Hole clearance resolution for:" ), a, b, r );
712 r->
Report(
_(
"Items belong to the same net. Clearance is 0." ) );
721 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
727 reportHeader(
_(
"Physical hole clearance resolution for:" ), a, b, layer, r );
736 r->
Report(
_(
"No 'physical_hole_clearance' constraints defined." ) );
741 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
748 reportHeader(
_(
"Hole-to-hole clearance resolution for:" ), a, b, r );
758 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
763 reportHeader(
_(
"Edge clearance resolution for:" ), a, b, r );
773 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
807 reportHeader(
_(
"Clearance resolution for:" ), a, b, layer, r );
815 r->
Report(
_(
"Items belong to the same net. Clearance is 0." ) );
824 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
830 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, layer, r );
839 r->
Report(
_(
"No 'physical_clearance' constraints defined." ) );
844 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ), clearanceStr ) );
856 drcEngine->ProcessAssertions( a, [](
const DRC_CONSTRAINT* c ){}, r );
866 dialog->
Show(
true );
876 wxCHECK( selTool, 0 );
884 if( !
selection.GetItem( 0 )->IsBOARD_ITEM() || !
selection.GetItem( 1 )->IsBOARD_ITEM() )
899 static const std::vector<KICAD_T> clearanceTypes = {
915 _(
"Select first item for clearance resolution..." ),
916 clearanceTypes,
nullptr );
926 _(
"Select second item for clearance resolution..." ),
927 clearanceTypes, firstItem );
934 if( firstItem == secondItem )
936 m_frame->ShowInfoBarError(
_(
"Select two different items for clearance resolution." ) );
948 wxCHECK(
m_frame && aItemA && aItemB, );
959 m_frame->ShowInfoBarError(
_(
"Cannot generate clearance report on empty group." ) );
972 m_frame->ShowInfoBarError(
_(
"Cannot generate clearance report on empty group." ) );
982 auto checkFootprint =
985 PAD* foundPad =
nullptr;
989 if( !foundPad ||
pad->SameLogicalPadAs( foundPad ) )
1002 a = checkFootprint(
static_cast<FOOTPRINT*
>( a ) );
1005 b = checkFootprint(
static_cast<FOOTPRINT*
>( b ) );
1027 ZONE* zone =
dynamic_cast<ZONE*
>( a );
1034 bool compileError =
false;
1035 bool courtyardError =
false;
1036 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
1038 if( copperIntersection.any() && zone &&
pad && zone->
GetNetCode() ==
pad->GetNetCode() )
1048 reportHeader(
_(
"Zone connection resolution for:" ), a, b, layer, r );
1050 constraint = drcEngine->EvalZoneConnection(
pad, zone, layer, r );
1056 reportHeader(
_(
"Thermal-relief gap resolution for:" ), a, b, layer, r );
1065 r->
Report( wxString::Format(
_(
"Resolved thermal relief gap: %s." ),
1066 m_frame->StringFromValue( gap,
true ) ) );
1070 reportHeader(
_(
"Thermal-relief spoke width resolution for:" ), a, b, layer, r );
1079 r->
Report( wxString::Format(
_(
"Resolved spoke width: %s." ),
1080 m_frame->StringFromValue( width,
true ) ) );
1084 reportHeader(
_(
"Thermal-relief min spoke count resolution for:" ), a, b, layer, r );
1093 r->
Report( wxString::Format(
_(
"Resolved min spoke count: %d." ),
1096 std::shared_ptr<CONNECTIVITY_DATA> connectivity =
pad->GetBoard()->GetConnectivity();
1102 reportHeader(
_(
"Zone clearance resolution for:" ), a, b, layer, r );
1106 r->
Report( wxString::Format(
_(
"Zone clearance: %s." ),
1116 r->
Report( wxString::Format(
_(
"Overridden by larger physical clearance from %s;"
1122 if( !
pad->FlashLayer( layer ) )
1132 r->
Report( wxString::Format(
_(
"Overridden by larger physical hole clearance "
1133 "from %s; clearance: %s." ),
1143 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1150 reportHeader(
_(
"Zone clearance resolution for:" ), a, b, layer, r );
1156 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1157 m_frame->StringFromValue( 0,
true ) ) );
1162 else if( copperIntersection.any() && !aFP && !bFP )
1166 if( !copperIntersection.test( layer ) )
1167 layer = copperIntersection.
Seq().front();
1170 reportHeader(
_(
"Clearance resolution for:" ), a, b, layer, r );
1174 r->
Report(
_(
"Items belong to the same net. Min clearance is 0." ) );
1186 if( constraint.
IsNull() )
1188 r->
Report(
_(
"Min clearance is 0." ) );
1192 r->
Report( wxString::Format(
_(
"Resolved clearance: %s; clearance will not be "
1198 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1209 wxString coupledNet;
1216 reportHeader(
_(
"Diff-pair gap resolution for:" ), ac, bc, active, r );
1221 r->
Report( wxString::Format(
_(
"Resolved gap constraints: min %s; opt %s; max %s." ),
1229 reportHeader(
_(
"Diff-pair max uncoupled length resolution for:" ), ac, bc,
1235 r->
Report(
_(
"No 'diff_pair_uncoupled' constraints defined." ) );
1242 r->
Report( wxString::Format(
_(
"Resolved max uncoupled length: %s." ),
1250 auto isOnCorrespondingLayer=
1262 if( aItem->
IsOnLayer( correspondingMask ) )
1265 if( aItem->
IsTented( correspondingMask ) && aItem->
IsOnLayer( correspondingCopper ) )
1267 *aWarning = wxString::Format(
_(
"Note: %s is tented; clearance will only be "
1268 "applied to holes." ),
1280 if( ( a->
IsOnLayer( layer ) && isOnCorrespondingLayer( b, layer, &warning ) )
1281 || ( b->
IsOnLayer( layer ) && isOnCorrespondingLayer( a, layer, &warning ) ) )
1284 reportHeader(
_(
"Silkscreen clearance resolution for:" ), a, b, layer, r );
1294 if( !warning.IsEmpty() )
1297 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1309 if( aCourtyard && bCourtyard )
1312 reportHeader(
_(
"Courtyard clearance resolution for:" ), a, b, layer, r );
1321 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1331 bool pageAdded =
false;
1347 reportHeader(
_(
"Hole clearance resolution for:" ), a, b, layer, r );
1356 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1376 reportHeader(
_(
"Hole-to-hole clearance resolution for:" ), a, b, r );
1385 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1413 wxString layerName =
m_frame->GetBoard()->GetLayerName( edgeLayer );
1414 r = dialog->
AddHTMLPage( layerName + wxS(
" " ) +
_(
"Clearance" ) );
1415 reportHeader(
_(
"Edge clearance resolution for:" ), a, b, layer, r );
1424 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1440 r->
Report(
_(
"No 'physical_clearance' constraints defined." ) );
1444 LSET reportLayers = layerIntersection;
1445 bool reported =
false;
1451 reportLayers |= edgeInteractingLayers;
1458 reportLayers |= edgeInteractingLayers;
1464 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, layer, r );
1469 if( constraint.
IsNull() )
1472 r->
Report( wxString::Format(
_(
"No 'physical_clearance' constraints in effect on %s." ),
1473 m_frame->GetBoard()->GetLayerName( layer ) ) );
1478 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1489 reportHeader(
_(
"Physical clearance resolution for:" ), a, b, r );
1491 r->
Report(
_(
"Items share no relevant layers. No 'physical_clearance' constraints will "
1509 reportHeader(
_(
"Physical hole clearance resolution for:" ), a, b, layer, r );
1521 r->
Report(
_(
"No 'physical_hole_clearance' constraints defined." ) );
1526 r->
Report( wxString::Format(
_(
"Resolved min clearance: %s." ),
1534 dialog->
Show(
true );
1540#define EVAL_RULES( constraint, a, b, layer, r ) drcEngine->EvalRules( constraint, a, b, layer, r )
1546 wxCHECK( selTool, 0 );
1557 static const std::vector<KICAD_T> constraintTypes = {
1574 constraintTypes,
nullptr );
1581 m_frame->ShowInfoBarError(
_(
"Select a single item for a constraints resolution report." ) );
1587 wxCHECK( dialog, 0 );
1592 bool compileError =
false;
1593 bool courtyardError =
false;
1594 std::unique_ptr<DRC_ENGINE> drcEngine =
makeDRCEngine( &compileError, &courtyardError );
1601 reportHeader(
_(
"Track width resolution for:" ), item, r );
1609 r->
Report( wxString::Format(
_(
"Resolved width constraints: min %s; opt %s; max %s." ),
1620 reportHeader(
_(
"Via diameter resolution for:" ), item, r );
1629 r->
Report( wxString::Format(
_(
"Resolved diameter constraints: min %s; opt %s; max %s." ),
1637 reportHeader(
_(
"Via annular width resolution for:" ), item, r );
1646 r->
Report( wxString::Format(
_(
"Resolved annular width constraints: min %s; opt %s; max %s." ),
1666 r->
Report( wxString::Format(
_(
"Resolved hole size constraints: min %s; opt %s; max %s." ),
1677 reportHeader(
_(
"Solder mask expansion resolution for:" ), item, r );
1685 r->
Report( wxString::Format(
_(
"Resolved solder mask expansion: %s." ),
1694 reportHeader(
_(
"Solder paste absolute clearance resolution for:" ), item, r );
1702 r->
Report( wxString::Format(
_(
"Resolved solder paste absolute clearance: %s." ),
1705 reportHeader(
_(
"Solder paste relative clearance resolution for:" ), item, r );
1715 r->
Report( wxString::Format(
_(
"Resolved solder paste relative clearance: %s." ),
1724 reportHeader(
_(
"Text height resolution for:" ), item, r );
1732 r->
Report( wxString::Format(
_(
"Resolved height constraints: min %s; opt %s; max %s." ),
1740 reportHeader(
_(
"Text thickness resolution for:" ), item, r );
1748 r->
Report( wxString::Format(
_(
"Resolved thickness constraints: min %s; opt %s; max %s." ),
1764 if( courtyardError )
1767 r->
Report(
_(
"Report may be incomplete: some footprint courtyards are malformed." )
1768 + wxS(
" " )
1769 + wxS(
"<a href='$DRC'>" ) +
_(
"Run DRC for a full analysis." )
1776 r->
Report(
_(
"Item <b>disallowed</b> at current location." ) );
1778 r->
Report(
_(
"Item allowed at current location." ) );
1788 if( courtyardError )
1791 r->
Report(
_(
"Report may be incomplete: some footprint courtyards are malformed." )
1792 + wxS(
" " )
1793 + wxS(
"<a href='$DRC'>" ) +
_(
"Run DRC for a full analysis." )
1797 drcEngine->ProcessAssertions( item, [](
const DRC_CONSTRAINT* c ){}, r );
1801 dialog->
Show(
true );
1812 wxCHECK( selTool, 0 );
1818 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
1823 aCollector.
Remove( item );
1830 m_frame->ShowInfoBarError(
_(
"Select a footprint to diff with its library equivalent." ) );
1842 wxCHECK( selTool, 0 );
1848 m_frame->ShowInfoBarError(
_(
"Select a footprint for a footprint associations report." ) );
1876 r->
Report( wxS(
"<h7>" ) +
_(
"Board vs library diff for:" ) + wxS(
"</h7>" ) );
1878 + wxS(
"<li>" ) +
_(
"Library: " ) +
EscapeHTML( libName ) + wxS(
"</li>" )
1879 + wxS(
"<li>" ) +
_(
"Library item: " ) +
EscapeHTML( fpName ) + wxS(
"</li></ul>" ) );
1888 r->
Report(
_(
"The library is not included in the current configuration." )
1889 + wxS(
"  " )
1890 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Footprint Libraries" )
1894 else if( !adapter->
HasLibrary( libName,
true ) )
1896 r->
Report(
_(
"The library is not enabled in the current configuration." )
1897 + wxS(
"  " )
1898 + wxS(
"<a href='$CONFIG'>" ) +
_(
"Manage Footprint Libraries" )
1904 std::shared_ptr<FOOTPRINT> libFootprint;
1908 libFootprint.reset( adapter->
LoadFootprint( libName, fpName,
true ) );
1916 r->
Report( wxString::Format(
_(
"The library no longer contains the item %s." ),
1922 r->
Report(
_(
"No relevant differences detected." ) );
1938 dialog->
Show(
true );
1944 wxBoxSizer* sizer =
new wxBoxSizer( wxVERTICAL );
1948 sizer->Add( diffWidget, 1, wxEXPAND | wxALL, 5 );
1949 aParentPanel->SetSizer( sizer );
1950 aParentPanel->Layout();
1960 m_frame->m_probingSchToPcb =
true;
1967 m_frame->m_probingSchToPcb =
false;
1969 bool request3DviewRedraw =
frame()->GetPcbNewSettings()->m_Display.m_Live3DRefresh;
1972 request3DviewRedraw =
false;
1975 if( request3DviewRedraw )
1976 m_frame->Update3DView(
false,
true );
1989 bool enableHighlight =
false;
1994 std::set<int> netcodes;
1999 netcodes.insert( ci->GetNetCode() );
2002 enableHighlight = !netcodes.empty();
2004 if( enableHighlight && netcodes.size() > 1 )
2009 board->ResetNetHighLight();
2011 for(
int multiNet : netcodes )
2012 board->SetHighLightNet( multiNet,
true );
2014 board->HighLightON();
2015 m_toolMgr->GetView()->UpdateAllLayersColor();
2019 else if( enableHighlight )
2021 net = *netcodes.begin();
2046 bool saved =
filter.lockedItems;
2047 filter.lockedItems =
true;
2051 filter.lockedItems = saved;
2059 for(
int i = collector.
GetCount() - 1; i >= 0; i-- )
2061 LSET itemLayers = collector[i]->GetLayerSet();
2064 ( highContrast && !itemLayers.
Contains( contrastLayer ) ) )
2071 enableHighlight = ( collector.
GetCount() > 0 );
2074 if( enableHighlight )
2079 m_frame->SendCrossProbeItem( targetItem );
2088 if( !aUseSelection && netcodes.size() == 1 && netcodes.contains( net ) )
2093 if( !netcodes.empty() )
2097 m_toolMgr->GetView()->UpdateAllLayersColor();
2101 if( enableHighlight && net >= 0 )
2104 board->SetHighLightNet( net );
2105 board->HighLightON();
2111 std::vector<MSG_PANEL_ITEM> items;
2113 m_frame->SetMsgPanel( items );
2120 board->ResetNetHighLight();
2122 m_frame->SendCrossProbeNetName(
"" );
2133 const std::set<int>& highlighted = settings->GetHighlightNetCodes();
2138 settings->SetHighlight(
true, netcode );
2139 m_toolMgr->GetView()->UpdateAllLayersColor();
2150 std::set<int> temp = highlighted;
2152 m_toolMgr->GetView()->UpdateAllLayersColor();
2160 m_toolMgr->GetView()->UpdateAllLayersColor();
2179 board->ResetNetHighLight();
2181 m_toolMgr->GetView()->UpdateAllLayersColor();
2183 m_frame->SendCrossProbeNetName(
"" );
2200 [
this](
const VECTOR2D& pt ) ->
bool
2206 EDIT_TOOL::PadFilter );
2213 EDIT_TOOL::FootprintFilter );
2222 for(
PAD*
pad : fp->Pads() )
2232 pad->SetLocalRatsnestVisible( !
pad->GetLocalRatsnestVisible() );
2236 if( !fp->Pads().empty() )
2238 bool enable = !fp->Pads()[0]->GetLocalRatsnestVisible();
2240 for(
PAD* childPad : fp->Pads() )
2241 childPad->SetLocalRatsnestVisible( enable );
2253 [
this](
int aCondition )
2259 for(
PAD*
pad : fp->Pads() )
2283 auto&
selection = selectionTool->GetSelection();
2288 connectivity->ClearLocalRatsnest();
2316 std::vector<BOARD_ITEM*> items;
2319 for( std::size_t i = 0; i < queued_items.size(); ++i )
2321 if( !queued_items[i]->IsBOARD_ITEM() )
2326 wxCHECK2( item,
continue );
2333 items.push_back(
pad );
2340 queued_items.push_back( aItem );
2346 if( boardItem->GetLocalRatsnestVisible() ||
displayOptions().m_ShowModuleRatsnest )
2347 items.push_back( boardItem );
2351 if( items.empty() || std::none_of( items.begin(), items.end(),
2354 return( aItem->Type() == PCB_TRACE_T
2355 || aItem->Type() == PCB_PAD_T
2356 || aItem->Type() == PCB_ARC_T
2357 || aItem->Type() == PCB_ZONE_T
2358 || aItem->Type() == PCB_FOOTPRINT_T
2359 || aItem->Type() == PCB_VIA_T
2360 || aItem->Type() == PCB_SHAPE_T );
2369 connectivity->BlockRatsnestItems( items );
2397 m_toolMgr->GetView()->GetPainter()->GetSettings() );
2402 if( aNetCode <= 0 && !
selection.Empty() )
2408 if( bci->GetNetCode() > 0 )
2421 if( !
m_frame->GetAppearancePanel()->IsTogglingNetclassRatsnestVisibility() )
2423 m_frame->GetCanvas()->RedrawRatsnest();
2424 m_frame->GetCanvas()->Refresh();
2426 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.
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 LSET AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
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.