KiCad PCB EDA Suite
PCBNEW_PRINTOUT Class Reference

#include <pcbnew_printout.h>

Inheritance diagram for PCBNEW_PRINTOUT:
BOARD_PRINTOUT

Public Member Functions

 PCBNEW_PRINTOUT (BOARD *aBoard, const PCBNEW_PRINTOUT_SETTINGS &aParams, const KIGFX::VIEW *aView, const wxString &aTitle)
 
bool OnPrintPage (int aPage) override
 
void GetPageInfo (int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) override
 
bool HasPage (int aPage) override
 
virtual void DrawPage (const wxString &aLayerName=wxEmptyString, int aPageNum=1, int aPageCount=1)
 Print a page (or a set of pages). More...
 

Protected Member Functions

int milsToIU (double aMils) const override
 < Convert mils to internal units More...
 
void setupViewLayers (KIGFX::VIEW &aView, const LSET &aLayerSet) override
 Configures PAINTER object for a printout. More...
 
void setupPainter (KIGFX::PAINTER &aPainter) override
 Configures GAL object for a printout. More...
 
void setupGal (KIGFX::GAL *aGal) override
 Returns bounding box of the printed objects (excluding drawing-sheet frame) More...
 
EDA_RECT getBoundingBox () override
 Returns a PAINTER instance used to draw the items. More...
 
std::unique_ptr< KIGFX::PAINTERgetPainter (KIGFX::GAL *aGal) override
 Source VIEW object (note that actual printing only refers to this object) More...
 

Protected Attributes

const KIGFX::VIEWm_view
 Printout parameters. More...
 
BOARD_PRINTOUT_SETTINGS m_settings
 

Private Attributes

BOARDm_board
 
PCBNEW_PRINTOUT_SETTINGS m_pcbnewSettings
 

Detailed Description

Definition at line 52 of file pcbnew_printout.h.

Constructor & Destructor Documentation

◆ PCBNEW_PRINTOUT()

PCBNEW_PRINTOUT::PCBNEW_PRINTOUT ( BOARD aBoard,
const PCBNEW_PRINTOUT_SETTINGS aParams,
const KIGFX::VIEW aView,
const wxString &  aTitle 
)

Definition at line 73 of file pcbnew_printout.cpp.

74  :
75  BOARD_PRINTOUT( aParams, aView, aTitle ), m_pcbnewSettings( aParams )
76 {
77  m_board = aBoard;
78 }
PCBNEW_PRINTOUT_SETTINGS m_pcbnewSettings
BOARD_PRINTOUT(const BOARD_PRINTOUT_SETTINGS &aParams, const KIGFX::VIEW *aView, const wxString &aTitle)

References m_board.

Member Function Documentation

◆ DrawPage()

void BOARD_PRINTOUT::DrawPage ( const wxString &  aLayerName = wxEmptyString,
int  aPageNum = 1,
int  aPageCount = 1 
)
virtualinherited

Print a page (or a set of pages).

Note
This function prepares the print parameters for the function which actually prints the draw layers.
Parameters
aLayerNamea text which can be printed as layer name.
aPageNumthe number of the current page (only used to print this value).
aPageCountthe number of pages to print (only used to print this value).

Definition at line 86 of file board_printout.cpp.

87 {
88  auto dc = GetDC();
90  auto galPrint = KIGFX::GAL_PRINT::Create( options, dc );
91  auto gal = galPrint->GetGAL();
92  auto printCtx = galPrint->GetPrintCtx();
93  auto painter = getPainter( gal );
94  std::unique_ptr<KIGFX::VIEW> view( m_view->DataReference() );
95 
96  // Target paper size
97  wxRect pageSizePx = GetLogicalPageRect();
98  const VECTOR2D pageSizeIn( (double) pageSizePx.width / dc->GetPPI().x,
99  (double) pageSizePx.height / dc->GetPPI().y );
100  galPrint->SetSheetSize( pageSizeIn );
101  const VECTOR2D pageSizeIU( milsToIU( pageSizeIn.x * 1000 ), milsToIU( pageSizeIn.y * 1000 ) );
102 
103  view->SetGAL( gal );
104  view->SetPainter( painter.get() );
105  view->SetScaleLimits( 10e9, 0.0001 );
106  view->SetScale( 1.0 );
107 
108 
109  // Set the color scheme
110  RENDER_SETTINGS* dstSettings = view->GetPainter()->GetSettings();
111  dstSettings->LoadColors( m_settings.m_colorSettings );
112 
114  {
115  for( int i = 0; i < LAYER_ID_COUNT; ++i )
116  dstSettings->SetLayerColor( i, COLOR4D::BLACK );
117  }
118  else // color enabled
119  {
120  for( int i = 0; i < LAYER_ID_COUNT; ++i )
121  {
122  // Cairo does not support translucent colors on PostScript surfaces
123  // see 'Features support by the PostScript surface' on
124  // https://www.cairographics.org/documentation/using_the_postscript_surface/
125  dstSettings->SetLayerColor( i, dstSettings->GetLayerColor( i ).WithAlpha( 1.0 ) );
126  }
127  }
128 
129  dstSettings->SetIsPrinting( true );
130 
131  setupPainter( *painter );
133 
134  auto sheetSizeMils = m_settings.m_pageInfo.GetSizeMils();
135  VECTOR2I sheetSizeIU( milsToIU( sheetSizeMils.GetWidth() ), milsToIU( sheetSizeMils.GetHeight() ) );
136  BOX2I bBox;
137 
138  // Determine printout bounding box
140  {
141  bBox = BOX2I( VECTOR2I( 0, 0 ), VECTOR2I( sheetSizeIU ) );
142  view->SetLayerVisible( LAYER_DRAWINGSHEET, true );
143  }
144  else
145  {
146  EDA_RECT targetBbox = getBoundingBox();
147  bBox = BOX2I( targetBbox.GetOrigin(), targetBbox.GetSize() );
148  view->SetLayerVisible( LAYER_DRAWINGSHEET, false );
149  }
150 
151 
152  // Fit to page
153  if( m_settings.m_scale <= 0.0 )
154  {
155  if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )
156  {
157  // Nothing to print
158  m_settings.m_scale = 1.0;
159  }
160  else
161  {
162  double scaleX = (double) pageSizeIU.x / bBox.GetWidth();
163  double scaleY = (double) pageSizeIU.y / bBox.GetHeight();
164  m_settings.m_scale = std::min( scaleX, scaleY );
165  }
166  }
167 
168  view->SetPrintMode( 1 );
169 
170  setupGal( gal );
171  galPrint->SetNativePaperSize( pageSizeIn, printCtx->HasNativeLandscapeRotation() );
172  gal->SetLookAtPoint( bBox.Centre() );
173  gal->SetZoomFactor( m_settings.m_scale );
174 
175  gal->SetClearColor( dstSettings->GetBackgroundColor() );
176  gal->ClearScreen();
177 
178  {
179  KIGFX::GAL_DRAWING_CONTEXT ctx( gal );
180  view->Redraw();
181  }
182 
183  view->SetPrintMode( 0 );
184 }
BOX2< VECTOR2I > BOX2I
Definition: box2.h:522
const PAGE_INFO & m_pageInfo
Definition: printout.h:63
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
virtual std::unique_ptr< KIGFX::PAINTER > getPainter(KIGFX::GAL *aGal)=0
Source VIEW object (note that actual printing only refers to this object)
virtual const COLOR4D & GetBackgroundColor()=0
Return current background color settings.
const KIGFX::VIEW * m_view
Printout parameters.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
Definition: color4d.h:300
LSET m_LayerSet
Layers to print.
Definition: color4d.h:44
VECTOR2< int > VECTOR2I
Definition: vector2d.h:623
BOARD_PRINTOUT_SETTINGS m_settings
double m_scale
Printing scale.
Definition: printout.h:58
COLOR_SETTINGS * m_colorSettings
The color settings to be used for printing.
Definition: printout.h:66
virtual int milsToIU(double aMils) const =0
< Convert mils to internal units
virtual void setupPainter(KIGFX::PAINTER &aPainter)
Configures GAL object for a printout.
const wxPoint GetOrigin() const
Definition: eda_rect.h:106
coord_type GetWidth() const
Definition: box2.h:197
virtual void setupGal(KIGFX::GAL *aGal)
Returns bounding box of the printed objects (excluding drawing-sheet frame)
void SetLayerColor(int aLayer, const COLOR4D &aColor)
Change the color used to draw a layer.
bool PrintBorderAndTitleBlock() const
Returns true if the drawing border and title block should be printed.
Definition: printout.h:55
const wxSize & GetSizeMils() const
Definition: page_info.h:135
#define LAYER_ID_COUNT
Must update this if you add any enums after GerbView!
virtual void setupViewLayers(KIGFX::VIEW &aView, const LSET &aLayerSet)
Configures PAINTER object for a printout.
bool m_blackWhite
Print in B&W or Color.
Definition: printout.h:60
std::unique_ptr< VIEW > DataReference() const
Return a new VIEW object that shares the same set of VIEW_ITEMs and LAYERs.
Definition: view.cpp:1439
Vec Centre() const
Definition: box2.h:79
void SetIsPrinting(bool isPrinting)
Handle the component boundary box.
Definition: eda_rect.h:42
coord_type GetHeight() const
Definition: box2.h:198
drawingsheet frame and titleblock
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
virtual EDA_RECT getBoundingBox()=0
Returns a PAINTER instance used to draw the items.
const wxSize GetSize() const
Definition: eda_rect.h:96

References BLACK, BOX2< Vec >::Centre(), KIGFX::VIEW::DataReference(), KIGFX::RENDER_SETTINGS::GetBackgroundColor(), BOARD_PRINTOUT::getBoundingBox(), BOX2< Vec >::GetHeight(), KIGFX::RENDER_SETTINGS::GetLayerColor(), EDA_RECT::GetOrigin(), BOARD_PRINTOUT::getPainter(), EDA_RECT::GetSize(), PAGE_INFO::GetSizeMils(), BOX2< Vec >::GetWidth(), LAYER_DRAWINGSHEET, LAYER_ID_COUNT, KIGFX::RENDER_SETTINGS::LoadColors(), PRINTOUT_SETTINGS::m_blackWhite, PRINTOUT_SETTINGS::m_colorSettings, BOARD_PRINTOUT_SETTINGS::m_LayerSet, PRINTOUT_SETTINGS::m_pageInfo, PRINTOUT_SETTINGS::m_scale, BOARD_PRINTOUT::m_settings, BOARD_PRINTOUT::m_view, BOARD_PRINTOUT::milsToIU(), PRINTOUT_SETTINGS::PrintBorderAndTitleBlock(), KIGFX::RENDER_SETTINGS::SetIsPrinting(), KIGFX::RENDER_SETTINGS::SetLayerColor(), BOARD_PRINTOUT::setupGal(), BOARD_PRINTOUT::setupPainter(), BOARD_PRINTOUT::setupViewLayers(), KIGFX::COLOR4D::WithAlpha(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by GERBVIEW_PRINTOUT::OnPrintPage(), and OnPrintPage().

◆ getBoundingBox()

EDA_RECT PCBNEW_PRINTOUT::getBoundingBox ( )
overrideprotectedvirtual

Returns a PAINTER instance used to draw the items.

Implements BOARD_PRINTOUT.

Definition at line 278 of file pcbnew_printout.cpp.

279 {
280  return m_board->ComputeBoundingBox();
281 }
EDA_RECT ComputeBoundingBox(bool aBoardEdgesOnly=false) const
Calculate the bounding box containing all board items (or board edge segments).
Definition: board.cpp:1050

References BOARD::ComputeBoundingBox(), and m_board.

◆ GetPageInfo()

void BOARD_PRINTOUT::GetPageInfo ( int *  minPage,
int *  maxPage,
int *  selPageFrom,
int *  selPageTo 
)
overrideinherited

Definition at line 76 of file board_printout.cpp.

77 {
78  *minPage = 1;
79  *selPageFrom = 1;
80 
81  *maxPage = m_settings.m_pageCount;
82  *selPageTo = m_settings.m_pageCount;
83 }
BOARD_PRINTOUT_SETTINGS m_settings
int m_pageCount
Number of pages to print.
Definition: printout.h:61

References PRINTOUT_SETTINGS::m_pageCount, and BOARD_PRINTOUT::m_settings.

◆ getPainter()

std::unique_ptr< KIGFX::PAINTER > PCBNEW_PRINTOUT::getPainter ( KIGFX::GAL aGal)
overrideprotectedvirtual

Source VIEW object (note that actual printing only refers to this object)

Implements BOARD_PRINTOUT.

Definition at line 284 of file pcbnew_printout.cpp.

285 {
286  return std::make_unique<KIGFX::PCB_PRINT_PAINTER>( aGal );
287 }

◆ HasPage()

bool BOARD_PRINTOUT::HasPage ( int  aPage)
inlineoverrideinherited

Definition at line 80 of file board_printout.h.

81  {
82  return aPage <= m_settings.m_pageCount;
83  }
BOARD_PRINTOUT_SETTINGS m_settings
int m_pageCount
Number of pages to print.
Definition: printout.h:61

References PRINTOUT_SETTINGS::m_pageCount, and BOARD_PRINTOUT::m_settings.

◆ milsToIU()

int PCBNEW_PRINTOUT::milsToIU ( double  aMils) const
overrideprotectedvirtual

< Convert mils to internal units

Enables layers visibility for a printout

Implements BOARD_PRINTOUT.

Definition at line 125 of file pcbnew_printout.cpp.

126 {
127  return KiROUND( IU_PER_MILS * aMils );
128 }
#define IU_PER_MILS
Definition: plotter.cpp:137
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68

References IU_PER_MILS, and KiROUND().

◆ OnPrintPage()

bool PCBNEW_PRINTOUT::OnPrintPage ( int  aPage)
override

Definition at line 81 of file pcbnew_printout.cpp.

82 {
83  // Store the layerset, as it is going to be modified below and the original settings are
84  // needed.
85  LSET lset = m_settings.m_LayerSet;
86  int pageCount = lset.count();
87  wxString layerName;
88  PCB_LAYER_ID extractLayer;
89 
90  // compute layer mask from page number if we want one page per layer
92  {
93  // This sequence is TBD, call a different sequencer if needed, such as Seq().
94  // Could not find documentation on page order.
95  LSEQ seq = lset.UIOrder();
96 
97  // aPage starts at 1, not 0
98  if( unsigned( aPage - 1 ) < seq.size() )
99  m_settings.m_LayerSet = LSET( seq[ aPage - 1] );
100  }
101 
102  if( !m_settings.m_LayerSet.any() )
103  return false;
104 
105  extractLayer = m_settings.m_LayerSet.ExtractLayer();
106 
107  if( extractLayer == UNDEFINED_LAYER )
108  layerName = _( "Multiple Layers" );
109  else
110  layerName = LSET::Name( extractLayer );
111 
112  // In Pcbnew we can want the layer EDGE always printed
115 
116  DrawPage( layerName, aPage, pageCount );
117 
118  // Restore the original layer set, so the next page can be printed
119  m_settings.m_LayerSet = lset;
120 
121  return true;
122 }
bool m_noEdgeLayer
Disable board outline on each page.
LSET m_LayerSet
Layers to print.
virtual void DrawPage(const wxString &aLayerName=wxEmptyString, int aPageNum=1, int aPageCount=1)
Print a page (or a set of pages).
BOARD_PRINTOUT_SETTINGS m_settings
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
Definition: lset.cpp:82
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
PCB_LAYER_ID ExtractLayer() const
Find the first set PCB_LAYER_ID.
Definition: lset.cpp:661
PCBNEW_PRINTOUT_SETTINGS m_pcbnewSettings
#define _(s)
Definition: 3d_actions.cpp:33
enum PCBNEW_PRINTOUT_SETTINGS::PAGINATION_T m_pagination
LSEQ UIOrder() const
Definition: lset.cpp:895

References _, BOARD_PRINTOUT::DrawPage(), Edge_Cuts, LSET::ExtractLayer(), PCBNEW_PRINTOUT_SETTINGS::LAYER_PER_PAGE, BOARD_PRINTOUT_SETTINGS::m_LayerSet, PCBNEW_PRINTOUT_SETTINGS::m_noEdgeLayer, PCBNEW_PRINTOUT_SETTINGS::m_pagination, m_pcbnewSettings, BOARD_PRINTOUT::m_settings, LSET::Name(), LSET::UIOrder(), and UNDEFINED_LAYER.

◆ setupGal()

void PCBNEW_PRINTOUT::setupGal ( KIGFX::GAL aGal)
overrideprotectedvirtual

Returns bounding box of the printed objects (excluding drawing-sheet frame)

Reimplemented from BOARD_PRINTOUT.

Definition at line 271 of file pcbnew_printout.cpp.

272 {
273  BOARD_PRINTOUT::setupGal( aGal );
274  aGal->SetWorldUnitLength( 1e-9 /* 1 nm */ / 0.0254 /* 1 inch in meters */ );
275 }
virtual void setupGal(KIGFX::GAL *aGal)
Returns bounding box of the printed objects (excluding drawing-sheet frame)
void SetWorldUnitLength(double aWorldUnitLength)
Set the unit length.

References BOARD_PRINTOUT::setupGal(), and KIGFX::GAL::SetWorldUnitLength().

◆ setupPainter()

void PCBNEW_PRINTOUT::setupPainter ( KIGFX::PAINTER aPainter)
overrideprotectedvirtual

Configures GAL object for a printout.

Reimplemented from BOARD_PRINTOUT.

Definition at line 237 of file pcbnew_printout.cpp.

238 {
239  BOARD_PRINTOUT::setupPainter( aPainter );
240 
241  KIGFX::PCB_PRINT_PAINTER& painter = dynamic_cast<KIGFX::PCB_PRINT_PAINTER&>( aPainter );
242 
244  {
246  painter.SetDrillMarks( false, 0 );
247  break;
248 
250  painter.SetDrillMarks( false, Millimeter2iu( ADVANCED_CFG::GetCfg().m_SmallDrillMarkSize ) );
251 
255  break;
256 
258  painter.SetDrillMarks( true );
259 
263  break;
264  }
265 
268 }
to draw via holes (pad holes do not use this layer)
handle color for not plated holes (holes, not pads)
Special flavor of PCB_PAINTER that contains modifications to handle printing options.
Definition: color4d.h:44
virtual PCB_RENDER_SETTINGS * GetSettings() override
Return a pointer to current settings that are going to be used when drawing items.
Definition: pcb_painter.h:247
virtual void setupPainter(KIGFX::PAINTER &aPainter)
Configures GAL object for a printout.
void SetLayerColor(int aLayer, const COLOR4D &aColor)
Change the color used to draw a layer.
void SetDrawIndividualViaLayers(bool aFlag)
Definition: pcb_painter.h:175
PCBNEW_PRINTOUT_SETTINGS m_pcbnewSettings
enum PCBNEW_PRINTOUT_SETTINGS::PAGINATION_T m_pagination
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
enum PCBNEW_PRINTOUT_SETTINGS::DRILL_MARK_SHAPE_T m_drillMarks
static constexpr int Millimeter2iu(double mm)
void SetDrillMarks(bool aRealSize, unsigned int aSize=0)
Set drill marks visibility and options.

References BLACK, PCBNEW_PRINTOUT_SETTINGS::FULL_DRILL_SHAPE, ADVANCED_CFG::GetCfg(), KIGFX::PCB_PAINTER::GetSettings(), LAYER_NON_PLATEDHOLES, LAYER_PAD_PLATEDHOLES, PCBNEW_PRINTOUT_SETTINGS::LAYER_PER_PAGE, LAYER_VIA_HOLES, PCBNEW_PRINTOUT_SETTINGS::m_drillMarks, PCBNEW_PRINTOUT_SETTINGS::m_pagination, m_pcbnewSettings, Millimeter2iu(), PCBNEW_PRINTOUT_SETTINGS::NO_DRILL_SHAPE, KIGFX::PCB_RENDER_SETTINGS::SetDrawIndividualViaLayers(), KIGFX::PCB_PRINT_PAINTER::SetDrillMarks(), KIGFX::RENDER_SETTINGS::SetLayerColor(), BOARD_PRINTOUT::setupPainter(), and PCBNEW_PRINTOUT_SETTINGS::SMALL_DRILL_SHAPE.

◆ setupViewLayers()

void PCBNEW_PRINTOUT::setupViewLayers ( KIGFX::VIEW aView,
const LSET aLayerSet 
)
overrideprotectedvirtual

Configures PAINTER object for a printout.

Reimplemented from BOARD_PRINTOUT.

Definition at line 131 of file pcbnew_printout.cpp.

132 {
133  BOARD_PRINTOUT::setupViewLayers( aView, aLayerSet );
134 
135  for( PCB_LAYER_ID layer : m_settings.m_LayerSet.Seq() )
136  {
137  aView.SetLayerVisible( PCBNEW_LAYER_ID_START + layer, true );
138 
139  // Enable the corresponding zone layer
140  if( IsCopperLayer( layer ) )
141  aView.SetLayerVisible( LAYER_ZONE_START + layer, true );
142  }
143 
144  RENDER_SETTINGS* renderSettings = aView.GetPainter()->GetSettings();
145  COLOR4D backgroundColor = renderSettings->GetLayerColor( LAYER_PCB_BACKGROUND );
146 
148  {
149  auto setVisibility =
150  [&]( GAL_LAYER_ID aLayer )
151  {
152  if( m_board->IsElementVisible( aLayer ) )
153  aView.SetLayerVisible( aLayer, true );
154  else
155  renderSettings->SetLayerColor( aLayer, backgroundColor );
156  };
157 
158  setVisibility( LAYER_MOD_FR );
159  setVisibility( LAYER_MOD_BK );
160  setVisibility( LAYER_MOD_VALUES );
161  setVisibility( LAYER_MOD_REFERENCES );
162  setVisibility( LAYER_MOD_TEXT_FR );
163  setVisibility( LAYER_MOD_TEXT_BK );
164  setVisibility( LAYER_MOD_TEXT_INVISIBLE );
165  setVisibility( LAYER_PAD_FR );
166  setVisibility( LAYER_PAD_BK );
167  setVisibility( LAYER_PADS_TH );
168 
169  setVisibility( LAYER_TRACKS );
170  setVisibility( LAYER_VIAS );
171 
172  setVisibility( LAYER_NO_CONNECTS );
173  setVisibility( LAYER_DRC_WARNING );
174  setVisibility( LAYER_DRC_ERROR );
175  setVisibility( LAYER_DRC_EXCLUSION );
176  setVisibility( LAYER_ANCHOR );
177  setVisibility( LAYER_DRAWINGSHEET );
178  setVisibility( LAYER_GRID );
179 
180  // Keep certain items always enabled and just rely on either the finer or coarser
181  // visibility controls
182  const int alwaysEnabled[] =
183  {
186  };
187 
188  for( int layer : alwaysEnabled )
189  aView.SetLayerVisible( layer, true );
190  }
191  else
192  {
193  // Enable pad layers corresponding to the selected copper layers
194  if( aLayerSet.test( F_Cu ) )
195  aView.SetLayerVisible( LAYER_PAD_FR, true );
196  else
197  renderSettings->SetLayerColor( LAYER_PAD_FR, backgroundColor );
198 
199  if( aLayerSet.test( B_Cu ) )
200  aView.SetLayerVisible( LAYER_PAD_BK, true );
201  else
202  renderSettings->SetLayerColor( LAYER_PAD_BK, backgroundColor );
203 
204  // Enable items on copper layers, but do not draw holes
205  for( GAL_LAYER_ID layer : { LAYER_PADS_TH, LAYER_VIA_THROUGH } )
206  {
207  if( ( aLayerSet & LSET::AllCuMask() ).any() ) // Items visible on any copper layer
208  aView.SetLayerVisible( layer, true );
209  else
210  renderSettings->SetLayerColor( layer, backgroundColor );
211  }
212 
213  // Keep certain items always enabled/disabled and just rely on the layer visibility
214  const int alwaysEnabled[] =
215  {
219  };
220 
221  for( int layer : alwaysEnabled )
222  aView.SetLayerVisible( layer, true );
223  }
224 
226  {
227  // Enable hole layers to draw drill marks
229  {
230  aView.SetLayerVisible( layer, true );
231  aView.SetTopLayer( layer, true );
232  }
233  }
234 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:750
Virtual layers for stacking zones and tracks on a given copper layer.
to draw blind/buried vias
show a marker on pads with no nets
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.
Definition: view.cpp:837
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
multilayer pads, usually with holes
to draw via holes (pad holes do not use this layer)
handle color for not plated holes (holes, not pads)
anchor of items having an anchor point (texts, footprints)
Control for copper zone opacity/visibility (color ignored)
show footprints on back
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
show footprints values (when texts are visibles)
LSET m_LayerSet
Layers to print.
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:411
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Definition: view.h:207
BOARD_PRINTOUT_SETTINGS m_settings
show footprints on front
PCB_LAYER_ID
A quick note on layer IDs:
Meta control for all pads opacity/visibility (color ignored)
to draw usual through hole vias
void SetLayerColor(int aLayer, const COLOR4D &aColor)
Change the color used to draw a layer.
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
Definition: view.h:387
bool m_asItemCheckboxes
Honor checkboxes in the Items tab of the Layers Manager.
virtual void setupViewLayers(KIGFX::VIEW &aView, const LSET &aLayerSet)
Configures PAINTER object for a printout.
layer for drc markers which have been individually excluded
bool IsElementVisible(GAL_LAYER_ID aLayer) const
Test whether a given element category is visible.
Definition: board.cpp:507
layer for drc markers with SEVERITY_WARNING
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
smd pads, front layer
Meta control for all vias opacity/visibility.
PCBNEW_PRINTOUT_SETTINGS m_pcbnewSettings
bool IsCopperLayer(LAYER_NUM aLayerId)
Tests whether a layer is a copper layer.
enum PCBNEW_PRINTOUT_SETTINGS::DRILL_MARK_SHAPE_T m_drillMarks
drawingsheet frame and titleblock
show footprints references (when texts are visibles)
layer for drc markers with SEVERITY_ERROR
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:98

References LSET::AllCuMask(), B_Cu, F_Cu, KIGFX::RENDER_SETTINGS::GetLayerColor(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), IsCopperLayer(), BOARD::IsElementVisible(), LAYER_ANCHOR, LAYER_DRAWINGSHEET, LAYER_DRC_ERROR, LAYER_DRC_EXCLUSION, LAYER_DRC_WARNING, LAYER_GRID, LAYER_MOD_BK, LAYER_MOD_FR, LAYER_MOD_REFERENCES, LAYER_MOD_TEXT_BK, LAYER_MOD_TEXT_FR, LAYER_MOD_TEXT_INVISIBLE, LAYER_MOD_VALUES, LAYER_NO_CONNECTS, LAYER_NON_PLATEDHOLES, LAYER_PAD_BK, LAYER_PAD_FR, LAYER_PAD_PLATEDHOLES, LAYER_PADS, LAYER_PADS_TH, LAYER_PCB_BACKGROUND, LAYER_TRACKS, LAYER_VIA_BBLIND, LAYER_VIA_HOLES, LAYER_VIA_MICROVIA, LAYER_VIA_THROUGH, LAYER_VIAS, LAYER_ZONE_START, LAYER_ZONES, PCBNEW_PRINTOUT_SETTINGS::m_asItemCheckboxes, m_board, PCBNEW_PRINTOUT_SETTINGS::m_drillMarks, BOARD_PRINTOUT_SETTINGS::m_LayerSet, m_pcbnewSettings, BOARD_PRINTOUT::m_settings, PCBNEW_PRINTOUT_SETTINGS::NO_DRILL_SHAPE, PCBNEW_LAYER_ID_START, LSET::Seq(), KIGFX::RENDER_SETTINGS::SetLayerColor(), KIGFX::VIEW::SetLayerVisible(), KIGFX::VIEW::SetTopLayer(), and BOARD_PRINTOUT::setupViewLayers().

Member Data Documentation

◆ m_board

BOARD* PCBNEW_PRINTOUT::m_board
private

Definition at line 74 of file pcbnew_printout.h.

Referenced by getBoundingBox(), PCBNEW_PRINTOUT(), and setupViewLayers().

◆ m_pcbnewSettings

PCBNEW_PRINTOUT_SETTINGS PCBNEW_PRINTOUT::m_pcbnewSettings
private

Definition at line 76 of file pcbnew_printout.h.

Referenced by OnPrintPage(), setupPainter(), and setupViewLayers().

◆ m_settings

◆ m_view

const KIGFX::VIEW* BOARD_PRINTOUT::m_view
protectedinherited

Printout parameters.

Definition at line 118 of file board_printout.h.

Referenced by BOARD_PRINTOUT::BOARD_PRINTOUT(), and BOARD_PRINTOUT::DrawPage().


The documentation for this class was generated from the following files: