Cleanup. No (intentional) functional changes.
This commit is contained in:
parent
1ed4cd3644
commit
9fe00bb808
|
@ -279,18 +279,18 @@ std::string GBR_APERTURE_METADATA::FormatAttribute( GBR_APERTURE_ATTRIB aAttribu
|
|||
attribute_string = "TA.AperFunction,ComponentMain";
|
||||
break;
|
||||
|
||||
case GBR_APERTURE_ATTRIB_PAD1_POSITION: // print info associated to a component
|
||||
case GBR_APERTURE_ATTRIB_PAD1_POS: // print info associated to a component
|
||||
// flashed shape at pad 1 position
|
||||
// (pad 1 is also pad A1 or pad AA1)
|
||||
// in placement files
|
||||
attribute_string = "TA.AperFunction,ComponentPin";
|
||||
break;
|
||||
|
||||
case GBR_APERTURE_ATTRIB_PADOTHER_POSITION: // print info associated to a component
|
||||
case GBR_APERTURE_ATTRIB_PADOTHER_POS: // print info associated to a component
|
||||
// flashed shape at pads position (all but pad 1)
|
||||
// in placement files
|
||||
// Currently: (could be changed later) same as
|
||||
// GBR_APERTURE_ATTRIB_PADOTHER_POSITION
|
||||
// GBR_APERTURE_ATTRIB_PADOTHER_POS
|
||||
attribute_string = "TA.AperFunction,ComponentPin";
|
||||
break;
|
||||
|
||||
|
|
|
@ -146,10 +146,10 @@ public:
|
|||
GBR_APERTURE_ATTRIB_CMP_POSITION,
|
||||
|
||||
///< aperture used for flashed pin 1 (or A1 or AA1) position in placement files.
|
||||
GBR_APERTURE_ATTRIB_PAD1_POSITION,
|
||||
GBR_APERTURE_ATTRIB_PAD1_POS,
|
||||
|
||||
///< aperture used for flashed pads position in placement files.
|
||||
GBR_APERTURE_ATTRIB_PADOTHER_POSITION,
|
||||
GBR_APERTURE_ATTRIB_PADOTHER_POS,
|
||||
|
||||
///< aperture used to draw component physical body outline without pins in placement files.
|
||||
GBR_APERTURE_ATTRIB_CMP_BODY,
|
||||
|
|
|
@ -225,7 +225,7 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
|
|||
{
|
||||
PCB_SHAPE dummy_shape( *static_cast<PCB_SHAPE*>( item ) );
|
||||
dummy_shape.SetLayer( Dwgs_User );
|
||||
itemplotter.PlotPcbShape( &dummy_shape );
|
||||
itemplotter.PlotShape( &dummy_shape );
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -31,11 +31,7 @@
|
|||
#include <string_utils.h>
|
||||
#include <locale_io.h>
|
||||
#include <macros.h>
|
||||
|
||||
#include <board.h>
|
||||
#include <board_design_settings.h>
|
||||
#include <pcb_shape.h>
|
||||
|
||||
#include <pcbplot.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <gbr_metadata.h>
|
||||
|
@ -126,16 +122,16 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
for( FOOTPRINT* footprint : fp_list )
|
||||
{
|
||||
// Manage the aperture attribute component position:
|
||||
GBR_METADATA gbr_metadata;
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_POSITION );
|
||||
GBR_METADATA metadata;
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_POSITION );
|
||||
|
||||
// Add object attribute: component reference to flash (mainly useful for users)
|
||||
// using quoted UTF8 string
|
||||
wxString ref = ConvertNotAllowedCharsInGerber( footprint->Reference().GetShownText( false ),
|
||||
allowUtf8, true );
|
||||
|
||||
gbr_metadata.SetCmpReference( ref );
|
||||
gbr_metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_CMP );
|
||||
metadata.SetCmpReference( ref );
|
||||
metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_CMP );
|
||||
|
||||
// Add P&P specific attributes
|
||||
GBR_CMP_PNP_METADATA pnpAttrib;
|
||||
|
@ -163,15 +159,15 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
fp_info = FROM_UTF8( footprint->GetFPID().GetLibNickname().c_str() );
|
||||
pnpAttrib.m_LibraryName = ConvertNotAllowedCharsInGerber( fp_info, allowUtf8, true );
|
||||
|
||||
gbr_metadata.m_NetlistMetadata.SetExtraData( pnpAttrib.FormatCmpPnPMetadata() );
|
||||
metadata.m_NetlistMetadata.SetExtraData( pnpAttrib.FormatCmpPnPMetadata() );
|
||||
|
||||
VECTOR2I flash_pos = footprint->GetPosition();
|
||||
|
||||
plotter.FlashPadCircle( flash_pos, flash_position_shape_diam, FILLED, &gbr_metadata );
|
||||
gbr_metadata.m_NetlistMetadata.ClearExtraData();
|
||||
plotter.FlashPadCircle( flash_pos, flash_position_shape_diam, FILLED, &metadata );
|
||||
metadata.m_NetlistMetadata.ClearExtraData();
|
||||
|
||||
// Now some extra metadata is output, avoid blindly clearing the full metadata list
|
||||
gbr_metadata.m_NetlistMetadata.m_TryKeepPreviousAttributes = true;
|
||||
metadata.m_NetlistMetadata.m_TryKeepPreviousAttributes = true;
|
||||
|
||||
// We plot the footprint courtyard when possible.
|
||||
// If not, the pads bounding box will be used.
|
||||
|
@ -184,8 +180,7 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
|
||||
if( ( footprint->GetFlags() & checkFlag ) == 0 )
|
||||
{
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_COURTYARD );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_COURTYARD );
|
||||
|
||||
const SHAPE_POLY_SET& courtyard = footprint->GetCourtyard( aLayer );
|
||||
|
||||
|
@ -197,14 +192,13 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
continue;
|
||||
|
||||
useFpPadsBbox = false;
|
||||
plotter.PLOTTER::PlotPoly( poly, FILL_T::NO_FILL, line_thickness, &gbr_metadata );
|
||||
plotter.PLOTTER::PlotPoly( poly, FILL_T::NO_FILL, line_thickness, &metadata );
|
||||
}
|
||||
}
|
||||
|
||||
if( useFpPadsBbox )
|
||||
{
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_FOOTPRINT );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CMP_FOOTPRINT );
|
||||
|
||||
// bbox of fp pads, pos 0, rot 0, non flipped
|
||||
BOX2I bbox = footprint->GetFpPadsLocalBbox();
|
||||
|
@ -222,7 +216,7 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
|
||||
poly.Rotate( footprint->GetOrientation() );
|
||||
poly.Move( footprint->GetPosition() );
|
||||
plotter.PLOTTER::PlotPoly( poly, FILL_T::NO_FILL, line_thickness, &gbr_metadata );
|
||||
plotter.PLOTTER::PlotPoly( poly, FILL_T::NO_FILL, line_thickness, &metadata );
|
||||
}
|
||||
|
||||
std::vector<PAD*>pad_key_list;
|
||||
|
@ -233,26 +227,21 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
|
||||
for( PAD* pad1 : pad_key_list )
|
||||
{
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_PAD1_POSITION );
|
||||
|
||||
gbr_metadata.SetPadName( pad1->GetNumber(), allowUtf8, true );
|
||||
|
||||
gbr_metadata.SetPadPinFunction( pad1->GetPinFunction(), allowUtf8, true );
|
||||
|
||||
gbr_metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_PAD );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_PAD1_POS );
|
||||
metadata.SetPadName( pad1->GetNumber(), allowUtf8, true );
|
||||
metadata.SetPadPinFunction( pad1->GetPinFunction(), allowUtf8, true );
|
||||
metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_PAD );
|
||||
|
||||
// Flashes a diamond at pad position:
|
||||
plotter.FlashRegularPolygon( pad1->GetPosition(), pad1_mark_size, 4, ANGLE_0,
|
||||
FILLED, &gbr_metadata );
|
||||
FILLED, &metadata );
|
||||
}
|
||||
}
|
||||
|
||||
if( m_plotOtherPadsMarker )
|
||||
{
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_PADOTHER_POSITION );
|
||||
gbr_metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_PAD );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_PADOTHER_POS );
|
||||
metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_PAD );
|
||||
|
||||
for( PAD* pad: footprint->Pads() )
|
||||
{
|
||||
|
@ -275,13 +264,11 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
if( !pad->IsOnLayer( aLayer ) )
|
||||
continue;
|
||||
|
||||
gbr_metadata.SetPadName( pad->GetNumber(), allowUtf8, true );
|
||||
|
||||
gbr_metadata.SetPadPinFunction( pad->GetPinFunction(), allowUtf8, true );
|
||||
metadata.SetPadName( pad->GetNumber(), allowUtf8, true );
|
||||
metadata.SetPadPinFunction( pad->GetPinFunction(), allowUtf8, true );
|
||||
|
||||
// Flashes a round, 0 sized round shape at pad position
|
||||
plotter.FlashPadCircle( pad->GetPosition(), other_pads_mark_size, FILLED,
|
||||
&gbr_metadata );
|
||||
plotter.FlashPadCircle( pad->GetPosition(), other_pads_mark_size, FILLED, &metadata );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -296,7 +283,8 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
brd_plotter.SetLayerSet( LSET( Edge_Cuts ) );
|
||||
|
||||
// Plot edge layer and graphic items
|
||||
brd_plotter.PlotBoardGraphicItems();
|
||||
for( const BOARD_ITEM* item : m_pcb->Drawings() )
|
||||
brd_plotter.PlotBoardGraphicItem( item );
|
||||
|
||||
// Draw footprint other graphic items:
|
||||
for( FOOTPRINT* footprint : fp_list )
|
||||
|
@ -304,7 +292,7 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER
|
|||
for( BOARD_ITEM* item : footprint->GraphicalItems() )
|
||||
{
|
||||
if( item->Type() == PCB_SHAPE_T && item->GetLayer() == Edge_Cuts )
|
||||
brd_plotter.PlotPcbShape( static_cast<PCB_SHAPE*>( item ) );
|
||||
brd_plotter.PlotShape( static_cast<PCB_SHAPE*>( item ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,12 +32,12 @@
|
|||
#include <convert_basic_shapes_to_polygon.h>
|
||||
#include <pcb_track.h>
|
||||
#include <base_units.h>
|
||||
#include <bitmaps.h>
|
||||
//#include <bitmaps.h>
|
||||
#include <string_utils.h>
|
||||
#include <view/view.h>
|
||||
#include <settings/color_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <i18n_utility.h>
|
||||
//#include <i18n_utility.h>
|
||||
#include <geometry/seg.h>
|
||||
#include <geometry/shape_segment.h>
|
||||
#include <geometry/shape_circle.h>
|
||||
|
@ -460,9 +460,7 @@ std::shared_ptr<SHAPE_SEGMENT> PCB_VIA::GetEffectiveHoleShape() const
|
|||
|
||||
bool PCB_VIA::IsTented() const
|
||||
{
|
||||
const BOARD* board = GetBoard();
|
||||
|
||||
if( board )
|
||||
if( const BOARD* board = GetBoard() )
|
||||
return board->GetTentVias();
|
||||
else
|
||||
return true;
|
||||
|
@ -471,9 +469,7 @@ bool PCB_VIA::IsTented() const
|
|||
|
||||
int PCB_VIA::GetSolderMaskExpansion() const
|
||||
{
|
||||
const BOARD* board = GetBoard();
|
||||
|
||||
if( board )
|
||||
if( const BOARD* board = GetBoard() )
|
||||
return board->GetDesignSettings().m_SolderMaskExpansion;
|
||||
else
|
||||
return 0;
|
||||
|
@ -615,7 +611,7 @@ void PCB_VIA::SanitizeLayers()
|
|||
|
||||
bool PCB_VIA::FlashLayer( LSET aLayers ) const
|
||||
{
|
||||
for( auto layer : aLayers.Seq() )
|
||||
for( PCB_LAYER_ID layer : aLayers.Seq() )
|
||||
{
|
||||
if( FlashLayer( layer ) )
|
||||
return true;
|
||||
|
@ -738,9 +734,8 @@ double PCB_TRACK::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
|||
const BOX2I PCB_TRACK::ViewBBox() const
|
||||
{
|
||||
BOX2I bbox = GetBoundingBox();
|
||||
const BOARD* board = GetBoard();
|
||||
|
||||
if( board )
|
||||
if( const BOARD* board = GetBoard() )
|
||||
bbox.Inflate( 2 * board->GetDesignSettings().GetBiggestClearanceValue() );
|
||||
else
|
||||
bbox.Inflate( GetWidth() ); // Add a bit extra for safety
|
||||
|
@ -777,7 +772,6 @@ double PCB_VIA::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
|||
|
||||
PCB_PAINTER* painter = static_cast<PCB_PAINTER*>( aView->GetPainter() );
|
||||
PCB_RENDER_SETTINGS* renderSettings = painter->GetSettings();
|
||||
const BOARD* board = GetBoard();
|
||||
LSET visible = LSET::AllLayersMask();
|
||||
|
||||
// Meta control for hiding all vias
|
||||
|
@ -785,7 +779,7 @@ double PCB_VIA::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
|
|||
return HIDE;
|
||||
|
||||
// Handle board visibility
|
||||
if( board )
|
||||
if( const BOARD* board = GetBoard() )
|
||||
visible = board->GetVisibleLayers() & board->GetEnabledLayers();
|
||||
|
||||
// In high contrast mode don't show vias that don't cross the high-contrast layer
|
||||
|
@ -1160,13 +1154,6 @@ EDA_ANGLE PCB_ARC::GetArcAngleStart() const
|
|||
}
|
||||
|
||||
|
||||
EDA_ANGLE PCB_ARC::GetArcAngleEnd() const
|
||||
{
|
||||
EDA_ANGLE angleEnd( m_End - GetPosition() );
|
||||
return angleEnd.Normalize();
|
||||
}
|
||||
|
||||
|
||||
bool PCB_TRACK::cmp_tracks::operator() ( const PCB_TRACK* a, const PCB_TRACK* b ) const
|
||||
{
|
||||
if( a->GetNetCode() != b->GetNetCode() )
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
* for curved tracks (PCB_ARC) and vias (PCB_VIA). All told there are three KICAD_Ts:
|
||||
* PCB_TRACK_T, PCB_ARC_T, and PCB_VIA_T.
|
||||
*
|
||||
* For vias there is a further VIATYPE which indicates THROUGH, BLIND_BURIED, or
|
||||
* MICROVIA, which are supported by the synthetic KICAD_Ts PCB_LOCATE_STDVIA_T,
|
||||
* PCB_LOCATE_BBVIA_T, and PCB_LOCATE_UVIA_T.
|
||||
* For vias there is a further VIATYPE which indicates THROUGH, BLIND_BURIED, or MICROVIA,
|
||||
* which are supported by the synthetic KICAD_Ts PCB_LOCATE_STDVIA_T, PCB_LOCATE_BBVIA_T, and
|
||||
* PCB_LOCATE_UVIA_T.
|
||||
*/
|
||||
|
||||
#ifndef CLASS_TRACK_H
|
||||
|
@ -280,7 +280,6 @@ protected:
|
|||
VECTOR2I m_End; ///< Line end point
|
||||
|
||||
double m_CachedLOD; ///< Last LOD used to draw this track's net
|
||||
|
||||
double m_CachedScale; ///< Last zoom scale used to draw this track's net.
|
||||
};
|
||||
|
||||
|
@ -290,8 +289,7 @@ class PCB_ARC : public PCB_TRACK
|
|||
public:
|
||||
PCB_ARC( BOARD_ITEM* aParent ) :
|
||||
PCB_TRACK( aParent, PCB_ARC_T )
|
||||
{
|
||||
};
|
||||
{ }
|
||||
|
||||
PCB_ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc );
|
||||
|
||||
|
@ -316,10 +314,7 @@ public:
|
|||
void SetMid( const VECTOR2I& aMid ) { m_Mid = aMid; }
|
||||
const VECTOR2I& GetMid() const { return m_Mid; }
|
||||
|
||||
void SetPosition( const VECTOR2I& aPos ) override
|
||||
{
|
||||
m_Start = aPos;
|
||||
}
|
||||
void SetPosition( const VECTOR2I& aPos ) override { m_Start = aPos; }
|
||||
|
||||
virtual VECTOR2I GetPosition() const override;
|
||||
|
||||
|
@ -328,7 +323,6 @@ public:
|
|||
double GetRadius() const;
|
||||
EDA_ANGLE GetAngle() const;
|
||||
EDA_ANGLE GetArcAngleStart() const;
|
||||
EDA_ANGLE GetArcAngleEnd() const;
|
||||
virtual bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
|
||||
|
||||
virtual bool HitTest( const BOX2I& aRect, bool aContained = true,
|
||||
|
@ -551,11 +545,6 @@ public:
|
|||
bool GetIsFree() const { return m_isFree; }
|
||||
void SetIsFree( bool aFree = true ) { m_isFree = aFree; }
|
||||
|
||||
/**
|
||||
* @return true if the drill value is default value (-1)
|
||||
*/
|
||||
bool IsDrillDefault() const { return m_drill <= 0; }
|
||||
|
||||
// @copydoc BOARD_ITEM::GetEffectiveShape
|
||||
std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER,
|
||||
FLASHING aFlash = FLASHING::DEFAULT ) const override;
|
||||
|
|
|
@ -55,13 +55,11 @@ class wxFileName;
|
|||
class BRDITEMS_PLOTTER : public PCB_PLOT_PARAMS
|
||||
{
|
||||
public:
|
||||
BRDITEMS_PLOTTER( PLOTTER* aPlotter, BOARD* aBoard, const PCB_PLOT_PARAMS& aPlotOpts )
|
||||
: PCB_PLOT_PARAMS( aPlotOpts )
|
||||
{
|
||||
m_plotter = aPlotter;
|
||||
m_board = aBoard;
|
||||
m_maxError = aBoard->GetDesignSettings().m_MaxError;
|
||||
}
|
||||
BRDITEMS_PLOTTER( PLOTTER* aPlotter, BOARD* aBoard, const PCB_PLOT_PARAMS& aPlotOpts ) :
|
||||
PCB_PLOT_PARAMS( aPlotOpts ),
|
||||
m_plotter( aPlotter ),
|
||||
m_board( aBoard )
|
||||
{ }
|
||||
|
||||
/**
|
||||
* @return a 'width adjustment' for the postscript engine
|
||||
|
@ -79,20 +77,13 @@ public:
|
|||
// Basic functions to plot a board item
|
||||
void SetLayerSet( LSET aLayerMask ) { m_layerMask = aLayerMask; }
|
||||
void PlotFootprintGraphicItems( const FOOTPRINT* aFootprint );
|
||||
void PlotFootprintTextItem( const PCB_TEXT* aText, const COLOR4D& aColor );
|
||||
|
||||
/*
|
||||
* Reference, Value, and other fields are plotted only if the corresponding option is enabled.
|
||||
* Invisible text fields are plotted only if PlotInvisibleText option is set.
|
||||
*/
|
||||
void PlotFootprintTextItems( const FOOTPRINT* aFootprint );
|
||||
|
||||
void PlotDimension( const PCB_DIMENSION_BASE* aDim );
|
||||
void PlotPcbTarget( const PCB_TARGET* aMire );
|
||||
void PlotFilledAreas( const ZONE* aZone, PCB_LAYER_ID aLayer,
|
||||
const SHAPE_POLY_SET& aPolysList );
|
||||
void PlotPcbText( const EDA_TEXT* aText, PCB_LAYER_ID aLayer, bool aIsKnockout );
|
||||
void PlotPcbShape( const PCB_SHAPE* aShape );
|
||||
void PlotZones( const ZONE* aZone, PCB_LAYER_ID aLayer, const SHAPE_POLY_SET& aPolysList );
|
||||
void PlotText( const EDA_TEXT* aText, PCB_LAYER_ID aLayer, bool aIsKnockout );
|
||||
void PlotShape( const PCB_SHAPE* aShape );
|
||||
|
||||
/**
|
||||
* Plot a pad.
|
||||
|
@ -105,8 +96,7 @@ public:
|
|||
/**
|
||||
* Plot items like text and graphics but not tracks and footprints.
|
||||
*/
|
||||
void PlotBoardGraphicItems();
|
||||
void PlotPcbGraphicItem( const BOARD_ITEM* item );
|
||||
void PlotBoardGraphicItem( const BOARD_ITEM* item );
|
||||
|
||||
/**
|
||||
* Draw a drill mark for pads and vias.
|
||||
|
@ -138,7 +128,6 @@ private:
|
|||
|
||||
PLOTTER* m_plotter;
|
||||
BOARD* m_board;
|
||||
int m_maxError; // For use when approximating shapes as polygons
|
||||
LSET m_layerMask;
|
||||
};
|
||||
|
||||
|
|
|
@ -284,7 +284,8 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||
bool sketchPads = ( onFrontFab || onBackFab ) && aPlotOpt.GetSketchPadsOnFabLayers();
|
||||
|
||||
// Plot edge layer and graphic items
|
||||
itemplotter.PlotBoardGraphicItems();
|
||||
for( const BOARD_ITEM* item : aBoard->Drawings() )
|
||||
itemplotter.PlotBoardGraphicItem( item );
|
||||
|
||||
// Draw footprint texts:
|
||||
for( const FOOTPRINT* footprint : aBoard->Footprints() )
|
||||
|
@ -376,7 +377,9 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||
// Note: a custom pad can have its pad anchor with size = 0
|
||||
if( pad->GetShape() != PAD_SHAPE::CUSTOM
|
||||
&& ( padPlotsSize.x <= 0 || padPlotsSize.y <= 0 ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
switch( pad->GetShape() )
|
||||
{
|
||||
|
@ -689,13 +692,13 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||
}
|
||||
}
|
||||
|
||||
itemplotter.PlotFilledAreas( zone, layer, mainArea );
|
||||
itemplotter.PlotZones( zone, layer, mainArea );
|
||||
|
||||
if( !islands.IsEmpty() )
|
||||
{
|
||||
ZONE dummy( *zone );
|
||||
dummy.SetNet( &nonet );
|
||||
itemplotter.PlotFilledAreas( &dummy, layer, islands );
|
||||
itemplotter.PlotZones( &dummy, layer, islands );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -893,7 +896,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||
else if( item->IsOnLayer( Edge_Cuts ) )
|
||||
{
|
||||
if( item->Type() == PCB_SHAPE_T )
|
||||
itemplotter.PlotPcbShape( static_cast<const PCB_SHAPE*>( item ) );
|
||||
itemplotter.PlotShape( static_cast<const PCB_SHAPE*>( item ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -951,7 +954,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||
}
|
||||
else if( item->IsOnLayer( Edge_Cuts ) )
|
||||
{
|
||||
itemplotter.PlotPcbGraphicItem( item );
|
||||
itemplotter.PlotBoardGraphicItem( item );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -989,7 +992,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask,
|
|||
areas.BooleanAdd( initialPolys, SHAPE_POLY_SET::PM_FAST );
|
||||
areas.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
||||
itemplotter.PlotFilledAreas( &zone, layer, areas );
|
||||
itemplotter.PlotZones( &zone, layer, areas );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include <algorithm> // for min
|
||||
#include <bitset> // for bitset, operator&, __bi...
|
||||
#include <math.h> // for abs
|
||||
#include <stddef.h> // for NULL, size_t
|
||||
|
||||
#include <geometry/seg.h> // for SEG
|
||||
#include <geometry/shape_circle.h>
|
||||
|
@ -37,20 +36,15 @@
|
|||
#include <math/vector2d.h> // for VECTOR2I
|
||||
#include <plotters/plotter_gerber.h>
|
||||
#include <trigo.h>
|
||||
#include <callback_gal.h>
|
||||
|
||||
#include <board_design_settings.h> // for BOARD_DESIGN_SETTINGS
|
||||
#include <core/typeinfo.h> // for dyn_cast, PCB_DIMENSION_T
|
||||
#include <gbr_metadata.h>
|
||||
#include <gbr_netlist_metadata.h> // for GBR_NETLIST_METADATA
|
||||
#include <layer_ids.h> // for LSET, IsCopperLayer
|
||||
#include <pad_shapes.h> // for PAD_ATTRIB::NPTH
|
||||
#include <pcbplot.h>
|
||||
#include <pcb_plot_params.h> // for PCB_PLOT_PARAMS, PCB_PL...
|
||||
#include <advanced_config.h>
|
||||
|
||||
#include <board.h>
|
||||
#include <board_item.h> // for BOARD_ITEM, S_CIRCLE
|
||||
#include <pcb_dimension.h>
|
||||
#include <pcb_shape.h>
|
||||
#include <footprint.h>
|
||||
|
@ -68,8 +62,7 @@ COLOR4D BRDITEMS_PLOTTER::getColor( int aLayer ) const
|
|||
{
|
||||
COLOR4D color = ColorSettings()->GetColor( aLayer );
|
||||
|
||||
// A hack to avoid plotting a white item in white color, expecting the paper
|
||||
// is also white: use a non white color:
|
||||
// A hack to avoid plotting a white item in white color on white paper
|
||||
if( color == COLOR4D::WHITE )
|
||||
color = COLOR4D( LIGHTGRAY );
|
||||
|
||||
|
@ -80,7 +73,7 @@ COLOR4D BRDITEMS_PLOTTER::getColor( int aLayer ) const
|
|||
void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_MODE aPlotMode )
|
||||
{
|
||||
VECTOR2I shape_pos = aPad->ShapePos();
|
||||
GBR_METADATA gbr_metadata;
|
||||
GBR_METADATA metadata;
|
||||
|
||||
bool plotOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any();
|
||||
bool plotOnExternalCopperLayer = ( m_layerMask & LSET::ExternalCuMask() ).any();
|
||||
|
@ -90,33 +83,33 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_
|
|||
// Not yet in use.
|
||||
// bool isPadOnBoardTechLayers = ( aPad->GetLayerSet() & LSET::AllBoardTechMask() ).any();
|
||||
|
||||
gbr_metadata.SetCmpReference( aPad->GetParent()->GetReference() );
|
||||
metadata.SetCmpReference( aPad->GetParent()->GetReference() );
|
||||
|
||||
if( plotOnCopperLayer )
|
||||
{
|
||||
gbr_metadata.SetNetAttribType( GBR_NETINFO_ALL );
|
||||
gbr_metadata.SetCopper( true );
|
||||
metadata.SetNetAttribType( GBR_NETINFO_ALL );
|
||||
metadata.SetCopper( true );
|
||||
|
||||
// Gives a default attribute, for instance for pads used as tracks in net ties:
|
||||
// Connector pads and SMD pads are on external layers
|
||||
// if on internal layers, they are certainly used as net tie
|
||||
// and are similar to tracks: just conductor items
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR );
|
||||
|
||||
const bool useUTF8 = false;
|
||||
const bool useQuoting = false;
|
||||
gbr_metadata.SetPadName( aPad->GetNumber(), useUTF8, useQuoting );
|
||||
metadata.SetPadName( aPad->GetNumber(), useUTF8, useQuoting );
|
||||
|
||||
if( !aPad->GetNumber().IsEmpty() )
|
||||
gbr_metadata.SetPadPinFunction( aPad->GetPinFunction(), useUTF8, useQuoting );
|
||||
metadata.SetPadPinFunction( aPad->GetPinFunction(), useUTF8, useQuoting );
|
||||
|
||||
gbr_metadata.SetNetName( aPad->GetNetname() );
|
||||
metadata.SetNetName( aPad->GetNetname() );
|
||||
|
||||
// Some pads are mechanical pads ( through hole or smd )
|
||||
// when this is the case, they have no pad name and/or are not plated.
|
||||
// In this case gerber files have slightly different attributes.
|
||||
if( aPad->GetAttribute() == PAD_ATTRIB::NPTH || aPad->GetNumber().IsEmpty() )
|
||||
gbr_metadata.m_NetlistMetadata.m_NotInNet = true;
|
||||
metadata.m_NetlistMetadata.m_NotInNet = true;
|
||||
|
||||
if( !plotOnExternalCopperLayer )
|
||||
{
|
||||
|
@ -126,7 +119,7 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_
|
|||
// Currently, Pcbnew does not handle embedded component, so we disable the .P
|
||||
// attribute on internal layers
|
||||
// Note the Gerber doc is not really clear about through holes pads about the .P
|
||||
gbr_metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_NET |
|
||||
metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_NET |
|
||||
GBR_NETLIST_METADATA::GBR_NETINFO_CMP );
|
||||
|
||||
}
|
||||
|
@ -139,25 +132,22 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_
|
|||
switch( aPad->GetAttribute() )
|
||||
{
|
||||
case PAD_ATTRIB::NPTH: // Mechanical pad through hole
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_WASHERPAD );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_WASHERPAD );
|
||||
break;
|
||||
|
||||
case PAD_ATTRIB::PTH : // Pad through hole, a hole is also expected
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_COMPONENTPAD );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_COMPONENTPAD );
|
||||
break;
|
||||
|
||||
case PAD_ATTRIB::CONN: // Connector pads, no solder paste but with solder mask.
|
||||
if( plotOnExternalCopperLayer )
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONNECTORPAD );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONNECTORPAD );
|
||||
break;
|
||||
|
||||
case PAD_ATTRIB::SMD: // SMD pads (on external copper layer only)
|
||||
// with solder paste and mask
|
||||
if( plotOnExternalCopperLayer )
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_SMDPAD_CUDEF );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_SMDPAD_CUDEF );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -167,34 +157,28 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_
|
|||
{
|
||||
case PAD_PROP::BGA: // Only applicable to outer layers
|
||||
if( plotOnExternalCopperLayer )
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_BGAPAD_CUDEF );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_BGAPAD_CUDEF );
|
||||
break;
|
||||
|
||||
case PAD_PROP::FIDUCIAL_GLBL:
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_FIDUCIAL_GLBL );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_FIDUCIAL_GLBL );
|
||||
break;
|
||||
|
||||
case PAD_PROP::FIDUCIAL_LOCAL:
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_FIDUCIAL_LOCAL );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_FIDUCIAL_LOCAL );
|
||||
break;
|
||||
|
||||
case PAD_PROP::TESTPOINT: // Only applicable to outer layers
|
||||
if( plotOnExternalCopperLayer )
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_TESTPOINT );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_TESTPOINT );
|
||||
break;
|
||||
|
||||
case PAD_PROP::HEATSINK:
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_HEATSINKPAD );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_HEATSINKPAD );
|
||||
break;
|
||||
|
||||
case PAD_PROP::CASTELLATED:
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CASTELLATEDPAD );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CASTELLATEDPAD );
|
||||
break;
|
||||
|
||||
case PAD_PROP::NONE:
|
||||
|
@ -203,11 +187,11 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_
|
|||
|
||||
// Ensure NPTH pads have *always* the GBR_APERTURE_ATTRIB_WASHERPAD attribute
|
||||
if( aPad->GetAttribute() == PAD_ATTRIB::NPTH )
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_WASHERPAD );
|
||||
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_WASHERPAD );
|
||||
}
|
||||
else
|
||||
{
|
||||
gbr_metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_CMP );
|
||||
metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_CMP );
|
||||
}
|
||||
|
||||
// Set plot color (change WHITE to LIGHTGRAY because
|
||||
|
@ -215,27 +199,27 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_
|
|||
m_plotter->SetColor( aColor != WHITE ? aColor : LIGHTGRAY);
|
||||
|
||||
if( aPlotMode == SKETCH )
|
||||
m_plotter->SetCurrentLineWidth( GetSketchPadLineWidth(), &gbr_metadata );
|
||||
m_plotter->SetCurrentLineWidth( GetSketchPadLineWidth(), &metadata );
|
||||
|
||||
switch( aPad->GetShape() )
|
||||
{
|
||||
case PAD_SHAPE::CIRCLE:
|
||||
m_plotter->FlashPadCircle( shape_pos, aPad->GetSize().x, aPlotMode, &gbr_metadata );
|
||||
m_plotter->FlashPadCircle( shape_pos, aPad->GetSize().x, aPlotMode, &metadata );
|
||||
break;
|
||||
|
||||
case PAD_SHAPE::OVAL:
|
||||
m_plotter->FlashPadOval( shape_pos, aPad->GetSize(), aPad->GetOrientation(), aPlotMode,
|
||||
&gbr_metadata );
|
||||
&metadata );
|
||||
break;
|
||||
|
||||
case PAD_SHAPE::RECTANGLE:
|
||||
m_plotter->FlashPadRect( shape_pos, aPad->GetSize(), aPad->GetOrientation(), aPlotMode,
|
||||
&gbr_metadata );
|
||||
&metadata );
|
||||
break;
|
||||
|
||||
case PAD_SHAPE::ROUNDRECT:
|
||||
m_plotter->FlashPadRoundRect( shape_pos, aPad->GetSize(), aPad->GetRoundRectCornerRadius(),
|
||||
aPad->GetOrientation(), aPlotMode, &gbr_metadata );
|
||||
aPad->GetOrientation(), aPlotMode, &metadata );
|
||||
break;
|
||||
|
||||
case PAD_SHAPE::TRAPEZOID:
|
||||
|
@ -254,8 +238,7 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_
|
|||
coord[2] = VECTOR2I( half_size.x - trap_delta.y, -half_size.y + trap_delta.x );
|
||||
coord[3] = VECTOR2I( -half_size.x + trap_delta.y, -half_size.y - trap_delta.x );
|
||||
|
||||
m_plotter->FlashPadTrapez( shape_pos, coord, aPad->GetOrientation(), aPlotMode,
|
||||
&gbr_metadata );
|
||||
m_plotter->FlashPadTrapez( shape_pos, coord, aPad->GetOrientation(), aPlotMode, &metadata );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -268,8 +251,7 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_
|
|||
aPad->GetRoundRectCornerRadius(),
|
||||
aPad->GetChamferRectRatio(),
|
||||
aPad->GetChamferPositions(),
|
||||
aPad->GetOrientation(), aPlotMode,
|
||||
&gbr_metadata );
|
||||
aPad->GetOrientation(), aPlotMode, &metadata );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -283,7 +265,7 @@ void BRDITEMS_PLOTTER::PlotPad( const PAD* aPad, const COLOR4D& aColor, OUTLINE_
|
|||
if( polygons->OutlineCount() )
|
||||
{
|
||||
m_plotter->FlashPadCustom( shape_pos, aPad->GetSize(), aPad->GetOrientation(),
|
||||
polygons.get(), aPlotMode, &gbr_metadata );
|
||||
polygons.get(), aPlotMode, &metadata );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -300,7 +282,7 @@ void BRDITEMS_PLOTTER::PlotFootprintTextItems( const FOOTPRINT* aFootprint )
|
|||
if( GetPlotReference() && m_layerMask[textLayer]
|
||||
&& ( textItem->IsVisible() || GetPlotInvisibleText() ) )
|
||||
{
|
||||
PlotPcbText( textItem, textLayer, textItem->IsKnockout() );
|
||||
PlotText( textItem, textLayer, textItem->IsKnockout() );
|
||||
}
|
||||
|
||||
textItem = &aFootprint->Value();
|
||||
|
@ -309,7 +291,7 @@ void BRDITEMS_PLOTTER::PlotFootprintTextItems( const FOOTPRINT* aFootprint )
|
|||
if( GetPlotValue() && m_layerMask[textLayer]
|
||||
&& ( textItem->IsVisible() || GetPlotInvisibleText() ) )
|
||||
{
|
||||
PlotPcbText( textItem, textLayer, textItem->IsKnockout() );
|
||||
PlotText( textItem, textLayer, textItem->IsKnockout() );
|
||||
}
|
||||
|
||||
for( const BOARD_ITEM* item : aFootprint->GraphicalItems() )
|
||||
|
@ -336,31 +318,31 @@ void BRDITEMS_PLOTTER::PlotFootprintTextItems( const FOOTPRINT* aFootprint )
|
|||
if( textItem->GetText() == wxT( "${VALUE}" ) && !GetPlotValue() )
|
||||
continue;
|
||||
|
||||
PlotPcbText( textItem, textLayer, textItem->IsKnockout() );
|
||||
PlotText( textItem, textLayer, textItem->IsKnockout() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BRDITEMS_PLOTTER::PlotPcbGraphicItem( const BOARD_ITEM* item )
|
||||
void BRDITEMS_PLOTTER::PlotBoardGraphicItem( const BOARD_ITEM* item )
|
||||
{
|
||||
switch( item->Type() )
|
||||
{
|
||||
case PCB_SHAPE_T:
|
||||
PlotPcbShape( static_cast<const PCB_SHAPE*>( item ) );
|
||||
PlotShape( static_cast<const PCB_SHAPE*>( item ) );
|
||||
break;
|
||||
|
||||
case PCB_TEXT_T:
|
||||
{
|
||||
const PCB_TEXT* text = static_cast<const PCB_TEXT*>( item );
|
||||
PlotPcbText( text, text->GetLayer(), text->IsKnockout() );
|
||||
PlotText( text, text->GetLayer(), text->IsKnockout() );
|
||||
break;
|
||||
}
|
||||
|
||||
case PCB_TEXTBOX_T:
|
||||
{
|
||||
const PCB_TEXTBOX* textbox = static_cast<const PCB_TEXTBOX*>( item );
|
||||
PlotPcbText( textbox, textbox->GetLayer(), textbox->IsKnockout() );
|
||||
PlotPcbShape( textbox );
|
||||
PlotText( textbox, textbox->GetLayer(), textbox->IsKnockout() );
|
||||
PlotShape( textbox );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -382,30 +364,23 @@ void BRDITEMS_PLOTTER::PlotPcbGraphicItem( const BOARD_ITEM* item )
|
|||
}
|
||||
|
||||
|
||||
void BRDITEMS_PLOTTER::PlotBoardGraphicItems()
|
||||
{
|
||||
for( const BOARD_ITEM* item : m_board->Drawings() )
|
||||
PlotPcbGraphicItem( item );
|
||||
}
|
||||
|
||||
|
||||
void BRDITEMS_PLOTTER::PlotDimension( const PCB_DIMENSION_BASE* aDim )
|
||||
{
|
||||
if( !m_layerMask[aDim->GetLayer()] )
|
||||
return;
|
||||
|
||||
PCB_SHAPE draw;
|
||||
|
||||
draw.SetStroke( STROKE_PARAMS( aDim->GetLineThickness(), PLOT_DASH_TYPE::SOLID ) );
|
||||
draw.SetLayer( aDim->GetLayer() );
|
||||
|
||||
COLOR4D color = ColorSettings()->GetColor( aDim->GetLayer() );
|
||||
|
||||
// Set plot color (change WHITE to LIGHTGRAY because
|
||||
// the white items are not seen on a white paper or screen
|
||||
m_plotter->SetColor( color != WHITE ? color : LIGHTGRAY);
|
||||
|
||||
PlotPcbText( aDim, aDim->GetLayer(), false );
|
||||
PlotText( aDim, aDim->GetLayer(), false );
|
||||
|
||||
PCB_SHAPE temp_item;
|
||||
|
||||
temp_item.SetStroke( STROKE_PARAMS( aDim->GetLineThickness(), PLOT_DASH_TYPE::SOLID ) );
|
||||
temp_item.SetLayer( aDim->GetLayer() );
|
||||
|
||||
for( const std::shared_ptr<SHAPE>& shape : aDim->GetShapes() )
|
||||
{
|
||||
|
@ -415,11 +390,11 @@ void BRDITEMS_PLOTTER::PlotDimension( const PCB_DIMENSION_BASE* aDim )
|
|||
{
|
||||
const SEG& seg = static_cast<const SHAPE_SEGMENT*>( shape.get() )->GetSeg();
|
||||
|
||||
draw.SetShape( SHAPE_T::SEGMENT );
|
||||
draw.SetStart( seg.A );
|
||||
draw.SetEnd( seg.B );
|
||||
temp_item.SetShape( SHAPE_T::SEGMENT );
|
||||
temp_item.SetStart( seg.A );
|
||||
temp_item.SetEnd( seg.B );
|
||||
|
||||
PlotPcbShape( &draw );
|
||||
PlotShape( &temp_item );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -428,12 +403,12 @@ void BRDITEMS_PLOTTER::PlotDimension( const PCB_DIMENSION_BASE* aDim )
|
|||
VECTOR2I start( shape->Centre() );
|
||||
int radius = static_cast<const SHAPE_CIRCLE*>( shape.get() )->GetRadius();
|
||||
|
||||
draw.SetShape( SHAPE_T::CIRCLE );
|
||||
draw.SetFilled( false );
|
||||
draw.SetStart( start );
|
||||
draw.SetEnd( VECTOR2I( start.x + radius, start.y ) );
|
||||
temp_item.SetShape( SHAPE_T::CIRCLE );
|
||||
temp_item.SetFilled( false );
|
||||
temp_item.SetStart( start );
|
||||
temp_item.SetEnd( VECTOR2I( start.x + radius, start.y ) );
|
||||
|
||||
PlotPcbShape( &draw );
|
||||
PlotShape( &temp_item );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -453,24 +428,24 @@ void BRDITEMS_PLOTTER::PlotPcbTarget( const PCB_TARGET* aMire )
|
|||
|
||||
m_plotter->SetColor( getColor( aMire->GetLayer() ) );
|
||||
|
||||
PCB_SHAPE draw;
|
||||
PCB_SHAPE temp_item;
|
||||
|
||||
draw.SetShape( SHAPE_T::CIRCLE );
|
||||
draw.SetFilled( false );
|
||||
draw.SetStroke( STROKE_PARAMS( aMire->GetWidth(), PLOT_DASH_TYPE::SOLID ) );
|
||||
draw.SetLayer( aMire->GetLayer() );
|
||||
draw.SetStart( aMire->GetPosition() );
|
||||
temp_item.SetShape( SHAPE_T::CIRCLE );
|
||||
temp_item.SetFilled( false );
|
||||
temp_item.SetStroke( STROKE_PARAMS( aMire->GetWidth(), PLOT_DASH_TYPE::SOLID ) );
|
||||
temp_item.SetLayer( aMire->GetLayer() );
|
||||
temp_item.SetStart( aMire->GetPosition() );
|
||||
radius = aMire->GetSize() / 3;
|
||||
|
||||
if( aMire->GetShape() ) // shape X
|
||||
if( aMire->GetShape() ) // temp_item X
|
||||
radius = aMire->GetSize() / 2;
|
||||
|
||||
// Draw the circle
|
||||
draw.SetEnd( VECTOR2I( draw.GetStart().x + radius, draw.GetStart().y ) );
|
||||
temp_item.SetEnd( VECTOR2I( temp_item.GetStart().x + radius, temp_item.GetStart().y ) );
|
||||
|
||||
PlotPcbShape( &draw );
|
||||
PlotShape( &temp_item );
|
||||
|
||||
draw.SetShape( SHAPE_T::SEGMENT );
|
||||
temp_item.SetShape( SHAPE_T::SEGMENT );
|
||||
|
||||
radius = aMire->GetSize() / 2;
|
||||
dx1 = radius;
|
||||
|
@ -487,14 +462,14 @@ void BRDITEMS_PLOTTER::PlotPcbTarget( const PCB_TARGET* aMire )
|
|||
|
||||
VECTOR2I mirePos( aMire->GetPosition() );
|
||||
|
||||
// Draw the X or + shape:
|
||||
draw.SetStart( VECTOR2I( mirePos.x - dx1, mirePos.y - dy1 ) );
|
||||
draw.SetEnd( VECTOR2I( mirePos.x + dx1, mirePos.y + dy1 ) );
|
||||
PlotPcbShape( &draw );
|
||||
// Draw the X or + temp_item:
|
||||
temp_item.SetStart( VECTOR2I( mirePos.x - dx1, mirePos.y - dy1 ) );
|
||||
temp_item.SetEnd( VECTOR2I( mirePos.x + dx1, mirePos.y + dy1 ) );
|
||||
PlotShape( &temp_item );
|
||||
|
||||
draw.SetStart( VECTOR2I( mirePos.x - dx2, mirePos.y - dy2 ) );
|
||||
draw.SetEnd( VECTOR2I( mirePos.x + dx2, mirePos.y + dy2 ) );
|
||||
PlotPcbShape( &draw );
|
||||
temp_item.SetStart( VECTOR2I( mirePos.x - dx2, mirePos.y - dy2 ) );
|
||||
temp_item.SetEnd( VECTOR2I( mirePos.x + dx2, mirePos.y + dy2 ) );
|
||||
PlotShape( &temp_item );
|
||||
}
|
||||
|
||||
|
||||
|
@ -512,7 +487,7 @@ void BRDITEMS_PLOTTER::PlotFootprintGraphicItems( const FOOTPRINT* aFootprint )
|
|||
const PCB_SHAPE* shape = static_cast<const PCB_SHAPE*>( item );
|
||||
|
||||
if( m_layerMask[ shape->GetLayer() ] )
|
||||
PlotPcbShape( shape );
|
||||
PlotShape( shape );
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -523,8 +498,8 @@ void BRDITEMS_PLOTTER::PlotFootprintGraphicItems( const FOOTPRINT* aFootprint )
|
|||
|
||||
if( m_layerMask[ textbox->GetLayer() ] )
|
||||
{
|
||||
PlotPcbText( textbox, textbox->GetLayer(), textbox->IsKnockout() );
|
||||
PlotPcbShape( textbox );
|
||||
PlotText( textbox, textbox->GetLayer(), textbox->IsKnockout() );
|
||||
PlotShape( textbox );
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -556,16 +531,18 @@ void BRDITEMS_PLOTTER::PlotFootprintGraphicItems( const FOOTPRINT* aFootprint )
|
|||
|
||||
|
||||
#include <font/stroke_font.h>
|
||||
void BRDITEMS_PLOTTER::PlotPcbText( const EDA_TEXT* aText, PCB_LAYER_ID aLayer, bool aIsKnockout )
|
||||
void BRDITEMS_PLOTTER::PlotText( const EDA_TEXT* aText, PCB_LAYER_ID aLayer, bool aIsKnockout )
|
||||
{
|
||||
KIFONT::FONT* font = aText->GetFont();
|
||||
|
||||
if( !font )
|
||||
{
|
||||
font = KIFONT::FONT::GetFont( m_plotter->RenderSettings()
|
||||
? m_plotter->RenderSettings()->GetDefaultFont()
|
||||
: wxString( wxEmptyString ),
|
||||
aText->IsBold(), aText->IsItalic() );
|
||||
wxString defaultFontName; // empty string is the KiCad stroke font
|
||||
|
||||
if( m_plotter->RenderSettings() )
|
||||
defaultFontName = m_plotter->RenderSettings()->GetDefaultFont();
|
||||
|
||||
font = KIFONT::FONT::GetFont( defaultFontName, aText->IsBold(), aText->IsItalic() );
|
||||
}
|
||||
|
||||
wxString shownText( aText->GetShownText( true ) );
|
||||
|
@ -598,7 +575,8 @@ void BRDITEMS_PLOTTER::PlotPcbText( const EDA_TEXT* aText, PCB_LAYER_ID aLayer,
|
|||
const PCB_TEXT* text = static_cast<const PCB_TEXT*>( aText );
|
||||
SHAPE_POLY_SET finalPoly;
|
||||
|
||||
text->TransformTextToPolySet( finalPoly, 0, m_maxError, ERROR_INSIDE );
|
||||
text->TransformTextToPolySet( finalPoly, 0, m_board->GetDesignSettings().m_MaxError,
|
||||
ERROR_INSIDE );
|
||||
finalPoly.Fracture( SHAPE_POLY_SET::PM_FAST );
|
||||
|
||||
for( int ii = 0; ii < finalPoly.OutlineCount(); ++ii )
|
||||
|
@ -626,10 +604,10 @@ void BRDITEMS_PLOTTER::PlotPcbText( const EDA_TEXT* aText, PCB_LAYER_ID aLayer,
|
|||
}
|
||||
|
||||
|
||||
void BRDITEMS_PLOTTER::PlotFilledAreas( const ZONE* aZone, PCB_LAYER_ID aLayer,
|
||||
const SHAPE_POLY_SET& polysList )
|
||||
void BRDITEMS_PLOTTER::PlotZones( const ZONE* aZone, PCB_LAYER_ID aLayer,
|
||||
const SHAPE_POLY_SET& aPolysList )
|
||||
{
|
||||
if( polysList.IsEmpty() )
|
||||
if( aPolysList.IsEmpty() )
|
||||
return;
|
||||
|
||||
GBR_METADATA gbr_metadata;
|
||||
|
@ -644,8 +622,7 @@ void BRDITEMS_PLOTTER::PlotFilledAreas( const ZONE* aZone, PCB_LAYER_ID aLayer,
|
|||
// be set as conductor
|
||||
if( aZone->GetNetname().IsEmpty() )
|
||||
{
|
||||
gbr_metadata.SetApertureAttrib(
|
||||
GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR );
|
||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_NONCONDUCTOR );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -662,9 +639,9 @@ void BRDITEMS_PLOTTER::PlotFilledAreas( const ZONE* aZone, PCB_LAYER_ID aLayer,
|
|||
* In non filled mode the outline is plotted, but not the filling items
|
||||
*/
|
||||
|
||||
for( int idx = 0; idx < polysList.OutlineCount(); ++idx )
|
||||
for( int idx = 0; idx < aPolysList.OutlineCount(); ++idx )
|
||||
{
|
||||
const SHAPE_LINE_CHAIN& outline = polysList.Outline( idx );
|
||||
const SHAPE_LINE_CHAIN& outline = aPolysList.Outline( idx );
|
||||
|
||||
// Plot the current filled area (as region for Gerber plotter to manage attributes)
|
||||
if( GetPlotMode() == FILLED )
|
||||
|
@ -689,7 +666,7 @@ void BRDITEMS_PLOTTER::PlotFilledAreas( const ZONE* aZone, PCB_LAYER_ID aLayer,
|
|||
}
|
||||
|
||||
|
||||
void BRDITEMS_PLOTTER::PlotPcbShape( const PCB_SHAPE* aShape )
|
||||
void BRDITEMS_PLOTTER::PlotShape( const PCB_SHAPE* aShape )
|
||||
{
|
||||
if( !m_layerMask[aShape->GetLayer()] )
|
||||
return;
|
||||
|
@ -844,8 +821,7 @@ void BRDITEMS_PLOTTER::PlotPcbShape( const PCB_SHAPE* aShape )
|
|||
|
||||
poly.Append( pts[0] ); // Close polygon.
|
||||
|
||||
FILL_T fill_mode = aShape->IsFilled() ? FILL_T::FILLED_SHAPE
|
||||
: FILL_T::NO_FILL;
|
||||
FILL_T fill_mode = aShape->IsFilled() ? FILL_T::FILLED_SHAPE : FILL_T::NO_FILL;
|
||||
|
||||
if( m_plotter->GetPlotterType() == PLOT_FORMAT::GERBER )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue