KiCad PCB EDA Suite
print_board_functions.cpp File Reference

Functions to print boards. More...

#include <fctsys.h>
#include <class_drawpanel.h>
#include <pcb_edit_frame.h>
#include <printout_controler.h>
#include <class_board.h>
#include <class_module.h>
#include <class_edge_mod.h>
#include <class_track.h>
#include <class_zone.h>
#include <pcbnew.h>
#include <pcbplot.h>
#include <footprint_edit_frame.h>

Go to the source code of this file.

Functions

static void Print_Module (EDA_DRAW_PANEL *aPanel, wxDC *aDC, MODULE *aModule, GR_DRAWMODE aDraw_mode, LSET aMasklayer, PRINT_PARAMETERS::DrillShapeOptT aDrillShapeOpt)
 

Detailed Description

Functions to print boards.

Definition in file print_board_functions.cpp.

Function Documentation

static void Print_Module ( EDA_DRAW_PANEL aPanel,
wxDC *  aDC,
MODULE aModule,
GR_DRAWMODE  aDraw_mode,
LSET  aMasklayer,
PRINT_PARAMETERS::DrillShapeOptT  aDrillShapeOpt 
)
static

Definition at line 295 of file print_board_functions.cpp.

References EDGE_MODULE::Draw(), TEXTE_MODULE::Draw(), PRINT_PARAMETERS::FULL_DRILL_SHAPE, BOARD_ITEM::GetLayer(), MODULE::GraphicalItemsList(), EDA_TEXT::IsVisible(), min, BOARD_ITEM::Next(), D_PAD::Next(), PRINT_PARAMETERS::NO_DRILL_SHAPE, MODULE::PadsList(), PCB_MODULE_EDGE_T, PCB_MODULE_TEXT_T, MODULE::Reference(), SMALL_DRILL, PRINT_PARAMETERS::SMALL_DRILL_SHAPE, and MODULE::Value().

Referenced by FOOTPRINT_EDIT_FRAME::PrintPage(), and PCB_EDIT_FRAME::PrintPage().

298 {
299  // Print pads
300  for( D_PAD* pad = aModule->PadsList(); pad; pad = pad->Next() )
301  {
302  if( !( pad->GetLayerSet() & aMask ).any() )
303  continue;
304 
305  // Manage hole according to the print drill option
306  wxSize drill_tmp = pad->GetDrillSize();
307 
308  switch( aDrillShapeOpt )
309  {
311  pad->SetDrillSize( wxSize(0,0) );
312  break;
313 
315  {
316  wxSize sz( std::min( SMALL_DRILL, pad->GetDrillSize().x ),
317  std::min( SMALL_DRILL, pad->GetDrillSize().y ) );
318 
319  pad->SetDrillSize( sz );
320  }
321  break;
322 
324  // Do nothing
325  break;
326  }
327 
328  pad->Draw( aPanel, aDC, aDraw_mode );
329  pad->SetDrillSize( drill_tmp );
330  }
331 
332  if( aModule->Reference().IsVisible() && aMask[aModule->Reference().GetLayer()] )
333  aModule->Reference().Draw( aPanel, aDC, aDraw_mode );
334 
335  if( aModule->Value().IsVisible() && aMask[aModule->Value().GetLayer()] )
336  aModule->Value().Draw( aPanel, aDC, aDraw_mode );
337 
338  for( EDA_ITEM* item = aModule->GraphicalItemsList(); item; item = item->Next() )
339  {
340  switch( item->Type() )
341  {
342  case PCB_MODULE_TEXT_T:
343  {
344  TEXTE_MODULE* textMod = static_cast<TEXTE_MODULE*>( item );
345 
346  if( !aMask[textMod->GetLayer()] )
347  break;
348 
349  textMod->Draw( aPanel, aDC, aDraw_mode );
350  break;
351  }
352 
353  case PCB_MODULE_EDGE_T:
354  {
355  EDGE_MODULE* edge = static_cast<EDGE_MODULE*>( item );
356 
357  if( !aMask[edge->GetLayer()] )
358  break;
359 
360  edge->Draw( aPanel, aDC, aDraw_mode );
361  }
362  break;
363 
364  default:
365  break;
366  }
367  }
368 }
#define SMALL_DRILL
Definition: pcbplot.h:73
TEXTE_MODULE & Reference()
Definition: class_module.h:502
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:94
BOARD_ITEM * Next() const
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:501
D_PAD * Next() const
Definition: class_pad.h:160
void Draw(EDA_DRAW_PANEL *panel, wxDC *DC, GR_DRAWMODE aDrawMode, const wxPoint &offset=ZeroOffset) override
Function Draw BOARD_ITEMs have their own color information.
void Draw(EDA_DRAW_PANEL *aPanel, wxDC *aDC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset) override
Function Draw Draw the text according to the footprint pos and orient.
class TEXTE_MODULE, text in a footprint
Definition: typeinfo.h:93
bool IsVisible() const
Definition: eda_text.h:174
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:162
DLIST< BOARD_ITEM > & GraphicalItemsList()
Definition: class_module.h:164
DLIST< D_PAD > & PadsList()
Definition: class_module.h:161
#define min(a, b)
Definition: auxiliary.h:85