62#include <wx/filename.h>
83#include <wx/hyperlink.h>
86using namespace std::placeholders;
96 m_pickerItem( nullptr )
109 m_frame = getEditFrame<PCB_BASE_FRAME>();
118 if( backgroundBrightness > 0.5 )
119 color.Darken( 0.25 );
121 color.Brighten( 0.25 );
167 const wxString fn = *aEvent.
Parameter<wxString*>();
176 const wxString fn = *aEvent.
Parameter<wxString*>();
199template<
class T>
void Flip(
T& aValue )
243 editFrame->OnDisplayOptionsChanged();
275 if(
Pgm().GetCommonSettings()->m_DoNotShowAgain.zone_fill_warning )
278 bool unfilledZones =
false;
280 for(
const ZONE* zone :
board()->Zones() )
282 if( !zone->GetIsRuleArea() && !zone->IsFilled() )
284 unfilledZones =
true;
292 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Don't show again" ), wxEmptyString );
294 button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<
void( wxHyperlinkEvent& aEvent )>(
295 [&]( wxHyperlinkEvent& aEvent )
305 msg.Printf(
_(
"Not all zones are filled. Use Edit > Fill All Zones (%s) "
306 "if you wish to see all fills." ),
365 ? HIGH_CONTRAST_MODE::DIMMED
366 : HIGH_CONTRAST_MODE::NORMAL;
393 if( !
Pgm().GetCommonSettings()->m_Input.hotkey_feedback )
398 wxArrayString labels;
399 labels.Add(
_(
"Normal" ) );
400 labels.Add(
_(
"Dimmed" ) );
401 labels.Add(
_(
"Hidden" ) );
410 popup->
Popup(
_(
"Inactive Layer Display" ), labels,
424 case NET_COLOR_MODE::ALL: opts.
m_NetColorMode = NET_COLOR_MODE::RATSNEST;
break;
425 case NET_COLOR_MODE::RATSNEST: opts.
m_NetColorMode = NET_COLOR_MODE::OFF;
break;
426 case NET_COLOR_MODE::OFF: opts.
m_NetColorMode = NET_COLOR_MODE::ALL;
break;
454 editFrame->OnDisplayOptionsChanged();
476 bool wraparound =
false;
490 for( ; ii < (int)layerStack.size(); ii++ )
492 if( layer == layerStack[ii] )
497 for( ; ii < (int)layerStack.size(); ii++ )
501 if( jj >= (
int)layerStack.size() )
504 layer = layerStack[jj];
535 bool wraparound =
false;
549 for( ; ii < (int)layerStack.size(); ii++ )
551 if( layer == layerStack[ii] )
556 for( ; ii >= 0; ii-- )
561 jj = (int)layerStack.size() - 1;
563 layer = layerStack[jj];
606#define ALPHA_MIN 0.20
607#define ALPHA_MAX 1.00
608#define ALPHA_STEP 0.05
620 settings->
SetColor( currentLayer, currentColor );
650 settings->
SetColor( currentLayer, currentColor );
683 if( presets.size() < 2 )
686 if( currentIndex < 0 )
688 wxASSERT_MSG(
false,
"Current layer pair not found in layer settings" );
692 const int nextIndex = ( currentIndex + 1 ) % presets.size();
693 const LAYER_PAIR& nextPair = presets[nextIndex].GetLayerPair();
706 if( !
Pgm().GetCommonSettings()->m_Input.hotkey_feedback )
721 wxArrayString labels;
724 wxString label = layerPresentation.
getLayerPairName( layerPairInfo.GetLayerPair() );
726 if( layerPairInfo.GetName() )
727 label += wxT(
" (" ) + *layerPairInfo.GetName() + wxT(
")" );
732 if( !editFrame->GetHotkeyPopup() )
733 editFrame->CreateHotkeyPopup();
786 [
this](
const VECTOR2D& pt ) ->
bool
808#define HITTEST_THRESHOLD_PIXELS 5
829 [
this](
const VECTOR2D& aPosition ) ->
bool
835 m_statusPopup.reset( new STATUS_TEXT_POPUP( m_frame ) );
836 m_statusPopup->SetText( _(
"Item locked." ) );
837 m_statusPopup->PopupFor( 2000 );
838 m_statusPopup->Move( KIPLATFORM::UI::GetMousePosition() + wxPoint( 20, 20 ) );
872 for(
int i = collector.
GetCount() - 1; i >= 0; --i )
874 if( !selectionTool->
Selectable( collector[ i ] ) )
899 [
this](
const int& aFinalState )
918 std::vector<BOARD_ITEM*>& aPastedItems )
926 pad->SetParent( editorFootprint );
927 aPastedItems.push_back(
pad );
930 aClipFootprint->
Pads().clear();
937 if( field->IsMandatory() )
939 if(
EDA_GROUP* parentGroup = field->GetParentGroup() )
940 parentGroup->RemoveItem( field );
949 VECTOR2I pos = field->GetFPRelativePosition();
950 field->SetParent( editorFootprint );
951 field->SetFPRelativePosition( pos );
953 aPastedItems.push_back( field );
969 item->Rotate( item->GetPosition(), -aClipFootprint->
GetOrientation() );
970 item->Rotate( item->GetPosition(), editorFootprint->
GetOrientation() );
972 VECTOR2I pos = item->GetFPRelativePosition();
973 item->SetParent( editorFootprint );
974 item->SetFPRelativePosition( pos );
976 aPastedItems.push_back( item );
981 for(
ZONE* zone : aClipFootprint->
Zones() )
983 zone->SetParent( editorFootprint );
984 aPastedItems.push_back( zone );
987 aClipFootprint->
Zones().clear();
991 group->SetParent( editorFootprint );
992 aPastedItems.push_back(
group );
995 aClipFootprint->
Groups().clear();
1009 std::vector<BOARD_ITEM*> returnItems;
1010 bool fpItemDeleted =
false;
1025 returnItems.push_back( fp );
1029 returnItems.push_back( item );
1033 LSET allowed = item->GetLayerSet() & enabledLayers;
1034 bool item_valid =
true;
1043 if( allowed.any() && item_valid )
1045 item->SetLayerSet( allowed );
1046 returnItems.push_back( item );
1050 if(
EDA_GROUP* parentGroup = item->GetParentGroup() )
1051 parentGroup->RemoveItem( item );
1056 if( ( returnItems.size() < aItems.size() ) || fpItemDeleted )
1059 "present in the current board.\n"
1060 "These items could not be pasted.\n" ) );
1063 aItems = returnItems;
1082 if( wxDialog::OSXHasModalDialogsOpen() )
1097 std::vector<BOARD_ITEM*> newItems;
1101 auto refImg = std::make_unique<PCB_REFERENCE_IMAGE>(
m_frame->
GetModel() );
1103 if( refImg->GetReferenceImage().SetImage( *clipImg ) )
1104 newItems.push_back( refImg.release() );
1110 if( clipText.empty() )
1116 int result =
IsOK(
m_frame,
_(
"Pasting a long text text string may be very slow. "
1117 "Do you want to continue?" ) );
1122 std::unique_ptr<PCB_TEXT> item = std::make_unique<PCB_TEXT>(
m_frame->
GetModel() );
1123 item->SetText( clipText );
1125 newItems.push_back( item.release() );
1128 bool cancelled = !
placeBoardItems( &commit, newItems,
true,
false,
false );
1133 commit.
Push(
_(
"Paste Text" ) );
1139 PASTE_MODE mode = PASTE_MODE::KEEP_ANNOTATIONS;
1140 bool clear_nets =
false;
1141 const wxString defaultRef = wxT(
"REF**" );
1158 BOARD* clipBoard =
static_cast<BOARD*
>( clipItem );
1160 if( isFootprintEditor || clear_nets )
1171 bool cancelled =
false;
1173 switch( clipItem->
Type() )
1177 BOARD* clipBoard =
static_cast<BOARD*
>( clipItem );
1179 if( isFootprintEditor )
1182 std::vector<BOARD_ITEM*> pastedItems;
1186 group->SetParent( editorFootprint );
1187 pastedItems.push_back(
group );
1197 switch( clipDrawItem->Type() )
1208 clipDrawItem->SetParent( editorFootprint );
1209 pastedItems.push_back( clipDrawItem );
1215 if(
EDA_GROUP* parentGroup = clipDrawItem->GetParentGroup() )
1216 parentGroup->RemoveItem( clipDrawItem );
1227 [&](
EDA_ITEM* item,
void* testData )
1233 BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( item );
1234 EDA_GROUP* parentGroup = boardItem->GetParentGroup();
1237 parentGroup->RemoveItem( boardItem );
1240 return INSPECT_RESULT::CONTINUE;
1249 mode == PASTE_MODE::UNIQUE_ANNOTATIONS );
1256 fp->ResolveComponentClassNames(
board(), fp->GetTransientComponentClassNames() );
1257 fp->ClearTransientComponentClassNames();
1260 if( mode == PASTE_MODE::REMOVE_ANNOTATIONS )
1263 fp->SetReference( defaultRef );
1267 mode == PASTE_MODE::UNIQUE_ANNOTATIONS );
1276 std::vector<BOARD_ITEM*> pastedItems;
1278 if( isFootprintEditor )
1281 delete clipFootprint;
1285 if( mode == PASTE_MODE::REMOVE_ANNOTATIONS )
1292 pastedItems.push_back( clipFootprint );
1298 mode == PASTE_MODE::UNIQUE_ANNOTATIONS );
1310 commit.
Push(
_(
"Paste" ) );
1353 if( !designBlock || designBlock->GetBoardFile().IsEmpty() )
1362 bool repeatPlacement =
false;
1365 repeatPlacement = cfg->m_DesignBlockChooserPanel.repeated_placement;
1371 ret =
AppendBoard( *pi, designBlock->GetBoardFile() );
1372 }
while( repeatPlacement && ret == 0 );
1394 if( !
group->HasDesignBlockLink() )
1399 std::unique_ptr<DESIGN_BLOCK> designBlock( designBlockPane->
GetDesignBlock(
group->GetDesignBlockLibId(),
1405 msg.Printf(
_(
"Could not find design block %s." ),
group->GetDesignBlockLibId().GetUniStringLibId() );
1410 if( designBlock->GetBoardFile().IsEmpty() )
1413 msg.Printf(
_(
"Design block %s does not have a board file." ),
1414 group->GetDesignBlockLibId().GetUniStringLibId() );
1426 int ret =
AppendBoard( *pi, designBlock->GetBoardFile() );
1448 if( !
group->HasDesignBlockLink() )
1453 std::unique_ptr<DESIGN_BLOCK> designBlock( designBlockPane->
GetDesignBlock(
group->GetDesignBlockLibId(),
1459 msg.Printf(
_(
"Could not find design block %s." ),
group->GetDesignBlockLibId().GetUniStringLibId() );
1474 std::copy_if( aList.begin(), aList.end(), std::back_inserter( aTarget ),
1477 bool doCopy = ( aItem->GetFlags() & SKIP_STRUCT ) == 0;
1479 aItem->ClearFlags( SKIP_STRUCT );
1480 aItem->SetFlags( aIsNew ? IS_NEW : 0 );
1491 std::copy_if( aList.begin(), aList.end(), std::back_inserter( aTarget ),
1494 bool doCopy = ( aItem->GetFlags() & SKIP_STRUCT ) == 0;
1496 aItem->ClearFlags( SKIP_STRUCT );
1497 aItem->SetFlags( aIsNew ? IS_NEW : 0 );
1505 bool aReannotateDuplicates )
1508 bool isNew =
board() != aBoard;
1509 std::vector<BOARD_ITEM*> items;
1533 item->SetParent(
board() );
1538 return placeBoardItems( aCommit, items, isNew, aAnchorAtOrigin, aReannotateDuplicates );
1543 bool aIsNew,
bool aAnchorAtOrigin,
bool aReannotateDuplicates )
1549 std::vector<BOARD_ITEM*> itemsToSel;
1550 itemsToSel.reserve( aItems.size() );
1556 const_cast<KIID&
>( item->m_Uuid ) =
KIID();
1558 item->RunOnChildren(
1563 RECURSE_MODE::RECURSE );
1569 if( item->IsGroupableType() && !item->GetParentGroup() )
1571 aCommit->
Modify( enteredGroup,
nullptr, RECURSE_MODE::NO_RECURSE );
1572 enteredGroup->AddItem( item );
1576 item->SetParent(
board() );
1602 if( !item->GetParentGroup() || !
alg::contains( aItems, item->GetParentGroup()->AsEdaItem() ) )
1603 itemsToSel.push_back( item );
1607 EDA_ITEMS toSel( itemsToSel.begin(), itemsToSel.end() );
1617 aCommit->
Add( item );
1619 aCommit->
Added( item );
1626 if( aAnchorAtOrigin )
1680 std::map<wxString, wxString> oldProperties = brd->
GetProperties();
1681 std::map<wxString, wxString> newProperties;
1693 std::map<std::string, UTF8> props;
1697 props[
"page_width"] = std::to_string( editFrame->
GetPageSizeIU().
x );
1698 props[
"page_height"] = std::to_string( editFrame->
GetPageSizeIU().
y );
1701 [&]( wxString aTitle,
int aIcon, wxString aMessage, wxString aAction ) ->
bool
1703 KIDIALOG dlg( editFrame, aMessage, aTitle, wxOK | wxCANCEL | aIcon );
1705 if( !aAction.IsEmpty() )
1706 dlg.SetOKLabel( aAction );
1717 pi.
LoadBoard( fileName, brd, &props,
nullptr );
1728 for(
const std::pair<const wxString, wxString>& prop : oldProperties )
1729 newProperties[ prop.first ] = prop.second;
1745 if( copperLayerCount > initialCopperLayerCount )
1750 enabledLayers |= initialEnabledLayers;
1756 bool placeAsGroup =
false;
1759 placeAsGroup = cfg->m_DesignBlockChooserPanel.place_as_group;
1783 if( eda_item->IsBOARD_ITEM() )
1786 group->SetLocked(
true );
1794 if( eda_item->IsBOARD_ITEM() && !
static_cast<BOARD_ITEM*
>( eda_item )->GetParentFootprint() )
1796 commit.
Modify( eda_item );
1797 group->AddItem( eda_item );
1809 commit.
Push(
_(
"Append Board" ) );
1830 wxCommandEvent
dummy;
1842 wxCommandEvent
dummy;
1862 snapMode = !snapMode;
1872 if( !
Pgm().GetCommonSettings()->m_Input.hotkey_feedback )
1875 wxArrayString labels;
1876 labels.Add(
_(
"Active Layer" ) );
1877 labels.Add(
_(
"All Layers" ) );
1888 popup->
Popup(
_(
"Object Snapping" ), labels,
static_cast<int>( settings.
allLayers ) );
1903 std::vector<MSG_PANEL_ITEM> msgItems;
1905 if( routerTool && routerTool->RoutingInProgress() )
1907 routerTool->UpdateMessagePanel();
1931 msgItems.emplace_back(
_(
"UUID" ), *uuid );
1947 if( candidate->GetNet() != coupledNet )
1951 candidate->GetEnd() ) );
1953 if( !coupledItem || dist_sq < closestDist_sq )
1955 coupledItem = candidate;
1956 closestDist_sq = dist_sq;
1965 if( !msg.IsEmpty() )
1967 msgItems.emplace_back( wxString::Format(
_(
"DP Gap Constraints: %s" ), msg ),
1968 wxString::Format(
_(
"(from %s)" ), constraint.
GetName() ) );
1977 msgItems.emplace_back( wxString::Format(
_(
"DP Max Uncoupled-length: %s" ), msg ),
1978 wxString::Format(
_(
"(from %s)" ), constraint.
GetName() ) );
1999 if( a_conn && b_conn )
2005 if( overlap.count() > 0 )
2009 if( a_netcode != b_netcode || a_netcode < 0 || b_netcode < 0 )
2012 msgItems.emplace_back(
_(
"Resolved Clearance" ),
2019 int actual_clearance = a_shape->GetClearance( b_shape.get() );
2021 if( actual_clearance > -1 && actual_clearance < std::numeric_limits<int>::max() )
2023 msgItems.emplace_back(
_(
"Actual Clearance" ),
2045 int actual = std::numeric_limits<int>::max();
2052 actual = std::min(
actual, hole->GetClearance( other.get() ) );
2060 actual = std::min(
actual, hole->GetClearance( other.get() ) );
2063 if(
actual < std::numeric_limits<int>::max() )
2066 msgItems.emplace_back(
_(
"Resolved Hole Clearance" ),
2069 if(
actual > -1 &&
actual < std::numeric_limits<int>::max() )
2071 msgItems.emplace_back(
_(
"Actual Hole Clearance" ),
2106 msgItems.emplace_back(
_(
"Resolved Edge Clearance" ),
2111 msgItems.emplace_back(
_(
"Resolved Margin Clearance" ),
2121 if( msgItems.empty() )
2123 msgItems.emplace_back(
_(
"Selected Items" ),
2128 std::set<wxString> netNames;
2129 std::set<wxString> netClasses;
2136 netClasses.insert(
UnescapeString( bci->GetEffectiveNetClass()->GetHumanReadableName() ) );
2138 if( netNames.size() > 1 && netClasses.size() > 1 )
2143 if( netNames.size() == 1 )
2144 msgItems.emplace_back(
_(
"Net" ), *netNames.begin() );
2146 if( netClasses.size() == 1 )
2147 msgItems.emplace_back(
_(
"Resolved Netclass" ), *netClasses.begin() );
2153 bool lengthValid =
true;
2154 double selectedLength = 0;
2157 std::function<void(
EDA_ITEM* )> accumulateTrackLength;
2159 accumulateTrackLength =
2164 selectedLength +=
static_cast<PCB_TRACK*
>( aItem )->GetLength();
2174 if( shape->
GetShape() == SHAPE_T::SEGMENT
2175 || shape->
GetShape() == SHAPE_T::ARC
2176 || shape->
GetShape() == SHAPE_T::BEZIER )
2182 lengthValid =
false;
2188 group->RunOnChildren( accumulateTrackLength, RECURSE_MODE::RECURSE );
2192 lengthValid =
false;
2199 accumulateTrackLength( item );
2204 msgItems.emplace_back(
_(
"Selected 2D Length" ),
2212 bool areaValid =
true;
2214 std::map<PCB_LAYER_ID, SHAPE_POLY_SET> copperPolys;
2217 std::function<void(
EDA_ITEM* )> accumulateArea;
2230 group->RunOnChildren( accumulateArea, RECURSE_MODE::RECURSE );
2236 boardItem->RunOnChildren( accumulateArea, RECURSE_MODE::NO_RECURSE );
2238 for(
PCB_LAYER_ID layer :
LSET( boardItem->GetLayerSet() & enabledCopper ) )
2240 boardItem->TransformShapeToPolySet( copperPolys[layer], layer, 0,
2244 if( aItem->Type() ==
PCB_PAD_T &&
static_cast<PAD*
>( aItem )->HasHole() )
2246 static_cast<PAD*
>( aItem )->TransformHoleToPolygon( holes, 0,
ARC_LOW_DEF,
2253 int R =
via->GetDrillValue() / 2;
2263 accumulateArea( item );
2270 for(
auto& [layer, copperPoly] : copperPolys )
2272 copperPoly.BooleanSubtract( holes );
2273 area += copperPoly.Area();
2276 msgItems.emplace_back(
_(
"Selected 2D Copper Area" ),
2294 wxFileName fileName = wxFileName( *aEvent.
Parameter<wxString*>() );
2301 wxString filePath = fileName.GetFullPath();
2322 table->SetColCount( 4 );
2324 auto addHeaderCell =
2325 [&](
const wxString&
text )
2332 table->AddCell( c );
2336 [&](
const wxString&
text )
2342 table->AddCell( c );
2345 addHeaderCell(
_(
"BOARD CHARACTERISTICS" ) );
2347 for(
int col = 1; col <
table->GetColCount(); ++col )
2349 addHeaderCell( wxEmptyString );
2350 table->GetCell( 0, col )->SetColSpan( 0 );
2353 addDataCell(
_(
"Copper layer count: " ) );
2357 addDataCell(
_(
"Board thickness: " ) );
2364 addDataCell(
_(
"Board overall dimensions: " ) );
2365 addDataCell( wxString::Format( wxT(
"%s x %s" ),
2369 addDataCell( wxEmptyString );
2370 addDataCell( wxEmptyString );
2372 addDataCell(
_(
"Min track/spacing: " ) );
2373 addDataCell( wxString::Format( wxT(
"%s / %s" ),
2379 addDataCell(
_(
"Min hole diameter: " ) );
2382 addDataCell(
_(
"Copper finish: " ) );
2385 addDataCell(
_(
"Impedance control: " ) );
2388 addDataCell(
_(
"Castellated pads: " ) );
2390 addDataCell( castellated_pad_count ?
_(
"Yes" ) :
_(
"No" ) );
2392 addDataCell(
_(
"Press-fit pads: " ) );
2394 addDataCell( pressfit_pad_count ?
_(
"Yes" ) :
_(
"No" ) );
2396 addDataCell(
_(
"Plated board edge: " ) );
2408 addDataCell(
_(
"Edge card connectors: " ) );
2414 std::vector<PCB_TABLECELL*> cells_list =
table->GetCells();
2415 int cell_to_add_cnt = cells_list.size() %
table->GetColCount();
2417 for(
int ii = 0; ii < cell_to_add_cnt; ii++ )
2418 addDataCell( wxEmptyString );
2420 table->SetStrokeExternal(
false );
2421 table->SetStrokeHeaderSeparator(
false );
2422 table->SetStrokeColumns(
false );
2423 table->SetStrokeRows(
false );
2426 std::vector<BOARD_ITEM*> items;
2427 items.push_back(
table );
2430 commit.
Push(
_(
"Place Board Characteristics" ) );
2447 std::vector<BOARD_STACKUP_ITEM*> layers = stackup.
GetList();
2451 table->SetColCount( 7 );
2453 const auto addHeaderCell =
2454 [&](
const wxString&
text )
2460 table->AddCell( c );
2463 const auto addDataCell =
2464 [&](
const wxString&
text,
const char align =
'L' )
2474 table->AddCell( c );
2477 const auto layerThicknessString =
2480 const int layerThickness = aStackupItem.
GetThickness( aSublayerId );
2490 addHeaderCell(
_(
"Layer Name" ) );
2491 addHeaderCell(
_(
"Type" ) );
2492 addHeaderCell(
_(
"Material" ) );
2493 addHeaderCell(
_(
"Thickness" ) );
2494 addHeaderCell(
_(
"Color" ) );
2495 addHeaderCell(
_(
"Epsilon R" ) );
2496 addHeaderCell(
_(
"Loss Tangent" ) );
2498 for(
int i = 0; i < stackup.
GetCount(); i++ )
2502 for(
int sublayer_id = 0; sublayer_id < stackup_item->
GetSublayersCount(); sublayer_id++ )
2516 layerName =
_(
"Dielectric" );
2518 addDataCell( layerName );
2526 addDataCell( stackup_item->
GetMaterial( sublayer_id ) );
2527 addDataCell( layerThicknessString( *stackup_item, sublayer_id ),
'R' );
2528 addDataCell( stackup_item->
GetColor( sublayer_id ) );
2530 stackup_item->
GetEpsilonR( sublayer_id ) ),
'R' );
2538 std::vector<BOARD_ITEM*> items;
2539 items.push_back(
table );
2542 commit.
Push(
_(
"Place Board Stackup Table" ) );
2565 static_cast<PCB_SHAPE*
>( aItem )->UpdateHatching();
2597 std::vector<const EMBEDDED_FILES*> stack;
2601 int embeddedCount = 0;
2605 bool fpModified =
false;
2614 wxFileName fname( fullPath );
2616 if( fname.Exists() )
2620 model.m_Filename = file->GetLink();
2631 if( embeddedCount > 0 )
2633 commit.
Push(
_(
"Embed 3D Models" ) );
2634 wxString msg = wxString::Format(
_(
"%d 3D model(s) successfully embedded." ), embeddedCount );
constexpr EDA_IU_SCALE pcbIUScale
constexpr int ARC_LOW_DEF
constexpr EDA_IU_SCALE unityScale
#define DEFAULT_LINE_WIDTH
@ BS_EDGE_CONNECTOR_BEVELLED
@ BS_EDGE_CONNECTOR_IN_USE
@ BS_ITEM_TYPE_DIELECTRIC
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
static TOOL_ACTION addLibrary
static TOOL_ACTION pickerTool
static TOOL_ACTION gridResetOrigin
static TOOL_ACTION pasteSpecial
static TOOL_ACTION highContrastModeCycle
static TOOL_ACTION highContrastMode
static TOOL_ACTION deleteTool
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION newLibrary
static TOOL_ACTION gridSetOrigin
static TOOL_ACTION ddAddLibrary
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
virtual void Revert() override
Revert the commit by restoring the modified items state.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
NETINFO_ITEM * GetNet() const
Return #NET_INFO object for a given item.
Container for design settings for a BOARD object.
std::shared_ptr< NET_SETTINGS > m_NetSettings
void SetGridOrigin(const VECTOR2I &aOrigin)
std::shared_ptr< DRC_ENGINE > m_DRCEngine
int GetBoardThickness() const
The full thickness of the board including copper and masks.
BOARD_STACKUP & GetStackupDescriptor()
int GetCopperLayerCount() const
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.
bool IsLocked() const override
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
virtual bool IsOnCopperLayer() const
virtual std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const
virtual bool HasHole() const
Manage one layer needed to make a physical board.
wxString GetTypeName() const
int GetSublayersCount() const
double GetEpsilonR(int aDielectricSubLayer=0) const
wxString GetColor(int aDielectricSubLayer=0) const
wxString GetLayerName() const
PCB_LAYER_ID GetBrdLayerId() const
bool IsThicknessEditable() const
int GetThickness(int aDielectricSubLayer=0) const
BOARD_STACKUP_ITEM_TYPE GetType() const
wxString GetMaterial(int aDielectricSubLayer=0) const
double GetLossTangent(int aDielectricSubLayer=0) const
Manage layers needed to make a physical board.
const std::vector< BOARD_STACKUP_ITEM * > & GetList() const
bool SynchronizeWithBoard(BOARD_DESIGN_SETTINGS *aSettings)
Synchronize the BOARD_STACKUP_ITEM* list with the board.
bool m_HasDielectricConstrains
True if some layers have impedance controlled tracks or have specific constrains for micro-wave appli...
bool m_EdgePlating
True if the edge board is plated.
BS_EDGE_CONNECTOR_CONSTRAINTS m_EdgeConnectorConstraints
If the board has edge connector cards, some constrains can be specified in job file: BS_EDGE_CONNECTO...
wxString m_FinishType
The name of external copper finish.
Information pertinent to a Pcbnew printed circuit board.
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &scanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr, bool aAllowUseArcsInPolygons=false, bool aIncludeNPTHAsOutlines=false)
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut l...
EMBEDDED_FILES * GetEmbeddedFiles() override
NETINFO_ITEM * DpCoupledNet(const NETINFO_ITEM *aNet)
void SetVisibleLayers(const LSET &aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of vis...
void MapNets(BOARD *aDestBoard)
Map all nets in the given board to nets with the same name (if any) in the destination board.
const GENERATORS & Generators() const
const std::vector< BOARD_CONNECTED_ITEM * > AllConnectedItems()
const PAGE_INFO & GetPageSettings() const
void SetProperties(const std::map< wxString, wxString > &aProps)
const ZONES & Zones() const
const GROUPS & Groups() const
The groups must maintain the following invariants.
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.
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
TITLE_BLOCK & GetTitleBlock()
int GetCopperLayerCount() const
const std::map< wxString, wxString > & GetProperties() const
const FOOTPRINTS & Footprints() const
void RemoveAll(std::initializer_list< KICAD_T > aTypes={ PCB_NETINFO_T, PCB_MARKER_T, PCB_GROUP_T, PCB_ZONE_T, PCB_GENERATOR_T, PCB_FOOTPRINT_T, PCB_TRACE_T, PCB_SHAPE_T })
An efficient way to remove all items of a certain type from the board.
const TRACKS & Tracks() const
void SetPageSettings(const PAGE_INFO &aPageSettings)
void SetCopperLayerCount(int aCount)
int GetPadWithCastellatedAttrCount()
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
bool IsLayerVisible(PCB_LAYER_ID aLayer) const
A proxy function that calls the correspondent function in m_BoardSettings tests whether a given layer...
int GetPadWithPressFitAttrCount()
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.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
void SetEnabledLayers(const LSET &aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
const DRAWINGS & Drawings() const
constexpr size_type GetWidth() const
constexpr size_type GetHeight() const
int GetCount() const
Return the number of objects in the list.
void Remove(int aIndex)
Remove the item at aIndex (first position is 0).
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetColor(int aLayer, const COLOR4D &aColor)
COLOR4D GetColor(int aLayer) const
COMMIT & Added(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Notify observers that aItem has been added.
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.
DO_NOT_SHOW_AGAIN m_DoNotShowAgain
void SelectLibId(const LIB_ID &aLibId)
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
DESIGN_BLOCK * GetDesignBlock(const LIB_ID &aLibId, bool aUseCacheLib, bool aShowErrorMsg)
Load design block from design block library table.
const LIB_ID & GetLibId() const
bool GetClearNets() const
MINOPTMAX< int > & Value()
virtual APP_SETTINGS_BASE * config() const
Return the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
bool IsType(FRAME_T aType) const
WX_INFOBAR * GetInfoBar()
HOTKEY_CYCLE_POPUP * GetHotkeyPopup()
void DisplayToolMsg(const wxString &msg) override
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
virtual COLOR4D GetGridColor()
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.
virtual void CreateHotkeyPopup()
void ForceRefresh()
Force a redraw.
void SetCurrentCursor(KICURSOR aCursor)
Set the current cursor shape for this panel.
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).
A base class for most all the KiCad significant classes used in schematics and boards.
virtual void SetPosition(const VECTOR2I &aPos)
void SetFlags(EDA_ITEM_FLAGS aMask)
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 void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList)
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
virtual void SetParent(EDA_ITEM *aParent)
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
virtual void SetText(const wxString &aText)
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
EMBEDDED_FILE * AddFile(const wxFileName &aName, bool aOverwrite)
Load a file from disk and adds it to the collection.
static const TOOL_EVENT ClearedEvent
static const TOOL_EVENT SelectedEvent
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
static const TOOL_EVENT PointSelectedEvent
static const TOOL_EVENT ContrastModeChangedByKeyEvent
static const TOOL_EVENT ConnectivityChangedEvent
Selected item had a property changed (except movement)
static const TOOL_EVENT UnselectedEvent
Provide an extensible class to resolve 3D model paths.
wxString ResolvePath(const wxString &aFileName, const wxString &aWorkingPath, std::vector< const EMBEDDED_FILES * > aEmbeddedFilesStack)
Determine the full path of the given file name.
A general implementation of a COLLECTORS_GUIDE.
Used when the right click button is pressed, or when the select tool is in effect.
static const std::vector< KICAD_T > BoardLevelItems
A scan list for all primary board items, omitting items which are subordinate to a FOOTPRINT,...
static const std::vector< KICAD_T > AllBoardItems
A scan list for all editable board items.
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.
static const std::vector< KICAD_T > FootprintItems
A scan list for primary footprint items.
virtual void SetProgressReporter(PROGRESS_REPORTER *aReporter)
Set an optional progress reporter.
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()
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
void DoNotShowCheckbox(wxString file, int line)
Shows the 'do not show again' checkbox.
A color representation with 4 components: red, green, blue, alpha.
double GetBrightness() const
Returns the brightness value of the color ranged from 0.0 to 1.0.
void SetGridOrigin(const VECTOR2D &aGridOrigin)
Set the origin point for the grid.
const COLOR4D & GetClearColor() const
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...
virtual void SetCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true, bool aTriggeredByArrows=false, long aArrowCommand=0)=0
Move cursor to the requested position expressed in world coordinates.
bool IsBOARD_ITEM() const
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
void SetMirror(bool aMirrorX, bool aMirrorY)
Control the mirroring of the VIEW.
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
GAL * GetGAL() const
Return the #GAL this view is using to draw graphical primitives.
void RecacheAllItems()
Rebuild GAL display lists.
void UpdateLayerColor(int aLayer)
Apply the new coloring scheme held by RENDER_SETTINGS in case that it has changed.
void MarkDirty()
Force redraw of view on the next rendering.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
All information about a layer pair as stored in the layer pair store.
Management class for layer pairs in a PCB.
std::vector< LAYER_PAIR_INFO > GetEnabledLayerPairs(int &aCurrentIndex) const
Get a vector of all enabled layer pairs, in order.
void SetCurrentLayerPair(const LAYER_PAIR &aPair)
Set the "active" layer pair.
bool IsValid() const
Check if this LID_ID is valid.
const UTF8 & GetLibItemName() const
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
LSEQ UIOrder() const
Return the copper, technical and user layers in the order shown in layer widget.
LSEQ CuStack() const
Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
static LSET AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
EDA_MSG_PANEL items for displaying messages.
Handle the data for a net.
static NETINFO_ITEM * OrphanedItem()
NETINFO_ITEM meaning that there was no net assigned for an item, as there was no board storing net li...
Describe the page size and margins of a paper page on which to eventually print or plot.
MAGNETIC_SETTINGS m_MagneticItems
static TOOL_ACTION layerToggle
static TOOL_ACTION layerInner12
static TOOL_ACTION nextFootprint
static TOOL_ACTION layerInner8
static TOOL_ACTION zoneDisplayToggle
static TOOL_ACTION previousFootprint
static TOOL_ACTION layerInner3
static TOOL_ACTION layerPrev
static TOOL_ACTION showRatsnest
static TOOL_ACTION zoneFillAll
static TOOL_ACTION layerInner2
static TOOL_ACTION magneticSnapAllLayers
static TOOL_ACTION collect3DModels
static TOOL_ACTION saveToLinkedDesignBlock
static TOOL_ACTION ddAppendBoard
Drag and drop.
static TOOL_ACTION layerInner25
static TOOL_ACTION magneticSnapActiveLayer
Snapping controls.
static TOOL_ACTION layerAlphaDec
static TOOL_ACTION zoneDisplayFilled
static TOOL_ACTION layerInner24
static TOOL_ACTION viaDisplayMode
static TOOL_ACTION layerInner29
static TOOL_ACTION placeCharacteristics
static TOOL_ACTION layerInner11
static TOOL_ACTION layerAlphaInc
static TOOL_ACTION layerPairPresetsCycle
static TOOL_ACTION layerInner16
static TOOL_ACTION layerInner26
static TOOL_ACTION layerInner18
static TOOL_ACTION layerInner14
static TOOL_ACTION trackDisplayMode
static TOOL_ACTION magneticSnapToggle
static TOOL_ACTION layerInner6
static TOOL_ACTION ddImportFootprint
static TOOL_ACTION zoneDisplayTriangulated
static TOOL_ACTION rehatchShapes
static TOOL_ACTION layerInner22
static TOOL_ACTION placeDesignBlock
static TOOL_ACTION layerInner5
static TOOL_ACTION zoneDisplayFractured
static TOOL_ACTION ratsnestModeCycle
static TOOL_ACTION layerInner20
static TOOL_ACTION layerInner7
static TOOL_ACTION layerInner27
static TOOL_ACTION loadFpFromBoard
static TOOL_ACTION appendBoard
static TOOL_ACTION netColorModeCycle
static TOOL_ACTION layerInner1
static TOOL_ACTION layerInner10
static TOOL_ACTION layerInner15
static TOOL_ACTION layerInner17
static TOOL_ACTION flipBoard
static TOOL_ACTION layerBottom
static TOOL_ACTION zoneDisplayOutline
static TOOL_ACTION ratsnestLineMode
static TOOL_ACTION layerInner19
static TOOL_ACTION layerInner9
static TOOL_ACTION saveSelectionToDesignBlock
static TOOL_ACTION move
move or drag an item
static TOOL_ACTION layerInner30
static TOOL_ACTION layerTop
static TOOL_ACTION layerInner4
static TOOL_ACTION layerInner13
static TOOL_ACTION layerInner21
static TOOL_ACTION saveFpToBoard
static TOOL_ACTION layerNext
static TOOL_ACTION placeLinkedDesignBlock
static TOOL_ACTION placeStackup
static TOOL_ACTION layerInner23
static TOOL_ACTION layerInner28
Common, abstract interface for edit frames.
void RestoreCopyFromUndoList(wxCommandEvent &aEvent)
Undo the last edit:
bool AddLibrary(const wxString &aDialogTitle, const wxString &aLibName=wxEmptyString, FP_LIB_TABLE *aTable=nullptr)
Add an existing library to either the global or project library table.
APPEARANCE_CONTROLS * GetAppearancePanel()
void RestoreCopyFromRedoList(wxCommandEvent &aEvent)
Redo the last edit:
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
virtual void OnDisplayOptionsChanged()
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
const VECTOR2I GetPageSizeIU() const override
Works off of GetPageSettings() to return the size of the paper page in the internal units of this par...
PCBNEW_SETTINGS * GetPcbNewSettings() const
virtual void SwitchLayer(PCB_LAYER_ID aLayer)
Change the active layer in the frame.
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 void SaveCopyInUndoList(EDA_ITEM *aItemToCopy, UNDO_REDO aTypeCommand)
Create a new entry in undo list of commands.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
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 SetDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions, bool aRefresh=true)
Update the current display options.
GENERAL_COLLECTORS_GUIDE GetCollectorsGuide()
virtual BOARD_ITEM_CONTAINER * GetModel() const =0
FOOTPRINT_EDITOR_SETTINGS * GetFootprintEditorSettings() const
virtual COLOR_SETTINGS * GetColorSettings(bool aForceRefresh=false) const override
Helper to retrieve the current color settings.
int RehatchShapes(const TOOL_EVENT &aEvent)
void setTransitions() override
< Sets up handlers for various events.
int AppendBoardFromFile(const TOOL_EVENT &aEvent)
int AddLibrary(const TOOL_EVENT &aEvent)
int DdAppendBoard(const TOOL_EVENT &aEvent)
int LoadFpFromBoard(const TOOL_EVENT &aEvent)
int SaveToLinkedDesignBlock(const TOOL_EVENT &aEvent)
int DdImportFootprint(const TOOL_EVENT &aEvent)
int SnapModeFeedback(const TOOL_EVENT &aEvent)
int NetColorModeCycle(const TOOL_EVENT &aEvent)
int SaveFpToBoard(const TOOL_EVENT &aEvent)
int RatsnestModeCycle(const TOOL_EVENT &aEvent)
int TrackDisplayMode(const TOOL_EVENT &aEvent)
int DdAddLibrary(const TOOL_EVENT &aEvent)
int Redo(const TOOL_EVENT &aEvent)
int PlaceLinkedDesignBlock(const TOOL_EVENT &aEvent)
int LayerPresetFeedback(const TOOL_EVENT &aEvent)
int UpdateMessagePanel(const TOOL_EVENT &aEvent)
int LayerAlphaDec(const TOOL_EVENT &aEvent)
int LayerNext(const TOOL_EVENT &aEvent)
int PlaceStackup(const TOOL_EVENT &aEvent)
int AppendBoard(PCB_IO &pi, const wxString &fileName, DESIGN_BLOCK *aDesignBlock=nullptr)
std::unique_ptr< STATUS_TEXT_POPUP > m_statusPopup
int ToggleRatsnest(const TOOL_EVENT &aEvent)
int LayerAlphaInc(const TOOL_EVENT &aEvent)
int HighContrastModeCycle(const TOOL_EVENT &aEvent)
std::unique_ptr< KIGFX::ORIGIN_VIEWITEM > m_gridOrigin
int Quit(const TOOL_EVENT &aEvent)
int HighContrastMode(const TOOL_EVENT &aEvent)
int Undo(const TOOL_EVENT &aEvent)
int ViaDisplayMode(const TOOL_EVENT &aEvent)
static void DoSetGridOrigin(KIGFX::VIEW *aView, PCB_BASE_FRAME *aFrame, EDA_ITEM *originViewItem, const VECTOR2D &aPoint)
int CollectAndEmbed3DModels(const TOOL_EVENT &aEvent)
void pruneItemLayers(std::vector< BOARD_ITEM * > &aItems)
Helper for pasting.
int GridPlaceOrigin(const TOOL_EVENT &aEvent)
int FlipPcbView(const TOOL_EVENT &aEvent)
int PlaceCharacteristics(const TOOL_EVENT &aEvent)
int SnapMode(const TOOL_EVENT &aEvent)
bool placeBoardItems(BOARD_COMMIT *aCommit, std::vector< BOARD_ITEM * > &aItems, bool aIsNew, bool aAnchorAtOrigin, bool aReannotateDuplicates)
Add and select or just select for move/place command a list of board items.
int ContrastModeFeedback(const TOOL_EVENT &aEvent)
int LayerToggle(const TOOL_EVENT &aEvent)
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
int IterateFootprint(const TOOL_EVENT &aEvent)
int Print(const TOOL_EVENT &aEvent)
void rehatchBoardItem(BOARD_ITEM *aItem)
int ZoneDisplayMode(const TOOL_EVENT &aEvent)
int GridResetOrigin(const TOOL_EVENT &aEvent)
BOARD_ITEM * m_pickerItem
int InteractiveDelete(const TOOL_EVENT &aEvent)
int AppendDesignBlock(const TOOL_EVENT &aEvent)
int LayerPrev(const TOOL_EVENT &aEvent)
int CycleLayerPresets(const TOOL_EVENT &aEvent)
int Paste(const TOOL_EVENT &aEvent)
void unfilledZoneCheck()
We have bug reports indicating that some new users confuse zone filling/unfilling with the display mo...
int LayerSwitch(const TOOL_EVENT &aEvent)
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
NET_COLOR_MODE m_NetColorMode
How to use color overrides on specific nets and netclasses.
ZONE_DISPLAY_MODE m_ZoneDisplayMode
void UpdateColors()
Update the color settings in the painter and GAL.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void RedrawRatsnest()
Return the bounding box of the view that should be used if model is not valid.
The main frame for Pcbnew.
PCB_DESIGN_BLOCK_PANE * GetDesignBlockPane() const
static const TOOL_EVENT & SnappingModeChangedByKeyEvent()
Hotkey feedback.
static const TOOL_EVENT & LayerPairPresetChangedByKeyEvent()
A set of BOARD_ITEMs (i.e., without duplicates).
static PCB_IO * PluginFind(PCB_FILE_T aFileType)
Return a #PLUGIN which the caller can use to import, export, save, or load design documents.
PCB_FILE_T
The set of file types that the PCB_IO_MGR knows about, and for which there has been a plugin written,...
@ KICAD_SEXP
S-expression Pcbnew file format.
static PCB_FILE_T FindPluginTypeFromBoardPath(const wxString &aFileName, int aCtl=0)
Return a plugin type given a path for a board file.
A base class that BOARD loading and saving plugins should derive from.
virtual void SetQueryUserCallback(std::function< bool(wxString aTitle, int aIcon, wxString aMessage, wxString aAction)> aCallback)
Registers a KIDIALOG callback for collecting info from the user.
virtual BOARD * LoadBoard(const wxString &aFileName, BOARD *aAppendToMe, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr)
Load information from some input file format that this PCB_IO implementation knows about into either ...
Class that manages the presentation of PCB layers in a PCB frame.
wxString getLayerPairName(const LAYER_PAIR &aPair) const
PCB_LAYER_ID m_Route_Layer_TOP
PCB_LAYER_ID m_Route_Layer_BOTTOM
EDA_ITEM * GetTopLeftItem(bool aFootprintsOnly=false) const override
void SetColSpan(int aSpan)
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
bool HasValidLayerPair(int aCopperLayerCount)
virtual COMMON_SETTINGS * GetCommonSettings() const
static FP_LIB_TABLE * PcbFootprintLibs(PROJECT *aProject)
Return the table of footprint libraries without Kiway.
static S3D_CACHE * Get3DCacheManager(PROJECT *aProject, bool updateProjDir=false)
Return a pointer to an instance of the 3D cache manager.
Container for project specific data.
virtual const wxString GetProjectPath() const
Return the full path of the project.
Cache for storing the 3D shapes.
FILENAME_RESOLVER * GetResolver() noexcept
ecoord SquaredDistance(const SEG &aSeg) const
VECTOR2I::extended_type ecoord
virtual void Add(EDA_ITEM *aItem)
virtual unsigned int GetSize() const override
Return the number of stored items.
int Size() const
Returns the number of selected parts.
void SetReferencePoint(const VECTOR2I &aP)
bool Empty() const
Checks if there is anything selected.
Represent a set of closed polygons.
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
wxString MessageTextFromMinOptMax(const MINOPTMAX< int > &aValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
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.
static constexpr extended_type ECOORD_MAX
A modified version of the wxInfoBar class that allows us to:
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
void AddButton(wxButton *aButton)
Add an already created button to the infobar.
void Dismiss() override
Dismisses the infobar and updates the containing layout and AUI manager (if one is provided).
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
Handle a list of polygons defining a copper zone.
std::string GetClipboardUTF8()
Return the information currently stored in the system clipboard.
std::unique_ptr< wxImage > GetImageFromClipboard()
Get image data from the clipboard, if there is any.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
This file is part of the common library.
void TransformCircleToPolygon(SHAPE_LINE_CHAIN &aBuffer, const VECTOR2I &aCenter, int aRadius, int aError, ERROR_LOC aErrorLoc, int aMinSegCount=0)
Convert a circle to a polygon, using multiple straight lines.
@ DIFF_PAIR_GAP_CONSTRAINT
@ EDGE_CLEARANCE_CONSTRAINT
@ MAX_UNCOUPLED_CONSTRAINT
@ HOLE_CLEARANCE_CONSTRAINT
Declaration of the eda_3d_viewer class.
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
#define SKIP_STRUCT
flag indicating that the structure should be ignored
static FILENAME_RESOLVER * resolver
int m_MaxPastedTextLength
Set the maximum number of characters that can be pasted without warning.
static const std::string KiCadUriPrefix
wxString KeyNameFromKeyCode(int aKeycode, bool *aIsFound)
Return the key name from the key code.
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
This file is part of the common library.
#define KICTL_KICAD_ONLY
chosen file is from KiCad according to user
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.
PCB_LAYER_ID
A quick note on layer IDs:
#define ZONE_LAYER_FOR(boardLayer)
bool IsValidLayer(int aLayerId)
Test whether a given integer is a valid layer index, i.e.
std::optional< wxString > GetMsgPanelDisplayUuid(const KIID &aKiid)
Get a formatted UUID string for display in the message panel, according to the current advanced confi...
KICOMMON_API wxString StringFromValue(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, double aValue, bool aAddUnitsText=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Return the string from aValue according to aUnits (inch, mm ...) for display.
@ REPAINT
Item needs to be redrawn.
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
bool AskLoadBoardFileName(PCB_EDIT_FRAME *aParent, wxString *aFileName, int aCtl=0)
Show a wxFileDialog asking for a BOARD filename to open.
static void pasteFootprintItemsToFootprintEditor(FOOTPRINT *aClipFootprint, BOARD *aBoard, std::vector< BOARD_ITEM * > &aPastedItems)
static void moveUnflaggedItems(const std::deque< T > &aList, std::vector< BOARD_ITEM * > &aTarget, bool aIsNew)
Class to handle a set of BOARD_ITEMs.
bool AskLoadBoardFileName(PCB_EDIT_FRAME *aParent, wxString *aFileName, int aCtl=0)
Show a wxFileDialog asking for a BOARD filename to open.
PGM_BASE & Pgm()
The global program "get" accessor.
std::vector< FAB_LAYER_COLOR > dummy
wxString NotSpecifiedPrm()
wxString UnescapeString(const wxString &aSource)
wxString InitialCaps(const wxString &aString)
Capitalize only the first word.
constexpr int mmToIU(double mm) const
RATSNEST_MODE m_RatsnestMode
bool m_ShowGlobalRatsnest
constexpr KICAD_T BaseType(const KICAD_T aType)
Return the underlying type of the given type.
@ 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_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
@ 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_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
@ 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.