61 for(
unsigned layer = 0; layer <
m_LayerSet.size(); ++layer )
68 const KIGFX::VIEW* aView,
const wxString& aTitle ) :
91 std::unique_ptr<KIGFX::GAL_PRINT> galPrint = KIGFX::GAL_PRINT::Create( options, dc );
94 std::unique_ptr<KIGFX::PAINTER> painter =
getPainter( gal );
98 wxRect pageSizePx = GetLogicalPageRect();
99 const VECTOR2D pageSizeIn( (
double) pageSizePx.width / dc->GetPPI().x,
100 (double) pageSizePx.height / dc->GetPPI().y );
103 galPrint->SetSheetSize( pageSizeIn );
106 view->SetPainter( painter.get() );
107 view->SetScaleLimits( 10e9, 0.0001 );
108 view->SetScale( 1.0 );
138 milsToIU( sheetSizeMils.GetHeight() ) );
165 double scaleX = (double) pageSizeIU.x / bBox.
GetWidth();
166 double scaleY = (double) pageSizeIU.y / bBox.
GetHeight();
182 view->UseDrawPriority(
true );
bool m_background
Print background color.
void SetClearColor(const COLOR4D &aColor)
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.
bool m_gerbviewPrint
True if the caller is Gerbview, false for Pcbnew.
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
drawingsheet frame and titleblock
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 void ClearScreen()
Clear the screen.
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.
virtual bool HasNativeLandscapeRotation() const =0
int m_pageCount
Number of pages to print.
void SetIsPrinting(bool isPrinting)
Handle the component boundary box.
void SetZoomFactor(double aZoomFactor)
Set the zoom factor of the scene.
coord_type GetHeight() const
void SetLookAtPoint(const VECTOR2D &aPoint)
Set the Point in world space to look at.
Board print handler definition file.
BOARD_PRINTOUT(const BOARD_PRINTOUT_SETTINGS &aParams, const KIGFX::VIEW *aView, const wxString &aTitle)
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.
#define LAYER_ID_COUNT
Must update this if you add any enums after GerbView!
const wxSize GetSize() const
Abstract interface for drawing on a 2D-surface.