40#include <unordered_map> 
   41#include <unordered_set> 
   59#include <wx/filename.h> 
   65#include <python_scripting.h> 
  108#include <wx/socket.h> 
  109#include <wx/wupdlock.h> 
  139#include "../scripting/python_scripting.h" 
  141#include <wx/filedlg.h> 
  143using namespace std::placeholders;
 
  146#define INSPECT_DRC_ERROR_DIALOG_NAME   wxT( "InspectDrcErrorDialog" ) 
  147#define INSPECT_CLEARANCE_DIALOG_NAME   wxT( "InspectClearanceDialog" ) 
  148#define INSPECT_CONSTRAINTS_DIALOG_NAME wxT( "InspectConstraintsDialog" ) 
  149#define FOOTPRINT_DIFF_DIALOG_NAME      wxT( "FootprintDiffDialog" ) 
  192    m_exportNetlistAction( 
nullptr ),
 
  193    m_findDialog( 
nullptr ),
 
  194    m_inspectDrcErrorDlg( 
nullptr ),
 
  195    m_inspectClearanceDlg( 
nullptr ),
 
  196    m_inspectConstraintsDlg( 
nullptr ),
 
  197    m_footprintDiffDlg( 
nullptr ),
 
  198    m_boardSetupDlg( 
nullptr ),
 
  199    m_designBlocksPane( 
nullptr ),
 
  200    m_importProperties( 
nullptr ),
 
  201    m_eventCounterTimer( 
nullptr )
 
  203    m_maximizeByDefault = 
true;
 
  204    m_showBorderAndTitleBlock = 
true;   
 
  205    m_SelTrackWidthBox = 
nullptr;
 
  206    m_SelViaSizeBox = 
nullptr;
 
  207    m_show_layer_manager_tools = 
true;
 
  208    m_supportsAutoSave = 
true;
 
  209    m_probingSchToPcb = 
false;
 
  210    m_show_search = 
false;
 
  211    m_show_net_inspector = 
false;
 
  213    m_crossProbeFlashTimer.SetOwner( 
this );
 
  218    m_ZoneFillsDirty = 
true;
 
  220    m_aboutTitle = 
_HKI( 
"KiCad PCB Editor" );
 
  225        m_exportNetlistAction = 
new TOOL_ACTION( 
"pcbnew.EditorControl.exportNetlist",
 
  227                                                 _( 
"Export netlist used to update schematics" ) );
 
  232                                          GetGalDisplayOptions(),
 
  236    SetBoard( 
new BOARD() );
 
  239    wxIconBundle icon_bundle;
 
  242    icon_bundle.AddIcon( icon );
 
  244    icon_bundle.AddIcon( icon );
 
  246    icon_bundle.AddIcon( icon );
 
  248    icon_bundle.AddIcon( icon );
 
  250    icon_bundle.AddIcon( icon );
 
  252    SetIcons( icon_bundle );
 
  261    GetScreen()->m_Center = 
false;
 
  269    PrepareLayerIndicator( 
true );
 
  275                    &PCB_EDIT_FRAME::onPluginAvailabilityChanged, 
this );
 
  292    m_auimgr.SetManagedWindow( 
this );
 
  296    unsigned int auiFlags = wxAUI_MGR_DEFAULT;
 
  297#if !defined( _WIN32 ) 
  300    auiFlags |= wxAUI_MGR_LIVE_RESIZE;
 
  302    m_auimgr.SetFlags( auiFlags );
 
  305    m_auimgr.AddPane( m_tbTopMain, 
EDA_PANE().HToolbar().Name( wxS( 
"TopMainToolbar" ) )
 
  307    m_auimgr.AddPane( m_tbTopAux, 
EDA_PANE().HToolbar().Name( wxS( 
"TopAuxToolbar" ) )
 
  309    m_auimgr.AddPane( m_messagePanel, 
EDA_PANE().Messages().Name( wxS( 
"MsgPanel" ) )
 
  310                      .Bottom().Layer( 6 ) );
 
  313    m_auimgr.AddPane( m_tbLeft, 
EDA_PANE().VToolbar().Name( wxS( 
"LeftToolbar" ) )
 
  314                      .Left().Layer( 3 ) );
 
  316    m_auimgr.AddPane( m_tbRight, 
EDA_PANE().VToolbar().Name( wxS( 
"RightToolbar" ) )
 
  317                      .Right().Layer( 3 ) );
 
  319    m_auimgr.AddPane( m_appearancePanel, 
EDA_PANE().Name( wxS( 
"LayersManager" ) )
 
  321                      .Caption( 
_( 
"Appearance" ) ).PaneBorder( 
false )
 
  322                      .MinSize( m_appearancePanel->GetMinSize().x, -1 )
 
  325                      .BestSize( m_appearancePanel->GetMinSize().x, -1 )
 
  327                      .BestSize( m_appearancePanel->GetBestSize().x, -1 )
 
  329                      .FloatingSize( m_appearancePanel->GetBestSize() )
 
  330                      .CloseButton( 
false ) );
 
  332    m_auimgr.AddPane( m_selectionFilterPanel, 
EDA_PANE().Name( wxS( 
"SelectionFilter" ) )
 
  333                      .Right().Layer( 4 ).Position( 2 )
 
  334                      .Caption( 
_( 
"Selection Filter" ) ).PaneBorder( 
false )
 
  335                      .MinSize( m_selectionFilterPanel->GetMinSize().x, -1  )
 
  336                      .BestSize( m_selectionFilterPanel->GetBestSize().x, -1 )
 
  337                      .FloatingSize( m_selectionFilterPanel->GetBestSize() )
 
  338                      .CloseButton( 
false ) );
 
  340    m_auimgr.AddPane( m_designBlocksPane, 
EDA_PANE().Name( DesignBlocksPaneName() )
 
  342                      .Caption( 
_( 
"Design Blocks" ) )
 
  343                      .CaptionVisible( 
true )
 
  345                      .TopDockable( 
false )
 
  346                      .BottomDockable( 
false )
 
  348                      .MinSize( FromDIP( wxSize( 240, 60 ) ) )
 
  349                      .BestSize( FromDIP( wxSize( 300, 200 ) ) )
 
  350                      .FloatingSize( FromDIP( wxSize( 800, 600 ) ) )
 
  351                      .FloatingPosition( FromDIP( wxPoint( 50, 200 ) ) )
 
  354    m_auimgr.AddPane( m_propertiesPanel, 
EDA_PANE().Name( PropertiesPaneName() )
 
  356                      .Caption( 
_( 
"Properties" ) ).PaneBorder( 
false )
 
  357                      .MinSize( FromDIP( wxSize( 240, 60 ) ) )
 
  358                      .BestSize( FromDIP( wxSize( 300, 200 ) ) )
 
  359                      .FloatingSize( wxSize( 300, 200 ) )
 
  360                      .CloseButton( 
true ) );
 
  363    m_auimgr.AddPane( GetCanvas(), 
EDA_PANE().Canvas().Name( wxS( 
"DrawFrame" ) )
 
  366    m_auimgr.AddPane( m_netInspectorPanel, 
EDA_PANE().Name( NetInspectorPanelName() )
 
  368                      .Caption( 
_( 
"Net Inspector" ) )
 
  370                      .MinSize( FromDIP( wxSize( 240, 60 ) ) )
 
  371                      .BestSize( FromDIP( wxSize( 300, 200 ) ) )
 
  372                      .FloatingSize( wxSize( 300, 200 ) )
 
  373                      .CloseButton( 
true ) );
 
  375    m_auimgr.AddPane( m_searchPane, 
EDA_PANE().Name( SearchPaneName() )
 
  377                      .Caption( 
_( 
"Search" ) ).PaneBorder( 
false )
 
  378                      .MinSize( FromDIP( wxSize ( 180, 60 ) ) )
 
  379                      .BestSize( FromDIP( wxSize ( 180, 100 ) ) )
 
  380                      .FloatingSize( FromDIP( wxSize( 480, 200 ) ) )
 
  381                      .DestroyOnClose( 
false )
 
  382                      .CloseButton( 
true ) );
 
  386    m_auimgr.GetPane( 
"LayersManager" ).Show( m_show_layer_manager_tools );
 
  387    m_auimgr.GetPane( 
"SelectionFilter" ).Show( m_show_layer_manager_tools );
 
  388    m_auimgr.GetPane( PropertiesPaneName() ).Show( GetPcbNewSettings()->m_AuiPanels.show_properties );
 
  389    m_auimgr.GetPane( NetInspectorPanelName() ).Show( m_show_net_inspector );
 
  390    m_auimgr.GetPane( SearchPaneName() ).Show( m_show_search );
 
  391    m_auimgr.GetPane( DesignBlocksPaneName() ).Show( GetPcbNewSettings()->m_AuiPanels.design_blocks_show );
 
  394    m_auimgr.GetPane( 
"SelectionFilter" ).dock_proportion = 0;
 
  395    FinishAUIInitialization();
 
  399        wxAuiPaneInfo& layersManager = m_auimgr.GetPane( wxS( 
"LayersManager" ) );
 
  402        wxAuiPaneInfo& designBlocksPane = m_auimgr.GetPane( DesignBlocksPaneName() );
 
  408        wxAuiPaneInfo& propertiesPanel = m_auimgr.GetPane( PropertiesPaneName() );
 
  416        wxAuiPaneInfo& searchPane = m_auimgr.GetPane( SearchPaneName() );
 
  424        wxAuiPaneInfo& searchPane = m_auimgr.GetPane( SearchPaneName() );
 
  432        m_layerPairSettings = std::make_unique<LAYER_PAIR_SETTINGS>();
 
  434        m_layerPairSettings->Bind( PCB_LAYER_PAIR_PRESETS_CHANGED, [&]( wxCommandEvent& aEvt )
 
  437            std::span<const LAYER_PAIR_INFO> newPairInfos = m_layerPairSettings->GetLayerPairs();
 
  439                    std::vector<LAYER_PAIR_INFO>{ newPairInfos.begin(), newPairInfos.end() };
 
  442        m_layerPairSettings->Bind( PCB_CURRENT_LAYER_PAIR_CHANGED, [&]( wxCommandEvent& aEvt )
 
  444            const LAYER_PAIR& layerPair = m_layerPairSettings->GetCurrentLayerPair();
 
  451            PrepareLayerIndicator();
 
  462            [
this]( wxIdleEvent& aEvent )
 
  464                BOX2D viewport = GetCanvas()->GetView()->GetViewport();
 
  466                if( viewport != m_lastNetnamesViewport )
 
  469                    m_lastNetnamesViewport = viewport;
 
  484        m_toolManager->GetTool<
DRC_TOOL>()->GetDRCEngine()->InitEngine( wxFileName() );
 
  491    PythonSyncEnvironmentVariables();
 
  492    PythonSyncProjectName();
 
  498    m_apiHandler = std::make_unique<API_HANDLER_PCB>( 
this );
 
  499    Pgm().GetApiServer().RegisterHandler( m_apiHandler.get() );
 
  503        m_apiHandlerCommon = std::make_unique<API_HANDLER_COMMON>();
 
  504        Pgm().GetApiServer().RegisterHandler( m_apiHandlerCommon.get() );
 
  508    GetCanvas()->SwitchBackend( m_canvasType );
 
  518    if( strK2S.Find( wxT( 
"pcbnew.app" ) ) != wxNOT_FOUND )
 
  521        strK2S += wxT( 
"../../" );
 
  524    strK2S += wxT( 
"Contents/MacOS/" );
 
  527    wxFileName appK2S( strK2S, wxT( 
"kicad2step" ) );
 
  530    appK2S.SetExt( wxT( 
"exe" ) );
 
  545                       m_appearancePanel->OnBoardChanged();
 
  555                    UpdateToolbarControlSizes();
 
  563        m_eventCounterTimer = 
new wxTimer( 
this );
 
  566                [&]( wxTimerEvent& aEvent )
 
  568                    GetCanvas()->m_PaintEventCounter->Show();
 
  569                    GetCanvas()->m_PaintEventCounter->Reset();
 
  577                m_eventCounterTimer->GetId() );
 
  579        m_eventCounterTimer->Start( 1000 );
 
  586    DragAcceptFiles( 
true );
 
 
  595    wxLogTrace( 
traceCrossProbeFlash, 
"StartCrossProbeFlash(PCB): aborted (setting disabled) items=%zu", aItems.size() );
 
  611    wxLogTrace( 
traceCrossProbeFlash, 
"StartCrossProbeFlash(PCB): starting with %zu items", aItems.size() );
 
 
  702        open_dlg->Close( 
true );
 
 
  725        m_pcb->ClearProject();
 
  731    if( aBuildConnectivity )
 
 
  795                                                               &
m_pcb->GetPageSettings(),
 
  797                                                               &
m_pcb->GetTitleBlock(),
 
  798                                                               &
m_pcb->GetProperties() );
 
  809    if( screen != 
nullptr )
 
 
  882            pcbTool->SetIsBoardEditor( 
true );
 
 
  913    auto groupWithDesignBlockLink =
 
  916                if( aSel.Size() != 1 )
 
  924                return group->HasDesignBlockLink();
 
  929#define ENABLE( x ) ACTION_CONDITIONS().Enable( x ) 
  930#define CHECK( x )  ACTION_CONDITIONS().Check( x ) 
  966    if( SCRIPTING::IsWxAvailable() )
 
  969    auto enableZoneControlCondition =
 
  977                        ENABLE( enableZoneControlCondition )
 
  980                        ENABLE( enableZoneControlCondition )
 
  983                        ENABLE( enableZoneControlCondition )
 
  986                        ENABLE( enableZoneControlCondition )
 
  998    auto boardFlippedCond =
 
 1004    auto layerManagerCond =
 
 1010    auto propertiesCond =
 
 1016    auto netInspectorCond =
 
 1022    auto searchPaneCond =
 
 1028    auto designBlockCond =
 
 1034    auto highContrastCond =
 
 1040    auto globalRatsnestCond =
 
 1046    auto curvedRatsnestCond =
 
 1052    auto netHighlightCond =
 
 1059    auto enableNetHighlightCond =
 
 1072                                                           .Enable( enableNetHighlightCond ) );
 
 1081    const auto isArcKeepCenterMode =
 
 1087    const auto isArcKeepEndpointMode =
 
 1093    const auto isArcKeepRadiusMode =
 
 1103    auto isHighlightMode =
 
 1117    auto isWalkaroundMode =
 
 1128    auto isAutoTrackWidth =
 
 1143                        if( bci->GetNetCode() > 0 )
 
 1160    static const std::vector<KICAD_T> zoneTypes =       { 
PCB_ZONE_T };
 
 1180#define CURRENT_TOOL( action ) mgr->SetConditions( action, CHECK( cond.CurrentTool( action ) ) ) 
 1195#define CURRENT_EDIT_TOOL( action )                                                             \ 
 1196            mgr->SetConditions( action, ACTION_CONDITIONS().Check( cond.CurrentTool( action ) ) \ 
 1197                                                           .Enable( isDRCIdle ) ) 
 1239#undef CURRENT_EDIT_TOOL 
 
 1248    if( event.GetId() == wxID_EXIT )
 
 1251    if( event.GetId() == wxID_CLOSE || 
Kiface().IsSingle() )
 
 
 1263            marker->GetRCItem()->SetItems( 
GetCanvas()->GetDrawingSheet() );
 
 1265        commit.
Add( marker );
 
 
 1291    if( zoneFillerTool->
IsBusy() )
 
 1295        if( wxWindow* reporter = 
dynamic_cast<wxWindow*
>( zoneFillerTool->
GetProgressReporter() ) )
 
 1296            reporter->ShowWithEffect( wxSHOW_EFFECT_EXPAND );
 
 1301    if( 
Kiface().IsSingle() )
 
 1305        if( fpEditor && !fpEditor->Close() )   
 
 1310        if( fpViewer && !fpViewer->Close() )   
 
 1317        if( chooser && !chooser->Close() )   
 
 1324        if( fpEditor && fpEditor->IsCurrentFPFromBoard() )
 
 1326            if( !fpEditor->CanCloseFPFromBoard( 
true ) )
 
 1334        wxString msg = 
_( 
"Save changes to '%s' before closing?" );
 
 1350            if( !projPath.IsEmpty() && 
Kiway().LocalHistory().HistoryExists( projPath ) )
 
 1353                        wxS(
"Discard unsaved pcb changes") );
 
 
 1370    GetCanvas()->SetEvtHandlerEnabled( 
false );
 
 1375    Pgm().GetApiServer().DeregisterHandler( m_apiHandler.get() );
 
 1377                      &PCB_EDIT_FRAME::onPluginAvailabilityChanged, 
this );
 
 1387        open_dlg->Close( 
true );
 
 1423    if( 
Prj().GetLocalSettings().ShouldAutoSave() )
 
 1430        wxLogTrace( 
traceAutoSave, wxT( 
"Skipping auto-save of migrated local settings" ) );
 
 1438        m_auimgr.GetPane( wxS( 
"LayersManager" ) ).Show( 
false );
 
 1439        m_auimgr.GetPane( wxS( 
"TabbedPanel" ) ).Show( 
false );
 
 
 1467    static std::mutex dialogMutex; 
 
 1469    std::unique_lock<std::mutex> dialogLock( dialogMutex, std::try_to_lock );
 
 1472    if( !dialogLock.owns_lock() )
 
 1487    if( !aInitialPage.IsEmpty() )
 
 1501        if( !
GetBoard()->SynchronizeComponentClasses( std::unordered_set<wxString>() ) )
 
 1505            m_infoBar->ShowMessage( 
_( 
"Could not load component class assignment rules" ),
 
 1535                        if( ( 
GetBoard()->GetVisibleLayers() & maskAndPasteLayers ).
any() )
 
 1553                        if( 
text->HasTextVars() )
 
 1555                            text->ClearRenderCache();
 
 1556                            text->ClearBoundingBoxCache();
 
 
 1650        if( designBlocksPane.IsDocked() )
 
 
 1689    if( oldLayer == aLayer && !aForceRedraw )
 
 1714    const auto getClearanceLayerForActive = []( 
PCB_LAYER_ID aActiveLayer ) -> std::optional<int>
 
 1719        return std::nullopt;
 
 1722    if( std::optional<int> oldClearanceLayer = getClearanceLayerForActive( oldLayer ) )
 
 1725    if( std::optional<int> newClearanceLayer = getClearanceLayerForActive( aLayer ) )
 
 1757                    if( 
via->GetRemoveUnconnected() )
 
 1764                    if( 
pad->GetRemoveUnconnected() )
 
 
 1777    wxFileName fn( 
GetBoard()->GetFileName() );
 
 1790        layerEnum.
Map( layer, 
GetBoard()->GetLayerName( layer ) );
 
 1808    if( fn.FileExists() && !fn.IsFileWritable() )
 
 1812        m_infoBar->ShowMessage( 
_( 
"Board file is read only." ),
 
 1856    SetStatusText( wxEmptyString );
 
 
 1905    if( 
project.m_PcbLastPath[ aType ].IsEmpty() )
 
 1906        return wxEmptyString;
 
 1908    wxFileName absoluteFileName = 
project.m_PcbLastPath[ aType ];
 
 1911    absoluteFileName.MakeAbsolute( pcbFileName.GetPath() );
 
 1912    return absoluteFileName.GetFullPath();
 
 
 1920    wxFileName relativeFileName = aLastPath;
 
 1923    relativeFileName.MakeRelativeTo( pcbFileName.GetPath() );
 
 1925    if( relativeFileName.GetFullPath() != 
project.m_PcbLastPath[ aType ] )
 
 1927        project.m_PcbLastPath[ aType ] = relativeFileName.GetFullPath();
 
 
 1944    if( !GetTitle().StartsWith( wxT( 
"*" ) ) )
 
 
 1955    connectivity->RecalculateRatsnest( 
nullptr );
 
 1958    std::vector<MSG_PANEL_ITEM> msg_list;
 
 
 1967    bool       readOnly = 
false;
 
 1968    bool       unsaved = 
false;
 
 1970    if( fn.IsOk() && fn.FileExists() )
 
 1971        readOnly = !fn.IsFileWritable();
 
 1980    title += fn.GetName();
 
 1983        title += wxS( 
" " ) + 
_( 
"[Read Only]" );
 
 1986        title += wxS( 
" " ) + 
_( 
"[Unsaved]" );
 
 1988    title += wxT( 
" \u2014 " ) + 
_( 
"PCB Editor" );
 
 
 2023        layerEnum.
Map( layer, 
GetBoard()->GetLayerName( layer ) );
 
 
 2054    wxString findString;
 
 2058    if( selection.
Size() == 1 )
 
 2062        switch( front->
Type() )
 
 2072            if( findString.Contains( wxT( 
"\n" ) ) )
 
 2073                findString = findString.Before( 
'\n' );
 
 
 2099    if( 
Kiface().IsSingle() )
 
 2111    if( !frame->IsShownOnScreen() )
 
 2113        wxEventBlocker blocker( 
this );
 
 2114        wxFileName fn( 
Prj().GetProjectPath(), 
Prj().GetProjectName(),
 
 2119        if( !fn.FileExists() )
 
 2123            if( !fn.FileExists() )
 
 2134        frame->Show( 
true );
 
 
 2145                                                const wxString& aAnnotateMessage )
 
 2149    if( standalone == 0 )
 
 2152                                      "stand-alone mode. In order to create or update PCBs from " 
 2153                                      "schematics, you must launch the KiCad project manager and " 
 2154                                      "create a project." ) );
 
 2158    if( standalone < 0 )      
 
 2163    std::string payload( aAnnotateMessage );
 
 2167    if( payload == aAnnotateMessage )
 
 2185        wxString extra_info = e.
Problem() + wxT( 
" : " ) + e.
What() + wxT( 
" at " ) + e.
Where();
 
 2188                                      "report this issue to the KiCad team using the menu " 
 2189                                      "Help->Report Bug."), extra_info );
 
 
 2203    for( 
const std::pair<const wxString, ENV_VAR_ITEM>& var : vars )
 
 2204        UpdatePythonEnvVar( var.first, var.second.GetValue() );
 
 2208    for( 
const std::pair<const wxString, ENV_VAR_ITEM>& var : vars )
 
 2209        wxSetEnv( var.first, var.second.GetValue() );
 
 
 2227    if( aFootprint == 
nullptr )
 
 2266            fp_editor->Show( 
true );
 
 2277            fp_editor->Show( 
true );
 
 
 2293                                                  bool aSelectedMode )
 
 
 2313                             bool aResetText, 
bool aResetTextLayers, 
bool aResetTextEffects,
 
 2314                             bool aResetTextPositions, 
bool* aUpdated )
 
 2321    if( aResetTextLayers )
 
 2334    if( aResetTextEffects )
 
 2347    if( aResetTextPositions )
 
 
 2364                                                              const std::vector<T*>& aNew )
 
 2366    struct MATCH_CANDIDATE
 
 2373    std::vector<MATCH_CANDIDATE> candidates;
 
 2375    for( 
T* existing : aExisting )
 
 2377        for( 
T* updated : aNew )
 
 2379            if( existing->Type() != updated->Type() )
 
 2382            double similarity = existing->Similarity( *updated );
 
 2384            if( similarity <= 0.0 )
 
 2387            double score = similarity;
 
 2389            if constexpr( std::is_same_v<T, PAD> )
 
 2391                if( existing->GetNumber() == updated->GetNumber() )
 
 2395            candidates.push_back( { existing, updated, score } );
 
 2399    std::sort( candidates.begin(), candidates.end(),
 
 2400               []( 
const MATCH_CANDIDATE& a, 
const MATCH_CANDIDATE& b )
 
 2402                   if( a.score != b.score )
 
 2403                       return a.score > b.score;
 
 2405                   if( a.existing != b.existing )
 
 2406                       return a.existing < b.existing;
 
 2408                   return a.updated < b.updated;
 
 2411    std::vector<std::pair<T*, T*>> matches;
 
 2412    matches.reserve( candidates.size() );
 
 2414    std::unordered_set<T*> matchedExisting;
 
 2415    std::unordered_set<T*> matchedNew;
 
 2417    for( 
const MATCH_CANDIDATE& candidate : candidates )
 
 2419        if( matchedExisting.find( candidate.existing ) != matchedExisting.end() )
 
 2422        if( matchedNew.find( candidate.updated ) != matchedNew.end() )
 
 2425        matchedExisting.insert( candidate.existing );
 
 2426        matchedNew.insert( candidate.updated );
 
 2427        matches.emplace_back( candidate.existing, candidate.updated );
 
 
 2436                                        bool deleteExtraTexts,
 
 2437                                        bool resetTextLayers,
 
 2438                                        bool resetTextEffects,
 
 2439                                        bool resetTextPositions,
 
 2440                                        bool resetTextContent,
 
 2441                                        bool resetFabricationAttrs,
 
 2442                                        bool resetClearanceOverrides,
 
 2447    bool       dummyBool   = 
false;
 
 2450        aUpdated = &dummyBool;
 
 2479    std::vector<PAD*> oldPads;
 
 2480    oldPads.reserve( aExisting->
Pads().size() );
 
 2483        oldPads.push_back( 
pad );
 
 2485    std::vector<PAD*> newPads;
 
 2486    newPads.reserve( aNew->
Pads().size() );
 
 2489        newPads.push_back( 
pad );
 
 2492    std::unordered_set<PAD*> matchedNewPads;
 
 2494    for( 
const auto& match : padMatches )
 
 2496        PAD* oldPad = match.first;
 
 2497        PAD* newPad = match.second;
 
 2499        matchedNewPads.insert( newPad );
 
 2511    for( 
PAD* newPad : aNew->
Pads() )
 
 2513        if( matchedNewPads.find( newPad ) != matchedNewPads.end() )
 
 2516        const_cast<KIID&
>( newPad->m_Uuid ) = 
KIID();
 
 2520    std::vector<BOARD_ITEM*> oldDrawings;
 
 2524        oldDrawings.push_back( item );
 
 2526    std::vector<BOARD_ITEM*> newDrawings;
 
 2530        newDrawings.push_back( item );
 
 2533    std::unordered_map<BOARD_ITEM*, BOARD_ITEM*> oldToNewDrawings;
 
 2534    std::unordered_set<BOARD_ITEM*> matchedNewDrawings;
 
 2536    for( 
const auto& match : drawingMatches )
 
 2541        oldToNewDrawings[ oldItem ] = newItem;
 
 2542        matchedNewDrawings.insert( newItem );
 
 2548        if( matchedNewDrawings.find( newItem ) == matchedNewDrawings.end() )
 
 2549            const_cast<KIID&
>( newItem->m_Uuid ) = 
KIID();
 
 2552    std::vector<ZONE*> oldZones;
 
 2553    oldZones.reserve( aExisting->
Zones().size() );
 
 2556        oldZones.push_back( zone );
 
 2558    std::vector<ZONE*> newZones;
 
 2559    newZones.reserve( aNew->
Zones().size() );
 
 2562        newZones.push_back( zone );
 
 2565    std::unordered_set<ZONE*> matchedNewZones;
 
 2567    for( 
const auto& match : zoneMatches )
 
 2569        ZONE* oldZone = match.first;
 
 2570        ZONE* newZone = match.second;
 
 2572        matchedNewZones.insert( newZone );
 
 2576    for( 
ZONE* newZone : newZones )
 
 2578        if( matchedNewZones.find( newZone ) == matchedNewZones.end() )
 
 2579            const_cast<KIID&
>( newZone->m_Uuid ) = 
KIID();
 
 2582    std::vector<PCB_POINT*> oldPoints;
 
 2583    oldPoints.reserve( aExisting->
Points().size() );
 
 2586        oldPoints.push_back( point );
 
 2588    std::vector<PCB_POINT*> newPoints;
 
 2589    newPoints.reserve( aNew->
Points().size() );
 
 2592        newPoints.push_back( point );
 
 2595    std::unordered_set<PCB_POINT*> matchedNewPoints;
 
 2597    for( 
const auto& match : pointMatches )
 
 2602        matchedNewPoints.insert( newPoint );
 
 2608        if( matchedNewPoints.find( newPoint ) == matchedNewPoints.end() )
 
 2609            const_cast<KIID&
>( newPoint->m_Uuid ) = 
KIID();
 
 2612    std::vector<PCB_GROUP*> oldGroups;
 
 2613    oldGroups.reserve( aExisting->
Groups().size() );
 
 2616        oldGroups.push_back( 
group );
 
 2618    std::vector<PCB_GROUP*> newGroups;
 
 2619    newGroups.reserve( aNew->
Groups().size() );
 
 2622        newGroups.push_back( 
group );
 
 2625    std::unordered_set<PCB_GROUP*> matchedNewGroups;
 
 2627    for( 
const auto& match : groupMatches )
 
 2632        matchedNewGroups.insert( newGroup );
 
 2638        if( matchedNewGroups.find( newGroup ) == matchedNewGroups.end() )
 
 2639            const_cast<KIID&
>( newGroup->m_Uuid ) = 
KIID();
 
 2642    std::vector<PCB_FIELD*> oldFieldsVec;
 
 2643    std::vector<PCB_FIELD*> newFieldsVec;
 
 2645    oldFieldsVec.reserve( aExisting->
GetFields().size() );
 
 2649        if( field->IsReference() || field->IsValue() )
 
 2652        oldFieldsVec.push_back( field );
 
 2655    newFieldsVec.reserve( aNew->
GetFields().size() );
 
 2659        if( field->IsReference() || field->IsValue() )
 
 2662        newFieldsVec.push_back( field );
 
 2666    std::unordered_map<PCB_FIELD*, PCB_FIELD*> oldToNewFields;
 
 2667    std::unordered_set<PCB_FIELD*> matchedNewFields;
 
 2669    for( 
const auto& match : fieldMatches )
 
 2674        oldToNewFields[ oldField ] = newField;
 
 2675        matchedNewFields.insert( newField );
 
 2679    for( 
PCB_FIELD* newField : newFieldsVec )
 
 2681        if( matchedNewFields.find( newField ) == matchedNewFields.end() )
 
 2682            const_cast<KIID&
>( newField->m_Uuid ) = 
KIID();
 
 2685    std::unordered_map<PCB_TEXT*, PCB_TEXT*> oldToNewTexts;
 
 2687    for( 
const auto& match : drawingMatches )
 
 2692        if( oldText && newText )
 
 2693            oldToNewTexts[ oldText ] = newText;
 
 2696    std::set<PCB_TEXT*> handledTextItems;
 
 2710            auto textMatchIt = oldToNewTexts.find( oldTextItem );
 
 2712            if( textMatchIt != oldToNewTexts.end() )
 
 2713                newTextItem = textMatchIt->second;
 
 2717                handledTextItems.insert( newTextItem );
 
 2718                processTextItem( *oldTextItem, *newTextItem, resetTextContent, resetTextLayers,
 
 2719                                 resetTextEffects, resetTextPositions, aUpdated );
 
 2721            else if( deleteExtraTexts )
 
 2727                newTextItem = 
static_cast<PCB_TEXT*
>( oldTextItem->
Clone() );
 
 2728                handledTextItems.insert( newTextItem );
 
 2729                aNew->
Add( newTextItem );
 
 2745            if( !handledTextItems.contains( newTextItem ) )
 
 2755                     resetTextEffects, resetTextPositions, aUpdated );
 
 2762                     resetTextLayers, resetTextEffects, resetTextPositions, aUpdated );
 
 2764    std::set<PCB_FIELD*> handledFields;
 
 2770        if( oldField->IsReference() || oldField->IsValue() )
 
 2775        auto fieldMatchIt = oldToNewFields.find( oldField );
 
 2777        if( fieldMatchIt != oldToNewFields.end() )
 
 2778            newField = fieldMatchIt->second;
 
 2782            handledFields.insert( newField );
 
 2783            processTextItem( *oldField, *newField, resetTextContent, resetTextLayers,
 
 2784                             resetTextEffects, resetTextPositions, aUpdated );
 
 2786        else if( deleteExtraTexts )
 
 2793            handledFields.insert( newField );
 
 2794            aNew->
Add( newField );
 
 2802        if( newField->IsReference() || newField->IsValue() )
 
 2805        if( !handledFields.contains( newField ) )
 
 2812    if( resetFabricationAttrs )
 
 2824    if( resetClearanceOverrides )
 
 2852        if( aNew->
Models().size() != aExisting->
Models().size() )
 
 2858            for( 
size_t ii = 0; ii < aNew->
Models().size(); ++ii )
 
 2880    if( *aUpdated == 
false )
 
 2887    aCommit.
Remove( aExisting );
 
 2888    aCommit.
Add( aNew );
 
 
 2918        wxHyperlinkCtrl* button = 
new wxHyperlinkCtrl( infobar, wxID_ANY, 
_( 
"Edit design rules" ),
 
 2921        button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<
void( wxHyperlinkEvent& aEvent )>(
 
 2922                [&]( wxHyperlinkEvent& aEvent )
 
 2927        infobar->RemoveAllButtons();
 
 2928        infobar->AddButton( button );
 
 2929        infobar->AddCloseButton();
 
 2930        infobar->ShowMessage( 
_( 
"Could not compile custom design rules." ), wxICON_ERROR,
 
 
 2962            [
this]( 
const wxString& aProjectPath, std::vector<wxString>& aFiles )
 
 
 2978    if( zoneFillerTool->
IsBusy() )
 
 
 2999    return m_auimgr.GetPane( wxS( 
"LayersManager" ) ).IsShown();
 
 
 3017    if( IsShownOnScreen() )
 
 
 3035                                                         _( 
"Violation Report" ) );
 
 
 3047                                                          _( 
"Clearance Report" ) );
 
 
 3059                                                            _( 
"Constraints Report" ) );
 
 
 3071                                                       _( 
"Compare Footprint with Library" ) );
 
 
 3100        if( aEvent.GetId() == wxID_APPLY )
 
 3114                            dialog.ShowQuasiModal();
 
 
 3125void PCB_EDIT_FRAME::onPluginAvailabilityChanged( wxCommandEvent& aEvt )
 
 3127    wxLogTrace( 
traceApi, 
"PCB frame: EDA_EVT_PLUGIN_AVAILABILITY_CHANGED" );
 
 3140    if( layer == curLayer )
 
 3147        if( layer > 
GetBoard()->GetCopperLayerStackMaxId() )
 
 3163    switch( aItem->
Type() )
 
 3184        DIALOG_TABLE_PROPERTIES dlg( 
this, 
static_cast<PCB_TABLE*
>( aItem ) );
 
 3187        dlg.ShowQuasiModal();
 
 3209        DIALOG_DIMENSION_PROPERTIES dlg( 
this, 
static_cast<PCB_DIMENSION_BASE*
>( aItem ) );
 
 3212        dlg.ShowQuasiModal();
 
 3226                                  static_cast<EDA_GROUP*
>( 
static_cast<PCB_GROUP*
>( aItem ) ) );
 
 3230        static_cast<PCB_GENERATOR*
>( aItem )->ShowPropertiesDialog( 
this );
 
 3234        m_toolManager->GetTool<DRC_TOOL>()->CrossProbe( 
static_cast<PCB_MARKER*
>( aItem ) );
 
Class PCBNEW_ACTION_PLUGINS.
 
const KICOMMON_API wxEventTypeTag< wxCommandEvent > EDA_EVT_PLUGIN_AVAILABILITY_CHANGED
Notifies other parts of KiCad when plugin availability changes.
 
@ KEEP_ENDPOINTS_OR_START_DIRECTION
Whe editing endpoints, the other end remains in place.
 
@ KEEP_CENTER_ENDS_ADJUST_ANGLE
When editing endpoints, only the angle is adjusted.
 
@ KEEP_CENTER_ADJUST_ANGLE_RADIUS
When editing endpoints, the angle and radius are adjusted.
 
constexpr EDA_IU_SCALE pcbIUScale
 
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
 
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
 
@ NORMAL
Inactive layers are shown normally (no high-contrast mode)
 
@ HIDDEN
Inactive layers are hidden.
 
constexpr BOX2I BOX2ISafe(const BOX2D &aInput)
 
static TOOL_ACTION toggleGrid
 
static TOOL_ACTION unselectAll
 
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
 
static TOOL_ACTION togglePolarCoords
 
static TOOL_ACTION pluginsReload
 
static TOOL_ACTION pasteSpecial
 
static TOOL_ACTION groupProperties
 
static TOOL_ACTION pointEditorArcKeepCenter
 
static TOOL_ACTION ungroup
 
static TOOL_ACTION toggleBoundingBoxes
 
static TOOL_ACTION pointEditorArcKeepRadius
 
static TOOL_ACTION showSearch
 
static TOOL_ACTION duplicate
 
static TOOL_ACTION highContrastMode
 
static TOOL_ACTION embeddedFiles
 
static TOOL_ACTION measureTool
 
static TOOL_ACTION doDelete
 
static TOOL_ACTION selectionTool
 
static TOOL_ACTION zoomFitScreen
 
static TOOL_ACTION deleteTool
 
static TOOL_ACTION zoomTool
 
static TOOL_ACTION showProperties
 
static TOOL_ACTION gridSetOrigin
 
static TOOL_ACTION toggleGridOverrides
 
static TOOL_ACTION selectAll
 
static TOOL_ACTION pointEditorArcKeepEndpoint
 
Manage TOOL_ACTION objects.
 
void SetConditions(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Set the conditions the UI elements for activating a specific tool action should use for determining t...
 
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
 
void OnColorThemeChanged()
Respond to change in OS's DarkMode.
 
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
 
Handles how to draw a screen (a board, a schematic ...)
 
bool IsContentModified() const
 
const wxString & GetPageNumber() const
 
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
 
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
 
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
 
bool GetLocalRatsnestVisible() const
 
void SetLocalRatsnestVisible(bool aVisible)
 
bool m_UseConnectedTrackWidth
 
Handle actions specific to the board editor in PcbNew.
 
Abstract interface for BOARD_ITEMs capable of storing other items inside.
 
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.
 
void SetLocked(bool aLocked) override
 
bool IsLocked() const override
 
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
 
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
 
VECTOR2I GetFPRelativePosition() const
 
void SetFPRelativePosition(const VECTOR2I &aPos)
 
Information pertinent to a Pcbnew printed circuit board.
 
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
 
void RemoveAllListeners()
Remove all listeners.
 
const PAGE_INFO & GetPageSettings() const
 
GAL_SET GetVisibleElements() const
Return a set of all the element categories that are visible.
 
bool BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
 
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
 
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
 
const wxString & GetFileName() const
 
void SetElementVisibility(GAL_LAYER_ID aLayer, bool aNewState)
Change the visibility of an element category.
 
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
 
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
 
void UpdateRatsnestExclusions()
Update the visibility flags on the current unconnected ratsnest lines.
 
void SynchronizeTuningProfileProperties()
Ensure that all time domain properties providers are in sync with current settings.
 
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
 
void SaveToHistory(const wxString &aProjectPath, std::vector< wxString > &aFiles)
Save board file to the .history directory.
 
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
 
void SetColor(int aLayer, const COLOR4D &aColor)
 
COLOR4D GetColor(int aLayer) const
 
COMMIT & Remove(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Remove a new item from the model.
 
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
 
COMMIT & Add(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Add a new item to the model.
 
Handle actions that are shared between different applications.
 
void InitEngine(const wxFileName &aRulePath)
Initialize the DRC engine.
 
void SetSheetPath(const std::string &aSheetPath)
Set the sheet path displayed in the title block.
 
void SetSheetCount(int aSheetCount)
Change the sheet-count number displayed in the title block.
 
void SetPageNumber(const std::string &aPageNumber)
Change the page number displayed in the title block.
 
void SetSheetName(const std::string &aSheetName)
Set the sheet name displayed in the title block.
 
void SetIsFirstPage(bool aIsFirstPage)
Change if this is first page.
 
void SetFileName(const std::string &aFileName)
Set the file name displayed in the title block.
 
virtual bool doAutoSave()
This should be overridden by the derived class to handle the auto save feature.
 
void CommonSettingsChanged(int aFlags) override
Notification event that some of the common (suite-wide) settings have changed.
 
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
 
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
 
virtual void ThemeChanged()
Process light/dark theme change.
 
virtual bool CanAcceptApiCommands()
Check if this frame is ready to accept API commands.
 
virtual void OnSize(wxSizeEvent &aEvent)
 
virtual bool canCloseWindow(wxCloseEvent &aCloseEvent)
 
virtual int GetUndoCommandCount() const
 
bool m_isClosing
Set by the close window event handler after frames are asked if they can close.
 
WX_INFOBAR * GetInfoBar()
 
static const wxString AppearancePanelName()
 
virtual wxString GetFullScreenDesc() const
 
void OnSelectGrid(wxCommandEvent &event)
Command event handler for selecting grid sizes.
 
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
 
virtual void SwitchCanvas(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType)
Change the current rendering backend.
 
virtual void OnSize(wxSizeEvent &event) override
Recalculate the size of toolbars and display panel when the frame size changes.
 
virtual void OnSelectZoom(wxCommandEvent &event)
Set the zoom factor when selected by the zoom list box in the main tool bar.
 
GAL_DISPLAY_OPTIONS_IMPL & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
 
virtual wxString GetScreenDesc() const
 
static const wxString PropertiesPaneName()
 
virtual void ReCreateAuxiliaryToolbar()
 
virtual void ReCreateHToolbar()
 
virtual void Zoom_Automatique(bool aWarpPointer)
Redraw the screen with best zoom level and the best centering that shows all the page or the board.
 
NET_INSPECTOR_PANEL * m_netInspectorPanel
 
static const wxString NetInspectorPanelName()
 
SEARCH_PANE * m_searchPane
 
static const wxString DesignBlocksPaneName()
 
PROPERTIES_PANEL * m_propertiesPanel
 
static constexpr GAL_TYPE GAL_FALLBACK
 
void StopDrawing()
Prevent the GAL canvas from further drawing until it is recreated or StartDrawing() is called.
 
void ForceRefresh()
Force a redraw.
 
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
 
KIGFX::GAL * GetGAL() const
Return a pointer to the GAL instance used in the panel.
 
A set of EDA_ITEMs (i.e., without duplicates).
 
void RemoveItem(EDA_ITEM *aItem)
Remove item from group.
 
void AddItem(EDA_ITEM *aItem)
Add item to group.
 
virtual EDA_ITEM * AsEdaItem()=0
 
A base class for most all the KiCad significant classes used in schematics and boards.
 
virtual EDA_GROUP * GetParentGroup() const
 
KICAD_T Type() const
Returns the type of object.
 
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
 
virtual void SetParent(EDA_ITEM *aParent)
 
Specialization of the wxAuiPaneInfo class for KiCad panels.
 
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
 
const EDA_ANGLE & GetTextAngle() const
 
virtual const wxString & GetText() const
Return the string associated with the text object.
 
virtual bool IsVisible() const
 
void SetAttributes(const EDA_TEXT &aSrc, bool aSetPosition=true)
Set the text attributes from another instance.
 
GR_TEXT_H_ALIGN_T GetHorizJustify() const
 
virtual void SetVisible(bool aVisible)
 
GR_TEXT_V_ALIGN_T GetVertJustify() const
 
virtual void SetText(const wxString &aText)
 
int GetTextThickness() const
 
VECTOR2I GetTextSize() const
 
SELECTION_CONDITION NoActiveTool()
Create a functor testing if there are no tools active in the frame.
 
SELECTION_CONDITION BoundingBoxes()
 
SELECTION_CONDITION RedoAvailable()
Create a functor that tests if there are any items in the redo queue.
 
SELECTION_CONDITION ScriptingConsoleVisible()
Create a functor testing if the python scripting console window is visible.
 
SELECTION_CONDITION GridVisible()
Create a functor testing if the grid is visible in a frame.
 
SELECTION_CONDITION PolarCoordinates()
Create a functor testing if polar coordinates are current being used.
 
SELECTION_CONDITION GridOverrides()
Create a functor testing if the grid overrides wires is enabled in a frame.
 
ENUM_MAP & Map(T aValue, const wxString &aName)
 
static ENUM_MAP< T > & Instance()
 
ENUM_MAP & Undefined(T aValue)
 
void ReadWindowSettings(WINDOW_SETTINGS &aCfg)
Read GAL config options from application-level config.
 
bool Contains(GAL_LAYER_ID aPos)
 
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
 
virtual const wxString What() const
A composite of Problem() and Where()
 
virtual const wxString Problem() const
what was the problem?
 
virtual const wxString Where() const
where did the Problem() occur?
 
Read the new s-expression based KiCad netlist format.
 
virtual void LoadNetlist() override
Load the contents of the netlist file into aNetlist.
 
APP_SETTINGS_BASE * KifaceSettings() const
 
A color representation with 4 components: red, green, blue, alpha.
 
void SetGridColor(const COLOR4D &aGridColor)
Set the grid color.
 
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
 
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const override
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
 
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.
 
An abstract base class for deriving all objects that can be added to a VIEW.
 
bool IsBOARD_ITEM() const
 
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
 
BOX2D GetViewport() const
Return the current viewport visible area rectangle.
 
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
 
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
 
bool IsMirroredX() const
Return true if view is flipped across the X axis.
 
void UpdateAllItems(int aUpdateFlags)
Update all items in the view according to the given flags.
 
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
 
void MarkTargetDirty(int aTarget)
Set or clear target 'dirty' flag.
 
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
 
An implementation of class VIEW_CONTROLS for wxWidgets library.
 
std::unique_ptr< PROF_COUNTER > m_MotionEventCounter
 
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
 
virtual bool OpenProjectFiles(const std::vector< wxString > &aFileList, int aCtl=0)
Open a project or set of files given by aFileList.
 
void OnSockRequestServer(wxSocketEvent &evt)
 
void OnSockRequest(wxSocketEvent &evt)
 
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
 
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
 
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr, bool aFromOtherThread=false)
Send aPayload to aDestination from aSource.
 
LOCAL_HISTORY & LocalHistory()
Return the LOCAL_HISTORY associated with this KIWAY.
 
virtual void CommonSettingsChanged(int aFlags=0)
Call CommonSettingsChanged() on all KIWAY_PLAYERs.
 
PCB_LAYER_ID GetLayerA() const
 
PCB_LAYER_ID GetLayerB() const
 
const UTF8 & GetLibItemName() const
 
bool CommitDuplicateOfLastSave(const wxString &aProjectPath, const wxString &aFileType, const wxString &aMessage)
Create a new commit duplicating the tree pointed to by Last_Save_<fileType> and move the Last_Save_<f...
 
bool Init(const wxString &aProjectPath)
Initialize the local history repository for the given project path.
 
void NoteFileChange(const wxString &aFile)
Record that a file has been modified and should be included in the next snapshot.
 
void RegisterSaver(const void *aSaverObject, const std::function< void(const wxString &, std::vector< wxString > &)> &aSaver)
Register a saver callback invoked during autosave history commits.
 
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 const LSET & AllLayersMask()
 
static wxString Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
 
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
 
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
 
void SetPinType(const wxString &aType)
Set the pad electrical type.
 
const wxString & GetPinType() const
 
const wxString & GetPinFunction() const
 
bool IsOnCopperLayer() const override
 
void SetPinFunction(const wxString &aName)
Set the pad function (pin name in schematic)
 
void SetInitialPage(const wxString &aPage, const wxString &aParentPage=wxEmptyString)
 
Describe the page size and margins of a paper page on which to eventually print or plot.
 
DISPLAY_OPTIONS m_Display
 
EDA_ANGLE m_RotationAngle
 
ARC_EDIT_MODE m_ArcEditMode
 
Gather all the actions that are shared by tools.
 
static TOOL_ACTION drawRuleArea
 
static TOOL_ACTION microwaveCreateGap
 
static TOOL_ACTION drawBezier
 
static TOOL_ACTION placeText
 
static TOOL_ACTION drawOrthogonalDimension
 
static TOOL_ACTION drawRectangle
 
static TOOL_ACTION padDisplayMode
 
static TOOL_ACTION placeReferenceImage
 
static TOOL_ACTION showRatsnest
 
static TOOL_ACTION showLayersManager
 
static TOOL_ACTION toggleNetHighlight
 
static TOOL_ACTION saveSelectionAsDesignBlock
 
static TOOL_ACTION drawCircle
 
static TOOL_ACTION routeDiffPair
Activation of the Push and Shove router (differential pair mode)
 
static TOOL_ACTION tuneDiffPair
 
static TOOL_ACTION saveToLinkedDesignBlock
 
static TOOL_ACTION layerChanged
 
static TOOL_ACTION ddAppendBoard
Drag and drop.
 
static TOOL_ACTION highlightNet
 
static TOOL_ACTION autoTrackWidth
 
static TOOL_ACTION drawTable
 
static TOOL_ACTION drawTextBox
 
static TOOL_ACTION routerHighlightMode
Actions to enable switching modes via hotkey assignments.
 
static TOOL_ACTION routerWalkaroundMode
 
static TOOL_ACTION routerShoveMode
 
static TOOL_ACTION drawZoneCutout
 
static TOOL_ACTION drawPolygon
 
static TOOL_ACTION hideNetInRatsnest
 
static TOOL_ACTION zoneDisplayFilled
 
static TOOL_ACTION showNetInRatsnest
 
static TOOL_ACTION drawRadialDimension
 
static TOOL_ACTION tuneSingleTrack
 
static TOOL_ACTION viaDisplayMode
 
static TOOL_ACTION drawLeader
 
static TOOL_ACTION angleSnapModeChanged
Notification event when angle mode changes.
 
static TOOL_ACTION saveBoardAsDesignBlock
 
static TOOL_ACTION drillOrigin
 
static TOOL_ACTION tuneSkew
 
static TOOL_ACTION trackDisplayMode
 
static TOOL_ACTION showNetInspector
 
static TOOL_ACTION microwaveCreateStubArc
 
static TOOL_ACTION zoneDisplayTriangulated
 
static TOOL_ACTION placeDesignBlock
 
static TOOL_ACTION selectUnconnected
Select unconnected footprints from ratsnest of selection.
 
static TOOL_ACTION zoneDisplayFractured
 
static TOOL_ACTION drawVia
 
static TOOL_ACTION drawArc
 
static TOOL_ACTION zoneDuplicate
Duplicate zone onto another layer.
 
static TOOL_ACTION graphicsOutlines
Display footprint graphics as outlines.
 
static TOOL_ACTION drawSimilarZone
 
static TOOL_ACTION showDesignBlockPanel
 
static TOOL_ACTION drawCenterDimension
 
static TOOL_ACTION selectSameSheet
Select all components on the same sheet as the selected footprint.
 
static TOOL_ACTION microwaveCreateStub
 
static TOOL_ACTION selectNet
Select all connections belonging to a single net.
 
static TOOL_ACTION ddImportGraphics
 
static TOOL_ACTION microwaveCreateLine
 
static TOOL_ACTION flipBoard
 
static TOOL_ACTION zoneDisplayOutline
 
static TOOL_ACTION ratsnestLineMode
 
static TOOL_ACTION textOutlines
Display texts as lines.
 
static TOOL_ACTION highlightNetSelection
 
static TOOL_ACTION microwaveCreateFunctionShape
 
static TOOL_ACTION placePoint
 
static TOOL_ACTION zoneMerge
 
static TOOL_ACTION unlock
 
static TOOL_ACTION placeFootprint
 
static TOOL_ACTION routeSingleTrack
Activation of the Push and Shove router.
 
static TOOL_ACTION createArray
Tool for creating an array of objects.
 
static TOOL_ACTION deselectNet
Remove all connections belonging to a single net from the active selection.
 
static TOOL_ACTION showPythonConsole
 
static TOOL_ACTION drawLine
 
static TOOL_ACTION placeLinkedDesignBlock
 
static TOOL_ACTION localRatsnestTool
 
static TOOL_ACTION drawAlignedDimension
 
static TOOL_ACTION drawZone
 
static TOOL_ACTION selectOnSchematic
Select symbols/pins on schematic corresponding to selected footprints/pads.
 
Common, abstract interface for edit frames.
 
void ShowTextPropertiesDialog(PCB_TEXT *aText)
 
COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
 
wxString GetDesignRulesPath()
Return the absolute path to the design rules file for the currently-loaded board.
 
void doCloseWindow() override
 
int ShowTextBoxPropertiesDialog(PCB_TEXTBOX *aTextBox)
 
void unitsChangeRefresh() override
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
 
PCB_LAYER_BOX_SELECTOR * m_SelLayerBox
 
virtual void SetBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr) override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
 
std::unique_ptr< LAYER_PAIR_SETTINGS > m_layerPairSettings
 
APPEARANCE_CONTROLS * GetAppearancePanel()
 
APPEARANCE_CONTROLS * m_appearancePanel
 
void ShowReferenceImagePropertiesDialog(BOARD_ITEM *aBitmap)
 
PANEL_SELECTION_FILTER * m_selectionFilterPanel
 
void ShowBarcodePropertiesDialog(PCB_BARCODE *aText)
 
void ShowGraphicItemPropertiesDialog(PCB_SHAPE *aShape)
 
void ActivateGalCanvas() override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
 
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
 
void ShowPadPropertiesDialog(PAD *aPad)
 
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
 
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
 
PCBNEW_SETTINGS * GetPcbNewSettings() const
 
virtual PCB_LAYER_ID GetActiveLayer() const
 
void OnModify() override
Must be called after a change in order to set the "modify" flag and update other data structures and ...
 
virtual MAGNETIC_SETTINGS * GetMagneticItemsSettings()
 
EDA_ITEM * ResolveItem(const KIID &aId, bool aAllowNullptrReturn=false) const override
Fetch an item by KIID.
 
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
 
virtual void SetPageSettings(const PAGE_INFO &aPageSettings) override
 
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
 
PCB_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
 
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Return the BOARD_DESIGN_SETTINGS for the open project.
 
void PlaceFootprint(FOOTPRINT *aFootprint, bool aRecreateRatsnest=true)
Place aFootprint at the current cursor position and updates footprint coordinates with the new positi...
 
virtual void SetActiveLayer(PCB_LAYER_ID aLayer)
 
virtual void Update3DView(bool aMarkDirty, bool aRefresh, const wxString *aTitle=nullptr)
Update the 3D view, if the viewer is opened by this frame.
 
Handle actions that are shared between different frames in PcbNew.
 
Handle design block actions in the PCB editor.
 
double m_ZoneOpacity
Opacity override for filled zone areas.
 
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
 
void UpdateColors()
Update the color settings in the painter and GAL.
 
void SetDrawingSheet(DS_PROXY_VIEW_ITEM *aDrawingSheet)
Sets (or updates) drawing-sheet used by the draw panel.
 
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
 
void SyncLayersVisibility(const BOARD *aBoard)
Update "visibility" property of each layer of a given BOARD.
 
virtual void SetHighContrastLayer(int aLayer) override
SetHighContrastLayer(), with some extra smarts for PCB.
 
void RedrawRatsnest()
Return the bounding box of the view that should be used if model is not valid.
 
Group generic conditions for PCB editor states.
 
SELECTION_CONDITION PadFillDisplay()
Create a functor that tests if the frame fills the pads.
 
SELECTION_CONDITION TrackFillDisplay()
Create a functor that tests if the frame fills tracks.
 
SELECTION_CONDITION HasItems()
Create a functor that tests if there are items in the board.
 
SELECTION_CONDITION GraphicsFillDisplay()
Create a functor that tests if the frame fills graphics items.
 
SELECTION_CONDITION ZoneDisplayMode(ZONE_DISPLAY_MODE aMode)
Create a functor that tests the current zone display mode in the frame.
 
SELECTION_CONDITION ViaFillDisplay()
Create a functor that tests if the frame fills vias.
 
SELECTION_CONDITION TextFillDisplay()
Create a functor that tests if the frame fills text items.
 
The main frame for Pcbnew.
 
void HardRedraw() override
Rebuild the GAL and redraws the screen.
 
void OnDisplayOptionsChanged() override
 
void OnEditItemRequest(BOARD_ITEM *aItem) override
Install the corresponding dialog editor for the given item.
 
void SetLastPath(LAST_PATH_TYPE aType, const wxString &aLastPath)
Set the path of the last file successfully read.
 
int m_crossProbeFlashPhase
Phase counter.
 
void FindNext(bool reverse=false)
Find the next item using our existing search parameters.
 
void ResolveDRCExclusions(bool aCreateMarkers)
If aCreateMarkers then create DRC exclusion markers from the serialized data.
 
void SetBoard(BOARD *aBoard, PROGRESS_REPORTER *aReporter=nullptr) override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
 
void SetActiveLayer(PCB_LAYER_ID aLayer) override
Change the currently active layer to aLayer and also update the APPEARANCE_CONTROLS.
 
void OnModify() override
Must be called after a board change to set the modified flag.
 
void ThemeChanged() override
Called when light/dark theme is changed.
 
void SwitchLayer(PCB_LAYER_ID layer) override
Change the active layer in the editor.
 
wxTimer m_crossProbeFlashTimer
Timer to toggle selection visibility for flash.
 
void StartCrossProbeFlash(const std::vector< BOARD_ITEM * > &aItems)
 
void OnCrossProbeFlashTimer(wxTimerEvent &aEvent)
 
void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
 
bool DoAutoSave()
Perform auto save when the board has been modified and not saved within the auto save interval.
 
void SetElementVisibility(GAL_LAYER_ID aElement, bool aNewState)
Change the visibility of an element category.
 
DIALOG_BOOK_REPORTER * m_inspectDrcErrorDlg
 
void OnClearFileHistory(wxCommandEvent &aEvent)
 
std::unique_ptr< GRID_HELPER > MakeGridHelper() override
 
virtual ~PCB_EDIT_FRAME()
 
void SwitchCanvas(EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType) override
Switch currently used canvas (Cairo / OpenGL).
 
void CommonSettingsChanged(int aFlags) override
Called after the preferences dialog is run.
 
BOARD_ITEM_CONTAINER * GetModel() const override
 
DIALOG_BOOK_REPORTER * GetInspectDrcErrorDialog()
 
void ShowTargetOptionsDialog(PCB_TARGET *aTarget)
 
void ShowBoardSetupDialog(const wxString &aInitialPage=wxEmptyString, wxWindow *aParent=nullptr)
 
DIALOG_FIND * m_findDialog
 
DIALOG_BOOK_REPORTER * m_inspectConstraintsDlg
 
void SetPageSettings(const PAGE_INFO &aPageSettings) override
 
bool IsElementVisible(GAL_LAYER_ID aElement) const
Test whether a given element category is visible.
 
bool CanAcceptApiCommands() override
Check if this frame is ready to accept API commands.
 
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility,...
 
void SetGridColor(const COLOR4D &aColor) override
 
void ProjectChanged() override
Notification event that the project has changed.
 
wxString GetLastPath(LAST_PATH_TYPE aType)
Get the last path for a particular type.
 
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
 
void doCloseWindow() override
 
void ReCreateLayerBox(bool aForceResizeToolbar=true)
Recreate the layer box by clearing the old list and building a new one from the new layer names and c...
 
void SaveProjectLocalSettings() override
Save changes to the project local settings.
 
void PythonSyncProjectName()
Synchronize the project name from KiCad's environment into the Python interpreter.
 
bool m_show_layer_manager_tools
 
void ShowFindDialog()
Show the Find dialog.
 
void onSize(wxSizeEvent &aEvent)
 
int ShowExchangeFootprintsDialog(FOOTPRINT *aFootprint, bool aUpdateMode, bool aSelectedMode)
 
int TestStandalone()
Test if standalone mode.
 
void ShowFootprintPropertiesDialog(FOOTPRINT *aFootprint)
 
bool IsContentModified() const override
Get if the current board has been modified but not saved.
 
void PythonSyncEnvironmentVariables()
Synchronize the environment variables from KiCad's environment into the Python interpreter.
 
bool Clear_Pcb(bool doAskAboutUnsavedChanges, bool aFinal=false)
Delete all and reinitialize the current board.
 
bool m_crossProbeFlashing
Currently flashing guard.
 
TOOL_ACTION * m_exportNetlistAction
The export board netlist tool action object.
 
void OnBoardLoaded()
Update the state of the GUI after a new board is loaded or created.
 
void Edit_Zone_Params(ZONE *zone_container)
Edit params (layer, clearance, ...) for a zone outline.
 
bool m_show_net_inspector
 
bool FetchNetlistFromSchematic(NETLIST &aNetlist, const wxString &aAnnotateMessage)
 
wxString GetCurrentFileName() const override
Get the full filename + path of the currently opened file in the frame.
 
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
 
DIALOG_BOOK_REPORTER * GetFootprintDiffDialog()
 
EDA_ANGLE GetRotationAngle() const override
Return the angle used for rotate operations.
 
COLOR4D GetGridColor() override
 
std::vector< KIID > m_crossProbeFlashItems
Items to flash (by UUID)
 
void UpdateTitle()
Set the main window title bar text.
 
void ExchangeFootprint(FOOTPRINT *aExisting, FOOTPRINT *aNew, BOARD_COMMIT &aCommit, bool deleteExtraTexts=true, bool resetTextLayers=true, bool resetTextEffects=true, bool resetTextPositions=true, bool resetTextContent=true, bool resetFabricationAttrs=true, bool resetClearanceOverrides=true, bool reset3DModels=true, bool *aUpdated=nullptr)
Replace aExisting footprint by aNew footprint using the Existing footprint settings (position,...
 
DIALOG_BOOK_REPORTER * m_footprintDiffDlg
 
void ActivateGalCanvas() override
Set the #m_Pcb member in such as way as to ensure deleting any previous BOARD.
 
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
 
void OnQuit(wxCommandEvent &event)
 
void onCloseModelessBookReporterDialogs(wxCommandEvent &aEvent)
 
PCB_DESIGN_BLOCK_PANE * m_designBlocksPane
 
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
 
DIALOG_BOARD_SETUP * m_boardSetupDlg
 
DIALOG_BOOK_REPORTER * GetInspectClearanceDialog()
 
wxTimer * m_eventCounterTimer
 
void Tracks_and_Vias_Size_Event(wxCommandEvent &event)
 
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
 
static const wxString SearchPaneName()
 
DIALOG_BOOK_REPORTER * m_inspectClearanceDlg
 
void OnFileHistory(wxCommandEvent &event)
 
DIALOG_BOOK_REPORTER * GetInspectConstraintsDialog()
 
A set of BOARD_ITEMs (i.e., without duplicates).
 
PCB net inspection panel.
 
Tool that displays edit points allowing to modify items by dragging the points.
 
A PCB_POINT is a 0-dimensional point that is used to mark a position on a PCB, or more usually a foot...
 
PCB_LAYER_ID m_Route_Layer_TOP
 
PCB_LAYER_ID m_Route_Layer_BOTTOM
 
static bool HasUnlockedItems(const SELECTION &aSelection)
Test if any selected items are unlocked.
 
static bool HasLockedItems(const SELECTION &aSelection)
Test if any selected items are locked.
 
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
 
virtual ENV_VAR_MAP & GetLocalEnvVariables() const
 
virtual const wxString & GetExecutablePath() const
 
void Show(std::ostream &aStream=std::cerr)
 
A progress reporter interface for use in multi-threaded environments.
 
The backing store for a PROJECT, in JSON format.
 
std::vector< LAYER_PAIR_INFO > m_LayerPairInfos
List of stored 3D viewports (view matrixes)
 
The project local settings are things that are attached to a particular project, but also might be pa...
 
wxString m_ActiveLayerPreset
The name of a LAYER_PRESET that is currently activated (or blank if none)
 
PCB_LAYER_ID m_ActiveLayer
The current (active) board layer for editing.
 
virtual const wxString GetProjectPath() const
Return the full path of the project.
 
virtual PROJECT_LOCAL_SETTINGS & GetLocalSettings() const
 
void IncrementNetclassesTicker()
 
virtual PROJECT_FILE & GetProjectFile() const
 
void IncrementTextVarsTicker()
 
static SELECTION_CONDITION HasTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if among the selected items there is at least one of a given types.
 
static bool NotEmpty(const SELECTION &aSelection)
Test if there are any items selected.
 
static SELECTION_CONDITION MoreThan(int aNumber)
Create a functor that tests if the number of selected items is greater than the value given as parame...
 
static bool Idle(const SELECTION &aSelection)
Test if there no items selected or being edited.
 
static SELECTION_CONDITION Count(int aNumber)
Create a functor that tests if the number of selected items is equal to the value given as parameter.
 
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
 
static SELECTION_CONDITION OnlyTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if the selected items are only of given types.
 
int Size() const
Returns the number of selected parts.
 
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
 
A modified version of the wxInfoBar class that allows us to:
 
@ OUTDATED_SAVE
OUTDATED_SAVE Messages that should be cleared on save.
 
@ GENERIC
GENERIC Are messages that do not have special handling.
 
Handle a list of polygons defining a copper zone.
 
A type-safe container of any type.
 
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
 
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
 
int GetLastUnsavedChangesResponse()
Return the result code from the last call to HandleUnsavedChanges(): wxID_YES, wxID_NO or wxID_CANCEL...
 
This file is part of the common library.
 
#define DIALOG_DRC_WINDOW_NAME
 
Declaration of the eda_3d_viewer class.
 
static constexpr EDA_ANGLE ANGLE_90
 
#define KICAD_DEFAULT_DRAWFRAME_STYLE
 
#define PCB_EDIT_FRAME_NAME
 
EVT_MENU_RANGE(ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILEMAX, GERBVIEW_FRAME::OnDrlFileHistory) EVT_MENU_RANGE(ID_GERBVIEW_ZIP_FILE1
 
@ FRAME_FOOTPRINT_CHOOSER
 
a few functions useful in geometry calculations.
 
static const std::string LegacySchematicFileExtension
 
static const std::string LegacyPcbFileExtension
 
static const std::string KiCadSchematicFileExtension
 
static const std::string SVGFileExtension
 
static const std::string KiCadPcbFileExtension
 
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
 
const wxChar *const traceCrossProbeFlash
Flag to enable debug output for cross-probe flash operations.
 
const wxChar *const traceApi
Flag to enable debug output related to the IPC API and its plugin system.
 
@ ID_EDA_SOCKET_EVENT_SERV
 
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
 
int GetNetnameLayer(int aLayer)
Return a netname layer corresponding to the given layer.
 
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
 
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
 
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored).
 
#define CLEARANCE_LAYER_FOR(boardLayer)
 
PCB_LAYER_ID
A quick note on layer IDs:
 
@ REPAINT
Item needs to be redrawn.
 
@ GEOMETRY
Position or shape has changed.
 
@ ALL
All except INITIAL_ADD.
 
@ TARGET_NONCACHED
Auxiliary rendering target (noncached)
 
@ RM_MarkObstacles
Ignore collisions, mark obstacles.
 
@ RM_Walkaround
Only walk around.
 
BARCODE class definition.
 
static void processTextItem(const PCB_TEXT &aSrc, PCB_TEXT &aDest, bool aResetText, bool aResetTextLayers, bool aResetTextEffects, bool aResetTextPositions, bool *aUpdated)
copy text settings from aSrc to aDest
 
static std::vector< std::pair< T *, T * > > matchItemsBySimilarity(const std::vector< T * > &aExisting, const std::vector< T * > &aNew)
 
#define FOOTPRINT_DIFF_DIALOG_NAME
 
EVT_MENU_RANGE(ID_POPUP_PCB_SELECT_WIDTH_START_RANGE, ID_POPUP_PCB_SELECT_WIDTH_END_RANGE, PCB_EDIT_FRAME::Tracks_and_Vias_Size_Event) EVT_UPDATE_UI_RANGE(ID_POPUP_PCB_SELECT_WIDTH1
 
ID_POPUP_PCB_SELECT_WIDTH8
 
#define INSPECT_CLEARANCE_DIALOG_NAME
 
PCB_EDIT_FRAME::OnUpdateSelectTrackWidth EVT_UPDATE_UI_RANGE(ID_POPUP_PCB_SELECT_VIASIZE1, ID_POPUP_PCB_SELECT_VIASIZE8, PCB_EDIT_FRAME::OnUpdateSelectViaSize) PCB_EDIT_FRAME
 
#define INSPECT_DRC_ERROR_DIALOG_NAME
 
#define INSPECT_CONSTRAINTS_DIALOG_NAME
 
@ ID_POPUP_PCB_SELECT_WIDTH_START_RANGE
 
@ ID_POPUP_PCB_SELECT_WIDTH1
 
@ ID_POPUP_PCB_SELECT_VIASIZE8
 
@ ID_AUX_TOOLBAR_PCB_VIA_SIZE
 
@ ID_POPUP_PCB_SELECT_WIDTH_END_RANGE
 
@ ID_POPUP_PCB_SELECT_VIASIZE1
 
@ ID_AUX_TOOLBAR_PCB_TRACK_WIDTH
 
void ScriptingOnDestructPcbEditFrame(PCB_EDIT_FRAME *aPcbEditFrame)
 
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
 
PGM_BASE & Pgm()
The global program "get" accessor.
 
#define PROJECT_VAR_NAME
A variable name whose value holds the current project directory.
 
LAST_PATH_TYPE
For storing PcbNew MRU paths of various types.
 
#define CURRENT_TOOL(action)
 
std::function< bool(const SELECTION &)> SELECTION_CONDITION
Functor type that checks a specific condition for selected items.
 
T * GetToolbarSettings(const wxString &aFilename)
 
KIWAY Kiway(KFCTL_STANDALONE)
 
wxString UnescapeString(const wxString &aSource)
 
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
 
A min-max version of BOX2 for fast intersection checking.
 
bool Intersects(const BOX2I_MINMAX &aOther) const
 
A filename or source description, a problem input line, a line number, a byte offset,...
 
float properties_splitter
 
int properties_panel_width
 
int design_blocks_panel_float_height
 
bool appearance_expand_layer_display
 
bool appearance_expand_net_display
 
int design_blocks_panel_docked_width
 
int search_panel_dock_direction
 
int design_blocks_panel_float_width
 
TRACK_CLEARANCE_MODE m_TrackClearance
 
bool m_DisplayRatsnestLinesCurved
 
bool m_ShowGlobalRatsnest
 
wxLogTrace helper definitions.
 
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
 
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
 
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
 
@ 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_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
 
@ 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_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap on a layer
 
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
 
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
 
@ PCB_BARCODE_T
class PCB_BARCODE, a barcode (graphic item)
 
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
 
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
 
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
 
@ 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_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
 
@ PCB_POINT_T
class PCB_POINT, a 0-dimensional point
 
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
 
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
 
VECTOR2< int32_t > VECTOR2I
 
Definition of file extensions used in Kicad.
 
void SetAuiPaneSize(wxAuiManager &aManager, wxAuiPaneInfo &aPane, int aWidth, int aHeight)
Sets the size of an AUI pane, working around http://trac.wxwidgets.org/ticket/13180.
 
WX_VIEW_CONTROLS class definition.