63 for(
unsigned layer = 0; layer <
m_LayerSet.size(); ++layer )
70 const KIGFX::VIEW* aView,
const wxString& aTitle ) :
96 std::unique_ptr<KIGFX::PAINTER> painter =
getPainter( gal );
100 wxRect pageSizePx = GetLogicalPageRect();
101 const VECTOR2D pageSizeIn( (
double) pageSizePx.width / dc->GetPPI().x,
102 (
double) pageSizePx.height / dc->GetPPI().y );
105 galPrint->SetSheetSize( pageSizeIn );
108 view->SetPainter( painter.get() );
109 view->SetScaleLimits( 10e9, 0.0001 );
110 view->SetScale( 1.0 );
167 double scaleX = (double) pageSizeIU.
x / drawingAreaBBox.
GetWidth();
168 double scaleY = (double) pageSizeIU.
y / drawingAreaBBox.
GetHeight();
178 gal->
ResizeScreen( pageSizePx.GetWidth(),pageSizePx.GetHeight() );
184 view->UseDrawPriority(
true );
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
BASE_SET & reset(size_t pos)
BASE_SET & set(size_t pos)
virtual void DrawPage(const wxString &aLayerName=wxEmptyString, int aPageNum=1, int aPageCount=1)
Print a page (or a set of pages).
bool m_gerbviewPrint
True if the caller is Gerbview, false for Pcbnew.
virtual void setupPainter(KIGFX::PAINTER &aPainter)
Configures GAL object for a printout.
virtual int milsToIU(double aMils) const =0
< Convert mils to internal units
virtual std::unique_ptr< KIGFX::PAINTER > getPainter(KIGFX::GAL *aGal)=0
Source VIEW object (note that actual printing only refers to this object)
const KIGFX::VIEW * m_view
Printout parameters.
virtual void setupViewLayers(KIGFX::VIEW &aView, const LSET &aLayerSet)
Configures PAINTER object for a printout.
BOARD_PRINTOUT(const BOARD_PRINTOUT_SETTINGS &aParams, const KIGFX::VIEW *aView, const wxString &aTitle)
void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) override
virtual void setupGal(KIGFX::GAL *aGal)
Returns bounding box of the printed objects (excluding drawing-sheet frame)
BOARD_PRINTOUT_SETTINGS m_settings
virtual BOX2I getBoundingBox()=0
Returns a PAINTER instance used to draw the items.
constexpr size_type GetWidth() const
constexpr Vec Centre() const
constexpr size_type GetHeight() const
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
static std::unique_ptr< GAL_PRINT > Create(GAL_DISPLAY_OPTIONS &aOptions, wxDC *aDC)
Abstract interface for drawing on a 2D-surface.
virtual void ResizeScreen(int aWidth, int aHeight)
Resize the canvas.
void SetFlip(bool xAxis, bool yAxis)
Sets flipping of the screen.
void SetZoomFactor(double aZoomFactor)
void SetLookAtPoint(const VECTOR2D &aPoint)
Get/set the Point in world space to look at.
virtual void ClearScreen()
Clear the screen.
void SetClearColor(const COLOR4D &aColor)
Contains all the knowledge about how to draw graphical object onto any particular output device.
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
virtual bool HasNativeLandscapeRotation() const =0
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void SetLayerColor(int aLayer, const COLOR4D &aColor)
Change the color used to draw a layer.
virtual void LoadColors(const COLOR_SETTINGS *aSettings)
void SetPrintLayers(LSET aLayerSet)
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
virtual void SetBackgroundColor(const COLOR4D &aColor)=0
Set the background color.
void SetLayerName(const wxString &aLayerName)
virtual const COLOR4D & GetBackgroundColor() const =0
Return current background color settings.
void SetIsPrinting(bool isPrinting)
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
void SetLayerTarget(int aLayer, RENDER_TARGET aTarget)
Change the rendering target for a particular layer.
void SetLayerVisible(int aLayer, bool aVisible=true)
Control the visibility of a particular layer.
static constexpr int VIEW_MAX_LAYERS
Rendering order modifier for layers that are marked as top layers.
std::unique_ptr< VIEW > DataReference() const
Return a new VIEW object that shares the same set of VIEW_ITEMs and LAYERs.
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.
LSET is a set of PCB_LAYER_IDs.
Describe the page size and margins of a paper page on which to eventually print or plot.
const VECTOR2D & GetSizeMils() const
#define LAYER_ID_COUNT
Must update this if you add any enums after GerbView!
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
@ TARGET_NONCACHED
Auxiliary rendering target (noncached)
std::vector< int > layers
List of enabled layers for printing.
void Load(APP_SETTINGS_BASE *aConfig) override
BOARD_PRINTOUT_SETTINGS(const PAGE_INFO &aPageInfo)
LSET m_LayerSet
Layers to print.
void Save(APP_SETTINGS_BASE *aConfig) override
bool m_Mirror
Print mirrored.
Handle the parameters used to print a board drawing.
bool PrintBorderAndTitleBlock() const
Returns true if the drawing border and title block should be printed.
COLOR_SETTINGS * m_colorSettings
The color settings to be used for printing.
virtual void Save(APP_SETTINGS_BASE *aConfig)
bool m_blackWhite
Print in B&W or Color.
int m_pageCount
Number of pages to print.
const PAGE_INFO & m_pageInfo
bool m_background
Print background color.
virtual void Load(APP_SETTINGS_BASE *aConfig)
double m_scale
Printing scale.
VECTOR2< int32_t > VECTOR2I