KiCad PCB EDA Suite
print_board_functions.cpp File Reference

Functions to print boards. More...

#include <fctsys.h>
#include <class_drawpanel.h>
#include <wxPcbStruct.h>
#include <printout_controler.h>
#include <colors_selection.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 <module_editor_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 316 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, D_PAD::Next(), BOARD_ITEM::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().

319 {
320  // Print pads
321  for( D_PAD* pad = aModule->PadsList(); pad; pad = pad->Next() )
322  {
323  if( !( pad->GetLayerSet() & aMask ).any() )
324  continue;
325 
326  // Manage hole according to the print drill option
327  wxSize drill_tmp = pad->GetDrillSize();
328 
329  switch( aDrillShapeOpt )
330  {
332  pad->SetDrillSize( wxSize(0,0) );
333  break;
334 
336  {
337  wxSize sz( std::min( SMALL_DRILL, pad->GetDrillSize().x ),
338  std::min( SMALL_DRILL, pad->GetDrillSize().y ) );
339 
340  pad->SetDrillSize( sz );
341  }
342  break;
343 
345  // Do nothing
346  break;
347  }
348 
349  pad->Draw( aPanel, aDC, aDraw_mode );
350  pad->SetDrillSize( drill_tmp );
351  }
352 
353  if( aModule->Reference().IsVisible() && aMask[aModule->Reference().GetLayer()] )
354  aModule->Reference().Draw( aPanel, aDC, aDraw_mode );
355 
356  if( aModule->Value().IsVisible() && aMask[aModule->Value().GetLayer()] )
357  aModule->Value().Draw( aPanel, aDC, aDraw_mode );
358 
359  for( EDA_ITEM* item = aModule->GraphicalItemsList(); item; item = item->Next() )
360  {
361  switch( item->Type() )
362  {
363  case PCB_MODULE_TEXT_T:
364  {
365  TEXTE_MODULE* textMod = static_cast<TEXTE_MODULE*>( item );
366 
367  if( !aMask[textMod->GetLayer()] )
368  break;
369 
370  textMod->Draw( aPanel, aDC, aDraw_mode );
371  break;
372  }
373 
374  case PCB_MODULE_EDGE_T:
375  {
376  EDGE_MODULE* edge = static_cast<EDGE_MODULE*>( item );
377 
378  if( !aMask[edge->GetLayer()] )
379  break;
380 
381  edge->Draw( aPanel, aDC, aDraw_mode );
382  }
383  break;
384 
385  default:
386  break;
387  }
388  }
389 }
#define SMALL_DRILL
Definition: pcbplot.h:72
TEXTE_MODULE & Reference()
Definition: class_module.h:463
class EDGE_MODULE, a footprint edge
Definition: typeinfo.h:106
BOARD_ITEM * Next() const
TEXTE_MODULE & Value()
read/write accessors:
Definition: class_module.h:462
D_PAD * Next() const
Definition: class_pad.h:106
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:105
PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
bool IsVisible() const
Definition: eda_text.h:176
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:151
DLIST< BOARD_ITEM > & GraphicalItemsList()
Definition: class_module.h:137
DLIST< D_PAD > & PadsList()
Definition: class_module.h:134
#define min(a, b)
Definition: auxiliary.h:85