Allow plotters to plot PCB_BARCODE items.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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()] )
|
||||
|
||||
Reference in New Issue
Block a user