264 const double keep = aKeep * contrast;
265 const double share = keep < 1.0 ? ( 1.0 - contrast ) / ( 1.0 - keep ) : 0.0;
267 aToward =
COLOR4D( background.
r * share, background.
g * share, background.
b * share, 1.0 );
318 int originalLayer = aLayer;
344 const PAD*
pad =
dynamic_cast<const PAD*
>( aItem );
346 int holeLayer = aLayer;
353 if( !copperLayers.empty() )
354 annularRingLayer = copperLayers.
Seq().front();
358 annularRingLayer =
F_Cu;
387 const PAD*
pad =
static_cast<const PAD*
>( aItem );
390 if(
pcbconfig()->m_Display.m_UseViaColorForNormalTHPadstacks
434 if( visibleLayers.any() )
435 aLayer = visibleLayers.
Seq().back();
455 return itemLayerIter->second;
495 netColor = ii->second;
547 switch( originalLayer )
551 const PAD*
pad =
static_cast<const PAD*
>( aItem );
553 if(
pad->IsOnLayer( primary ) && !
pad->FlashLayer( primary ) )
574 if(
via->GetLayerSet().test( primary ) == 0 )
587 if( !
via->FlashLayer( primary ) )
621 if(
via->GetLayerSet().test( primary ) == 0 )
656 color = color.
Mix( it->second, dim_factor_Edge_Cuts );
670 color = color.
Mix( backgroundColor, dim_factor_Edge_Cuts );
686 const BOARD* board =
via->GetBoard();
693 if( (
via->GetLayerSet() & visibleLayers ).none() )
751 if( aActualThickness == 0 )
754 return aActualThickness;
824 switch( item->
Type() )
831 draw(
static_cast<const PCB_ARC*
>( item ), aLayer );
838 draw(
static_cast<const PCB_VIA*
>( item ), aLayer );
846 draw(
static_cast<const PAD*
>( item ), aLayer );
899 draw(
static_cast<const ZONE*
>( item ), aLayer );
945 m_gal->SetIsFill(
false );
946 m_gal->SetIsStroke(
true );
953 m_gal->SetLineWidth( 1 );
979 int track_width = aTrack->
GetWidth();
989 if( netinfo->GetNetChain() ==
m_pcbSettings.m_highlightedNetChain )
1033 m_gal->SetStrokeColor( color );
1034 m_gal->SetIsStroke(
true );
1035 m_gal->SetIsFill(
false );
1037 m_gal->DrawSegment( start,
end, track_width );
1052 m_gal->SetIsFill(
false );
1053 m_gal->SetIsStroke(
true );
1054 m_gal->SetStrokeColor( color );
1061 const wxString& aNetName )
const
1073 int nameSize = (int) aNetName.size() * aSeg.
GetWidth();
1080 double penWidth = textSize / 12.0;
1088 if(
end.y == start.
y )
1093 else if(
end.x == start.
x )
1104 num_names = std::max( num_names,
KiROUND( aSeg.
GetSeg().
Length() / ( M_SQRT2 * min_size ) ) );
1107 m_gal->SetIsStroke(
true );
1108 m_gal->SetIsFill(
false );
1109 m_gal->SetStrokeColor( aColor );
1110 m_gal->SetLineWidth( penWidth );
1111 m_gal->SetFontBold(
false );
1112 m_gal->SetFontItalic(
false );
1113 m_gal->SetFontUnderlined(
false );
1114 m_gal->SetTextMirrored(
false );
1115 m_gal->SetGlyphSize(
VECTOR2D( textSize * 0.55, textSize * 0.55 ) );
1119 int divisions = num_names + 1;
1121 for(
int ii = 1; ii < divisions; ++ii )
1123 VECTOR2I textPosition = start + segV * ( (double) ii / divisions );
1125 if( viewport.
Contains( textPosition ) )
1126 m_gal->BitmapText( aNetName, textPosition, textOrientation );
1142 if( netinfo->GetNetChain() ==
m_pcbSettings.m_highlightedNetChain )
1175 if( netname.IsEmpty() )
1187 int nameSize = (int) netname.size() * width;
1197 textOrientation = -textOrientation;
1200 double textSize = width;
1201 double penWidth = textSize / 12.0;
1203 m_gal->SetIsStroke(
true );
1204 m_gal->SetIsFill(
false );
1205 m_gal->SetStrokeColor( color );
1206 m_gal->SetLineWidth( penWidth );
1207 m_gal->SetFontBold(
false );
1208 m_gal->SetFontItalic(
false );
1209 m_gal->SetFontUnderlined(
false );
1210 m_gal->SetTextMirrored(
false );
1211 m_gal->SetGlyphSize(
VECTOR2D( textSize * 0.55, textSize * 0.55 ) );
1215 m_gal->BitmapText( netname, midPt, textOrientation );
1224 m_gal->SetStrokeColor( color );
1225 m_gal->SetFillColor( color );
1226 m_gal->SetIsStroke( outline_mode );
1227 m_gal->SetIsFill( not outline_mode );
1253 m_gal->SetIsFill(
false );
1254 m_gal->SetIsStroke(
true );
1255 m_gal->SetStrokeColor( color );
1272 m_gal->SetIsFill(
false );
1273 m_gal->SetIsStroke(
true );
1275 m_gal->DrawPolygon( cornerBuffer );
1282 m_gal->SetIsFill(
false );
1283 m_gal->SetIsStroke(
true );
1296 m_gal->SetIsFill(
false );
1297 m_gal->SetIsStroke(
true );
1298 m_gal->SetStrokeColor(
COLOR4D( 0.3, 0.2, 0.5, 1.0 ) );
1300 for(
int idx = 1; idx < arcSpine.
PointCount(); idx++ )
1309 aVia->
LayerPair( &layerTop, &layerBottom );
1323 switch(
static_cast<const BOARD_ITEM*
>( aItem )->Type() )
1327 const PAD*
pad =
static_cast<const PAD*
>( aItem );
1337 return pad->GetDrillSize().x <= 0 || (
pad->GetSecondaryDrillSizeX() <= 0 &&
pad->GetTertiaryDrillSizeX() <= 0 );
1350 return via->GetSecondaryDrillSize().value_or( 0 ) <= 0 &&
via->GetTertiaryDrillSize().value_or( 0 ) <= 0;
1390 if( netinfo->GetNetChain() ==
m_pcbSettings.m_highlightedNetChain )
1404 aVia->
LayerPair( &layerTop, &layerBottom );
1419 if( !showNets && !showLayers )
1423 double size = aVia->
GetWidth( currentLayer );
1426 if( size > maxSize )
1430 m_gal->Translate( position );
1433 m_gal->ResetTextAttributes();
1436 m_gal->SetFontBold(
false );
1437 m_gal->SetFontItalic(
false );
1438 m_gal->SetFontUnderlined(
false );
1439 m_gal->SetTextMirrored(
false );
1441 m_gal->SetIsStroke(
true );
1442 m_gal->SetIsFill(
false );
1456 switch( topLayerId )
1458 case F_Cu: topLayer = 1;
break;
1460 default: topLayer = (topLayerId -
B_Cu)/2 + 1;
break;
1463 switch( bottomLayerId )
1465 case F_Cu: bottomLayer = 1;
break;
1467 default: bottomLayer = (bottomLayerId -
B_Cu)/2 + 1;
break;
1471#if wxUSE_UNICODE_WCHAR
1472 layerIds << std::to_wstring( topLayer ) <<
L'-' << std::to_wstring( bottomLayer );
1474 layerIds << std::to_string( topLayer ) <<
'-' << std::to_string( bottomLayer );
1480 int minCharCnt = showLayers ? 6 : 3;
1484 tsize = std::min( tsize, size );
1491 if( showLayers && showNets )
1492 textpos.
y += ( tsize * 1.3 )/ 2;
1494 m_gal->SetGlyphSize( namesize );
1495 m_gal->SetLineWidth( namesize.
x / 10.0 );
1503 textpos.
y -= tsize * 1.3;
1515 m_gal->SetStrokeColor( color );
1516 m_gal->SetFillColor( color );
1517 m_gal->SetIsStroke(
true );
1518 m_gal->SetIsFill(
false );
1527 double maxRadius = aVia->
GetWidth( layerTop ) / 2.0;
1528 double radius = drillRadius + thickness;
1534 thickness =
radius - drillRadius;
1537 if( thickness <= 0 )
1542 m_gal->SetLineWidth( thickness );
1543 radius -= thickness / 2.0;
1547 m_gal->SetIsFill(
true );
1558 if( secDrill.value_or( 0 ) > 0 )
1561 if( terDrill.value_or( 0 ) > 0 )
1569 m_gal->SetIsStroke(
false );
1570 m_gal->SetIsFill(
true );
1574 m_gal->SetIsStroke(
false );
1575 m_gal->SetIsFill(
true );
1594 m_gal->SetIsFill(
true );
1595 m_gal->SetIsStroke(
false );
1597 m_gal->SetLineWidth( margin );
1624 m_gal->SetLineWidth( annular_width );
1625 radius -= annular_width / 2.0;
1654 if( aVia->
FlashLayer( copperLayerForClearance ) )
1660 m_gal->SetIsFill(
false );
1661 m_gal->SetIsStroke(
true );
1662 m_gal->SetStrokeColor( color );
1682 m_gal->SetIsFill(
false );
1683 m_gal->SetIsStroke(
true );
1687 for(
const auto& [row, shapeIndex] : aChart->
RowShapes() )
1709 switch( part.m_Type )
1712 m_gal->DrawLine( part.m_Points.front(), part.m_Points.back() );
1716 for(
size_t ii = 0; ii + 1 < part.m_Points.size(); ++ii )
1717 m_gal->DrawLine( part.m_Points[ii], part.m_Points[ii + 1] );
1722 m_gal->DrawCircle( centre, part.m_Radius );
1738 const int outlineWidth =
1741 m_gal->SetIsFill(
false );
1742 m_gal->SetIsStroke(
true );
1744 m_gal->SetLineWidth( outlineWidth );
1746 const std::shared_ptr<const SHAPE_POLY_SET> outlines = aMap->
GetBoardOutlines();
1748 for(
int ii = 0; ii < outlines->OutlineCount(); ++ii )
1750 m_gal->DrawSegmentChain( outlines->COutline( ii ), outlineWidth );
1752 for(
int jj = 0; jj < outlines->HoleCount( ii ); ++jj )
1753 m_gal->DrawSegmentChain( outlines->CHole( ii, jj ), outlineWidth );
1760 const std::shared_ptr<const DRILL_SYMBOL_CACHE> cache = board->
DrillSymbolCache();
1763 for(
const auto& [itemId, entries] : cache->m_ByItem )
1770 const int thickness = std::max<int>(
m_pcbSettings.m_outlineWidth, 1 );
1772 m_gal->SetLineWidth( thickness );
1784 m_gal->DrawSegment( a, b, thickness );
1798 const std::vector<const PCB_DRILL_MAP*> maps =
1805 const std::shared_ptr<const DRILL_SYMBOL_CACHE> cache = board->
DrillSymbolCache();
1807 const auto it = cache->m_ByItem.find( aItem->
m_Uuid );
1809 if( it == cache->m_ByItem.end() )
1822 if( map->IsMoving() )
1841 const int radius = symbolSize / 2;
1851 m_gal->SetIsFill(
false );
1852 m_gal->SetIsStroke(
true );
1853 m_gal->SetStrokeColor( aColor );
1863 switch( part.m_Type )
1866 m_gal->DrawLine( part.m_Points.front(), part.m_Points.back() );
1870 for(
size_t ii = 0; ii + 1 < part.m_Points.size(); ++ii )
1871 m_gal->DrawLine( part.m_Points[ii], part.m_Points[ii + 1] );
1876 m_gal->DrawCircle( pos, part.m_Radius );
1885 const wxString
text =
1887 ? entry.m_Symbol.m_Letter
1888 : wxString::Format( wxT(
"%.2f" ),
1897 m_gal->SetIsFill(
true );
1898 m_gal->SetFillColor( aColor );
1906 const int reach = symbolSize;
1908 m_gal->SetIsFill(
false );
1909 m_gal->SetIsStroke(
true );
1910 m_gal->SetStrokeColor( aColor );
1924 if( size.
x > size.
y )
1926 std::swap( size.
x, size.
y );
1930 const int half = ( size.
y - size.
x ) / 2;
1938 m_gal->SetIsFill(
false );
1939 m_gal->SetIsStroke(
true );
1940 m_gal->SetStrokeColor( aColor );
1942 m_gal->DrawSegment( pos + start, pos +
end, size.
x );
1974 netname = wxT(
"x" );
1976 netname = wxT(
"*" );
1979 if( netname.IsEmpty() && padNumber.IsEmpty() )
2014 for(
const std::shared_ptr<PCB_SHAPE>& primitive : aPad->
GetPrimitives( pcbLayer ) )
2018 position = primitive->GetCenter();
2020 position += aPad->
ShapePos( pcbLayer );
2022 padsize.
x = abs( primitive->GetBotRight().x - primitive->GetTopLeft().x );
2023 padsize.
y = abs( primitive->GetBotRight().y - primitive->GetTopLeft().y );
2037 double limit = std::min( aPad->
GetSize( pcbLayer ).
x, aPad->
GetSize( pcbLayer ).
y ) * 1.1;
2039 if( padsize.
x > limit && padsize.
y > limit )
2047 double size = padsize.
y;
2050 m_gal->Translate( position );
2053 if( padsize.
x < ( padsize.
y * 0.95 ) )
2057 std::swap( padsize.
x, padsize.
y );
2061 if( size > maxSize )
2065 m_gal->ResetTextAttributes();
2068 m_gal->SetFontBold(
false );
2069 m_gal->SetFontItalic(
false );
2070 m_gal->SetFontUnderlined(
false );
2071 m_gal->SetTextMirrored(
false );
2073 m_gal->SetIsStroke(
true );
2074 m_gal->SetIsFill(
false );
2082 int Y_offset_numpad = 0;
2083 int Y_offset_netname = 0;
2085 if( !netname.IsEmpty() && !padNumber.IsEmpty() )
2089 Y_offset_netname = size / 1.4;
2091 Y_offset_numpad = size / 1.7;
2097 const double Xscale_for_stroked_font = 0.9;
2099 if( !netname.IsEmpty() )
2105 tsize = std::min( tsize, size );
2118 VECTOR2D namesize( tsize*Xscale_for_stroked_font, tsize );
2119 textpos.
y =
KiROUND( std::min( tsize * 1.4,
double( Y_offset_netname ) ) );
2121 m_gal->SetGlyphSize( namesize );
2122 m_gal->SetLineWidth( namesize.
x / 6.0 );
2123 m_gal->SetFontBold(
true );
2127 if( !padNumber.IsEmpty() )
2132 tsize = std::min( tsize, size );
2136 tsize = std::min( tsize, size );
2137 VECTOR2D numsize( tsize*Xscale_for_stroked_font, tsize );
2138 textpos.
y = -Y_offset_numpad;
2140 m_gal->SetGlyphSize( numsize );
2141 m_gal->SetLineWidth( numsize.
x / 6.0 );
2142 m_gal->SetFontBold(
true );
2152 m_gal->SetIsFill(
true );
2153 m_gal->SetIsStroke(
false );
2159 m_gal->SetFillColor( color );
2160 m_gal->SetMinLineWidth( lineWidth );
2164 if( slot->GetSeg().A == slot->GetSeg().B )
2166 double holeRadius = slot->GetWidth() / 2.0;
2167 m_gal->DrawHoleWall( slot->GetSeg().A, holeRadius, lineWidth );
2171 int holeSize =
KiROUND( slot->GetWidth() + ( 2 * lineWidth ) );
2172 m_gal->DrawSegment( slot->GetSeg().A, slot->GetSeg().B, holeSize );
2175 m_gal->SetMinLineWidth( 1.0 );
2181 const VECTOR2I& holePos = slot->GetSeg().A;
2185 if( secondaryDrill.
x > 0 )
2188 if( tertiaryDrill.
x > 0 )
2198 outline_mode =
true;
2200 bool drawShape =
false;
2214 outline_mode =
true;
2219 outline_mode =
false;
2227 m_gal->SetIsFill(
false );
2228 m_gal->SetIsStroke(
true );
2230 m_gal->SetStrokeColor( color );
2235 m_gal->SetIsFill(
true );
2236 m_gal->SetIsStroke(
false );
2237 m_gal->SetFillColor( color );
2250 else if( drawShape )
2256 if(
m_gal->SupportsTypedPads()
2268 double halfWidth = padSize.
x / 2.0;
2269 double halfHeight = padSize.
y / 2.0;
2280 default: shapeType = 0.0f;
break;
2283 double cornerRadius = 0.0;
2288 m_gal->DrawPad(
center, halfWidth, halfHeight, cornerRadius, shapeType,
2314 expansion.
x = expansion.
y = 0;
2333 VECTOR2I expansion = getExpansion( layer );
2344 margin = getExpansion( pcbLayer );
2347 std::unique_ptr<PAD> dummyPad;
2348 std::shared_ptr<SHAPE_COMPOUND> shapes;
2351 bool simpleShapes = !outline_mode;
2357 && ( margin.
x < 0 || margin.
y < 0 ) ) )
2365 if( pad_size.
x + 2 * margin.
x <= 0 || pad_size.
y + 2 * margin.
y <= 0 )
2370 int initial_radius = dummyPad->GetRoundRectCornerRadius( pcbLayer );
2372 dummyPad->SetSize( pcbLayer, pad_size + margin + margin );
2378 int radius_margin = std::max( margin.
x, margin.
y );
2379 dummyPad->SetRoundRectCornerRadius( pcbLayer, std::max( initial_radius + radius_margin, 0 ) );
2382 shapes = std::dynamic_pointer_cast<SHAPE_COMPOUND>( dummyPad->GetEffectiveShape( pcbLayer ) );
2383 margin.
x = margin.
y = 0;
2387 shapes = std::dynamic_pointer_cast<SHAPE_COMPOUND>( aPad->
GetEffectiveShape( pcbLayer ) );
2400 simpleShapes =
false;
2403 for(
const SHAPE* shape : shapes->Shapes() )
2408 switch( shape->Type() )
2419 simpleShapes =
false;
2425 const auto drawOneSimpleShape =
2426 [&](
const SHAPE& aShape )
2428 switch( aShape.Type() )
2433 int effectiveWidth = seg.
GetWidth() + 2 * margin.
x;
2435 if( effectiveWidth > 0 )
2444 int effectiveRadius =
circle.GetRadius() + margin.
x;
2446 if( effectiveRadius > 0 )
2447 m_gal->DrawCircle(
circle.GetCenter(), effectiveRadius );
2458 if( effectiveMargin.
x < 0 )
2463 if( effectiveSize.
x > 0 && effectiveSize.
y > 0 )
2464 m_gal->DrawRectangle( pos - effectiveMargin, pos + effectiveSize );
2466 else if( effectiveMargin.
x > 0 )
2472 m_gal->DrawSegment( pos,
2474 effectiveMargin.
x * 2 );
2477 effectiveMargin.
x * 2 );
2480 effectiveMargin.
x * 2 );
2483 effectiveMargin.
x * 2 );
2505 for(
int ii = 0; ii < poly.
PointCount(); ++ii )
2510 m_gal->DrawPolygon( outline );
2523 m_gal->DrawSegment( seg.
A, seg.
B, margin.
x * 2 );
2538 for(
const SHAPE* shape : shapes->Shapes() )
2539 drawOneSimpleShape( *shape );
2546 m_gal->DrawPolygon( polySet );
2567 m_gal->SetIsStroke(
true );
2568 m_gal->SetIsFill(
false );
2569 m_gal->SetStrokeColor( color );
2575 auto shape = std::dynamic_pointer_cast<SHAPE_COMPOUND>( aPad->
GetEffectiveShape( pcbLayer ) );
2577 if( shape && shape->Size() == 1 && shape->Shapes()[0]->Type() ==
SH_SEGMENT )
2582 else if( shape && shape->Size() == 1 && shape->Shapes()[0]->Type() ==
SH_CIRCLE )
2595 m_gal->DrawPolygon( polySet );
2601 m_gal->DrawSegment( slot->GetSeg().A, slot->GetSeg().B, slot->GetWidth() + 2 *
clearance );
2612 m_gal->SetIsFill(
false );
2613 m_gal->SetIsStroke(
true );
2628 board->GetNetChainColor(
m_pcbSettings.m_highlightedNetChain );
2631 termColor = chainColor;
2643 m_gal->SetStrokeColor( termColor );
2644 m_gal->SetLineWidth( baseWidth );
2652 int inset = baseWidth * 2;
2654 inner.
Inflate( -inset, -inset );
2688 isHatchedFill =
false;
2706 if( netname.IsEmpty() )
2743 thickness = thickness + margin;
2749 m_gal->SetIsFill(
false );
2750 m_gal->SetIsStroke(
true );
2754 m_gal->SetFillColor( color );
2755 m_gal->SetStrokeColor( color );
2771 std::vector<VECTOR2I> pts;
2772 VECTOR2I offset = ( segEnd - segStart ).Perpendicular();
2773 offset = offset.
Resize( thickness / 2 );
2775 pts.push_back( segStart + offset );
2776 pts.push_back( segStart - offset );
2777 pts.push_back( segEnd - offset );
2778 pts.push_back( segEnd + offset );
2781 m_gal->DrawLine( pts[0], pts[1] );
2782 m_gal->DrawLine( pts[1], pts[2] );
2783 m_gal->DrawLine( pts[2], pts[3] );
2784 m_gal->DrawLine( pts[3], pts[0] );
2785 m_gal->DrawLine( ( pts[0] + pts[1] ) / 2, ( pts[1] + pts[2] ) / 2 );
2786 m_gal->DrawLine( ( pts[1] + pts[2] ) / 2, ( pts[2] + pts[3] ) / 2 );
2787 m_gal->DrawLine( ( pts[2] + pts[3] ) / 2, ( pts[3] + pts[0] ) / 2 );
2788 m_gal->DrawLine( ( pts[3] + pts[0] ) / 2, ( pts[0] + pts[1] ) / 2 );
2790 else if( outline_mode )
2792 m_gal->DrawSegment( segStart, segEnd, thickness );
2796 m_gal->SetIsFill(
true );
2797 m_gal->SetIsStroke(
false );
2799 m_gal->DrawSegment( segStart, segEnd, thickness );
2822 m_gal->DrawPolygon( outline );
2824 else if( outline_mode )
2826 m_gal->DrawSegmentChain( outline, thickness );
2830 m_gal->SetIsFill(
true );
2831 m_gal->SetIsStroke(
false );
2835 m_gal->DrawSegmentChain( outline, thickness );
2844 m_gal->DrawPolygon( deflated_shape );
2848 m_gal->DrawPolygon( outline );
2860 m_gal->DrawLine( pts[0], pts[1] );
2861 m_gal->DrawLine( pts[1], pts[2] );
2862 m_gal->DrawLine( pts[2], pts[3] );
2863 m_gal->DrawLine( pts[3], pts[0] );
2864 m_gal->DrawLine( pts[0], pts[2] );
2865 m_gal->DrawLine( pts[1], pts[3] );
2867 else if( outline_mode )
2869 m_gal->DrawSegment( pts[0], pts[1], thickness );
2870 m_gal->DrawSegment( pts[1], pts[2], thickness );
2871 m_gal->DrawSegment( pts[2], pts[3], thickness );
2872 m_gal->DrawSegment( pts[3], pts[0], thickness );
2876 m_gal->SetIsFill(
true );
2877 m_gal->SetIsStroke(
false );
2881 m_gal->DrawSegment( pts[0], pts[1], thickness );
2882 m_gal->DrawSegment( pts[1], pts[2], thickness );
2883 m_gal->DrawSegment( pts[2], pts[3], thickness );
2884 m_gal->DrawSegment( pts[3], pts[0], thickness );
2898 m_gal->DrawPolygon( poly );
2912 EDA_ANGLE arcAngle = endAngle - startAngle;
2923 m_gal->SetIsFill(
true );
2924 m_gal->SetIsStroke(
false );
2944 m_gal->SetLineWidth( thickness );
2952 else if( isSolidFill )
2969 auto drawOutlineBody =
2978 std::vector<VECTOR2I> pts;
2989 m_gal->DrawSegmentChain( shortened, thickness );
2993 m_gal->DrawSegmentChain( aOutline, thickness );
3003 drawOutlineBody( shape.
COutline( ii ), ii );
3007 m_gal->SetIsFill(
true );
3008 m_gal->SetIsStroke(
false );
3013 drawOutlineBody( shape.
COutline( ii ), ii );
3022 m_gal->DrawPolygon( deflated_shape );
3030 if(
m_gal->UsesPolygonTriangulationCache()
3034 m_gal->DrawPolygon( shape );
3047 std::vector<VECTOR2D> output;
3048 BEZIER_POLY converter( std::vector<VECTOR2D>{ curve->Start, curve->C1, curve->C2, curve->End } );
3051 m_gal->DrawSegmentChain( output, thickness );
3057 m_gal->SetLineWidth( thickness );
3058 m_gal->DrawCurve( curve->Start, curve->C1, curve->C2, curve->End,
m_maxError );
3073 m_gal->DrawEllipse(
center, majorR - thickness / 2, minorR - thickness / 2, rot );
3074 m_gal->DrawEllipse(
center, majorR + thickness / 2, minorR + thickness / 2, rot );
3080 m_gal->SetLineWidth( thickness );
3083 m_gal->DrawEllipse(
center, majorR, minorR, rot );
3084 else if( isSolidFill )
3085 m_gal->DrawEllipse(
center, majorR, minorR, rot );
3101 std::vector<VECTOR2I> pts;
3110 chain.SetClosed(
false );
3130 m_gal->SetIsFill(
true );
3131 m_gal->SetIsStroke(
false );
3136 for(
SHAPE* shape : shapes )
3142 m_gal->DrawSegment( a, b, thickness );
3146 for(
SHAPE* shape : shapes )
3153 m_gal->SetIsFill(
false );
3154 m_gal->SetIsStroke(
true );
3158 m_gal->DrawLine( seg.A, seg.B );
3206 font->
Draw(
m_gal, aText, pos, aAttrs, aFontMetrics );
3223 if( img_scale != 1.0 )
3231 m_gal->SetIsStroke(
true );
3232 m_gal->SetStrokeColor( color );
3234 m_gal->SetIsFill(
false );
3241 bm_size.
x /= img_scale;
3242 bm_size.
y /= img_scale;
3243 VECTOR2D origin( -bm_size.
x / 2.0, -bm_size.
y / 2.0 );
3246 m_gal->DrawRectangle( origin,
end );
3249 imgAlpha = std::max( imgAlpha, 0.1 );
3265 draw(
static_cast<const PCB_TEXT*
>( aField ), aLayer );
3273 if( resolvedText.Length() == 0 )
3280 m_gal->SetIsFill(
true );
3281 m_gal->SetIsStroke(
true );
3282 m_gal->SetFillColor( color );
3283 m_gal->SetStrokeColor( color );
3288 m_gal->DrawPolygon( poly );
3303 m_gal->SetStrokeColor( color );
3304 m_gal->SetFillColor( color );
3311 m_gal->SetIsStroke(
false );
3312 m_gal->SetIsFill(
true );
3313 m_gal->DrawPolygon( finalPoly );
3333 textWidth.
x = -textWidth.
x;
3340 textPos -= textWidth;
3342 textPos += textWidth;
3345 strokeText( resolvedText, textPos, attrs, metrics );
3349 std::vector<std::unique_ptr<KIFONT::GLYPH>>* cache =
nullptr;
3357 m_gal->DrawGlyphs( *cache );
3397 m_gal->SetIsFill(
true );
3398 m_gal->SetIsStroke(
false );
3399 m_gal->SetFillColor( sh_color );
3400 m_gal->SetStrokeColor( sh_color );
3404 std::vector<VECTOR2I> pts = aTextBox->
GetCorners();
3405 int line_thickness = std::max( thickness*3,
pcbIUScale.mmToIU( 0.2 ) );
3407 std::deque<VECTOR2D> dpts;
3412 dpts.push_back(
VECTOR2D( pts[0] ) );
3414 m_gal->SetIsStroke(
true );
3415 m_gal->SetLineWidth( line_thickness );
3416 m_gal->DrawPolygon( dpts );
3419 m_gal->SetFillColor( color );
3420 m_gal->SetStrokeColor( color );
3421 m_gal->SetIsFill(
true );
3422 m_gal->SetIsStroke(
false );
3431 std::vector<VECTOR2I> pts = aTextBox->
GetCorners();
3433 for(
size_t ii = 0; ii < pts.size(); ++ii )
3434 m_gal->DrawSegment( pts[ii], pts[( ii + 1 ) % pts.size()], thickness );
3441 for(
SHAPE* shape : shapes )
3446 m_gal->DrawSegment( a, b, thickness );
3450 for(
SHAPE* shape : shapes )
3463 m_canvas->SetFillColor( sh_color );
3464 m_canvas->SetStrokeColor( sh_color );
3477 m_gal->SetIsStroke(
false );
3478 m_gal->SetIsFill(
true );
3479 m_gal->DrawPolygon( finalPoly );
3483 if( resolvedText.Length() == 0 )
3499 std::vector<std::unique_ptr<KIFONT::GLYPH>>* cache =
nullptr;
3507 m_gal->DrawGlyphs( *cache );
3523 if( cell->GetColSpan() > 0 || cell->GetRowSpan() > 0 )
3535 m_gal->SetIsFill(
false );
3536 m_gal->SetIsStroke(
true );
3537 m_gal->SetStrokeColor( color );
3538 m_gal->SetLineWidth( lineWidth );
3542 m_gal->DrawLine( ptA, ptB );
3553 m_gal->DrawLine( a+1, b );
3555 m_gal->DrawLine( a, b );
3563 if( aTable->
IsSelected() || cell->IsSelected() )
3565 std::vector<VECTOR2I> corners = cell->GetCorners();
3566 std::deque<VECTOR2D> pts;
3568 pts.insert( pts.end(), corners.begin(), corners.end() );
3571 m_gal->SetIsFill(
true );
3572 m_gal->SetIsStroke(
false );
3573 m_gal->DrawPolygon( pts );
3586 double worldScale =
m_gal->GetWorldScaleForScreenSpace();
3587 double anchorSize = 5.0 / worldScale;
3588 double anchorThickness = 1.0 / worldScale;
3590 m_gal->SetIsFill(
false );
3591 m_gal->SetIsStroke(
true );
3592 m_gal->SetStrokeColor( color );
3593 m_gal->SetLineWidth( anchorThickness );
3594 m_gal->SetScreenSpaceMode(
true );
3600 m_gal->SetScreenSpaceMode(
false );
3607 m_gal->SetIsFill(
true );
3608 m_gal->SetIsStroke(
false );
3609 m_gal->SetFillColor( color );
3613 m_canvas->DrawPolygon( poly );
3619 m_gal->DrawRectangle( topLeft, botRight );
3636 m_gal->SetIsFill(
true );
3637 m_gal->SetIsStroke(
false );
3638 m_gal->SetFillColor( color );
3641 m_gal->DrawPolygon( frontpoly );
3644 m_gal->DrawPolygon( backpoly );
3670 m_gal->SetStrokeColor( color );
3678 m_gal->DrawLine( topLeft, topLeft + width );
3679 m_gal->DrawLine( topLeft + width, topLeft + width + height );
3680 m_gal->DrawLine( topLeft + width + height, topLeft + height );
3681 m_gal->DrawLine( topLeft + height, topLeft );
3685 if(
name.IsEmpty() )
3689 int scaledSize = abs(
KiROUND(
m_gal->GetScreenWorldMatrix().GetScale().x * ptSize ) );
3690 int unscaledSize =
pcbIUScale.MilsToIU( ptSize );
3693 int textSize = ( scaledSize + ( unscaledSize * 2 ) ) / 3;
3699 m_gal->DrawLine( topLeft, topLeft - titleHeight );
3700 m_gal->DrawLine( topLeft - titleHeight, topLeft + width - titleHeight );
3701 m_gal->DrawLine( topLeft + width - titleHeight, topLeft + width );
3734 zoneOutline = aZone->
Outline();
3742 m_gal->SetIsFill(
true );
3743 m_gal->SetIsStroke(
false );
3744 m_gal->SetFillColor( color );
3769 std::deque<VECTOR2D> corners;
3787 m_gal->SetStrokeColor( outlineColor );
3788 m_gal->SetIsFill(
false );
3789 m_gal->SetIsStroke(
true );
3801 for(
int ii = 0; ii < zoneOutline->
OutlineCount(); ++ii )
3806 int holes_count = zoneOutline->
HoleCount( ii );
3808 for(
int jj = 0; jj < holes_count; ++jj )
3809 m_gal->DrawPolyline( zoneOutline->
CHole( ii, jj ) );
3814 m_gal->DrawLine( hatchLine.A, hatchLine.B );
3826 if( polySet->OutlineCount() == 0 )
3829 m_gal->SetStrokeColor( color );
3830 m_gal->SetFillColor( color );
3831 m_gal->SetLineWidth( 0 );
3835 m_gal->SetIsFill(
true );
3836 m_gal->SetIsStroke(
false );
3840 m_gal->SetIsFill(
false );
3841 m_gal->SetIsStroke(
true );
3848 if(
m_gal->UsesPolygonTriangulationCache() && !polySet->IsTriangulationUpToDate() )
3849 polySet->CacheTriangulation(
true );
3860 m_gal->SetIsFill(
true );
3861 m_gal->SetIsStroke(
false );
3862 m_gal->SetFillColor( color );
3873 m_gal->DrawPolygon( shape );
3892 m_gal->SetIsFill(
true );
3893 m_gal->SetIsStroke(
true );
3894 m_gal->SetFillColor( color );
3895 m_gal->SetStrokeColor( color );
3896 m_gal->SetLineWidth( margin );
3898 for(
const std::shared_ptr<SHAPE>& shape : aDimension->
GetShapes() )
3900 switch( shape->Type() )
3905 m_gal->DrawSegment( seg.
A, seg.
B, margin );
3922 m_gal->DrawPolygon( poly );
3927 m_gal->SetStrokeColor( color );
3928 m_gal->SetFillColor( color );
3929 m_gal->SetIsFill(
false );
3930 m_gal->SetIsStroke(
true );
3941 for(
const std::shared_ptr<SHAPE>& shape : aDimension->
GetShapes() )
3943 switch( shape->Type() )
3948 m_gal->DrawLine( seg.
A, seg.
B );
3976 std::vector<std::unique_ptr<KIFONT::GLYPH>>* cache =
nullptr;
3983 for(
const std::unique_ptr<KIFONT::GLYPH>& glyph : *cache )
3984 m_gal->DrawGlyph( *glyph );
4009 m_gal->SetIsFill(
false );
4010 m_gal->SetIsStroke(
true );
4027 if( phiMax + 1e-9 < 2 *
M_PI )
4047 wxFAIL_MSG( wxT(
"draw(PCB_GRID_ITEM*): unhandled PCB_GRID_TYPE" ) );
4059 const double anchorSize = 5.0 /
m_gal->GetWorldScale();
4060 const double anchorThickness = 1.0 /
m_gal->GetWorldScale();
4063 m_gal->SetStrokeColor( anchorColor );
4064 m_gal->SetLineWidth( anchorThickness );
4079 m_gal->SetStrokeColor( strokeColor );
4080 m_gal->SetIsFill(
false );
4081 m_gal->SetIsStroke(
true );
4084 m_gal->Translate( position );
4090 size = 2.0 * aTarget->
GetSize() / 3.0;
4096 size = aTarget->
GetSize() / 2.0;
4115 double size = (double)aPoint->
GetSize() / 2;
4135 m_gal->SetLineWidth( (
float) thickness );
4136 m_gal->SetStrokeColor( crossColor );
4137 m_gal->SetIsFill(
false );
4138 m_gal->SetIsStroke(
true );
4141 m_gal->Translate( position );
4148 m_gal->SetStrokeColor( ringColor );
4172 aMarker->
SetZoom( 1.0 / sqrt(
m_gal->GetZoomFactor() ) );
4178 m_gal->SetStrokeColor( shadowColor );
4179 m_gal->SetFillColor( color );
4183 m_gal->SetIsFill(
false );
4184 m_gal->SetIsStroke(
true );
4189 m_gal->SetIsFill(
true );
4190 m_gal->SetIsStroke(
false );
4200 double bg_h, bg_s, bg_l;
4203 legendColor.
ToHSL( bg_h, bg_s, bg_l );
4204 haloColor.
FromHSL( bg_h, bg_s, bg_l < 0.5 ? 1.0 : 0.0 );
4212 if( shape.GetStroke().GetWidth() == 1.0 )
4214 m_gal->SetIsFill(
false );
4215 m_gal->SetIsStroke(
true );
4219 m_gal->DrawLine( shape.GetStart(), shape.GetEnd() );
4224 shape.CalcArcAngles( startAngle, endAngle );
4226 m_gal->DrawArc( shape.GetCenter(), shape.GetRadius(), startAngle, shape.GetArcAngle() );
4231 m_gal->SetIsFill(
true );
4232 m_gal->SetIsStroke(
false );
4236 m_gal->DrawSegment( shape.GetStart(), shape.GetEnd(), shape.GetWidth() );
4241 shape.CalcArcAngles( startAngle, endAngle );
4243 m_gal->DrawArcSegment( shape.GetCenter(), shape.GetRadius(), startAngle, shape.GetArcAngle(),
4268 m_gal->SetFillColor( outlineColor );
4269 m_gal->AdvanceDepth();
4270 m_gal->SetLineWidth( 0 );
4271 m_gal->SetIsFill(
true );
4272 m_gal->SetIsStroke(
false );
4280 int aBackdrillSize,
PCB_LAYER_ID aMustCutLayer,
int aOffset )
4282 double backdrillRadius = aBackdrillSize / 2.0;
4283 double lineWidth = std::max( backdrillRadius / 16.0,
m_pcbSettings.m_outlineWidth * 2.0 );
4286 backdrillRadius -= lineWidth / 2;
4289 m_gal->AdvanceDepth();
4290 m_gal->SetIsFill(
false );
4291 m_gal->SetIsStroke(
true );
4292 m_gal->SetLineWidth( (
float) lineWidth );
4295 constexpr int NUM_DASHES = 12;
4298 for(
int i = aOffset; i < NUM_DASHES; i += 2 )
4300 EDA_ANGLE startAngle = dashAngle * ( i * 2 );
4302 m_gal->DrawArc( aCenter, backdrillRadius, startAngle, dashAngle );
4312 if(
const PAD*
pad =
dynamic_cast<const PAD*
>( aItem ) )
4313 size =
pad->GetPostMachiningKnockout( aLayer );
4315 size =
via->GetPostMachiningKnockout( aLayer );
4321 m_gal->AdvanceDepth();
4323 double pmRadius = size / 2.0;
4325 double lineWidth = std::max( pmRadius / 16.0,
m_pcbSettings.m_outlineWidth * 2.0 );
4328 pmRadius -= lineWidth / 2;
4332 m_gal->SetIsFill(
false );
4333 m_gal->SetIsStroke(
true );
4334 m_gal->SetStrokeColor( layerColor );
4335 m_gal->SetLineWidth( (
float) lineWidth );
4338 constexpr int NUM_DASHES = 12;
4341 for(
int i = 0; i < NUM_DASHES; ++i )
4343 EDA_ANGLE startAngle = dashAngle * ( i * 2 );
4344 m_gal->DrawArc( aCenter, pmRadius, startAngle, dashAngle );
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
constexpr int ARC_HIGH_DEF
constexpr EDA_IU_SCALE pcbIUScale
@ NORMAL
Inactive layers are shown normally (no high-contrast mode)
@ HIDDEN
Inactive layers are hidden.
@ DIMMED
Inactive layers are dimmed (old high-contrast mode)
@ RATSNEST
Net/netclass colors are shown on ratsnest lines only.
@ ALL
Net/netclass colors are shown on all net copper.
ZONE_DISPLAY_MODE
Determine how zones should be displayed.
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
Bezier curves to polygon converter.
void GetPoly(std::vector< VECTOR2I > &aOutput, int aMaxError=10)
Convert a Bezier curve to a polygon.
Generic cubic Bezier representation.
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
virtual NETCLASS * GetEffectiveNetClass() const
Return the NETCLASS for this item.
wxString GetNetname() const
NETINFO_ITEM * GetNet() const
Return NETINFO_ITEM object for a given item.
const wxString & GetDisplayNetname() const
virtual int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const
Return an item's "own" clearance in internal units.
Container for design settings for a BOARD object.
int GetHolePlatingThickness() const
Pad & via drills are finish size.
DRILL_SYMBOL_PROFILE & GetDrillSymbolProfile()
int m_SolderMaskExpansion
int GetLineThickness(PCB_LAYER_ID aLayer) const
Return the default graphic segment thickness from the layer class for the given layer.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual BOARD_ITEM * Duplicate(bool addToParentGroup, BOARD_COMMIT *aCommit=nullptr) const
Create a copy of this BOARD_ITEM.
virtual bool IsConnected() const
Returns information if the object is derived from BOARD_CONNECTED_ITEM.
virtual bool IsKnockout() const
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
FOOTPRINT * GetParentFootprint() const
virtual LSET GetLayerSet() const
Return a std::bitset of all layers on which the item physically resides.
virtual void TransformShapeToPolySet(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, KIGFX::RENDER_SETTINGS *aRenderSettings=nullptr) const
Convert the item shape to a polyset.
const KIFONT::METRICS & GetFontMetrics() const
BOARD_ITEM_CONTAINER * GetParent() const
bool IsSideSpecific() const
virtual int BoardCopperLayerCount() const
Return the total number of copper layers for the board that this item resides on.
virtual bool IsOnCopperLayer() const
Information pertinent to a Pcbnew printed circuit board.
std::vector< const PCB_DRILL_MAP * > DrillMapsOnLayer(PCB_LAYER_ID aLayer) const
Every map on this layer.
BOARD_USE GetBoardUse() const
Get what the board use is.
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
const LSET & GetVisibleLayers() const
A proxy function that calls the correspondent function in m_BoardSettings.
std::shared_ptr< const DRILL_SYMBOL_CACHE > DrillSymbolCache() const
Resolved drill symbols, by group and by owning item.
KIGFX::COLOR4D GetNetChainColor(const wxString &aChain) const
const LSET & GetEnabledLayers() const
A proxy function that calls the corresponding function in m_BoardSettings.
BOARD_DESIGN_SETTINGS & GetDesignSettings()
constexpr const Vec & GetPosition() const
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr const Vec GetEnd() const
constexpr void SetOrigin(const Vec &pos)
constexpr BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
constexpr size_type GetWidth() const
constexpr Vec Centre() const
constexpr const Vec GetCenter() const
constexpr size_type GetHeight() const
constexpr bool Contains(const Vec &aPoint) const
constexpr const Vec & GetOrigin() const
constexpr const SizeVec & GetSize() const
constexpr void SetEnd(coord_type x, coord_type y)
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) const
Grouping rules and symbol assignments, shared by reference so a chart and its map can never disagree ...
int GetSymbolWidth() const
int GetSymbolSize() const
A set of EDA_ITEMs (i.e., without duplicates).
virtual EDA_ITEM * AsEdaItem()=0
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
virtual EDA_GROUP * GetParentGroup() const
KICAD_T Type() const
Returns the type of object.
bool IsBrightened() const
EDA_ANGLE GetAngle() const
static bool ShortenSegmentForEndings(VECTOR2I &aStart, VECTOR2I &aEnd, const LINE_ENDING &aStartEnding, const LINE_ENDING &aEndEnding, int aLineWidth)
Shorten a segment body for line endings.
int GetEllipseMinorRadius() const
const VECTOR2I & GetEllipseCenter() const
virtual VECTOR2I GetTopLeft() const
EDA_ANGLE GetEllipseEndAngle() const
int GetEllipseMajorRadius() const
int GetRectangleWidth() const
virtual std::vector< SHAPE * > MakeEffectiveShapes(bool aEdgeOnly=false) const
Make a set of SHAPE objects representing the EDA_SHAPE.
void GetEndingTangents(EDA_ANGLE &aStartTangent, EDA_ANGLE &aEndTangent, int aLineWidth=0) const
Compute outward-facing tangent angles at the start and end of the shape.
void CalcArcAngles(EDA_ANGLE &aStartAngle, EDA_ANGLE &aEndAngle) const
Calc arc start and end angles such that aStartAngle < aEndAngle.
EDA_ANGLE GetEllipseRotation() const
std::vector< SHAPE * > MakeEffectiveShapesForStroking(int aLineWidth=-1) const
Make a set of SHAPE objects to hand to STROKE_PARAMS::Stroke().
virtual VECTOR2I GetBotRight() const
bool GetShortenedBodyPolyPoints(const SHAPE_LINE_CHAIN &aOutline, int aOutlineIdx, std::vector< VECTOR2I > &aPoints, int aLineWidth) const
Copy an outline and apply line-ending body shortening when applicable.
const std::vector< SEG > & GetHatchLines() const
bool IsHatchedFill() const
bool GetLineEndingEndpoints(VECTOR2I &aStartPoint, VECTOR2I &aEndPoint) const
Return the source endpoints used to place line endings.
virtual int GetHatchLineWidth() const
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
std::vector< VECTOR2I > GetRectCorners() const
EDA_ANGLE GetEllipseStartAngle() const
const LINE_ENDING & GetStartEnding() const
std::optional< BEZIER< double > > ShortenedBezierCurve(int aLineWidth) const
Return the cubic Bezier curve shortened for line endings.
int GetRectangleHeight() const
bool ShortenArcForEndings(EDA_ANGLE &aStartAngle, EDA_ANGLE &aArcAngle, double aRadius, int aLineWidth) const
Shorten an arc body for line endings.
const LINE_ENDING & GetEndEnding() const
int GetCornerRadius() const
virtual bool IsVisible() const
KIFONT::FONT * GetFont() const
std::vector< std::unique_ptr< KIFONT::GLYPH > > * GetRenderCache(const KIFONT::FONT *aFont, const wxString &forResolvedText, const VECTOR2I &aOffset={ 0, 0 }) const
BOX2I GetTextBox(const RENDER_SETTINGS *aSettings, int aLine=-1) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
GR_TEXT_H_ALIGN_T GetHorizJustify() const
virtual KIFONT::FONT * GetDrawFont(const RENDER_SETTINGS *aSettings) const
const TEXT_ATTRIBUTES & GetAttributes() const
int GetEffectiveTextPenWidth(int aDefaultPenWidth=0) const
The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
APP_SETTINGS_BASE * KifaceSettings() const
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
void Draw(KIGFX::GAL *aGal, const wxString &aText, const VECTOR2I &aPosition, const VECTOR2I &aCursor, const TEXT_ATTRIBUTES &aAttributes, const METRICS &aFontMetrics, std::optional< VECTOR2I > aMousePos=std::nullopt, wxString *aActiveUrl=nullptr) const
Draw a string.
virtual bool IsOutline() const
A color representation with 4 components: red, green, blue, alpha.
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
static const COLOR4D CLEAR
void ToHSL(double &aOutHue, double &aOutSaturation, double &aOutLightness) const
Converts current color (stored in RGB) to HSL format.
COLOR4D & Darken(double aFactor)
Makes the color darker by a given factor.
COLOR4D Darkened(double aFactor) const
Return a color that is darker by a given factor, without modifying object.
COLOR4D Inverted() const
Returns an inverted color, alpha remains the same.
COLOR4D & Brighten(double aFactor)
Makes the color brighter by a given factor.
static const COLOR4D WHITE
COLOR4D Brightened(double aFactor) const
Return a color that is brighter by a given factor, without modifying object.
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
void FromHSL(double aInHue, double aInSaturation, double aInLightness)
Change currently used color to the one given by hue, saturation and lightness parameters.
static const COLOR4D BLACK
COLOR4D Mix(const COLOR4D &aColor, double aFactor) const
Return a color that is mixed with the input by a factor.
Attribute save/restore for GAL attributes.
Abstract interface for drawing on a 2D-surface.
GAL * m_gal
Instance of graphic abstraction layer that gives an interface to call commands used to draw (eg.
PAINTER(GAL *aGal)
Initialize this object for painting on any of the polymorphic GRAPHICS_ABSTRACTION_LAYER* derivatives...
void drawPostMachiningIndicator(const BOARD_ITEM *aItem, const VECTOR2D &aCenter, PCB_LAYER_ID aLayer)
Draw post-machining indicator (dashed circle) at the given center point.
virtual SHAPE_SEGMENT getPadHoleShape(const PAD *aPad) const
Return hole shape for a pad (internal units).
void drawChartSymbols(const PCB_DRILL_CHART *aChart, int aLayer)
PCB_PAINTER(GAL *aGal, FRAME_T aFrameType)
int getLineThickness(int aActualThickness) const
Get the thickness to draw for a line (e.g.
void drawDrillSymbol(const BOARD_ITEM *aItem, int aLayer)
virtual bool HasUniformColor(const VIEW_ITEM *aItem, int aLayer) const override
Return false when drawing the item on the given layer emits more than one colour, so a cached group o...
void renderNetNameForSegment(const SHAPE_SEGMENT &aSeg, const COLOR4D &aColor, const wxString &aNetName) const
bool zoneOutlineOnly(const ZONE *aZone) const
True when a zone's only visual is its outline, as for a rule area or outline-only display.
PCB_VIEWERS_SETTINGS_BASE * viewer_settings()
void draw(const PCB_TRACK *aTrack, int aLayer)
void drawDrillMarks(const PCB_DRILL_MAP *aMap, const std::vector< DRILL_SYMBOL_ENTRY > &aEntries, const COLOR4D &aColor, const KIFONT::METRICS &aFontMetrics)
One hole's marks for one map.
virtual PAD_DRILL_SHAPE getDrillShape(const PAD *aPad) const
Return drill shape of a pad.
int m_holePlatingThickness
void drawBackdrillIndicator(const BOARD_ITEM *aItem, const VECTOR2D &aCenter, int aBackdrillSize, PCB_LAYER_ID aMustCutLayer, int aOffset)
Draw backdrill indicator (two semi-circles) at the given center point.
PCB_RENDER_SETTINGS m_pcbSettings
virtual int getViaDrillSize(const PCB_VIA *aVia) const
Return drill diameter for a via (internal units).
void strokeText(const wxString &aText, const VECTOR2I &aPosition, const TEXT_ATTRIBUTES &aAttrs, const KIFONT::METRICS &aFontMetrics)
virtual bool Draw(const VIEW_ITEM *aItem, int aLayer) override
Takes an instance of VIEW_ITEM and passes it to a function that knows how to draw the item.
double m_zoneOpacity
Opacity override for filled zones.
double m_trackOpacity
Opacity override for all tracks.
double m_imageOpacity
Opacity override for user images.
double m_viaOpacity
Opacity override for all types of via.
ZONE_DISPLAY_MODE m_ZoneDisplayMode
void LoadColors(const COLOR_SETTINGS *aSettings) override
double m_padOpacity
Opacity override for SMD pads and PTHs.
double m_outsideGroupOpacity
Opacity override for items outside the entered group.
void SetBackgroundColor(const COLOR4D &aColor) override
Set the background color.
COLOR4D GetColor(const VIEW_ITEM *aItem, int aLayer) const override
Returns the color that should be used to draw the specific VIEW_ITEM on the specific layer using curr...
HIGH_CONTRAST_MODE m_ContrastModeDisplay
std::map< int, KIGFX::COLOR4D > m_netColors
Overrides for specific net colors, stored as netcodes for the ratsnest to access easily.
bool isInEnteredGroup(const BOARD_ITEM *aItem) const
NET_COLOR_MODE m_netColorMode
How to display nets and netclasses with color overrides.
static const double MAX_FONT_SIZE
Maximum font size for netnames (and other dynamically shown strings)
double m_filledShapeOpacity
Opacity override for graphic shapes.
bool IsDimExempt(const VIEW_ITEM *aItem) const override
Return true for an item that keeps its colour on a layer the canvas fades, such as a selected item in...
bool m_ForceShowFieldsWhenFPSelected
bool GetShowPageLimits() const override
std::bitset< MAX_LAYERS_FOR_VIEW > m_canvasFadedLayers
Layers the canvas fades for high contrast, see SetCanvasFadedLayers()
bool m_groupEditModeActive
True when inside an entered group.
void LoadDisplayOptions(const PCB_DISPLAY_OPTIONS &aOptions)
Load settings related to display options (high-contrast mode, full or outline modes for vias/pads/tra...
bool m_ForcePadSketchModeOn
bool GetLayerDim(int aLayer, COLOR4D &aToward, double &aKeep) const override
Get how the canvas fades a whole layer, see GAL::SetSceneLayerDim().
bool IsCanvasFadedLayer(int aLayer) const
COLOR4D m_backgroundColor
PCB_LAYER_ID GetPrimaryHighContrastLayer() const
Return the board layer which is in high-contrast mode.
void SetGapLengthRatio(double aRatio)
PCB_LAYER_ID GetActiveLayer() const
std::map< int, COLOR4D > m_layerColorsHi
virtual void update()
Precalculates extra colors for layers (e.g.
void SetDashLengthRatio(double aRatio)
std::set< int > m_highlightNetcodes
std::map< int, COLOR4D > m_layerColorsDark
std::map< int, COLOR4D > m_layerColorsSel
std::set< int > m_highContrastLayers
std::map< int, COLOR4D > m_layerColors
bool m_hiContrastEnabled
Parameters for display modes.
An abstract base class for deriving all objects that can be added to a VIEW.
bool IsBOARD_ITEM() const
double GetForcedTransparency() const
int GetShortenDepth(int aLineWidth) const
Return how far the line should be shortened at this ending.
void Draw(KIGFX::GAL &aGal, const VECTOR2I &aPoint, const EDA_ANGLE &aTangent, double aLineWidth, const KIGFX::COLOR4D &aColor) const
LINE_ENDING_STYLE GetStyle() const
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
PCB_LAYER_ID ExtractLayer() const
Find the first set PCB_LAYER_ID.
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
static const LSET & AllLayersMask()
static const LSET & PhysicalLayersMask()
Return a mask holding all layers which are physically realized.
int MarkerScale() const
The scaling factor to convert polygonal shape coordinates to internal units.
void ShapeToPolygon(SHAPE_LINE_CHAIN &aPolygon, int aScale=-1) const
Return the shape polygon in internal units in a SHAPE_LINE_CHAIN the coordinates are relatives to the...
A collection of nets and the parameters used to route or test these nets.
COLOR4D GetPcbColor(bool aIsForSave=false) const
Handle the data for a net.
const wxString & GetNetChain() const
PAD * GetTerminalPad(int aIndex) const
static const int UNCONNECTED
Constant that holds the "unconnected net" number (typically 0) all items "connected" to this net are ...
@ NORMAL
Shape is the same on all layers.
static constexpr PCB_LAYER_ID ALL_LAYERS
! The layer identifier to use for the single defintion on normal padstacks
int GetOwnClearance(PCB_LAYER_ID aLayer, wxString *aSource=nullptr) const override
Return the pad's "own" clearance in internal units.
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
const std::vector< std::shared_ptr< PCB_SHAPE > > & GetPrimitives(PCB_LAYER_ID aLayer) const
Accessor to the basic shape list for custom-shaped pads.
int GetRoundRectCornerRadius(PCB_LAYER_ID aLayer) const
bool FlashLayer(int aLayer, bool aOnlyCheckIfPermitted=false) const
Check to see whether the pad should be flashed on the specific layer.
std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
Return a SHAPE_SEGMENT object representing the pad's hole.
const BOX2I GetBoundingBox() const override
The bounding box is cached, so this will be efficient most of the time.
PAD_ATTRIB GetAttribute() const
const wxString & GetPinFunction() const
const wxString & GetNumber() const
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc=ERROR_INSIDE, bool aIgnoreLineWidth=false) const override
Convert the pad shape to a closed polygon.
VECTOR2I GetPosition() const override
PCB_LAYER_ID GetTertiaryDrillEndLayer() const
VECTOR2I GetOffset(PCB_LAYER_ID aLayer) const
VECTOR2I GetDrillSize() const
bool IsNoConnectPad() const
PAD_SHAPE GetShape(PCB_LAYER_ID aLayer) const
int GetSolderMaskExpansion(PCB_LAYER_ID aLayer) const
VECTOR2I GetSize(PCB_LAYER_ID aLayer) const
const VECTOR2I & GetSecondaryDrillSize() const
EDA_ANGLE GetOrientation() const
Return the rotation angle of the pad.
PAD_DRILL_SHAPE GetDrillShape() const
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
int GetPostMachiningKnockout(PCB_LAYER_ID aLayer) const
Get the knockout diameter for a layer affected by post-machining.
VECTOR2I GetSolderPasteMargin(PCB_LAYER_ID aLayer) const
Usually < 0 (mask shape smaller than pad)because the margin can be dependent on the pad size,...
const VECTOR2I & GetTertiaryDrillSize() const
VECTOR2I ShapePos(PCB_LAYER_ID aLayer) const
PCB_LAYER_ID GetSecondaryDrillEndLayer() const
DISPLAY_OPTIONS m_Display
bool IsDegenerated(int aThreshold=5) const
virtual double GetLength() const override
Return the length of the arc track.
EDA_ANGLE GetArcAngleStart() const
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
const VECTOR2I GetFocusPosition() const override
Similar to GetPosition() but allows items to return their visual center rather than their anchor.
EDA_ANGLE GetAngle() const
const VECTOR2I & GetMid() const
void GetBoundingHull(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc=ERROR_INSIDE) const
Add two rectangular polygons separately bounding the barcode's symbol and the barcode's text.
const SHAPE_POLY_SET & GetOutline() const
int GetLineThickness() const
const std::vector< std::shared_ptr< SHAPE > > & GetShapes() const
double m_TrackOpacity
Opacity override for all tracks.
double m_FilledShapeOpacity
Opacity override for graphic shapes.
double m_ZoneOpacity
Opacity override for filled zone areas.
double m_OutsideGroupOpacity
Opacity override for items outside the entered group.
double m_ImageOpacity
Opacity override for user images.
double m_PadOpacity
Opacity override for SMD pads and PTHs.
double m_ViaOpacity
Opacity override for all types of via.
HIGH_CONTRAST_MODE m_ContrastModeDisplay
How inactive layers are displayed.
NET_COLOR_MODE m_NetColorMode
How to use color overrides on specific nets and netclasses.
ZONE_DISPLAY_MODE m_ZoneDisplayMode
A drill chart placed on the board, kept in step with the holes.
const std::map< int, int > & RowShapes() const
Curated shape index for each generated row, by table row.
int GetSymbolColumn() const
Table column the symbol is drawn in, or -1 when the chart has no symbol column.
Turns on drill symbols at the holes, for one layer.
int GetSymbolSize() const
bool GetGuideCross() const
bool GetOutlineSlots() const
const DRILL_SPAN & GetSpan() const
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
std::shared_ptr< const SHAPE_POLY_SET > GetBoardOutlines() const
The board outline displaced by this map's offset.
const VECTOR2I & GetOffset() const
EDA_ANGLE GetPhiExtent() const
VECTOR2I GetExtent() const
VECTOR2I GetPosition() const override
EDA_ANGLE GetOrientation() const
int GetRadiusExtent() const
PCB_GRID_TYPE GetGridItemType() const
A set of BOARD_ITEMs (i.e., without duplicates).
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void SetZoom(double aZoomFactor) const
std::vector< PCB_SHAPE > GetErrorLegendShapes() const
GAL_LAYER_ID GetColorLayer() const
VECTOR2I GetPosition() const override
PCB_VIEWERS_SETTINGS_BASE * viewer_settings()
A PCB_POINT is a 0-dimensional point that is used to mark a position on a PCB, or more usually a foot...
VECTOR2I GetPosition() const override
Object to handle a bitmap image that can be inserted in a PCB.
REFERENCE_IMAGE & GetReferenceImage()
VECTOR2I GetCenter() const override
This defaults to the center of the bounding box if not overridden.
int GetWidth() const override
bool HasSolderMask() const
int GetSolderMaskExpansion() const
bool IsProxyItem() const override
STROKE_PARAMS GetStroke() const override
void UpdateHatching() const override
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
PCB_TABLECELL * GetCell(int aRow, int aCol) const
std::vector< PCB_TABLECELL * > GetCells() const
void DrawBorders(const std::function< void(const VECTOR2I &aPt1, const VECTOR2I &aPt2, const STROKE_PARAMS &aStroke)> &aCallback) const
VECTOR2I GetPosition() const override
bool IsBorderEnabled() const
Tests whether the border is disabled, as configured by the stroke.
void TransformTextToPolySet(SHAPE_POLY_SET &aBuffer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc) const
Convert the text to a polygonSet describing the actual character strokes (one per segment).
VECTOR2I GetTextSize() const override
VECTOR2I GetDrawPos() const override
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
PCB_SHAPE GetPolygonalBoxShape() const
wxString GetShownText(RESOLUTION_CONTEXT aContext, int aDepth=0) const override
Return the string actually shown after processing of the base text.
std::vector< VECTOR2I > GetCorners() const override
Return 4 corners for a rectangle or rotated rectangle (stored as a poly).
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aMaxError, ERROR_LOC aErrorLoc, bool aIgnoreLineWidth=false) const override
Convert the item shape to a closed polygon.
const SHAPE_POLY_SET & GetKnockoutCache(const KIFONT::FONT *aFont, const wxString &forResolvedText, int aMaxError) const
VECTOR2I GetTextPos() const override
int GetTextThickness() const override
EDA_ANGLE GetDrawRotation() const override
wxString GetShownText(RESOLUTION_CONTEXT aContext, int aDepth=0) const override
Return the string actually shown after processing of the base text.
VECTOR2I GetTextSize() const override
int GetSolderMaskExpansion() const
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
virtual int GetWidth() const
PCB_LAYER_ID BottomLayer() const
PCB_LAYER_ID GetTertiaryDrillEndLayer() const
std::optional< int > GetTertiaryDrillSize() const
bool FlashLayer(int aLayer) const
Check to see whether the via should have a pad on the specific layer.
std::optional< int > GetSecondaryDrillSize() const
PCB_LAYER_ID GetSecondaryDrillEndLayer() const
int GetWidth() const override
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test to see if this object is on the given layer.
PCB_LAYER_ID TopLayer() const
int GetDrillValue() const
Calculate the drill value for vias (m_drill if > 0, or default drill value for the board).
VIATYPE GetViaType() const
void LayerPair(PCB_LAYER_ID *top_layer, PCB_LAYER_ID *bottom_layer) const
Return the 2 layers used by the via (the via actually uses all layers between these 2 layers)
VIEWERS_DISPLAY_OPTIONS m_ViewersDisplay
virtual COMMON_SETTINGS * GetCommonSettings() const
virtual SETTINGS_MANAGER & GetSettingsManager() const
A REFERENCE_IMAGE is a wrapper around a BITMAP_IMAGE that is displayed in an editor as a reference fo...
EDA_ANGLE GetOrientation() const
VECTOR2I GetPosition() const
double GetOpacity() const
const BITMAP_BASE & GetImage() const
Get the underlying image.
double GetImageScale() const
A round rectangle shape, based on a rectangle and a radius.
void TransformToPolygon(SHAPE_POLY_SET &aBuffer, int aMaxError) const
Get the polygonal representation of the roundrect.
int Length() const
Return the length (this).
static SEG::ecoord Square(int a)
ecoord SquaredLength() const
T * GetAppSettings(const char *aFilename)
Return a handle to the a given settings by type.
VECTOR2I GetEnd() const override
const SHAPE_LINE_CHAIN ConvertToPolyline(int aMaxError=DefaultAccuracyForPCB(), int *aActualError=nullptr) const
Construct a SHAPE_LINE_CHAIN of segments from a given arc.
VECTOR2I GetStart() const override
const VECTOR2I & GetCenter() const
SHAPE_LINE_CHAIN ConvertToPolyline(int aMaxError) const
Build a polyline approximation of the ellipse or arc.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
bool IsClosed() const override
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.
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.
Represent a set of closed polygons.
bool IsTriangulationUpToDate() const
virtual void CacheTriangulation(bool aSimplify=false, const TASK_SUBMITTER &aSubmitter={}, bool aBuildIndexes=false)
Build a polygon triangulation, needed to draw a polygon on OpenGL and in some other calculations.
void Inflate(int aAmount, CORNER_STRATEGY aCornerStrategy, int aMaxError, bool aSimplify=false)
Perform outline inflation/deflation.
int HoleCount(int aOutline) const
Returns the number of holes in a given outline.
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)
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.
void Deflate(int aAmount, CORNER_STRATEGY aCornerStrategy, int aMaxError)
const SHAPE_LINE_CHAIN & CHole(int aOutline, int aHole) const
int OutlineCount() const
Return the number of outlines in the set.
void Fracture(bool aSimplify=true)
Convert a set of polygons with holes to a single outline with "slits"/"fractures" connecting the oute...
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
int GetWidth() const override
const VECTOR2I & GetPosition() const
const VECTOR2I GetSize() const
const SEG & GetSeg() const
int GetWidth() const override
Represent a simple polygon consisting of a zero-thickness closed chain of connected line segments.
const SHAPE_LINE_CHAIN & Vertices() const
Return the list of vertices defining this simple polygon.
virtual const SEG GetSegment(int aIndex) const override
const VECTOR2I & CPoint(int aIndex) const
Return a const reference to a given point in the polygon.
int PointCount() const
Return the number of points (vertices) in this polygon.
virtual size_t GetSegmentCount() const override
An abstract shape on 2D plane.
Simple container to manage line stroke parameters.
LINE_STYLE GetLineStyle() const
static void Stroke(const SHAPE *aShape, LINE_STYLE aLineStyle, int aWidth, const KIGFX::RENDER_SETTINGS *aRenderSettings, const std::function< void(const VECTOR2I &a, const VECTOR2I &b)> &aStroker)
GR_TEXT_H_ALIGN_T m_Halign
GR_TEXT_V_ALIGN_T m_Valign
constexpr extended_type SquaredEuclideanNorm() const
Compute the squared euclidean norm of the vector, which is defined as (x ** 2 + y ** 2).
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.
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
std::shared_ptr< SHAPE_POLY_SET > GetFilledPolysList(PCB_LAYER_ID aLayer) const
SHAPE_POLY_SET * Outline()
SHAPE_POLY_SET GetBoardOutline() const
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Test to see if this object is on the given layer.
bool IsTeardropArea() const
ZONE_BORDER_DISPLAY_STYLE GetHatchStyle() const
bool IsConflicting() const
For rule areas which exclude footprints (and therefore participate in courtyard conflicts during move...
std::vector< SEG > GetHatchLines() const
void TransformArcToPolygon(SHAPE_POLY_SET &aBuffer, const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd, int aWidth, int aError, ERROR_LOC aErrorLoc)
Convert arc to multiple straight segments.
@ CHAMFER_ALL_CORNERS
All angles are chamfered.
@ ROUND_ALL_CORNERS
All angles are rounded.
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
#define MAX_LAYERS_FOR_VIEW
static constexpr EDA_ANGLE ANGLE_90
static constexpr EDA_ANGLE ANGLE_VERTICAL
static constexpr EDA_ANGLE ANGLE_HORIZONTAL
static constexpr EDA_ANGLE ANGLE_360
#define IGNORE_PARENT_GROUP
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
@ FRAME_FOOTPRINT_PREVIEW
@ FRAME_FOOTPRINT_CHOOSER
a few functions useful in geometry calculations.
int GetPenSizeForNormal(int aTextSize)
double m_HoleWallPaintingMultiplier
What factor to use when painting via and PTH pad hole walls, so that the painted hole wall can be ove...
bool IsSolderMaskLayer(int aLayer)
@ LAYER_PAD_FR_NETNAMES
Additional netnames layers (not associated with a PCB layer).
@ NETNAMES_LAYER_ID_START
bool IsDrillSymbolLayer(int aLayer)
bool IsPcbLayer(int aLayer)
Test whether a layer is a valid layer for Pcbnew.
bool IsPadCopperLayer(int aLayer)
#define BOARD_LAYER_FOR_DRILL_SYMBOL(galLayer)
bool IsPointsLayer(int aLayer)
int GetNetnameLayer(int aLayer)
Return a netname layer corresponding to the given layer.
bool IsClearanceLayer(int aLayer)
bool IsCopperLayer(int aLayerId)
Test whether a layer is a copper layer.
@ LAYER_POINTS
PCB reference/manual snap points visibility.
@ LAYER_LOCKED_ITEM_SHADOW
Shadow layer for locked items.
@ LAYER_PAD_COPPER_START
Virtual layers for pad copper on a given copper layer.
@ LAYER_CONFLICTS_SHADOW
Shadow layer for items flagged conflicting.
@ LAYER_NON_PLATEDHOLES
Draw usual through hole vias.
@ LAYER_DRC_EXCLUSION
Layer for DRC markers which have been individually excluded.
@ LAYER_PCB_BACKGROUND
PCB background color.
@ LAYER_DRC_HIGHLIGHTED
Color for highlighted DRC markers.
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored).
@ LAYER_DRC_WARNING
Layer for DRC markers with RPT_SEVERITY_WARNING.
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
@ LAYER_VIA_COPPER_START
Virtual layers for via copper on a given copper layer.
@ LAYER_CONSTRAINT_SHADOW
Shadow layer for items bound to a constraint.
@ LAYER_CLEARANCE_START
Virtual layers for pad/via/track clearance outlines for a given copper layer.
@ LAYER_ZONE_START
Virtual layers for stacking zones and tracks on a given copper layer.
@ LAYER_ANCHOR
Anchor of items having an anchor point (texts, footprints).
@ LAYER_VIA_BURIED
Draw blind vias.
@ LAYER_MARKER_SHADOWS
Shadows for DRC markers.
@ LAYER_VIA_HOLES
Draw via holes (pad holes do not use this layer).
@ LAYER_VIA_BLIND
Draw micro vias.
@ LAYER_VIA_THROUGH
Draw buried vias.
@ LAYER_SUBGRIDS
Routing/placement subgrids (PCB_GRID_ITEM) visibility and color.
@ LAYER_DRC_ERROR
Layer for DRC markers with RPT_SEVERITY_ERROR.
bool IsViaCopperLayer(int aLayer)
#define DRILL_SYMBOL_LAYER_FOR(boardLayer)
bool IsNetnameLayer(int aLayer)
Test whether a layer is a netname layer.
bool IsHoleLayer(int aLayer)
bool IsExternalCopperLayer(int aLayerId)
Test whether a layer is an external (F_Cu or B_Cu) copper layer.
PCB_LAYER_ID
A quick note on layer IDs:
bool IsZoneFillLayer(int aLayer)
PCB_LAYER_ID ToLAYER_ID(int aLayer)
MATRIX3x3< double > MATRIX3x3D
unsigned CuratedShape(int aIndex)
Pattern index for the nth curated mark.
std::vector< MARKER_PART > BuildMarker(const VECTOR2I &aPosition, int aRadius, unsigned aShapeId)
Decompose one mark, in the order the parts must be drawn.
The Cairo implementation of the graphics abstraction layer.
bool ZoneOutlineDrawnOnLayer(bool aOutlineOnly, int aLayer)
Decide which GAL draw pass paints a zone's outline.
PAD_DRILL_SHAPE
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
@ NPTH
like PAD_PTH, but not plated mechanical use only, no connection allowed
@ PTH
Plated through hole pad.
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
BARCODE class definition.
Class to handle a set of BOARD_ITEMs.
static bool viaHoleShowsLayerPair(const PCB_VIA *aVia)
PCBNEW_SETTINGS * pcbconfig()
PGM_BASE & Pgm()
The global program "get" accessor.
PGM_BASE * PgmOrNull()
Return a reference that can be nullptr when running a shared lib from a script, not from a kicad app.
@ SH_RECT
axis-aligned rectangle
@ SH_SIMPLE
simple polygon
wxString UnescapeString(const wxString &aSource)
int PrintableCharCount(const wxString &aString)
Return the number of printable (ie: non-formatting) chars.
LINE_STYLE
Dashed line types.
double hicontrast_dimming_factor
One drawable mark, with the geometry the renderer needs to place it.
bool m_DisplayPcbTrackFill
bool m_DisplayGraphicsFill
static EDA_ORIENTATION orientation(double d)
const SHAPE_LINE_CHAIN chain
SHAPE_CIRCLE circle(c.m_circle_center, c.m_circle_radius)
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.
constexpr KICAD_T BaseType(const KICAD_T aType)
Return the underlying type of the given type.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_DRILL_MAP_T
class PCB_DRILL_MAP, drill symbols drawn at the holes
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap on a layer
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
@ PCB_BARCODE_T
class PCB_BARCODE, a barcode (graphic item)
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_GRID_ITEM_T
a subgrid placed on a board
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_BOARD_OUTLINE_T
class PCB_BOARD_OUTLINE_T, a pcb board outline item
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
@ PCB_STACKUP_TABLE_T
class PCB_STACKUP_TABLE, a live stackup table derived from PCB_TABLE
@ PCB_POINT_T
class PCB_POINT, a 0-dimensional point
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
@ PCB_DRILL_CHART_T
class PCB_DRILL_CHART, a live drill chart derived from PCB_TABLE
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D
static PIECE rect(double aLeft, double aTop, double aRight, double aBottom, bool aMixed=false)
static PIECE polygon(std::vector< VIA_CROSS_SECTION_GEOMETRY::POINT > aPoints, bool aMixed=false)