KiCad PCB EDA Suite
Loading...
Searching...
No Matches
BOARD_PRINTOUT Class Referenceabstract

An object derived from wxPrintout to handle the necessary information to control a printer when printing a board. More...

#include <board_printout.h>

Inheritance diagram for BOARD_PRINTOUT:
GERBVIEW_PRINTOUT PCBNEW_PRINTOUT

Public Member Functions

 BOARD_PRINTOUT (const BOARD_PRINTOUT_SETTINGS &aParams, const KIGFX::VIEW *aView, const wxString &aTitle)
 
virtual ~BOARD_PRINTOUT ()
 
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).
 

Protected Member Functions

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

Protected Attributes

const KIGFX::VIEWm_view
 Printout parameters.
 
BOARD_PRINTOUT_SETTINGS m_settings
 
bool m_gerbviewPrint
 True if the caller is Gerbview, false for Pcbnew.
 

Detailed Description

An object derived from wxPrintout to handle the necessary information to control a printer when printing a board.

Definition at line 67 of file board_printout.h.

Constructor & Destructor Documentation

◆ BOARD_PRINTOUT()

BOARD_PRINTOUT::BOARD_PRINTOUT ( const BOARD_PRINTOUT_SETTINGS aParams,
const KIGFX::VIEW aView,
const wxString &  aTitle 
)

Definition at line 69 of file board_printout.cpp.

References m_gerbviewPrint, and m_view.

◆ ~BOARD_PRINTOUT()

virtual BOARD_PRINTOUT::~BOARD_PRINTOUT ( )
inlinevirtual

Definition at line 73 of file board_printout.h.

Member Function Documentation

◆ DrawPage()

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

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 89 of file board_printout.cpp.

References BOX2< Vec >::Centre(), KIGFX::GAL::ClearScreen(), KIGFX::GAL_PRINT::Create(), KIGFX::VIEW::DataReference(), KIGFX::RENDER_SETTINGS::GetBackgroundColor(), getBoundingBox(), BOX2< Vec >::GetHeight(), KIGFX::RENDER_SETTINGS::GetLayerColor(), getPainter(), PAGE_INFO::GetSizeMils(), BOX2< Vec >::GetWidth(), KIGFX::PRINT_CONTEXT::HasNativeLandscapeRotation(), LAYER_DRAWINGSHEET, LAYER_ID_COUNT, KIGFX::RENDER_SETTINGS::LoadColors(), PRINTOUT_SETTINGS::m_blackWhite, PRINTOUT_SETTINGS::m_colorSettings, m_gerbviewPrint, BOARD_PRINTOUT_SETTINGS::m_LayerSet, PRINTOUT_SETTINGS::m_pageInfo, PRINTOUT_SETTINGS::m_scale, m_settings, m_view, milsToIU(), PRINTOUT_SETTINGS::PrintBorderAndTitleBlock(), KIGFX::RENDER_SETTINGS::SetBackgroundColor(), KIGFX::GAL::SetClearColor(), KIGFX::RENDER_SETTINGS::SetIsPrinting(), KIGFX::RENDER_SETTINGS::SetLayerColor(), KIGFX::RENDER_SETTINGS::SetLayerName(), KIGFX::GAL::SetLookAtPoint(), KIGFX::RENDER_SETTINGS::SetPrintLayers(), setupGal(), setupPainter(), setupViewLayers(), KIGFX::GAL::SetZoomFactor(), KIGFX::COLOR4D::WithAlpha(), VECTOR2< T >::x, and VECTOR2< T >::y.

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

◆ getBoundingBox()

virtual BOX2I BOARD_PRINTOUT::getBoundingBox ( )
protectedpure virtual

Returns a PAINTER instance used to draw the items.

Implemented in GERBVIEW_PRINTOUT, and PCBNEW_PRINTOUT.

Referenced by DrawPage().

◆ GetPageInfo()

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

Definition at line 79 of file board_printout.cpp.

References PRINTOUT_SETTINGS::m_pageCount, and m_settings.

◆ getPainter()

virtual std::unique_ptr< KIGFX::PAINTER > BOARD_PRINTOUT::getPainter ( KIGFX::GAL aGal)
protectedpure virtual

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

Implemented in GERBVIEW_PRINTOUT, and PCBNEW_PRINTOUT.

Referenced by DrawPage().

◆ HasPage()

bool BOARD_PRINTOUT::HasPage ( int  aPage)
inlineoverride

Definition at line 77 of file board_printout.h.

References PRINTOUT_SETTINGS::m_pageCount, and m_settings.

◆ milsToIU()

virtual int BOARD_PRINTOUT::milsToIU ( double  aMils) const
protectedpure virtual

< Convert mils to internal units

Enables layers visibility for a printout

Implemented in GERBVIEW_PRINTOUT, and PCBNEW_PRINTOUT.

Referenced by DrawPage().

◆ setupGal()

void BOARD_PRINTOUT::setupGal ( KIGFX::GAL aGal)
protectedvirtual

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

Reimplemented in GERBVIEW_PRINTOUT, and PCBNEW_PRINTOUT.

Definition at line 211 of file board_printout.cpp.

References BOARD_PRINTOUT_SETTINGS::m_Mirror, m_settings, and KIGFX::GAL::SetFlip().

Referenced by DrawPage(), GERBVIEW_PRINTOUT::setupGal(), and PCBNEW_PRINTOUT::setupGal().

◆ setupPainter()

void BOARD_PRINTOUT::setupPainter ( KIGFX::PAINTER aPainter)
protectedvirtual

Configures GAL object for a printout.

Reimplemented in PCBNEW_PRINTOUT.

Definition at line 204 of file board_printout.cpp.

References KIGFX::PAINTER::GetSettings(), PRINTOUT_SETTINGS::m_background, m_settings, and KIGFX::RENDER_SETTINGS::SetBackgroundColor().

Referenced by DrawPage(), and PCBNEW_PRINTOUT::setupPainter().

◆ setupViewLayers()

void BOARD_PRINTOUT::setupViewLayers ( KIGFX::VIEW aView,
const LSET aLayerSet 
)
protectedvirtual

Member Data Documentation

◆ m_gerbviewPrint

bool BOARD_PRINTOUT::m_gerbviewPrint
protected

True if the caller is Gerbview, false for Pcbnew.

Definition at line 121 of file board_printout.h.

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

◆ m_settings

◆ m_view

const KIGFX::VIEW* BOARD_PRINTOUT::m_view
protected

Printout parameters.

Definition at line 115 of file board_printout.h.

Referenced by BOARD_PRINTOUT(), and DrawPage().


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