83 const KIGFX::VIEW* aView,
const wxString& aTitle ) :
84 BOARD_PRINTOUT( aParams, aView, aTitle ), m_pcbnewSettings( aParams )
95 int pageCount = lset.count();
107 if(
unsigned( aPage - 1 ) < seq.size() )
117 layerName =
_(
"Multiple Layers" );
125 DrawPage( layerName, aPage, pageCount );
155 COLOR4D invisible_color = COLOR4D::UNSPECIFIED;
199 if( !aLayerSet.test(
F_Cu ) )
202 if( !aLayerSet.test(
B_Cu ) )
217 const int alwaysEnabled[] =
226 for(
int layer : alwaysEnabled )
260 case DRILL_MARKS::NO_DRILL_SHAPE:
264 case DRILL_MARKS::SMALL_DRILL_SHAPE:
272 case DRILL_MARKS::FULL_DRILL_SHAPE:
298 return std::make_unique<KIGFX::PCB_PRINT_PAINTER>( aGal );
304 m_drillMarkReal( false ),
317 if( m_drillMarkReal )
constexpr EDA_IU_SCALE pcbIUScale
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
BASE_SET & set(size_t pos)
An object derived from wxPrintout to handle the necessary information to control a printer when print...
virtual void DrawPage(const wxString &aLayerName=wxEmptyString, int aPageNum=1, int aPageCount=1)
Print a page (or a set of pages).
virtual void setupPainter(KIGFX::PAINTER &aPainter)
Configures GAL object for a printout.
virtual void setupViewLayers(KIGFX::VIEW &aView, const LSET &aLayerSet)
Configures PAINTER object for a printout.
virtual void setupGal(KIGFX::GAL *aGal)
Returns bounding box of the printed objects (excluding drawing-sheet frame)
BOARD_PRINTOUT_SETTINGS m_settings
Information pertinent to a Pcbnew printed circuit board.
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
BOX2I ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
A color representation with 4 components: red, green, blue, alpha.
Abstract interface for drawing on a 2D-surface.
void SetWorldUnitLength(double aWorldUnitLength)
Set the unit length.
Contains all the knowledge about how to draw graphical object onto any particular output device.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
Contains methods for drawing PCB-specific items.
virtual SHAPE_SEGMENT getPadHoleShape(const PAD *aPad) const
Return hole shape for a pad (internal units).
virtual PCB_RENDER_SETTINGS * GetSettings() override
Return a pointer to current settings that are going to be used when drawing items.
virtual PAD_DRILL_SHAPE getDrillShape(const PAD *aPad) const
Return drill shape of a pad.
virtual int getViaDrillSize(const PCB_VIA *aVia) const
Return drill diameter for a via (internal units).
Special flavor of PCB_PAINTER that contains modifications to handle printing options.
void SetDrillMarks(bool aRealSize, unsigned int aSize=0)
Set drill marks visibility and options.
SHAPE_SEGMENT getPadHoleShape(const PAD *aPad) const override
Return hole shape for a pad (internal units).
PCB_PRINT_PAINTER(GAL *aGal)
int getViaDrillSize(const PCB_VIA *aVia) const override
Return drill diameter for a via (internal units).
PAD_DRILL_SHAPE getDrillShape(const PAD *aPad) const override
Return drill shape of a pad.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void SetLayerColor(int aLayer, const COLOR4D &aColor)
Change the color used to draw a layer.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
virtual void SetTopLayer(int aLayer, bool aEnabled=true)
Set given layer to be displayed on the top or sets back the default order of layers.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
LSEQ UIOrder() const
Returns the copper, technical and user layers in the order shown in layer widget.
PCB_LAYER_ID ExtractLayer() const
Find the first set PCB_LAYER_ID.
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
VECTOR2I GetPosition() const override
Describe the page size and margins of a paper page on which to eventually print or plot.
int milsToIU(double aMils) const override
< Convert mils to internal units
bool OnPrintPage(int aPage) override
std::unique_ptr< KIGFX::PAINTER > getPainter(KIGFX::GAL *aGal) override
Source VIEW object (note that actual printing only refers to this object)
void setupGal(KIGFX::GAL *aGal) override
Returns bounding box of the printed objects (excluding drawing-sheet frame)
PCBNEW_PRINTOUT(BOARD *aBoard, const PCBNEW_PRINTOUT_SETTINGS &aParams, const KIGFX::VIEW *aView, const wxString &aTitle)
PCBNEW_PRINTOUT_SETTINGS m_pcbnewSettings
void setupPainter(KIGFX::PAINTER &aPainter) override
Configures GAL object for a printout.
BOX2I getBoundingBox() override
Returns a PAINTER instance used to draw the items.
void setupViewLayers(KIGFX::VIEW &aView, const LSET &aLayerSet) override
Configures PAINTER object for a printout.
double m_SmallDrillMarkSize
The diameter of the drill marks on print and plot outputs (in mm) when the "Drill marks" option is se...
constexpr PCB_LAYER_ID PCBNEW_LAYER_ID_START
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
@ LAYER_FOOTPRINTS_FR
show footprints on front
@ LAYER_NON_PLATEDHOLES
handle color for not plated holes (holes, not pads)
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
@ LAYER_FP_REFERENCES
show footprints references (when texts are visible)
@ LAYER_DRC_EXCLUSION
layer for drc markers which have been individually excluded
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored)
@ LAYER_SHAPES
Copper graphic shape opacity/visibility (color ignored)
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored)
@ LAYER_DRC_WARNING
layer for drc markers with SEVERITY_WARNING
@ LAYER_PAD_PLATEDHOLES
to draw pad holes (plated)
@ LAYER_ZONE_START
Virtual layers for stacking zones and tracks on a given copper layer.
@ LAYER_FOOTPRINTS_BK
show footprints on back
@ LAYER_ANCHOR
anchor of items having an anchor point (texts, footprints)
@ LAYER_PADS_SMD_BK
smd pads, back layer
@ LAYER_PADS_TH
multilayer pads, usually with holes
@ LAYER_PADS_SMD_FR
smd pads, front layer
@ LAYER_VIA_HOLES
to draw via holes (pad holes do not use this layer)
@ LAYER_FP_VALUES
show footprints values (when texts are visible)
@ LAYER_VIA_MICROVIA
to draw micro vias
@ LAYER_VIA_THROUGH
to draw usual through hole vias
@ LAYER_DRC_ERROR
layer for drc markers with SEVERITY_ERROR
@ LAYER_VIAS
Meta control for all vias opacity/visibility.
@ LAYER_VIA_BBLIND
to draw blind/buried vias
PCB_LAYER_ID
A quick note on layer IDs:
PAD_DRILL_SHAPE
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
DRILL_MARKS
Plots and prints can show holes in pads and vias 3 options are available:
void Load(APP_SETTINGS_BASE *aConfig) override
LSET m_LayerSet
Layers to print.
void Save(APP_SETTINGS_BASE *aConfig) override
bool m_Mirror
Print mirrored.
constexpr int mmToIU(double mm) const
enum PCBNEW_PRINTOUT_SETTINGS::PAGINATION_T m_Pagination
bool m_PrintEdgeCutsOnAllPages
Print board outline on each page.
enum DRILL_MARKS m_DrillMarks
bool m_AsItemCheckboxes
Honor checkboxes in the Items tab of the Layers Manager.
void Load(APP_SETTINGS_BASE *aConfig) override
void Save(APP_SETTINGS_BASE *aConfig) override
PCBNEW_PRINTOUT_SETTINGS(const PAGE_INFO &aPageInfo)
bool m_blackWhite
Print in B&W or Color.