diff --git a/pcbnew/pcbplot.h b/pcbnew/pcbplot.h index d151940258..cde2ab37ae 100644 --- a/pcbnew/pcbplot.h +++ b/pcbnew/pcbplot.h @@ -36,6 +36,7 @@ class EDA_TEXT; class PLOTTER; class PCB_TEXT; +class PCB_BARCODE; class PAD; class PCB_SHAPE; class PCB_TABLE; @@ -94,6 +95,7 @@ public: const KIFONT::METRICS& aFontMetrics, bool aStrikeout = false ); void PlotShape( const PCB_SHAPE* aShape ); void PlotTableBorders( const PCB_TABLE* aTable ); + void PlotBarCode( const PCB_BARCODE* aBarCode ); /** * Plot a pad. diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index b3560934bf..6607492e5e 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -60,6 +60,7 @@ #include #include #include +#include #include // for wxASSERT_MSG @@ -508,6 +509,14 @@ void BRDITEMS_PLOTTER::PlotBoardGraphicItem( const BOARD_ITEM* item ) break; } + case PCB_BARCODE_T: + { + const PCB_BARCODE* barCode = static_cast( item ); + PlotBarCode( barCode ); + + break; + } + case PCB_TABLE_T: { const PCB_TABLE* table = static_cast( item ); @@ -1170,6 +1179,25 @@ void BRDITEMS_PLOTTER::PlotShape( const PCB_SHAPE* aShape ) } +void BRDITEMS_PLOTTER::PlotBarCode( const PCB_BARCODE* aBarCode ) +{ + if( !m_layerMask[aBarCode->GetLayer()] ) + return; + + // To avoid duplicate code, build a PCB_SHAPE to plot the polygon shape + PCB_SHAPE dummy( aBarCode->GetParent(), SHAPE_T::POLY ); + dummy.SetLayer( aBarCode->GetLayer() ); + dummy.SetFillMode( FILL_T::FILLED_SHAPE ); + dummy.SetWidth( 0 ); + + SHAPE_POLY_SET shape; + aBarCode->TransformShapeToPolySet( shape, aBarCode->GetLayer(), 0, 0, ERROR_INSIDE ); + dummy.SetPolyShape( shape ); + + PlotShape( &dummy ); +} + + void BRDITEMS_PLOTTER::PlotTableBorders( const PCB_TABLE* aTable ) { if( !m_layerMask[aTable->GetLayer()] )