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 328 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().

331 {
332  // Print pads
333  for( D_PAD* pad = aModule->PadsList(); pad; pad = pad->Next() )
334  {
335  if( !( pad->GetLayerSet() & aMask ).any() )
336  continue;
337 
338  // Manage hole according to the print drill option
339  wxSize drill_tmp = pad->GetDrillSize();
340 
341  switch( aDrillShapeOpt )
342  {
344  pad->SetDrillSize( wxSize(0,0) );
345  break;
346 
348  {
349  wxSize sz( std::min( SMALL_DRILL, pad->GetDrillSize().x ),
350  std::min( SMALL_DRILL, pad->GetDrillSize().y ) );
351 
352  pad->SetDrillSize( sz );
353  }
354  break;
355 
357  // Do nothing
358  break;
359  }
360 
361  pad->Draw( aPanel, aDC, aDraw_mode );
362  pad->SetDrillSize( drill_tmp );
363  }
364 
365  if( aModule->Reference().IsVisible() && aMask[aModule->Reference().GetLayer()] )
366  aModule->Reference().Draw( aPanel, aDC, aDraw_mode );
367 
368  if( aModule->Value().IsVisible() && aMask[aModule->Value().GetLayer()] )
369  aModule->Value().Draw( aPanel, aDC, aDraw_mode );
370 
371  for( EDA_ITEM* item = aModule->GraphicalItemsList(); item; item = item->Next() )
372  {
373  switch( item->Type() )
374  {
375  case PCB_MODULE_TEXT_T:
376  {
377  TEXTE_MODULE* textMod = static_cast<TEXTE_MODULE*>( item );
378 
379  if( !aMask[textMod->GetLayer()] )
380  break;
381 
382  textMod->Draw( aPanel, aDC, aDraw_mode );
383  break;
384  }
385 
386  case PCB_MODULE_EDGE_T:
387  {
388  EDGE_MODULE* edge = static_cast<EDGE_MODULE*>( item );
389 
390  if( !aMask[edge->GetLayer()] )
391  break;
392 
393  edge->Draw( aPanel, aDC, aDraw_mode );
394  }
395  break;
396 
397  default:
398  break;
399  }
400  }
401 }
#define SMALL_DRILL
Definition: pcbplot.h:72
TEXTE_MODULE & Reference()
Definition: class_module.h:501
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:500
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:180
DLIST< BOARD_ITEM > & GraphicalItemsList()
Definition: class_module.h:163
DLIST< D_PAD > & PadsList()
Definition: class_module.h:160
#define min(a, b)
Definition: auxiliary.h:85