KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcbnew_printout.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 CERN
3 * Copyright (C) 2018-2023 KiCad Developers, see AUTHORS.txt for contributors.
4 *
5 * @author Maciej Suminski <[email protected]>
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef PCBNEW_PRINTOUT_H
22#define PCBNEW_PRINTOUT_H
23
24#include <board_printout.h>
25#include <pcb_painter.h>
26#include <plotprint_opts.h>
27
28class BOARD;
29
31{
32 PCBNEW_PRINTOUT_SETTINGS( const PAGE_INFO& aPageInfo );
33
35
40
43
44 void Load( APP_SETTINGS_BASE* aConfig ) override;
45 void Save( APP_SETTINGS_BASE* aConfig ) override;
46};
47
48
50{
51public:
52 PCBNEW_PRINTOUT( BOARD* aBoard, const PCBNEW_PRINTOUT_SETTINGS& aParams,
53 const KIGFX::VIEW* aView, const wxString& aTitle );
54
55 bool OnPrintPage( int aPage ) override;
56
57protected:
58 int milsToIU( double aMils ) const override;
59
60 void setupViewLayers( KIGFX::VIEW& aView, const LSET& aLayerSet ) override;
61
62 void setupPainter( KIGFX::PAINTER& aPainter ) override;
63
64 void setupGal( KIGFX::GAL* aGal ) override;
65
66 BOX2I getBoundingBox() override;
67
68 std::unique_ptr<KIGFX::PAINTER> getPainter( KIGFX::GAL* aGal ) override;
69
70private:
73};
74
75
76namespace KIGFX {
77
82{
83public:
84 PCB_PRINT_PAINTER( GAL* aGal );
85
93 void SetDrillMarks( bool aRealSize, unsigned int aSize = 0 )
94 {
95 m_drillMarkReal = aRealSize;
96 m_drillMarkSize = aSize;
97 }
98
99protected:
100 int getDrillShape( const PAD* aPad ) const override;
101
102 SHAPE_SEGMENT getPadHoleShape( const PAD* aPad ) const override;
103
104 int getViaDrillSize( const PCB_VIA* aVia ) const override;
105
106protected:
109};
110
111}; // namespace KIGFX
112
113#endif /* PCBNEW_PRINTOUT_H */
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:92
An object derived from wxPrintout to handle the necessary information to control a printer when print...
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:281
Abstract interface for drawing on a 2D-surface.
Contains all the knowledge about how to draw graphical object onto any particular output device.
Definition: painter.h:59
Contains methods for drawing PCB-specific items.
Definition: pcb_painter.h:164
Special flavor of PCB_PAINTER that contains modifications to handle printing options.
void SetDrillMarks(bool aRealSize, unsigned int aSize=0)
Set drill marks visibility and options.
SHAPE_SEGMENT getPadHoleShape(const PAD *aPad) const override
Return hole shape for a pad (internal units).
int getViaDrillSize(const PCB_VIA *aVia) const override
Return drill diameter for a via (internal units).
int m_drillMarkSize
User-specified size (in internal units)
int getDrillShape(const PAD *aPad) const override
Return drill shape of a pad.
bool m_drillMarkReal
Actual hole size or user-specified size for drill marks.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:574
Definition: pad.h:59
Describe the page size and margins of a paper page on which to eventually print or plot.
Definition: page_info.h:59
int milsToIU(double aMils) const override
< Convert mils to internal units
bool OnPrintPage(int aPage) override
std::unique_ptr< KIGFX::PAINTER > getPainter(KIGFX::GAL *aGal) override
Source VIEW object (note that actual printing only refers to this object)
void setupGal(KIGFX::GAL *aGal) override
Returns bounding box of the printed objects (excluding drawing-sheet frame)
PCBNEW_PRINTOUT_SETTINGS m_pcbnewSettings
void setupPainter(KIGFX::PAINTER &aPainter) override
Configures GAL object for a printout.
BOX2I getBoundingBox() override
Returns a PAINTER instance used to draw the items.
void setupViewLayers(KIGFX::VIEW &aView, const LSET &aLayerSet) override
Configures PAINTER object for a printout.
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:247
DRILL_MARKS
Plots and prints can show holes in pads and vias 3 options are available:
enum PCBNEW_PRINTOUT_SETTINGS::PAGINATION_T m_Pagination
bool m_PrintEdgeCutsOnAllPages
Print board outline on each page.
enum DRILL_MARKS m_DrillMarks
bool m_AsItemCheckboxes
Honor checkboxes in the Items tab of the Layers Manager.
void Load(APP_SETTINGS_BASE *aConfig) override
void Save(APP_SETTINGS_BASE *aConfig) override