68#include <wx/filename.h>
69#include <wx/wfstream.h>
70#include <wx/txtstrm.h>
71#include <boost/ptr_container/ptr_map.hpp>
103#define FIRST_COPPER_LAYER 0
104#define LAYER_N_BACK 0
119#define LAYER_N_FRONT 15
120#define LAST_COPPER_LAYER LAYER_N_FRONT
122#define FIRST_NON_COPPER_LAYER 16
123#define ADHESIVE_N_BACK 16
124#define ADHESIVE_N_FRONT 17
125#define SOLDERPASTE_N_BACK 18
126#define SOLDERPASTE_N_FRONT 19
127#define SILKSCREEN_N_BACK 20
128#define SILKSCREEN_N_FRONT 21
129#define SOLDERMASK_N_BACK 22
130#define SOLDERMASK_N_FRONT 23
136#define LAST_NON_COPPER_LAYER 28
140#define LAYER_BACK (1 << LAYER_N_BACK)
141#define LAYER_2 (1 << LAYER_N_2)
142#define LAYER_3 (1 << LAYER_N_3)
143#define LAYER_4 (1 << LAYER_N_4)
144#define LAYER_5 (1 << LAYER_N_5)
145#define LAYER_6 (1 << LAYER_N_6)
146#define LAYER_7 (1 << LAYER_N_7)
147#define LAYER_8 (1 << LAYER_N_8)
148#define LAYER_9 (1 << LAYER_N_9)
149#define LAYER_10 (1 << LAYER_N_10)
150#define LAYER_11 (1 << LAYER_N_11)
151#define LAYER_12 (1 << LAYER_N_12)
152#define LAYER_13 (1 << LAYER_N_13)
153#define LAYER_14 (1 << LAYER_N_14)
154#define LAYER_15 (1 << LAYER_N_15)
155#define LAYER_FRONT (1 << LAYER_N_FRONT)
156#define ADHESIVE_LAYER_BACK (1 << ADHESIVE_N_BACK)
157#define ADHESIVE_LAYER_FRONT (1 << ADHESIVE_N_FRONT)
158#define SOLDERPASTE_LAYER_BACK (1 << SOLDERPASTE_N_BACK)
159#define SOLDERPASTE_LAYER_FRONT (1 << SOLDERPASTE_N_FRONT)
160#define SILKSCREEN_LAYER_BACK (1 << SILKSCREEN_N_BACK)
161#define SILKSCREEN_LAYER_FRONT (1 << SILKSCREEN_N_FRONT)
162#define SOLDERMASK_LAYER_BACK (1 << SOLDERMASK_N_BACK)
163#define SOLDERMASK_LAYER_FRONT (1 << SOLDERMASK_N_FRONT)
164#define DRAW_LAYER (1 << DRAW_N)
165#define COMMENT_LAYER (1 << COMMENT_N)
166#define ECO1_LAYER (1 << ECO1_N)
167#define ECO2_LAYER (1 << ECO2_N)
168#define EDGE_LAYER (1 << EDGE_N)
173#define ALL_NO_CU_LAYERS 0x1FFF0000
174#define ALL_CU_LAYERS 0x0000FFFF
175#define FRONT_TECH_LAYERS (SILKSCREEN_LAYER_FRONT | SOLDERMASK_LAYER_FRONT \
176 | ADHESIVE_LAYER_FRONT | SOLDERPASTE_LAYER_FRONT)
177#define BACK_TECH_LAYERS (SILKSCREEN_LAYER_BACK | SOLDERMASK_LAYER_BACK \
178 | ADHESIVE_LAYER_BACK | SOLDERPASTE_LAYER_BACK)
179#define ALL_TECH_LAYERS (FRONT_TECH_LAYERS | BACK_TECH_LAYERS)
180#define BACK_LAYERS (LAYER_BACK | BACK_TECH_LAYERS)
181#define FRONT_LAYERS (LAYER_FRONT | FRONT_TECH_LAYERS)
183#define ALL_USER_LAYERS (DRAW_LAYER | COMMENT_LAYER | ECO1_LAYER | ECO2_LAYER )
185#define NO_LAYERS 0x00000000
187#define PCB_LEGACY_TEXT_is_REFERENCE 0
188#define PCB_LEGACY_TEXT_is_VALUE 1
189#define PCB_LEGACY_TEXT_is_DIVERS 2
192#define PCB_LEGACY_INTERNAL_UNIT 10000
195#define SZ( x ) (sizeof(x)-1)
201static bool inline isSpace(
int c ) {
return strchr(
delims, c ) !=
nullptr; }
203#define MASK(x) (1<<(x))
208 const unsigned PROGRESS_DELTA = 250;
231#define TESTLINE( x ) ( !strncasecmp( line, x, SZ( x ) ) && isSpace( line[SZ( x )] ) )
234#define TESTSUBSTR( x ) ( !strncasecmp( line, x, SZ( x ) ) )
238#define READLINE( rdr ) rdr->ReadLine()
244static inline char* ReadLine(
LINE_READER* rdr,
const char* caller )
248 const char* line = rdr->
Line();
251 if( !strcmp(
"loadSETUP", caller ) && !strcmp(
"$EndSETUP\n", line ) )
259#define READLINE( rdr ) ReadLine( rdr, __FUNCTION__ )
265 if( !strcmp(
"L", horizontal ) )
268 if( !strcmp(
"R", horizontal ) )
276 if( !strcmp(
"T", vertical ) )
279 if( !strcmp(
"B", vertical ) )
307 return aLegacyLayerNum ==
LAYER_N_FRONT || aLegacyLayerNum < aCu_Count;
314 unsigned old = aLayerNum;
332 newid = cu_count - 1 - old;
333 wxASSERT( newid >= 0 );
375 aMask &= ~ALL_CU_LAYERS;
378 for(
int i=0; aMask; ++i, aMask >>= 1 )
394static inline int intParse(
const char*
next,
const char** out =
nullptr )
397 return (
int) strtol(
next, (
char**) out, 10 );
407static inline long hexParse(
const char*
next,
const char** out =
nullptr )
410 return strtol(
next, (
char**) out, 16 );
444 char* line = reader.
Line();
453 if( !strncasecmp( line,
"$MODULE", strlen(
"$MODULE" ) ) )
470 const std::map<std::string, UTF8>* aProperties,
PROJECT* aProject )
476 std::unique_ptr<BOARD> boardDeleter;
484 boardDeleter = std::make_unique<BOARD>();
541 std::unique_ptr<FOOTPRINT> footprint = std::make_unique<FOOTPRINT>(
m_board );
544 std::string fpName =
StrPurge( line +
SZ(
"$MODULE" ) );
550 if( !fpName.empty() )
551 fpid.
Parse( fpName,
true );
553 footprint->SetFPID( fpid );
556 m_board->
Add( footprint.release(), ADD_MODE::APPEND );
558 else if(
TESTLINE(
"$DRAWSEGMENT" ) )
578 else if(
TESTLINE(
"$CZONE_OUTLINE" ) )
599 else if(
TESTLINE(
"$SHEETDESCR" ) )
636 char* line = aReader->
Line();
644 sscanf( line,
"PCBNEW-BOARD Version %d", &ver );
652 if( ver > LEGACY_BOARD_FILE_VERSION )
654 THROW_IO_ERROR( wxString::Format(
_(
"File '%s' has an unrecognized version: %d." ),
667 bool saw_LayerCount =
false;
676 data = strtok_r( line +
SZ(
"Units"),
delims, &saveptr );
678 if( !strcmp( data,
"mm" ) )
685 int tmp =
intParse( line +
SZ(
"LayerCount" ) );
693 saw_LayerCount =
true;
695 else if(
TESTLINE(
"EnabledLayers" ) )
697 if( !saw_LayerCount )
712 else if(
TESTLINE(
"VisibleLayers" ) )
718 if( !saw_LayerCount )
730 if( !saw_LayerCount )
737 saw_LayerCount =
true;
740 else if(
TESTLINE(
"BoardThickness" ) )
765 else if(
TESTLINE(
"$EndGENERAL" ) )
789 char* sname = strtok_r( line +
SZ(
"Sheet" ),
delims, &data );
797 m_error.Printf(
_(
"Unknown sheet type '%s' on line: %d." ),
803 char* width = strtok_r(
nullptr,
delims, &data );
804 char* height = strtok_r(
nullptr,
delims, &data );
805 char* orient = strtok_r(
nullptr,
delims, &data );
810 if( width && height )
822 if( orient && !strcmp( orient,
"portrait" ) )
895 else if(
TESTLINE(
"$EndSHEETDESCR" ) )
910 std::shared_ptr<NETCLASS> defaultNetclass = bds.
m_NetSettings->GetDefaultNetclass();
927 plot_opts.
Parse( &parser );
939 else if(
TESTLINE(
"AuxiliaryAxisOrg" ) )
950 int layer_num =
intParse( line +
SZ(
"Layer[" ), &data );
953 data = strtok_r( (
char*) data+1,
delims, &saveptr );
960 data = strtok_r(
nullptr,
delims, &saveptr );
972 defaultNetclass->SetTrackWidth( tmp );
974 else if(
TESTLINE(
"TrackWidthList" ) )
979 else if(
TESTLINE(
"TrackClearence" ) )
982 defaultNetclass->SetClearance( tmp );
984 else if(
TESTLINE(
"TrackMinWidth" ) )
989 else if(
TESTLINE(
"ZoneClearence" ) )
994 else if(
TESTLINE(
"Zone_45_Only" ) )
998 else if(
TESTLINE(
"DrawSegmWidth" ) )
1003 else if(
TESTLINE(
"EdgeSegmWidth" ) )
1008 else if(
TESTLINE(
"ViaMinSize" ) )
1013 else if(
TESTLINE(
"MicroViaMinSize" ) )
1018 else if(
TESTLINE(
"ViaSizeList" ) )
1023 BIU diameter =
biuParse( line +
SZ(
"ViaSizeList" ), &data );
1025 data = strtok_r( (
char*) data,
delims, (
char**) &data );
1034 defaultNetclass->SetViaDiameter( tmp );
1039 defaultNetclass->SetViaDrill( tmp );
1041 else if(
TESTLINE(
"ViaMinDrill" ) )
1046 else if(
TESTLINE(
"MicroViaSize" ) )
1049 defaultNetclass->SetuViaDiameter( tmp );
1051 else if(
TESTLINE(
"MicroViaDrill" ) )
1054 defaultNetclass->SetuViaDrill( tmp );
1056 else if(
TESTLINE(
"MicroViaMinDrill" ) )
1061 else if(
TESTLINE(
"MicroViasAllowed" ) )
1065 else if(
TESTLINE(
"TextPcbWidth" ) )
1070 else if(
TESTLINE(
"TextPcbSize" ) )
1077 else if(
TESTLINE(
"EdgeModWidth" ) )
1083 else if(
TESTLINE(
"TextModWidth" ) )
1089 else if(
TESTLINE(
"TextModSize" ) )
1109 else if(
TESTLINE(
"Pad2MaskClearance" ) )
1114 else if(
TESTLINE(
"SolderMaskMinWidth" ) )
1119 else if(
TESTLINE(
"Pad2PasteClearance" ) )
1124 else if(
TESTLINE(
"Pad2PasteClearanceRatio" ) )
1126 double ratio = atof( line +
SZ(
"Pad2PasteClearanceRatio" ) );
1130 else if(
TESTLINE(
"GridOrigin" ) )
1137 else if(
TESTLINE(
"VisibleElements" ) )
1143 int visibleElements =
hexParse( line +
SZ(
"VisibleElements" ) );
1149 for(
size_t i = 0; i < visibles.size(); i++ )
1150 visibles.
set( i, visibleElements & ( 1u << i ) );
1190 for(
unsigned ii = 1; ii < designSettings.
m_TrackWidthList.size() - 1; ii++ )
1211 if(
TESTSUBSTR(
"D" ) && strchr(
"SCAP", line[1] ) )
1249 int orient =
intParse( data, &data );
1250 int layer_num =
intParse( data, &data );
1253 [[maybe_unused]]
long edittime =
hexParse( data, &data );
1255 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
1257 data = strtok_r( (
char*) data+1,
delims, (
char**) &data );
1261 if( data && data[0] ==
'F' )
1264 if( data && data[1] ==
'P' )
1274 char* uuid = strtok_r( (
char*) line +
SZ(
"Sc" ),
delims, (
char**) &data );
1286 data = line +
SZ(
"At" );
1288 if( strstr( data,
"SMD" ) )
1290 else if( strstr( data,
"VIRTUAL" ) )
1300 data = strtok_r( line +
SZ(
"AR" ),
delims, (
char**) &data );
1318 else if(
TESTLINE(
".SolderPasteRatio" ) )
1320 double tmp = atof( line +
SZ(
".SolderPasteRatio" ) );
1334 else if(
TESTLINE(
".SolderPaste" ) )
1339 else if(
TESTLINE(
".SolderMask" ) )
1344 else if(
TESTLINE(
".LocalClearance" ) )
1349 else if(
TESTLINE(
".ZoneConnection" ) )
1351 int tmp =
intParse( line +
SZ(
".ZoneConnection" ) );
1354 else if(
TESTLINE(
".ThermalWidth" ) )
1359 else if(
TESTLINE(
".ThermalGap" ) )
1364 else if(
TESTLINE(
"$EndMODULE" ) )
1370 wxString msg = wxString::Format(
_(
"Missing '$EndMODULE' for MODULE '%s'." ),
1378 std::unique_ptr<PAD>
pad = std::make_unique<PAD>( aFootprint );
1394 char mypadnumber[50];
1396 data = line +
SZ(
"Sh" ) + 1;
1399 data = data +
ReadDelimitedText( mypadnumber, data,
sizeof( mypadnumber ) ) + 1;
1404 unsigned char padchar = (
unsigned char) *data++;
1415 case 'C': padshape =
static_cast<int>( PAD_SHAPE::CIRCLE );
break;
1416 case 'R': padshape =
static_cast<int>( PAD_SHAPE::RECTANGLE );
break;
1417 case 'O': padshape =
static_cast<int>( PAD_SHAPE::OVAL );
break;
1418 case 'T': padshape =
static_cast<int>( PAD_SHAPE::TRAPEZOID );
break;
1420 m_error.Printf(
_(
"Unknown padshape '%c=0x%02x' on line: %d of footprint: '%s'." ),
1433 const unsigned char* cp = (
unsigned char*) mypadnumber;
1446 pad->SetNumber( padNumber );
1450 pad->SetOrientation( orient );
1456 BIU drill_y = drill_x;
1462 data = strtok_r( (
char*) data,
delims, &saveptr );
1466 if( data[0] ==
'O' )
1468 drShape = PAD_DRILL_SHAPE::OBLONG;
1470 data = strtok_r(
nullptr,
delims, &saveptr );
1473 data = strtok_r(
nullptr,
delims, &saveptr );
1478 pad->SetDrillShape( drShape );
1480 pad->SetDrillSize(
VECTOR2I( drill_x, drill_y ) );
1489 data = strtok_r( line +
SZ(
"At" ),
delims, &saveptr );
1491 if( !strcmp( data,
"SMD" ) )
1492 attribute = PAD_ATTRIB::SMD;
1493 else if( !strcmp( data,
"CONN" ) )
1494 attribute = PAD_ATTRIB::CONN;
1495 else if( !strcmp( data,
"HOLE" ) )
1496 attribute = PAD_ATTRIB::NPTH;
1498 attribute = PAD_ATTRIB::PTH;
1500 strtok_r(
nullptr,
delims, &saveptr );
1501 data = strtok_r(
nullptr,
delims, &saveptr );
1506 pad->SetAttribute( attribute );
1513 int netcode =
intParse( line +
SZ(
"Ne" ), &data );
1535 pad->SetFPRelativePosition( pos );
1540 pad->SetPadToDieLength( tmp );
1542 else if(
TESTLINE(
".SolderMask" ) )
1545 pad->SetLocalSolderMaskMargin( tmp );
1547 else if(
TESTLINE(
".SolderPasteRatio" ) )
1549 double tmp = atof( line +
SZ(
".SolderPasteRatio" ) );
1550 pad->SetLocalSolderPasteMarginRatio( tmp );
1552 else if(
TESTLINE(
".SolderPaste" ) )
1555 pad->SetLocalSolderPasteMargin( tmp );
1557 else if(
TESTLINE(
".LocalClearance" ) )
1560 pad->SetLocalClearance( tmp );
1562 else if(
TESTLINE(
".ZoneConnection" ) )
1564 int tmp =
intParse( line +
SZ(
".ZoneConnection" ) );
1567 else if(
TESTLINE(
".ThermalWidth" ) )
1570 pad->SetThermalSpokeWidth( tmp );
1572 else if(
TESTLINE(
".ThermalGap" ) )
1575 pad->SetThermalGap( tmp );
1579 if(
pad->GetSizeX() > 0 &&
pad->GetSizeY() > 0 )
1581 aFootprint->
Add(
pad.release() );
1585 wxLogError(
_(
"Invalid zero-sized pad ignored in\nfile: %s" ),
1604 case 'S': shape = SHAPE_T::SEGMENT;
break;
1605 case 'C': shape = SHAPE_T::CIRCLE;
break;
1606 case 'A': shape = SHAPE_T::ARC;
break;
1607 case 'P': shape = SHAPE_T::POLY;
break;
1609 m_error.Printf(
_(
"Unknown PCB_SHAPE type:'%c=0x%02x' on line %d of footprint '%s'." ),
1615 std::unique_ptr<PCB_SHAPE> dwg = std::make_unique<PCB_SHAPE>( aFootprint, shape );
1636 dwg->SetCenter(
VECTOR2I( center0_x, center0_y ) );
1637 dwg->SetStart(
VECTOR2I( start0_x, start0_y ) );
1638 dwg->SetArcAngleAndEnd( angle,
true );
1642 case SHAPE_T::SEGMENT:
1643 case SHAPE_T::CIRCLE:
1654 dwg->SetStart(
VECTOR2I( start0_x, start0_y ) );
1655 dwg->SetEnd(
VECTOR2I( end0_x, end0_y ) );
1666 int ptCount =
intParse( data, &data );
1671 dwg->SetStart(
VECTOR2I( start0_x, start0_y ) );
1672 dwg->SetEnd(
VECTOR2I( end0_x, end0_y ) );
1674 std::vector<VECTOR2I> pts;
1675 pts.reserve( ptCount );
1677 for(
int ii = 0; ii < ptCount; ++ii )
1694 pts.emplace_back( x, y );
1697 dwg->SetPolyPoints( pts );
1712 dwg->SetStroke(
STROKE_PARAMS( width, LINE_STYLE::SOLID ) );
1717 aFootprint->
Add( dwg.release() );
1724 const char* txt_end;
1732 int type =
intParse( line+1, &data );
1747 m_field.Replace( wxT(
"%V" ), wxT(
"${VALUE}" ) );
1748 m_field.Replace( wxT(
"%R" ), wxT(
"${REFERENCE}" ) );
1755 char* mirror = strtok_r( (
char*) data,
delims, (
char**) &data );
1756 char* hide = strtok_r(
nullptr,
delims, (
char**) &data );
1757 char* tmp = strtok_r(
nullptr,
delims, (
char**) &data );
1761 char* italic = strtok_r(
nullptr,
delims, (
char**) &data );
1763 char* hjust = strtok_r( (
char*) txt_end,
delims, (
char**) &data );
1764 char* vjust = strtok_r(
nullptr,
delims, (
char**) &data );
1778 aText->
SetVisible( !(hide && *hide ==
'I') );
1780 aText->
SetItalic( italic && *italic ==
'I' );
1833 else if(
TESTLINE(
"$EndSHAPE3D" ) )
1835 aFootprint->
Models().push_back( t3D );
1853 std::unique_ptr<PCB_SHAPE> dseg = std::make_unique<PCB_SHAPE>(
m_board );
1864 int shape =
intParse( line +
SZ(
"Po" ), &data );
1874 dseg->SetShape(
static_cast<SHAPE_T>( shape ) );
1875 dseg->SetFilled(
false );
1876 dseg->SetStroke(
STROKE_PARAMS( width, LINE_STYLE::SOLID ) );
1878 if( dseg->GetShape() == SHAPE_T::ARC )
1880 dseg->SetCenter(
VECTOR2I( start_x, start_y ) );
1881 dseg->SetStart(
VECTOR2I( end_x, end_y ) );
1885 dseg->SetStart(
VECTOR2I( start_x, start_y ) );
1886 dseg->SetEnd(
VECTOR2I( end_x, end_y ) );
1894 data = strtok_r( line +
SZ(
"De" ),
delims, &saveptr );
1896 for(
int i = 0; data; ++i, data = strtok_r(
nullptr,
delims, &saveptr ) )
1919 if( dseg->GetShape() == SHAPE_T::ARC )
1920 dseg->SetArcAngleAndEnd( angle );
1925 const_cast<KIID&
>( dseg->m_Uuid ) =
KIID( data );
1939 dseg->SetBezierC1(
VECTOR2I( x, y ) );
1946 dseg->SetBezierC2(
VECTOR2I( x, y ) );
1954 else if(
TESTLINE(
"$EndDRAWSEGMENT" ) )
1956 m_board->
Add( dseg.release(), ADD_MODE::APPEND );
1987 netCode =
intParse( line +
SZ(
"Na" ), &data );
1991 if( net ==
nullptr )
1998 THROW_IO_ERROR( wxT(
"Two net definitions in '$EQUIPOT' block" ) );
2001 else if(
TESTLINE(
"$EndEQUIPOT" ) )
2097 int layer_num =
intParse( line +
SZ(
"De" ), &data );
2098 int notMirrored =
intParse( data, &data );
2099 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
2100 char* style = strtok_r(
nullptr,
delims, (
char**) &data );
2101 char* hJustify = strtok_r(
nullptr,
delims, (
char**) &data );
2102 char* vJustify = strtok_r(
nullptr,
delims, (
char**) &data );
2106 pcbtxt->
SetItalic( !strcmp( style,
"Italic" ) );
2132 else if(
TESTLINE(
"$EndTEXTPCB" ) )
2156 if( line[0] ==
'$' )
2169 data = strtok_r( (
char*) data,
delims, (
char**) &data );
2199 int layer_num =
intParse( line +
SZ(
"De" ), &data );
2200 int type =
intParse( data, &data );
2201 int net_code =
intParse( data, &data );
2202 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
2205 intParse( data, (
const char**) &data );
2217 wxFAIL_MSG( wxT(
"Segment type unknown" ) );
2237 via->SetViaType( viatype );
2241 via->SetDrillDefault();
2243 via->SetDrill( drill );
2245 if(
via->GetViaType() == VIATYPE::THROUGH )
2257 via->SetLayerPair( front, back );
2306 std::shared_ptr<NETCLASS> nc = std::make_shared<NETCLASS>( wxEmptyString );
2317 netname, nc->GetName() );
2322 nc->SetClearance( tmp );
2324 else if(
TESTLINE(
"TrackWidth" ) )
2327 nc->SetTrackWidth( tmp );
2332 nc->SetViaDiameter( tmp );
2337 nc->SetViaDrill( tmp );
2342 nc->SetuViaDiameter( tmp );
2347 nc->SetuViaDrill( tmp );
2359 else if(
TESTLINE(
"$EndNCLASS" ) )
2368 m_error.Printf(
_(
"Duplicate NETCLASS name '%s'." ), nc->GetName() );
2386 std::unique_ptr<ZONE> zc = std::make_unique<ZONE>(
m_board );
2389 bool endContour =
false;
2413 zc->AppendCorner(
VECTOR2I( x, y ), holeIndex );
2423 char* uuid = strtok_r( (
char*) line +
SZ(
"ZInfo" ),
delims, (
char**) &data );
2424 int netcode =
intParse( data, &data );
2429 const_cast<KIID&
>( zc->m_Uuid ) =
KIID( uuid );
2434 zc->BOARD_CONNECTED_ITEM::SetNetCode(
getNetCode( netcode ) );
2438 int layer_num =
intParse( line +
SZ(
"ZLayer" ) );
2445 char* hopt = strtok_r( (
char*) data,
delims, (
char**) &data );
2449 m_error.Printf(
_(
"Bad ZAux for CZONE_CONTAINER \"%s\"" ),
2450 zc->GetNetname().GetData() );
2456 case 'N': outline_hatch = ZONE_BORDER_DISPLAY_STYLE::NO_HATCH;
break;
2457 case 'E': outline_hatch = ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_EDGE;
break;
2458 case 'F': outline_hatch = ZONE_BORDER_DISPLAY_STYLE::DIAGONAL_FULL;
break;
2460 m_error.Printf(
_(
"Bad ZAux for CZONE_CONTAINER \"%s\"" ),
2461 zc->GetNetname().GetData() );
2467 else if(
TESTLINE(
"ZSmoothing" ) )
2470 int smoothing =
intParse( line +
SZ(
"ZSmoothing" ), &data );
2475 m_error.Printf(
_(
"Bad ZSmoothing for CZONE_CONTAINER \"%s\"" ),
2476 zc->GetNetname().GetData() );
2480 zc->SetCornerSmoothingType( smoothing );
2481 zc->SetCornerRadius( cornerRadius );
2486 zc->SetIsRuleArea(
true );
2487 zc->SetDoNotAllowPads(
false );
2488 zc->SetDoNotAllowFootprints(
false );
2491 token = strtok_r( line +
SZ(
"ZKeepout" ),
delims, (
char**) &data );
2495 if( !strcmp( token,
"tracks" ) )
2497 token = strtok_r(
nullptr,
delims, (
char**) &data );
2498 zc->SetDoNotAllowTracks( token && *token ==
'N' );
2500 else if( !strcmp( token,
"vias" ) )
2502 token = strtok_r(
nullptr,
delims, (
char**) &data );
2503 zc->SetDoNotAllowVias( token && *token ==
'N' );
2505 else if( !strcmp( token,
"copperpour" ) )
2507 token = strtok_r(
nullptr,
delims, (
char**) &data );
2508 zc->SetDoNotAllowCopperPour( token && *token ==
'N' );
2511 token = strtok_r(
nullptr,
delims, (
char**) &data );
2517 int fillmode =
intParse( line +
SZ(
"ZOptions" ), &data );
2519 char fillstate = data[1];
2520 BIU thermalReliefGap =
biuParse( data += 2 , &data );
2527 wxLogWarning(
_(
"The legacy segment zone fill mode is no longer supported.\n"
2528 "Zone fills will be converted on a best-effort basis." ) );
2534 zc->SetFillMode( ZONE_FILL_MODE::POLYGONS );
2535 zc->SetIsFilled( fillstate ==
'S' );
2536 zc->SetThermalReliefGap( thermalReliefGap );
2537 zc->SetThermalReliefSpokeWidth( thermalReliefCopperBridge );
2539 else if(
TESTLINE(
"ZClearance" ) )
2542 BIU clearance =
biuParse( line +
SZ(
"ZClearance" ), &data );
2543 char* padoption = strtok_r( (
char*) data,
delims, (
char**) &data );
2546 switch( *padoption )
2548 case 'I': popt = ZONE_CONNECTION::FULL;
break;
2549 case 'T': popt = ZONE_CONNECTION::THERMAL;
break;
2550 case 'H': popt = ZONE_CONNECTION::THT_THERMAL;
break;
2551 case 'X': popt = ZONE_CONNECTION::NONE;
break;
2553 m_error.Printf(
_(
"Bad ZClearance padoption for CZONE_CONTAINER \"%s\"" ),
2554 zc->GetNetname().GetData() );
2558 zc->SetLocalClearance( clearance );
2559 zc->SetPadConnection( popt );
2561 else if(
TESTLINE(
"ZMinThickness" ) )
2564 zc->SetMinThickness( thickness );
2568 int priority =
intParse( line +
SZ(
"ZPriority" ) );
2569 zc->SetAssignedPriority( priority );
2571 else if(
TESTLINE(
"$POLYSCORNERS" ) )
2576 bool makeNewOutline =
true;
2580 if(
TESTLINE(
"$endPOLYSCORNERS" ) )
2587 if( makeNewOutline )
2590 polysList.
Append( x, y );
2593 bool end_contour =
intParse( data, &data );
2596 makeNewOutline = end_contour;
2599 zc->SetFilledPolysList( zc->GetFirstLayer(), polysList );
2601 else if(
TESTLINE(
"$FILLSEGMENTS" ) )
2605 if(
TESTLINE(
"$endFILLSEGMENTS" ) )
2615 else if(
TESTLINE(
"$endCZONE_OUTLINE" ) )
2619 if( zc->GetIsRuleArea() )
2622 if( zc->GetMinThickness() > 0 )
2629 CORNER_STRATEGY::ROUND_ALL_CORNERS,
2632 zc->SetFilledPolysList( layer, inflatedFill );
2638 if( zc->GetNumCorners() > 2 )
2640 if( !zc->IsOnCopperLayer() )
2642 zc->SetFillMode( ZONE_FILL_MODE::POLYGONS );
2663 std::unique_ptr<PCB_DIM_ALIGNED> dim = std::make_unique<PCB_DIM_ALIGNED>(
m_board,
2676 dim->UpdateHeight( crossBarF, crossBarO );
2678 m_board->
Add( dim.release(), ADD_MODE::APPEND );
2691 int shape =
intParse( line +
SZ(
"De" ), (
const char**) &data );
2692 int layer_num =
intParse( data, &data );
2693 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
2696 const_cast<KIID&
>( dim->m_Uuid ) =
KIID( uuid );
2706 dim->SetOverrideText(
From_UTF8( buf ) );
2707 dim->SetOverrideTextEnabled(
true );
2708 dim->SetUnitsFormat( DIM_UNITS_FORMAT::NO_SUFFIX );
2709 dim->SetAutoUnits();
2719 char* mirror = strtok_r( (
char*) data,
delims, (
char**) &data );
2721 dim->SetTextPos(
VECTOR2I( pos_x, pos_y ) );
2722 dim->SetTextSize(
VECTOR2I( width, height ) );
2723 dim->SetMirrored( mirror && *mirror ==
'0' );
2724 dim->SetTextThickness( thickn );
2725 dim->SetTextAngle( orient );
2736 dim->SetLineThickness( width );
2737 crossBarO =
VECTOR2I( crossBarOx, crossBarOy );
2738 crossBarF =
VECTOR2I( crossBarFx, crossBarFy );
2749 dim->SetStart(
VECTOR2I( featureLineDOx, featureLineDOy ) );
2760 dim->SetEnd(
VECTOR2I( featureLineGOx, featureLineGOy ) );
2814 int shape =
intParse( line +
SZ(
"Po" ), &data );
2815 int layer_num =
intParse( data, &data );
2820 char* uuid = strtok_r( (
char*) data,
delims, (
char**) &data );
2828 VECTOR2I( pos_x, pos_y ), size, width );
2845 double fval = strtod( aValue, &nptr );
2849 m_error.Printf(
_(
"Invalid floating point number in file: '%s'\nline: %d, offset: %d" ),
2857 if( aValue == nptr )
2859 m_error.Printf(
_(
"Missing floating point number in file: '%s'\nline: %d, offset: %d" ),
2884 double fval = strtod( aValue, &nptr );
2888 m_error.Printf(
_(
"Invalid floating point number in file: '%s'\nline: %d, offset: %d" ),
2896 if( aValue == nptr )
2898 m_error.Printf(
_(
"Missing floating point number in file: '%s'\nline: %d, offset: %d" ),
2976 static long long GetTimestamp(
const wxString& aLibPath );
2992 m_lib_path( aLibraryPath ),
2994 m_cache_dirty( true ),
2995 m_cache_timestamp( 0 )
3010 return wxFileName( aLibPath ).GetModificationTime().GetValue().GetValue();
3039 if( !
TESTLINE(
"PCBNEW-LibModule-V1" ) )
3042 while( ( line = aReader->
ReadLine() ) !=
nullptr )
3046 const char* units = strtok_r( line +
SZ(
"Units" ),
delims, &data );
3048 if( !strcmp( units,
"mm" ) )
3066 char* line = aReader->
Line();
3074 while( ( line = aReader->
ReadLine() ) !=
nullptr )
3087 }
while( ( line = aReader->
ReadLine() ) !=
nullptr );
3095 char* line = aReader->
Line();
3102 std::unique_ptr<FOOTPRINT> fp_ptr = std::make_unique<FOOTPRINT>(
m_owner->
m_board );
3104 std::string footprintName =
StrPurge( line +
SZ(
"$MODULE" ) );
3111 fp_ptr->SetFPID(
LIB_ID( wxEmptyString, footprintName ) );
3133 FOOTPRINT_MAP::const_iterator it =
m_footprints.find( footprintName );
3139 wxFAIL_MSG( wxT(
"error doing cache insert using guaranteed unique name" ) );
3146 bool nameOK =
false;
3152 std::string newName = footprintName;
3155 snprintf( buf,
sizeof(buf),
"%d", version++ );
3168 wxFAIL_MSG( wxT(
"error doing cache insert using guaranteed unique "
3176 }
while( ( line = aReader->
ReadLine() ) !=
nullptr );
3199 bool aBestEfforts,
const std::map<std::string, UTF8>* aProperties )
3204 init( aProperties );
3212 errorMsg = ioe.
What();
3219 aFootprintNames.Add(
From_UTF8( footprint.first.c_str() ) );
3221 if( !errorMsg.IsEmpty() && !aBestEfforts )
3227 const wxString& aFootprintName,
bool aKeepUUID,
3228 const std::map<std::string, UTF8>* aProperties )
3232 init( aProperties );
3237 FOOTPRINT_MAP::const_iterator it = footprints.find(
TO_UTF8( aFootprintName ) );
3239 if( it == footprints.end() )
3246 copy->SetParent(
nullptr );
3252 const std::map<std::string, UTF8>* aProperties )
3254 wxFileName fn = aLibraryPath;
3256 if( !fn.FileExists() )
3261 if( wxRemove( aLibraryPath ) )
3263 THROW_IO_ERROR( wxString::Format(
_(
"Footprint library '%s' cannot be deleted." ),
3264 aLibraryPath.GetData() ) );
3295 m_progressReporter( nullptr ),
3296 m_lastProgressLine( 0 ),
3298 m_reader( nullptr ),
constexpr int ARC_HIGH_DEF
constexpr EDA_IU_SCALE pcbIUScale
LAYER_T
The allowed types of layers, same as Specctra DSN spec.
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
BASE_SET & set(size_t pos)
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
Container for design settings for a BOARD object.
std::shared_ptr< NET_SETTINGS > m_NetSettings
void SetGridOrigin(const VECTOR2I &aOrigin)
std::unique_ptr< PAD > m_Pad_Master
void SetAuxOrigin(const VECTOR2I &aOrigin)
int m_SolderMaskExpansion
void SetDefaultZoneSettings(const ZONE_SETTINGS &aSettings)
int m_TextThickness[LAYER_CLASS_COUNT]
std::vector< int > m_TrackWidthList
int m_LineThickness[LAYER_CLASS_COUNT]
void SetBoardThickness(int aThickness)
double m_SolderPasteMarginRatio
ZONE_SETTINGS & GetDefaultZoneSettings()
VECTOR2I m_TextSize[LAYER_CLASS_COUNT]
std::vector< VIA_DIMENSION > m_ViasDimensionsList
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
void SetFPRelativePosition(const VECTOR2I &aPos)
Information pertinent to a Pcbnew printed circuit board.
void SetPlotOptions(const PCB_PLOT_PARAMS &aOptions)
bool m_LegacyDesignSettingsLoaded
True if the legacy board design settings were loaded from a file.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
void SetFileName(const wxString &aFileName)
void SetEnabledLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
bool SetLayerName(PCB_LAYER_ID aLayer, const wxString &aLayerName)
Changes the name of the layer given by aLayer.
void SetPageSettings(const PAGE_INFO &aPageSettings)
void SetVisibleLayers(LSET aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings changes the bit-mask of vis...
bool m_LegacyNetclassesLoaded
True if netclasses were loaded from the file.
void SetCopperLayerCount(int aCount)
bool SetLayerType(PCB_LAYER_ID aLayer, LAYER_T aLayerType)
Change the type of the layer given by aLayer.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
void SetTitleBlock(const TITLE_BLOCK &aTitleBlock)
void SetVisibleElements(const GAL_SET &aMask)
A proxy function that calls the correspondent function in m_BoardSettings.
void SetFileFormatVersionAtLoad(int aVersion)
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true)
virtual const wxString & GetText() const
Return the string associated with the text object.
void SetTextPos(const VECTOR2I &aPoint)
void SetMirrored(bool isMirrored)
void SetVertJustify(GR_TEXT_V_ALIGN_T aType)
GR_TEXT_H_ALIGN_T GetHorizJustify() const
virtual void SetVisible(bool aVisible)
void SetTextThickness(int aWidth)
The TextThickness is that set by the user.
virtual void SetText(const wxString &aText)
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 SetHorizJustify(GR_TEXT_H_ALIGN_T aType)
A LINE_READER that reads from an open file.
void Rewind()
Rewind the file and resets the line number back to zero.
char * ReadLine() override
Read a line of text into the buffer and increments the line number counter.
VECTOR3D m_Offset
3D model offset (mm)
VECTOR3D m_Rotation
3D model rotation (degrees)
VECTOR3D m_Scale
3D model scaling factor (dimensionless)
wxString m_Filename
The 3D shape filename in 3D library.
Helper for storing and iterating over GAL_LAYER_IDs.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
A logical library item identifier and consists of various portions much like a URI.
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
const UTF8 & GetLibItemName() const
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
virtual char * ReadLine()=0
Read a line of text into the buffer and increments the line number counter.
virtual const wxString & GetSource() const
Returns the name of the source of the lines in an abstract sense.
virtual unsigned LineNumber() const
Return the line number of the last line read from this LINE_READER.
char * Line() const
Return a pointer to the last line that was read in.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
LSET is a set of PCB_LAYER_IDs.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
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 ...
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
Describe the page size and margins of a paper page on which to eventually print or plot.
void SetPortrait(bool aIsPortrait)
Rotate the paper page 90 degrees.
static const wxChar Custom[]
"User" defined page type
void SetHeightMils(double aHeightInMils)
void SetWidthMils(double aWidthInMils)
bool SetType(const wxString &aStandardPageDescriptionName, bool aIsPortrait=false)
Set the name of the page type and also the sizes and margins commonly associated with that type name.
A #PLUGIN derivation which could possibly be put into a DLL/DSO.
wxString m_error
for throwing exceptions
EDA_ANGLE degParse(const char *aValue, const char **nptrptr=nullptr)
Parse an ASCII decimal floating point value which is certainly an angle in tenths of a degree.
void init(const std::map< std::string, UTF8 > *aProperties)
initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
void loadMODULE_TEXT(PCB_TEXT *aText)
bool CanReadFootprint(const wxString &aFileName) const override
Checks if this PCB_IO can read a footprint from specified file or directory.
PROGRESS_REPORTER * m_progressReporter
may be NULL, no ownership
void loadFP_SHAPE(FOOTPRINT *aFootprint)
std::vector< int > m_netCodes
net codes mapping for boards being loaded
long long GetLibraryTimestamp(const wxString &aLibraryPath) const override
Generate a timestamp representing all the files in the library (including the library directory).
void loadAllSections(bool doAppend)
bool m_showLegacySegmentZoneWarning
unsigned m_lineCount
for progress reporting
void cacheLib(const wxString &aLibraryPath)
we only cache one footprint library for now, this determines which one.
void loadPAD(FOOTPRINT *aFootprint)
double biuToDisk
convert from BIUs to disk engineering units with this scale factor
static LSET leg_mask2new(int cu_count, unsigned aMask)
void loadTrackList(int aStructType)
Read a list of segments (Tracks and Vias, or Segzones)
void FootprintEnumerate(wxArrayString &aFootprintNames, const wxString &aLibraryPath, bool aBestEfforts, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Return a list of footprint names contained within the library at aLibraryPath.
unsigned m_lastProgressLine
LINE_READER * m_reader
no ownership here.
bool DeleteLibrary(const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Delete an existing library and returns true, or if library does not exist returns false,...
void SetReader(LINE_READER *aReader)
double diskToBiu
convert from disk engineering units to BIUs
BOARD * LoadBoard(const wxString &aFileName, BOARD *aAppendToMe, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr) override
Load information from some input file format that this PCB_IO implementation knows about into either ...
BIU biuParse(const char *aValue, const char **nptrptr=nullptr)
Parse an ASCII decimal floating point value and scales it into a BIU according to the current value o...
void loadZONE_CONTAINER()
wxString m_field
reused to stuff FOOTPRINT fields.
void checkpoint()
Converts net code using the mapping table if available, otherwise returns unchanged net code.
void loadFOOTPRINT(FOOTPRINT *aFootprint)
static int getVersion(LINE_READER *aReader)
void load3D(FOOTPRINT *aFootprint)
bool CanReadBoard(const wxString &aFileName) const override
Checks if this PCB_IO can read the specified board file.
int getNetCode(int aNetCode)
bool IsLibraryWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
int m_loading_format_version
which BOARD_FORMAT_VERSION am I Load()ing?
static PCB_LAYER_ID leg_layer2new(int cu_count, int aLayerNum)
FOOTPRINT * FootprintLoad(const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PC...
A base class that BOARD loading and saving plugins should derive from.
BOARD * m_board
The board BOARD being worked on, no ownership here.
virtual bool CanReadFootprint(const wxString &aFileName) const
Checks if this PCB_IO can read a footprint from specified file or directory.
virtual bool CanReadBoard(const wxString &aFileName) const
Checks if this PCB_IO can read the specified board file.
const std::map< std::string, UTF8 > * m_props
Properties passed via Save() or Load(), no ownership, may be NULL.
The parser for PCB_PLOT_PARAMS.
Parameters and options when plotting/printing a board.
std::optional< bool > GetLegacyPlotViaOnMaskLayer() const
void Parse(PCB_PLOT_PARAMS_PARSER *aParser)
void SetEnd(const VECTOR2I &aEnd)
void SetPosition(const VECTOR2I &aPos) override
virtual void SetWidth(int aWidth)
virtual bool KeepRefreshing(bool aWait=false)=0
Update the UI (if any).
virtual void Report(const wxString &aMessage)=0
Display aMessage in the progress bar dialog.
virtual void SetCurrentProgress(double aProgress)=0
Set the progress value to aProgress (0..1).
Container for project specific data.
Represent a set of closed polygons.
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 NewOutline()
Creates a new empty polygon in the set and returns its index.
void InflateWithLinkedHoles(int aFactor, CORNER_STRATEGY aCornerStrategy, int aMaxError)
Perform outline inflation/deflation, using round corners.
Simple container to manage line stroke parameters.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
void SetRevision(const wxString &aRevision)
void SetComment(int aIdx, const wxString &aComment)
void SetTitle(const wxString &aTitle)
void SetCompany(const wxString &aCompany)
void SetDate(const wxString &aDate)
Set the date field, and defaults to the current time and date.
Read lines of text from another LINE_READER but only returns non-comment lines and non-blank lines wi...
char * ReadLine() override
Read a line of text into the buffer and increments the line number counter.
ZONE_SETTINGS handles zones parameters.
static int GetDefaultHatchPitch()
This file is part of the common library.
#define FIRST_COPPER_LAYER
static bool isSpace(char cc)
Test for whitespace.
void ignore_unused(const T &)
#define THROW_IO_ERROR(msg)
PCB_LAYER_ID
A quick note on layer IDs:
This file contains miscellaneous commonly used macros and functions.
PAD_DRILL_SHAPE
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
PAD_ATTRIB
The set of pad shapes, used with PAD::{Set,Get}Attribute().
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
std::map< wxString, FOOTPRINT * > FOOTPRINT_MAP
static GR_TEXT_V_ALIGN_T vertJustify(const char *vertical)
static int intParse(const char *next, const char **out=nullptr)
Parse an ASCII integer string with possible leading whitespace into an integer and updates the pointe...
#define SILKSCREEN_N_BACK
#define PCB_LEGACY_TEXT_is_DIVERS
#define SZ(x)
Get the length of a string constant, at compile time.
static const char delims[]
#define TESTSUBSTR(x)
C sub-string compare test for a specific length of characters.
#define LAST_NON_COPPER_LAYER
PCB_IO_KICAD_LEGACY::BIU BIU
#define SOLDERMASK_N_FRONT
#define SOLDERMASK_N_BACK
bool is_leg_copperlayer_valid(int aCu_Count, int aLegacyLayerNum)
#define SOLDERPASTE_N_BACK
int layerMaskCountSet(LEG_MASK aMask)
Count the number of set layers in the mask.
static long hexParse(const char *next, const char **out=nullptr)
Parse an ASCII hex integer string with possible leading whitespace into a long integer and updates th...
#define SOLDERPASTE_N_FRONT
#define PCB_LEGACY_TEXT_is_REFERENCE
static GR_TEXT_H_ALIGN_T horizJustify(const char *horizontal)
#define SILKSCREEN_N_FRONT
#define TESTLINE(x)
C string compare test for a specific length of characters.
boost::ptr_map< std::string, FOOTPRINT > FOOTPRINT_MAP
#define FIRST_NON_COPPER_LAYER
#define PCB_LEGACY_TEXT_is_VALUE
static bool isSpace(int c)
#define FOOTPRINT_LIBRARY_HEADER_CNT
#define FOOTPRINT_LIBRARY_HEADER
wxString ConvertToNewOverbarNotation(const wxString &aOldStr)
Convert the old ~...~ overbar notation to the new ~{...} one.
wxString From_UTF8(const char *cstring)
int ReadDelimitedText(wxString *aDest, const char *aSource)
Copy bytes from aSource delimited string segment to aDest wxString.
bool ReplaceIllegalFileNameChars(std::string *aName, int aReplaceChar)
Checks aName for illegal file name characters.
char * StrPurge(char *text)
Remove leading and training spaces, tabs and end of line chars in text.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
static LAYER_T ParseType(const char *aType)
Convert a string to a LAYER_T.
The footprint portion of the PLUGIN API, and only for the PCB_IO_KICAD_LEGACY, so therefore is privat...
PCB_IO_KICAD_LEGACY * m_owner
void ReadAndVerifyHeader(LINE_READER *aReader)
long long m_cache_timestamp
void LoadModules(LINE_READER *aReader)
FOOTPRINT_MAP m_footprints
static long long GetTimestamp(const wxString &aLibPath)
LP_CACHE(PCB_IO_KICAD_LEGACY *aOwner, const wxString &aLibraryPath)
void SkipIndex(LINE_READER *aReader)
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ NOT_USED
the 3d code uses this value
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
VECTOR2< int32_t > VECTOR2I
ZONE_BORDER_DISPLAY_STYLE
Zone border styles.
ZONE_CONNECTION
How pads are covered by copper in zone.