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

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