diff --git a/common/pcb.keywords b/common/pcb.keywords index 251119018d..d2ec44cb9f 100644 --- a/common/pcb.keywords +++ b/common/pcb.keywords @@ -89,6 +89,8 @@ edge_width effects end epsilon_r +fab_layers_line_width +fab_layers_text_dims feature1 feature2 fill diff --git a/common/pcb_plot_params.keywords b/common/pcb_plot_params.keywords index 5be1f4ea12..066a40f799 100644 --- a/common/pcb_plot_params.keywords +++ b/common/pcb_plot_params.keywords @@ -13,7 +13,6 @@ mirror mode outputdirectory outputformat -padsonsilk pcbplotparams plotframeref plotinvisibletext @@ -23,6 +22,7 @@ psa4output pscolor psnegative scaleselection +sketchpadsonfab subtractmaskfromsilk svgprecision svguseinch diff --git a/common/plotters/GERBER_plotter.cpp b/common/plotters/GERBER_plotter.cpp index c430153f85..e7f9bc3c31 100644 --- a/common/plotters/GERBER_plotter.cpp +++ b/common/plotters/GERBER_plotter.cpp @@ -731,8 +731,6 @@ void GERBER_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre, EDA_DRAW_ if( trace_mode == SKETCH ) { - SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH, gbr_metadata ); - if( gbr_metadata ) formatNetAttribute( &gbr_metadata->m_NetlistMetadata ); @@ -825,8 +823,6 @@ void GERBER_PLOTTER::FlashPadRect( const wxPoint& pos, const wxSize& aSize, case 1800: if( trace_mode == SKETCH ) { - SetCurrentLineWidth( USE_DEFAULT_LINE_WIDTH, gbr_metadata ); - if( gbr_metadata ) formatNetAttribute( &gbr_metadata->m_NetlistMetadata ); @@ -1113,8 +1109,7 @@ void GERBER_PLOTTER::FlashPadTrapez( const wxPoint& aPadPos, const wxPoint* aCo metadata = *gbr_metadata; if( aTrace_Mode == SKETCH ) - PlotPoly( cornerList, NO_FILL, USE_DEFAULT_LINE_WIDTH, - &metadata ); + PlotPoly( cornerList, NO_FILL, DO_NOT_SET_LINE_WIDTH, &metadata ); else PlotGerberRegion( cornerList, &metadata ); } @@ -1145,7 +1140,6 @@ void GERBER_PLOTTER::FlashRegularPolygon( const wxPoint& aShapePos, cornerList.push_back( cornerList[0] ); // Close the shape - SetCurrentLineWidth( aDiameter/8, gbr_metadata ); PlotPoly( cornerList, NO_FILL, GetCurrentLineWidth(), gbr_metadata ); } else diff --git a/include/board_design_settings.h b/include/board_design_settings.h index d1de99d067..d300162e70 100644 --- a/include/board_design_settings.h +++ b/include/board_design_settings.h @@ -168,6 +168,7 @@ enum LAYER_CLASS_COPPER, LAYER_CLASS_EDGES, LAYER_CLASS_COURTYARD, + LAYER_CLASS_FAB, LAYER_CLASS_OTHERS, LAYER_CLASS_COUNT diff --git a/pcbnew/board_design_settings.cpp b/pcbnew/board_design_settings.cpp index 1d557cf717..a178f6ff7a 100644 --- a/pcbnew/board_design_settings.cpp +++ b/pcbnew/board_design_settings.cpp @@ -551,6 +551,13 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() : m_TextItalic[ LAYER_CLASS_COURTYARD ] = false; m_TextUpright[ LAYER_CLASS_COURTYARD ] = false; + m_LineThickness[ LAYER_CLASS_FAB ] = Millimeter2iu( DEFAULT_LINE_WIDTH ); + m_TextSize[ LAYER_CLASS_FAB ] = wxSize( Millimeter2iu( DEFAULT_TEXT_SIZE ), + Millimeter2iu( DEFAULT_TEXT_SIZE ) ); + m_TextThickness[ LAYER_CLASS_FAB ] = Millimeter2iu( DEFAULT_TEXT_WIDTH ); + m_TextItalic[ LAYER_CLASS_FAB ] = false; + m_TextUpright[ LAYER_CLASS_FAB ] = false; + m_LineThickness[ LAYER_CLASS_OTHERS ] = Millimeter2iu( DEFAULT_LINE_WIDTH ); m_TextSize[ LAYER_CLASS_OTHERS ] = wxSize( Millimeter2iu( DEFAULT_TEXT_SIZE ), Millimeter2iu( DEFAULT_TEXT_SIZE ) ); @@ -734,6 +741,32 @@ void BOARD_DESIGN_SETTINGS::AppendConfigs( BOARD* aBoard, std::vectorpush_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "FabLineWidth" ), + &m_LineThickness[ LAYER_CLASS_FAB ], + Millimeter2iu( DEFAULT_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), + nullptr, MM_PER_IU ) ); + + aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "FabTextSizeV" ), + &m_TextSize[ LAYER_CLASS_FAB ].x, + Millimeter2iu( DEFAULT_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE, + nullptr, MM_PER_IU ) ); + + aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "FabTextSizeH" ), + &m_TextSize[ LAYER_CLASS_FAB ].y, + Millimeter2iu( DEFAULT_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE, + nullptr, MM_PER_IU ) ); + + aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "FabTextSizeThickness" ), + &m_TextThickness[ LAYER_CLASS_FAB ], + Millimeter2iu( DEFAULT_TEXT_WIDTH ), 1, TEXTS_MAX_WIDTH, + nullptr, MM_PER_IU ) ); + + aResult->push_back( new PARAM_CFG_BOOL( wxT( "FabTextItalic" ), + &m_TextItalic[ LAYER_CLASS_FAB ], false ) ); + + aResult->push_back( new PARAM_CFG_BOOL( wxT( "FabTextUpright" ), + &m_TextUpright[ LAYER_CLASS_FAB ], true ) ); + aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "OthersLineWidth" ), &m_LineThickness[ LAYER_CLASS_OTHERS ], Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), @@ -1034,7 +1067,7 @@ void BOARD_DESIGN_SETTINGS::SetEnabledLayers( LSET aMask ) } -// Return the layer class index { silk, copper, edges & courtyards, others } of the +// Return the layer class index { silk, copper, edges & courtyards, fab, others } of the // given layer. int BOARD_DESIGN_SETTINGS::GetLayerClass( PCB_LAYER_ID aLayer ) const { @@ -1046,6 +1079,8 @@ int BOARD_DESIGN_SETTINGS::GetLayerClass( PCB_LAYER_ID aLayer ) const return LAYER_CLASS_EDGES; else if( aLayer == F_CrtYd || aLayer == B_CrtYd ) return LAYER_CLASS_COURTYARD; + else if( aLayer == F_Fab || aLayer == B_Fab ) + return LAYER_CLASS_FAB; else return LAYER_CLASS_OTHERS; } diff --git a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp index 82da0d65e8..9430ac079c 100644 --- a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -55,6 +55,7 @@ enum ROW_COPPER, ROW_EDGES, ROW_COURTYARD, + ROW_FAB, ROW_OTHERS }; @@ -202,6 +203,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow() m_grid->SetCellValue( ROW_COPPER, COL_CLASS_NAME, _( "Copper Layers" ) ); m_grid->SetCellValue( ROW_EDGES, COL_CLASS_NAME, _( "Edge Cuts" ) ); m_grid->SetCellValue( ROW_COURTYARD, COL_CLASS_NAME, _( "Courtyards" ) ); + m_grid->SetCellValue( ROW_FAB, COL_CLASS_NAME, _( "Fab Layers" ) ); m_grid->SetCellValue( ROW_OTHERS, COL_CLASS_NAME, _( "Other Layers" ) ); m_grid->SetCellValue( ROW_HEADER, COL_LINE_THICKNESS, _( "Line Thickness" ) ); @@ -209,31 +211,37 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow() SET_INT_VALUE( ROW_COPPER, COL_LINE_THICKNESS, bds.m_LineThickness[ LAYER_CLASS_COPPER ] ); SET_INT_VALUE( ROW_EDGES, COL_LINE_THICKNESS, bds.m_LineThickness[ LAYER_CLASS_EDGES ] ); SET_INT_VALUE( ROW_COURTYARD, COL_LINE_THICKNESS, bds.m_LineThickness[ LAYER_CLASS_COURTYARD ] ); + SET_INT_VALUE( ROW_FAB, COL_LINE_THICKNESS, bds.m_LineThickness[ LAYER_CLASS_FAB ] ); SET_INT_VALUE( ROW_OTHERS, COL_LINE_THICKNESS, bds.m_LineThickness[ LAYER_CLASS_OTHERS ] ); m_grid->SetCellValue( ROW_HEADER, COL_TEXT_WIDTH, _( "Text Width" ) ); SET_INT_VALUE( ROW_SILK, COL_TEXT_WIDTH, bds.m_TextSize[ LAYER_CLASS_SILK ].x ); SET_INT_VALUE( ROW_COPPER, COL_TEXT_WIDTH, bds.m_TextSize[ LAYER_CLASS_COPPER ].x ); + SET_INT_VALUE( ROW_FAB, COL_TEXT_WIDTH, bds.m_TextSize[ LAYER_CLASS_FAB ].x ); SET_INT_VALUE( ROW_OTHERS, COL_TEXT_WIDTH, bds.m_TextSize[ LAYER_CLASS_OTHERS ].x ); m_grid->SetCellValue( ROW_HEADER, COL_TEXT_HEIGHT, _( "Text Height" ) ); SET_INT_VALUE( ROW_SILK, COL_TEXT_HEIGHT, bds.m_TextSize[ LAYER_CLASS_SILK ].y ); SET_INT_VALUE( ROW_COPPER, COL_TEXT_HEIGHT, bds.m_TextSize[ LAYER_CLASS_COPPER ].y ); + SET_INT_VALUE( ROW_FAB, COL_TEXT_HEIGHT, bds.m_TextSize[ LAYER_CLASS_FAB ].y ); SET_INT_VALUE( ROW_OTHERS, COL_TEXT_HEIGHT, bds.m_TextSize[ LAYER_CLASS_OTHERS ].y ); m_grid->SetCellValue( ROW_HEADER, COL_TEXT_THICKNESS, _( "Text Thickness" ) ); SET_INT_VALUE( ROW_SILK, COL_TEXT_THICKNESS, bds.m_TextThickness[ LAYER_CLASS_SILK ] ); SET_INT_VALUE( ROW_COPPER, COL_TEXT_THICKNESS, bds.m_TextThickness[ LAYER_CLASS_COPPER ] ); + SET_INT_VALUE( ROW_FAB, COL_TEXT_THICKNESS, bds.m_TextThickness[ LAYER_CLASS_FAB ] ); SET_INT_VALUE( ROW_OTHERS, COL_TEXT_THICKNESS, bds.m_TextThickness[ LAYER_CLASS_OTHERS ] ); m_grid->SetCellValue( ROW_HEADER, COL_TEXT_ITALIC, _( "Italic" ) ); SET_BOOL_VALUE( ROW_SILK, COL_TEXT_ITALIC, bds.m_TextItalic[ LAYER_CLASS_SILK ] ); SET_BOOL_VALUE( ROW_COPPER, COL_TEXT_ITALIC, bds.m_TextItalic[ LAYER_CLASS_COPPER ] ); + SET_BOOL_VALUE( ROW_FAB, COL_TEXT_ITALIC, bds.m_TextItalic[ LAYER_CLASS_FAB ] ); SET_BOOL_VALUE( ROW_OTHERS, COL_TEXT_ITALIC, bds.m_TextItalic[ LAYER_CLASS_OTHERS ] ); m_grid->SetCellValue( ROW_HEADER, COL_TEXT_UPRIGHT, _( "Upright" ) ); SET_BOOL_VALUE( ROW_SILK, COL_TEXT_UPRIGHT, bds.m_TextUpright[ LAYER_CLASS_SILK ] ); SET_BOOL_VALUE( ROW_COPPER, COL_TEXT_UPRIGHT, bds.m_TextUpright[ LAYER_CLASS_COPPER ] ); + SET_BOOL_VALUE( ROW_FAB, COL_TEXT_UPRIGHT, bds.m_TextUpright[ LAYER_CLASS_FAB ] ); SET_BOOL_VALUE( ROW_OTHERS, COL_TEXT_UPRIGHT, bds.m_TextUpright[ LAYER_CLASS_OTHERS ] ); return true; diff --git a/pcbnew/dialogs/dialog_plot.cpp b/pcbnew/dialogs/dialog_plot.cpp index 5d832648a9..8088259d57 100644 --- a/pcbnew/dialogs/dialog_plot.cpp +++ b/pcbnew/dialogs/dialog_plot.cpp @@ -46,7 +46,6 @@ DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* aParent ) : DIALOG_PLOT_BASE( aParent ), m_parent( aParent ), - m_defaultLineWidth( aParent, m_lineWidthLabel, m_lineWidthCtrl, m_lineWidthUnits, true ), m_defaultPenSize( aParent, m_hpglPenLabel, m_hpglPenCtrl, m_hpglPenUnits, true ), m_trackWidthCorrection( aParent, m_widthAdjustLabel, m_widthAdjustCtrl, m_widthAdjustUnits, true ) { @@ -106,8 +105,6 @@ void DIALOG_PLOT::init_Dialog() // Set units and value for HPGL pen size (this param is in mils). m_defaultPenSize.SetValue( m_plotOpts.GetHPGLPenDiameter() * IU_PER_MILS ); - m_defaultLineWidth.SetValue( m_plotOpts.GetLineWidth() ); - // Test for a reasonable scale value. Set to 1 if problem if( m_XScaleAdjust < PLOT_MIN_SCALE || m_YScaleAdjust < PLOT_MIN_SCALE || m_XScaleAdjust > PLOT_MAX_SCALE || m_YScaleAdjust > PLOT_MAX_SCALE ) @@ -164,7 +161,7 @@ void DIALOG_PLOT::init_Dialog() m_excludeEdgeLayerOpt->SetValue( m_plotOpts.GetExcludeEdgeLayer() ); // Option to exclude pads from silkscreen layers - m_excludePadsFromSilkscreen->SetValue( !m_plotOpts.GetPlotPadsOnSilkLayer() ); + m_sketchPadsOnFabLayers->SetValue( m_plotOpts.GetSketchPadsOnFabLayers() ); // Option to tent vias m_subtractMaskFromSilk->SetValue( m_plotOpts.GetSubtractMaskFromSilk() ); @@ -412,7 +409,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_plotMirrorOpt->Enable( true ); m_useAuxOriginCheckBox->Enable( false ); m_useAuxOriginCheckBox->SetValue( false ); - m_defaultLineWidth.Enable( true ); m_defaultPenSize.Enable( false ); m_excludeEdgeLayerOpt->Enable( true ); m_scaleOpt->Enable( false ); @@ -436,7 +432,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_plotMirrorOpt->Enable( true ); m_useAuxOriginCheckBox->Enable( false ); m_useAuxOriginCheckBox->SetValue( false ); - m_defaultLineWidth.Enable( true ); m_defaultPenSize.Enable( false ); m_excludeEdgeLayerOpt->Enable( true ); m_scaleOpt->Enable( true ); @@ -461,7 +456,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_plotMirrorOpt->Enable( false ); m_plotMirrorOpt->SetValue( false ); m_useAuxOriginCheckBox->Enable( true ); - m_defaultLineWidth.Enable( true ); m_defaultPenSize.Enable( false ); m_excludeEdgeLayerOpt->Enable( true ); m_scaleOpt->Enable( false ); @@ -487,7 +481,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_plotMirrorOpt->Enable( true ); m_useAuxOriginCheckBox->Enable( false ); m_useAuxOriginCheckBox->SetValue( false ); - m_defaultLineWidth.Enable( false ); m_defaultPenSize.Enable( true ); m_excludeEdgeLayerOpt->Enable( true ); m_scaleOpt->Enable( true ); @@ -512,7 +505,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event ) m_plotMirrorOpt->Enable( false ); m_plotMirrorOpt->SetValue( false ); m_useAuxOriginCheckBox->Enable( true ); - m_defaultLineWidth.Enable( false ); m_defaultPenSize.Enable( false ); m_excludeEdgeLayerOpt->Enable( true ); m_scaleOpt->Enable( false ); @@ -595,7 +587,7 @@ void DIALOG_PLOT::applyPlotSettings() tempOptions.SetExcludeEdgeLayer( m_excludeEdgeLayerOpt->GetValue() ); tempOptions.SetSubtractMaskFromSilk( m_subtractMaskFromSilk->GetValue() ); tempOptions.SetPlotFrameRef( m_plotSheetRef->GetValue() ); - tempOptions.SetPlotPadsOnSilkLayer( !m_excludePadsFromSilkscreen->GetValue() ); + tempOptions.SetSketchPadsOnFabLayers( m_sketchPadsOnFabLayers->GetValue()); tempOptions.SetUseAuxOrigin( m_useAuxOriginCheckBox->GetValue() ); tempOptions.SetPlotValue( m_plotModuleValueOpt->GetValue() ); tempOptions.SetPlotReference( m_plotModuleRefOpt->GetValue() ); @@ -640,14 +632,6 @@ void DIALOG_PLOT::applyPlotSettings() else // keep the last value (initial value if no HPGL plot made) tempOptions.SetHPGLPenDiameter( m_plotOpts.GetHPGLPenDiameter() ); - // Default linewidth - if( !tempOptions.SetLineWidth( m_defaultLineWidth.GetValue() ) ) - { - m_defaultLineWidth.SetValue( tempOptions.GetLineWidth() ); - msg.Printf( _( "Default line width constrained." ) ); - reporter.Report( msg, RPT_SEVERITY_INFO ); - } - // X scale double tmpDouble; msg = m_fineAdjustXCtrl->GetValue(); @@ -754,6 +738,8 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event ) applyPlotSettings(); + m_plotOpts.SetSketchPadLineWidth( board->GetDesignSettings().GetLineThickness( F_Fab ) ); + // If no layer selected, we have nothing plotted. // Prompt user if it happens because he could think there is a bug in Pcbnew. if( !m_plotOpts.GetLayerSelection().any() ) diff --git a/pcbnew/dialogs/dialog_plot.h b/pcbnew/dialogs/dialog_plot.h index 63a35653d2..59d29aed38 100644 --- a/pcbnew/dialogs/dialog_plot.h +++ b/pcbnew/dialogs/dialog_plot.h @@ -56,7 +56,6 @@ private: int m_widthAdjustMinValue; // Global track width limits int m_widthAdjustMaxValue; // tracks width will be "clipped" whenever the // m_PSWidthAdjust to these limits. - UNIT_BINDER m_defaultLineWidth; UNIT_BINDER m_defaultPenSize; UNIT_BINDER m_trackWidthCorrection; diff --git a/pcbnew/dialogs/dialog_plot_base.cpp b/pcbnew/dialogs/dialog_plot_base.cpp index e6650a9f01..cee55b3d71 100644 --- a/pcbnew/dialogs/dialog_plot_base.cpp +++ b/pcbnew/dialogs/dialog_plot_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jul 10 2019) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -97,10 +97,10 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr gbSizer1->Add( m_excludeEdgeLayerOpt, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); - m_excludePadsFromSilkscreen = new wxCheckBox( sbOptionsSizer->GetStaticBox(), ID_ALLOW_PRINT_PAD_ON_SILKSCREEN, _("Exclude pads from silkscreen"), wxDefaultPosition, wxDefaultSize, 0 ); - m_excludePadsFromSilkscreen->SetToolTip( _("Do not plot pads on silkscreen layers, even when they are assigned to them.\nUncheck this if you wish to create assembly drawings from silkscreen layers.") ); + m_sketchPadsOnFabLayers = new wxCheckBox( sbOptionsSizer->GetStaticBox(), ID_ALLOW_PRINT_PAD_ON_SILKSCREEN, _("Sketch pads on fab layers"), wxDefaultPosition, wxDefaultSize, 0 ); + m_sketchPadsOnFabLayers->SetToolTip( _("Do not plot pads on silkscreen layers, even when they are assigned to them.\nUncheck this if you wish to create assembly drawings from silkscreen layers.") ); - gbSizer1->Add( m_excludePadsFromSilkscreen, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + gbSizer1->Add( m_sketchPadsOnFabLayers, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_plotNoViaOnMaskOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Do not tent vias"), wxDefaultPosition, wxDefaultSize, 0 ); m_plotNoViaOnMaskOpt->SetToolTip( _("Remove soldermask on vias") ); @@ -110,7 +110,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr m_useAuxOriginCheckBox = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Use auxiliary axis as origin"), wxDefaultPosition, wxDefaultSize, 0 ); m_useAuxOriginCheckBox->SetToolTip( _("Use auxiliary axis as coordinates origin in plot files") ); - gbSizer1->Add( m_useAuxOriginCheckBox, wxGBPosition( 7, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); + gbSizer1->Add( m_useAuxOriginCheckBox, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 ); drillMarksLabel = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Drill marks:"), wxDefaultPosition, wxDefaultSize, 0 ); drillMarksLabel->Wrap( -1 ); @@ -142,22 +142,6 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr m_plotModeOpt->SetSelection( 0 ); gbSizer1->Add( m_plotModeOpt, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxEXPAND|wxLEFT, 5 ); - m_lineWidthLabel = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Default line width:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_lineWidthLabel->Wrap( -1 ); - m_lineWidthLabel->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") ); - - gbSizer1->Add( m_lineWidthLabel, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 ); - - m_lineWidthCtrl = new wxTextCtrl( sbOptionsSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_lineWidthCtrl->SetToolTip( _("Line width for, e.g., sheet references.") ); - m_lineWidthCtrl->SetMinSize( wxSize( 120,-1 ) ); - - gbSizer1->Add( m_lineWidthCtrl, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxLEFT, 5 ); - - m_lineWidthUnits = new wxStaticText( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); - m_lineWidthUnits->Wrap( -1 ); - gbSizer1->Add( m_lineWidthUnits, wxGBPosition( 3, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - m_plotMirrorOpt = new wxCheckBox( sbOptionsSizer->GetStaticBox(), ID_MIROR_OPT, _("Mirrored plot"), wxDefaultPosition, wxDefaultSize, 0 ); gbSizer1->Add( m_plotMirrorOpt, wxGBPosition( 4, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 ); @@ -165,7 +149,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr gbSizer1->Add( m_plotPSNegativeOpt, wxGBPosition( 5, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 ); m_zoneFillCheck = new wxCheckBox( sbOptionsSizer->GetStaticBox(), wxID_ANY, _("Check zone fills before plotting"), wxDefaultPosition, wxDefaultSize, 0 ); - gbSizer1->Add( m_zoneFillCheck, wxGBPosition( 7, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 30 ); + gbSizer1->Add( m_zoneFillCheck, wxGBPosition( 6, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 30 ); gbSizer1->AddGrowableCol( 0 ); diff --git a/pcbnew/dialogs/dialog_plot_base.fbp b/pcbnew/dialogs/dialog_plot_base.fbp index 42bcd76794..7c2492bfdf 100644 --- a/pcbnew/dialogs/dialog_plot_base.fbp +++ b/pcbnew/dialogs/dialog_plot_base.fbp @@ -14,7 +14,6 @@ dialog_plot_base 1000 none - 1 Dialog_Plot_base @@ -26,7 +25,6 @@ 1 1 UI - 0 1 0 @@ -901,7 +899,7 @@ 0 0 ID_ALLOW_PRINT_PAD_ON_SILKSCREEN - Exclude pads from silkscreen + Sketch pads on fab layers 0 @@ -909,7 +907,7 @@ 0 1 - m_excludePadsFromSilkscreen + m_sketchPadsOnFabLayers 1 @@ -1000,11 +998,11 @@ - 5 + 30 1 - 0 - wxALIGN_CENTER_VERTICAL - 7 + 1 + wxALIGN_CENTER_VERTICAL|wxLEFT + 3 1 1 @@ -1460,201 +1458,6 @@ - - 30 - 1 - 1 - wxALIGN_CENTER_VERTICAL|wxLEFT - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Default line width: - 0 - - 0 - - - 0 - - 1 - m_lineWidthLabel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Pen size used to draw items that have no pen size specified. Used mainly to draw items in sketch mode. - - - - -1 - - - - 5 - 1 - 2 - wxLEFT - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - 120,-1 - 1 - m_lineWidthCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Line width for, e.g., sheet references. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - 5 - 1 - 3 - wxALIGN_CENTER_VERTICAL|wxLEFT - 3 - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - mm - 0 - - 0 - - - 0 - - 1 - m_lineWidthUnits - 1 - - - protected - 1 - - Resizable - 1 - - - ; forward_declare - 0 - - - - - -1 - - 30 2 @@ -1793,8 +1596,8 @@ 30 2 1 - wxALIGN_CENTER_VERTICAL|wxLEFT - 7 + wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT + 6 1 1 diff --git a/pcbnew/dialogs/dialog_plot_base.h b/pcbnew/dialogs/dialog_plot_base.h index 257031fe06..6390330d87 100644 --- a/pcbnew/dialogs/dialog_plot_base.h +++ b/pcbnew/dialogs/dialog_plot_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jul 10 2019) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -72,7 +72,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM wxCheckBox* m_plotModuleRefOpt; wxCheckBox* m_plotInvisibleText; wxCheckBox* m_excludeEdgeLayerOpt; - wxCheckBox* m_excludePadsFromSilkscreen; + wxCheckBox* m_sketchPadsOnFabLayers; wxCheckBox* m_plotNoViaOnMaskOpt; wxCheckBox* m_useAuxOriginCheckBox; wxStaticText* drillMarksLabel; @@ -81,9 +81,6 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM wxChoice* m_scaleOpt; wxStaticText* plotModeLabel; wxChoice* m_plotModeOpt; - wxStaticText* m_lineWidthLabel; - wxTextCtrl* m_lineWidthCtrl; - wxStaticText* m_lineWidthUnits; wxCheckBox* m_plotMirrorOpt; wxCheckBox* m_plotPSNegativeOpt; wxCheckBox* m_zoneFillCheck; diff --git a/pcbnew/dialogs/panel_modedit_defaults.cpp b/pcbnew/dialogs/panel_modedit_defaults.cpp index c9532f870d..97dc2b8fac 100644 --- a/pcbnew/dialogs/panel_modedit_defaults.cpp +++ b/pcbnew/dialogs/panel_modedit_defaults.cpp @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -48,6 +47,7 @@ enum ROW_COPPER, ROW_EDGES, ROW_COURTYARD, + ROW_FAB, ROW_OTHERS, ROW_COUNT @@ -157,7 +157,7 @@ bool PANEL_MODEDIT_DEFAULTS::validateData() return false; // Test text parameters. - for( int row : { ROW_SILK, ROW_COPPER, ROW_OTHERS } ) + for( int row : { ROW_SILK, ROW_COPPER, ROW_FAB, ROW_OTHERS } ) { int textSize = std::min( getGridValue( row, COL_TEXT_WIDTH ), getGridValue( row, COL_TEXT_HEIGHT ) ); diff --git a/pcbnew/dialogs/panel_modedit_defaults_base.cpp b/pcbnew/dialogs/panel_modedit_defaults_base.cpp index 6f271abd6c..b7abbe8cc3 100644 --- a/pcbnew/dialogs/panel_modedit_defaults_base.cpp +++ b/pcbnew/dialogs/panel_modedit_defaults_base.cpp @@ -97,7 +97,7 @@ PANEL_MODEDIT_DEFAULTS_BASE::PANEL_MODEDIT_DEFAULTS_BASE( wxWindow* parent, wxWi m_grid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); // Grid - m_grid->CreateGrid( 5, 5 ); + m_grid->CreateGrid( 6, 5 ); m_grid->EnableEditing( true ); m_grid->EnableGridLines( true ); m_grid->EnableDragGridSize( false ); @@ -126,7 +126,8 @@ PANEL_MODEDIT_DEFAULTS_BASE::PANEL_MODEDIT_DEFAULTS_BASE( wxWindow* parent, wxWi m_grid->SetRowLabelValue( 1, _("Copper Layers") ); m_grid->SetRowLabelValue( 2, _("Edge Cuts") ); m_grid->SetRowLabelValue( 3, _("Courtyards") ); - m_grid->SetRowLabelValue( 4, _("Other Layers") ); + m_grid->SetRowLabelValue( 4, _("Fab Layers") ); + m_grid->SetRowLabelValue( 5, _("Other Layers") ); m_grid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER ); // Label Appearance diff --git a/pcbnew/dialogs/panel_modedit_defaults_base.fbp b/pcbnew/dialogs/panel_modedit_defaults_base.fbp index d80dcd556a..4186ae2f48 100644 --- a/pcbnew/dialogs/panel_modedit_defaults_base.fbp +++ b/pcbnew/dialogs/panel_modedit_defaults_base.fbp @@ -873,10 +873,10 @@ Resizable wxALIGN_LEFT 125 - "Silk Layers" "Copper Layers" "Edge Cuts" "Courtyards" "Other Layers" + "Silk Layers" "Copper Layers" "Edge Cuts" "Courtyards" "Fab Layers" "Other Layers" wxALIGN_CENTER - 5 + 6 1 WX_GRID; widgets/wx_grid.h; forward_declare diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp index 000a01e435..1fc2a6a2b2 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics.cpp +++ b/pcbnew/dialogs/panel_setup_text_and_graphics.cpp @@ -47,6 +47,7 @@ enum ROW_COPPER, ROW_EDGES, ROW_COURTYARD, + ROW_FAB, ROW_OTHERS, ROW_COUNT @@ -150,7 +151,7 @@ bool PANEL_SETUP_TEXT_AND_GRAPHICS::validateData() return false; // Test text parameters. - for( int row : { ROW_SILK, ROW_COPPER, ROW_OTHERS } ) + for( int row : { ROW_SILK, ROW_COPPER, ROW_FAB, ROW_OTHERS } ) { int textSize = std::min( getGridValue( row, COL_TEXT_WIDTH ), getGridValue( row, COL_TEXT_HEIGHT ) ); diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics_base.cpp b/pcbnew/dialogs/panel_setup_text_and_graphics_base.cpp index 5cdbf51622..50e0e2f829 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics_base.cpp +++ b/pcbnew/dialogs/panel_setup_text_and_graphics_base.cpp @@ -25,7 +25,7 @@ PANEL_SETUP_TEXT_AND_GRAPHICS_BASE::PANEL_SETUP_TEXT_AND_GRAPHICS_BASE( wxWindow m_grid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); // Grid - m_grid->CreateGrid( 5, 6 ); + m_grid->CreateGrid( 6, 6 ); m_grid->EnableEditing( true ); m_grid->EnableGridLines( true ); m_grid->EnableDragGridSize( false ); @@ -56,7 +56,8 @@ PANEL_SETUP_TEXT_AND_GRAPHICS_BASE::PANEL_SETUP_TEXT_AND_GRAPHICS_BASE( wxWindow m_grid->SetRowLabelValue( 1, _("Copper Layers") ); m_grid->SetRowLabelValue( 2, _("Edge Cuts") ); m_grid->SetRowLabelValue( 3, _("Courtyards") ); - m_grid->SetRowLabelValue( 4, _("Other Layers") ); + m_grid->SetRowLabelValue( 4, _("Fab Layers") ); + m_grid->SetRowLabelValue( 5, _("Other Layers") ); m_grid->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTER ); // Label Appearance diff --git a/pcbnew/dialogs/panel_setup_text_and_graphics_base.fbp b/pcbnew/dialogs/panel_setup_text_and_graphics_base.fbp index f0a4accc7d..79adb904c6 100644 --- a/pcbnew/dialogs/panel_setup_text_and_graphics_base.fbp +++ b/pcbnew/dialogs/panel_setup_text_and_graphics_base.fbp @@ -198,10 +198,10 @@ Resizable wxALIGN_LEFT 132 - "Silk Layers" "Copper Layers" "Edge Cuts" "Courtyards" "Other Layers" + "Silk Layers" "Copper Layers" "Edge Cuts" "Courtyards" "Fab Layers" "Other Layers" wxALIGN_CENTER - 5 + 6 1 WX_GRID; widgets/wx_grid.h; forward_declare diff --git a/pcbnew/exporters/gerber_placefile_writer.cpp b/pcbnew/exporters/gerber_placefile_writer.cpp index 1b57ff5b84..6b096fe009 100644 --- a/pcbnew/exporters/gerber_placefile_writer.cpp +++ b/pcbnew/exporters/gerber_placefile_writer.cpp @@ -310,7 +310,7 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, for( auto item : footprint->GraphicalItems() ) { if( item->Type() == PCB_MODULE_EDGE_T && item->GetLayer() == Edge_Cuts ) - brd_plotter.Plot_1_EdgeModule( (EDGE_MODULE*) item ); + brd_plotter.PlotFootprintGraphicItem((EDGE_MODULE*) item ); } } } diff --git a/pcbnew/footprint_editor_settings.cpp b/pcbnew/footprint_editor_settings.cpp index 8a2e6f4ee2..eedbc9c9a7 100644 --- a/pcbnew/footprint_editor_settings.cpp +++ b/pcbnew/footprint_editor_settings.cpp @@ -116,6 +116,26 @@ FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS() : Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), MM_PER_IU ) ); + m_params.emplace_back( new PARAM_SCALED( "design_settings.fab_line_width", + &m_DesignSettings.m_LineThickness[ LAYER_CLASS_FAB ], + Millimeter2iu( DEFAULT_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), + MM_PER_IU ) ); + + m_params.emplace_back( new PARAM_SCALED( "design_settings.fab_text_size_h", + &m_DesignSettings.m_TextSize[ LAYER_CLASS_FAB ].x, + Millimeter2iu( DEFAULT_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE, MM_PER_IU ) ); + + m_params.emplace_back( new PARAM_SCALED( "design_settings.fab_text_size_v", + &m_DesignSettings.m_TextSize[ LAYER_CLASS_FAB ].y, + Millimeter2iu( DEFAULT_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE, MM_PER_IU ) ); + + m_params.emplace_back( new PARAM_SCALED( "design_settings.fab_text_thickness", + &m_DesignSettings.m_TextThickness[ LAYER_CLASS_FAB ], + Millimeter2iu( DEFAULT_TEXT_WIDTH ), 1, TEXTS_MAX_WIDTH, MM_PER_IU ) ); + + m_params.emplace_back( new PARAM( "design_settings.fab_text_italic", + &m_DesignSettings.m_TextItalic[ LAYER_CLASS_FAB ], false ) ); + m_params.emplace_back( new PARAM_SCALED( "design_settings.others_line_width", &m_DesignSettings.m_LineThickness[ LAYER_CLASS_OTHERS ], Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ), diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index 7d81099c19..f5b5f23898 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -627,6 +627,15 @@ void PCB_IO::formatDefaults( const BOARD_DESIGN_SETTINGS& aSettings, int aNestLe aSettings.m_TextItalic[ LAYER_CLASS_SILK ] ? " italic" : "", aSettings.m_TextUpright[ LAYER_CLASS_SILK ] ? " keep_upright" : "" ); + m_out->Print( aNestLevel+1, "(fab_layers_line_width %s)\n", + FormatInternalUnits( aSettings.m_LineThickness[ LAYER_CLASS_FAB ] ).c_str() ); + m_out->Print( aNestLevel+1, "(fab_layers_text_dims (size %s %s) (thickness %s)%s%s)\n", + FormatInternalUnits( aSettings.m_TextSize[ LAYER_CLASS_FAB ].x ).c_str(), + FormatInternalUnits( aSettings.m_TextSize[ LAYER_CLASS_FAB ].y ).c_str(), + FormatInternalUnits( aSettings.m_TextThickness[ LAYER_CLASS_FAB ] ).c_str(), + aSettings.m_TextItalic[ LAYER_CLASS_OTHERS ] ? " italic" : "", + aSettings.m_TextUpright[ LAYER_CLASS_OTHERS ] ? " keep_upright" : "" ); + m_out->Print( aNestLevel+1, "(other_layers_line_width %s)\n", FormatInternalUnits( aSettings.m_LineThickness[ LAYER_CLASS_OTHERS ] ).c_str() ); m_out->Print( aNestLevel+1, "(other_layers_text_dims (size %s %s) (thickness %s)%s%s)\n", diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp index fc9ef3beb9..f3ebf76bf1 100644 --- a/pcbnew/pcb_parser.cpp +++ b/pcbnew/pcb_parser.cpp @@ -1734,6 +1734,15 @@ void PCB_PARSER::parseDefaults( BOARD_DESIGN_SETTINGS& designSettings ) parseDefaultTextDims( designSettings, LAYER_CLASS_SILK ); break; + case T_fab_layers_line_width: + designSettings.m_LineThickness[ LAYER_CLASS_FAB ] = parseBoardUnits( token ); + NeedRIGHT(); + break; + + case T_fab_layers_text_dims: + parseDefaultTextDims( designSettings, LAYER_CLASS_FAB ); + break; + case T_other_layers_line_width: designSettings.m_LineThickness[ LAYER_CLASS_OTHERS ] = parseBoardUnits( token ); NeedRIGHT(); diff --git a/pcbnew/pcb_plot_params.cpp b/pcbnew/pcb_plot_params.cpp index 67f3fe4264..30c746311b 100644 --- a/pcbnew/pcb_plot_params.cpp +++ b/pcbnew/pcb_plot_params.cpp @@ -126,7 +126,7 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS() m_plotReference = true; m_plotValue = true; m_plotInvisibleText = false; - m_plotPadsOnSilkLayer = false; + m_sketchPadsOnFabLayers = false; m_subtractMaskFromSilk = false; m_format = PLOT_FORMAT::GERBER; m_mirror = false; @@ -248,8 +248,8 @@ void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter, m_plotValue ? trueStr : falseStr ); aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_plotinvisibletext ), m_plotInvisibleText ? trueStr : falseStr ); - aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_padsonsilk ), - m_plotPadsOnSilkLayer ? trueStr : falseStr ); + aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_sketchpadsonfab ), + m_sketchPadsOnFabLayers ? trueStr : falseStr ); aFormatter->Print( aNestLevel+1, "(%s %s)\n", getTokenName( T_subtractmaskfromsilk ), m_subtractMaskFromSilk ? trueStr : falseStr ); aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_outputformat ), @@ -326,7 +326,7 @@ bool PCB_PLOT_PARAMS::IsSameAs( const PCB_PLOT_PARAMS &aPcbPlotParams, bool aCom return false; if( m_plotInvisibleText != aPcbPlotParams.m_plotInvisibleText ) return false; - if( m_plotPadsOnSilkLayer != aPcbPlotParams.m_plotPadsOnSilkLayer ) + if( m_sketchPadsOnFabLayers != aPcbPlotParams.m_sketchPadsOnFabLayers ) return false; if( m_subtractMaskFromSilk != aPcbPlotParams.m_subtractMaskFromSilk ) return false; @@ -374,11 +374,6 @@ bool PCB_PLOT_PARAMS::SetHPGLPenSpeed( int aValue ) } -bool PCB_PLOT_PARAMS::SetLineWidth( int aValue ) -{ - return setInt( &m_lineWidth, aValue, PLOT_LINEWIDTH_MIN, PLOT_LINEWIDTH_MAX ); -} - // PCB_PLOT_PARAMS_PARSER PCB_PLOT_PARAMS_PARSER::PCB_PLOT_PARAMS_PARSER( LINE_READER* aReader ) : @@ -480,17 +475,6 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) aPcbPlotParams->m_excludeEdgeLayer = parseBool(); break; - case T_linewidth: - { - // Due to a bug, this (minor) parameter was saved in biu - // and now is saved in mm - // If the read value is outside bounds, force a default value - double tmp = parseDouble(); - if( !aPcbPlotParams->SetLineWidth( KiROUND( tmp * IU_PER_MM ) ) ) - aPcbPlotParams->SetLineWidth( PLOT_LINEWIDTH_DEFAULT ); - } - break; - case T_plotframeref: aPcbPlotParams->m_plotFrameRef = parseBool(); break; @@ -546,8 +530,8 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) aPcbPlotParams->m_plotInvisibleText = parseBool(); break; - case T_padsonsilk: - aPcbPlotParams->m_plotPadsOnSilkLayer= parseBool(); + case T_sketchpadsonfab: + aPcbPlotParams->m_sketchPadsOnFabLayers= parseBool(); break; case T_subtractmaskfromsilk: diff --git a/pcbnew/pcb_plot_params.h b/pcbnew/pcb_plot_params.h index 1cee3199c2..2d8049d75d 100644 --- a/pcbnew/pcb_plot_params.h +++ b/pcbnew/pcb_plot_params.h @@ -155,8 +155,9 @@ private: /// Force plotting of fields marked invisible bool m_plotInvisibleText; - /// Allows pads outlines on silkscreen layer (when pads are also on silk screen) - bool m_plotPadsOnSilkLayer; + /// Plots pads outlines on fab layers + bool m_sketchPadsOnFabLayers; + int m_sketchPadLineWidth; /* These next two scale factors are intended to compensate plotters * (mainly printers) X and Y scale error. Therefore they are expected very @@ -256,8 +257,10 @@ public: void SetMirror( bool aFlag ) { m_mirror = aFlag; } bool GetMirror() const { return m_mirror; } - void SetPlotPadsOnSilkLayer( bool aFlag ) { m_plotPadsOnSilkLayer = aFlag; } - bool GetPlotPadsOnSilkLayer() const { return m_plotPadsOnSilkLayer; } + void SetSketchPadsOnFabLayers( bool aFlag ) { m_sketchPadsOnFabLayers = aFlag; } + bool GetSketchPadsOnFabLayers() const { return m_sketchPadsOnFabLayers; } + void SetSketchPadLineWidth( int aWidth ) { m_sketchPadLineWidth = aWidth; } + int GetSketchPadLineWidth() const { return m_sketchPadLineWidth; } void SetPlotInvisibleText( bool aFlag ) { m_plotInvisibleText = aFlag; } bool GetPlotInvisibleText() const { return m_plotInvisibleText; } @@ -342,9 +345,6 @@ public: void SetHPGLPenNum( int aVal ) { m_HPGLPenNum = aVal; } int GetHPGLPenNum() const { return m_HPGLPenNum; } - - int GetLineWidth() const { return m_lineWidth; }; - bool SetLineWidth( int aValue ); }; diff --git a/pcbnew/pcbplot.h b/pcbnew/pcbplot.h index 7a3bc8e7b7..d44d8e4904 100644 --- a/pcbnew/pcbplot.h +++ b/pcbnew/pcbplot.h @@ -90,18 +90,15 @@ public: // Basic functions to plot a board item void SetLayerSet( LSET aLayerMask ) { m_layerMask = aLayerMask; } - void Plot_Edges_Modules(); - void Plot_1_EdgeModule( EDGE_MODULE* aEdge ); - void PlotTextModule( TEXTE_MODULE* aTextMod, COLOR4D aColor ); + void PlotFootprintGraphicItems( MODULE* aModule ); + void PlotFootprintGraphicItem( EDGE_MODULE* aEdge ); + void PlotFootprintTextItem( TEXTE_MODULE* aTextMod, COLOR4D aColor ); /* - * Plot field of a module (footprint) - * 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 - * usually they are not plotted. + * 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. */ - bool PlotAllTextsModule( MODULE* aModule ); + void PlotFootprintTextItems( MODULE* aModule ); void PlotDimension( DIMENSION* Dimension ); void PlotPcbTarget( PCB_TARGET* PtMire ); @@ -206,19 +203,6 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, void PlotLayerOutlines( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS& aPlotOpt ); -/** - * Function PlotSilkScreen - * plot silkscreen layers which have specific requirements, mainly for pads. - * Should not be used for other layers - * @param aBoard = the board to plot - * @param aPlotter = the plotter to use - * @param aLayerMask = the mask to define the layers to plot (silkscreen Front and/or Back) - * @param aPlotOpt = the plot options (files, sketch). Has meaning for some formats only - */ -void PlotSilkScreen( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, - const PCB_PLOT_PARAMS& aPlotOpt ); - - /** * Function BuildPlotFileName (helper function) * Complete a plot filename: forces the output directory, diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 105fd81e60..aa095a533d 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -62,94 +62,6 @@ static void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, const PCB_PLOT_PARAMS& aPlotOpt, int aMinThickness ); -/* - * Creates the plot for silkscreen layers. Silkscreen layers have specific requirement for - * pads (not filled) and texts (with option to remove them from some copper areas (pads...) - */ -void PlotSilkScreen( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, - const PCB_PLOT_PARAMS& aPlotOpt ) -{ - BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt ); - itemplotter.SetLayerSet( aLayerMask ); - - // Plot edge layer and graphic items - itemplotter.PlotBoardGraphicItems(); - - // Plot footprint outlines : - itemplotter.Plot_Edges_Modules(); - - // Plot pads (creates pads outlines, for pads on silkscreen layers) - LSET layersmask_plotpads = aLayerMask; - - // Calculate the mask layers of allowed layers for pads - - if( !aPlotOpt.GetPlotPadsOnSilkLayer() ) // Do not plot pads on silk screen layers - layersmask_plotpads.set( B_SilkS, false ).set( F_SilkS, false ); - - if( layersmask_plotpads.any() ) - { - for( auto Module : aBoard->Modules() ) - { - aPlotter->StartBlock( NULL ); - - for( auto pad : Module->Pads() ) - { - // See if the pad is on this layer - LSET masklayer = pad->GetLayerSet(); - if( !( masklayer & layersmask_plotpads ).any() ) - continue; - - COLOR4D color = COLOR4D::BLACK; - - if( layersmask_plotpads[B_SilkS] ) - color = aPlotter->RenderSettings()->GetLayerColor( B_SilkS ); - else if( layersmask_plotpads[F_SilkS] ) - color = aPlotter->RenderSettings()->GetLayerColor( F_SilkS ); - - itemplotter.PlotPad( pad, color, SKETCH ); - } - - aPlotter->EndBlock( NULL ); - } - } - - // Plot footprints fields (ref, value ...) - for( auto module : aBoard->Modules() ) - { - if( ! itemplotter.PlotAllTextsModule( module ) ) - { - wxLogMessage( _( "Your BOARD has a bad layer number for footprint %s" ), - module->GetReference() ); - } - } - - // Plot filled areas - aPlotter->StartBlock( NULL ); - - // Plot all zones together so we don't end up with divots where zones touch each other. - ZONE_CONTAINER* zone = nullptr; - SHAPE_POLY_SET aggregateArea; - - for( ZONE_CONTAINER* candidate : aBoard->Zones() ) - { - if( !aLayerMask[ candidate->GetLayer() ] ) - continue; - - if( !zone ) - zone = candidate; - - aggregateArea.BooleanAdd( candidate->GetFilledPolysList(), SHAPE_POLY_SET::PM_FAST ); - } - - if( zone ) - { - aggregateArea.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE ); - itemplotter.PlotFilledAreas( zone, aggregateArea ); - } - - aPlotter->EndBlock( NULL ); -} - void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, PCB_LAYER_ID aLayer, const PCB_PLOT_PARAMS& aPlotOpt ) { @@ -227,7 +139,7 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, PCB_LAYER_ID aLayer, // and must not be used for other plot formats PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt ); else - PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt ); + PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt ); // Gerber: Subtract soldermask from silkscreen if enabled if( aPlotter->GetPlotterType() == PLOT_FORMAT::GERBER @@ -270,7 +182,7 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, PCB_LAYER_ID aLayer, // and must not be used for other plot formats PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt ); else - PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt ); + PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt ); break; default: @@ -300,58 +212,51 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, itemplotter.SetLayerSet( aLayerMask ); EDA_DRAW_MODE_T plotMode = aPlotOpt.GetPlotMode(); + bool onCopperLayer = ( LSET::AllCuMask() & aLayerMask ).any(); + bool onSolderMaskLayer = ( LSET( 2, F_Mask, B_Mask ) & aLayerMask ).any(); + bool onSolderPasteLayer = ( LSET( 2, F_Paste, B_Paste ) & aLayerMask ).any(); + bool onFabLayer = ( LSET( 2, F_Fab, B_Fab ) & aLayerMask ).any(); + bool sketchPads = onFabLayer && aPlotOpt.GetSketchPadsOnFabLayers(); // Plot edge layer and graphic items itemplotter.PlotBoardGraphicItems(); // Draw footprint texts: - for( auto module : aBoard->Modules() ) - { - if( ! itemplotter.PlotAllTextsModule( module ) ) - { - wxLogMessage( _( "Your BOARD has a bad layer number for footprint %s" ), - module->GetReference() ); - } - } + for( MODULE* module : aBoard->Modules() ) + itemplotter.PlotFootprintTextItems( module ); // Draw footprint other graphic items: - for( auto module : aBoard->Modules() ) - { - for( auto item : module->GraphicalItems() ) - { - if( item->Type() == PCB_MODULE_EDGE_T && aLayerMask[ item->GetLayer() ] ) - itemplotter.Plot_1_EdgeModule( (EDGE_MODULE*) item ); - } - } + for( MODULE* module : aBoard->Modules() ) + itemplotter.PlotFootprintGraphicItems( module ); // Plot footprint pads - for( auto module : aBoard->Modules() ) + for( MODULE* module : aBoard->Modules() ) { aPlotter->StartBlock( NULL ); - for( auto pad : module->Pads() ) + for( D_PAD* pad : module->Pads() ) { - if( (pad->GetLayerSet() & aLayerMask) == 0 ) - continue; + EDA_DRAW_MODE_T padPlotMode = plotMode; + + if( !( pad->GetLayerSet() & aLayerMask ).any() ) + { + if( sketchPads ) + padPlotMode = SKETCH; + else + continue; + } wxSize margin; double width_adj = 0; - if( ( aLayerMask & LSET::AllCuMask() ).any() ) + if( onCopperLayer ) width_adj = itemplotter.getFineWidthAdj(); - static const LSET speed( 4, B_Mask, F_Mask, B_Paste, F_Paste ); - - LSET anded = ( speed & aLayerMask ); - - if( anded == LSET( F_Mask ) || anded == LSET( B_Mask ) ) - { + if( onSolderMaskLayer ) margin.x = margin.y = pad->GetSolderMaskMargin(); - } - else if( anded == LSET( F_Paste ) || anded == LSET( B_Paste ) ) - { + + if( onSolderPasteLayer ) margin = pad->GetSolderPasteMargin(); - } // Now offset the pad size by margin + width_adj // this is easy for most shapes, but not for a trapezoid or a custom shape @@ -413,6 +318,11 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, if( pad->GetLayerSet()[F_Cu] ) color = color.LegacyMix( aPlotOpt.ColorSettings()->GetColor( LAYER_PAD_FR ) ); + if( sketchPads && aLayerMask[F_Fab] ) + color = aPlotOpt.ColorSettings()->GetColor( F_Fab ); + else if( sketchPads && aLayerMask[B_Fab] ) + color = aPlotOpt.ColorSettings()->GetColor( B_Fab ); + // Temporary set the pad size to the required plot size: wxSize tmppadsize = pad->GetSize(); @@ -428,7 +338,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, ( pad->GetAttribute() == PAD_ATTRIB_HOLE_NOT_PLATED ) ) break; - itemplotter.PlotPad( pad, color, plotMode ); + itemplotter.PlotPad( pad, color, padPlotMode ); break; case PAD_SHAPE_RECT: @@ -444,7 +354,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, case PAD_SHAPE_ROUNDRECT: case PAD_SHAPE_CHAMFERED_RECT: pad->SetSize( padPlotsSize ); - itemplotter.PlotPad( pad, color, plotMode ); + itemplotter.PlotPad( pad, color, padPlotMode ); break; case PAD_SHAPE_CUSTOM: @@ -469,7 +379,7 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, if( margin.x < 0 ) // we expect margin.x = margin.y for custom pads dummy.SetSize( padPlotsSize ); - itemplotter.PlotPad( &dummy, color, plotMode ); + itemplotter.PlotPad( &dummy, color, padPlotMode ); } break; } @@ -863,10 +773,10 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, { for( auto item : module->GraphicalItems() ) { - itemplotter.PlotAllTextsModule( module ); + itemplotter.PlotFootprintTextItems( module ); if( item->Type() == PCB_MODULE_EDGE_T && item->GetLayer() == layer ) - itemplotter.Plot_1_EdgeModule( (EDGE_MODULE*) item ); + itemplotter.PlotFootprintGraphicItem((EDGE_MODULE*) item ); } } @@ -1213,7 +1123,6 @@ PLOTTER* StartPlotBoard( BOARD *aBoard, PCB_PLOT_PARAMS *aPlotOpts, int aLayer, KIGFX::PCB_RENDER_SETTINGS* renderSettings = new KIGFX::PCB_RENDER_SETTINGS(); renderSettings->LoadColors( aPlotOpts->ColorSettings() ); - renderSettings->SetDefaultPenWidth( aPlotOpts->GetLineWidth() ); plotter->SetRenderSettings( renderSettings ); // Compute the viewport and set the other options diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index 1ffd4ea24f..9c96515d6b 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -212,6 +212,9 @@ void BRDITEMS_PLOTTER::PlotPad( D_PAD* aPad, COLOR4D aColor, EDA_DRAW_MODE_T aPl // the white items are not seen on a white paper or screen m_plotter->SetColor( aColor != WHITE ? aColor : LIGHTGRAY); + if( aPlotMode == SKETCH ) + m_plotter->SetCurrentLineWidth( GetSketchPadLineWidth(), &gbr_metadata ); + switch( aPad->GetShape() ) { case PAD_SHAPE_CIRCLE: @@ -275,7 +278,7 @@ void BRDITEMS_PLOTTER::PlotPad( D_PAD* aPad, COLOR4D aColor, EDA_DRAW_MODE_T aPl } -bool BRDITEMS_PLOTTER::PlotAllTextsModule( MODULE* aModule ) +void BRDITEMS_PLOTTER::PlotFootprintTextItems( MODULE* aModule ) { TEXTE_MODULE* textModule = &aModule->Reference(); LAYER_NUM textLayer = textModule->GetLayer(); @@ -284,7 +287,7 @@ bool BRDITEMS_PLOTTER::PlotAllTextsModule( MODULE* aModule ) if( GetPlotReference() && m_layerMask[textLayer] && ( textModule->IsVisible() || GetPlotInvisibleText() ) ) { - PlotTextModule( textModule, getColor( textLayer ) ); + PlotFootprintTextItem( textModule, getColor( textLayer )); } textModule = &aModule->Value(); @@ -293,7 +296,7 @@ bool BRDITEMS_PLOTTER::PlotAllTextsModule( MODULE* aModule ) if( GetPlotValue() && m_layerMask[textLayer] && ( textModule->IsVisible() || GetPlotInvisibleText() ) ) { - PlotTextModule( textModule, getColor( textLayer ) ); + PlotFootprintTextItem( textModule, getColor( textLayer )); } for( auto item : aModule->GraphicalItems() ) @@ -309,7 +312,7 @@ bool BRDITEMS_PLOTTER::PlotAllTextsModule( MODULE* aModule ) textLayer = textModule->GetLayer(); if( textLayer >= PCB_LAYER_ID_COUNT ) - return false; + return; if( !m_layerMask[textLayer] ) continue; @@ -320,10 +323,8 @@ bool BRDITEMS_PLOTTER::PlotAllTextsModule( MODULE* aModule ) if( textModule->GetText() == wxT( "${VALUE}" ) && !GetPlotValue() ) continue; - PlotTextModule( textModule, getColor( textLayer ) ); + PlotFootprintTextItem( textModule, getColor( textLayer )); } - - return true; } @@ -343,44 +344,36 @@ void BRDITEMS_PLOTTER::PlotBoardGraphicItems() } } -void BRDITEMS_PLOTTER::PlotTextModule( TEXTE_MODULE* pt_texte, COLOR4D aColor ) +void BRDITEMS_PLOTTER::PlotFootprintTextItem( TEXTE_MODULE* aTextMod, COLOR4D aColor ) { - wxSize size; - wxPoint pos; - double orient; - int thickness; - if( aColor == COLOR4D::WHITE ) aColor = COLOR4D( LIGHTGRAY ); m_plotter->SetColor( aColor ); // calculate some text parameters : - size = pt_texte->GetTextSize(); - pos = pt_texte->GetTextPos(); + wxSize size = aTextMod->GetTextSize(); + wxPoint pos = aTextMod->GetTextPos(); + double orient = aTextMod->GetDrawRotation(); - orient = pt_texte->GetDrawRotation(); - - thickness = std::max( pt_texte->GetEffectiveTextPenWidth(), - m_plotter->RenderSettings()->GetDefaultPenWidth() ); - - if( pt_texte->IsMirrored() ) + if( aTextMod->IsMirrored() ) size.x = -size.x; // Text is mirrored // Non bold texts thickness is clamped at 1/6 char size by the low level draw function. // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size // (like bold text) and we manage the thickness. // So we set bold flag to true - bool allow_bold = pt_texte->IsBold() || thickness; + bool allow_bold = true; GBR_METADATA gbr_metadata; gbr_metadata.SetNetAttribType( GBR_NETLIST_METADATA::GBR_NETINFO_CMP ); - MODULE* parent = static_cast ( pt_texte->GetParent() ); + MODULE* parent = static_cast ( aTextMod->GetParent() ); gbr_metadata.SetCmpReference( parent->GetReference() ); - m_plotter->Text( pos, aColor, pt_texte->GetShownText(), orient, size, - pt_texte->GetHorizJustify(), pt_texte->GetVertJustify(), thickness, - pt_texte->IsItalic(), allow_bold, false, &gbr_metadata ); + m_plotter->Text( pos, aColor, aTextMod->GetShownText(), orient, size, + aTextMod->GetHorizJustify(), aTextMod->GetVertJustify(), + aTextMod->GetEffectiveTextPenWidth(), aTextMod->IsItalic(), allow_bold, + false, &gbr_metadata ); } @@ -486,32 +479,27 @@ void BRDITEMS_PLOTTER::PlotPcbTarget( PCB_TARGET* aMire ) // Plot footprints graphic items (outlines) -void BRDITEMS_PLOTTER::Plot_Edges_Modules() +void BRDITEMS_PLOTTER::PlotFootprintGraphicItems( MODULE* aModule ) { - for( auto module : m_board->Modules() ) + for( BOARD_ITEM* item : aModule->GraphicalItems() ) { - for( auto item : module->GraphicalItems() ) - { - EDGE_MODULE* edge = dyn_cast( item ); + EDGE_MODULE* edge = dynamic_cast( item ); - if( edge && m_layerMask[edge->GetLayer()] ) - Plot_1_EdgeModule( edge ); - } + if( edge && m_layerMask[ edge->GetLayer() ] ) + PlotFootprintGraphicItem( edge ); } } //* Plot a graphic item (outline) relative to a footprint -void BRDITEMS_PLOTTER::Plot_1_EdgeModule( EDGE_MODULE* aEdge ) +void BRDITEMS_PLOTTER::PlotFootprintGraphicItem( EDGE_MODULE* aEdge ) { if( aEdge->Type() != PCB_MODULE_EDGE_T ) return; m_plotter->SetColor( getColor( aEdge->GetLayer() ) ); - int thickness = std::max( aEdge->GetWidth(), - m_plotter->RenderSettings()->GetDefaultPenWidth() ); - + int thickness = aEdge->GetWidth(); wxPoint pos( aEdge->GetStart() ); wxPoint end( aEdge->GetEnd() ); @@ -632,10 +620,6 @@ void BRDITEMS_PLOTTER::Plot_1_EdgeModule( EDGE_MODULE* aEdge ) // Plot a PCB Text, i.e. a text found on a copper or technical layer void BRDITEMS_PLOTTER::PlotTextePcb( TEXTE_PCB* pt_texte ) { - double orient; - int thickness; - wxPoint pos; - wxSize size; wxString shownText( pt_texte->GetShownText() ); if( shownText.IsEmpty() ) @@ -652,11 +636,10 @@ void BRDITEMS_PLOTTER::PlotTextePcb( TEXTE_PCB* pt_texte ) COLOR4D color = getColor( pt_texte->GetLayer() ); m_plotter->SetColor( color ); - size = pt_texte->GetTextSize(); - pos = pt_texte->GetTextPos(); - orient = pt_texte->GetTextAngle(); - thickness = std::max( pt_texte->GetEffectiveTextPenWidth(), - m_plotter->RenderSettings()->GetDefaultPenWidth() ); + wxSize size = pt_texte->GetTextSize(); + wxPoint pos = pt_texte->GetTextPos(); + double orient = pt_texte->GetTextAngle(); + int thickness = pt_texte->GetEffectiveTextPenWidth(); if( pt_texte->IsMirrored() ) size.x = -size.x; @@ -665,7 +648,7 @@ void BRDITEMS_PLOTTER::PlotTextePcb( TEXTE_PCB* pt_texte ) // but in Pcbnew we do not manage bold texts and thickness up to 1/4 char size // (like bold text) and we manage the thickness. // So we set bold flag to true - bool allow_bold = pt_texte->IsBold() || thickness; + bool allow_bold = true; m_plotter->SetCurrentLineWidth( thickness ); @@ -785,8 +768,7 @@ void BRDITEMS_PLOTTER::PlotDrawSegment( DRAWSEGMENT* aSeg ) int radius = 0; double StAngle = 0, EndAngle = 0; - int thickness = std::max( aSeg->GetWidth(), - m_plotter->RenderSettings()->GetDefaultPenWidth() ); + int thickness = aSeg->GetWidth(); m_plotter->SetColor( getColor( aSeg->GetLayer() ) ); @@ -824,9 +806,8 @@ void BRDITEMS_PLOTTER::PlotDrawSegment( DRAWSEGMENT* aSeg ) break; case S_CURVE: - m_plotter->BezierCurve( aSeg->GetStart(), aSeg->GetBezControl1(), - aSeg->GetBezControl2(), aSeg->GetEnd(), - 0, thickness ); + m_plotter->BezierCurve( aSeg->GetStart(), aSeg->GetBezControl1(), aSeg->GetBezControl2(), + aSeg->GetEnd(), 0, thickness ); break; case S_POLYGON: @@ -837,7 +818,7 @@ void BRDITEMS_PLOTTER::PlotDrawSegment( DRAWSEGMENT* aSeg ) { auto seg = it.Get(); m_plotter->ThickSegment( wxPoint( seg.A ), wxPoint( seg.B ), - thickness, GetPlotMode(), &gbr_metadata ); + thickness, GetPlotMode(), &gbr_metadata ); } } else