Allow plotters to plot PCB_BARCODE items.

This commit is contained in:
jean-pierre charras
2025-09-27 19:01:14 +02:00
parent 48a82f945b
commit b113ec1543
2 changed files with 30 additions and 0 deletions
+2
View File
@@ -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.
+28
View File
@@ -60,6 +60,7 @@
#include <pcb_tablecell.h>
#include <pcb_table.h>
#include <zone.h>
#include <pcb_barcode.h>
#include <wx/debug.h> // 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<const PCB_BARCODE*>( item );
PlotBarCode( barCode );
break;
}
case PCB_TABLE_T:
{
const PCB_TABLE* table = static_cast<const PCB_TABLE*>( 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()] )