51#include <compoundfilereader.h>
58#include <wx/docview.h>
60#include <wx/mstream.h>
61#include <wx/wfstream.h>
62#include <wx/zstream.h>
64#include <magic_enum.hpp>
87 THROW_IO_ERROR( wxString::Format( wxT(
"Component creator tries to access component id %u "
88 "of %u existing components" ),
97 const std::vector<ALTIUM_VERTICE>& aVertices )
106 double startradiant =
DEG2RAD( vertex.startangle );
107 double endradiant =
DEG2RAD( vertex.endangle );
108 VECTOR2I arcStartOffset =
KiROUND( std::cos( startradiant ) * vertex.radius,
109 -std::sin( startradiant ) * vertex.radius );
111 VECTOR2I arcEndOffset =
KiROUND( std::cos( endradiant ) * vertex.radius,
112 -std::sin( endradiant ) * vertex.radius );
114 VECTOR2I arcStart = vertex.center + arcStartOffset;
115 VECTOR2I arcEnd = vertex.center + arcEndOffset;
120 if( arcStart.
Distance( vertex.position )
121 < arcEnd.
Distance( vertex.position ) )
148 aLine.
Append( vertex.position );
158 auto override =
m_layermap.find( aAltiumLayer );
162 return override->second;
177 switch( aAltiumLayer )
279 std::vector<PCB_LAYER_ID> layers;
280 layers.reserve( layerCount );
285 layers.emplace_back( layer );
302 const wxString& aLibrary,
const wxString& aFootprintName )
322 const unsigned PROGRESS_DELTA = 250;
340 const std::map<ALTIUM_PCB_DIR, std::string>& aFileMapping )
343 const std::vector<std::tuple<bool, ALTIUM_PCB_DIR, PARSE_FUNCTION_POINTER_fp>> parserOrder = {
455 for(
const std::tuple<bool, ALTIUM_PCB_DIR, PARSE_FUNCTION_POINTER_fp>& cur : parserOrder )
460 std::tie( isRequired,
directory, fp ) = cur;
465 const auto& mappedDirectory = aFileMapping.find(
directory );
467 if( mappedDirectory == aFileMapping.end() )
470 const std::vector<std::string> mappedFile{ mappedDirectory->second,
"Header" };
471 const CFB::COMPOUND_FILE_ENTRY* file = altiumPcbFile.
FindStream( mappedFile );
473 if( file ==
nullptr )
477 uint32_t numOfRecords = reader.
Read<uint32_t>();
483 m_reporter->Report( wxString::Format(
_(
"'%s' was not parsed correctly." ),
497 m_reporter->Report( wxString::Format(
_(
"'%s' was not fully parsed." ),
509 if( boardDirectory != aFileMapping.end() )
511 std::vector<std::string> mappedFile{ boardDirectory->second,
"Data" };
513 const CFB::COMPOUND_FILE_ENTRY* file = altiumPcbFile.
FindStream( mappedFile );
518 "This file does not appear to be in a valid PCB Binary Version 6.0 format. In "
520 "make sure to save as \"PCB Binary Files (*.PcbDoc)\"." ) );
525 for(
const std::tuple<bool, ALTIUM_PCB_DIR, PARSE_FUNCTION_POINTER_fp>& cur : parserOrder )
530 std::tie( isRequired,
directory, fp ) = cur;
532 const auto& mappedDirectory = aFileMapping.find(
directory );
534 if( mappedDirectory == aFileMapping.end() )
536 wxASSERT_MSG( !isRequired, wxString::Format( wxT(
"Altium Directory of kind %d was "
537 "expected, but no mapping is "
538 "present in the code" ),
543 std::vector<std::string> mappedFile{ mappedDirectory->second };
546 mappedFile.emplace_back(
"Data" );
548 const CFB::COMPOUND_FILE_ENTRY* file = altiumPcbFile.
FindStream( mappedFile );
550 if( file !=
nullptr )
552 fp( altiumPcbFile, file );
554 else if( isRequired )
558 m_reporter->Report( wxString::Format(
_(
"File not found: '%s' for directory '%s'." ),
573 if( zone->GetAssignedPriority() == 1000 )
584 zone->SetAssignedPriority( priority >= 0 ? priority : 0 );
588 for( std::pair<const ALTIUM_LAYER, ZONE*>& zone :
m_outer_plane )
589 zone.second->SetAssignedPriority( 0 );
599 if( !zone->HasFilledPolysForLayer( layer ) )
602 zone->GetFilledPolysList( layer )->Fracture();
640 if( arc->
GetCenter() == dim->GetPosition() )
649 VECTOR2I radialLine = dim->GetEnd() - dim->GetStart();
654 radialLine = radialLine.
Resize( std::max(
radius, 2 ) );
655 dim->SetEnd( dim->GetStart() + (
VECTOR2I) radialLine );
656 dim->SetLeaderLength( totalLength -
radius );
666 int desired_x = ( w - bbbox.
GetWidth() ) / 2;
667 int desired_y = ( h - bbbox.
GetHeight() ) / 2;
669 VECTOR2I movementVector( desired_x - bbbox.
GetX(), desired_y - bbbox.
GetY() );
670 m_board->Move( movementVector );
681 const wxString& aFootprintName )
683 std::unique_ptr<FOOTPRINT> footprint = std::make_unique<FOOTPRINT>(
m_board );
688 const std::vector<std::string> libStreamName{
"Library",
"Data" };
689 const CFB::COMPOUND_FILE_ENTRY* libStream = altiumLibFile.
FindStream( libStreamName );
691 if( libStream ==
nullptr )
709 std::tuple<wxString, const CFB::COMPOUND_FILE_ENTRY*> ret =
712 wxString fpDirName = std::get<0>( ret );
713 const CFB::COMPOUND_FILE_ENTRY* footprintStream = std::get<1>( ret );
715 if( fpDirName.IsEmpty() )
718 wxString::Format(
_(
"Footprint directory not found: '%s'." ), aFootprintName ) );
721 const std::vector<std::string> streamName{ fpDirName.ToStdString(),
"Data" };
722 const CFB::COMPOUND_FILE_ENTRY* footprintData = altiumLibFile.
FindStream( footprintStream, {
"Data" } );
724 if( footprintData ==
nullptr )
737 footprint->SetFPID( fpID );
739 const std::vector<std::string> parametersStreamName{ fpDirName.ToStdString(),
741 const CFB::COMPOUND_FILE_ENTRY* parametersData =
742 altiumLibFile.
FindStream( footprintStream, {
"Parameters" } );
744 if( parametersData !=
nullptr )
747 std::map<wxString, wxString> parameterProperties = parametersReader.
ReadProperties();
749 wxT(
"DESCRIPTION" ), wxT(
"" ) );
750 footprint->SetLibDescription( description );
756 m_reporter->Report( wxString::Format(
_(
"File not found: '%s'." ),
761 footprint->SetLibDescription( wxT(
"" ) );
764 const std::vector<std::string> extendedPrimitiveInformationStreamName{
765 "ExtendedPrimitiveInformation",
"Data"
767 const CFB::COMPOUND_FILE_ENTRY* extendedPrimitiveInformationData =
768 altiumLibFile.
FindStream( footprintStream, extendedPrimitiveInformationStreamName );
770 if( extendedPrimitiveInformationData !=
nullptr )
773 footprint->SetReference( wxT(
"REF**" ) );
774 footprint->SetValue( aFootprintName );
775 footprint->Reference().SetVisible(
true );
776 footprint->Value().SetVisible(
true );
779 const int defaultTextThickness(
pcbIUScale.mmToIU( 0.15 ) );
781 for(
PCB_FIELD* field : footprint->GetFields() )
783 field->SetTextSize( defaultTextSize );
784 field->SetTextThickness( defaultTextThickness );
842 THROW_IO_ERROR( wxString::Format(
_(
"Record of unknown type: '%d'." ), recordtype ) );
848 for(
bool changes =
true; changes; )
853 [&changes](
PAD* aPad1,
PAD* aPad2 )
855 if( !( aPad1->GetNumber().IsEmpty() ^ aPad2->GetNumber().IsEmpty() ) )
858 for( PCB_LAYER_ID layer : aPad1->GetLayerSet() )
860 std::shared_ptr<SHAPE> shape1 = aPad1->GetEffectiveShape( layer );
861 std::shared_ptr<SHAPE> shape2 = aPad2->GetEffectiveShape( layer );
863 if( shape1->Collide( shape2.get() ) )
865 if( aPad1->GetNumber().IsEmpty() )
866 aPad1->SetNumber( aPad2->GetNumber() );
868 aPad2->SetNumber( aPad1->GetNumber() );
877 footprint->AutoPositionFields();
879 if( parser.HasParsingError() )
881 THROW_IO_ERROR( wxString::Format( wxT(
"%s stream was not parsed correctly" ),
885 if( parser.GetRemainingBytes() != 0 )
887 THROW_IO_ERROR( wxString::Format( wxT(
"%s stream is not fully parsed" ),
891 return footprint.release();
902 THROW_IO_ERROR( wxString::Format( wxT(
"Netcode with id %d does not exist. Only %d nets "
914 const auto rules =
m_rules.find( aKind );
919 for(
const ARULE6& rule : rules->second )
921 if( rule.
name == aName )
930 const auto rules =
m_rules.find( aKind );
935 for(
const ARULE6& rule : rules->second )
947 const auto rules =
m_rules.find( aKind );
961 const CFB::COMPOUND_FILE_ENTRY* aEntry )
979 const CFB::COMPOUND_FILE_ENTRY* aEntry )
996 THROW_IO_ERROR( wxT(
"ExtendedPrimitiveInformation stream is not fully parsed" ) );
1001 const CFB::COMPOUND_FILE_ENTRY* aEntry )
1018 size_t layercount = 0;
1021 while( layerid < elem.
stackup.size() && layerid != 0 )
1023 layerid = elem.
stackup[ layerid - 1 ].nextId;
1027 size_t kicadLayercount = ( layercount % 2 == 0 ) ? layercount : layercount + 1;
1028 m_board->SetCopperLayerCount( kicadLayercount );
1037 auto it = stackup.
GetList().begin();
1046 altiumLayerId < elem.
stackup.size() && altiumLayerId != 0;
1047 altiumLayerId = elem.
stackup[altiumLayerId - 1].nextId )
1053 if( layer.
nextId == 0 && layercount != kicadLayercount )
1055 m_board->SetLayerName( ( *it )->GetBrdLayerId(), wxT(
"[unused]" ) );
1058 THROW_IO_ERROR( wxT(
"Board6 stream, unexpected item while parsing stackup" ) );
1060 ( *it )->SetThickness( 0 );
1065 THROW_IO_ERROR( wxT(
"Board6 stream, unexpected item while parsing stackup" ) );
1067 ( *it )->SetThickness( 0, 0 );
1068 ( *it )->SetThicknessLocked(
true, 0 );
1076 THROW_IO_ERROR( wxT(
"Board6 stream, unexpected item while parsing stackup" ) );
1090 if( klayer ==
B_Cu )
1093 THROW_IO_ERROR( wxT(
"Board6 stream, unexpected id while parsing last stackup layer" ) );
1103 THROW_IO_ERROR( wxT(
"Board6 stream, unexpected item while parsing stackup" ) );
1139 wxString nameLower = aName.Lower();
1140 return nameLower.Contains( wxT(
"courtyard" ) ) || nameLower.Contains( wxT(
"court yard" ) )
1141 || nameLower.Contains( wxT(
"crtyd" ) );
1148 wxString nameLower = aName.Lower();
1149 return nameLower.Contains( wxT(
"assembly" ) ) || nameLower.Contains( wxT(
"assy" ) );
1158 auto check = [&isTop](
bool aTopCond,
bool aBotCond )
1160 if( aTopCond && aBotCond )
1163 if( !aTopCond && !aBotCond )
1170 wxString lower = aName.Lower();
1172 if( check( lower.StartsWith(
"top" ), lower.StartsWith(
"bot" ) ) )
1175 if( check( lower.EndsWith(
"_t" ), lower.EndsWith(
"_b" ) ) )
1178 if( check( lower.EndsWith(
".t" ), lower.EndsWith(
".b" ) ) )
1181 if( check( lower.Contains(
"top" ), lower.Contains(
"bot" ) ) )
1194 if( aStackup.size() == 0 )
1197 std::vector<INPUT_LAYER_DESC> inputLayers;
1198 std::map<wxString, ALTIUM_LAYER> altiumLayerNameMap;
1205 bool frontCourtyardMapped =
false;
1206 bool backCourtyardMapped =
false;
1208 for(
size_t ii = 0; ii < aStackup.size(); ii++ )
1210 curLayer = aStackup[ii];
1229 auto existingMapping =
m_layermap.find( layer_num );
1256 if( isTopSide && !frontCourtyardMapped )
1259 frontCourtyardMapped =
true;
1261 else if( !isTopSide && !backCourtyardMapped )
1264 backCourtyardMapped =
true;
1266 else if( !frontCourtyardMapped )
1269 frontCourtyardMapped =
true;
1271 else if( !backCourtyardMapped )
1274 backCourtyardMapped =
true;
1297 inputLayers.push_back( iLdesc );
1298 altiumLayerNameMap.insert( { curLayer.
name, layer_num } );
1302 if( inputLayers.size() == 0 )
1308 for( std::pair<wxString, PCB_LAYER_ID> layerPair : reMappedLayers )
1316 m_reporter->Report( wxString::Format(
_(
"Layer '%s' could not be mapped and "
1317 "will be skipped." ),
1325 ALTIUM_LAYER altiumID = altiumLayerNameMap.at( layerPair.first );
1326 m_layermap.insert_or_assign( altiumID, layerPair.second );
1327 enabledLayers |=
LSET( { layerPair.second } );
1332 for(
const auto& [
name, altLayer] : altiumLayerNameMap )
1334 if( reMappedLayers.find(
name ) == reMappedLayers.end()
1341 m_board->SetEnabledLayers( enabledLayers );
1342 m_board->SetVisibleLayers( enabledLayers );
1355 if( !layer.mechenabled )
1363 switch( layer.mechkind )
1424 shape->SetStroke( stroke );
1436 shape->SetStroke( stroke );
1438 shape->SetStart( seg.
A );
1439 shape->SetEnd( seg.
B );
1448 const CFB::COMPOUND_FILE_ENTRY* aEntry )
1462 std::shared_ptr<NETCLASS> nc = std::make_shared<NETCLASS>( elem.
name );
1464 for(
const wxString&
name : elem.
names )
1466 m_board->GetDesignSettings().m_NetSettings->SetNetclassPatternAssignment(
1467 name, nc->GetName() );
1470 if(
m_board->GetDesignSettings().m_NetSettings->HasNetclass( nc->GetName() ) )
1477 msg.Printf(
_(
"More than one Altium netclass with name '%s' found. "
1478 "Only the first one will be imported." ), elem.
name );
1484 m_board->GetDesignSettings().m_NetSettings->SetNetclass( nc->GetName(), nc );
1494 std::shared_ptr<NET_SETTINGS> netSettings =
m_board->GetDesignSettings().m_NetSettings;
1498 if( net->GetNetCode() > 0 )
1500 std::shared_ptr<NETCLASS> netclass = netSettings->GetEffectiveNetClass( net->GetNetname() );
1503 net->SetNetClass( netclass );
1507 m_board->m_LegacyNetclassesLoaded =
true;
1512 const CFB::COMPOUND_FILE_ENTRY* aEntry )
1524 std::unique_ptr<FOOTPRINT> footprint = std::make_unique<FOOTPRINT>(
m_board );
1535 wxString fpName = elem.
pattern;
1537 if( fpName.Contains( wxT(
"\\" ) ) || fpName.Contains( wxT(
"/" ) ) )
1539 wxFileName fpPath( fpName, wxPATH_WIN );
1540 fpName = fpPath.GetFullName();
1545 footprint->SetFPID( fpID );
1547 footprint->SetPosition( elem.
position );
1548 footprint->SetOrientationDegrees( elem.
rotation );
1554 if( reference.find_first_not_of(
"0123456789" ) == wxString::npos )
1555 reference.Prepend( wxT(
"UNK" ) );
1557 footprint->SetReference( reference );
1562 path.push_back( pathid );
1563 path.push_back(
id );
1565 footprint->SetPath(
path );
1569 footprint->SetLocked( elem.
locked );
1570 footprint->Reference().SetVisible( elem.
nameon );
1571 footprint->Value().SetVisible( elem.
commenton );
1579 THROW_IO_ERROR( wxT(
"Components6 stream is not fully parsed" ) );
1586 while( Angle < aMin )
1589 while( Angle >= aMax )
1612 m_reporter->Report( wxString::Format( wxT(
"Model %s not found for footprint %s" ),
1623 if( file->
name.IsEmpty() )
1627 std::vector<char> decompressedData;
1628 wxMemoryInputStream compressedStream(
model->second.data(),
model->second.size() );
1629 wxZlibInputStream zlibStream( compressedStream );
1633 decompressedData.resize(
model->second.size() * 6 );
1636 while( !zlibStream.Eof() )
1638 zlibStream.Read( decompressedData.data() + offset, decompressedData.size() - offset );
1639 size_t bytesRead = zlibStream.LastRead();
1644 offset += bytesRead;
1646 if( offset >= decompressedData.size() )
1647 decompressedData.resize( 2 * decompressedData.size() );
1650 decompressedData.resize( offset );
1671 orientation = -orientation;
1678 modelRotation.
x += 180;
1679 modelRotation.
z = -modelRotation.
z;
1693 aFootprint->
Models().push_back( modelSettings );
1698 const CFB::COMPOUND_FILE_ENTRY* aEntry )
1704 BS::multi_future<void> embeddedFutures;
1715 if( skipComponentBodies )
1723 THROW_IO_ERROR( wxString::Format( wxT(
"ComponentsBodies6 stream tries to access "
1724 "component id %d of %zu existing components" ),
1739 msg.Printf( wxT(
"ComponentsBodies6 stream tries to access model id %s which does "
1740 "not exist" ), elem.
modelId );
1753 wxMemoryInputStream compressedStream( modelData.
m_data.data(), modelData.
m_data.size() );
1754 wxZlibInputStream zlibStream( compressedStream );
1755 wxMemoryOutputStream decompressedStream;
1757 zlibStream.Read( decompressedStream );
1763 embeddedFutures.push_back(
tp.submit_task(
1766 EMBEDDED_FILES::CompressAndEncode( *file );
1785 orientation = -orientation;
1808 footprint->
Models().push_back( modelSettings );
1811 embeddedFutures.wait();
1814 THROW_IO_ERROR( wxT(
"ComponentsBodies6 stream is not fully parsed" ) );
1821 THROW_IO_ERROR( wxT(
"Incorrect number of reference points for linear dimension object" ) );
1830 _(
"Dimension found on an Altium layer (%d) with no KiCad equivalent. "
1831 "It has been moved to KiCad layer Eco1_User." ), aElem.
layer ),
1844 dimension->SetLayer( klayer );
1845 dimension->SetStart( referencePoint0 );
1847 if( referencePoint0 != aElem.
xy1 )
1859 VECTOR2I referenceDiff = referencePoint1 - referencePoint0;
1861 SEG segm1( referencePoint0, referencePoint0 + directionNormalVector );
1862 SEG segm2( referencePoint1, referencePoint1 + direction );
1866 THROW_IO_ERROR( wxT(
"Invalid dimension. This should never happen." ) );
1868 dimension->SetEnd( *intersection );
1872 if( direction.
Cross( referenceDiff ) > 0 )
1875 dimension->SetHeight( height );
1879 dimension->SetEnd( referencePoint1 );
1882 dimension->SetLineThickness( aElem.
linewidth );
1888 int dist = ( dimension->GetEnd() - dimension->GetStart() ).EuclideanNorm();
1890 if( dist < 3 * dimension->GetArrowLength() )
1894 wxRegEx units( wxS(
"(mm)|(in)|(mils)|(thou)|(')|(\")" ), wxRE_ADVANCED );
1906 dimension->Text().SetBold( aElem.
textbold );
1909 dimension->SetTextThickness( dimension->GetTextThickness() *
BOLD_FACTOR );
1928 THROW_IO_ERROR( wxT(
"Not enough reference points for radial dimension object" ) );
1937 _(
"Dimension found on an Altium layer (%d) with no KiCad equivalent. "
1938 "It has been moved to KiCad layer Eco1_User." ),
1947 std::unique_ptr<PCB_DIM_RADIAL> dimension = std::make_unique<PCB_DIM_RADIAL>(
m_board );
1950 dimension->SetLayer( klayer );
1951 dimension->SetStart( referencePoint0 );
1952 dimension->SetEnd( aElem.
xy1 );
1953 dimension->SetLineThickness( aElem.
linewidth );
1954 dimension->SetKeepTextAligned(
false );
1975 m_reporter->Report( wxT(
"No text position present for leader dimension object" ),
1982 dimension->SetTextPos( aElem.
textPoint.at( 0 ) );
1988 dimension->SetBold( aElem.
textbold );
1991 dimension->SetTextThickness( dimension->GetTextThickness() *
BOLD_FACTOR );
1999 int yAdjust = dimension->GetTextBox(
nullptr ).GetCenter().y - dimension->GetTextPos().y;
2000 dimension->SetTextPos( dimension->GetTextPos() +
VECTOR2I( 0, yAdjust + aElem.
textgap ) );
2017 msg.Printf(
_(
"Dimension found on an Altium layer (%d) with no KiCad equivalent. "
2018 "It has been moved to KiCad layer Eco1_User." ), aElem.
layer );
2035 shape->SetLayer( klayer );
2037 shape->SetStart( last );
2049 if( dirVec.
x != 0 || dirVec.
y != 0 )
2058 shape1->SetLayer( klayer );
2060 shape1->SetStart( referencePoint0 );
2061 shape1->SetEnd( referencePoint0 + arrVec );
2071 shape2->SetLayer( klayer );
2073 shape2->SetStart( referencePoint0 );
2074 shape2->SetEnd( referencePoint0 + arrVec );
2086 m_reporter->Report( wxT(
"No text position present for leader dimension object" ),
2093 std::unique_ptr<PCB_TEXT>
text = std::make_unique<PCB_TEXT>(
m_board );
2097 text->SetLayer( klayer );
2116 msg.Printf(
_(
"Dimension found on an Altium layer (%d) with no KiCad equivalent. "
2117 "It has been moved to KiCad layer Eco1_User." ), aElem.
layer );
2128 shape->SetLayer( klayer );
2147 msg.Printf(
_(
"Dimension found on an Altium layer (%d) with no KiCad equivalent. "
2148 "It has been moved to KiCad layer Eco1_User." ), aElem.
layer );
2158 std::unique_ptr<PCB_DIM_CENTER> dimension = std::make_unique<PCB_DIM_CENTER>(
m_board );
2160 dimension->SetLayer( klayer );
2161 dimension->SetLineThickness( aElem.
linewidth );
2162 dimension->SetStart( aElem.
xy1 );
2163 dimension->SetEnd( aElem.
xy1 + vec );
2170 const CFB::COMPOUND_FILE_ENTRY* aEntry )
2190 m_reporter->Report( wxString::Format(
_(
"Ignored Angular dimension (not yet supported)." ) ),
2203 m_reporter->Report( wxString::Format(
_(
"Ignored Datum dimension (not yet supported)." ) ),
2211 m_reporter->Report( wxString::Format(
_(
"Ignored Baseline dimension (not yet supported)." ) ),
2221 m_reporter->Report( wxString::Format(
_(
"Ignored Linear dimension (not yet supported)." ) ),
2228 m_reporter->Report( wxString::Format(
_(
"Ignored Radial dimension (not yet supported)." ) ),
2236 msg.Printf(
_(
"Ignored dimension of kind %d (not yet supported)." ), elem.
kind );
2244 THROW_IO_ERROR( wxT(
"Dimensions6 stream is not fully parsed" ) );
2249 const CFB::COMPOUND_FILE_ENTRY* aEntry,
2250 const std::vector<std::string>& aRootDir )
2261 wxString invalidChars = wxFileName::GetForbiddenChars();
2268 std::vector<std::string> stepPath = aRootDir;
2269 stepPath.emplace_back( std::to_string( idx ) );
2271 bool validName = !elem.
name.IsEmpty() && elem.
name.IsAscii()
2272 && wxString::npos == elem.
name.find_first_of( invalidChars );
2273 wxString storageName = validName ? elem.
name : wxString::Format( wxT(
"model_%d" ), idx );
2277 const CFB::COMPOUND_FILE_ENTRY* stepEntry = aAltiumPcbFile.
FindStream( stepPath );
2279 if( stepEntry ==
nullptr )
2284 msg.Printf(
_(
"File not found: '%s'. 3D-model not imported." ),
FormatPath( stepPath ) );
2291 size_t stepSize =
static_cast<size_t>( stepEntry->size );
2292 std::vector<char> stepContent( stepSize );
2300 std::move( stepContent ) ) ) );
2304 std::map<wxString, std::vector<wxString>> nameIdMap;
2307 nameIdMap[data.m_modelname].push_back(
id );
2309 for(
auto& [
name, ids] : nameIdMap )
2311 for(
size_t i = 1; i < ids.size(); i++ )
2313 const wxString&
id = ids[i];
2320 wxString modelName = modelTuple->second.m_modelname;
2322 if( modelName.Contains(
"." ) )
2325 wxString baseName = modelName.BeforeLast(
'.', &ext );
2327 modelTuple->second.m_modelname = baseName +
'_' + std::to_string( i ) +
'.' + ext;
2331 modelTuple->second.m_modelname = modelName +
'_' + std::to_string( i );
2342 const CFB::COMPOUND_FILE_ENTRY* aEntry )
2354 ANET6 elem( reader );
2368 const CFB::COMPOUND_FILE_ENTRY* aEntry )
2411 msg.Printf(
_(
"Polygon outline count is %d, expected 1." ), outline.
OutlineCount() );
2419 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>(
m_board);
2425 zone->SetPosition( elem.
vertices.at( 0 ).position );
2426 zone->SetLocked( elem.
locked );
2428 zone->Outline()->AddOutline( outline.
Outline( 0 ) );
2435 int planeLayers = 0;
2436 int signalLayers = 0;
2450 if( planeLayers > 0 && planeClearanceRule )
2453 if( signalLayers > 0 && zoneClearanceRule )
2461 if( polygonConnectRule !=
nullptr )
2480 zone->SetThermalReliefSpokeWidth(
2491 zone->SetAssignedPriority( 1 );
2496 || zone->GetBoundingBox().Contains( outer_plane->second->GetBoundingBox() ) )
2511 const BOX2I& bbox = zone->GetBoundingBox();
2520 zone->SetHatchOrientation(
ANGLE_45 );
2535 const CFB::COMPOUND_FILE_ENTRY* aEntry )
2554 std::sort( val.second.begin(), val.second.end(),
2557 return lhs.priority < rhs.priority;
2570 if( trackWidthRule )
2572 m_board->GetDesignSettings().m_TrackMinWidth = trackWidthRule->
minLimit;
2576 if( routingViasRule )
2578 m_board->GetDesignSettings().m_ViasMinSize = routingViasRule->
minWidth;
2587 if( holeToHoleRule )
2593 if( soldermaskRule )
2604 const CFB::COMPOUND_FILE_ENTRY* aEntry )
2620 THROW_IO_ERROR( wxT(
"BoardRegions stream is not fully parsed" ) );
2624 const CFB::COMPOUND_FILE_ENTRY* aEntry )
2632 for(
int primitiveIndex = 0; reader.
GetRemainingBytes() >= 4; primitiveIndex++ )
2651 THROW_IO_ERROR(
"ShapeBasedRegions6 stream is not fully parsed" );
2675 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>(
m_board );
2677 zone->SetIsRuleArea(
true );
2685 zone->SetDoNotAllowZoneFills(
true );
2686 zone->SetDoNotAllowVias(
false );
2687 zone->SetDoNotAllowTracks(
false );
2688 zone->SetDoNotAllowPads(
false );
2689 zone->SetDoNotAllowFootprints(
false );
2692 zone->SetPosition( aElem.
outline.at( 0 ).position );
2693 zone->Outline()->AddOutline( linechain );
2713 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>(
m_board );
2715 zone->SetPosition( aElem.
outline.at( 0 ).position );
2716 zone->Outline()->AddOutline( linechain );
2724 fill.
Append( linechain );
2728 zone->SetFilledPolysList( klayer, fill );
2730 zone->SetIsFilled(
true );
2731 zone->SetNeedRefill(
false );
2744 msg.Printf(
_(
"Dashed outline found on an Altium layer (%d) with no KiCad equivalent. "
2745 "It has been moved to KiCad layer Eco1_User." ), aElem.
layer );
2766 shape->SetPolyShape( linechain );
2767 shape->SetFilled(
false );
2768 shape->SetLayer( klayer );
2786 msg.Printf(
_(
"Ignored polygon shape of kind %d (not yet supported)." ), aElem.
kind );
2795 const int aPrimitiveIndex )
2811 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aFootprint );
2813 zone->SetIsRuleArea(
true );
2821 zone->SetDoNotAllowZoneFills(
true );
2822 zone->SetDoNotAllowVias(
false );
2823 zone->SetDoNotAllowTracks(
false );
2824 zone->SetDoNotAllowPads(
false );
2825 zone->SetDoNotAllowFootprints(
false );
2828 zone->SetPosition( aElem.
outline.at( 0 ).position );
2829 zone->Outline()->AddOutline( linechain );
2863 msg.Printf(
_(
"Loading library '%s':\n"
2864 "Footprint %s contains a dashed outline on Altium layer (%d) with "
2865 "no KiCad equivalent. It has been moved to KiCad layer Eco1_User." ),
2877 msg.Printf(
_(
"Footprint %s contains a dashed outline on Altium layer (%d) with "
2878 "no KiCad equivalent. It has been moved to KiCad layer Eco1_User." ),
2900 std::unique_ptr<PCB_SHAPE> shape = std::make_unique<PCB_SHAPE>( aFootprint,
SHAPE_T::POLY );
2902 shape->SetPolyShape( linechain );
2903 shape->SetFilled(
false );
2904 shape->SetLayer( klayer );
2920 msg.Printf(
_(
"Error loading library '%s':\n"
2921 "Footprint %s contains polygon shape of kind %d (not yet supported)." ),
2933 msg.Printf(
_(
"Footprint %s contains polygon shape of kind %d (not yet supported)." ),
2961 for(
const std::vector<ALTIUM_VERTICE>& hole : aElem.
holes )
2969 polySet.
AddHole( hole_linechain );
2974 shape->SetPolyShape( polySet );
2975 shape->SetFilled(
true );
2976 shape->SetLayer( aLayer );
2991 const int aPrimitiveIndex )
3008 for(
const std::vector<ALTIUM_VERTICE>& hole : aElem.
holes )
3016 polySet.
AddHole( hole_linechain );
3019 if( aLayer ==
F_Cu || aLayer ==
B_Cu )
3022 std::unique_ptr<PAD>
pad = std::make_unique<PAD>( aFootprint );
3025 padLayers.
set( aLayer );
3036 pad->SetPosition( anchorPos );
3039 shapePolys.
Move( -anchorPos );
3043 auto it = map.find( aPrimitiveIndex );
3045 if( it != map.end() )
3051 pad->SetLocalSolderPasteMargin(
info.pastemaskexpansionmanual );
3056 pad->SetLocalSolderMaskMargin(
info.soldermaskexpansionmanual );
3066 pad->SetLayerSet( padLayers );
3072 std::unique_ptr<PCB_SHAPE> shape = std::make_unique<PCB_SHAPE>( aFootprint,
SHAPE_T::POLY );
3074 shape->SetPolyShape( polySet );
3075 shape->SetFilled(
true );
3076 shape->SetLayer( aLayer );
3085 const CFB::COMPOUND_FILE_ENTRY* aEntry )
3101 THROW_IO_ERROR( wxString::Format(
"Region stream tries to access polygon id %d "
3102 "of %d existing polygons.",
3109 if( zone ==
nullptr )
3131 for(
const std::vector<ALTIUM_VERTICE>& hole : elem.
holes )
3138 hole_linechain.
Append( hole.at( 0 ).position );
3140 fill.
AddHole( hole_linechain );
3160 const CFB::COMPOUND_FILE_ENTRY* aEntry )
3167 for(
int primitiveIndex = 0; reader.
GetRemainingBytes() >= 4; primitiveIndex++ )
3170 AARC6 elem( reader );
3221 THROW_IO_ERROR( wxString::Format(
"Tracks stream tries to access polygon id %u "
3222 "of %zu existing polygons.",
3228 if( zone ==
nullptr )
3276 for(
const auto& layerExpansionMask :
3279 int width = aElem.
width + ( layerExpansionMask.second * 2 );
3283 std::unique_ptr<PCB_SHAPE> arc = std::make_unique<PCB_SHAPE>(
m_board );
3287 arc->SetLayer( layerExpansionMask.first );
3296 const int aPrimitiveIndex,
const bool aIsBoardImport )
3300 wxFAIL_MSG( wxString::Format(
"Altium: Unexpected footprint Arc with polygon id %d",
3333 for(
const auto& layerExpansionMask :
3336 int width = aElem.
width + ( layerExpansionMask.second * 2 );
3340 std::unique_ptr<PCB_SHAPE> arc = std::make_unique<PCB_SHAPE>( aFootprint );
3344 arc->SetLayer( layerExpansionMask.first );
3376 std::unique_ptr<PCB_ARC> arc = std::make_unique<PCB_ARC>(
m_board, &shapeArc );
3378 arc->SetWidth( aElem.
width );
3379 arc->SetLayer( aLayer );
3387 std::unique_ptr<PCB_SHAPE> arc = std::make_unique<PCB_SHAPE>(
m_board);
3391 arc->SetLayer( aLayer );
3401 std::unique_ptr<PCB_SHAPE> arc = std::make_unique<PCB_SHAPE>( aFootprint );
3405 arc->SetLayer( aLayer );
3412 const CFB::COMPOUND_FILE_ENTRY* aEntry )
3422 APAD6 elem( reader );
3451 std::unique_ptr<FOOTPRINT> footprint = std::make_unique<FOOTPRINT>(
m_board );
3452 footprint->SetPosition( aElem.
position );
3463 std::unique_ptr<PAD>
pad = std::make_unique<PAD>( aFootprint );
3465 pad->SetNumber(
"" );
3476 pad->SetLayerSet(
LSET().AllCuMask() );
3495 cuLayers &=
m_board->GetEnabledLayers();
3501 if( altiumIdx < 32 )
3511 pad->Padstack().FrontOuterLayers().has_solder_mask =
true;
3515 pad->Padstack().FrontOuterLayers().has_solder_mask =
false;
3521 pad->Padstack().BackOuterLayers().has_solder_mask =
true;
3525 pad->Padstack().BackOuterLayers().has_solder_mask =
false;
3530 pad->SetLocked(
true );
3560 std::unique_ptr<PAD>
pad = std::make_unique<PAD>( aFootprint );
3583 msg.Printf(
_(
"Error loading library '%s':\n"
3584 "Footprint %s pad %s is not marked as multilayer, but is a TH pad." ),
3596 msg.Printf(
_(
"Footprint %s pad %s is not marked as multilayer, but is a TH pad." ),
3616 wxFAIL_MSG( wxT(
"Round holes are handled before the switch" ) );
3625 msg.Printf(
_(
"Loading library '%s':\n"
3626 "Footprint %s pad %s has a square hole (not yet supported)." ),
3638 msg.Printf(
_(
"Footprint %s pad %s has a square hole (not yet supported)." ),
3673 msg.Printf(
_(
"Loading library '%s':\n"
3674 "Footprint %s pad %s has a hole-rotation of %d degrees. "
3675 "KiCad only supports 90 degree rotations." ),
3688 msg.Printf(
_(
"Footprint %s pad %s has a hole-rotation of %d degrees. "
3689 "KiCad only supports 90 degree rotations." ),
3708 msg.Printf(
_(
"Error loading library '%s':\n"
3709 "Footprint %s pad %s uses a hole of unknown kind %d." ),
3722 msg.Printf(
_(
"Footprint %s pad %s uses a hole of unknown kind %d." ),
3742 auto setCopperGeometry =
3787 msg.Printf(
_(
"Error loading library '%s':\n"
3788 "Footprint %s pad %s uses an unknown pad shape." ),
3800 msg.Printf(
_(
"Footprint %s pad %s uses an unknown pad shape." ),
3851 switch( aElem.
layer )
3869 pad->SetLayer( klayer );
3870 pad->SetLayerSet(
LSET( { klayer } ) );
3881 pad->SetLayerSet(
pad->GetLayerSet().reset(
F_Mask ) );
3884 pad->SetLayerSet(
pad->GetLayerSet().reset(
B_Mask ) );
3902 msg.Printf(
_(
"Non-copper pad %s found on an Altium layer (%d) with no KiCad "
3903 "equivalent. It has been moved to KiCad layer Eco1_User." ),
3911 std::unique_ptr<PCB_SHAPE>
pad = std::make_unique<PCB_SHAPE>(
m_board );
3930 msg.Printf(
_(
"Loading library '%s':\n"
3931 "Footprint %s non-copper pad %s found on an Altium layer (%d) with no "
3932 "KiCad equivalent. It has been moved to KiCad layer Eco1_User." ),
3945 msg.Printf(
_(
"Footprint %s non-copper pad %s found on an Altium layer (%d) with no "
3946 "KiCad equivalent. It has been moved to KiCad layer Eco1_User." ),
3957 std::unique_ptr<PCB_SHAPE>
pad = std::make_unique<PCB_SHAPE>( aFootprint );
3973 msg.Printf(
_(
"Non-copper pad %s is connected to a net, which is not supported." ),
3984 msg.Printf(
_(
"Non-copper pad %s has a hole, which is not supported." ), aElem.
name );
3994 msg.Printf(
_(
"Non-copper pad %s has a complex pad stack (not yet supported)." ),
4027 int offset = ( std::min( aElem.
topsize.
x, aElem.
topsize.
y ) * cornerradius ) / 200;
4032 if( cornerradius < 100 )
4034 int offsetX = aElem.
topsize.
x / 2 - offset;
4035 int offsetY = aElem.
topsize.
y / 2 - offset;
4128 aShape->
SetPolyPoints( { p11 - chamferX, p11 - chamferY, p12 + chamferY, p12 - chamferX,
4129 p22 + chamferX, p22 + chamferY, p21 - chamferY, p21 + chamferX } );
4141 msg.Printf(
_(
"Non-copper pad %s uses an unknown pad shape." ), aElem.
name );
4151 const CFB::COMPOUND_FILE_ENTRY* aEntry )
4161 AVIA6 elem( reader );
4163 std::unique_ptr<PCB_VIA>
via = std::make_unique<PCB_VIA>(
m_board );
4175 if( start_layer_outside && end_layer_outside )
4179 else if( ( !start_layer_outside ) && ( !end_layer_outside ) )
4202 msg.Printf(
_(
"Via from layer %d to %d uses a non-copper layer, which is not "
4213 via->SetLayerPair( start_klayer, end_klayer );
4238 wxCHECK2_MSG( altiumLayer < 32,
break,
4239 "Altium importer expects 32 or fewer copper layers" );
4264 const CFB::COMPOUND_FILE_ENTRY* aEntry )
4271 for(
int primitiveIndex = 0; reader.
GetRemainingBytes() >= 4; primitiveIndex++ )
4302 msg.Printf( wxT(
"ATRACK6 stream tries to access polygon id %u "
4303 "of %u existing polygons; skipping it" ),
4304 static_cast<unsigned>( aElem.
polygon ),
4305 static_cast<unsigned>(
m_polygons.size() ) );
4314 if( zone ==
nullptr )
4364 int width = aElem.
width + ( layerExpansionMask.second * 2 );
4369 seg->SetStart( aElem.
start );
4370 seg->SetEnd( aElem.
end );
4372 seg->SetLayer( layerExpansionMask.first );
4381 const int aPrimitiveIndex,
4382 const bool aIsBoardImport )
4386 wxFAIL_MSG( wxString::Format(
"Altium: Unexpected footprint Track with polygon id %u",
4422 int width = aElem.
width + ( layerExpansionMask.second * 2 );
4425 std::unique_ptr<PCB_SHAPE> seg = std::make_unique<PCB_SHAPE>( aFootprint,
SHAPE_T::SEGMENT );
4427 seg->SetStart( aElem.
start );
4428 seg->SetEnd( aElem.
end );
4430 seg->SetLayer( layerExpansionMask.first );
4442 std::unique_ptr<PCB_TRACK> track = std::make_unique<PCB_TRACK>(
m_board );
4444 track->SetStart( aElem.
start );
4445 track->SetEnd( aElem.
end );
4446 track->SetWidth( aElem.
width );
4447 track->SetLayer( aLayer );
4456 seg->SetStart( aElem.
start );
4457 seg->SetEnd( aElem.
end );
4459 seg->SetLayer( aLayer );
4469 std::unique_ptr<PCB_SHAPE> seg = std::make_unique<PCB_SHAPE>( aFootprint,
SHAPE_T::SEGMENT );
4471 seg->SetStart( aElem.
start );
4472 seg->SetEnd( aElem.
end );
4474 seg->SetLayer( aLayer );
4481 const CFB::COMPOUND_FILE_ENTRY* aEntry )
4491 THROW_IO_ERROR( wxT(
"WideStrings6 stream is not fully parsed" ) );
4495 const CFB::COMPOUND_FILE_ENTRY* aEntry )
4553 std::unique_ptr<PCB_TEXTBOX> pcbTextbox = std::make_unique<PCB_TEXTBOX>(
m_board );
4554 std::unique_ptr<PCB_TEXT> pcbText = std::make_unique<PCB_TEXT>(
m_board );
4558 static const std::map<wxString, wxString> variableMap = {
4559 {
"LAYER_NAME",
"LAYER" },
4560 {
"PRINT_DATE",
"CURRENT_DATE"},
4569 item = pcbTextbox.get();
4570 text = pcbTextbox.get();
4581 text->SetText( kicadText );
4595 std::unique_ptr<PCB_TEXTBOX> fpTextbox = std::make_unique<PCB_TEXTBOX>( aFootprint );
4596 std::unique_ptr<PCB_TEXT> fpText = std::make_unique<PCB_TEXT>( aFootprint );
4611 item = &aFootprint->
Value();
4616 item = fpText.get();
4617 text = fpText.get();
4621 static const std::map<wxString, wxString> variableMap = {
4622 {
"DESIGNATOR",
"REFERENCE" },
4623 {
"COMMENT",
"VALUE" },
4624 {
"VALUE",
"ALTIUM_VALUE" },
4625 {
"LAYER_NAME",
"LAYER" },
4626 {
"PRINT_DATE",
"CURRENT_DATE"},
4631 item = fpTextbox.get();
4632 text = fpTextbox.get();
4645 text->SetText( kicadText );
4646 text->SetKeepUpright(
false );
4662 std::unique_ptr<PCB_BARCODE> pcbBarcode = std::make_unique<PCB_BARCODE>(
m_board );
4664 pcbBarcode->SetLayer( aLayer );
4665 pcbBarcode->SetPosition( aElem.
position );
4669 pcbBarcode->SetText( aElem.
text );
4679 pcbBarcode->AssembleBarcode();
4688 std::unique_ptr<PCB_BARCODE> fpBarcode = std::make_unique<PCB_BARCODE>( aFootprint );
4690 fpBarcode->SetLayer( aLayer );
4691 fpBarcode->SetPosition( aElem.
position );
4695 fpBarcode->SetText( aElem.
text );
4705 fpBarcode->AssembleBarcode();
4734 kicadMargin =
VECTOR2I( charWidth * 0.933, charHeight * 0.67 );
4736 kicadMargin =
VECTOR2I( charWidth * 0.808, charHeight * 0.844 );
4739 + kicadMargin * 2 - margin * 2 );
4741 kposition = kposition - kicadMargin + margin;
4759 switch( justification )
4783 msg.Printf(
_(
"Unknown textbox justification %d, aText %s" ), justification,
4803 int rectHeight = aElem.
height;
4806 rectWidth = -rectWidth;
4812 switch( justification )
4818 kposition.
y -= rectHeight;
4824 kposition.
y -= rectHeight / 2;
4834 kposition.
x += rectWidth / 2;
4835 kposition.
y -= rectHeight;
4841 kposition.
x += rectWidth / 2;
4842 kposition.
y -= rectHeight / 2;
4848 kposition.
x += rectWidth / 2;
4854 kposition.
x += rectWidth;
4855 kposition.
y -= rectHeight;
4861 kposition.
x += rectWidth;
4862 kposition.
y -= rectHeight / 2;
4868 kposition.
x += rectWidth;
4921 if( font->
GetName().Contains( wxS(
"Arial" ) ) )
4936 const CFB::COMPOUND_FILE_ENTRY* aEntry )
4994 const bool aIsBoardImport )
5036 fill->SetFilled(
true );
5037 fill->SetLayer( aLayer );
5040 fill->SetStart( aElem.
pos1 );
5041 fill->SetEnd( aElem.
pos2 );
5063 if( aLayer ==
F_Cu || aLayer ==
B_Cu )
5065 std::unique_ptr<PAD>
pad = std::make_unique<PAD>( aFootprint );
5068 padLayers.
set( aLayer );
5083 std::swap( width, height );
5086 pad->SetPosition( aElem.
pos1 / 2 + aElem.
pos2 / 2 );
5098 pad->SetPosition( anchorPos );
5109 aElem.
pos1.
y / 2 + aElem.
pos2.
y / 2 - anchorPos.
y );
5111 pad->AddPrimitivePoly(
F_Cu, shapePolys, 0,
true );
5115 pad->SetLayerSet( padLayers );
5121 std::unique_ptr<PCB_SHAPE> fill =
5124 fill->SetFilled(
true );
5125 fill->SetLayer( aLayer );
5128 fill->SetStart( aElem.
pos1 );
5129 fill->SetEnd( aElem.
pos2 );
5148 layerSet.
set( klayer );
5156 bool keepoutRestrictionVia = ( aKeepoutRestrictions & 0x01 ) != 0;
5157 bool keepoutRestrictionTrack = ( aKeepoutRestrictions & 0x02 ) != 0;
5158 bool keepoutRestrictionCopper = ( aKeepoutRestrictions & 0x04 ) != 0;
5159 bool keepoutRestrictionSMDPad = ( aKeepoutRestrictions & 0x08 ) != 0;
5160 bool keepoutRestrictionTHPad = ( aKeepoutRestrictions & 0x10 ) != 0;
5172 const uint8_t aKeepoutRestrictions )
5174 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>(
m_board );
5176 zone->SetIsRuleArea(
true );
5193 const uint8_t aKeepoutRestrictions )
5195 std::unique_ptr<ZONE> zone = std::make_unique<ZONE>( aFootprint );
5197 zone->SetIsRuleArea(
true );
5221 if( elems.first == elems.second )
5224 std::vector<std::pair<PCB_LAYER_ID, int>> layerExpansionPairs;
5226 for(
auto it = elems.first; it != elems.second; ++it )
5266 return layerExpansionPairs;
std::string FormatPath(const std::vector< std::string > &aVectorPath)
Helper for debug logging (vector -> string)
const ARULE6 * selectAltiumPolygonRule(const std::vector< ARULE6 > &aRulesByPriorityAsc)
Select the highest Altium-priority rule whose scope references polygons.
const uint16_t ALTIUM_NET_UNCONNECTED
const uint16_t ALTIUM_POLYGON_NONE
const uint16_t ALTIUM_POLYGON_BOARD
const int ALTIUM_COMPONENT_NONE
LIB_ID AltiumToKiCadLibID(const wxString &aLibName, const wxString &aLibReference)
wxString AltiumPcbSpecialStringsToKiCadStrings(const wxString &aString, const std::map< wxString, wxString > &aOverrides)
static bool IsLayerNameAssembly(const wxString &aName)
void HelperShapeLineChainFromAltiumVertices(SHAPE_LINE_CHAIN &aLine, const std::vector< ALTIUM_VERTICE > &aVertices)
double normalizeAngleDegrees(double Angle, double aMin, double aMax)
Normalize angle to be aMin < angle <= aMax angle is in degrees.
constexpr double BOLD_FACTOR
static bool IsLayerNameCourtyard(const wxString &aName)
bool IsAltiumLayerCopper(ALTIUM_LAYER aLayer)
bool IsAltiumLayerAPlane(ALTIUM_LAYER aLayer)
static bool IsLayerNameTopSide(const wxString &aName)
@ EXTENDPRIMITIVEINFORMATION
std::function< void(const ALTIUM_PCB_COMPOUND_FILE &, const CFB::COMPOUND_FILE_ENTRY *)> PARSE_FUNCTION_POINTER_fp
constexpr int ARC_HIGH_DEF
constexpr EDA_IU_SCALE pcbIUScale
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
#define DEFAULT_BOARD_THICKNESS_MM
@ BS_ITEM_TYPE_DIELECTRIC
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
size_t GetRemainingBytes() const
std::map< uint32_t, wxString > ReadWideStringTable()
size_t ReadAndSetSubrecordLength()
std::map< wxString, wxString > ReadProperties(std::function< std::map< wxString, wxString >(const std::string &)> handleBinaryData=[](const std::string &) { return std::map< wxString, wxString >();})
const CFB::CompoundFileReader & GetCompoundFileReader() const
const CFB::COMPOUND_FILE_ENTRY * FindStream(const std::vector< std::string > &aStreamPath) const
const std::pair< AMODEL, std::vector< char > > * GetLibModel(const wxString &aModelID) const
std::tuple< wxString, const CFB::COMPOUND_FILE_ENTRY * > FindLibFootprintDirName(const wxString &aFpUnicodeName)
PROGRESS_REPORTER * m_progressReporter
optional; may be nullptr
void ParseClasses6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
std::vector< PCB_DIM_RADIAL * > m_radialDimensions
const ARULE6 * GetRuleForPolygon(ALTIUM_RULE_KIND aKind) const
void ConvertArcs6ToFootprintItemOnLayer(FOOTPRINT *aFootprint, const AARC6 &aElem, PCB_LAYER_ID aLayer)
void ConvertTracks6ToBoardItem(const ATRACK6 &aElem, const int aPrimitiveIndex)
void ConvertTracks6ToFootprintItem(FOOTPRINT *aFootprint, const ATRACK6 &aElem, const int aPrimitiveIndex, const bool aIsBoardImport)
int m_highest_pour_index
Altium stores pour order across all layers.
void ConvertTexts6ToFootprintItemOnLayer(FOOTPRINT *aFootprint, const ATEXT6 &aElem, PCB_LAYER_ID aLayer)
std::map< ALTIUM_LAYER, PCB_LAYER_ID > m_layermap
void ConvertShapeBasedRegions6ToBoardItemOnLayer(const AREGION6 &aElem, PCB_LAYER_ID aLayer)
void ParseVias6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void HelperParseDimensions6Leader(const ADIMENSION6 &aElem)
wxString m_footprintName
for footprint library loading error reporting
std::vector< FOOTPRINT * > m_components
void HelperFillMechanicalLayerAssignments(const std::vector< ABOARD6_LAYER_STACKUP > &aStackup)
void ParseShapeBasedRegions6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
const ARULE6 * GetRuleDefault(ALTIUM_RULE_KIND aKind) const
void HelperParsePad6NonCopper(const APAD6 &aElem, PCB_LAYER_ID aLayer, PCB_SHAPE *aShape)
void ParseRegions6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
std::vector< PCB_LAYER_ID > GetKicadLayersToIterate(ALTIUM_LAYER aAltiumLayer) const
void ConvertShapeBasedRegions6ToFootprintItem(FOOTPRINT *aFootprint, const AREGION6 &aElem, const int aPrimitiveIndex)
void HelperPcpShapeAsFootprintKeepoutRegion(FOOTPRINT *aFootprint, const PCB_SHAPE &aShape, const ALTIUM_LAYER aAltiumLayer, const uint8_t aKeepoutRestrictions)
void ConvertArcs6ToBoardItem(const AARC6 &aElem, const int aPrimitiveIndex)
void ConvertShapeBasedRegions6ToFootprintItemOnLayer(FOOTPRINT *aFootprint, const AREGION6 &aElem, PCB_LAYER_ID aLayer, const int aPrimitiveIndex)
std::map< ALTIUM_LAYER, ZONE * > m_outer_plane
std::vector< int > m_altiumToKicadNetcodes
unsigned m_totalCount
for progress reporting
void ParseComponents6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void HelperPcpShapeAsBoardKeepoutRegion(const PCB_SHAPE &aShape, const ALTIUM_LAYER aAltiumLayer, const uint8_t aKeepoutRestrictions)
std::map< wxString, ALTIUM_EMBEDDED_MODEL_DATA > m_EmbeddedModels
void ConvertFills6ToBoardItemOnLayer(const AFILL6 &aElem, PCB_LAYER_ID aLayer)
std::vector< std::pair< PCB_LAYER_ID, int > > HelperGetSolderAndPasteMaskExpansions(const ALTIUM_RECORD aType, const int aPrimitiveIndex, const ALTIUM_LAYER aAltiumLayer)
void ConvertBarcodes6ToBoardItemOnLayer(const ATEXT6 &aElem, PCB_LAYER_ID aLayer)
void ConvertComponentBody6ToFootprintItem(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, FOOTPRINT *aFootprint, const ACOMPONENTBODY6 &aElem)
void HelperSetTextAlignmentAndPos(const ATEXT6 &aElem, EDA_TEXT *aEdaText)
void ParseBoard6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ConvertFills6ToFootprintItem(FOOTPRINT *aFootprint, const AFILL6 &aElem, const bool aIsBoardImport)
void ParseExtendedPrimitiveInformationData(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ParseFileHeader(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ConvertShapeBasedRegions6ToBoardItem(const AREGION6 &aElem)
void HelperCreateBoardOutline(const std::vector< ALTIUM_VERTICE > &aVertices)
std::map< ALTIUM_RULE_KIND, std::vector< ARULE6 > > m_rules
void ConvertVias6ToFootprintItem(FOOTPRINT *aFootprint, const AVIA6 &aElem)
void ParseRules6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void HelperSetZoneKeepoutRestrictions(ZONE &aZone, const uint8_t aKeepoutRestrictions)
void HelperParseDimensions6Linear(const ADIMENSION6 &aElem)
void ParseTracks6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
std::map< uint32_t, wxString > m_unicodeStrings
void ConvertTexts6ToBoardItem(const ATEXT6 &aElem)
void HelperParseDimensions6Center(const ADIMENSION6 &aElem)
void HelperParseDimensions6Radial(const ADIMENSION6 &aElem)
void ParseBoardRegionsData(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ParseArcs6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ConvertTexts6ToBoardItemOnLayer(const ATEXT6 &aElem, PCB_LAYER_ID aLayer)
void ConvertPads6ToFootprintItemOnCopper(FOOTPRINT *aFootprint, const APAD6 &aElem)
FOOTPRINT * ParseFootprint(ALTIUM_PCB_COMPOUND_FILE &altiumLibFile, const wxString &aFootprintName)
REPORTER * m_reporter
optional; may be nullptr
int GetNetCode(uint16_t aId) const
void ConvertTexts6ToEdaTextSettings(const ATEXT6 &aElem, EDA_TEXT &aEdaText)
wxString m_library
for footprint library loading error reporting
void ConvertPads6ToFootprintItemOnNonCopper(FOOTPRINT *aFootprint, const APAD6 &aElem)
void ConvertTexts6ToFootprintItem(FOOTPRINT *aFootprint, const ATEXT6 &aElem)
unsigned m_lastProgressCount
void ParseFills6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ConvertArcs6ToFootprintItem(FOOTPRINT *aFootprint, const AARC6 &aElem, const int aPrimitiveIndex, const bool aIsBoardImport)
void HelperParseDimensions6Datum(const ADIMENSION6 &aElem)
void ConvertPads6ToBoardItem(const APAD6 &aElem)
void ConvertFills6ToFootprintItemOnLayer(FOOTPRINT *aFootprint, const AFILL6 &aElem, PCB_LAYER_ID aLayer)
void ParseWideStrings6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void remapUnsureLayers(std::vector< ABOARD6_LAYER_STACKUP > &aStackup)
std::vector< ZONE * > m_polygons
void ParsePads6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ConvertArcs6ToPcbShape(const AARC6 &aElem, PCB_SHAPE *aShape)
void ConvertTracks6ToBoardItemOnLayer(const ATRACK6 &aElem, PCB_LAYER_ID aLayer)
void ConvertFills6ToBoardItem(const AFILL6 &aElem)
FOOTPRINT * HelperGetFootprint(uint16_t aComponent) const
LAYER_MAPPING_HANDLER m_layerMappingHandler
void ParsePolygons6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
PCB_LAYER_ID GetKicadLayer(ALTIUM_LAYER aAltiumLayer) const
void ParseComponentsBodies6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ConvertTracks6ToFootprintItemOnLayer(FOOTPRINT *aFootprint, const ATRACK6 &aElem, PCB_LAYER_ID aLayer)
void Parse(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const std::map< ALTIUM_PCB_DIR, std::string > &aFileMapping)
ALTIUM_PCB(BOARD *aBoard, PROGRESS_REPORTER *aProgressReporter, LAYER_MAPPING_HANDLER &aLayerMappingHandler, REPORTER *aReporter=nullptr, const wxString &aLibrary=wxEmptyString, const wxString &aFootprintName=wxEmptyString)
void ConvertArcs6ToBoardItemOnLayer(const AARC6 &aElem, PCB_LAYER_ID aLayer)
void ParseTexts6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
std::map< ALTIUM_RECORD, std::multimap< int, const AEXTENDED_PRIMITIVE_INFORMATION > > m_extendedPrimitiveInformationMaps
void ParseModelsData(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry, const std::vector< std::string > &aRootDir)
std::map< ALTIUM_LAYER, wxString > m_layerNames
void ConvertPads6ToBoardItemOnNonCopper(const APAD6 &aElem)
void HelperSetTextboxAlignmentAndPos(const ATEXT6 &aElem, PCB_TEXTBOX *aPcbTextbox)
void ConvertBarcodes6ToFootprintItemOnLayer(FOOTPRINT *aFootprint, const ATEXT6 &aElem, PCB_LAYER_ID aLayer)
void ParseNets6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void ConvertPads6ToFootprintItem(FOOTPRINT *aFootprint, const APAD6 &aElem)
const ARULE6 * GetRule(ALTIUM_RULE_KIND aKind, const wxString &aName) const
void ParseDimensions6Data(const ALTIUM_PCB_COMPOUND_FILE &aAltiumPcbFile, const CFB::COMPOUND_FILE_ENTRY *aEntry)
void HelperSetZoneLayers(ZONE &aZone, const ALTIUM_LAYER aAltiumLayer)
static wxString ReadString(const std::map< wxString, wxString > &aProps, const wxString &aKey, const wxString &aDefault)
BASE_SET & set(size_t pos)
Container for design settings for a BOARD object.
void SetGridOrigin(const VECTOR2I &aOrigin)
const VECTOR2I & GetGridOrigin() const
void SetAuxOrigin(const VECTOR2I &aOrigin)
const VECTOR2I & GetAuxOrigin() const
BOARD_STACKUP & GetStackupDescriptor()
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual void SetIsKnockout(bool aKnockout)
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual LSET BoardLayerSet() const
Return the LSET for the board that this item resides on.
Manage layers needed to make a physical board.
void RemoveAll()
Delete all items in list and clear the list.
const std::vector< BOARD_STACKUP_ITEM * > & GetList() const
int BuildBoardThicknessFromStackup() const
void BuildDefaultStackupList(const BOARD_DESIGN_SETTINGS *aSettings, int aActiveCopperLayersCount=0)
Create a default stackup, according to the current BOARD_DESIGN_SETTINGS settings.
Information pertinent to a Pcbnew printed circuit board.
constexpr coord_type GetY() const
constexpr size_type GetWidth() const
constexpr coord_type GetX() const
constexpr size_type GetHeight() const
bool IsHorizontal() const
bool IsCardinal90() const
EDA_ANGLE GetArcAngle() const
void SetCenter(const VECTOR2I &aCenter)
virtual void SetFilled(bool aFlag)
void SetStart(const VECTOR2I &aStart)
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
void SetShape(SHAPE_T aShape)
void SetEnd(const VECTOR2I &aEnd)
void SetArcAngleAndEnd(const EDA_ANGLE &aAngle, bool aCheckNegativeAngle=false)
Set the end point from the angle center and start.
void SetPolyPoints(const std::vector< VECTOR2I > &aPoints)
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
int GetTextHeight() const
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
void SetTextPos(const VECTOR2I &aPoint)
KIFONT::FONT * GetFont() const
void SetMirrored(bool isMirrored)
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
void SetBoldFlag(bool aBold)
Set only the bold flag, without changing the font.
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
GR_TEXT_V_ALIGN_T GetVertJustify() const
virtual void SetTextAngle(const EDA_ANGLE &aAngle)
void SetItalic(bool aItalic)
Set the text to be italic - this will also update the font if needed.
void SetFont(KIFONT::FONT *aFont)
void SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
wxString GetEmbeddedFileLink(const EMBEDDED_FILE &aFile) const
Return the link for an embedded file.
EMBEDDED_FILE * AddFile(const wxFileName &aName, bool aOverwrite)
Load a file from disk and adds it to the collection.
static RETURN_CODE CompressAndEncode(EMBEDDED_FILE &aFile)
Take data from the #decompressedData buffer and compresses it using ZSTD into the #compressedEncodedD...
VECTOR3D m_Offset
3D model offset (mm)
VECTOR3D m_Rotation
3D model rotation (degrees)
wxString m_Filename
The 3D shape filename in 3D library.
FONT is an abstract base class for both outline and stroke fonts.
static FONT * GetFont(const wxString &aFontName=wxEmptyString, bool aBold=false, bool aItalic=false, const std::vector< wxString > *aEmbeddedFiles=nullptr, bool aForDrawingSheet=false)
virtual bool IsStroke() const
const wxString & GetName() const
virtual bool IsOutline() const
LAYER_RANGE_ITERATOR begin() const
A logical library item identifier and consists of various portions much like a URI.
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllBoardTechMask()
Return a mask holding board technical layers (no CU layer) on both side.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
static const LSET & UserMask()
static LSET UserDefinedLayersMask(int aUserDefinedLayerCount=MAX_USER_DEFINED_LAYERS)
Return a mask with the requested number of user defined layers.
static const LSET & InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
Handle the data for a net.
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
A PADSTACK defines the characteristics of a single or multi-layer pad, in the IPC sense of the word.
void SetRoundRectRadiusRatio(double aRatio, PCB_LAYER_ID aLayer)
void SetChamferRatio(double aRatio, PCB_LAYER_ID aLayer)
void SetShape(PAD_SHAPE aShape, PCB_LAYER_ID aLayer)
void SetChamferPositions(int aPositions, PCB_LAYER_ID aLayer)
@ NORMAL
Shape is the same on all layers.
@ CUSTOM
Shapes can be defined on arbitrary layers.
@ FRONT_INNER_BACK
Up to three shapes can be defined (F_Cu, inner copper layers, B_Cu)
void SetSize(const VECTOR2I &aSize, PCB_LAYER_ID aLayer)
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
static constexpr PCB_LAYER_ID INNER_LAYERS
! The layer identifier to use for "inner layers" on top/inner/bottom padstacks
static LSET PTHMask()
layer set for a through hole pad
static LSET UnplatedHoleMask()
layer set for a mechanical unplated through hole pad
static LSET SMDMask()
layer set for a SMD pad on Front layer
virtual VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
A radial dimension indicates either the radius or diameter of an arc or circle.
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
void SetPosition(const VECTOR2I &aPos) override
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void SetStroke(const STROKE_PARAMS &aStroke) override
VECTOR2I GetPosition() const override
void SetBorderEnabled(bool enabled)
void SetMarginTop(int aTop)
void SetMarginLeft(int aLeft)
void SetMarginBottom(int aBottom)
void SetTextAngle(const EDA_ANGLE &aAngle) override
void SetMarginRight(int aRight)
A progress reporter interface for use in multi-threaded environments.
A pure virtual class used to derive REPORTER objects from.
OPT_VECTOR2I Intersect(const SEG &aSeg, bool aIgnoreEndpoints=false, bool aLines=false) const
Compute intersection point of segment (this) with segment aSeg.
const VECTOR2I & GetArcMid() const
const VECTOR2I & GetP1() const
const VECTOR2I & GetP0() const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
const SHAPE_ARC & Arc(size_t aArc) const
void SetClosed(bool aClosed)
Mark the line chain as closed (i.e.
int PointCount() const
Return the number of points (vertices) in this line chain.
ssize_t ArcIndex(size_t aSegment) const
Return the arc index for the given segment index.
SEG Segment(int aIndex) const
Return a copy of the aIndex-th segment in the line chain.
int NextShape(int aPointIndex) const
Return the vertex index of the next shape in the chain, or -1 if aPointIndex is the last shape.
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
bool IsArcStart(size_t aIndex) const
Represent a set of closed polygons.
void Rotate(const EDA_ANGLE &aAngle, const VECTOR2I &aCenter={ 0, 0 }) override
Rotate all vertices by a given angle.
void BooleanAdd(const SHAPE_POLY_SET &b)
Perform boolean polyset union.
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index.
void Inflate(int aAmount, CORNER_STRATEGY aCornerStrategy, int aMaxError, bool aSimplify=false)
Perform outline inflation/deflation.
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)
int AddHole(const SHAPE_LINE_CHAIN &aHole, int aOutline=-1)
Adds a new hole to the given outline (default: last) and returns its index.
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.
void Move(const VECTOR2I &aVector) override
void Fracture(bool aSimplify=true)
Convert a set of polygons with holes to a single outline with "slits"/"fractures" connecting the oute...
Simple container to manage line stroke parameters.
constexpr extended_type Cross(const VECTOR2< T > &aVector) const
Compute cross product of self with aVector.
double Distance(const VECTOR2< extended_type > &aVector) const
Compute the distance between two vectors.
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
constexpr VECTOR2< T > Perpendicular() const
Compute the perpendicular vector.
VECTOR2< T > Resize(T aNewLength) const
Return a vector of the same direction, but length specified in aNewLength.
Handle a list of polygons defining a copper zone.
void SetNeedRefill(bool aNeedRefill)
void SetDoNotAllowPads(bool aEnable)
SHAPE_POLY_SET * GetFill(PCB_LAYER_ID aLayer)
void SetDoNotAllowTracks(bool aEnable)
void SetFilledPolysList(PCB_LAYER_ID aLayer, const SHAPE_POLY_SET &aPolysList)
Set the list of filled polygons.
void SetIsFilled(bool isFilled)
bool HasFilledPolysForLayer(PCB_LAYER_ID aLayer) const
void SetLayerSet(const LSET &aLayerSet) override
void SetDoNotAllowVias(bool aEnable)
void SetDoNotAllowFootprints(bool aEnable)
void SetDoNotAllowZoneFills(bool aEnable)
static int GetDefaultHatchPitch()
@ CHAMFER_ACUTE_CORNERS
Acute angles are chamfered.
static constexpr EDA_ANGLE ANGLE_90
static constexpr EDA_ANGLE ANGLE_45
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
bool m_ImportSkipComponentBodies
Skip importing component bodies when importing some format files, such as Altium.
#define THROW_IO_ERROR(msg)
macro which captures the "call site" values of FILE_, __FUNCTION & LINE
#define MAX_USER_DEFINED_LAYERS
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
size_t CopperLayerToOrdinal(PCB_LAYER_ID aLayer)
Converts KiCad copper layer enum to an ordinal between the front and back layers.
PCB_LAYER_ID
A quick note on layer IDs:
void for_all_pairs(_InputIterator __first, _InputIterator __last, _Function __f)
Apply a function to every possible pair of elements of a sequence.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
@ SMD
Smd pad, appears on the solder paste layer (default)
@ PTH
Plated through hole pad.
BARCODE class definition.
std::function< std::map< wxString, PCB_LAYER_ID >(const std::vector< INPUT_LAYER_DESC > &)> LAYER_MAPPING_HANDLER
Pointer to a function that takes a map of source and KiCad layers and returns a re-mapped version.
std::optional< VECTOR2I > OPT_VECTOR2I
wxString NotSpecifiedPrm()
uint8_t keepoutrestrictions
wxString dielectricmaterial
std::vector< ABOARD6_LAYER_STACKUP > stackup
std::vector< ALTIUM_VERTICE > board_vertices
std::vector< wxString > names
wxString sourceHierachicalPath
wxString sourcefootprintlibrary
wxString sourcedesignator
std::vector< VECTOR2I > textPoint
ALTIUM_DIMENSION_KIND kind
std::vector< VECTOR2I > referencePoint
uint8_t keepoutrestrictions
std::vector< ABOARD6_LAYER_STACKUP > stackup
std::vector< char > m_data
ALTIUM_PAD_SHAPE inner_shape[29]
ALTIUM_PAD_HOLE_SHAPE holeshape
ALTIUM_PAD_SHAPE_ALT alt_shape[32]
int32_t soldermaskexpansionmanual
std::unique_ptr< APAD6_SIZE_AND_SHAPE > sizeAndShape
ALTIUM_PAD_SHAPE topshape
ALTIUM_MODE pastemaskexpansionmode
ALTIUM_MODE soldermaskexpansionmode
ALTIUM_PAD_SHAPE botshape
ALTIUM_PAD_SHAPE midshape
int32_t pastemaskexpansionmanual
int32_t pad_to_die_length
std::vector< ALTIUM_VERTICE > vertices
ALTIUM_POLYGON_HATCHSTYLE hatchstyle
uint8_t keepoutrestrictions
std::vector< ALTIUM_VERTICE > outline
std::vector< std::vector< ALTIUM_VERTICE > > holes
ALTIUM_CONNECT_STYLE polygonconnectStyle
int planeclearanceClearance
int32_t polygonconnectReliefconductorwidth
int32_t polygonconnectAirgapwidth
uint32_t text_offset_width
uint32_t textbox_rect_height
ALTIUM_TEXT_POSITION textbox_rect_justification
uint32_t textbox_rect_width
uint32_t margin_border_width
bool isJustificationValid
ALTIUM_BARCODE_TYPE barcode_type
ALTIUM_TEXT_TYPE fonttype
uint8_t keepoutrestrictions
int32_t soldermask_expansion_front
bool soldermask_expansion_manual
int32_t soldermask_expansion_back
uint32_t diameter_by_layer[32]
std::vector< char > decompressedData
std::vector< std::string > header
thread_pool & GetKiCadThreadPool()
Get a reference to the current thread pool.
BS::priority_thread_pool thread_pool
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
double DEG2RAD(double deg)
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
VECTOR2< int32_t > VECTOR2I
VECTOR3< double > VECTOR3D
@ THERMAL
Use thermal relief for pads.
@ NONE
Pads are not covered.
@ FULL
pads are covered by copper