174 group->RemoveItem( aItem );
187 aShape->EDA_SHAPE::TransformShapeToPolygon( poly, 0, aMaxError,
ERROR_INSIDE,
false );
204 chain.SetClosed(
true );
251 if( aMatches( item ) )
252 static_cast<PCB_SHAPE*
>( item )->SetFillMode( aFill );
269 std::vector<PCB_SHAPE*> shapes;
283 shapes.push_back( shape );
292 std::vector<PCB_BARCODE*> barcodes;
297 barcodes.push_back(
static_cast<PCB_BARCODE*
>( item ) );
306 aFootprint->
Add( shape );
309 group->AddItem( shape );
313 aFootprint->
Remove( barcode );
327 aFootprint->
Points().clear();
365 std::vector<wxString> names;
368 names.push_back(
name );
370 for(
const wxString&
name : names )
379 pad->Padstack().FrontPostMachining().mode.reset();
380 pad->Padstack().BackPostMachining().mode.reset();
398 pad->SetPadToDieDelay( 0 );
416 if( !net->GetNetChain().IsEmpty() || net->GetTerminalPad( 0 ) || net->GetTerminalPad( 1 ) )
428 net->SetNetChain( wxEmptyString );
429 net->ClearTerminalPad( 0 );
430 net->ClearTerminalPad( 1 );
433 std::vector<wxString> chains;
436 chains.push_back(
chain );
438 for(
const wxString&
chain : chains )
455 for(
BOARD_ITEM* item : fp->GraphicalItems() )
515 if( fp->GetHeight() != 0 )
536 if( zone->IsCopperThieving() )
542 for(
ZONE* zone : fp->Zones() )
544 if( zone->IsCopperThieving() )
582 if( fp->GetUnitInfo().size() > 1 )
609 for(
BOARD_ITEM* item : fp->GraphicalItems() )
622 std::vector<PCB_BARCODE*> barcodes;
627 barcodes.push_back(
static_cast<PCB_BARCODE*
>( item ) );
636 aBoard->
Add( shape );
639 group->AddItem( shape );
642 aBoard->
Remove( barcode );
657 if( !fp->GetVariants().empty() )
681 if( !fp->JumperPadGroups().IsEmpty() || fp->GetDuplicatePadNumbersAreJumpers() )
759 aPadstack.FrontPostMachining().mode.reset();
760 aPadstack.BackPostMachining().mode.reset();
879 if(
pad->GetPadToDieDelay() != 0 )
900 if( aMatches( item ) )
906 for(
BOARD_ITEM* item : fp->GraphicalItems() )
908 if( aMatches( item ) )
921 if( aMatches( item ) )
922 static_cast<PCB_SHAPE*
>( item )->SetFillMode( aFill );
932 int count =
static_cast<int>( aBoard->
Points().size() );
935 count +=
static_cast<int>( fp->Points().size() );
943 std::vector<BOARD_ITEM*> points( aBoard->
Points().begin(), aBoard->
Points().end() );
1046 for(
int idx = 0; idx < item->GetSublayersCount(); idx++ )
1066 for(
int idx = 0; idx < item->GetSublayersCount(); idx++ )
1078 if(
group->HasDesignBlockLink() )
1086 if(
group->HasDesignBlockLink() )
1111 if( !fp->GetTransform().HasUnitScale() )
1152 pad->Padstack().ForEachUniqueLayer(
1155 for(
const std::shared_ptr<PCB_SHAPE>& primitive :
pad->GetPrimitives( aLayer ) )
1156 aFunc( primitive.get() );
1253 item->SetIsKnockout(
false );
1280 item->SetIsKnockout(
false );
1297 if( cell->IsKnockout() )
1314 for(
BOARD_ITEM* item : fp->GraphicalItems() )
1329 if( cell->IsKnockout() )
1330 cell->SetIsKnockout(
false );
1358 if( !zone->LayerProperties().empty() )
1364 for(
ZONE* zone : fp->Zones() )
1366 if( !zone->LayerProperties().empty() )
1378 zone->SetLayerProperties( {} );
1385 zone->SetLayerProperties( {} );
1459 for(
const PAD*
pad : fp->Pads() )
1474 std::vector<BOARD_ITEM*> remove;
1478 if( aMatches( item ) )
1479 remove.push_back( item );
1485 aFootprint->
Remove( item );
1493 std::vector<BOARD_ITEM*> remove;
1497 if( aMatches( item ) )
1498 remove.push_back( item );
1516 pad->Padstack().ForEachUniqueLayer(
1519 std::erase_if(
pad->Padstack().Primitives( aLayer ),
1520 [&](
const std::shared_ptr<PCB_SHAPE>& aPrimitive )
1522 return aMatches( aPrimitive.get() );
1594 if( cell->IsKnockout() )
1597 cell->SetText( wxEmptyString );
1598 cell->SetIsKnockout(
false );
1626 count += fp->Constraints().size();
1634 const auto constraints = aFootprint->
Constraints();
1639 aFootprint->
Remove( constraint );
1651 aBoard->
Remove( constraint );
1674 return std::count_if( aBoard->
Drawings().begin(), aBoard->
Drawings().end(), aMatches );
1728 table->SetColCount( cols );
1730 for(
int col = 0; col < cols; ++col )
1733 for(
int row = 0; row <
rows; ++row )
1748 std::vector<PCB_STACKUP_TABLE*> tables;
1761 aBoard->
Add( flat );
1764 group->AddItem( flat );
1775 const auto isRotatedReferenceImage = [](
const BOARD_ITEM* aItem )
1784 size_t count = std::count_if( aBoard->
Drawings().begin(), aBoard->
Drawings().end(), isRotatedReferenceImage );
1788 count += std::count_if( fp->GraphicalItems().begin(), fp->GraphicalItems().end(), isRotatedReferenceImage );
1791 return static_cast<int>( count );
1797 const auto isReferenceImageWithOpacity = [](
const BOARD_ITEM* aItem )
1806 size_t count = std::count_if( aBoard->
Drawings().begin(), aBoard->
Drawings().end(), isReferenceImageWithOpacity );
1810 count += std::count_if( fp->GraphicalItems().begin(), fp->GraphicalItems().end(), isReferenceImageWithOpacity );
1813 return static_cast<int>( count );
1819 const auto clearOpacity = [](
BOARD_ITEM* aItem )
1826 clearOpacity( item );
1830 for(
BOARD_ITEM* item : fp->GraphicalItems() )
1831 clearOpacity( item );
1865 return aGenerator->GetGeneratorType() == aType;
1872 const auto generators = aBoard->
Generators();
1876 if( !aMatches( generator ) )
1879 EDA_GROUP* outer = generator->GetParentGroup();
1880 const auto members = generator->
GetItems();
1881 generator->RemoveAll();
1889 aBoard->
Remove( generator );
1908 return pattern && !pattern->
GetItems().empty() && pattern->GetSettings().m_isTimeDomain;
1929 if( aGenerator->GetGeneratorType() != wxT(
"tuning_pattern" ) )
1932 return !dynamic_cast<const PCB_TUNING_PATTERN*>( aGenerator )
1933 || !KICAD_FORMAT::LEGACY::AreTuningPropertiesReviewed(
1934 aGenerator->GetProperties() );
1945 const wxString type = generator->GetGeneratorType();
1947 if( type != wxT(
"tuning_pattern" ) && type != wxT(
"via_stitch" ) && type != wxT(
"via_stack" ) )
1950 for(
EDA_ITEM* member : generator->GetItems() )
1968 switch( aItem->
Type() )
1988 default:
return true;
1999 count += std::count_if( fp->GraphicalItems().begin(), fp->GraphicalItems().end(),
isUnreviewedDrawing );
2008 aVisit(
const_cast<FOOTPRINT*
>( aFootprint ) );
2020 aVisit( generator );
2022 for(
const auto& [
name, item] : generator->GetTemplateItems() )
2070 for(
const ZONE* zone : aBoard->
Zones() )
2072 if( zone->GetLinkSet() !=
niluuid )
2096 bool excluded = fp->IsExcludedFromSim();
2098 for(
const auto& [
name, variant] : fp->GetVariants() )
2099 excluded = excluded || variant.GetExcludedFromSim();
2143 const auto unsafeStroke =
2196 for(
int outline = 0; outline < ink.
OutlineCount(); ++outline )
2202 polygon->SetPolyShape( poly );
2211 polygon->SetParentGroup(
nullptr );
2226 std::vector<PCB_SHAPE*> shapes;
2231 shapes.push_back(
static_cast<PCB_SHAPE*
>( aItem ) );
2246 std::vector<PCB_SHAPE*> shapes;
2251 shapes.push_back(
static_cast<PCB_SHAPE*
>( aItem ) );
2266 if( aName == wxT(
"TITLE" ) )
2268 if( aName == wxT(
"ISSUE_DATE" ) )
2270 if( aName == wxT(
"REVISION" ) )
2272 if( aName == wxT(
"COMPANY" ) )
2274 if( aName.length() == 8 && aName.StartsWith( wxT(
"COMMENT" ) ) && aName[7] >=
'1' && aName[7] <=
'9' )
2275 return 4 + aName[7].GetValue() -
'1';
2285 case 1:
return aTitle.
GetDate();
2288 default:
return aTitle.
GetComment( aIndex - 4 );
2294 std::set<wxString>& aDependencies,
int aDepth = 0 )
2299 for(
size_t pos = 0; pos + 1 < aText.length(); ++pos )
2301 if( aText[pos] ==
'\\'
2302 && pos + 2 < aText.length()
2303 && ( aText[pos + 1] ==
'$' || aText[pos + 1] ==
'@' )
2304 && aText[pos + 2] ==
'{' )
2312 for( ; pos < aText.length() && braces; ++pos )
2313 braces += aText[pos] ==
'{' ? 1 : ( aText[pos] ==
'}' ? -1 : 0 );
2319 if( aText[pos] ==
'@'
2320 && aText[pos + 1] ==
'{'
2326 if( aText[pos] ==
'$'
2327 && aText[pos + 1] ==
'{'
2328 && aText.Mid( pos + 2 ).BeforeFirst(
'}' ).AfterFirst(
':' ).StartsWith( wxT(
"PROPERTY." ) ) )
2336 const wxString&
name = reference.primary;
2338 if(
name.StartsWith( wxT(
"PROPERTY." ) )
2339 || reference.secondary.StartsWith( wxT(
"PROPERTY." ) )
2340 ||
name == wxT(
"DRILL_OPERATIONS" )
2341 ||
name == wxT(
"DRILL_SITES" )
2342 ||
name == wxT(
"DRILL_GROUPS" ) )
2349 wxString resolved =
name;
2355 if( aDependencies.insert(
name ).second
2356 &&
postTargetText( resolved, aBoard, aTargetVersion, aDependencies, aDepth + 1 ) )
2365 const wxString* value =
nullptr;
2370 auto variable = variables.find(
name );
2372 if( variable != variables.end() )
2373 value = &variable->second;
2378 const std::map<wxString, wxString>& properties = aBoard->
GetProperties();
2379 auto property = properties.find(
name );
2381 if( property != properties.end() )
2382 value = &
property->second;
2386 && aDependencies.insert(
name ).second
2387 &&
postTargetText( *value, aBoard, aTargetVersion, aDependencies, aDepth + 1 ) )
2400 std::set<wxString> dependencies;
2401 return postTargetText( aText, aBoard, aTargetVersion, dependencies );
2416 for(
size_t pos = 0; pos + 1 < aText.length(); ++pos )
2418 if( aText[pos] ==
'\\' && pos + 2 < aText.length() && ( aText[pos + 1] ==
'$' || aText[pos + 1] ==
'@' )
2419 && aText[pos + 2] ==
'{' )
2424 for( ; pos < aText.length() && braces; ++pos )
2425 braces += aText[pos] ==
'{' ? 1 : ( aText[pos] ==
'}' ? -1 : 0 );
2429 else if( aText[pos] ==
'@' && aText[pos + 1] ==
'{' )
2440 const std::function<
bool( wxString* )>* aResolver =
nullptr )
2449 if( !
text && !barcode )
2461 std::function<bool( wxString* )> resolver =
2462 [&]( wxString* aToken )
2465 return ( *aResolver )( aToken );
2467 if( *aToken == wxT(
"LAYER" ) && board )
2478 bool blocked =
false;
2480 for(
size_t pos = 0; pos < raw.length(); )
2483 bool escaped = raw[pos] ==
'\\'
2484 && pos + 2 < raw.length()
2485 && ( raw[pos + 1] ==
'$' || raw[pos + 1] ==
'@' )
2486 && raw[pos + 2] ==
'{';
2487 size_t marker = escaped ? pos + 1 : pos;
2489 if( marker + 1 >= raw.length() || ( raw[marker] !=
'$' && raw[marker] !=
'@' ) || raw[marker + 1] !=
'{' )
2498 while( pos < raw.length() && braces )
2500 braces += raw[pos] ==
'{' ? 1 : ( raw[pos] ==
'}' ? -1 : 0 );
2504 wxString block = raw.Mid( start, pos - start );
2523 if( cell->GetRow() < 0 || cell->GetColumn() < 0 )
2554 for(
int depth = 0; depth < 32; ++depth )
2561 expanded = evaluator.
Evaluate( expanded );
2570 if( expanded == block )
2583 || block.Contains( wxT(
"<Unresolved:" ) )
2584 || block.Contains( wxT(
"<Unknown reference:" ) ) )
2593 && (
result.Contains( wxT(
"\\${" ) ) ||
result.Contains( wxT(
"\\@{" ) ) ) )
2606 plan.m_board =
const_cast<BOARD*
>( aBoard );
2613 std::function<bool( wxString* )> resolver = [&]( wxString* aToken )
2615 if( *aToken == wxT(
"FILENAME" )
2616 || *aToken == wxT(
"FILEPATH" )
2617 || *aToken == wxT(
"VARIANT" )
2618 || *aToken == wxT(
"VARIANT_DESC" ) )
2628 for(
int field = 0; field < 13; ++field )
2633 planTextItem( &temporary, aTargetVersion, title, &resolver );
2649 dimension->ChangeOverrideText( value );
2651 text->SetText( value );
2652 else if(
auto barcode =
dynamic_cast<PCB_BARCODE*
>( item ) )
2653 barcode->SetBarcodeText( value );
2662 case 0: title.
SetTitle( value );
break;
2663 case 1: title.
SetDate( value );
break;
2666 default: title.
SetComment( field - 4, value );
break;
2698 _(
"Unknown generator kinds or detached generated children cannot be safely exported." ),
2701 _(
"The tuning generator contains properties outside the reviewed historical schemas." ),
2704 _(
"Generator editability is removed. Existing generated copper and group membership are kept." ),
2707 _(
"Group placement linkage is removed. Zone geometry, keepout settings, groups, and copper are kept." ),
2710 _(
"An unrecognized graphic item cannot be safely represented by the target writer." ),
2713 _(
"Solver relationships are removed. Existing geometry is kept in its current position." ),
countConstraints,
2716 _(
"Placement, snapping, and routing grid configuration is removed. Copper is unchanged." ),
countGrids,
2719 _(
"Generator editability is removed. Existing generated copper and group membership are kept." ),
2720 [](
const BOARD* b )
2729 _(
"Generator editability is removed. Existing generated copper and group membership are kept." ),
2730 [](
const BOARD* b )
2739 _(
"Converted to printed polygons with the shortened line body. Ending editability is lost." ),
2740 [](
const BOARD* b )
2760 _(
"Endpoint embellishments are removed. The supported line body and its style are kept." ) },
2762 _(
"Simulation exclusions are removed. The target may include these footprints in simulation." ),
2765 _(
"Custom item metadata is removed after affected displayed text has been resolved." ),
2768 _(
"Drill chart tables and drill map symbols are removed from the fabrication drawings. Holes are kept." ),
2771 _(
"Drill symbol assignments and display settings are removed. Holes are unchanged." ),
2774 _(
"Links between placement rule areas and their saved repeat layout options are removed. "
2775 "The copied layouts are kept." ),
2778 _(
"The target cannot store an image rotation." ),
2781 _(
"The target cannot store an image opacity. Opacity will be ignored." ),
2784 _(
"No equivalent in the target. Connectivity will change." ),
2787 _(
"Approximated by a polygon." ),
2789 _(
"Ellipse graphics are omitted instead of approximated." ) },
2791 _(
"No equivalent in the target. The 3D body is left out." ),
2794 _(
"No equivalent in the target. The footprint height is left out." ),
2797 _(
"A refill in the target would turn the pattern into solid copper." ),
2800 _(
"The simulation electrical type is left out." ),
2803 _(
"Pin-to-unit assignments used for gate swapping are removed." ),
2806 _(
"Converted to the printed polygons. No longer editable as a barcode." ),
2808 _(
"Barcodes are omitted instead of converted to polygons." ) },
2810 _(
"Variant registry and per-footprint overrides are removed." ),
2813 _(
"Jumper pad groupings are removed." ),
2816 _(
"Backdrilling changes copper connectivity and cannot be represented." ),
2821 _(
"The press-fit fabrication property is removed." ),
2824 _(
"Approximated by keeping only the start and end layers." ),
2833 _(
"Written with the older combined blind type." ),
2842 _(
"Per-layer zone defaults are removed." ),
2845 _(
"Pad-to-die delay is removed." ),
2848 _(
"Converted to a solid fill." ),
2849 [](
const BOARD* b )
2869 _(
"The hatch fill is omitted. The supported outline is kept." ) },
2871 _(
"Converted to a solid fill. Copper geometry may change." ),
2872 [](
const BOARD* b )
2889 _(
"No equivalent in the target. Points are removed." ),
2892 _(
"IPC-4761 covering, plugging, capping, and filling are removed." ),
2895 _(
"The frequency-dependent dielectric model is removed." ),
2898 _(
"The link from a group to its design block is removed." ),
2901 _(
"Converted to a static table with the same contents. Column configuration and the "
2902 "link to the board stackup are lost." ),
2904 _(
"Stackup tables are omitted instead of converted to static tables." ) },
2906 _(
"Drawn as plain text boxes." ),
2909 _(
"Knockout text boxes are omitted instead of drawn as plain text." ) },
2911 _(
"Approximated by a polygon." ),
2913 _(
"Rounded rectangles and rounded custom pad primitives are omitted. Copper geometry may change." ) },
2915 _(
"Drawn as plain cells." ),
2918 _(
"Knockout cell contents are omitted; empty cells and the table grid are kept." ) },
2920 _(
"The per-layer overrides are removed." ),
2923 _(
"The target supports only 9 user layers." ),
2926 _(
"The target would expand the footprint's inner layers and change its connectivity." ),
2929 _(
"The target cannot represent a scaled footprint." ),
2935 _(
"Non-component pads" ),
2936 _(
"The target cannot represent non-component pads." ),
2946 bool aDropInsteadOfApproximate )
2951 wxT(
"Board format changed. Review the downgrade rules and denylist, then update "
2952 "BOARD_DOWNGRADE_COVERED." ) );
2959 _(
"The current board format has changed since the downgrade rules were reviewed." ), 1 );
2965 _(
"The unsupported plot format is reset to Gerber." ), 1 );
2972 if(
text.m_blocked )
2975 _(
"Affected property variables or expressions could not be safely resolved." ),
2979 if( !
text.m_replacements.empty() || !
text.m_titleReplacements.empty() )
2982 _(
"Affected displayed text is resolved to its current value and loses dynamic evaluation." ),
2983 text.m_replacements.size() +
text.m_titleReplacements.size() );
2992 _(
"Dashed, colored, or unresolved-width line endings cannot be faithfully converted. "
2993 "The omission policy can remove just the endpoint embellishments." ),
3003 if(
int count = rule.m_count( aBoard ); count > 0 )
3005 bool omit = aDropInsteadOfApproximate
3007 && !rule.m_keepUnderOmitPolicy;
3011 omit ? rule.m_omitDetail : rule.m_detail,
3076 bool omit = aDropInsteadOfApproximate
3078 && !rule.m_keepUnderOmitPolicy;
3080 const std::function<void(
BOARD* )>& apply = omit ? rule.m_omit : rule.m_apply;
3082 wxASSERT_MSG( !omit || apply, wxT(
"A LOWER rule needs an omission transform." ) );
3113 bool omit = aDropInsteadOfApproximate
3115 && !rule.m_keepUnderOmitPolicy;
3117 const std::function<void(
FOOTPRINT*)>& apply = omit ? rule.m_omitFp : rule.m_applyFp;
3119 wxASSERT_MSG( !omit || !rule.m_applyFp || apply, wxT(
"A footprint LOWER rule needs an omission transform." ) );
3122 apply( aFootprint );
3232 wxFAIL_MSG( wxT(
"No writer for this downgrade target." ) );
3243 wxFAIL_MSG( wxT(
"No writer for this downgrade target." ) );
3250 std::vector<std::string>
path;
3252 for(
size_t position = 0; position <
text.size(); ++position )
3254 if(
text[position] ==
'(' )
3256 size_t begin = position + 1;
3258 while( begin <
text.size() && std::isspace(
static_cast<unsigned char>(
text[begin] ) ) )
3264 && ( std::isalnum(
static_cast<unsigned char>(
text[
end] ) ) ||
text[
end] ==
'_' ) )
3267 const std::string head =
text.substr( begin,
end - begin );
3269 if( head ==
"group" &&
path.size() >= 2 &&
path.back() ==
"placement" &&
path[
path.size() - 2] ==
"zone" )
3272 path.push_back( head );
3273 position =
end > begin ?
end - 1 : position;
3275 else if(
text[position] ==
')' && !
path.empty() )
3288 return wxEmptyString;
3291 return wxT(
"placement/group" );
3302 fp->SetDNP( fp->GetDNPForVariant( aVariantName ) );
3303 fp->SetExcludedFromBOM( fp->GetExcludedFromBOMForVariant( aVariantName ) );
3304 fp->SetExcludedFromPosFiles( fp->GetExcludedFromPosFilesForVariant( aVariantName ) );
3305 fp->SetExcludedFromSim( fp->GetExcludedFromSimForVariant( aVariantName ) );
3309 for(
const auto& [
name, value] : variant->GetFields() )
3312 field->SetText( value );
3324 std::unique_ptr<FOOTPRINT> owned = loader.
ImportFootprint( aSrcFile, nameOut );
3333 scratch.
Add( owned.release() );
3353 bool aDropInsteadOfApproximate )
3355 if( aUnsupportedToken )
3356 aUnsupportedToken->clear();
3359 wxFileName projectFile( aSrcFile );
3361 projectFile.MakeAbsolute();
3362 projectSettings.
LoadProject( projectFile.GetFullPath(),
false );
3365 std::unique_ptr<BOARD> board( pi.
LoadBoard( aSrcFile,
nullptr ) );
3371 board->SetProject( projectSettings.
GetProject( projectFile.GetFullPath() ),
true );
3373 if( !aVariant.IsEmpty() )
3386 const wxString tmpFile = wxFileName::CreateTempFileName( aDestFile + wxT(
".downgrade_tmp." ) );
3388 if( tmpFile.IsEmpty() )
3393 wxRemoveFile( tmpFile );
3401 wxRemoveFile( tmpFile );
3411 [&](
const wxString& aText )
3413 return FindUnsupportedBoardToken( aText, aTarget );
3419 wxRemoveFile( tmpFile );
3421 if( aUnsupportedToken )
3422 *aUnsupportedToken = bad;
3427 if( !wxRenameFile( tmpFile, aDestFile,
true ) )
3429 wxRemoveFile( tmpFile );
constexpr EDA_IU_SCALE pcbIUScale
static void dropDielectricModels(BOARD *aBoard)
static void dropUnitInfoFp(FOOTPRINT *aFootprint)
COMPATIBILITY_REPORT ClassifyBoardForDowngrade(const BOARD *aBoard, const DOWNGRADE_TARGET &aTarget, bool aDropInsteadOfApproximate)
Report what a board would lose if exported to an older KiCad.
static void dropUnitInfo(BOARD *aBoard)
static void transformLineEndingsFp(FOOTPRINT *aFootprint, bool aOmit)
static constexpr int VER_IMAGE_PPI
static constexpr int VER_USER_LAYERS
static int countLinkedPlacementAreas(const BOARD *aBoard)
static constexpr int VER_JUMPER_PADS
static void dropKnockoutTableCells(BOARD *aBoard)
static void lowerBarcodes(BOARD *aBoard)
static void dropLinkedPlacementAreas(BOARD *aBoard)
static void dropPressFitPadsFp(FOOTPRINT *aFootprint)
static int countDieDelays(const BOARD *aBoard)
static bool hasViaProtection(const PCB_VIA *aVia)
static void detachFromGroup(BOARD_ITEM *aItem)
static void dropTimeDomainTuning(BOARD *aBoard)
static void dropJumperPadsFp(FOOTPRINT *aFootprint)
static void dropCustomProperties(BOARD *aBoard)
static int countCustomFpStackups(const BOARD *aBoard)
static constexpr int VER_NON_COMPONENT_PAD
static int countFootprintHeights(const BOARD *aBoard)
static constexpr int VER_DRILL_DRAWINGS
static int countHatchedFills(const BOARD *aBoard, const std::function< bool(const BOARD_ITEM *)> &aMatches)
static constexpr int VER_THIEVING
static bool isDrillDrawing(const BOARD_ITEM *aItem)
static void lowerRoundedRects(BOARD *aBoard)
void SaveFootprintForTarget(FOOTPRINT *aFootprint, const wxString &aPath, const DOWNGRADE_TARGET &aTarget)
Save a single .kicad_mod footprint file for the target.
static constexpr int VER_DIELECTRIC
static constexpr int BOARD_DOWNGRADE_COVERED
static int countKnockoutTextBoxesFp(const FOOTPRINT *aFootprint)
static void dropKnockoutCellsIn(BOARD_ITEM *aItem)
static void omitBarcodesFp(FOOTPRINT *aFootprint)
static constexpr int VER_IMAGE_ROTATION
static int countLineEndings(const BOARD *aBoard, bool aUnsafeOnly=false)
static void lowerBuriedVias(BOARD *aBoard)
static void dropPostMachiningFp(FOOTPRINT *aFootprint)
static int countPcbPoints(const BOARD *aBoard)
static int countGrids(const BOARD *aBoard)
static void omitGraphicsFp(FOOTPRINT *aFootprint, const std::function< bool(const BOARD_ITEM *)> &aMatches)
static constexpr int VER_PRESSFIT
static void dropKnockoutTextBoxes(BOARD *aBoard)
int BoardDowngradeCoveredVersion()
The format the denylist was generated against. A format bump forces a review.
static void forEachPadPrimitive(FOOTPRINT *aFootprint, const std::function< void(PCB_SHAPE *)> &aFunc)
static bool isBarcode(const BOARD_ITEM *aItem)
static bool hasActiveExpression(const wxString &aText)
static int countZoneDefaults(const BOARD *aBoard)
static bool isUnreviewedDrawing(const BOARD_ITEM *aItem)
static void dropViaProtection(BOARD *aBoard)
static void omitKnockoutTextBoxesFp(FOOTPRINT *aFootprint)
static void dropJumperPads(BOARD *aBoard)
static void dropGrids(BOARD *aBoard)
static constexpr int VER_SIM_EXCLUSION
static int countStackupTables(const BOARD *aBoard)
static int countJumperPads(const BOARD *aBoard)
static int countPostMachining(const BOARD *aBoard)
static int countSkipVias(const BOARD *aBoard)
static int countPadSimTypes(const BOARD *aBoard)
static void planTextItem(BOARD_ITEM *aItem, int aTargetVersion, TEXT_DOWNGRADE_PLAN &aPlan, const std::function< bool(wxString *)> *aResolver=nullptr)
static const wxString & titleFieldText(const TITLE_BLOCK &aTitle, int aIndex)
static void dropFootprintHeights(BOARD *aBoard)
static void roundedRectToPolygon(PCB_SHAPE *aShape, int aMaxError)
static int countHighUserLayers(const BOARD *aBoard)
static bool hasBackdrill(const PADSTACK &aPadstack)
static void dropZoneLayerProperties(BOARD *aBoard)
static int countBackdrills(const BOARD *aBoard)
static int countNetChains(const BOARD *aBoard)
static int countNonComponentPads(const BOARD *aBoard)
static void setHatchedFills(BOARD *aBoard, const std::function< bool(const BOARD_ITEM *)> &aMatches, FILL_T aFill)
static std::vector< BOARD_RULE > boardRules()
static void dropConstraints(BOARD *aBoard)
static int countKnockoutCellsIn(const BOARD_ITEM *aItem)
static constexpr int VER_ZONE_DEFAULTS
static constexpr int VER_SHAPE_HATCH
static int countRoundedRectsFp(const FOOTPRINT *aFootprint)
static void omitGraphics(BOARD *aBoard, const std::function< bool(const BOARD_ITEM *)> &aMatches)
void SaveBoardForTarget(BOARD *aBoard, const wxString &aPath, const DOWNGRADE_TARGET &aTarget)
Save a board stamped for the target, using the writer for that version.
static int countGroupDesignBlocks(const BOARD *aBoard)
static void omitEllipses(BOARD *aBoard)
static int countScaledFootprints(const BOARD *aBoard)
static int countSimulationExclusions(const BOARD *aBoard)
static int footprintMaxError(const FOOTPRINT *aFootprint)
static bool isGrid(const BOARD_ITEM *aItem)
void FlattenBoardVariant(BOARD *aBoard, const wxString &aVariantName)
Bake a variant's overrides into the base footprint attributes.
static void dropPcbVariantsFp(FOOTPRINT *aFootprint)
static int countZoneLayerProperties(const BOARD *aBoard)
static void dropConstraintsFp(FOOTPRINT *aFootprint)
static void omitKnockoutTableCells(BOARD *aBoard)
static void dropExtrudedBodiesFp(FOOTPRINT *aFootprint)
static void setHatchedFillsFp(FOOTPRINT *aFootprint, const std::function< bool(const BOARD_ITEM *)> &aMatches, FILL_T aFill)
static int countGroupPlacementAreas(const BOARD *aBoard)
static void transformLineEndings(BOARD *aBoard, bool aOmit)
static constexpr int VER_PAD_DIE_DELAY
static constexpr int VER_VIA_SPLIT
static int countUnreviewedDrawings(const BOARD *aBoard)
static constexpr int VER_VIA_STITCH
static void omitEllipsesFp(FOOTPRINT *aFootprint)
static void dropGroupPlacementLinkage(ZONE *aZone)
static void dropDieDelaysFp(FOOTPRINT *aFootprint)
static constexpr int VER_NET_CHAINS
static void dropExtrudedBodies(BOARD *aBoard)
static bool isHatchedShape(const BOARD_ITEM *aItem)
static constexpr DATED_TOKEN BOARD_VALUES[]
static int countBuriedVias(const BOARD *aBoard)
static void dropNetChains(BOARD *aBoard)
static constexpr int VER_TIME_DOMAIN_TUNING
static bool isKnockoutTextBox(const BOARD_ITEM *aItem)
static int countUnknownGenerators(const BOARD *aBoard)
static constexpr int VER_VIA_STACK
static constexpr int VER_ELLIPSE
static int countDrillSymbolConfiguration(const BOARD *aBoard)
static void omitRoundedRectsFp(FOOTPRINT *aFootprint)
static void dropDrillDrawings(BOARD *aBoard)
static PCB_TABLE * stackupTableToTable(const PCB_STACKUP_TABLE *aTable, BOARD_ITEM *aParent)
Cells are cloned, not moved, because a table deletes its own cells.
static bool isTimeDomainTuning(const PCB_GENERATOR *aGenerator)
static constexpr int VER_CELL_KNOCKOUT
static constexpr int VER_GRIDS
static constexpr int VER_PROPERTY_VARIABLES
static void dropZoneDefaults(BOARD *aBoard)
static void dropReferenceImageOpacities(BOARD *aBoard)
static void dropFootprintHeightsFp(FOOTPRINT *aFootprint)
static int countTimeDomainTuning(const BOARD *aBoard)
static int countCustomProperties(const BOARD *aBoard)
static void dropPadSimTypesFp(FOOTPRINT *aFootprint)
int FootprintLibDowngradeCoveredVersion()
The footprint library format the rules were reviewed against. Moves independently of the board.
static bool isHatchedCopperShape(const BOARD_ITEM *aItem)
static constexpr int VER_TEXTBOX_KNOCKOUT
bool ExportBoardToOlderVersion(const wxString &aSrcFile, const wxString &aDestFile, const DOWNGRADE_TARGET &aTarget, COMPATIBILITY_REPORT &aReport, wxString *aUnsupportedToken, const wxString &aVariant, bool aDropInsteadOfApproximate)
Load a board, downgrade the copy, and write it stamped for the target.
static void dropPcbVariants(BOARD *aBoard)
static void dropGroupPlacementAreas(BOARD *aBoard)
static constexpr int VER_FOOTPRINT_HEIGHT
static void dropPressFitPads(BOARD *aBoard)
static void dropPostMachining(BOARD *aBoard)
static TEXT_DOWNGRADE_PLAN planBoardText(const BOARD *aBoard, int aTargetVersion)
static constexpr int VER_FP_UNITS
static int countBarcodes(const BOARD *aBoard)
static void lowerLineEndingShape(PCB_SHAPE *aShape, int aMaxError)
static void dropSimulationExclusions(BOARD *aBoard)
static void omitStackupTables(BOARD *aBoard)
static bool hasLineEndings(const BOARD_ITEM *aItem)
static constexpr int VER_IMAGE_OPACITY
static int countGenerators(const BOARD *aBoard, const wxString &aType)
static constexpr int VER_GROUP_LIB_ID
static int countEllipses(const BOARD *aBoard)
static void ellipseToPolygon(PCB_SHAPE *aShape, int aMaxError)
static void dropSimulationExclusionsFp(FOOTPRINT *aFootprint)
static int countExtrudedBodies(const BOARD *aBoard)
static void lowerSkipVias(BOARD *aBoard)
static void dropPcbPoints(BOARD *aBoard)
static void visitBoardItems(const BOARD *aBoard, const std::function< void(BOARD_ITEM *)> &aVisit)
static constexpr int VER_LINE_ENDINGS
static int countViaProtection(const BOARD *aBoard)
static int countUnitInfo(const BOARD *aBoard)
static constexpr int VER_CONSTRAINTS
static int countDrawings(const BOARD *aBoard, const std::function< bool(const BOARD_ITEM *)> &aMatches)
static bool postTargetText(const wxString &aText, const BOARD *aBoard, int aTargetVersion, std::set< wxString > &aDependencies, int aDepth=0)
static void compensateImageScale(PCB_REFERENCE_IMAGE *aImage)
static void omitKnockoutTextBoxes(BOARD *aBoard)
static int countReferenceImageRotations(const BOARD *aBoard)
static void dropKnockoutTextBoxesFp(FOOTPRINT *aFootprint)
static void clearLineEndings(PCB_SHAPE *aShape)
static int countReferenceImageOpacities(const BOARD *aBoard)
static void lowerEllipses(BOARD *aBoard)
static bool isStackupTable(const BOARD_ITEM *aItem)
static void dropDieDelays(BOARD *aBoard)
static constexpr int VER_STACKUP_TABLE
static constexpr int VER_PCB_POINTS
static void omitKnockoutTableCellsFp(FOOTPRINT *aFootprint)
static bool unsafeLineEndings(const PCB_SHAPE *aShape)
static std::vector< PCB_SHAPE * > barcodeToShapes(PCB_BARCODE *aBarcode, BOARD_ITEM_CONTAINER *aParent)
static constexpr int VER_BACKDRILL
static void omitBarcodes(BOARD *aBoard)
static void dropGroupDesignBlocks(BOARD *aBoard)
static int countDrillDrawings(const BOARD *aBoard)
static bool hasPostMachining(const PADSTACK &aPadstack)
static void lowerEllipsesFp(FOOTPRINT *aFootprint)
static void dropPcbPointsFp(FOOTPRINT *aFootprint)
static void lowerRoundedRectsFp(FOOTPRINT *aFootprint)
static bool isEllipse(const BOARD_ITEM *aItem)
static void lowerBarcodesFp(FOOTPRINT *aFootprint)
static void compensateReferenceImageScales(BOARD *aBoard)
static void visitFootprintItems(const FOOTPRINT *aFootprint, const std::function< void(BOARD_ITEM *)> &aVisit)
static constexpr int VER_VIA_PROTECTION
static bool isRoundedRect(const BOARD_ITEM *aItem)
DOWNGRADE_FILE_RESULT DowngradeFootprintFileToTemp(const wxString &aSrcFile, const wxString &aTmpFile, const DOWNGRADE_TARGET &aTarget, bool aDropInsteadOfApproximate)
Load one .kicad_mod, classify it against the rule table, and write the downgraded copy to aTmpFile.
static int countPcbVariants(const BOARD *aBoard)
static bool containsGroupPlacementSource(const std::string &aText)
static void applyTextPlan(const TEXT_DOWNGRADE_PLAN &aPlan)
void DowngradeBoardInPlace(BOARD *aBoard, const DOWNGRADE_TARGET &aTarget, bool aDropInsteadOfApproximate)
Approximate or remove, in place, what the target cannot represent.
static int countConstraints(const BOARD *aBoard)
static void dropGroupDesignBlocksFp(FOOTPRINT *aFootprint)
static int countKnockoutTableCells(const BOARD *aBoard)
static constexpr int VER_POST_MACHINING
static int countUnreviewedTuningProperties(const BOARD *aBoard)
void DowngradeFootprintInPlace(FOOTPRINT *aFootprint, const DOWNGRADE_TARGET &aTarget, bool aDropInsteadOfApproximate)
Footprint-scoped downgrade for standalone .kicad_mod files the board pass never sees.
static int countPressFitPads(const BOARD *aBoard)
static constexpr int VER_PAD_SIM
static constexpr int VER_BARCODE
static void omitKnockoutCellContents(BOARD_ITEM *aItem)
static void dropZoneLayerPropertiesFp(FOOTPRINT *aFootprint)
static bool hasGroupPlacementLinkage(const ZONE *aZone)
static constexpr int FOOTPRINT_LIB_DOWNGRADE_COVERED
static int countThievingZones(const BOARD *aBoard)
static constexpr int VER_FP_LIB_HEADER
static int countKnockoutTextBoxes(const BOARD *aBoard)
static void omitPadPrimitives(FOOTPRINT *aFootprint, const std::function< bool(const BOARD_ITEM *)> &aMatches)
static constexpr int VER_CUSTOM_PROPERTIES
static void dropCustomPropertiesFp(FOOTPRINT *aFootprint)
static constexpr int VER_EXTRUDED_BODY
static int countDielectricModels(const BOARD *aBoard)
static int countRoundedRects(const BOARD *aBoard)
static void dropPadSimTypes(BOARD *aBoard)
static constexpr int VER_ROUNDED_RECT
static void omitRoundedRects(BOARD *aBoard)
static int titleFieldIndex(const wxString &aName)
static void dropGroupPlacementAreasFp(FOOTPRINT *aFootprint)
static constexpr int VER_SKIP_VIA
static constexpr int VER_LINKED_PLACEMENT
static constexpr DATED_TOKEN BOARD_TOKENS[]
static bool isHatchedInkShape(const BOARD_ITEM *aItem)
static void compensateReferenceImageScalesFp(FOOTPRINT *aFootprint)
static void dropDrillSymbolConfiguration(BOARD *aBoard)
static void dropGenerators(BOARD *aBoard, const std::function< bool(const PCB_GENERATOR *)> &aMatches)
wxString FindUnsupportedBoardToken(const wxString &aSerialized, const DOWNGRADE_TARGET &aTarget)
Scan serialized board text for tokens the target cannot parse.
static void lowerStackupTables(BOARD *aBoard)
static constexpr int VER_GROUP_PLACEMENT
static void dropKnockoutTableCellsFp(FOOTPRINT *aFootprint)
constexpr int FIRST_FP_CUSTOM_STACKUP
First board format that stores custom footprint stackups.
constexpr int FIRST_PCB_VARIANTS
First board format that stores variants.
@ BS_ITEM_TYPE_DIELECTRIC
int GetLegacyPPI() const
Recompute the PPI the way it was computed before the pixels/cm truncation fix.
Container for design settings for a BOARD object.
std::map< PCB_LAYER_ID, ZONE_LAYER_PROPERTIES > m_ZoneLayerProperties
DRILL_SYMBOL_PROFILE & GetDrillSymbolProfile()
BOARD_STACKUP & GetStackupDescriptor()
Abstract interface for BOARD_ITEMs capable of storing other items inside.
virtual void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false)=0
Adds an item to the container.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
void SetLocked(bool aLocked) override
virtual bool IsKnockout() const
bool IsLocked() const override
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
FOOTPRINT * GetParentFootprint() const
BOARD_ITEM_CONTAINER * GetParent() const
Manage one layer needed to make a physical board.
Manage layers needed to make a physical board.
const std::vector< BOARD_STACKUP_ITEM * > & GetList() const
Information pertinent to a Pcbnew printed circuit board.
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
const NETINFO_LIST & GetNetInfo() const
void SetCurrentVariant(const wxString &aVariant)
void SetVariantNames(const std::vector< wxString > &aNames)
const std::vector< wxString > & GetVariantNames() const
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
void SetNetChainColor(const wxString &aChain, const KIGFX::COLOR4D &aColor)
Per-net-chain colour override (empty COLOR4D::UNSPECIFIED = no override).
const GENERATORS & Generators() const
const PCB_POINTS & Points() const
const std::map< wxString, KIGFX::COLOR4D > & GetNetChainColors() const
const ZONES & Zones() const
const GROUPS & Groups() const
The groups must maintain the following invariants.
bool ResolveTextVar(wxString *token, int aDepth) const
const std::vector< PAD * > GetPads() const
Return a reference to a list of all the pads.
TITLE_BLOCK & GetTitleBlock()
const std::map< wxString, wxString > & GetProperties() const
const FOOTPRINTS & Footprints() const
const TRACKS & Tracks() const
const CONSTRAINTS & Constraints() const
Geometric constraints (#2329) owned by this board.
const PCB_PLOT_PARAMS & GetPlotOptions() const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction, RECURSE_MODE aMode) const override
Invoke a function on all children.
PROJECT * GetProject() const
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
bool IsItemIndexedById(const BOARD_ITEM *aItem) const
Return true if aItem is currently indexed.
BOARD_DESIGN_SETTINGS & GetDesignSettings()
const DRAWINGS & Drawings() const
What an export to a given target will keep, approximate, drop, or block.
void Add(DOWNGRADE_BUCKET aBucket, const wxString &aFeature, const wxString &aDetail=wxEmptyString, int aCount=1)
bool IsBlocked() const
True if some feature makes the target impossible. The user cannot export anyway.
Grouping rules and symbol assignments, shared by reference so a chart and its map can never disagree ...
A set of EDA_ITEMs (i.e., without duplicates).
std::unordered_set< EDA_ITEM * > & GetItems()
void AddItem(EDA_ITEM *aItem)
Add item to group.
A base class for most all the KiCad significant classes used in schematics and boards.
void ClearCustomProperties()
virtual EDA_GROUP * GetParentGroup() const
KICAD_T Type() const
Returns the type of object.
bool HasCustomProperties() const
virtual void SetParent(EDA_ITEM *aParent)
int GetEllipseMinorRadius() const
const VECTOR2I & GetEllipseCenter() const
void SetEndEnding(const LINE_ENDING &aEnding)
int GetEllipseMajorRadius() const
virtual int GetEffectiveWidth() const
void TransformWithLineEndingsToPolygon(SHAPE_POLY_SET &aBuffer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const
Convert the shape body shortened for line endings plus line-ending geometry to polygons.
EDA_ANGLE GetEllipseRotation() const
void SetStartEnding(const LINE_ENDING &aEnding)
bool GetLineEndingEndpoints(VECTOR2I &aStartPoint, VECTOR2I &aEndPoint) const
Return the source endpoints used to place line endings.
LINE_ENDING_STYLE GetStartEndingStyle() const
LINE_STYLE GetLineStyle() const
std::vector< VECTOR2I > GetRectCorners() const
const LINE_ENDING & GetStartEnding() const
const LINE_ENDING & GetEndEnding() const
LINE_ENDING_STYLE GetEndEndingStyle() const
int GetCornerRadius() const
void SetFillMode(FILL_T aFill)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
virtual void SetText(const wxString &aText)
High-level wrapper for evaluating mathematical and string expressions in wxString format.
wxString Evaluate(const wxString &aInput)
Main evaluation function - processes input string and evaluates all '@{}' expressions.
bool HasErrors() const
Check if the last evaluation had errors.
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
A logical library item identifier and consists of various portions much like a URI.
Decorative shape (arrowhead, circle, square) at the start or end of a graphic line,...
const STROKE_PARAMS & GetStroke() const
LSET is a set of PCB_LAYER_IDs.
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
Handle the data for a net.
A PADSTACK defines the characteristics of a single or multi-layer pad, in the IPC sense of the word.
MASK_LAYER_PROPS & FrontOuterLayers()
void SetUnconnectedLayerMode(UNCONNECTED_LAYER_MODE aMode)
POST_MACHINING_PROPS & FrontPostMachining()
UNCONNECTED_LAYER_MODE UnconnectedLayerMode() const
DRILL_PROPS & TertiaryDrill()
DRILL_PROPS & SecondaryDrill()
POST_MACHINING_PROPS & BackPostMachining()
MASK_LAYER_PROPS & BackOuterLayers()
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc=ERROR_INSIDE, bool ignoreLineWidth=false) const override
Convert the barcode (text + symbol shapes) to polygonal geometry suitable for filling/collision tests...
A geometric constraint between board items (issue #2329).
wxString GetOverrideText() const
bool GetOverrideTextEnabled() const
virtual wxString GetGeneratorType() const
A set of BOARD_ITEMs (i.e., without duplicates).
A PCB_IO derivation for saving and loading Pcbnew s-expression formatted files.
std::unique_ptr< FOOTPRINT > ImportFootprint(const wxString &aFootprintPath, wxString &aFootprintNameOut, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a single footprint from aFootprintPath and put its name in aFootprintNameOut.
std::unique_ptr< BOARD > LoadBoard(const wxString &aFileName, 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 new BOA...
Parameters and options when plotting/printing a board.
PLOT_FORMAT GetFormat() const
void SetFormat(PLOT_FORMAT aFormat)
A PCB_POINT is a 0-dimensional point that is used to mark a position on a PCB, or more usually a foot...
Object to handle a bitmap image that can be inserted in a PCB.
void SetOpacity(double aOpacity)
REFERENCE_IMAGE & GetReferenceImage()
void SetCornerRadius(int aCornerRadius) override
void SetWidth(int aWidth) override
int GetWidth() const override
void SetShape(SHAPE_T aShape) override
void SetPolyShape(const SHAPE_POLY_SET &aShape) override
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
A board stackup table placed on the board, kept in step with the stackup.
wxString GetUnwrappedShownText(RESOLUTION_CONTEXT aContext, int aDepth=0) const
GetShownText() before it is line-broken to the cell's width, i.e.
bool StrokeHeaderSeparator() const
bool StrokeColumns() const
bool StrokeExternal() const
std::vector< PCB_TABLECELL * > GetCells() const
int GetBorderWidth() const
const STROKE_PARAMS & GetSeparatorsStroke() const
const STROKE_PARAMS & GetBorderStroke() const
int GetColWidth(int aCol) const
int GetRowHeight(int aRow) const
wxString GetShownText(RESOLUTION_CONTEXT aContext, int aDepth=0) const override
Return the string actually shown after processing of the base text.
const PADSTACK & Padstack() const
VIATYPE GetViaType() const
Writes a board or footprint in the KiCad 10.0 file format.
static constexpr int FORMAT_VERSION
void SaveFootprintFile(const wxString &aFileName, FOOTPRINT *aFootprint)
void SaveBoard(const wxString &aFileName, BOARD *aBoard)
Writes a board or footprint in the KiCad 9.0 file format.
static constexpr int FORMAT_VERSION
void SaveFootprintFile(const wxString &aFileName, FOOTPRINT *aFootprint)
void SaveBoard(const wxString &aFileName, BOARD *aBoard)
virtual bool TextVarResolver(wxString *aToken) const
virtual std::map< wxString, wxString > & GetTextVars() const
A REFERENCE_IMAGE is a wrapper around a BITMAP_IMAGE that is displayed in an editor as a reference fo...
EDA_ANGLE GetOrientation() const
double GetOpacity() const
const BITMAP_BASE & GetImage() const
Get the underlying image.
double GetImageScale() const
void SetImageScale(double aScale)
Set the image "zoom" value.
PROJECT * GetProject(const wxString &aFullPath) const
Retrieve a loaded project by name.
bool LoadProject(const wxString &aFullPath, bool aSetActive=true, bool aOverrideLock=false)
Load a project or sets up a new project with a specified path.
SHAPE_LINE_CHAIN ConvertToPolyline(int aMaxError) const
Build a polyline approximation of the ellipse or arc.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Represent a set of closed polygons.
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
void Simplify()
Simplify the polyset (merges overlapping polys, eliminates degeneracy/self-intersections)
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
int NewOutline()
Creates a new empty polygon in the set and returns its index.
int OutlineCount() const
Return the number of outlines in the set.
SHAPE_POLY_SET Fillet(int aRadius, int aErrorMax)
Return a filleted version of the polygon set.
void Fracture(bool aSimplify=true)
Convert a set of polygons with holes to a single outline with "slits"/"fractures" connecting the oute...
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
Simple container to manage line stroke parameters.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
const wxString & GetCompany() const
void SetRevision(const wxString &aRevision)
void SetComment(int aIdx, const wxString &aComment)
bool TextVarResolver(wxString *aToken, const PROJECT *aProject, RESOLUTION_CONTEXT aContext) const
const wxString & GetRevision() const
void SetTitle(const wxString &aTitle)
const wxString & GetDate() const
const wxString & GetComment(int aIdx) const
void SetCompany(const wxString &aCompany)
const wxString & GetTitle() const
void SetDate(const wxString &aDate)
Set the date field, and defaults to the current time and date.
Handle a list of polygons defining a copper zone.
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
wxString GetPlacementAreaSource() const
void SetPlacementAreaSource(const wxString &aSource)
PLACEMENT_SOURCE_T GetPlacementAreaSourceType() const
void SetPlacementAreaSourceType(PLACEMENT_SOURCE_T aType)
bool GetPlacementAreaEnabled() const
void SetPlacementAreaEnabled(bool aEnabled)
void FinalizeTextVarExpansion(wxString &aText, RESOLUTION_CONTEXT aContext)
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, RESOLUTION_CONTEXT aContext)
std::vector< TEXT_VAR_REF_KEY > ExtractTextVarReferences(const wxString &aSource)
Lex-scan aSource and return every ${...} reference that appears, without resolving.
DOWNGRADE_BUCKET
What happens to a feature when we export to an older KiCad.
@ BLOCK
Cannot be represented at all, export to this target is not possible.
@ LOWER
Approximated down to a simpler equivalent.
@ DROP
No equivalent, left out.
wxString FindUnsupportedToken(const wxString &aSerialized, const DATED_TOKEN *aNodes, size_t aNodeCount, const DATED_TOKEN *aValues, size_t aValueCount, int aTargetVersion)
Scan serialized s-expression text against dated node and value denylists.
std::string StripSexprStrings(const std::string &aText)
Drop quoted strings so a token inside a text value cannot cause a false refusal.
DOWNGRADE_FILE_RESULT
What a per-file converter did with one library file.
@ SKIPPED
Not a convertible file, leave it alone.
@ REFUSED
The target cannot represent this file.
@ CONVERTED
The temp file holds the downgraded copy.
bool VerifyDowngradedFile(const wxString &aPath, int aStampVersion, const std::function< wxString(const wxString &)> &aFindForbidden, wxString *aForbidden=nullptr)
Read back a downgraded output and require the target stamp plus a clean token scan.
@ FILLED_SHAPE
Fill with object color.
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
int RefreshGeneratedTables(BOARD &aBoard)
Bring every generated table on the board up to date and return how many were rebuilt.
static const std::string ProjectFileExtension
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
static std::vector< PENDING_PROPERTY > plan(const EDA_ITEM &aSource, const EDA_ITEM &aTarget, const std::set< wxString > &aEnabledKeys)
Target properties to write, paired with values read off the source.
@ NON_COMPONENT
Pad with no hole that does not connect to a physical component, but rather provides a connection poin...
@ PRESSFIT
a PTH with a hole diameter with tight tolerances for press fit pin
@ NONE
no special fabrication property
@ REMOVE_EXCEPT_START_AND_END
BARCODE class definition.
Class to handle a set of BOARD_ITEMs.
#define FIRST_FP_AFFINE_TRANSFORM
First version that stores footprint children in library frame.
#define SEXPR_BOARD_FILE_VERSION
Current s-expression file format version. 2 was the last legacy format version.
static int countCustomProperties(const SCH_SCREEN *aScreen)
static void lowerEllipses(SCH_SCREEN *aScreen)
static void omitEllipses(SCH_SCREEN *aScreen)
static bool isEllipse(const SCH_ITEM *aItem)
static void lowerRoundedRects(SCH_SCREEN *aScreen)
static bool isRoundedRect(const SCH_ITEM *aItem)
static int countRoundedRects(const SCH_SCREEN *aScreen)
static void omitRoundedRects(SCH_SCREEN *aScreen)
static void dropCustomProperties(SCH_SCREEN *aScreen)
static int countEllipses(const SCH_SCREEN *aScreen)
std::function< void(BOARD *)> m_omit
std::function< void(BOARD *)> m_apply
DOWNGRADE_BUCKET m_bucket
std::function< void(FOOTPRINT *)> m_applyFp
Footprint-scoped part, for .kicad_mod files.
std::function< void(FOOTPRINT *)> m_omitFp
std::function< int(const BOARD *)> m_count
bool m_keepUnderOmitPolicy
An approximation the omission preference must not remove, because removing it would change the board ...
A token dated by the format that introduced it, for the fail-closed downgrade gates.
An older KiCad release we can export a project back to.
int m_boardVersion
SEXPR_BOARD_FILE_VERSION for the target.
VECTOR2I size
Drill diameter (x == y) or slot dimensions (x != y)
std::optional< bool > is_capped
True if the drill hole should be capped.
std::optional< bool > is_filled
True if the drill hole should be filled completely.
std::optional< bool > has_covering
True if the pad on this side should have covering.
std::optional< bool > has_plugging
True if the drill hole should be plugged on this side.
Options for copying a placement rule area onto the others linked to it.
std::vector< std::pair< int, wxString > > m_titleReplacements
std::map< EDA_TEXT *, wxString > m_replacements
std::vector< DATABASE_CONNECTION::ROW > rows
const SHAPE_LINE_CHAIN chain
wxString result
Test unit parsing edge cases and error handling.
@ 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_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_DRILL_MAP_T
class PCB_DRILL_MAP, drill symbols drawn at the holes
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ 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_BARCODE_T
class PCB_BARCODE, a barcode (graphic item)
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
@ PCB_GRID_ITEM_T
a subgrid placed on a board
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
@ PCB_STACKUP_TABLE_T
class PCB_STACKUP_TABLE, a live stackup table derived from PCB_TABLE
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
@ PCB_DRILL_CHART_T
class PCB_DRILL_CHART, a live drill chart derived from PCB_TABLE
VECTOR2< int32_t > VECTOR2I
static PIECE polygon(std::vector< VIA_CROSS_SECTION_GEOMETRY::POINT > aPoints, bool aMixed=false)
Definition of file extensions used in Kicad.
Class ZONE_SETTINGS used to handle zones parameters in dialogs.