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 <lset.h>
26#include <pcb_painter.h>
27#include <plotprint_opts.h>
28
29class BOARD;
30
32{
33 PCBNEW_PRINTOUT_SETTINGS( const PAGE_INFO& aPageInfo );
34
36
41
44
45 void Load( APP_SETTINGS_BASE* aConfig ) override;
46 void Save( APP_SETTINGS_BASE* aConfig ) override;
47};
48
49
51{
52public:
53 PCBNEW_PRINTOUT( BOARD* aBoard, const PCBNEW_PRINTOUT_SETTINGS& aParams,
54 const KIGFX::VIEW* aView, const wxString& aTitle );
55
56 bool OnPrintPage( int aPage ) override;
57
58protected:
59 int milsToIU( double aMils ) const override;
60
61 void setupViewLayers( KIGFX::VIEW& aView, const LSET& aLayerSet ) override;
62
63 void setupPainter( KIGFX::PAINTER& aPainter ) override;
64
65 void setupGal( KIGFX::GAL* aGal ) override;
66
67 BOX2I getBoundingBox() override;
68
69 std::unique_ptr<KIGFX::PAINTER> getPainter( KIGFX::GAL* aGal ) override;
70
71private:
74};
75
76
77namespace KIGFX {
78
83{
84public:
85 PCB_PRINT_PAINTER( GAL* aGal );
86
94 void SetDrillMarks( bool aRealSize, unsigned int aSize = 0 )
95 {
96 m_drillMarkReal = aRealSize;
97 m_drillMarkSize = aSize;
98 }
99
100protected:
101 PAD_DRILL_SHAPE getDrillShape( const PAD* aPad ) const override;
102
103 SHAPE_SEGMENT getPadHoleShape( const PAD* aPad ) const override;
104
105 int getViaDrillSize( const PCB_VIA* aVia ) const override;
106
107protected:
110};
111
112}; // namespace KIGFX
113
114#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:289
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:175
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)
PAD_DRILL_SHAPE 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: lset.h:35
Definition: pad.h:54
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
PAD_DRILL_SHAPE
The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
Definition: padstack.h:63
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