165 group->RemoveItem( aItem );
178 aShape->EDA_SHAPE::TransformShapeToPolygon( poly, 0, aMaxError,
ERROR_INSIDE,
false );
195 chain.SetClosed(
true );
242 if( aMatches( item ) )
243 static_cast<PCB_SHAPE*
>( item )->SetFillMode( aFill );
260 std::vector<PCB_SHAPE*> shapes;
274 shapes.push_back( shape );
283 std::vector<PCB_BARCODE*> barcodes;
288 barcodes.push_back(
static_cast<PCB_BARCODE*
>( item ) );
297 aFootprint->
Add( shape );
300 group->AddItem( shape );
304 aFootprint->
Remove( barcode );
318 aFootprint->
Points().clear();
356 std::vector<wxString> names;
359 names.push_back(
name );
361 for(
const wxString&
name : names )
370 pad->Padstack().FrontPostMachining().mode.reset();
371 pad->Padstack().BackPostMachining().mode.reset();
389 pad->SetPadToDieDelay( 0 );
407 if( !net->GetNetChain().IsEmpty() || net->GetTerminalPad( 0 ) || net->GetTerminalPad( 1 ) )
419 net->SetNetChain( wxEmptyString );
420 net->ClearTerminalPad( 0 );
421 net->ClearTerminalPad( 1 );
424 std::vector<wxString> chains;
427 chains.push_back(
chain );
429 for(
const wxString&
chain : chains )
446 for(
BOARD_ITEM* item : fp->GraphicalItems() )
506 if( fp->GetHeight() != 0 )
527 if( zone->IsCopperThieving() )
533 for(
ZONE* zone : fp->Zones() )
535 if( zone->IsCopperThieving() )
573 if( fp->GetUnitInfo().size() > 1 )
600 for(
BOARD_ITEM* item : fp->GraphicalItems() )
613 std::vector<PCB_BARCODE*> barcodes;
618 barcodes.push_back(
static_cast<PCB_BARCODE*
>( item ) );
627 aBoard->
Add( shape );
630 group->AddItem( shape );
633 aBoard->
Remove( barcode );
648 if( !fp->GetVariants().empty() )
672 if( !fp->JumperPadGroups().IsEmpty() || fp->GetDuplicatePadNumbersAreJumpers() )
750 aPadstack.FrontPostMachining().mode.reset();
751 aPadstack.BackPostMachining().mode.reset();
870 if(
pad->GetPadToDieDelay() != 0 )
891 if( aMatches( item ) )
897 for(
BOARD_ITEM* item : fp->GraphicalItems() )
899 if( aMatches( item ) )
912 if( aMatches( item ) )
913 static_cast<PCB_SHAPE*
>( item )->SetFillMode( aFill );
923 int count =
static_cast<int>( aBoard->
Points().size() );
926 count +=
static_cast<int>( fp->Points().size() );
934 std::vector<BOARD_ITEM*> points( aBoard->
Points().begin(), aBoard->
Points().end() );
1037 for(
int idx = 0; idx < item->GetSublayersCount(); idx++ )
1057 for(
int idx = 0; idx < item->GetSublayersCount(); idx++ )
1069 if(
group->HasDesignBlockLink() )
1077 if(
group->HasDesignBlockLink() )
1102 if( !fp->GetTransform().HasUnitScale() )
1143 pad->Padstack().ForEachUniqueLayer(
1146 for(
const std::shared_ptr<PCB_SHAPE>& primitive :
pad->GetPrimitives( aLayer ) )
1147 aFunc( primitive.get() );
1244 item->SetIsKnockout(
false );
1271 item->SetIsKnockout(
false );
1288 if( cell->IsKnockout() )
1305 for(
BOARD_ITEM* item : fp->GraphicalItems() )
1320 if( cell->IsKnockout() )
1321 cell->SetIsKnockout(
false );
1349 if( !zone->LayerProperties().empty() )
1355 for(
ZONE* zone : fp->Zones() )
1357 if( !zone->LayerProperties().empty() )
1369 zone->SetLayerProperties( {} );
1376 zone->SetLayerProperties( {} );
1448 std::vector<BOARD_ITEM*> remove;
1452 if( aMatches( item ) )
1453 remove.push_back( item );
1459 aFootprint->
Remove( item );
1467 std::vector<BOARD_ITEM*> remove;
1471 if( aMatches( item ) )
1472 remove.push_back( item );
1490 pad->Padstack().ForEachUniqueLayer(
1493 std::erase_if(
pad->Padstack().Primitives( aLayer ),
1494 [&](
const std::shared_ptr<PCB_SHAPE>& aPrimitive )
1496 return aMatches( aPrimitive.get() );
1568 if( cell->IsKnockout() )
1571 cell->SetText( wxEmptyString );
1572 cell->SetIsKnockout(
false );
1600 count += fp->Constraints().size();
1608 const auto constraints = aFootprint->
Constraints();
1613 aFootprint->
Remove( constraint );
1625 aBoard->
Remove( constraint );
1648 return std::count_if( aBoard->
Drawings().begin(), aBoard->
Drawings().end(), aMatches );
1666 const auto isRotatedReferenceImage = [](
const BOARD_ITEM* aItem )
1675 size_t count = std::count_if( aBoard->
Drawings().begin(), aBoard->
Drawings().end(), isRotatedReferenceImage );
1679 count += std::count_if( fp->GraphicalItems().begin(), fp->GraphicalItems().end(), isRotatedReferenceImage );
1682 return static_cast<int>( count );
1688 const auto isReferenceImageWithOpacity = [](
const BOARD_ITEM* aItem )
1697 size_t count = std::count_if( aBoard->
Drawings().begin(), aBoard->
Drawings().end(), isReferenceImageWithOpacity );
1701 count += std::count_if( fp->GraphicalItems().begin(), fp->GraphicalItems().end(), isReferenceImageWithOpacity );
1704 return static_cast<int>( count );
1710 const auto clearOpacity = [](
BOARD_ITEM* aItem )
1717 clearOpacity( item );
1721 for(
BOARD_ITEM* item : fp->GraphicalItems() )
1722 clearOpacity( item );
1756 return aGenerator->GetGeneratorType() == aType;
1763 const auto generators = aBoard->
Generators();
1767 if( !aMatches( generator ) )
1770 EDA_GROUP* outer = generator->GetParentGroup();
1771 const auto members = generator->
GetItems();
1772 generator->RemoveAll();
1780 aBoard->
Remove( generator );
1799 return pattern && !pattern->
GetItems().empty() && pattern->GetSettings().m_isTimeDomain;
1820 if( aGenerator->GetGeneratorType() != wxT(
"tuning_pattern" ) )
1823 return !dynamic_cast<const PCB_TUNING_PATTERN*>( aGenerator )
1824 || !KICAD_FORMAT::LEGACY::AreTuningPropertiesReviewed(
1825 aGenerator->GetProperties() );
1836 const wxString type = generator->GetGeneratorType();
1838 if( type != wxT(
"tuning_pattern" ) && type != wxT(
"via_stitch" ) && type != wxT(
"via_stack" ) )
1841 for(
EDA_ITEM* member : generator->GetItems() )
1859 switch( aItem->
Type() )
1878 default:
return true;
1889 count += std::count_if( fp->GraphicalItems().begin(), fp->GraphicalItems().end(),
isUnreviewedDrawing );
1898 aVisit(
const_cast<FOOTPRINT*
>( aFootprint ) );
1910 aVisit( generator );
1912 for(
const auto& [
name, item] : generator->GetTemplateItems() )
1960 for(
const ZONE* zone : aBoard->
Zones() )
1962 if( zone->GetLinkSet() !=
niluuid )
1986 bool excluded = fp->IsExcludedFromSim();
1988 for(
const auto& [
name, variant] : fp->GetVariants() )
1989 excluded = excluded || variant.GetExcludedFromSim();
2033 const auto unsafeStroke =
2086 for(
int outline = 0; outline < ink.
OutlineCount(); ++outline )
2102 parent->
Add( polygon );
2105 group->AddItem( polygon );
2116 std::vector<PCB_SHAPE*> shapes;
2121 shapes.push_back(
static_cast<PCB_SHAPE*
>( aItem ) );
2136 std::vector<PCB_SHAPE*> shapes;
2141 shapes.push_back(
static_cast<PCB_SHAPE*
>( aItem ) );
2156 if( aName == wxT(
"TITLE" ) )
2158 if( aName == wxT(
"ISSUE_DATE" ) )
2160 if( aName == wxT(
"REVISION" ) )
2162 if( aName == wxT(
"COMPANY" ) )
2164 if( aName.length() == 8 && aName.StartsWith( wxT(
"COMMENT" ) ) && aName[7] >=
'1' && aName[7] <=
'9' )
2165 return 4 + aName[7].GetValue() -
'1';
2175 case 1:
return aTitle.
GetDate();
2178 default:
return aTitle.
GetComment( aIndex - 4 );
2184 std::set<wxString>& aDependencies,
int aDepth = 0 )
2189 for(
size_t pos = 0; pos + 1 < aText.length(); ++pos )
2191 if( aText[pos] ==
'\\'
2192 && pos + 2 < aText.length()
2193 && ( aText[pos + 1] ==
'$' || aText[pos + 1] ==
'@' )
2194 && aText[pos + 2] ==
'{' )
2202 for( ; pos < aText.length() && braces; ++pos )
2203 braces += aText[pos] ==
'{' ? 1 : ( aText[pos] ==
'}' ? -1 : 0 );
2209 if( aText[pos] ==
'@'
2210 && aText[pos + 1] ==
'{'
2216 if( aText[pos] ==
'$'
2217 && aText[pos + 1] ==
'{'
2218 && aText.Mid( pos + 2 ).BeforeFirst(
'}' ).AfterFirst(
':' ).StartsWith( wxT(
"PROPERTY." ) ) )
2226 const wxString&
name = reference.primary;
2228 if(
name.StartsWith( wxT(
"PROPERTY." ) )
2229 || reference.secondary.StartsWith( wxT(
"PROPERTY." ) )
2230 ||
name == wxT(
"DRILL_OPERATIONS" )
2231 ||
name == wxT(
"DRILL_SITES" )
2232 ||
name == wxT(
"DRILL_GROUPS" ) )
2239 wxString resolved =
name;
2245 if( aDependencies.insert(
name ).second
2246 &&
postTargetText( resolved, aBoard, aTargetVersion, aDependencies, aDepth + 1 ) )
2255 const wxString* value =
nullptr;
2260 auto variable = variables.find(
name );
2262 if( variable != variables.end() )
2263 value = &variable->second;
2268 const std::map<wxString, wxString>& properties = aBoard->
GetProperties();
2269 auto property = properties.find(
name );
2271 if( property != properties.end() )
2272 value = &
property->second;
2276 && aDependencies.insert(
name ).second
2277 &&
postTargetText( *value, aBoard, aTargetVersion, aDependencies, aDepth + 1 ) )
2290 std::set<wxString> dependencies;
2291 return postTargetText( aText, aBoard, aTargetVersion, dependencies );
2306 for(
size_t pos = 0; pos + 1 < aText.length(); ++pos )
2308 if( aText[pos] ==
'\\' && pos + 2 < aText.length() && ( aText[pos + 1] ==
'$' || aText[pos + 1] ==
'@' )
2309 && aText[pos + 2] ==
'{' )
2314 for( ; pos < aText.length() && braces; ++pos )
2315 braces += aText[pos] ==
'{' ? 1 : ( aText[pos] ==
'}' ? -1 : 0 );
2319 else if( aText[pos] ==
'@' && aText[pos + 1] ==
'{' )
2330 const std::function<
bool( wxString* )>* aResolver =
nullptr )
2339 if( !
text && !barcode )
2351 std::function<bool( wxString* )> resolver =
2352 [&]( wxString* aToken )
2355 return ( *aResolver )( aToken );
2357 if( *aToken == wxT(
"LAYER" ) && board )
2368 bool blocked =
false;
2370 for(
size_t pos = 0; pos < raw.length(); )
2373 bool escaped = raw[pos] ==
'\\'
2374 && pos + 2 < raw.length()
2375 && ( raw[pos + 1] ==
'$' || raw[pos + 1] ==
'@' )
2376 && raw[pos + 2] ==
'{';
2377 size_t marker = escaped ? pos + 1 : pos;
2379 if( marker + 1 >= raw.length() || ( raw[marker] !=
'$' && raw[marker] !=
'@' ) || raw[marker + 1] !=
'{' )
2388 while( pos < raw.length() && braces )
2390 braces += raw[pos] ==
'{' ? 1 : ( raw[pos] ==
'}' ? -1 : 0 );
2394 wxString block = raw.Mid( start, pos - start );
2413 if( cell->GetRow() < 0 || cell->GetColumn() < 0 )
2444 for(
int depth = 0; depth < 32; ++depth )
2451 expanded = evaluator.
Evaluate( expanded );
2460 if( expanded == block )
2473 || block.Contains( wxT(
"<Unresolved:" ) )
2474 || block.Contains( wxT(
"<Unknown reference:" ) ) )
2483 && (
result.Contains( wxT(
"\\${" ) ) ||
result.Contains( wxT(
"\\@{" ) ) ) )
2496 plan.m_board =
const_cast<BOARD*
>( aBoard );
2503 std::function<bool( wxString* )> resolver = [&]( wxString* aToken )
2505 if( *aToken == wxT(
"FILENAME" )
2506 || *aToken == wxT(
"FILEPATH" )
2507 || *aToken == wxT(
"VARIANT" )
2508 || *aToken == wxT(
"VARIANT_DESC" ) )
2518 for(
int field = 0; field < 13; ++field )
2523 planTextItem( &temporary, aTargetVersion, title, &resolver );
2539 dimension->ChangeOverrideText( value );
2541 text->SetText( value );
2542 else if(
auto barcode =
dynamic_cast<PCB_BARCODE*
>( item ) )
2543 barcode->SetBarcodeText( value );
2552 case 0: title.
SetTitle( value );
break;
2553 case 1: title.
SetDate( value );
break;
2556 default: title.
SetComment( field - 4, value );
break;
2588 _(
"Unknown generator kinds or detached generated children cannot be safely exported." ),
2591 _(
"The tuning generator contains properties outside the reviewed historical schemas." ),
2594 _(
"Generator editability is removed. Existing generated copper and group membership are kept." ),
2597 _(
"Group placement linkage is removed. Zone geometry, keepout settings, groups, and copper are kept." ),
2600 _(
"An unrecognized graphic item cannot be safely represented by the target writer." ),
2603 _(
"Solver relationships are removed. Existing geometry is kept in its current position." ),
countConstraints,
2606 _(
"Placement, snapping, and routing grid configuration is removed. Copper is unchanged." ),
countGrids,
2609 _(
"Generator editability is removed. Existing generated copper and group membership are kept." ),
2610 [](
const BOARD* b )
2619 _(
"Generator editability is removed. Existing generated copper and group membership are kept." ),
2620 [](
const BOARD* b )
2629 _(
"Converted to printed polygons with the shortened line body. Ending editability is lost." ),
2630 [](
const BOARD* b )
2650 _(
"Endpoint embellishments are removed. The supported line body and its style are kept." ) },
2652 _(
"Simulation exclusions are removed. The target may include these footprints in simulation." ),
2655 _(
"Custom item metadata is removed after affected displayed text has been resolved." ),
2658 _(
"Drill chart tables and drill map symbols are removed from the fabrication drawings. Holes are kept." ),
2661 _(
"Drill symbol assignments and display settings are removed. Holes are unchanged." ),
2664 _(
"Links between placement rule areas and their saved repeat layout options are removed. "
2665 "The copied layouts are kept." ),
2668 _(
"The target cannot store an image rotation." ),
2671 _(
"The target cannot store an image opacity. Opacity will be ignored." ),
2674 _(
"No equivalent in the target. Connectivity will change." ),
2677 _(
"Approximated by a polygon." ),
2679 _(
"Ellipse graphics are omitted instead of approximated." ) },
2681 _(
"No equivalent in the target. The 3D body is left out." ),
2684 _(
"No equivalent in the target. The footprint height is left out." ),
2687 _(
"A refill in the target would turn the pattern into solid copper." ),
2690 _(
"The simulation electrical type is left out." ),
2693 _(
"Pin-to-unit assignments used for gate swapping are removed." ),
2696 _(
"Converted to the printed polygons. No longer editable as a barcode." ),
2698 _(
"Barcodes are omitted instead of converted to polygons." ) },
2700 _(
"Variant registry and per-footprint overrides are removed." ),
2703 _(
"Jumper pad groupings are removed." ),
2706 _(
"Backdrilling changes copper connectivity and cannot be represented." ),
2711 _(
"The press-fit fabrication property is removed." ),
2714 _(
"Approximated by keeping only the start and end layers." ),
2723 _(
"Written with the older combined blind type." ),
2732 _(
"Per-layer zone defaults are removed." ),
2735 _(
"Pad-to-die delay is removed." ),
2738 _(
"Converted to a solid fill." ),
2739 [](
const BOARD* b )
2759 _(
"The hatch fill is omitted. The supported outline is kept." ) },
2761 _(
"Converted to a solid fill. Copper geometry may change." ),
2762 [](
const BOARD* b )
2779 _(
"No equivalent in the target. Points are removed." ),
2782 _(
"IPC-4761 covering, plugging, capping, and filling are removed." ),
2785 _(
"The frequency-dependent dielectric model is removed." ),
2788 _(
"The link from a group to its design block is removed." ),
2791 _(
"Drawn as plain text boxes." ),
2794 _(
"Knockout text boxes are omitted instead of drawn as plain text." ) },
2796 _(
"Approximated by a polygon." ),
2798 _(
"Rounded rectangles and rounded custom pad primitives are omitted. Copper geometry may change." ) },
2800 _(
"Drawn as plain cells." ),
2803 _(
"Knockout cell contents are omitted; empty cells and the table grid are kept." ) },
2805 _(
"The per-layer overrides are removed." ),
2808 _(
"The target supports only 9 user layers." ),
2811 _(
"The target would expand the footprint's inner layers and change its connectivity." ),
2814 _(
"The target cannot represent a scaled footprint." ),
2822 bool aDropInsteadOfApproximate )
2827 wxT(
"Board format changed. Review the downgrade rules and denylist, then update "
2828 "BOARD_DOWNGRADE_COVERED." ) );
2835 _(
"The current board format has changed since the downgrade rules were reviewed." ), 1 );
2841 _(
"The unsupported plot format is reset to Gerber." ), 1 );
2848 if(
text.m_blocked )
2851 _(
"Affected property variables or expressions could not be safely resolved." ),
2855 if( !
text.m_replacements.empty() || !
text.m_titleReplacements.empty() )
2858 _(
"Affected displayed text is resolved to its current value and loses dynamic evaluation." ),
2859 text.m_replacements.size() +
text.m_titleReplacements.size() );
2868 _(
"Dashed, colored, or unresolved-width line endings cannot be faithfully converted. "
2869 "The omission policy can remove just the endpoint embellishments." ),
2879 if(
int count = rule.m_count( aBoard ); count > 0 )
2881 bool omit = aDropInsteadOfApproximate
2883 && !rule.m_keepUnderOmitPolicy;
2887 omit ? rule.m_omitDetail : rule.m_detail,
2952 bool omit = aDropInsteadOfApproximate
2954 && !rule.m_keepUnderOmitPolicy;
2956 const std::function<void(
BOARD* )>& apply = omit ? rule.m_omit : rule.m_apply;
2958 wxASSERT_MSG( !omit || apply, wxT(
"A LOWER rule needs an omission transform." ) );
2989 bool omit = aDropInsteadOfApproximate
2991 && !rule.m_keepUnderOmitPolicy;
2993 const std::function<void(
FOOTPRINT*)>& apply = omit ? rule.m_omitFp : rule.m_applyFp;
2995 wxASSERT_MSG( !omit || !rule.m_applyFp || apply, wxT(
"A footprint LOWER rule needs an omission transform." ) );
2998 apply( aFootprint );
3099 wxFAIL_MSG( wxT(
"No writer for this downgrade target." ) );
3110 wxFAIL_MSG( wxT(
"No writer for this downgrade target." ) );
3117 std::vector<std::string>
path;
3119 for(
size_t position = 0; position <
text.size(); ++position )
3121 if(
text[position] ==
'(' )
3123 size_t begin = position + 1;
3125 while( begin <
text.size() && std::isspace(
static_cast<unsigned char>(
text[begin] ) ) )
3131 && ( std::isalnum(
static_cast<unsigned char>(
text[
end] ) ) ||
text[
end] ==
'_' ) )
3134 const std::string head =
text.substr( begin,
end - begin );
3136 if( head ==
"group" &&
path.size() >= 2 &&
path.back() ==
"placement" &&
path[
path.size() - 2] ==
"zone" )
3139 path.push_back( head );
3140 position =
end > begin ?
end - 1 : position;
3142 else if(
text[position] ==
')' && !
path.empty() )
3155 return wxEmptyString;
3158 return wxT(
"placement/group" );
3169 fp->SetDNP( fp->GetDNPForVariant( aVariantName ) );
3170 fp->SetExcludedFromBOM( fp->GetExcludedFromBOMForVariant( aVariantName ) );
3171 fp->SetExcludedFromPosFiles( fp->GetExcludedFromPosFilesForVariant( aVariantName ) );
3172 fp->SetExcludedFromSim( fp->GetExcludedFromSimForVariant( aVariantName ) );
3176 for(
const auto& [
name, value] : variant->GetFields() )
3179 field->SetText( value );
3191 std::unique_ptr<FOOTPRINT> owned = loader.
ImportFootprint( aSrcFile, nameOut );
3200 scratch.
Add( owned.release() );
3220 bool aDropInsteadOfApproximate )
3222 if( aUnsupportedToken )
3223 aUnsupportedToken->clear();
3226 wxFileName projectFile( aSrcFile );
3228 projectFile.MakeAbsolute();
3229 projectSettings.
LoadProject( projectFile.GetFullPath(),
false );
3232 std::unique_ptr<BOARD> board( pi.
LoadBoard( aSrcFile,
nullptr ) );
3238 board->SetProject( projectSettings.
GetProject( projectFile.GetFullPath() ),
true );
3240 if( !aVariant.IsEmpty() )
3253 const wxString tmpFile = wxFileName::CreateTempFileName( aDestFile + wxT(
".downgrade_tmp." ) );
3255 if( tmpFile.IsEmpty() )
3260 wxRemoveFile( tmpFile );
3268 wxRemoveFile( tmpFile );
3278 [&](
const wxString& aText )
3280 return FindUnsupportedBoardToken( aText, aTarget );
3286 wxRemoveFile( tmpFile );
3288 if( aUnsupportedToken )
3289 *aUnsupportedToken = bad;
3294 if( !wxRenameFile( tmpFile, aDestFile,
true ) )
3296 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 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 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 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 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)
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 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 void dropDieDelays(BOARD *aBoard)
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 int countThievingZones(const BOARD *aBoard)
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 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.
virtual void SetParentGroup(EDA_GROUP *aGroup)
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.
void SetLineStyle(const LINE_STYLE aStyle)
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.
wxString GetUnwrappedShownText(RESOLUTION_CONTEXT aContext, int aDepth=0) const
GetShownText() before it is line-broken to the cell's width, i.e.
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.
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Load a project or sets up a new project with a specified path.
PROJECT * GetProject(const wxString &aFullPath) const
Retrieve a loaded project by name.
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.
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.
@ 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
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_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
Definition of file extensions used in Kicad.
Class ZONE_SETTINGS used to handle zones parameters in dialogs.