155 group->RemoveItem( aItem );
168 aShape->EDA_SHAPE::TransformShapeToPolygon( poly, 0, aMaxError,
ERROR_INSIDE,
false );
185 chain.SetClosed(
true );
232 if( aMatches( item ) )
233 static_cast<PCB_SHAPE*
>( item )->SetFillMode( aFill );
250 std::vector<PCB_SHAPE*> shapes;
264 shapes.push_back( shape );
273 std::vector<PCB_BARCODE*> barcodes;
278 barcodes.push_back(
static_cast<PCB_BARCODE*
>( item ) );
287 aFootprint->
Add( shape );
290 group->AddItem( shape );
294 aFootprint->
Remove( barcode );
308 aFootprint->
Points().clear();
340 std::vector<wxString> names;
343 names.push_back(
name );
345 for(
const wxString&
name : names )
354 pad->Padstack().FrontPostMachining().mode.reset();
355 pad->Padstack().BackPostMachining().mode.reset();
373 pad->SetPadToDieDelay( 0 );
391 if( !net->GetNetChain().IsEmpty() || net->GetTerminalPad( 0 ) || net->GetTerminalPad( 1 ) )
403 net->SetNetChain( wxEmptyString );
404 net->ClearTerminalPad( 0 );
405 net->ClearTerminalPad( 1 );
408 std::vector<wxString> chains;
411 chains.push_back(
chain );
413 for(
const wxString&
chain : chains )
430 for(
BOARD_ITEM* item : fp->GraphicalItems() )
469 if( fp->HasExtrudedBody() )
490 if( zone->IsCopperThieving() )
496 for(
ZONE* zone : fp->Zones() )
498 if( zone->IsCopperThieving() )
536 if( fp->GetUnitInfo().size() > 1 )
563 for(
BOARD_ITEM* item : fp->GraphicalItems() )
576 std::vector<PCB_BARCODE*> barcodes;
581 barcodes.push_back(
static_cast<PCB_BARCODE*
>( item ) );
590 aBoard->
Add( shape );
593 group->AddItem( shape );
596 aBoard->
Remove( barcode );
611 if( !fp->GetVariants().empty() )
635 if( !fp->JumperPadGroups().IsEmpty() || fp->GetDuplicatePadNumbersAreJumpers() )
711 aPadstack.FrontPostMachining().mode.reset();
712 aPadstack.BackPostMachining().mode.reset();
830 if(
pad->GetPadToDieDelay() != 0 )
851 if( aMatches( item ) )
857 for(
BOARD_ITEM* item : fp->GraphicalItems() )
859 if( aMatches( item ) )
872 if( aMatches( item ) )
873 static_cast<PCB_SHAPE*
>( item )->SetFillMode( aFill );
883 int count =
static_cast<int>( aBoard->
Points().size() );
886 count +=
static_cast<int>( fp->Points().size() );
894 std::vector<BOARD_ITEM*> points( aBoard->
Points().begin(), aBoard->
Points().end() );
996 for(
int idx = 0; idx < item->GetSublayersCount(); idx++ )
1016 for(
int idx = 0; idx < item->GetSublayersCount(); idx++ )
1028 if(
group->HasDesignBlockLink() )
1036 if(
group->HasDesignBlockLink() )
1061 if( fp->GetTransform().GetScaleX() != 1.0 || fp->GetTransform().GetScaleY() != 1.0 )
1102 pad->Padstack().ForEachUniqueLayer(
1105 for(
const std::shared_ptr<PCB_SHAPE>& primitive :
pad->GetPrimitives( aLayer ) )
1106 aFunc( primitive.get() );
1203 item->SetIsKnockout(
false );
1230 item->SetIsKnockout(
false );
1247 if( cell->IsKnockout() )
1264 for(
BOARD_ITEM* item : fp->GraphicalItems() )
1279 if( cell->IsKnockout() )
1280 cell->SetIsKnockout(
false );
1308 if( !zone->LayerProperties().empty() )
1314 for(
ZONE* zone : fp->Zones() )
1316 if( !zone->LayerProperties().empty() )
1328 zone->SetLayerProperties( {} );
1335 zone->SetLayerProperties( {} );
1406 std::vector<BOARD_ITEM*> remove;
1410 if( aMatches( item ) )
1411 remove.push_back( item );
1417 aFootprint->
Remove( item );
1425 std::vector<BOARD_ITEM*> remove;
1429 if( aMatches( item ) )
1430 remove.push_back( item );
1448 pad->Padstack().ForEachUniqueLayer(
1451 auto& primitives =
pad->Padstack().Primitives( aLayer );
1452 primitives.erase( std::remove_if( primitives.begin(), primitives.end(),
1453 [&](
const std::shared_ptr<PCB_SHAPE>& aPrimitive )
1455 return aMatches( aPrimitive.get() );
1528 if( cell->IsKnockout() )
1531 cell->SetText( wxEmptyString );
1532 cell->SetIsKnockout(
false );
1560 count += fp->Constraints().size();
1568 const auto constraints = aFootprint->
Constraints();
1573 aFootprint->
Remove( constraint );
1585 aBoard->
Remove( constraint );
1608 return std::count_if( aBoard->
Drawings().begin(), aBoard->
Drawings().end(), aMatches );
1653 return aGenerator->GetGeneratorType() == aType;
1660 const auto generators = aBoard->
Generators();
1664 if( !aMatches( generator ) )
1667 EDA_GROUP* outer = generator->GetParentGroup();
1668 const auto members = generator->
GetItems();
1669 generator->RemoveAll();
1677 aBoard->
Remove( generator );
1696 return pattern && !pattern->
GetItems().empty() && pattern->GetSettings().m_isTimeDomain;
1717 if( aGenerator->GetGeneratorType() != wxT(
"tuning_pattern" ) )
1720 return !dynamic_cast<const PCB_TUNING_PATTERN*>( aGenerator )
1721 || !KICAD_FORMAT::LEGACY::AreTuningPropertiesReviewed(
1722 aGenerator->GetProperties() );
1733 const wxString type = generator->GetGeneratorType();
1735 if( type != wxT(
"tuning_pattern" ) && type != wxT(
"via_stitch" ) && type != wxT(
"via_stack" ) )
1738 for(
EDA_ITEM* member : generator->GetItems() )
1756 switch( aItem->
Type() )
1775 default:
return true;
1786 count += std::count_if( fp->GraphicalItems().begin(), fp->GraphicalItems().end(),
isUnreviewedDrawing );
1795 aVisit(
const_cast<FOOTPRINT*
>( aFootprint ) );
1807 aVisit( generator );
1809 for(
const auto& [
name, item] : generator->GetTemplateItems() )
1859 bool excluded = fp->IsExcludedFromSim();
1861 for(
const auto& [
name, variant] : fp->GetVariants() )
1862 excluded = excluded || variant.GetExcludedFromSim();
1906 const auto unsafeStroke = [](
const STROKE_PARAMS& aStroke )
1958 for(
int outline = 0; outline < ink.
OutlineCount(); ++outline )
1974 parent->
Add( polygon );
1977 group->AddItem( polygon );
1988 std::vector<PCB_SHAPE*> shapes;
1993 shapes.push_back(
static_cast<PCB_SHAPE*
>( aItem ) );
2008 std::vector<PCB_SHAPE*> shapes;
2013 shapes.push_back(
static_cast<PCB_SHAPE*
>( aItem ) );
2028 if( aName == wxT(
"TITLE" ) )
2030 if( aName == wxT(
"ISSUE_DATE" ) )
2032 if( aName == wxT(
"REVISION" ) )
2034 if( aName == wxT(
"COMPANY" ) )
2036 if( aName.length() == 8 && aName.StartsWith( wxT(
"COMMENT" ) ) && aName[7] >=
'1' && aName[7] <=
'9' )
2037 return 4 + aName[7].GetValue() -
'1';
2047 case 1:
return aTitle.
GetDate();
2050 default:
return aTitle.
GetComment( aIndex - 4 );
2056 std::set<wxString>& aDependencies,
int aDepth = 0 )
2061 for(
size_t pos = 0; pos + 1 < aText.length(); ++pos )
2063 if( aText[pos] ==
'\\' && pos + 2 < aText.length() && ( aText[pos + 1] ==
'$' || aText[pos + 1] ==
'@' )
2064 && aText[pos + 2] ==
'{' )
2072 for( ; pos < aText.length() && braces; ++pos )
2073 braces += aText[pos] ==
'{' ? 1 : ( aText[pos] ==
'}' ? -1 : 0 );
2079 if( aText[pos] ==
'@' && aText[pos + 1] ==
'{'
2083 if( aText[pos] ==
'$' && aText[pos + 1] ==
'{'
2084 && aText.Mid( pos + 2 ).BeforeFirst(
'}' ).AfterFirst(
':' ).StartsWith( wxT(
"PROPERTY." ) ) )
2090 const wxString&
name = reference.primary;
2092 if(
name.StartsWith( wxT(
"PROPERTY." ) ) || reference.secondary.StartsWith( wxT(
"PROPERTY." ) )
2093 ||
name == wxT(
"DRILL_OPERATIONS" ) ||
name == wxT(
"DRILL_SITES" ) ||
name == wxT(
"DRILL_GROUPS" ) )
2098 wxString resolved =
name;
2104 if( aDependencies.insert(
name ).second
2105 &&
postTargetText( resolved, aBoard, aTargetVersion, aDependencies, aDepth + 1 ) )
2114 const wxString* value =
nullptr;
2119 auto variable = variables.find(
name );
2121 if( variable != variables.end() )
2122 value = &variable->second;
2128 auto property = properties.find(
name );
2130 if( property != properties.end() )
2131 value = &
property->second;
2134 if( value && aDependencies.insert(
name ).second
2135 &&
postTargetText( *value, aBoard, aTargetVersion, aDependencies, aDepth + 1 ) )
2146 std::set<wxString> dependencies;
2147 return postTargetText( aText, aBoard, aTargetVersion, dependencies );
2162 for(
size_t pos = 0; pos + 1 < aText.length(); ++pos )
2164 if( aText[pos] ==
'\\' && pos + 2 < aText.length() && ( aText[pos + 1] ==
'$' || aText[pos + 1] ==
'@' )
2165 && aText[pos + 2] ==
'{' )
2170 for( ; pos < aText.length() && braces; ++pos )
2171 braces += aText[pos] ==
'{' ? 1 : ( aText[pos] ==
'}' ? -1 : 0 );
2175 else if( aText[pos] ==
'@' && aText[pos + 1] ==
'{' )
2186 const std::function<
bool( wxString* )>* aResolver =
nullptr )
2195 if( !
text && !barcode )
2207 std::function<bool( wxString* )> resolver = [&]( wxString* aToken )
2210 return ( *aResolver )( aToken );
2212 if( *aToken == wxT(
"LAYER" ) && board )
2223 bool blocked =
false;
2225 for(
size_t pos = 0; pos < raw.length(); )
2228 bool escaped = raw[pos] ==
'\\' && pos + 2 < raw.length() && ( raw[pos + 1] ==
'$' || raw[pos + 1] ==
'@' )
2229 && raw[pos + 2] ==
'{';
2230 size_t marker = escaped ? pos + 1 : pos;
2232 if( marker + 1 >= raw.length() || ( raw[marker] !=
'$' && raw[marker] !=
'@' ) || raw[marker + 1] !=
'{' )
2241 while( pos < raw.length() && braces )
2243 braces += raw[pos] ==
'{' ? 1 : ( raw[pos] ==
'}' ? -1 : 0 );
2247 wxString block = raw.Mid( start, pos - start );
2266 if( cell->GetRow() < 0 || cell->GetColumn() < 0 )
2297 for(
int depth = 0; depth < 32; ++depth )
2304 expanded = evaluator.
Evaluate( expanded );
2313 if( expanded == block )
2325 if(
postTargetText( block, board, aTargetVersion ) || block.Contains( wxT(
"<Unresolved:" ) )
2326 || block.Contains( wxT(
"<Unknown reference:" ) ) )
2333 && (
result.Contains( wxT(
"\\${" ) ) ||
result.Contains( wxT(
"\\@{" ) ) ) )
2346 plan.m_board =
const_cast<BOARD*
>( aBoard );
2353 std::function<bool( wxString* )> resolver = [&]( wxString* aToken )
2355 if( *aToken == wxT(
"FILENAME" ) || *aToken == wxT(
"FILEPATH" ) || *aToken == wxT(
"VARIANT" )
2356 || *aToken == wxT(
"VARIANT_DESC" ) )
2364 for(
int field = 0; field < 13; ++field )
2369 planTextItem( &temporary, aTargetVersion, title, &resolver );
2385 dimension->ChangeOverrideText( value );
2387 text->SetText( value );
2388 else if(
auto barcode =
dynamic_cast<PCB_BARCODE*
>( item ) )
2389 barcode->SetBarcodeText( value );
2398 case 0: title.
SetTitle( value );
break;
2399 case 1: title.
SetDate( value );
break;
2402 default: title.
SetComment( field - 4, value );
break;
2433 _(
"Unknown generator kinds or detached generated children cannot be safely exported." ),
2436 _(
"The tuning generator contains properties outside the reviewed historical schemas." ),
2439 _(
"Generator editability is removed. Existing generated copper and group membership are kept." ),
2442 _(
"Group placement linkage is removed. Zone geometry, keepout settings, groups, and copper are kept." ),
2445 _(
"An unrecognized graphic item cannot be safely represented by the target writer." ),
2448 _(
"Solver relationships are removed. Existing geometry is kept in its current position." ),
countConstraints,
2451 _(
"Placement, snapping, and routing grid configuration is removed. Copper is unchanged." ),
countGrids,
2454 _(
"Generator editability is removed. Existing generated copper and group membership are kept." ),
2455 [](
const BOARD* b )
2464 _(
"Generator editability is removed. Existing generated copper and group membership are kept." ),
2465 [](
const BOARD* b )
2474 _(
"Converted to printed polygons with the shortened line body. Ending editability is lost." ),
2475 [](
const BOARD* b )
2495 _(
"Endpoint embellishments are removed. The supported line body and its style are kept." ) },
2497 _(
"Simulation exclusions are removed. The target may include these footprints in simulation." ),
2500 _(
"Custom item metadata is removed after affected displayed text has been resolved." ),
2503 _(
"Drill chart tables and drill map symbols are removed from the fabrication drawings. Holes are kept." ),
2506 _(
"Drill symbol assignments and display settings are removed. Holes are unchanged." ),
2512 _(
"Ellipse graphics are omitted instead of approximated." ) },
2517 _(
"A refill in the target would turn the pattern into solid copper." ),
countThievingZones,
nullptr },
2526 _(
"Barcodes are omitted instead of converted to polygons." ) },
2533 _(
"Backdrilling changes copper connectivity and cannot be represented." ),
countBackdrills,
nullptr },
2542 _(
"Approximated by keeping only the start and end layers." ),
2553 _(
"Written with the older combined blind type." ),
2566 [](
const BOARD* b )
2586 _(
"The hatch fill is omitted. The supported outline is kept." ) },
2589 _(
"Hatched copper fills" ),
2590 _(
"Converted to a solid fill. Copper geometry may change." ),
2591 [](
const BOARD* b )
2610 _(
"IPC-4761 covering, plugging, capping, and filling are removed." ),
countViaProtection,
2622 _(
"Rounded rectangles and rounded custom pad primitives are omitted. Copper geometry may change." ) },
2626 _(
"Knockout cell contents are omitted; empty cells and the table grid are kept." ) },
2633 _(
"The target would expand the footprint's inner layers and change its connectivity." ),
2642 bool aDropInsteadOfApproximate )
2647 wxT(
"Board format changed. Review the downgrade rules and denylist, then update "
2648 "BOARD_DOWNGRADE_COVERED." ) );
2654 _(
"The current board format has changed since the downgrade rules were reviewed." ), 1 );
2658 _(
"The unsupported plot format is reset to Gerber." ), 1 );
2664 if(
text.m_blocked )
2666 _(
"Affected property variables or expressions could not be safely resolved." ),
2669 if( !
text.m_replacements.empty() || !
text.m_titleReplacements.empty() )
2671 _(
"Affected displayed text is resolved to its current value and loses dynamic evaluation." ),
2672 text.m_replacements.size() +
text.m_titleReplacements.size() );
2679 _(
"Dashed, colored, or unresolved-width line endings cannot be faithfully converted. "
2680 "The omission policy can remove just the endpoint embellishments." ),
2689 if(
int count = rule.m_count( aBoard ); count > 0 )
2692 && !rule.m_keepUnderOmitPolicy;
2694 omit ? rule.m_omitDetail : rule.m_detail, count );
2759 && !rule.m_keepUnderOmitPolicy;
2760 const auto& apply = omit ? rule.m_omit : rule.m_apply;
2761 wxASSERT_MSG( !omit || apply, wxT(
"A LOWER rule needs an omission transform." ) );
2793 && !rule.m_keepUnderOmitPolicy;
2794 const auto& apply = omit ? rule.m_omitFp : rule.m_applyFp;
2795 wxASSERT_MSG( !omit || !rule.m_applyFp || apply, wxT(
"A footprint LOWER rule needs an omission transform." ) );
2798 apply( aFootprint );
2891 wxFAIL_MSG( wxT(
"No writer for this downgrade target." ) );
2902 wxFAIL_MSG( wxT(
"No writer for this downgrade target." ) );
2909 std::vector<std::string>
path;
2911 for(
size_t position = 0; position <
text.size(); ++position )
2913 if(
text[position] ==
'(' )
2915 size_t begin = position + 1;
2917 while( begin <
text.size() && std::isspace(
static_cast<unsigned char>(
text[begin] ) ) )
2923 && ( std::isalnum(
static_cast<unsigned char>(
text[
end] ) ) ||
text[
end] ==
'_' ) )
2926 const std::string head =
text.substr( begin,
end - begin );
2928 if( head ==
"group" &&
path.size() >= 2 &&
path.back() ==
"placement" &&
path[
path.size() - 2] ==
"zone" )
2931 path.push_back( head );
2932 position =
end > begin ?
end - 1 : position;
2934 else if(
text[position] ==
')' && !
path.empty() )
2947 return wxEmptyString;
2950 return wxT(
"placement/group" );
2961 fp->SetDNP( fp->GetDNPForVariant( aVariantName ) );
2962 fp->SetExcludedFromBOM( fp->GetExcludedFromBOMForVariant( aVariantName ) );
2963 fp->SetExcludedFromPosFiles( fp->GetExcludedFromPosFilesForVariant( aVariantName ) );
2964 fp->SetExcludedFromSim( fp->GetExcludedFromSimForVariant( aVariantName ) );
2968 for(
const auto& [
name, value] : variant->GetFields() )
2971 field->SetText( value );
2983 std::unique_ptr<FOOTPRINT> owned = loader.
ImportFootprint( aSrcFile, nameOut );
2992 scratch.
Add( owned.release() );
3012 bool aDropInsteadOfApproximate )
3014 if( aUnsupportedToken )
3015 aUnsupportedToken->clear();
3018 wxFileName projectFile( aSrcFile );
3020 projectFile.MakeAbsolute();
3021 projectSettings.
LoadProject( projectFile.GetFullPath(),
false );
3024 std::unique_ptr<BOARD> board( pi.
LoadBoard( aSrcFile,
nullptr ) );
3030 board->SetProject( projectSettings.
GetProject( projectFile.GetFullPath() ),
true );
3032 if( !aVariant.IsEmpty() )
3045 const wxString tmpFile = wxFileName::CreateTempFileName( aDestFile + wxT(
".downgrade_tmp." ) );
3047 if( tmpFile.IsEmpty() )
3052 wxRemoveFile( tmpFile );
3060 wxRemoveFile( tmpFile );
3070 [&](
const wxString& aText )
3072 return FindUnsupportedBoardToken( aText, aTarget );
3078 wxRemoveFile( tmpFile );
3080 if( aUnsupportedToken )
3081 *aUnsupportedToken = bad;
3086 if( !wxRenameFile( tmpFile, aDestFile,
true ) )
3088 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 constexpr int VER_JUMPER_PADS
static void dropKnockoutTableCells(BOARD *aBoard)
static void lowerBarcodes(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_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 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 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 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 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 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 void dropKnockoutTextBoxesFp(FOOTPRINT *aFootprint)
static void clearLineEndings(PCB_SHAPE *aShape)
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 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
BOARD_DESIGN_SETTINGS & GetDesignSettings() 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
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.
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...
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.
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.