61 for(
unsigned layer = 0; layer <
m_LayerSet.size(); ++layer )
68 const KIGFX::VIEW* aView,
const wxString& aTitle ) :
90 auto galPrint = KIGFX::GAL_PRINT::Create( options, dc );
91 auto gal = galPrint->GetGAL();
92 auto printCtx = galPrint->GetPrintCtx();
97 wxRect pageSizePx = GetLogicalPageRect();
98 const VECTOR2D pageSizeIn( (
double) pageSizePx.width / dc->GetPPI().x,
99 (double) pageSizePx.height / dc->GetPPI().y );
100 galPrint->SetSheetSize( pageSizeIn );
104 view->SetPainter( painter.get() );
105 view->SetScaleLimits( 10e9, 0.0001 );
106 view->SetScale( 1.0 );
162 double scaleX = (double) pageSizeIU.
x / bBox.
GetWidth();
163 double scaleY = (double) pageSizeIU.
y / bBox.
GetHeight();
168 view->SetPrintMode( 1 );
171 galPrint->SetNativePaperSize( pageSizeIn, printCtx->HasNativeLandscapeRotation() );
172 gal->SetLookAtPoint( bBox.
Centre() );
183 view->SetPrintMode( 0 );
bool m_background
Print background color.
const PAGE_INFO & m_pageInfo
void Save(APP_SETTINGS_BASE *aConfig) override
virtual void Save(APP_SETTINGS_BASE *aConfig)
Handle the parameters used to print a board drawing.
virtual void SetTopLayer(int aLayer, bool aEnabled=true)
Set given layer to be displayed on the top or sets back the default order of layers.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
virtual std::unique_ptr< KIGFX::PAINTER > getPainter(KIGFX::GAL *aGal)=0
Source VIEW object (note that actual printing only refers to this object)
virtual const COLOR4D & GetBackgroundColor()=0
Return current background color settings.
const KIGFX::VIEW * m_view
Printout parameters.
void SetFlip(bool xAxis, bool yAxis)
Sets flipping of the screen.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
void Load(APP_SETTINGS_BASE *aConfig) override
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
LSET m_LayerSet
Layers to print.
virtual void DrawPage(const wxString &aLayerName=wxEmptyString, int aPageNum=1, int aPageCount=1)
Print a page (or a set of pages).
static constexpr int VIEW_MAX_LAYERS
maximum number of layers that may be shown
Auxiliary rendering target (noncached)
BOARD_PRINTOUT_SETTINGS m_settings
virtual void Load(APP_SETTINGS_BASE *aConfig)
double m_scale
Printing scale.
Board plot function definition file.
COLOR_SETTINGS * m_colorSettings
The color settings to be used for printing.
void SetLayerTarget(int aLayer, RENDER_TARGET aTarget)
Change the rendering target for a particular layer.
Contains all the knowledge about how to draw graphical object onto any particular output device.
LSET is a set of PCB_LAYER_IDs.
void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) override
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
virtual int milsToIU(double aMils) const =0
< Convert mils to internal units
virtual void setupPainter(KIGFX::PAINTER &aPainter)
Configures GAL object for a printout.
const wxPoint GetOrigin() const
Describe the page size and margins of a paper page on which to eventually print or plot.
coord_type GetWidth() const
std::vector< int > layers
List of enabled layers for printing.
virtual void setupGal(KIGFX::GAL *aGal)
Returns bounding box of the printed objects (excluding drawing-sheet frame)
void SetLayerColor(int aLayer, const COLOR4D &aColor)
Change the color used to draw a layer.
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
bool PrintBorderAndTitleBlock() const
Returns true if the drawing border and title block should be printed.
const wxSize & GetSizeMils() const
#define LAYER_ID_COUNT
Must update this if you add any enums after GerbView!
virtual void setupViewLayers(KIGFX::VIEW &aView, const LSET &aLayerSet)
Configures PAINTER object for a printout.
bool m_blackWhite
Print in B&W or Color.
std::unique_ptr< VIEW > DataReference() const
Return a new VIEW object that shares the same set of VIEW_ITEMs and LAYERs.
BOARD_PRINTOUT_SETTINGS(const PAGE_INFO &aPageInfo)
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
virtual void SetBackgroundColor(const COLOR4D &aColor)=0
Set the background color.
int m_pageCount
Number of pages to print.
void SetIsPrinting(bool isPrinting)
Handle the component boundary box.
coord_type GetHeight() const
Board print handler definition file.
BOARD_PRINTOUT(const BOARD_PRINTOUT_SETTINGS &aParams, const KIGFX::VIEW *aView, const wxString &aTitle)
drawingsheet frame and titleblock
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
bool m_Mirror
Print mirrored.
virtual EDA_RECT getBoundingBox()=0
Returns a PAINTER instance used to draw the items.
const wxSize GetSize() const
Abstract interface for drawing on a 2D-surface.